[FFmpeg-cvslog] r14459 - trunk/libavcodec/h264.c

darkshikari subversion
Mon Jul 28 17:42:50 CEST 2008


Author: darkshikari
Date: Mon Jul 28 17:42:49 2008
New Revision: 14459

Log:
Small h264 decoding speed optimization: while->do/while

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Mon Jul 28 17:42:49 2008
@@ -5356,10 +5356,10 @@ static av_always_inline void decode_caba
         }
     }
 
-    while( coeff_count-- ) {
+    do {
         uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base;
 
-        int j= scantable[index[coeff_count]];
+        int j= scantable[index[--coeff_count]];
 
         if( get_cabac( CC, ctx ) == 0 ) {
             node_ctx = coeff_abs_level_transition[0][node_ctx];
@@ -5396,7 +5396,7 @@ static av_always_inline void decode_caba
                 block[j] = (get_cabac_bypass_sign( CC, -coeff_abs ) * qmul[j] + 32) >> 6;
             }
         }
-    }
+    } while( coeff_count );
 #ifdef CABAC_ON_STACK
             h->cabac.range     = cc.range     ;
             h->cabac.low       = cc.low       ;




More information about the ffmpeg-cvslog mailing list