summaryrefslogtreecommitdiff
path: root/vp8/decoder/decodframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/decoder/decodframe.c')
-rw-r--r--vp8/decoder/decodframe.c144
1 files changed, 3 insertions, 141 deletions
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 27f1377e1..29b9e9b85 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -244,10 +244,10 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
{
RECON_INVOKE(&pbi->common.rtcd.recon,
build_intra_predictors_mby)(xd);
- } else {
-#if !CONFIG_SUPERBLOCKS
+ }
+ else
+ {
vp8_intra_prediction_down_copy(xd);
-#endif
}
}
}
@@ -448,135 +448,6 @@ static int get_delta_q(vp8_reader *bc, int prev, int *q_update)
FILE *vpxlog = 0;
#endif
-#if CONFIG_SUPERBLOCKS
-static void
-decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd)
-{
- int i;
- int recon_yoffset, recon_uvoffset;
- int mb_row, mb_col;
- int ref_fb_idx = pc->lst_fb_idx;
- int dst_fb_idx = pc->new_fb_idx;
- int recon_y_stride = pc->yv12_fb[ref_fb_idx].y_stride;
- int recon_uv_stride = pc->yv12_fb[ref_fb_idx].uv_stride;
- int sb_col;
- int row_delta[4] = { 0, +1, 0, -1};
- int col_delta[4] = {+1, -1, +1, +1};
- int sb_cols = (pc->mb_cols + 1)>>1;
- ENTROPY_CONTEXT_PLANES left_context[2];
-
- vpx_memset(left_context, 0, sizeof(left_context));
-
- mb_row = mbrow;
- mb_col = 0;
-
- for (sb_col=0; sb_col<sb_cols; sb_col++)
- {
- for ( i=0; i<4; i++ )
- {
- int dy = row_delta[i];
- int dx = col_delta[i];
- int offset_extended = dy * xd->mode_info_stride + dx;
-
- if ((mb_row >= pc->mb_rows) || (mb_col >= pc->mb_cols))
- {
- // Skip on to the next MB
- mb_row += dy;
- mb_col += dx;
- xd->mode_info_context += offset_extended;
- continue;
- }
-
- // Copy in the appropriate left context
- vpx_memcpy (&pc->left_context,
- &left_context[(i>>1) & 0x1],
- sizeof(ENTROPY_CONTEXT_PLANES));
-
- // reset above block coeffs
- xd->above_context = pc->above_context + mb_col;
-
- /* Distance of Mb to the various image edges.
- * These are specified to 8th pel as they are always compared to
- * values that are in 1/8th pel units
- */
- xd->mb_to_top_edge = -((mb_row * 16)) << 3;
- xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3;
-
- xd->mb_to_left_edge = -((mb_col * 16) << 3);
- xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3;
-
- xd->up_available = (mb_row != 0);
- xd->left_available = (mb_col != 0);
-
- update_blockd_bmi(xd);
-
- recon_yoffset = (mb_row * recon_y_stride * 16) + (mb_col * 16);
- recon_uvoffset = (mb_row * recon_uv_stride * 8) + (mb_col * 8);
-
- xd->dst.y_buffer = pc->yv12_fb[dst_fb_idx].y_buffer + recon_yoffset;
- xd->dst.u_buffer = pc->yv12_fb[dst_fb_idx].u_buffer + recon_uvoffset;
- xd->dst.v_buffer = pc->yv12_fb[dst_fb_idx].v_buffer + recon_uvoffset;
-
- /* Select the appropriate reference frame for this MB */
- if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
- ref_fb_idx = pc->lst_fb_idx;
- else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME)
- ref_fb_idx = pc->gld_fb_idx;
- else
- ref_fb_idx = pc->alt_fb_idx;
-
- xd->pre.y_buffer = pc->yv12_fb[ref_fb_idx].y_buffer +recon_yoffset;
- xd->pre.u_buffer = pc->yv12_fb[ref_fb_idx].u_buffer +recon_uvoffset;
- xd->pre.v_buffer = pc->yv12_fb[ref_fb_idx].v_buffer +recon_uvoffset;
-
- if (xd->mode_info_context->mbmi.second_ref_frame)
- {
- int second_ref_fb_idx;
-
- /* Select the appropriate reference frame for this MB */
- if (xd->mode_info_context->mbmi.second_ref_frame == LAST_FRAME)
- second_ref_fb_idx = pc->lst_fb_idx;
- else if (xd->mode_info_context->mbmi.second_ref_frame ==
- GOLDEN_FRAME)
- second_ref_fb_idx = pc->gld_fb_idx;
- else
- second_ref_fb_idx = pc->alt_fb_idx;
-
- xd->second_pre.y_buffer =
- pc->yv12_fb[second_ref_fb_idx].y_buffer + recon_yoffset;
- xd->second_pre.u_buffer =
- pc->yv12_fb[second_ref_fb_idx].u_buffer + recon_uvoffset;
- xd->second_pre.v_buffer =
- pc->yv12_fb[second_ref_fb_idx].v_buffer + recon_uvoffset;
- }
-
- if (xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME)
- {
- /* propagate errors from reference frames */
- xd->corrupted |= pc->yv12_fb[ref_fb_idx].corrupted;
- }
-
- decode_macroblock(pbi, xd, mb_row * pc->mb_cols + mb_col);
-
- /* check if the boolean decoder has suffered an error */
- xd->corrupted |= vp8dx_bool_error(xd->current_bc);
-
- // Copy in the appropriate left context
- vpx_memcpy (&left_context[(i>>1) & 0x1],
- &pc->left_context,
- sizeof(ENTROPY_CONTEXT_PLANES));
-
- // skip to next MB
- xd->mode_info_context += offset_extended;
- mb_row += dy;
- mb_col += dx;
- }
- }
-
- /* skip prediction column */
- xd->mode_info_context += 1 - (pc->mb_cols & 0x1) + xd->mode_info_stride;
-}
-#else
static void
decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
{
@@ -674,7 +545,6 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
++xd->mode_info_context; /* skip prediction column */
}
-#endif // CONFIG_SUPERBLOCKS
static unsigned int read_partition_size(const unsigned char *cx_size)
{
@@ -1278,19 +1148,11 @@ int vp8_decode_frame(VP8D_COMP *pbi)
// Resset the macroblock mode info context to the start of the list
xd->mode_info_context = pc->mi;
-#if CONFIG_SUPERBLOCKS
- /* Decode a row of super-blocks */
- for (mb_row = 0; mb_row < pc->mb_rows; mb_row+=2)
- {
- decode_sb_row(pbi, pc, mb_row, xd);
- }
-#else
/* Decode a row of macro blocks */
for (mb_row = 0; mb_row < pc->mb_rows; mb_row++)
{
decode_mb_row(pbi, pc, mb_row, xd);
}
-#endif /* CONFIG_SUPERBLOCKS */
corrupt_tokens |= xd->corrupted;
/* Collect information about decoder corruption. */