Commit 6e3b34bd authored by Yaowu Xu's avatar Yaowu Xu

Removed a number of unnecessary check on ref_frame

Since intra block decoding is handled by decode_sb_intra() separately.

Change-Id: I42d757884714084c92fc23ec5d35d4dc946f4b15
parent 36568357
......@@ -276,8 +276,6 @@ static void decode_atom(VP9D_COMP *pbi, MACROBLOCKD *xd,
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
assert(mbmi->ref_frame[0] != INTRA_FRAME);
if ((pbi->common.frame_type != KEY_FRAME) && (!pbi->common.intra_only))
vp9_setup_interp_filters(xd, mbmi->interp_filter, &pbi->common);
// prediction
......@@ -327,7 +325,6 @@ static void decode_sb(VP9D_COMP *pbi, MACROBLOCKD *xd, int mi_row, int mi_col,
assert(mbmi->sb_type == bsize);
assert(mbmi->ref_frame[0] != INTRA_FRAME);
if (pbi->common.frame_type != KEY_FRAME)
vp9_setup_interp_filters(xd, mbmi->interp_filter, pc);
// generate prediction
......@@ -392,14 +389,13 @@ static void set_refs(VP9D_COMP *pbi, int mi_row, int mi_col) {
MACROBLOCKD *const xd = &pbi->mb;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
if (mbmi->ref_frame[0] > INTRA_FRAME) {
// Select the appropriate reference frame for this MB
const int fb_idx = cm->active_ref_idx[mbmi->ref_frame[0] - 1];
const YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[fb_idx];
xd->scale_factor[0] = cm->active_ref_scale[mbmi->ref_frame[0] - 1];
xd->scale_factor_uv[0] = cm->active_ref_scale[mbmi->ref_frame[0] - 1];
setup_pre_planes(xd, cfg, NULL, mi_row, mi_col,
xd->scale_factor, xd->scale_factor_uv);
setup_pre_planes(xd, cfg, NULL, mi_row, mi_col, xd->scale_factor,
xd->scale_factor_uv);
xd->corrupted |= cfg->corrupted;
if (mbmi->ref_frame[1] > INTRA_FRAME) {
......@@ -408,11 +404,10 @@ static void set_refs(VP9D_COMP *pbi, int mi_row, int mi_col) {
const YV12_BUFFER_CONFIG *second_cfg = &cm->yv12_fb[second_fb_idx];
xd->scale_factor[1] = cm->active_ref_scale[mbmi->ref_frame[1] - 1];
xd->scale_factor_uv[1] = cm->active_ref_scale[mbmi->ref_frame[1] - 1];
setup_pre_planes(xd, NULL, second_cfg, mi_row, mi_col,
xd->scale_factor, xd->scale_factor_uv);
setup_pre_planes(xd, NULL, second_cfg, mi_row, mi_col, xd->scale_factor,
xd->scale_factor_uv);
xd->corrupted |= second_cfg->corrupted;
}
}
}
static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
......@@ -424,16 +419,17 @@ static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
return;
set_offsets(pbi, bsize, mi_row, mi_col);
vp9_decode_mb_mode_mv(pbi, xd, mi_row, mi_col, r);
set_refs(pbi, mi_row, mi_col);
if (xd->mode_info_context->mbmi.ref_frame[0] == INTRA_FRAME)
if (xd->mode_info_context->mbmi.ref_frame[0] == INTRA_FRAME) {
decode_sb_intra(pbi, xd, mi_row, mi_col, r, (bsize < BLOCK_SIZE_SB8X8) ?
BLOCK_SIZE_SB8X8 : bsize);
else if (bsize < BLOCK_SIZE_SB8X8)
} else {
set_refs(pbi, mi_row, mi_col);
if (bsize < BLOCK_SIZE_SB8X8)
decode_atom(pbi, xd, mi_row, mi_col, r, BLOCK_SIZE_SB8X8);
else
decode_sb(pbi, xd, mi_row, mi_col, r, bsize);
}
xd->corrupted |= vp9_reader_has_error(r);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment