From: Jingning Han Date: Fri, 26 Feb 2016 17:23:43 +0000 (-0800) Subject: Unify frame border extension operation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1d11fc6dd7662c3bdaa9f9ea73f15504dc2f211;p=libvpx Unify frame border extension operation This commit unifies the encoder and decoder border extension and motion compensated prediction process. Remove the decoder specific flow to simplify the development flow. Change-Id: I9c43bbe6d7c017e6da2db6a62c5bf3d0af7ccfce --- diff --git a/vp10/common/reconinter.c b/vp10/common/reconinter.c index c1cb69d97..b48e1ac86 100644 --- a/vp10/common/reconinter.c +++ b/vp10/common/reconinter.c @@ -119,6 +119,7 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, scaled_mv.col = mv_q4.col; xs = ys = 16; } + subpel_x = scaled_mv.col & SUBPEL_MASK; subpel_y = scaled_mv.row & SUBPEL_MASK; pre += (scaled_mv.row >> SUBPEL_BITS) * pre_buf->stride diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index 31a6b40ab..1cb72160c 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -493,6 +493,7 @@ static int reconstruct_inter_block(MACROBLOCKD *const xd, return eob; } +#if (CONFIG_SUPERTX || CONFIG_OBMC) static void build_mc_border(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int x, int y, int b_w, int b_h, int w, int h) { @@ -581,9 +582,7 @@ static void high_build_mc_border(const uint8_t *src8, int src_stride, ref_row += src_stride; } while (--b_h); } -#endif // CONFIG_VP9_HIGHBITDEPTH -#if CONFIG_VP9_HIGHBITDEPTH static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride, int x0, int y0, int b_w, int b_h, int frame_width, int frame_height, @@ -616,9 +615,7 @@ static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride, subpel_y, sf, w, h, ref, interp_filter, xs, ys); } } - #else - static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride, int x0, int y0, int b_w, int b_h, int frame_width, int frame_height, @@ -639,7 +636,6 @@ static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride, subpel_y, sf, w, h, ref, interp_filter, xs, ys); } #endif // CONFIG_VP9_HIGHBITDEPTH - static void dec_build_inter_predictors(VP10Decoder *const pbi, MACROBLOCKD *xd, int plane, int bw, int bh, int x, int y, int w, int h, int mi_x, int mi_y, @@ -872,6 +868,7 @@ static void dec_build_inter_predictors_sb(VP10Decoder *const pbi, } } } +#endif // (CONFIG_SUPERTX || CONFIG_OBMC) #if CONFIG_SUPERTX static void dec_build_inter_predictors_sb_sub8x8(VP10Decoder *const pbi, @@ -1846,7 +1843,8 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd, } } else { // Prediction - dec_build_inter_predictors_sb(pbi, xd, mi_row, mi_col); + vp10_build_inter_predictors_sb(xd, mi_row, mi_col, + VPXMAX(bsize, BLOCK_8X8)); #if CONFIG_OBMC if (mbmi->obmc) { #if CONFIG_VP9_HIGHBITDEPTH diff --git a/vp10/decoder/decoder.c b/vp10/decoder/decoder.c index 05a2539bc..13a590a05 100644 --- a/vp10/decoder/decoder.c +++ b/vp10/decoder/decoder.c @@ -395,6 +395,8 @@ int vp10_receive_compressed_data(VP10Decoder *pbi, swap_frame_buffers(pbi); + vpx_extend_frame_inner_borders(cm->frame_to_show); + vpx_clear_system_state(); if (!cm->show_existing_frame) { diff --git a/vpx_scale/yv12config.h b/vpx_scale/yv12config.h index 37b255d4d..38dd2706b 100644 --- a/vpx_scale/yv12config.h +++ b/vpx_scale/yv12config.h @@ -24,7 +24,7 @@ extern "C" { #define VP9INNERBORDERINPIXELS 96 #define VP9_INTERP_EXTEND 4 #define VP9_ENC_BORDER_IN_PIXELS 160 -#define VP9_DEC_BORDER_IN_PIXELS 32 +#define VP9_DEC_BORDER_IN_PIXELS 160 typedef struct yv12_buffer_config { int y_width;