diff options
author | Paul Wilkins <paulwilkins@google.com> | 2012-02-09 16:10:46 +0000 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2012-02-09 16:10:46 +0000 |
commit | cf8af867dddc7830cf42577dd9bb27bf0330a682 (patch) | |
tree | a9fd276314ad7e7705bfbc7466836da030e35a84 /vp8/encoder | |
parent | 8266abfe96cb1b46f537aec66b3dfcf22da2bb1c (diff) | |
download | libvpx-cf8af867dddc7830cf42577dd9bb27bf0330a682.tar libvpx-cf8af867dddc7830cf42577dd9bb27bf0330a682.tar.gz libvpx-cf8af867dddc7830cf42577dd9bb27bf0330a682.tar.bz2 libvpx-cf8af867dddc7830cf42577dd9bb27bf0330a682.zip |
Merge COMPRED
Merged in most of the current common prediction changes
that were under the #if CONFIG_COMPRED option.
Change-Id: If4e6f61dbe7b86dd449f6effbe93b5eb7e893885
Diffstat (limited to 'vp8/encoder')
-rw-r--r-- | vp8/encoder/bitstream.c | 175 | ||||
-rw-r--r-- | vp8/encoder/encodeframe.c | 16 | ||||
-rw-r--r-- | vp8/encoder/onyx_if.c | 158 | ||||
-rw-r--r-- | vp8/encoder/pickinter.c | 2 | ||||
-rw-r--r-- | vp8/encoder/rdopt.c | 34 |
5 files changed, 7 insertions, 378 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index dd8d3d7a6..9e0211d7f 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -849,7 +849,6 @@ static void encode_ref_frame( vp8_writer *const w, segment_id, SEG_LVL_REF_FRAME ); -#if CONFIG_COMPRED if ( seg_ref_active ) { seg_ref_count = check_segref( xd, segment_id, INTRA_FRAME ) + @@ -861,11 +860,7 @@ static void encode_ref_frame( vp8_writer *const w, // If segment level coding of this signal is disabled... // or the segment allows multiple reference frame options if ( !seg_ref_active || (seg_ref_count > 1) ) -#else - if ( !seg_ref_active ) -#endif { -#if CONFIG_COMPRED // Values used in prediction model coding unsigned char prediction_flag; vp8_prob pred_prob; @@ -927,77 +922,10 @@ static void encode_ref_frame( vp8_writer *const w, } } } -#else - if (rf == INTRA_FRAME) - { - vp8_write(w, 0, cm->prob_intra_coded); - } - else /* inter coded */ - { - vp8_write(w, 1, cm->prob_intra_coded); - - if (rf == LAST_FRAME) - { - vp8_write(w, 0, cm->prob_last_coded); - } - else - { - vp8_write(w, 1, cm->prob_last_coded); - - vp8_write(w, (rf == GOLDEN_FRAME) ? 0 : 1, cm->prob_gf_coded); - } - } -#endif } // if using the prediction mdoel we have nothing further to do because // the reference frame is fully coded by the segment - -//#if CONFIG_SEGFEATURES -#if !CONFIG_COMPRED - // Else use the segment - else - { - if (rf == INTRA_FRAME) - { - // This MB intra coded. If inter also allowed we must code - // an explicit inter/intra flag. - if ( check_segref_inter( xd, segment_id ) ) - vp8_write(w, 0, cm->prob_intra_coded); - } - else /* inter coded */ - { - // If intra also allowed we must code an explicit intra/inter flag. - if ( check_segref( xd, segment_id, INTRA_FRAME ) ) - vp8_write(w, 1, cm->prob_intra_coded); - - if (rf == LAST_FRAME) - { - // If GOLDEN or ALTREF allowed we must code explicit flag. - if ( check_segref( xd, segment_id, GOLDEN_FRAME ) || - check_segref( xd, segment_id, ALTREF_FRAME ) ) - { - vp8_write(w, 0, cm->prob_last_coded); - } - } - else - { - // if LAST is allowed we must code explicit flag - if ( check_segref( xd, segment_id, LAST_FRAME ) ) - { - vp8_write(w, 1, cm->prob_last_coded); - } - - // if GOLDEN and ALTREF allowed we must code an explicit flag - if ( check_segref( xd, segment_id, GOLDEN_FRAME ) && - check_segref( xd, segment_id, ALTREF_FRAME ) ) - { - vp8_write(w, (rf == GOLDEN_FRAME) ? 0 : 1, cm->prob_gf_coded); - } - } - } - } -#endif } // Update the probabilities used to encode reference frame data @@ -1029,11 +957,9 @@ static void update_ref_probs( VP8_COMP *const cpi ) if (!cm->prob_gf_coded) cm->prob_gf_coded = 1; -#if CONFIG_COMPRED // Compute a modified set of probabilities to use when prediction of the // reference frame fails compute_mod_refprobs( cm ); -#endif } #if CONFIG_SUPERBLOCKS @@ -1058,12 +984,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) int prob_skip_false = 0; -#if CONFIG_DUALPRED -#if !CONFIG_COMPRED - int prob_dual_pred[DUAL_PRED_CONTEXTS]; -#endif -#endif /* CONFIG_DUALPRED */ - // Values used in prediction model coding vp8_prob pred_prob; unsigned char prediction_flag; @@ -1114,7 +1034,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { if (cpi->single_pred_count[i] + cpi->dual_pred_count[i]) { -#if CONFIG_COMPRED pc->prob_dualpred[i] = cpi->single_pred_count[i] * 255 / (cpi->single_pred_count[i] + cpi->dual_pred_count[i]); if (pc->prob_dualpred[i] < 1) @@ -1125,20 +1044,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) pc->prob_dualpred[i] = 128; } vp8_write_literal(w, pc->prob_dualpred[i], 8); -#else - prob_dual_pred[i] = cpi->single_pred_count[i] * 256 / - (cpi->single_pred_count[i] + cpi->dual_pred_count[i]); - if (prob_dual_pred[i] < 1) - prob_dual_pred[i] = 1; - else if (prob_dual_pred[i] > 255) - prob_dual_pred[i] = 255; - } - else - { - prob_dual_pred[i] = 128; - } - vp8_write_literal(w, prob_dual_pred[i], 8); -#endif } } else if (cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY) @@ -1324,17 +1229,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { -#if CONFIG_COMPRED vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); -#else - - int t = m[-mis].mbmi.second_ref_frame != INTRA_FRAME; - int l = m[-1 ].mbmi.second_ref_frame != INTRA_FRAME; - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, - prob_dual_pred[t + l]); -#endif } if (mi->second_ref_frame) { @@ -1400,17 +1297,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { -#if CONFIG_COMPRED - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); -#else - int t = m[-mis].mbmi.second_ref_frame != INTRA_FRAME; - int l = m[-1 ].mbmi.second_ref_frame != INTRA_FRAME; - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, - prob_dual_pred[t + l]); -#endif } #endif /* CONFIG_DUALPRED */ break; @@ -1434,17 +1323,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) m += mis + (1- (pc->mb_cols & 0x1)); cpi->mb.partition_info += mis + (1- (pc->mb_cols & 0x1)); } - -#if !CONFIG_COMPRED -#if CONFIG_DUALPRED - if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) - { - pc->prob_dualpred[0] = (prob_dual_pred[0] + pc->prob_dualpred[0] + 1) >> 1; - pc->prob_dualpred[1] = (prob_dual_pred[1] + pc->prob_dualpred[1] + 1) >> 1; - pc->prob_dualpred[2] = (prob_dual_pred[2] + pc->prob_dualpred[2] + 1) >> 1; - } -#endif /* CONFIG_DUALPRED */ -#endif } #else static void pack_inter_mode_mvs(VP8_COMP *const cpi) @@ -1468,12 +1346,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) int prob_skip_false = 0; -#if CONFIG_DUALPRED -#if !CONFIG_COMPRED - int prob_dual_pred[DUAL_PRED_CONTEXTS]; -#endif -#endif /* CONFIG_DUALPRED */ - // Values used in prediction model coding vp8_prob pred_prob; unsigned char prediction_flag; @@ -1521,7 +1393,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { if (cpi->single_pred_count[i] + cpi->dual_pred_count[i]) { -#if CONFIG_COMPRED pc->prob_dualpred[i] = cpi->single_pred_count[i] * 255 / (cpi->single_pred_count[i] + cpi->dual_pred_count[i]); if (pc->prob_dualpred[i] < 1) @@ -1532,20 +1403,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) pc->prob_dualpred[i] = 128; } vp8_write_literal(w, pc->prob_dualpred[i], 8); -#else - prob_dual_pred[i] = cpi->single_pred_count[i] * 256 / - (cpi->single_pred_count[i] + cpi->dual_pred_count[i]); - if (prob_dual_pred[i] < 1) - prob_dual_pred[i] = 1; - else if (prob_dual_pred[i] > 255) - prob_dual_pred[i] = 255; - } - else - { - prob_dual_pred[i] = 128; - } - vp8_write_literal(w, prob_dual_pred[i], 8); -#endif } } else if (cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY) @@ -1711,16 +1568,8 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { -#if CONFIG_COMPRED - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); -#else - int t = m[-mis].mbmi.second_ref_frame != INTRA_FRAME; - int l = m[-1 ].mbmi.second_ref_frame != INTRA_FRAME; - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, - prob_dual_pred[t + l]); -#endif } if (mi->second_ref_frame) { @@ -1785,16 +1634,8 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) #if CONFIG_DUALPRED if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { -#if CONFIG_COMPRED - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, get_pred_prob( pc, xd, PRED_DUAL ) ); -#else - int t = m[-mis].mbmi.second_ref_frame != INTRA_FRAME; - int l = m[-1 ].mbmi.second_ref_frame != INTRA_FRAME; - vp8_write(w, mi->second_ref_frame != INTRA_FRAME, - prob_dual_pred[t + l]); -#endif } #endif /* CONFIG_DUALPRED */ break; @@ -1813,17 +1654,6 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) ++prev_m; cpi->mb.partition_info++; } - -#if !CONFIG_COMPRED -#if CONFIG_DUALPRED - if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) - { - pc->prob_dualpred[0] = (prob_dual_pred[0] + pc->prob_dualpred[0] + 1) >> 1; - pc->prob_dualpred[1] = (prob_dual_pred[1] + pc->prob_dualpred[1] + 1) >> 1; - pc->prob_dualpred[2] = (prob_dual_pred[2] + pc->prob_dualpred[2] + 1) >> 1; - } -#endif /* CONFIG_DUALPRED */ -#endif } #endif // CONFIG_SUPERBLOCKS @@ -2258,9 +2088,6 @@ static int default_coef_context_savings(VP8_COMP *cpi) return savings; } -#if CONFIG_COMPRED -// TODO... this will all need changing for new reference frame coding model -#endif int vp8_estimate_entropy_savings(VP8_COMP *cpi) { int savings = 0; @@ -2851,7 +2678,6 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) } } -#if CONFIG_COMPRED // Encode the common prediction model status flag probability updates for // the reference frame if ( pc->frame_type != KEY_FRAME ) @@ -2867,7 +2693,6 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) vp8_write_bit(bc, 0); } } -#endif // Encode the loop filter level and type vp8_write_bit(bc, pc->filter_type); diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index c79ce67df..1600456ec 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -1181,12 +1181,10 @@ static void encode_frame_internal(VP8_COMP *cpi) TOKENEXTRA *tp = cpi->tok; int totalrate; -#if CONFIG_COMPRED // Compute a modified set of reference frame probabilities to use when // prediction fails. These are based on the current genreal estimates for // this frame which may be updated with each itteration of the recode loop. compute_mod_refprobs( cm ); -#endif //#if CONFIG_SEGFEATURES // debug output @@ -1785,9 +1783,7 @@ int vp8cx_encode_inter_macroblock int distortion; unsigned char *segment_id = &xd->mode_info_context->mbmi.segment_id; int seg_ref_active; -#if CONFIG_COMPRED unsigned char ref_pred_flag; -#endif x->skip = 0; @@ -1824,15 +1820,8 @@ int vp8cx_encode_inter_macroblock { unsigned char pred_context; -#if CONFIG_COMPRED pred_context = get_pred_context( cm, xd, PRED_DUAL ); -#else - MB_MODE_INFO *t = &x->e_mbd.mode_info_context - [-cpi->common.mode_info_stride].mbmi; - MB_MODE_INFO *l = &x->e_mbd.mode_info_context[-1].mbmi; - pred_context = (t->second_ref_frame != INTRA_FRAME) + - (l->second_ref_frame != INTRA_FRAME); -#endif + if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME) cpi->single_pred_count[pred_context]++; else @@ -1941,7 +1930,6 @@ int vp8cx_encode_inter_macroblock //#if CONFIG_SEGFEATURES seg_ref_active = segfeature_active( xd, *segment_id, SEG_LVL_REF_FRAME ); -#if CONFIG_COMPRED // SET VARIOUS PREDICTION FLAGS // Did the chosen reference frame match its predicted value. @@ -1949,8 +1937,6 @@ int vp8cx_encode_inter_macroblock get_pred_ref( cm, xd )) ); set_pred_flag( xd, PRED_REF, ref_pred_flag ); -#endif - // If we have just a single reference frame coded for a segment then // exclude from the reference frame counts used to work out // probabilities. NOTE: At the moment we dont support custom trees diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index a4b730442..d8867d2ae 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -3415,124 +3415,6 @@ static void update_golden_frame_stats(VP8_COMP *cpi) } } -#if !CONFIG_COMPRED -//#if 1 -// This function updates the reference frame probability estimates that -// will be used during mode selection -static void update_rd_ref_frame_probs(VP8_COMP *cpi) -{ - VP8_COMMON *cm = &cpi->common; - -#if 0 - const int *const rfct = cpi->recent_ref_frame_usage; - const int rf_intra = rfct[INTRA_FRAME]; - const int rf_inter = rfct[LAST_FRAME] + rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]; - - if (cm->frame_type == KEY_FRAME) - { - cm->prob_intra_coded = 255; - cm->prob_last_coded = 128; - cm->prob_gf_coded = 128; - } - else if (!(rf_intra + rf_inter)) - { - // This is a trap in case this function is called with cpi->recent_ref_frame_usage[] blank. - cm->prob_intra_coded = 63; - cm->prob_last_coded = 128; - cm->prob_gf_coded = 128; - } - else - { - cm->prob_intra_coded = (rf_intra * 255) / (rf_intra + rf_inter); - - if (cm->prob_intra_coded < 1) - cm->prob_intra_coded = 1; - - if ((cm->frames_since_golden > 0) || cpi->source_alt_ref_active) - { - cm->prob_last_coded = rf_inter ? (rfct[LAST_FRAME] * 255) / rf_inter : 128; - - if (cm->prob_last_coded < 1) - cm->prob_last_coded = 1; - - cm->prob_gf_coded = (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) - ? (rfct[GOLDEN_FRAME] * 255) / (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) : 128; - - if (cm->prob_gf_coded < 1) - cm->prob_gf_coded = 1; - } - } - -#else - const int *const rfct = cpi->count_mb_ref_frame_usage; - const int rf_intra = rfct[INTRA_FRAME]; - const int rf_inter = rfct[LAST_FRAME] + rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]; - - if (cm->frame_type == KEY_FRAME) - { - cm->prob_intra_coded = 255; - cm->prob_last_coded = 128; - cm->prob_gf_coded = 128; - } - else if (!(rf_intra + rf_inter)) - { - // This is a trap in case this function is called with - // cpi->recent_ref_frame_usage[] blank. - cm->prob_intra_coded = 63; - cm->prob_last_coded = 128; - cm->prob_gf_coded = 128; - } - else - { - cm->prob_intra_coded = (rf_intra * 255) / (rf_intra + rf_inter); - - if (cm->prob_intra_coded < 1) - cm->prob_intra_coded = 1; - - cm->prob_last_coded = - rf_inter ? (rfct[LAST_FRAME] * 255) / rf_inter : 128; - - if (cm->prob_last_coded < 1) - cm->prob_last_coded = 1; - - cm->prob_gf_coded = - (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) - ? (rfct[GOLDEN_FRAME] * 255) / - (rfct[GOLDEN_FRAME] + rfct[ALTREF_FRAME]) : 128; - - if (cm->prob_gf_coded < 1) - cm->prob_gf_coded = 1; - } - - // update reference frame costs since we can do better than what we got - // last frame. - - if (cpi->common.refresh_alt_ref_frame) - { - cm->prob_intra_coded += 40; - cm->prob_last_coded = 200; - cm->prob_gf_coded = 1; - } - else if (cpi->common.frames_since_golden == 0) - { - cm->prob_last_coded = 214; - cm->prob_gf_coded = 1; - } - else if (cpi->common.frames_since_golden == 1) - { - cm->prob_last_coded = 192; - cm->prob_gf_coded = 220; - } - else if (cpi->source_alt_ref_active) - { - cm->prob_gf_coded = - ( cm->prob_gf_coded > 30 ) ? cm->prob_gf_coded - 20 : 10; - } - -#endif -} -#endif - // 1 = key, 0 = inter static int decide_key_frame(VP8_COMP *cpi) { @@ -3871,7 +3753,6 @@ void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) } -#if CONFIG_COMPRED // This function updates the reference frame prediction stats static void update_refpred_stats( VP8_COMP *cpi ) { @@ -3927,33 +3808,6 @@ static void update_refpred_stats( VP8_COMP *cpi ) xd->mode_info_context++; } - // TEMP / Print out prediction quality numbers - if (0) - { - FILE *f = fopen("predquality.stt", "a"); - int pred0, pred1, pred2; - - - pred0 = ref_pred_count[0][0] + ref_pred_count[0][1]; - if ( pred0 ) - pred0 = (ref_pred_count[0][1] * 255) / pred0; - - pred1 = ref_pred_count[1][0] + ref_pred_count[1][1]; - if ( pred1 ) - pred1 = (ref_pred_count[1][1] * 255) / pred1; - - pred2 = ref_pred_count[2][0] + ref_pred_count[2][1]; - if ( pred2 ) - pred2 = (ref_pred_count[2][1] * 255) / pred2; - - fprintf(f, "%8d: %8d %8d: %8d %8d: %8d %8d\n", - cm->current_video_frame, - pred0, ref_pred_count[0][1], - pred1, ref_pred_count[1][1], - pred2, ref_pred_count[2][1] ); - fclose(f); - } - // From the prediction counts set the probabilities for each context for ( i = 0; i < PREDICTION_PROBS; i++ ) { @@ -3998,7 +3852,6 @@ static void update_refpred_stats( VP8_COMP *cpi ) } } } -#endif static void encode_frame_to_data_rate ( @@ -4156,10 +4009,11 @@ static void encode_frame_to_data_rate } #endif -#if !CONFIG_COMPRED -//#if 1 - update_rd_ref_frame_probs(cpi); -#endif +//#if !CONFIG_COMPRED + // This function has been deprecated for now but we may want to do + // something here at a late date + //update_rd_ref_frame_probs(cpi); +//#endif // Test code for new segment features init_seg_features( cpi ); @@ -5010,11 +4864,9 @@ static void encode_frame_to_data_rate cpi->segmentation_map, cm->MBs ); } -#if CONFIG_COMPRED // Update the common prediction model probabilities to reflect // the what was seen in the current frame. update_refpred_stats( cpi ); -#endif // build the bitstream vp8_pack_bitstream(cpi, dest, size); diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 239780641..8b78986e2 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -601,7 +601,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, // #if CONFIG_COMPRED -// TODO... this will all need changing for new reference frame coding model +// TODO... this will need changing for new reference frame coding model // #endif // Work out the cost assosciated with selecting the reference frame frame_cost = diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 349a47921..10686688c 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -2038,7 +2038,6 @@ static void set_i8x8_block_modes(MACROBLOCK *x, int *modes) } } -#if CONFIG_COMPRED void vp8_estimate_ref_frame_costs(VP8_COMP *cpi, unsigned int * ref_costs ) { VP8_COMMON *cm = &cpi->common; @@ -2096,7 +2095,6 @@ void vp8_estimate_ref_frame_costs(VP8_COMP *cpi, unsigned int * ref_costs ) ref_costs[i] = cost; } } -#endif void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *returnrate, int *returndistortion, int *returnintra, @@ -2158,9 +2156,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int unsigned char *u_buffer[4]; unsigned char *v_buffer[4]; -#if CONFIG_COMPRED unsigned int ref_costs[MAX_REF_FRAMES]; -#endif vpx_memset(&best_mbmode, 0, sizeof(best_mbmode)); vpx_memset(&best_bmodes, 0, sizeof(best_bmodes)); @@ -2226,11 +2222,9 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rd_pick_intra_mbuv_mode(cpi, x, &uv_intra_rate, &uv_intra_rate_tokenonly, &uv_intra_distortion); uv_intra_mode = x->e_mbd.mode_info_context->mbmi.uv_mode; -#if CONFIG_COMPRED // Get estimates of reference frame costs for each reference frame // that depend on the current prediction etc. vp8_estimate_ref_frame_costs( cpi, ref_costs ); -#endif for (mode_index = 0; mode_index < MAX_MODES; mode_index++) { @@ -2622,17 +2616,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int vp8_build_inter16x16_predictors_mby(&x->e_mbd); #if CONFIG_DUALPRED -#if CONFIG_COMPRED dualmode_cost = vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 0 ); -#else - { - MB_MODE_INFO *t = &x->e_mbd.mode_info_context[-cpi->common.mode_info_stride].mbmi; - MB_MODE_INFO *l = &x->e_mbd.mode_info_context[-1].mbmi; - int cnt = (t->second_ref_frame != INTRA_FRAME) + (l->second_ref_frame != INTRA_FRAME); - dualmode_cost = vp8_cost_bit(cm->prob_dualpred[cnt], 0); - } -#endif #endif /* CONFIG_DUALPRED */ if (cpi->active_map_enabled && x->active_ptr[0] == 0) { @@ -2787,17 +2772,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int /* We don't include the cost of the second reference here, because there are only * three options: Last/Golden, ARF/Last or Golden/ARF, or in other words if you * present them in that order, the second one is always known if the first is known */ -#if CONFIG_COMPRED dualmode_cost = vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 1 ); -#else - { - MB_MODE_INFO *t = &x->e_mbd.mode_info_context[-cpi->common.mode_info_stride].mbmi; - MB_MODE_INFO *l = &x->e_mbd.mode_info_context[-1].mbmi; - int cnt = (t->second_ref_frame != INTRA_FRAME) + (l->second_ref_frame != INTRA_FRAME); - dualmode_cost = vp8_cost_bit(cm->prob_dualpred[cnt], 1); - } -#endif } #endif /* CONFIG_DUALPRED */ @@ -2821,12 +2797,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int // Estimate the reference frame signaling cost and add it // to the rolling cost variable. -#if CONFIG_COMPRED rate2 += ref_costs[x->e_mbd.mode_info_context->mbmi.ref_frame]; -#else - rate2 += - x->e_mbd.ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; -#endif if (!disable_skip) { @@ -2907,12 +2878,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int x->e_mbd.mode_info_context->mbmi.mv.as_int = 0; } -#if CONFIG_COMPRED other_cost += ref_costs[x->e_mbd.mode_info_context->mbmi.ref_frame]; -#else - other_cost += - x->e_mbd.ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; -#endif /* Calculate the final y RD estimate for this mode */ best_yrd = RDCOST(x->rdmult, x->rddiv, (rate2-rate_uv-other_cost), |