Commit e5b31a1d authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Decoupling set_ref_ptrs() and vp9_setup_interp_filters().

Change-Id: I8d17867a4772554cbba2bd113cc5b4c99d50146d
parent 00bfacb7
...@@ -93,11 +93,6 @@ static void setup_pre_planes(MACROBLOCKD *xd, int idx, ...@@ -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 #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
......
...@@ -2681,6 +2681,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled, ...@@ -2681,6 +2681,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
vp9_update_zbin_extra(cpi, x); vp9_update_zbin_extra(cpi, x);
} }
} else { } else {
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm); vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
......
...@@ -27,16 +27,6 @@ ...@@ -27,16 +27,6 @@
void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter, void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
VP9_COMMON *cm) { 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 xd->interp_kernel = vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP
: filter); : filter);
assert(((intptr_t)xd->interp_kernel & 0xff) == 0); assert(((intptr_t)xd->interp_kernel & 0xff) == 0);
......
...@@ -3395,6 +3395,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, ...@@ -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) { int64_t *time_stamp, int64_t *time_end, int flush) {
VP9_COMP *cpi = (VP9_COMP *) ptr; VP9_COMP *cpi = (VP9_COMP *) ptr;
VP9_COMMON *cm = &cpi->common; VP9_COMMON *cm = &cpi->common;
MACROBLOCKD *xd = &cpi->mb.e_mbd;
struct vpx_usec_timer cmptimer; struct vpx_usec_timer cmptimer;
YV12_BUFFER_CONFIG *force_src_buffer = NULL; YV12_BUFFER_CONFIG *force_src_buffer = NULL;
MV_REFERENCE_FRAME ref_frame; MV_REFERENCE_FRAME ref_frame;
...@@ -3578,7 +3579,8 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, ...@@ -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_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) { if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
vp9_vaq_init(); vp9_vaq_init();
......
...@@ -821,6 +821,12 @@ static int get_token_alloc(int mb_rows, int mb_cols) { ...@@ -821,6 +821,12 @@ static int get_token_alloc(int mb_rows, int mb_cols) {
return mb_rows * mb_cols * (48 * 16 + 4); 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 #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
......
...@@ -3277,7 +3277,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -3277,7 +3277,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
continue; 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; mbmi->uv_mode = DC_PRED;
// Evaluate all sub-pel filters irrespective of whether we can use // 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, ...@@ -3709,7 +3709,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(best_tx_diff); 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, store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0], &mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 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, ...@@ -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)) vp9_is_scaled(&cm->frame_refs[second_ref_frame - 1].sf))
continue; 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; mbmi->uv_mode = DC_PRED;
// Evaluate all sub-pel filters irrespective of whether we can use // 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, ...@@ -4442,7 +4442,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(best_tx_diff); 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, store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0], &mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 : &mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 :
......
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