[FFmpeg-devel] [PATCH] lavfi/mp/mcdeint: avoid uninited data read

Stefano Sabatini stefasab at gmail.com
Fri May 31 01:39:40 CEST 2013


On date Thursday 2013-05-30 23:30:35 +0200, Michael Niedermayer encoded:
> On Thu, May 30, 2013 at 06:57:14PM +0200, Stefano Sabatini wrote:
> > Always read in-buffer pixels when computing the value for a pixel close
> > to the image buffer edge.
> > 
> > This avoids non visible artifacts which affect the output checksum.
> > ---
> >  libavfilter/libmpcodecs/vf_mcdeint.c |   32 +++++++++++++++++++++++---------
> >  1 file changed, 23 insertions(+), 9 deletions(-)
> 
> should be ok if theres no slowdown,

$ ffmpeg  -f lavfi -i "testsrc=d=100,mp=mcdeint" -f null - -benchmark -nostats
[...]
1547 decicycles in before, 65534 runs, 2 skips
1543 decicycles in before, 131070 runs, 2 skips
1547 decicycles in before, 262140 runs, 4 skips
1545 decicycles in before, 524281 runs, 7 skips
1544 decicycles in before, 1048559 runs, 17 skips
1542 decicycles in before, 2097112 runs, 40 skips
1540 decicycles in before, 4194227 runs, 77 skips
1539 decicycles in before, 8388462 runs, 146 skips
1539 decicycles in before, 16776934 runs, 282 skips
1539 decicycles in before, 33553858 runs, 574 skips
1542 decicycles in before, 67107653 runs, 1211 skips
1542 decicycles in before, 134214492 runs, 3236 skips
frame= 2500 fps= 79 q=0.0 Lsize=N/A time=00:01:40.00 bitrate=N/A    
video:234kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.009167%
bench: utime=31.610s
bench: maxrss=22324kB

$ ffmpeg  -f lavfi -i "testsrc=d=100,mp=mcdeint" -f null - -benchmark -nostats
[...]
1607 decicycles in after, 65533 runs, 3 skips
1597 decicycles in after, 131067 runs, 5 skips
1594 decicycles in after, 262136 runs, 8 skips
1594 decicycles in after, 524268 runs, 20 skips
1589 decicycles in after, 1048540 runs, 36 skips
1587 decicycles in after, 2097095 runs, 57 skips
1585 decicycles in after, 4194211 runs, 93 skips
1584 decicycles in after, 8388443 runs, 165 skips
1583 decicycles in after, 16776903 runs, 313 skips
1584 decicycles in after, 33553812 runs, 620 skips
1583 decicycles in after, 67107632 runs, 1232 skips
1583 decicycles in after, 134215301 runs, 2427 skips
frame= 2500 fps= 79 q=0.0 Lsize=N/A time=00:01:40.00 bitrate=N/A    
video:234kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.009167%
bench: utime=31.662s
bench: maxrss=22296kB

This is as fast as I can get it. I could eventually add a
fast/non-bitexact option to keep the current speed, but seems a bit
overkill.

> note please make sure libmpcodecs doesnt diverge from mplayer, that is
> this should be submitted / commited to mplayer too if its applied
> to ffmpegs libmpcodecs

I don't volunteer for this but hopefully some MPlayer devs on list can
help with this after the patch is committed to FFmpeg.
-- 
FFmpeg = Fabulous Frightening Mysterious Perfectionist Exciting Governor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavfi-mp-mcdeint-add-timers.patch
Type: text/x-diff
Size: 1520 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130531/c16abdca/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-lavfi-mp-mcdeint-avoid-uninited-data-read.patch
Type: text/x-diff
Size: 3982 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130531/c16abdca/attachment-0001.bin>


More information about the ffmpeg-devel mailing list