Decoupling set_ref_ptrs() and vp9_setup_interp_filters().

Change-Id: I8d17867a4772554cbba2bd113cc5b4c99d50146d
This commit is contained in:
Dmitry Kovalev 2014-01-27 16:00:20 -08:00
parent 00bfacb769
commit e5b31a1d8c
6 changed files with 14 additions and 20 deletions

View File

@ -93,11 +93,6 @@ static void setup_pre_planes(MACROBLOCKD *xd, int idx,
}
}
static void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, int ref0, int ref1) {
xd->block_refs[0] = &cm->frame_refs[ref0 >= 0 ? ref0 : 0];
xd->block_refs[1] = &cm->frame_refs[ref1 >= 0 ? ref1 : 0];
}
#ifdef __cplusplus
} // extern "C"
#endif

View File

@ -2681,6 +2681,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
vp9_update_zbin_extra(cpi, x);
}
} else {
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {

View File

@ -27,16 +27,6 @@
void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
VP9_COMMON *cm) {
if (xd->mi_8x8 && xd->mi_8x8[0]) {
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
set_ref_ptrs(cm, xd, mbmi->ref_frame[0] - LAST_FRAME,
mbmi->ref_frame[1] - LAST_FRAME);
} else {
set_ref_ptrs(cm, xd, -1, -1);
}
xd->interp_kernel = vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP
: filter);
assert(((intptr_t)xd->interp_kernel & 0xff) == 0);

View File

@ -3395,6 +3395,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
int64_t *time_stamp, int64_t *time_end, int flush) {
VP9_COMP *cpi = (VP9_COMP *) ptr;
VP9_COMMON *cm = &cpi->common;
MACROBLOCKD *xd = &cpi->mb.e_mbd;
struct vpx_usec_timer cmptimer;
YV12_BUFFER_CONFIG *force_src_buffer = NULL;
MV_REFERENCE_FRAME ref_frame;
@ -3578,7 +3579,8 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
vp9_extend_frame_borders(buf, cm->subsampling_x, cm->subsampling_y);
}
vp9_setup_interp_filters(&cpi->mb.e_mbd, DEFAULT_INTERP_FILTER, cm);
set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
vp9_setup_interp_filters(xd, DEFAULT_INTERP_FILTER, cm);
if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
vp9_vaq_init();

View File

@ -821,6 +821,12 @@ static int get_token_alloc(int mb_rows, int mb_cols) {
return mb_rows * mb_cols * (48 * 16 + 4);
}
static void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd,
MV_REFERENCE_FRAME ref0, MV_REFERENCE_FRAME ref1) {
xd->block_refs[0] = &cm->frame_refs[ref0 - LAST_FRAME];
xd->block_refs[1] = &cm->frame_refs[ref1 - LAST_FRAME];
}
#ifdef __cplusplus
} // extern "C"
#endif

View File

@ -3277,7 +3277,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
continue;
}
set_ref_ptrs(cm, xd, ref_frame - 1, second_ref_frame - 1);
set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
mbmi->uv_mode = DC_PRED;
// Evaluate all sub-pel filters irrespective of whether we can use
@ -3709,7 +3709,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(best_tx_diff);
}
set_ref_ptrs(cm, xd, mbmi->ref_frame[0] - 1, mbmi->ref_frame[1] - 1);
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 :
@ -3902,7 +3902,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
vp9_is_scaled(&cm->frame_refs[second_ref_frame - 1].sf))
continue;
set_ref_ptrs(cm, xd, ref_frame - 1, second_ref_frame - 1);
set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
mbmi->uv_mode = DC_PRED;
// Evaluate all sub-pel filters irrespective of whether we can use
@ -4442,7 +4442,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(best_tx_diff);
}
set_ref_ptrs(cm, xd, mbmi->ref_frame[0] - 1, mbmi->ref_frame[1] - 1);
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 :