summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-10-16 14:08:40 -0700
committerJohn Koleszar <jkoleszar@google.com>2012-10-16 14:08:40 -0700
commitc073e5ca96bc5cf2e20c1c6cbc000be025b2e008 (patch)
tree30bfe38d15a0825b8bb88a78b7fd1b9fa87bc975
parent9443f05e6b10c2f4de9d21a77df2108dd829529b (diff)
downloadlibvpx-c073e5ca96bc5cf2e20c1c6cbc000be025b2e008.tar
libvpx-c073e5ca96bc5cf2e20c1c6cbc000be025b2e008.tar.gz
libvpx-c073e5ca96bc5cf2e20c1c6cbc000be025b2e008.tar.bz2
libvpx-c073e5ca96bc5cf2e20c1c6cbc000be025b2e008.zip
Force interleaved decoding
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
-rw-r--r--vp8/decoder/decodemv.c85
-rw-r--r--vp8/decoder/decodemv.h1
-rw-r--r--vp8/decoder/decodframe.c11
-rw-r--r--vp8/decoder/onyxd_if.c2
-rw-r--r--vp8/decoder/onyxd_int.h2
5 files changed, 3 insertions, 98 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index fa15af9e9..4408ae7f9 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -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);
diff --git a/vp8/decoder/decodemv.h b/vp8/decoder/decodemv.h
index 17bbb5b67..9629f952b 100644
--- a/vp8/decoder/decodemv.h
+++ b/vp8/decoder/decodemv.h
@@ -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,
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index c46957202..bcf6ea3d4 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -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);
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index aa3ef81b3..2e7751325 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -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;
}
diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h
index 53350b819..b757f7764 100644
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -82,8 +82,6 @@ typedef struct VP8Decompressor {
int decoded_key_frame;
- int interleaved_decoding;
-
} VP8D_COMP;
int vp8_decode_frame(VP8D_COMP *cpi);