changeset 7444:a9da32d66fec libavcodec

Small h264 decoding speed optimization: while->do/while
author darkshikari
date Mon, 28 Jul 2008 15:42:49 +0000
parents a8b985890c34
children a202753ce99d
files h264.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Mon Jul 28 10:49:44 2008 +0000
+++ b/h264.c	Mon Jul 28 15:42:49 2008 +0000
@@ -5356,10 +5356,10 @@
         }
     }
 
-    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 @@
                 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       ;