[FFmpeg-devel] [PATCH] lavfi: port mcdeint filter from libmpcodecs
Stefano Sabatini
stefasab at gmail.com
Fri May 31 18:47:32 CEST 2013
On date Thursday 2013-05-30 15:36:08 +0200, Stefano Sabatini encoded:
[...]
> Updated mcdeint patch. I tracked the inconsistent output to
> uninitialiazed buffer reading which happens in the CHECK(j) macro:
>
> #define CHECK(j)\
> { int score = FFABS(srcp[-srcs-1+(j)] - srcp[+srcs-1-(j)]) +\
> FFABS(srcp[-srcs +(j)] - srcp[+srcs -(j)]) +\
> FFABS(srcp[-srcs+1+(j)] - srcp[+srcs+1-(j)]);\
> if (score < spatial_score) {\
> spatial_score = score;\
> diff0 = filp[-fils+(j)] - srcp[-srcs+(j)];\
> diff1 = filp[+fils-(j)] - srcp[+srcs-(j)];
>
> which is reading padded data if x<2 && x>=w-2, and out-of-buffer data
> in case x=2 and y=1 or x=w-3 and y=h-1.
>
> A possible way to fix it would be to change:
> - if((x-2)+(y-1)*w>=0 && (x+2)+(y+1)*w<w*h){ //FIXME either alloc larger images or optimize this
> + if(y>0 && y<h-1 && x>2 && x<w-3){
>
> but Michael suggested to adopt the same logic used in yadif. I suspend
> my port of mcdeint until the problem is fixed in libmpcodecs.
>
> Note: CHECK(j) macro restored to initial form for consistency with
> yadif code.
Patch update mirroring the same fix in the mp/mcdeint patch. Now
mcdeint and mp=mcdeint are bit-exact equivalent, and native mcdeint
performs faster.
I'll push the port and drop the wrapper at the same time as the
mcdeint fix is approved&committed.
--
FFmpeg = Freak & Fast Multipurpose Perfectionist Elected Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavfi-port-mcdeint-filter-from-libmpcodecs.patch
Type: text/x-diff
Size: 15188 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130531/2a0581b9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-tests-add-mcdeint-tests.patch
Type: text/x-diff
Size: 5705 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130531/2a0581b9/attachment-0001.bin>
More information about the ffmpeg-devel
mailing list