shithub: libvpx

Download patch

ref: 8394f1a015a5d203b15c9427a6814f0d1f415be7
parent: ad6ed536d5084a5839a57f8c02b73a5acc010b95
parent: aeb603f2afc7a357f364d415abd520ff5e27501e
author: Dmitry Kovalev <[email protected]>
date: Thu Oct 3 07:06:29 EDT 2013

Merge "Making decode_modes_b function more straightforward."

--- a/vp9/common/vp9_pred_common.c
+++ b/vp9/common/vp9_pred_common.c
@@ -392,11 +392,6 @@
   xd->this_mi->mbmi.seg_id_predicted = pred_flag;
 }
 
-void vp9_set_pred_flag_mbskip(MACROBLOCKD *xd, BLOCK_SIZE bsize,
-                              uint8_t pred_flag) {
-  xd->this_mi->mbmi.skip_coeff = pred_flag;
-}
-
 int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
                        BLOCK_SIZE bsize, int mi_row, int mi_col) {
   const int mi_offset = mi_row * cm->mi_cols + mi_col;
--- a/vp9/common/vp9_pred_common.h
+++ b/vp9/common/vp9_pred_common.h
@@ -52,9 +52,6 @@
   return xd->this_mi->mbmi.skip_coeff;
 }
 
-void vp9_set_pred_flag_mbskip(MACROBLOCKD *xd, BLOCK_SIZE bsize,
-                              uint8_t pred_flag);
-
 unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
 
 unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd);
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -231,6 +231,7 @@
   MACROBLOCKD *const xd = &pbi->mb;
   const int less8x8 = bsize < BLOCK_8X8;
   MB_MODE_INFO *mbmi;
+  int eobtotal;
 
   if (less8x8)
     if (xd->ab_index > 0)
@@ -244,15 +245,21 @@
 
   // Has to be called after set_offsets
   mbmi = &xd->this_mi->mbmi;
+  eobtotal = decode_tokens(pbi, bsize, r);
 
   if (!is_inter_block(mbmi)) {
     // Intra reconstruction
-    decode_tokens(pbi, bsize, r);
     foreach_transformed_block(xd, bsize, decode_block_intra, xd);
   } else {
     // Inter reconstruction
-    int eobtotal;
+    const int decode_blocks = (eobtotal > 0);
 
+    if (!less8x8) {
+      assert(mbmi->sb_type == bsize);
+      if (eobtotal == 0)
+        mbmi->skip_coeff = 1; // skip loopfilter
+    }
+
     set_ref(pbi, 0, mi_row, mi_col);
     if (has_second_ref(mbmi))
       set_ref(pbi, 1, mi_row, mi_col);
@@ -259,18 +266,9 @@
 
     vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
     vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
-    eobtotal = decode_tokens(pbi, bsize, r);
-    if (less8x8) {
-      if (eobtotal >= 0)
-        foreach_transformed_block(xd, bsize, decode_block, xd);
-    } else {
-      assert(mbmi->sb_type == bsize);
-      if (eobtotal == 0)
-        // skip loopfilter
-        vp9_set_pred_flag_mbskip(xd, bsize, 1);
-      else if (eobtotal > 0)
-        foreach_transformed_block(xd, bsize, decode_block, xd);
-    }
+
+    if (decode_blocks)
+      foreach_transformed_block(xd, bsize, decode_block, xd);
   }
   xd->corrupted |= vp9_reader_has_error(r);
 }