From df78fea166793cec96a5cceff07bc1b06c90b1cd Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 19 Nov 2013 14:57:58 -0800 Subject: [PATCH] Move vp9_setup_interp_filter() to encoder As it is used in encoder only. Change-Id: I5f2a8abbe72bb18cbf6ce36a3dc7e132aeae8ec2 --- vp9/common/vp9_reconinter.c | 19 ------------------- vp9/common/vp9_reconinter.h | 4 ---- vp9/encoder/vp9_encodemb.c | 20 ++++++++++++++++++++ vp9/encoder/vp9_encodemb.h | 4 +++- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c index 7cc66c8b4..3add81b99 100644 --- a/vp9/common/vp9_reconinter.c +++ b/vp9/common/vp9_reconinter.c @@ -20,25 +20,6 @@ #include "vp9/common/vp9_reconinter.h" #include "vp9/common/vp9_reconintra.h" -void vp9_setup_interp_filters(MACROBLOCKD *xd, - INTERPOLATION_TYPE mcomp_filter_type, - VP9_COMMON *cm) { - if (xd->mi_8x8 && xd->mi_8x8[0]) { - MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; - - set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME, - mbmi->ref_frame[1] - LAST_FRAME, - cm->active_ref_scale); - } else { - set_scale_factors(xd, -1, -1, cm->active_ref_scale); - } - - xd->subpix.filter_x = xd->subpix.filter_y = - vp9_get_filter_kernel(mcomp_filter_type == SWITCHABLE ? - EIGHTTAP : mcomp_filter_type); - - assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0); -} static void inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, diff --git a/vp9/common/vp9_reconinter.h b/vp9/common/vp9_reconinter.h index 2c8a6e4d9..b328754e7 100644 --- a/vp9/common/vp9_reconinter.h +++ b/vp9/common/vp9_reconinter.h @@ -24,10 +24,6 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col, void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, BLOCK_SIZE bsize); -void vp9_setup_interp_filters(MACROBLOCKD *xd, - INTERPOLATION_TYPE filter, - VP9_COMMON *cm); - void vp9_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, const MV *mv_q3, diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 0d089ce82..0e1523b84 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -25,6 +25,26 @@ #include "vp9/encoder/vp9_rdopt.h" #include "vp9/encoder/vp9_tokenize.h" +void vp9_setup_interp_filters(MACROBLOCKD *xd, + INTERPOLATION_TYPE mcomp_filter_type, + VP9_COMMON *cm) { + if (xd->mi_8x8 && xd->mi_8x8[0]) { + MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; + + set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME, + mbmi->ref_frame[1] - LAST_FRAME, + cm->active_ref_scale); + } else { + set_scale_factors(xd, -1, -1, cm->active_ref_scale); + } + + xd->subpix.filter_x = xd->subpix.filter_y = + vp9_get_filter_kernel(mcomp_filter_type == SWITCHABLE ? + EIGHTTAP : mcomp_filter_type); + + assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0); +} + void vp9_subtract_block_c(int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, diff --git a/vp9/encoder/vp9_encodemb.h b/vp9/encoder/vp9_encodemb.h index 8fbc4a0bc..7be66210c 100644 --- a/vp9/encoder/vp9_encodemb.h +++ b/vp9/encoder/vp9_encodemb.h @@ -54,5 +54,7 @@ void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize); void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize); int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred); - +void vp9_setup_interp_filters(MACROBLOCKD *xd, + INTERPOLATION_TYPE mcomp_filter_type, + VP9_COMMON *cm); #endif // VP9_ENCODER_VP9_ENCODEMB_H_ -- 2.40.0