summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
Diffstat (limited to 'vp8')
-rw-r--r--vp8/decoder/decodemv.c28
-rw-r--r--vp8/decoder/decodframe.c13
-rw-r--r--vp8/decoder/onyxd_if.c2
-rw-r--r--vp8/decoder/onyxd_int.h2
4 files changed, 37 insertions, 8 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index 072734271..5a11f646c 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -588,6 +588,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
// Make sure the MACROBLOCKD mode info pointer is pointed at the
// correct entry for the current macroblock.
xd->mode_info_context = mi;
+ xd->prev_mode_info_context = prev_mi;
// Read the macroblock segment id.
read_mb_segment_id(pbi, mb_row, mb_col);
@@ -976,8 +977,6 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) {
for (sb_col = 0; sb_col < sb_cols; sb_col++) {
for (i = 0; i < 4; i++) {
- int mb_to_top_edge;
- int mb_to_bottom_edge;
int dy = row_delta[i];
int dx = col_delta[i];
@@ -996,13 +995,9 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) {
xd->mode_info_context = mi;
xd->prev_mode_info_context = prev_mi;
- pbi->mb.mb_to_top_edge = mb_to_top_edge = -((mb_row * 16)) << 3;
- mb_to_top_edge -= LEFT_TOP_MARGIN;
-
+ pbi->mb.mb_to_top_edge = -((mb_row * 16)) << 3;
pbi->mb.mb_to_bottom_edge =
- mb_to_bottom_edge =
((pbi->common.mb_rows - 1 - mb_row) * 16) << 3;
- mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN;
if (cm->frame_type == KEY_FRAME)
vp8_kfread_modes(pbi, mi, mb_row, mb_col);
@@ -1022,3 +1017,22 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi) {
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);
+ if (cm->frame_type == KEY_FRAME &&!cm->kf_ymode_probs_update)
+ cm->kf_ymode_probs_index = vp8_read_literal(&pbi->bc, 3);
+}
+void vpx_decode_mb_mode_mv(VP8D_COMP *pbi,
+ MACROBLOCKD *xd,
+ int mb_row,
+ int mb_col){
+ MODE_INFO *mi = xd->mode_info_context;
+ MODE_INFO *prev_mi = xd->prev_mode_info_context;
+
+ if (pbi->common.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);
+}
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 4aa1df662..475584211 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -604,6 +604,7 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
mb_row += dy;
mb_col += dx;
xd->mode_info_context += offset_extended;
+ xd->prev_mode_info_context += offset_extended;
continue;
}
@@ -631,6 +632,9 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
xd->up_available = (mb_row != 0);
xd->left_available = (mb_col != 0);
+ if(pbi->interleaved_decoding)
+ vpx_decode_mb_mode_mv(pbi, xd, mb_row, mb_col);
+
update_blockd_bmi(xd);
recon_yoffset = (mb_row * recon_y_stride * 16) + (mb_col * 16);
@@ -689,6 +693,7 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
// skip to next MB
xd->mode_info_context += offset_extended;
+ xd->prev_mode_info_context += offset_extended;
mb_row += dy;
mb_col += dx;
}
@@ -696,6 +701,7 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) {
/* skip prediction column */
xd->mode_info_context += 1 - (pc->mb_cols & 0x1) + xd->mode_info_stride;
+ xd->prev_mode_info_context += 1 - (pc->mb_cols & 0x1) + xd->mode_info_stride;
}
static unsigned int read_partition_size(const unsigned char *cx_size) {
@@ -802,6 +808,7 @@ static void init_frame(VP8D_COMP *pbi) {
xd->left_context = &pc->left_context;
xd->mode_info_context = pc->mi;
+ xd->prev_mode_info_context = pc->prev_mi;
xd->frame_type = pc->frame_type;
xd->mode_info_context->mbmi.mode = DC_PRED;
xd->mode_info_stride = pc->mode_info_stride;
@@ -1332,12 +1339,16 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
/* Read the mb_no_coeff_skip flag */
pc->mb_no_coeff_skip = (int)vp8_read_bit(bc);
- vp8_decode_mode_mvs(pbi);
+ if(pbi->interleaved_decoding)
+ vpx_decode_mode_mvs_init(pbi);
+ else
+ vp8_decode_mode_mvs(pbi);
vpx_memset(pc->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * pc->mb_cols);
// Resset the macroblock mode info context to the start of the list
xd->mode_info_context = pc->mi;
+ xd->prev_mode_info_context = pc->prev_mi;
/* Decode a row of superblocks */
for (mb_row = 0; mb_row < pc->mb_rows; mb_row += 2) {
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index 992b5db08..f7d93b201 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -149,6 +149,8 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf) {
pbi->decoded_key_frame = 0;
+ pbi->interleaved_decoding = 1;
+
return (VP8D_PTR) pbi;
}
diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h
index f4147e119..b2a643bc5 100644
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -91,6 +91,8 @@ typedef struct VP8Decompressor {
int decoded_key_frame;
+ int interleaved_decoding;
+
} VP8D_COMP;
int vp8_decode_frame(VP8D_COMP *cpi);