simplify escape decoding
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Oct 2006 16:19:15 +0000 (16:19 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Oct 2006 16:19:15 +0000 (16:19 +0000)
Originally committed as revision 6685 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.c

index 59a5b1f..37e373f 100644 (file)
@@ -6164,14 +6164,14 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n
             if( coeff_abs >= 15 ) {
                 int j = 0;
                 while( get_cabac_bypass( &h->cabac ) ) {
-                    coeff_abs += 1 << j;
                     j++;
                 }
 
+                coeff_abs=1;
                 while( j-- ) {
-                    if( get_cabac_bypass( &h->cabac ) )
-                        coeff_abs += 1 << j ;
+                    coeff_abs += coeff_abs + get_cabac_bypass( &h->cabac );
                 }
+                coeff_abs+= 14;
             }
 
             if( !qmul ) {