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

Michael Niedermayer michaelni
Sun Feb 26 12:47:12 CET 2006


Hi

On Sun, Feb 26, 2006 at 12:52:28AM -0500, Dan Maas wrote:
> > btw, isnt
> > b->prev[a2] = prev;
> > enough? (i mean no for(; (b->prev[a2]==k) && (a2<4); a2++)) ?
> 
> I'm not 100% sure, but I couldn't convince myself that the for() is
> unnecessary, so I left it in for safety... Imagine a block where areas
> 1, 2, and 3 are already all zero, and area 0 just got zeroed out. If
> we adjust b->prev[1] then we must also adjust b->prev[2] and
> b->prev[3], otherwise the standard loop iteration pattern won't work:
> 
> for (a=0; a<4; a++) {
>    prev = b->prev[a];
>    ...
> 
> (since b->mb[prev] might be zero now)

there are 2 things you are missing
1. if areas 1,2,3 are zero and 0 gets zeroed, none of this code will be 
   executed due to the b->next[k]<64 check
2. prev = b->prev[a]; is "wrong" but the value isnt used as 
   b->next[prev] should be >= mb_area_start[a+1]

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list