[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec dv.c,1.75,1.76
Michael Niedermayer CVS
michael
Sat Feb 25 23:58:28 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv31742/libavcodec
Modified Files:
dv.c
Log Message:
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.
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.
this also might fix the ppc regression failure?
patch by (Dan Maas <dmaas maasdigital com>)
Index: dv.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dv.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- dv.c 24 Feb 2006 09:16:26 -0000 1.75
+++ dv.c 25 Feb 2006 22:58:25 -0000 1.76
@@ -731,7 +731,7 @@
int i, j, k, a, prev, a2;
EncBlockInfo* b;
- size[4]= 1<<24;
+ size[0] = size[1] = size[2] = size[3] = size[4] = 1<<24;
do {
b = blks;
for (i=0; i<5; i++) {
@@ -753,11 +753,14 @@
prev= k;
} else {
if(b->next[k] >= mb_area_start[a+1] && b->next[k]<64){
- for(a2=a+1; b->next[k] >= mb_area_start[a2+1]; a2++);
+ for(a2=a+1; b->next[k] >= mb_area_start[a2+1]; a2++)
+ b->prev[a2] = prev;
assert(a2<4);
assert(b->mb[b->next[k]]);
b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
-dv_rl2vlc_size(b->next[k] - k - 1, b->mb[b->next[k]]);
+ for(; (b->prev[a2]==k) && (a2<4); a2++)
+ b->prev[a2] = prev;
}
b->next[prev] = b->next[k];
}
More information about the ffmpeg-cvslog
mailing list