From 29e4d7e861eb044902a34291df0814e972e28bcb Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" <rbultje@google.com> Date: Thu, 9 Feb 2012 16:11:00 -0800 Subject: [PATCH] Merge dualpred (compound prediction) experiment. Change-Id: Ieaaa07c50eae41118596197f6a4d848135946e41 --- configure | 1 - vp8/common/alloccommon.c | 2 -- vp8/common/blockd.h | 12 ++------- vp8/common/filter.c | 14 ---------- vp8/common/generic/systemdependent.c | 6 ----- vp8/common/onyxc_int.h | 8 ------ vp8/common/recon.h | 4 --- vp8/common/reconinter.c | 9 +------ vp8/common/subpixel.h | 9 ------- vp8/decoder/decodemv.c | 6 ----- vp8/decoder/decodframe.c | 11 +------- vp8/decoder/threading.c | 2 -- vp8/encoder/bitstream.c | 18 ++----------- vp8/encoder/encodeframe.c | 14 ++-------- vp8/encoder/ethreading.c | 4 --- vp8/encoder/onyx_if.c | 28 ------------------- vp8/encoder/onyx_int.h | 8 ------ vp8/encoder/pickinter.c | 2 -- vp8/encoder/rdopt.c | 40 ---------------------------- 19 files changed, 8 insertions(+), 190 deletions(-) diff --git a/configure b/configure index f1ccaa19b9..5be1c40711 100755 --- a/configure +++ b/configure @@ -217,7 +217,6 @@ HAVE_LIST=" unistd_h " EXPERIMENT_LIST=" - dualpred extend_qrange segmentation segfeatures diff --git a/vp8/common/alloccommon.c b/vp8/common/alloccommon.c index 15166a6703..c130a31045 100644 --- a/vp8/common/alloccommon.c +++ b/vp8/common/alloccommon.c @@ -212,9 +212,7 @@ void vp8_create_common(VP8_COMMON *oci) vp8_default_bmode_probs(oci->fc.bmode_prob); oci->mb_no_coeff_skip = 1; -#if CONFIG_DUALPRED oci->dual_pred_mode = HYBRID_PREDICTION; -#endif /* CONFIG_DUALPRED */ oci->no_lpf = 0; oci->filter_type = NORMAL_LOOPFILTER; oci->use_bilinear_mc_filter = 0; diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 72fee373d5..f6ff1c2a8d 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -176,15 +176,11 @@ typedef enum typedef struct { MB_PREDICTION_MODE mode, uv_mode; - MV_REFERENCE_FRAME ref_frame; + MV_REFERENCE_FRAME ref_frame, second_ref_frame; #if CONFIG_T8X8 TX_SIZE txfm_size; #endif - int_mv mv; -#if CONFIG_DUALPRED - MV_REFERENCE_FRAME second_ref_frame; - int_mv second_mv; -#endif + int_mv mv, second_mv; unsigned char partitioning; unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ unsigned char need_to_clamp_mvs; @@ -242,11 +238,9 @@ typedef struct MacroBlockD int fullpixel_mask; YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */ -#if CONFIG_DUALPRED struct { uint8_t *y_buffer, *u_buffer, *v_buffer; } second_pre; -#endif /* CONFIG_DUALPRED */ YV12_BUFFER_CONFIG dst; MODE_INFO *prev_mode_info_context; @@ -310,10 +304,8 @@ typedef struct MacroBlockD vp8_subpix_fn_t subpixel_predict8x4; vp8_subpix_fn_t subpixel_predict8x8; vp8_subpix_fn_t subpixel_predict16x16; -#if CONFIG_DUALPRED vp8_subpix_fn_t subpixel_predict_avg8x8; vp8_subpix_fn_t subpixel_predict_avg16x16; -#endif /* CONFIG_DUALPRED */ void *current_bc; diff --git a/vp8/common/filter.c b/vp8/common/filter.c index 58e1d545f1..dc585045d8 100644 --- a/vp8/common/filter.c +++ b/vp8/common/filter.c @@ -221,7 +221,6 @@ static void filter_block2d_second_pass } } -#if CONFIG_DUALPRED /* * The only functional difference between filter_block2d_second_pass() * and this function is that filter_block2d_second_pass() does a sixtap @@ -299,7 +298,6 @@ static void filter_block2d_second_pass_avg output_ptr += output_pitch; } } -#endif /* CONFIG_DUALPRED */ static void filter_block2d ( @@ -368,7 +366,6 @@ void vp8_sixtap_predict8x8_c } -#if CONFIG_DUALPRED void vp8_sixtap_predict_avg8x8_c ( unsigned char *src_ptr, @@ -394,7 +391,6 @@ void vp8_sixtap_predict_avg8x8_c /* then filter verticaly... */ filter_block2d_second_pass_avg(FData + 8*(INTERP_EXTEND-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } -#endif /* CONFIG_DUALPRED */ void vp8_sixtap_predict8x4_c ( @@ -452,7 +448,6 @@ void vp8_sixtap_predict16x16_c } -#if CONFIG_DUALPRED void vp8_sixtap_predict_avg16x16_c ( unsigned char *src_ptr, @@ -479,7 +474,6 @@ void vp8_sixtap_predict_avg16x16_c filter_block2d_second_pass_avg(FData + 16*(INTERP_EXTEND-1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } -#endif /* CONFIG_DUALPRED */ /**************************************************************************** * @@ -584,7 +578,6 @@ static void filter_block2d_bil_second_pass } } -#if CONFIG_DUALPRED /* * As before for filter_block2d_second_pass_avg(), the functional difference * between filter_block2d_bil_second_pass() and filter_block2d_bil_second_pass_avg() @@ -623,7 +616,6 @@ static void filter_block2d_bil_second_pass_avg dst_ptr += dst_pitch; } } -#endif /* CONFIG_DUALPRED */ /**************************************************************************** * @@ -670,7 +662,6 @@ static void filter_block2d_bil filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter); } -#if CONFIG_DUALPRED static void filter_block2d_bil_avg ( unsigned char *src_ptr, @@ -691,7 +682,6 @@ static void filter_block2d_bil_avg /* then 1-D vertically... */ filter_block2d_bil_second_pass_avg(FData, dst_ptr, dst_pitch, Height, Width, VFilter); } -#endif /* CONFIG_DUALPRED */ void vp8_bilinear_predict4x4_c ( @@ -751,7 +741,6 @@ void vp8_bilinear_predict8x8_c } -#if CONFIG_DUALPRED void vp8_bilinear_predict_avg8x8_c ( unsigned char *src_ptr, @@ -771,7 +760,6 @@ void vp8_bilinear_predict_avg8x8_c filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); } -#endif /* CONFIG_DUALPRED */ void vp8_bilinear_predict8x4_c ( @@ -812,7 +800,6 @@ void vp8_bilinear_predict16x16_c filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); } -#if CONFIG_DUALPRED void vp8_bilinear_predict_avg16x16_c ( unsigned char *src_ptr, @@ -832,4 +819,3 @@ void vp8_bilinear_predict_avg16x16_c filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); } -#endif /* CONFIG_DUALPRED */ diff --git a/vp8/common/generic/systemdependent.c b/vp8/common/generic/systemdependent.c index 267b2f21a5..22d249b895 100644 --- a/vp8/common/generic/systemdependent.c +++ b/vp8/common/generic/systemdependent.c @@ -84,10 +84,8 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) #endif rtcd->recon.copy16x16 = vp8_copy_mem16x16_c; rtcd->recon.copy8x8 = vp8_copy_mem8x8_c; -#if CONFIG_DUALPRED rtcd->recon.avg16x16 = vp8_avg_mem16x16_c; rtcd->recon.avg8x8 = vp8_avg_mem8x8_c; -#endif /* CONFIG_DUALPRED */ rtcd->recon.copy8x4 = vp8_copy_mem8x4_c; rtcd->recon.recon = vp8_recon_b_c; rtcd->recon.recon_uv = vp8_recon_uv_b_c; @@ -112,18 +110,14 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c; rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c; -#if CONFIG_DUALPRED rtcd->subpix.sixtap_avg16x16 = vp8_sixtap_predict_avg16x16_c; rtcd->subpix.sixtap_avg8x8 = vp8_sixtap_predict_avg8x8_c; -#endif /* CONFIG_DUALPRED */ rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_c; rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_c; rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c; rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_c; -#if CONFIG_DUALPRED rtcd->subpix.bilinear_avg16x16 = vp8_bilinear_predict_avg16x16_c; rtcd->subpix.bilinear_avg8x8 = vp8_bilinear_predict_avg8x8_c; -#endif /* CONFIG_DUALPRED */ rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_c; rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_c; diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h index 338fc2d2da..67c075b0ef 100644 --- a/vp8/common/onyxc_int.h +++ b/vp8/common/onyxc_int.h @@ -42,9 +42,7 @@ void vp8_initialize_common(void); #define MAX_PARTITIONS 9 -#if CONFIG_DUALPRED #define DUAL_PRED_CONTEXTS 2 -#endif /* CONFIG_DUALPRED */ typedef struct frame_contexts { @@ -84,7 +82,6 @@ typedef enum BILINEAR = 1 } INTERPOLATIONFILTERTYPE; -#if CONFIG_DUALPRED typedef enum { SINGLE_PREDICTION_ONLY = 0, @@ -92,7 +89,6 @@ typedef enum HYBRID_PREDICTION = 2, NB_PREDICTION_TYPES = 3, } DUALPREDMODE_TYPE; -#endif /* CONFIG_DUALPRED */ typedef struct VP8_COMMON_RTCD { @@ -151,9 +147,7 @@ typedef struct VP8Common /* profile settings */ int experimental; int mb_no_coeff_skip; -#if CONFIG_DUALPRED DUALPREDMODE_TYPE dual_pred_mode; -#endif /* CONFIG_DUALPRED */ int no_lpf; int use_bilinear_mc_filter; int full_pixel; @@ -237,9 +231,7 @@ typedef struct VP8Common vp8_prob ref_pred_probs[PREDICTION_PROBS]; vp8_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS]; -#if CONFIG_DUALPRED vp8_prob prob_dualpred[DUAL_PRED_CONTEXTS]; -#endif /* CONFIG_DUALPRED */ FRAME_CONTEXT lfc_a; /* last alt ref entropy */ FRAME_CONTEXT lfc; /* last frame entropy */ diff --git a/vp8/common/recon.h b/vp8/common/recon.h index 9b56827016..decd114793 100644 --- a/vp8/common/recon.h +++ b/vp8/common/recon.h @@ -49,7 +49,6 @@ extern prototype_copy_block(vp8_recon_copy16x16); #endif extern prototype_copy_block(vp8_recon_copy8x8); -#if CONFIG_DUALPRED #ifndef vp8_recon_avg16x16 #define vp8_recon_avg16x16 vp8_avg_mem16x16_c #endif @@ -59,7 +58,6 @@ extern prototype_copy_block(vp8_recon_avg16x16); #define vp8_recon_avg8x8 vp8_avg_mem8x8_c #endif extern prototype_copy_block(vp8_recon_avg8x8); -#endif /* CONFIG_DUALPRED */ #ifndef vp8_recon_copy8x4 #define vp8_recon_copy8x4 vp8_copy_mem8x4_c @@ -160,10 +158,8 @@ typedef struct vp8_recon_rtcd_vtable { vp8_copy_block_fn_t copy16x16; vp8_copy_block_fn_t copy8x8; -#if CONFIG_DUALPRED vp8_copy_block_fn_t avg16x16; vp8_copy_block_fn_t avg8x8; -#endif /* CONFIG_DUALPRED */ vp8_copy_block_fn_t copy8x4; vp8_recon_fn_t recon; vp8_recon_fn_t recon_uv; diff --git a/vp8/common/reconinter.c b/vp8/common/reconinter.c index 0d70c405cc..fedbff50d3 100644 --- a/vp8/common/reconinter.c +++ b/vp8/common/reconinter.c @@ -62,7 +62,6 @@ void vp8_copy_mem16x16_c( } -#if CONFIG_DUALPRED void vp8_avg_mem16x16_c( unsigned char *src, int src_stride, @@ -84,7 +83,6 @@ void vp8_avg_mem16x16_c( dst += dst_stride; } } -#endif /* CONFIG_DUALPRED */ void vp8_copy_mem8x8_c( unsigned char *src, @@ -116,7 +114,6 @@ void vp8_copy_mem8x8_c( } -#if CONFIG_DUALPRED void vp8_avg_mem8x8_c( unsigned char *src, int src_stride, @@ -138,7 +135,6 @@ void vp8_avg_mem8x8_c( dst += dst_stride; } } -#endif /* CONFIG_DUALPRED */ void vp8_copy_mem8x4_c( unsigned char *src, @@ -478,7 +474,6 @@ void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x, } -#if CONFIG_DUALPRED /* * This function should be called after an initial call to * vp8_build_inter16x16_predictors_mb() or _mby()/_mbuv(). @@ -544,7 +539,6 @@ void vp8_build_2nd_inter16x16_predictors_mb(MACROBLOCKD *x, RECON_INVOKE(&x->rtcd->recon, avg8x8)(vptr, pre_stride, dst_v, dst_uvstride); } } -#endif /* CONFIG_DUALPRED */ static void build_inter4x4_predictors_mb(MACROBLOCKD *x) { @@ -665,7 +659,7 @@ void vp8_build_inter_predictors_mb(MACROBLOCKD *x) { vp8_build_inter16x16_predictors_mb(x, x->predictor, &x->predictor[256], &x->predictor[320], 16, 8); -#if CONFIG_DUALPRED + if (x->mode_info_context->mbmi.second_ref_frame) { /* 256 = offset of U plane in Y+U+V buffer; @@ -675,7 +669,6 @@ void vp8_build_inter_predictors_mb(MACROBLOCKD *x) &x->predictor[256], &x->predictor[320], 16, 8); } -#endif /* CONFIG_DUALPRED */ } else { diff --git a/vp8/common/subpixel.h b/vp8/common/subpixel.h index 33d4b355de..0b1b72fa01 100644 --- a/vp8/common/subpixel.h +++ b/vp8/common/subpixel.h @@ -34,7 +34,6 @@ extern prototype_subpixel_predict(vp8_subpix_sixtap16x16); #endif extern prototype_subpixel_predict(vp8_subpix_sixtap8x8); -#if CONFIG_DUALPRED #ifndef vp8_subpix_sixtap_avg16x16 #define vp8_subpix_sixtap_avg16x16 vp8_sixtap_predict_avg16x16_c #endif @@ -44,8 +43,6 @@ extern prototype_subpixel_predict(vp8_subpix_sixtap_avg16x16); #define vp8_subpix_sixtap_avg8x8 vp8_sixtap_predict_avg8x8_c #endif extern prototype_subpixel_predict(vp8_subpix_sixtap_avg8x8); -#endif /* CONFIG_DUALPRED */ - #ifndef vp8_subpix_sixtap8x4 #define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_c #endif @@ -66,7 +63,6 @@ extern prototype_subpixel_predict(vp8_subpix_bilinear16x16); #endif extern prototype_subpixel_predict(vp8_subpix_bilinear8x8); -#if CONFIG_DUALPRED #ifndef vp8_subpix_bilinear_avg16x16 #define vp8_subpix_bilinear_avg16x16 vp8_bilinear_predict_avg16x16_c #endif @@ -76,7 +72,6 @@ extern prototype_subpixel_predict(vp8_subpix_bilinear_avg16x16); #define vp8_subpix_bilinear_avg8x8 vp8_bilinear_predict_avg8x8_c #endif extern prototype_subpixel_predict(vp8_subpix_bilinear_avg8x8); -#endif /* CONFIG_DUALPRED */ #ifndef vp8_subpix_bilinear8x4 #define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_c @@ -93,18 +88,14 @@ typedef struct { vp8_subpix_fn_t sixtap16x16; vp8_subpix_fn_t sixtap8x8; -#if CONFIG_DUALPRED vp8_subpix_fn_t sixtap_avg16x16; vp8_subpix_fn_t sixtap_avg8x8; -#endif /* CONFIG_DUALPRED */ vp8_subpix_fn_t sixtap8x4; vp8_subpix_fn_t sixtap4x4; vp8_subpix_fn_t bilinear16x16; vp8_subpix_fn_t bilinear8x8; -#if CONFIG_DUALPRED vp8_subpix_fn_t bilinear_avg16x16; vp8_subpix_fn_t bilinear_avg8x8; -#endif /* CONFIG_DUALPRED */ vp8_subpix_fn_t bilinear8x4; vp8_subpix_fn_t bilinear4x4; } vp8_subpix_rtcd_vtable_t; diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index 4680e4aee2..28cbf17d68 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -416,7 +416,6 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) // frame prediction fails. compute_mod_refprobs( cm ); -#if CONFIG_DUALPRED pbi->common.dual_pred_mode = vp8_read(bc, 128); if (cm->dual_pred_mode) cm->dual_pred_mode += vp8_read(bc, 128); @@ -426,7 +425,6 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ ) cm->prob_dualpred[i] = (vp8_prob)vp8_read_literal(bc, 8); } -#endif /* CONFIG_DUALPRED */ if (vp8_read_bit(bc)) { @@ -541,9 +539,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, mb_to_top_edge -= LEFT_TOP_MARGIN; mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN; mbmi->need_to_clamp_mvs = 0; -#if CONFIG_DUALPRED mbmi->second_ref_frame = 0; -#endif /* CONFIG_DUALPRED */ /* Distance of Mb to the various image edges. * These specified to 8th pel as they are always compared to MV values that are in 1/8th pel units */ @@ -732,7 +728,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, propagate_mv: /* same MV throughout */ -#if CONFIG_DUALPRED if ( cm->dual_pred_mode == DUAL_PREDICTION_ONLY || (cm->dual_pred_mode == HYBRID_PREDICTION && vp8_read(bc, get_pred_prob( cm, xd, PRED_DUAL ))) ) @@ -776,7 +771,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, break; } } -#endif /* CONFIG_DUALPRED */ #if CONFIG_ERROR_CONCEALMENT if(pbi->ec_enabled) diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 3140e70b73..ac796163d4 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -134,14 +134,13 @@ static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) vp8_build_inter16x16_predictors_mb(xd, xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.y_stride, xd->dst.uv_stride); -#if CONFIG_DUALPRED + if (xd->mode_info_context->mbmi.second_ref_frame) { vp8_build_2nd_inter16x16_predictors_mb(xd, xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, xd->dst.y_stride, xd->dst.uv_stride); } -#endif /* CONFIG_DUALPRED */ } #ifdef DEC_DEBUG if (dec_debug) { @@ -571,7 +570,6 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) xd->pre.u_buffer = pc->yv12_fb[ref_fb_idx].u_buffer +recon_uvoffset; xd->pre.v_buffer = pc->yv12_fb[ref_fb_idx].v_buffer +recon_uvoffset; -#if CONFIG_DUALPRED if (xd->mode_info_context->mbmi.second_ref_frame) { int second_ref_fb_idx; @@ -592,7 +590,6 @@ decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd) xd->second_pre.v_buffer = pc->yv12_fb[second_ref_fb_idx].v_buffer + recon_uvoffset; } -#endif /* CONFIG_DUALPRED */ if (xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME) { @@ -697,7 +694,6 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd) xd->pre.u_buffer = pc->yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset; xd->pre.v_buffer = pc->yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset; -#if CONFIG_DUALPRED if (xd->mode_info_context->mbmi.second_ref_frame) { int second_ref_fb_idx; @@ -714,7 +710,6 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd) xd->second_pre.u_buffer = pc->yv12_fb[second_ref_fb_idx].u_buffer + recon_uvoffset; xd->second_pre.v_buffer = pc->yv12_fb[second_ref_fb_idx].v_buffer + recon_uvoffset; } -#endif /* CONFIG_DUALPRED */ if (xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME) { @@ -964,10 +959,8 @@ static void init_frame(VP8D_COMP *pbi) xd->subpixel_predict8x4 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x4); xd->subpixel_predict8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x8); xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap16x16); -#if CONFIG_DUALPRED xd->subpixel_predict_avg8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap_avg8x8); xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap_avg16x16); -#endif /* CONFIG_DUALPRED */ } else { @@ -975,10 +968,8 @@ static void init_frame(VP8D_COMP *pbi) xd->subpixel_predict8x4 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x4); xd->subpixel_predict8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x8); xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear16x16); -#if CONFIG_DUALPRED xd->subpixel_predict_avg8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear_avg8x8); xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear_avg16x16); -#endif /* CONFIG_DUALPRED */ } if (pbi->decoded_key_frame && pbi->ec_enabled && !pbi->ec_active) diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index 3d17e18b89..396ffe9a44 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -49,10 +49,8 @@ static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_D mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; mbd->subpixel_predict16x16 = xd->subpixel_predict16x16; -#if CONFIG_DUALPRED mbd->subpixel_predict_avg8x8 = xd->subpixel_predict_avg8x8; mbd->subpixel_predict_avg16x16 = xd->subpixel_predict_avg16x16; -#endif /* CONFIG_DUALPRED */ mbd->mode_info_context = pc->mi + pc->mode_info_stride * (i + 1); mbd->mode_info_stride = pc->mode_info_stride; diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index b318cc5570..4f7b9df69f 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -967,9 +967,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) const MV_CONTEXT *mvc = pc->fc.mvc; MACROBLOCKD *xd = &cpi->mb.e_mbd; -#if CONFIG_DUALPRED int i; -#endif int pred_context; MODE_INFO *m = pc->mi; @@ -1022,7 +1020,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) vp8_write_literal(w, pc->prob_last_coded, 8); vp8_write_literal(w, pc->prob_gf_coded, 8); -#if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, 1, 128); @@ -1052,7 +1049,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) vp8_write(w, 1, 128); vp8_write(w, 0, 128); } -#endif /* CONFIG_DUALPRED */ update_mbintra_mode_probs(cpi); @@ -1220,7 +1216,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #endif write_mv(w, &mi->mv.as_mv, &best_mv, mvc); -#if CONFIG_DUALPRED + if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, @@ -1239,7 +1235,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) cpi->common.ref_frame_sign_bias); write_mv(w, &mi->second_mv.as_mv, &best_mv, mvc); } -#endif /* CONFIG_DUALPRED */ break; case SPLITMV: @@ -1288,14 +1283,12 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) } break; default: -#if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); } -#endif /* CONFIG_DUALPRED */ break; } } @@ -1326,9 +1319,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) const MV_CONTEXT *mvc = pc->fc.mvc; MACROBLOCKD *xd = &cpi->mb.e_mbd; -#if CONFIG_DUALPRED int i; -#endif int pred_context; @@ -1378,7 +1369,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) vp8_write_literal(w, pc->prob_last_coded, 8); vp8_write_literal(w, pc->prob_gf_coded, 8); -#if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, 1, 128); @@ -1408,7 +1398,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) vp8_write(w, 1, 128); vp8_write(w, 0, 128); } -#endif /* CONFIG_DUALPRED */ update_mbintra_mode_probs(cpi); @@ -1556,7 +1545,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #endif write_mv(w, &mi->mv.as_mv, &best_mv, mvc); -#if CONFIG_DUALPRED + if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, mi->second_ref_frame != INTRA_FRAME, @@ -1574,7 +1563,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) cpi->common.ref_frame_sign_bias); write_mv(w, &mi->second_mv.as_mv, &best_mv, mvc); } -#endif /* CONFIG_DUALPRED */ break; case SPLITMV: { @@ -1622,13 +1610,11 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) } break; default: -#if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); } -#endif /* CONFIG_DUALPRED */ break; } } diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index a0909eb766..c45fe59c71 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -1214,12 +1214,10 @@ static void encode_frame_internal(VP8_COMP *cpi) &cpi->common.rtcd.subpix, sixtap8x8); xd->subpixel_predict16x16 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, sixtap16x16); -#if CONFIG_DUALPRED xd->subpixel_predict_avg8x8 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, sixtap_avg8x8); xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, sixtap_avg16x16); -#endif /* CONFIG_DUALPRED */ } else { @@ -1231,12 +1229,10 @@ static void encode_frame_internal(VP8_COMP *cpi) &cpi->common.rtcd.subpix, bilinear8x8); xd->subpixel_predict16x16 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, bilinear16x16); -#if CONFIG_DUALPRED xd->subpixel_predict_avg8x8 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, bilinear_avg8x8); xd->subpixel_predict_avg16x16 = SUBPIX_INVOKE( &cpi->common.rtcd.subpix, bilinear_avg16x16); -#endif /* CONFIG_DUALPRED */ } // Reset frame count of inter 0,0 motion vector usage. @@ -1276,11 +1272,10 @@ static void encode_frame_internal(VP8_COMP *cpi) // re-initencode frame context. init_encode_frame_mb_context(cpi); -#if CONFIG_DUALPRED + cpi->rd_single_diff = cpi->rd_dual_diff = cpi->rd_hybrid_diff = 0; vpx_memset(cpi->single_pred_count, 0, sizeof(cpi->single_pred_count)); vpx_memset(cpi->dual_pred_count, 0, sizeof(cpi->dual_pred_count)); -#endif /* CONFIG_DUALPRED */ { struct vpx_usec_timer emr_timer; @@ -1438,7 +1433,6 @@ static void encode_frame_internal(VP8_COMP *cpi) void vp8_encode_frame(VP8_COMP *cpi) { -#if CONFIG_DUALPRED if (cpi->sf.RD) { int frame_type, pred_type; @@ -1561,7 +1555,6 @@ void vp8_encode_frame(VP8_COMP *cpi) } } else -#endif /* CONFIG_DUALPRED */ { encode_frame_internal(cpi); } @@ -1807,7 +1800,7 @@ int vp8cx_encode_inter_macroblock } vp8_rd_pick_inter_mode(cpi, x, recon_yoffset, recon_uvoffset, &rate, &distortion, &intra_error, &single, &dual, &hybrid); -#if CONFIG_DUALPRED + cpi->rd_single_diff += single; cpi->rd_dual_diff += dual; cpi->rd_hybrid_diff += hybrid; @@ -1823,7 +1816,6 @@ int vp8cx_encode_inter_macroblock else cpi->dual_pred_count[pred_context]++; } -#endif /* CONFIG_DUALPRED */ /* switch back to the regular quantizer for the encode */ if (cpi->sf.improved_quant) @@ -1989,7 +1981,6 @@ int vp8cx_encode_inter_macroblock xd->pre.u_buffer = cpi->common.yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset; xd->pre.v_buffer = cpi->common.yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset; -#if CONFIG_DUALPRED if (xd->mode_info_context->mbmi.second_ref_frame) { int second_ref_fb_idx; @@ -2007,7 +1998,6 @@ int vp8cx_encode_inter_macroblock xd->second_pre.v_buffer = cpi->common.yv12_fb[second_ref_fb_idx].v_buffer + recon_uvoffset; } -#endif /* CONFIG_DUALPRED */ if (!x->skip) { diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index c715149be7..f7a513df9a 100644 --- a/vp8/encoder/ethreading.c +++ b/vp8/encoder/ethreading.c @@ -390,10 +390,8 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc) zd->subpixel_predict8x4 = xd->subpixel_predict8x4; zd->subpixel_predict8x8 = xd->subpixel_predict8x8; zd->subpixel_predict16x16 = xd->subpixel_predict16x16; -#if CONFIG_DUALPRED zd->subpixel_predict_avg8x8 = xd->subpixel_predict_avg8x8; zd->subpixel_predict_avg16x16 = xd->subpixel_predict_avg16x16; -#endif /* CONFIG_DUALPRED */ zd->segmentation_enabled = xd->segmentation_enabled; zd->mb_segement_abs_delta = xd->mb_segement_abs_delta; @@ -434,10 +432,8 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi, mbd->subpixel_predict8x4 = xd->subpixel_predict8x4; mbd->subpixel_predict8x8 = xd->subpixel_predict8x8; mbd->subpixel_predict16x16 = xd->subpixel_predict16x16; -#if CONFIG_DUALPRED mbd->subpixel_predict_avg8x8 = xd->subpixel_predict_avg8x8; mbd->subpixel_predict_avg16x16 = xd->subpixel_predict_avg16x16; -#endif /* CONFIG_DUALPRED */ #if CONFIG_RUNTIME_CPU_DETECT mbd->rtcd = xd->rtcd; #endif diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 3c94cb51d8..ff2493d9f6 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -893,7 +893,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITG ] = 5000; sf->thresh_mult[THR_SPLITA ] = 5000; -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 0; sf->thresh_mult[THR_DUAL_NEARESTLG] = 0; sf->thresh_mult[THR_DUAL_NEARLG ] = 0; @@ -907,7 +906,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 1000; sf->thresh_mult[THR_DUAL_NEWLA ] = 1000; sf->thresh_mult[THR_DUAL_NEWGA ] = 1000; -#endif /* CONFIG_DUALPRED */ sf->first_step = 0; sf->max_step_search_steps = MAX_MVSEARCH_STEPS; @@ -958,7 +956,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITG ] = 4500; sf->thresh_mult[THR_SPLITA ] = 4500; -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 0; sf->thresh_mult[THR_DUAL_NEARESTLG] = 0; sf->thresh_mult[THR_DUAL_NEARLG ] = 0; @@ -972,7 +969,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 1000; sf->thresh_mult[THR_DUAL_NEWLA ] = 1000; sf->thresh_mult[THR_DUAL_NEWGA ] = 1000; -#endif /* CONFIG_DUALPRED */ #else sf->thresh_mult[THR_NEWMV ] = 1500; sf->thresh_mult[THR_NEWG ] = 1500; @@ -1033,7 +1029,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITA ] = 20000; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 1500; sf->thresh_mult[THR_DUAL_NEARESTLG] = 1500; sf->thresh_mult[THR_DUAL_NEARLG ] = 1500; @@ -1047,7 +1042,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 2000; sf->thresh_mult[THR_DUAL_NEWLA ] = 2000; sf->thresh_mult[THR_DUAL_NEWGA ] = 2000; -#endif /* CONFIG_DUALPRED */ } if (Speed > 2) @@ -1086,7 +1080,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITA ] = 50000; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 2000; sf->thresh_mult[THR_DUAL_NEARESTLG] = 2000; sf->thresh_mult[THR_DUAL_NEARLG ] = 2000; @@ -1100,7 +1093,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 2500; sf->thresh_mult[THR_DUAL_NEWLA ] = 2500; sf->thresh_mult[THR_DUAL_NEWGA ] = 2500; -#endif /* CONFIG_DUALPRED */ sf->improved_quant = 0; sf->improved_dct = 0; @@ -1153,14 +1145,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) cpi->mode_check_freq[THR_NEWA] = 4; } -#if CONFIG_DUALPRED cpi->mode_check_freq[THR_DUAL_NEARLG ] = 2; cpi->mode_check_freq[THR_DUAL_NEARLA ] = 2; cpi->mode_check_freq[THR_DUAL_NEARGA ] = 2; cpi->mode_check_freq[THR_DUAL_NEWLG ] = 4; cpi->mode_check_freq[THR_DUAL_NEWLA ] = 4; cpi->mode_check_freq[THR_DUAL_NEWGA ] = 4; -#endif /* CONFIG_DUALPRED */ if (cpi->ref_frame_flags & VP8_GOLD_FLAG) { @@ -1178,11 +1168,9 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_NEWA ] = 4000; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_NEWLG ] = 4000; sf->thresh_mult[THR_DUAL_NEWLA ] = 4000; sf->thresh_mult[THR_DUAL_NEWGA ] = 4000; -#endif /* CONFIG_DUALPRED */ } break; @@ -1215,7 +1203,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITA ] = 10000; sf->search_method = NSTEP; -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 1000; sf->thresh_mult[THR_DUAL_NEARESTLG] = 1000; sf->thresh_mult[THR_DUAL_NEARLG ] = 1000; @@ -1229,7 +1216,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 2000; sf->thresh_mult[THR_DUAL_NEWLA ] = 2000; sf->thresh_mult[THR_DUAL_NEWGA ] = 2000; -#endif /* CONFIG_DUALPRED */ if (Speed > 0) { @@ -1315,7 +1301,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITA ] = 50000; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = 2000; sf->thresh_mult[THR_DUAL_NEARESTLG] = 2000; sf->thresh_mult[THR_DUAL_NEARLG ] = 2000; @@ -1329,7 +1314,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = 2500; sf->thresh_mult[THR_DUAL_NEWLA ] = 2500; sf->thresh_mult[THR_DUAL_NEWGA ] = 2500; -#endif /* CONFIG_DUALPRED */ } if (Speed > 2) @@ -1353,14 +1337,12 @@ void vp8_set_speed_features(VP8_COMP *cpi) cpi->mode_check_freq[THR_NEWA] = 4; } -#if CONFIG_DUALPRED cpi->mode_check_freq[THR_DUAL_NEARLG ] = 2; cpi->mode_check_freq[THR_DUAL_NEARLA ] = 2; cpi->mode_check_freq[THR_DUAL_NEARGA ] = 2; cpi->mode_check_freq[THR_DUAL_NEWLG ] = 4; cpi->mode_check_freq[THR_DUAL_NEWLA ] = 4; cpi->mode_check_freq[THR_DUAL_NEWGA ] = 4; -#endif /* CONFIG_DUALPRED */ sf->thresh_mult[THR_SPLITMV ] = INT_MAX; sf->thresh_mult[THR_SPLITG ] = INT_MAX; @@ -1421,11 +1403,9 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_NEWA ] = 4000; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_NEWLG ] = 4000; sf->thresh_mult[THR_DUAL_NEWLA ] = 4000; sf->thresh_mult[THR_DUAL_NEWGA ] = 4000; -#endif /* CONFIG_DUALPRED */ } if (Speed > 5) @@ -1493,7 +1473,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_NEARA ] = thresh; } -#if CONFIG_DUALPRED sf->thresh_mult[THR_DUAL_ZEROLG ] = thresh; sf->thresh_mult[THR_DUAL_NEARESTLG] = thresh; sf->thresh_mult[THR_DUAL_NEARLG ] = thresh; @@ -1507,7 +1486,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEWLG ] = thresh << 1; sf->thresh_mult[THR_DUAL_NEWLA ] = thresh << 1; sf->thresh_mult[THR_DUAL_NEWGA ] = thresh << 1; -#endif /* CONFIG_DUALPRED */ // Disable other intra prediction modes sf->thresh_mult[THR_TM] = INT_MAX; @@ -1545,7 +1523,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) cpi->mode_check_freq[THR_NEWA] = 1 << (Tmp + 1); } -#if CONFIG_DUALPRED cpi->mode_check_freq[THR_DUAL_ZEROLG ] = 1 << (Tmp - 1); cpi->mode_check_freq[THR_DUAL_NEARESTLG] = 1 << (Tmp - 1); cpi->mode_check_freq[THR_DUAL_NEARLG ] = 1 << Tmp; @@ -1559,7 +1536,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) cpi->mode_check_freq[THR_DUAL_NEWLG ] = 1 << (Tmp + 1); cpi->mode_check_freq[THR_DUAL_NEWLA ] = 1 << (Tmp + 1); cpi->mode_check_freq[THR_DUAL_NEWGA ] = 1 << (Tmp + 1); -#endif /* CONFIG_DUALPRED */ cpi->mode_check_freq[THR_NEWMV] = 1 << (Tmp - 1); } @@ -1606,7 +1582,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_SPLITA ] = INT_MAX; } -#if CONFIG_DUALPRED if ((cpi->ref_frame_flags & (VP8_LAST_FLAG | VP8_GOLD_FLAG)) != (VP8_LAST_FLAG | VP8_GOLD_FLAG)) { sf->thresh_mult[THR_DUAL_ZEROLG ] = INT_MAX; @@ -1630,7 +1605,6 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->thresh_mult[THR_DUAL_NEARGA ] = INT_MAX; sf->thresh_mult[THR_DUAL_NEWGA ] = INT_MAX; } -#endif /* CONFIG_DUALPRED */ // Slow quant, dct and trellis not worthwhile for first pass // so make sure they are always turned off. @@ -2332,10 +2306,8 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) cm->prob_last_coded = 128; cm->prob_gf_coded = 128; cm->prob_intra_coded = 63; -#if CONFIG_DUALPRED for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ ) cm->prob_dualpred[i] = 128; -#endif /* CONFIG_DUALPRED */ // Prime the recent reference frame useage counters. // Hereafter they will be maintained as a sort of moving average diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index ad5592fc18..f67729bcdc 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -42,11 +42,7 @@ #define AF_THRESH 25 #define AF_THRESH2 100 #define ARF_DECAY_THRESH 12 -#if CONFIG_DUALPRED #define MAX_MODES 33 -#else /* CONFIG_DUALPRED */ -#define MAX_MODES 21 -#endif /* CONFIG_DUALPRED */ #define MIN_THRESHMULT 32 #define MAX_THRESHMULT 512 @@ -194,7 +190,6 @@ typedef enum THR_B_PRED = 19, THR_I8X8_PRED = 20, -#if CONFIG_DUALPRED THR_DUAL_ZEROLG = 21, THR_DUAL_NEARESTLG = 22, THR_DUAL_NEARLG = 23, @@ -210,7 +205,6 @@ typedef enum THR_DUAL_NEWLG = 30, THR_DUAL_NEWLA = 31, THR_DUAL_NEWGA = 32, -#endif /* CONFIG_DUALPRED */ } THR_MODES; @@ -362,12 +356,10 @@ typedef struct VP8_COMP int rd_thresh_mult[MAX_MODES]; int rd_baseline_thresh[MAX_MODES]; int rd_threshes[MAX_MODES]; -#if CONFIG_DUALPRED int rd_single_diff, rd_dual_diff, rd_hybrid_diff; int rd_prediction_type_threshes[4][NB_PREDICTION_TYPES]; int dual_pred_count[DUAL_PRED_CONTEXTS]; int single_pred_count[DUAL_PRED_CONTEXTS]; -#endif /* CONFIG_DUALPRED */ int RDMULT; int RDDIV ; diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index f8afeaddc5..6efd688e1c 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -531,10 +531,8 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, if (best_rd <= cpi->rd_threshes[mode_index]) continue; -#if CONFIG_DUALPRED if (vp8_second_ref_frame_order[mode_index]) continue; -#endif /* CONFIG_DUALPRED */ x->e_mbd.mode_info_context->mbmi.ref_frame = vp8_ref_frame_order[mode_index]; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 3d35228d71..0eca759aa6 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -105,7 +105,6 @@ const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES] = B_PRED, I8X8_PRED, -#if CONFIG_DUALPRED /* dual prediction modes */ ZEROMV, NEARESTMV, @@ -122,7 +121,6 @@ const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES] = NEWMV, NEWMV, NEWMV, -#endif /* CONFIG_DUALPRED */ }; const MV_REFERENCE_FRAME vp8_ref_frame_order[MAX_MODES] = @@ -157,7 +155,6 @@ const MV_REFERENCE_FRAME vp8_ref_frame_order[MAX_MODES] = INTRA_FRAME, INTRA_FRAME, -#if CONFIG_DUALPRED /* dual prediction modes */ LAST_FRAME, LAST_FRAME, @@ -174,10 +171,8 @@ const MV_REFERENCE_FRAME vp8_ref_frame_order[MAX_MODES] = LAST_FRAME, ALTREF_FRAME, GOLDEN_FRAME, -#endif /* CONFIG_DUALPRED */ }; -#if CONFIG_DUALPRED const MV_REFERENCE_FRAME vp8_second_ref_frame_order[MAX_MODES] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -201,7 +196,6 @@ const MV_REFERENCE_FRAME vp8_second_ref_frame_order[MAX_MODES] = LAST_FRAME, ALTREF_FRAME, }; -#endif /* CONFIG_DUALPRED */ static void fill_token_costs( unsigned int c [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS], @@ -2110,11 +2104,9 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int distortion; int best_rd = INT_MAX; int best_intra_rd = INT_MAX; -#if CONFIG_DUALPRED int best_dual_rd = INT_MAX; int best_single_rd = INT_MAX; int best_hybrid_rd = INT_MAX; -#endif /* CONFIG_DUALPRED */ int rate2, distortion2; int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly; int rate_y, UNINITIALIZED_IS_SAFE(rate_uv); @@ -2135,9 +2127,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int_mv frame_nearest_mv[4]; int_mv frame_near_mv[4]; int_mv frame_best_ref_mv[4]; -#if CONFIG_DUALPRED int_mv mc_search_result[4]; -#endif /* CONFIG_DUALPRED */ int frame_mdcounts[4][4]; unsigned char *y_buffer[4]; unsigned char *u_buffer[4]; @@ -2148,13 +2138,11 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int vpx_memset(&best_mbmode, 0, sizeof(best_mbmode)); vpx_memset(&best_bmodes, 0, sizeof(best_bmodes)); -#if CONFIG_DUALPRED for (i = 0; i < 4; i++) { #define INVALID_MV 0x80008000 mc_search_result[i].as_int = INVALID_MV; } -#endif /* CONFIG_DUALPRED */ if (cpi->ref_frame_flags & VP8_LAST_FLAG) { @@ -2218,10 +2206,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int this_rd = INT_MAX; int disable_skip = 0; int other_cost = 0; -#if CONFIG_DUALPRED int dualmode_cost = 0; int mode_excluded = 0; -#endif /* CONFIG_DUALPRED */ // Experimental debug code. // Record of rd values recorded for this MB. -1 indicates not measured @@ -2243,9 +2229,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int x->e_mbd.mode_info_context->mbmi.mode = this_mode; x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED; x->e_mbd.mode_info_context->mbmi.ref_frame = vp8_ref_frame_order[mode_index]; -#if CONFIG_DUALPRED x->e_mbd.mode_info_context->mbmi.second_ref_frame = vp8_second_ref_frame_order[mode_index]; -#endif /* CONFIG_DUALPRED */ // If the segment reference frame feature is enabled.... // then do nothing if the current ref frame is not allowed.. @@ -2327,9 +2311,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int vp8_update_zbin_extra(cpi, x); } -#if CONFIG_DUALPRED if (!x->e_mbd.mode_info_context->mbmi.second_ref_frame) -#endif /* CONFIG_DUALPRED */ switch (this_mode) { case B_PRED: @@ -2569,9 +2551,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int &cpi->fn_ptr[BLOCK_16X16], x->mvcost, &dis, &sse); } -#if CONFIG_DUALPRED mc_search_result[x->e_mbd.mode_info_context->mbmi.ref_frame].as_int = d->bmi.mv.as_int; -#endif /* CONFIG_DUALPRED */ mode_mv[NEWMV].as_int = d->bmi.mv.as_int; @@ -2600,10 +2580,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int vp8_set_mbmode_and_mvs(x, this_mode, &mode_mv[this_mode]); vp8_build_inter16x16_predictors_mby(&x->e_mbd); -#if CONFIG_DUALPRED dualmode_cost = vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 0 ); -#endif /* CONFIG_DUALPRED */ if (cpi->active_map_enabled && x->active_ptr[0] == 0) { x->skip = 1; @@ -2667,15 +2645,12 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rd_inter16x16_uv(cpi, x, &rate_uv, &distortion_uv, cpi->common.full_pixel); rate2 += rate_uv; distortion2 += distortion_uv; -#if CONFIG_DUALPRED mode_excluded = cpi->common.dual_pred_mode == DUAL_PREDICTION_ONLY; -#endif /* CONFIG_DUALPRED */ break; default: break; } -#if CONFIG_DUALPRED else /* x->e_mbd.mode_info_context->mbmi.second_ref_frame != 0 */ { int ref1 = x->e_mbd.mode_info_context->mbmi.ref_frame; @@ -2760,7 +2735,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int dualmode_cost = vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 1 ); } -#endif /* CONFIG_DUALPRED */ // Where skip is allowable add in the default per mb cost for the no skip case. // where we then decide to skip we have to delete this and replace it with the @@ -2772,12 +2746,10 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rate2 += prob_skip_cost; } -#if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { rate2 += dualmode_cost; } -#endif /* CONFIG_DUALPRED */ // Estimate the reference frame signaling cost and add it @@ -2833,7 +2805,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int *returnintra = distortion2 ; } -#if CONFIG_DUALPRED if (!disable_skip && (this_mode == SPLITMV || x->e_mbd.mode_info_context->mbmi.ref_frame == INTRA_FRAME)) { @@ -2844,15 +2815,12 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int if (this_rd < best_hybrid_rd) best_hybrid_rd = this_rd; } -#endif /* CONFIG_DUALPRED */ // Did this mode help.. i.i is it the new best mode if (this_rd < best_rd || x->skip) { -#if CONFIG_DUALPRED if (!mode_excluded) { -#endif /* CONFIG_DUALPRED */ // Note index of best mode so far best_mode_index = mode_index; @@ -2882,9 +2850,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int { best_bmodes[i] = x->e_mbd.block[i].bmi; } -#if CONFIG_DUALPRED } -#endif /* CONFIG_DUALPRED */ // Testing this mode gave rise to an improvement in best error score. Lower threshold a bit for next time cpi->rd_thresh_mult[mode_index] = (cpi->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? cpi->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT; @@ -2902,7 +2868,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int cpi->rd_threshes[mode_index] = (cpi->rd_baseline_thresh[mode_index] >> 7) * cpi->rd_thresh_mult[mode_index]; } -#if CONFIG_DUALPRED /* keep record of best dual/single-only prediction */ if (!disable_skip && x->e_mbd.mode_info_context->mbmi.ref_frame != INTRA_FRAME && @@ -2942,7 +2907,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int if (0) printf("hybrid rd [DMC: %d]: %d\n", best_hybrid_rd, hybrid_rd); } } -#endif /* CONFIG_DUALPRED */ if (x->skip) break; @@ -2996,9 +2960,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int (cpi->common.mb_no_coeff_skip) ? 1 : 0; x->e_mbd.mode_info_context->mbmi.partitioning = 0; -#if CONFIG_DUALPRED *best_single_rd_diff = *best_dual_rd_diff = *best_hybrid_rd_diff = 0; -#endif /* CONFIG_DUALPRED */ return; } @@ -3034,11 +2996,9 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rd_update_mvcount(cpi, x, &frame_best_ref_mv[xd->mode_info_context->mbmi.ref_frame]); -#if CONFIG_DUALPRED *best_single_rd_diff = best_rd - best_single_rd; *best_dual_rd_diff = best_rd - best_dual_rd; *best_hybrid_rd_diff = best_rd - best_hybrid_rd; -#endif /* CONFIG_DUALPRED */ } void vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_) -- GitLab