[Ffmpeg-devel] [Ffmpeg-devel-old] [patch] bug fix in mc_block

Yartrebo yartrebo
Sat Apr 16 22:55:31 CEST 2005

I've noticed that mc_block does not clip values to the 0-255 range but
instead allows wrap around. For a normal non-animated and clean source
file (coast_guard_cif), the bitrate loss is about .2% (coming only from
edge motion blocks).

The worst case I could find was using mc_block for all blocks, and using
my Caillou clip [cartoon with about half of an average frame being
white]. The bug caused a bitrate bloat of about 225%!!! Not only that,
but psnr was reduced by about 1.00.

By not clipping values, they can sometimes overflow or underflow, which
completely ruins motion compensation for that block.

This is probably why my 'simple' linear interpolation algorithm worked
so well before, since linear interpolation cannot cause overflow even
without clipping.

My attached patch fixes the overflow bug.

I'm also attaching a patch for AUTHORS, since I neglected to send such a
file for my previous patches.

Robert Edele

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snow_mc_block_bug_fix.patch
Type: text/x-patch
Size: 1761 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050416/5f5dd631/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: authors_robert.patch
Type: text/x-patch
Size: 546 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050416/5f5dd631/attachment-0001.bin>

More information about the ffmpeg-devel mailing list