changeset 8385:af35581ac2ca libavcodec

Replace i by trailing_ones, part of a patch by dark shikari. No speed change meassureable with START/STOP_TIMER, but this is needed for future optimizations.
author michael
date Thu, 18 Dec 2008 15:51:32 +0000
parents 9754fef77769
children 102b197185d1
files h264.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Thu Dec 18 15:32:07 2008 +0000
+++ b/h264.c	Thu Dec 18 15:51:32 2008 +0000
@@ -4091,7 +4091,7 @@
         level[i]= 1 - 2*get_bits1(gb);
     }
 
-    if(i<total_coeff) {
+    if(trailing_ones<total_coeff) {
         int level_code, mask;
         int suffix_length = total_coeff > 10 && trailing_ones < 3;
         int prefix= get_level_prefix(gb);
@@ -4120,11 +4120,10 @@
         if(level_code > 5)
             suffix_length++;
         mask= -(level_code&1);
-        level[i]= (((2+level_code)>>1) ^ mask) - mask;
-        i++;
+        level[trailing_ones]= (((2+level_code)>>1) ^ mask) - mask;
 
         //remaining coefficients have suffix_length > 0
-        for(;i<total_coeff;i++) {
+        for(i=trailing_ones+1;i<total_coeff;i++) {
             static const int suffix_limit[7] = {0,5,11,23,47,95,INT_MAX };
             prefix = get_level_prefix(gb);
             if(prefix<15){