]> granicus.if.org Git - libvpx/commitdiff
Force interleaved decoding
authorJohn Koleszar <jkoleszar@google.com>
Tue, 16 Oct 2012 21:08:40 +0000 (14:08 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Tue, 16 Oct 2012 21:08:40 +0000 (14:08 -0700)
Rather than decoding all modes/mvs separately, decode them per MB. This
forces the mode which was already used form the CONFIG_NEWBESTREFMV and
CONFIG_SUPERBLOCKS experiments, and is a precursor to changing to
interleaved encoding.

Change-Id: If19ee74ac8a987846d1cd0cf2b2e02a82f1a43ad

vp8/decoder/decodemv.c
vp8/decoder/decodemv.h
vp8/decoder/decodframe.c
vp8/decoder/onyxd_if.c
vp8/decoder/onyxd_int.h

index fa15af9e9ad85494cf5197191bf8e60c9c01d93c..4408ae7f91fcab21701d03eacf799427b3f7d983 100644 (file)
@@ -1302,91 +1302,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
   }
 }
 
-void vp8_decode_mode_mvs(VP8D_COMP *pbi) {
-  int i;
-  VP8_COMMON *cm = &pbi->common;
-  MODE_INFO *mi = cm->mi;
-  MACROBLOCKD *const xd  = &pbi->mb;
-  int sb_row, sb_col;
-  int sb_rows = (cm->mb_rows + 1) >> 1;
-  int sb_cols = (cm->mb_cols + 1) >> 1;
-  int row_delta[4] = { 0, +1,  0, -1};
-  int col_delta[4] = { +1, -1, +1, +1};
-
-  MODE_INFO *prev_mi = cm->prev_mi;
-
-  mb_mode_mv_init(pbi);
-
-  if (cm->frame_type == KEY_FRAME && !cm->kf_ymode_probs_update) {
-    cm->kf_ymode_probs_index = vp8_read_literal(&pbi->bc, 3);
-  }
-
-  for (sb_row = 0; sb_row < sb_rows; sb_row++) {
-    int mb_col = 0;
-    int mb_row = (sb_row << 1);
-
-    for (sb_col = 0; sb_col < sb_cols; sb_col++) {
-#if CONFIG_SUPERBLOCKS
-      mi->mbmi.encoded_as_sb = vp8_read(&pbi->bc, cm->sb_coded);
-#endif
-      for (i = 0; i < 4; i++) {
-
-        int dy = row_delta[i];
-        int dx = col_delta[i];
-        int offset_extended = dy * cm->mode_info_stride + dx;
-
-        if ((mb_row >= cm->mb_rows) || (mb_col >= cm->mb_cols)) {
-          /* next macroblock */
-          mb_row += dy;
-          mb_col += dx;
-          mi += offset_extended;
-          prev_mi += offset_extended;
-          continue;
-        }
-#if CONFIG_SUPERBLOCKS
-        if (i)
-          mi->mbmi.encoded_as_sb = 0;
-#endif
-
-        // Make sure the MacroBlockD mode info pointer is set correctly
-        xd->mode_info_context = mi;
-        xd->prev_mode_info_context = prev_mi;
-
-        pbi->mb.mb_to_top_edge = -((mb_row * 16)) << 3;
-        pbi->mb.mb_to_bottom_edge =
-            ((pbi->common.mb_rows - 1 - mb_row) * 16) << 3;
-
-        if (cm->frame_type == KEY_FRAME)
-          vp8_kfread_modes(pbi, mi, mb_row, mb_col);
-        else
-          read_mb_modes_mv(pbi, mi, &mi->mbmi, prev_mi, mb_row,
-                           mb_col);
-
-#if CONFIG_SUPERBLOCKS
-        if (mi->mbmi.encoded_as_sb) {
-          assert(!i);
-          mb_col += 2;
-          mi[1] = mi[cm->mode_info_stride] =
-            mi[cm->mode_info_stride + 1] = mi[0];
-          mi += 2;
-          prev_mi += 2;
-          break;
-        }
-#endif
-
-        /* next macroblock */
-        mb_row += dy;
-        mb_col += dx;
-        mi += offset_extended;
-        prev_mi += offset_extended;
-      }
-    }
-
-    mi += cm->mode_info_stride + (1 - (cm->mb_cols & 0x1));
-    prev_mi += cm->mode_info_stride + (1 - (cm->mb_cols & 0x1));
-  }
-}
-
 void vpx_decode_mode_mvs_init(VP8D_COMP *pbi){
   VP8_COMMON *cm = &pbi->common;
   mb_mode_mv_init(pbi);
index 17bbb5b674f997ceae20fda2fdbe6191b55089cf..9629f952bee2d27fc9d4a48b5f1d3ba34a8d1641 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "onyxd_int.h"
 
-void vp8_decode_mode_mvs(VP8D_COMP *);
 void vpx_decode_mb_mode_mv(VP8D_COMP *pbi,
                            MACROBLOCKD *xd,
                            int mb_row,
index c46957202a2f94631c189322076e03d37a50cf04..bcf6ea3d4f029703d4ac4b2a004c74050e36f414 100644 (file)
@@ -635,8 +635,7 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
     MODE_INFO *mi = xd->mode_info_context;
 
 #if CONFIG_SUPERBLOCKS
-    if (pbi->interleaved_decoding)
-      mi->mbmi.encoded_as_sb = vp8_read(&pbi->bc, pc->sb_coded);
+    mi->mbmi.encoded_as_sb = vp8_read(&pbi->bc, pc->sb_coded);
 #endif
 
     // Process the 4 MBs within the SB in the order:
@@ -685,8 +684,7 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
       if (i)
         mi->mbmi.encoded_as_sb = 0;
 #endif
-      if(pbi->interleaved_decoding)
-        vpx_decode_mb_mode_mv(pbi, xd, mb_row, mb_col);
+      vpx_decode_mb_mode_mv(pbi, xd, mb_row, mb_col);
 
       update_blockd_bmi(xd);
 
@@ -1510,10 +1508,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
   /* Read the mb_no_coeff_skip flag */
   pc->mb_no_coeff_skip = (int)vp8_read_bit(bc);
 
-  if(pbi->interleaved_decoding)
-    vpx_decode_mode_mvs_init(pbi);
-  else
-    vp8_decode_mode_mvs(pbi);
+  vpx_decode_mode_mvs_init(pbi);
 
   vpx_memset(pc->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * pc->mb_cols);
 
index aa3ef81b38168340dccd85182e846427355005af..2e7751325d3bcf945138dd683ba0c277d5cf5088 100644 (file)
@@ -149,8 +149,6 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf) {
 
   pbi->decoded_key_frame = 0;
 
-  pbi->interleaved_decoding = CONFIG_NEWBESTREFMV || CONFIG_SUPERBLOCKS;
-
   return (VP8D_PTR) pbi;
 }
 
index 53350b81937cc9479ee2ffae7f6748b46225b8d2..b757f77645be7825769a985897aa56c4142db669 100644 (file)
@@ -82,8 +82,6 @@ typedef struct VP8Decompressor {
 
   int decoded_key_frame;
 
-  int interleaved_decoding;
-
 } VP8D_COMP;
 
 int vp8_decode_frame(VP8D_COMP *cpi);