[Ffmpeg-devel] improved [PATCH] fix DV encoder VLC bit accounting

Michael Niedermayer michaelni
Sun Feb 26 00:03:15 CET 2006


On Sat, Feb 25, 2006 at 01:43:37PM -0500, Dan Maas wrote:
> Hi Michael - I like your version of the dv_guess_qnos() fix, it's a
> lot simpler. However, it is not quite correct (it triggers asserts and
> AC overflows on my test video). The attached patch fixes two things:

i knew the asserts would be valuable :)

> 1. size[0-3] are not initialized (and can get random negative trash
> values), so the comparison with vs_total_ac_bits is messed up on the
> first couple loop iterations, leading to AC underflows.
> 2. the b->prev[] pointers were not being maintained correctly. We
> potentially have to update b->prev[] both before and after the area
> whose VLC length is getting adjusted.
> With this patch, I no longer get any asserts or AC overflows.


btw, isnt
b->prev[a2] = prev;
enough? (i mean no for(; (b->prev[a2]==k) && (a2<4); a2++)) ?

and next time, please update the regression test checksums too when they
change through your patch ...



More information about the ffmpeg-devel mailing list