Moved skip_true_count to macroblock struct
authorScott LaVarnway <slavarnway@google.com>
Sat, 3 Nov 2012 01:03:03 +0000 (18:03 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Mon, 5 Nov 2012 19:02:35 +0000 (11:02 -0800)
Change-Id: Ie9a26be7c9baa54a0e43a63ed6c77f2746477a9c

vp8/encoder/bitstream.c
vp8/encoder/block.h
vp8/encoder/encodeframe.c
vp8/encoder/ethreading.c
vp8/encoder/onyx_int.h
vp8/encoder/tokenize.c

index cc8f439..7ab6dc9 100644 (file)
@@ -539,7 +539,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
     {
         int total_mbs = pc->mb_rows * pc->mb_cols;
 
-        prob_skip_false = (total_mbs - cpi->skip_true_count ) * 256 / total_mbs;
+        prob_skip_false = (total_mbs - cpi->mb.skip_true_count ) * 256 / total_mbs;
 
         if (prob_skip_false <= 1)
             prob_skip_false = 1;
@@ -730,7 +730,7 @@ static void write_kfmodes(VP8_COMP *cpi)
     {
         int total_mbs = c->mb_rows * c->mb_cols;
 
-        prob_skip_false = (total_mbs - cpi->skip_true_count ) * 256 / total_mbs;
+        prob_skip_false = (total_mbs - cpi->mb.skip_true_count ) * 256 / total_mbs;
 
         if (prob_skip_false <= 1)
             prob_skip_false = 1;
index ec316ea..e6228ec 100644 (file)
@@ -127,6 +127,7 @@ typedef struct macroblock
     unsigned char need_to_clamp_best_mvs;
 #endif
 
+    int skip_true_count;
     unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
 
 
index e3e7d9d..d580d89 100644 (file)
@@ -751,7 +751,7 @@ void vp8_encode_frame(VP8_COMP *cpi)
 
     cpi->prediction_error = 0;
     cpi->intra_error = 0;
-    cpi->skip_true_count = 0;
+    cpi->mb.skip_true_count = 0;
     cpi->tok_count = 0;
 
 #if 0
@@ -869,6 +869,8 @@ void vp8_encode_frame(VP8_COMP *cpi)
             {
                 totalrate += cpi->mb_row_ei[i].totalrate;
 
+                cpi->mb.skip_true_count += cpi->mb_row_ei[i].mb.skip_true_count;
+
                 /* add up counts for each thread */
                 sum_coef_counts(x, &cpi->mb_row_ei[i].mb);
             }
@@ -1356,7 +1358,7 @@ int vp8cx_encode_inter_macroblock
 
         if (cpi->common.mb_no_coeff_skip)
         {
-            cpi->skip_true_count ++;
+            x->skip_true_count ++;
             vp8_fix_contexts(xd);
         }
         else
index fc47248..9b7805e 100644 (file)
@@ -473,6 +473,7 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi,
             mbd->fullpixel_mask = 0xfffffff8;
 
         vp8_zero(mb->coef_counts);
+        mb->skip_true_count = 0;
     }
 }
 
index 72d96b5..7cea725 100644 (file)
@@ -518,7 +518,6 @@ typedef struct VP8_COMP
     int lf_zeromv_pct;
     int gf_bad_count;
     int gf_update_recommended;
-    int skip_true_count;
 
     unsigned char *segmentation_map;
     signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS];
index 90463ef..3b5268b 100644 (file)
@@ -396,7 +396,7 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t)
         else
         {
             vp8_fix_contexts(xd);
-            cpi->skip_true_count++;
+            x->skip_true_count++;
         }
 
         return;