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>)

Originally committed as revision 5064 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Dan Maas 2006-02-25 22:58:26 +00:00 committed by Michael Niedermayer
parent 1bd8624697
commit 6df5f6ae51
3 changed files with 8 additions and 5 deletions

View File

@ -731,7 +731,7 @@ static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
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 @@ static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
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];
}

View File

@ -133,9 +133,9 @@ stddev: 23.20 PSNR:20.81 bytes:7602176
3533710 ./data/a-snow53.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
229e5f8d1f386d0cf84f629be7d74955 *./data/a-dv.dv
a071e3aa523e0f91fce08bdba0d47199 *./data/a-dv.dv
7200000 ./data/a-dv.dv
0ac51c62d3c2a4bacf216ea73050485e *./data/out.yuv
a99de8648a78970065b834219d9fa27a *./data/out.yuv
stddev: 9.10 PSNR:28.94 bytes:7602176
bd0db310a36ad94bcd4448abe0a88368 *./data/a-svq1.mov
1379827 ./data/a-svq1.mov

View File

@ -28,7 +28,7 @@ e4ed8d635d867e2f5980fd9c73c9cf3d *./data/b-libav.mov
8bf16d40a2ec19fa36b124a928e47e23 *./data/b-libav.nut
332358 ./data/b-libav.nut
./data/b-libav.nut CRC=0xccab3a27
973886f2acd79e6785e0f31519d721cf *./data/b-libav.dv
5a040cc1353f17f6a7305e972c0667d0 *./data/b-libav.dv
3600000 ./data/b-libav.dv
./data/b-libav.dv CRC=0x5e1f4cdc
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm