Revision d2d230a7

View differences:

libavcodec/dv.c
728 728
static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
729 729
{
730 730
    int size[5];
731
    int i, j, k, a, prev;
731
    int i, j, k, a, prev, a2;
732 732
    EncBlockInfo* b;
733 733

  
734 734
    do {
......
751 751
                           b->bit_size[a] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
752 752
                           prev= k;
753 753
                       } else {
754
                           if(b->next[k] >= mb_area_start[a+1] && b->next[k]<64){
755
                                for(a2=a+1; b->next[k] >= mb_area_start[a2+1]; a2++);
756
                                assert(a2<4);
757
                                assert(b->mb[b->next[k]]);
758
                                b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
759
                                                  -dv_rl2vlc_size(b->next[k] -    k - 1, b->mb[b->next[k]]);
760
                           }
754 761
                           b->next[prev] = b->next[k];
755 762
                       }
756 763
                    }
......
760 767
             }
761 768
          }
762 769
       }
763
    } while ((vs_total_ac_bits < size[0] + size[1] + size[2] + size[3] + size[4]) &&
764
             (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]));
770
       if(vs_total_ac_bits >= size[0] + size[1] + size[2] + size[3] + size[4])
771
            return;
772
    } while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
773

  
774

  
775
    for(a=2; a==2 || vs_total_ac_bits < size[0]; a+=a){
776
        b = blks;
777
        size[0] = 0;
778
        for (j=0; j<6*5; j++, b++) {
779
            prev= b->prev[0];
780
            for (k= b->next[prev]; k<64; k= b->next[k]) {
781
                if(b->mb[k] < a && b->mb[k] > -a){
782
                    b->next[prev] = b->next[k];
783
                }else{
784
                    size[0] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
785
                    prev= k;
786
                }
787
            }
788
        }
789
    }
765 790
}
766 791

  
767 792
/*
tests/ffmpeg.regression.ref
133 133
3533710 ./data/a-snow53.avi
134 134
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
135 135
stddev:  0.00 PSNR:99.99 bytes:7602176
136
e1da20e3f52f4d2aa18e9486986161fc *./data/a-dv.dv
136
4e6e84ebab4eef5a9d7171cfd687d4cd *./data/a-dv.dv
137 137
7200000 ./data/a-dv.dv
138
55612d1a7246c82a32414638d601ac95 *./data/out.yuv
139
stddev:  9.15 PSNR:28.88 bytes:7602176
138
70c5b0eb61f16b7cd7328b4aca57a4e2 *./data/out.yuv
139
stddev:  9.16 PSNR:28.88 bytes:7602176
140 140
bd0db310a36ad94bcd4448abe0a88368 *./data/a-svq1.mov
141 141
1379827 ./data/a-svq1.mov
142 142
bbff871d1475e1eee4231a08e075de2c *./data/out.yuv
tests/libav.regression.ref
28 28
8bf16d40a2ec19fa36b124a928e47e23 *./data/b-libav.nut
29 29
 332358 ./data/b-libav.nut
30 30
./data/b-libav.nut CRC=0xccab3a27
31
b466c970d54eb254ad0f954b08535634 *./data/b-libav.dv
31
9317bd7830cbc8d660cb7b8f5b949ac2 *./data/b-libav.dv
32 32
3600000 ./data/b-libav.dv
33
./data/b-libav.dv CRC=0xc5215996
33
./data/b-libav.dv CRC=0xedf45b11
34 34
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm
35 35
 317075 ./data/b-libav.pbm
36 36
./data/b-libav.pbm CRC=0xb92906cb
tests/rotozoom.regression.ref
133 133
2725570 ./data/a-snow53.avi
134 134
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
135 135
stddev:  0.00 PSNR:99.99 bytes:7602176
136
a553532dcd54c1c421b52c3b6fece6ef *./data/a-dv.dv
136
b829649260346655ad2c820ab56edeb3 *./data/a-dv.dv
137 137
7200000 ./data/a-dv.dv
138
1a1717b271a7536d641d5e1750d852d9 *./data/out.yuv
138
ecf8fde289dd44819493844e95057a6a *./data/out.yuv
139 139
stddev:  3.16 PSNR:38.12 bytes:7602176
140 140
5b02b6ae7ffa257a66ae9857a992fdfe *./data/a-svq1.mov
141 141
769527 ./data/a-svq1.mov

Also available in: Unified diff