diff options
author | Paul Wilkins <paulwilkins@google.com> | 2012-10-26 09:42:37 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2012-10-26 09:42:37 -0700 |
commit | 7d921524d680b08ce5749fdbca4d8e68a433d64d (patch) | |
tree | 008516f2c6bc209826324a63447bf0629a6650d8 /vp8/encoder/rdopt.c | |
parent | 47fb14743dc05b77f8902bcff6580f5c3136b6af (diff) | |
parent | ba30e7746e49a63e9802ae1e86f106d5342ab181 (diff) | |
download | libvpx-7d921524d680b08ce5749fdbca4d8e68a433d64d.tar libvpx-7d921524d680b08ce5749fdbca4d8e68a433d64d.tar.gz libvpx-7d921524d680b08ce5749fdbca4d8e68a433d64d.tar.bz2 libvpx-7d921524d680b08ce5749fdbca4d8e68a433d64d.zip |
Merge "Explicit MV reference experiment." into experimental
Diffstat (limited to 'vp8/encoder/rdopt.c')
-rw-r--r-- | vp8/encoder/rdopt.c | 103 |
1 files changed, 5 insertions, 98 deletions
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index b2207cb1f..f72697728 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -3011,70 +3011,6 @@ void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffse } } -void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, - int_mv *best_ref_mv, int_mv *second_best_ref_mv) { - MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; - MV mv; - - if (mbmi->mode == SPLITMV) { - int i; - - for (i = 0; i < x->partition_info->count; i++) { - if (x->partition_info->bmi[i].mode == NEW4X4) { - if (x->e_mbd.allow_high_precision_mv) { - mv.row = (x->partition_info->bmi[i].mv.as_mv.row - - best_ref_mv->as_mv.row); - mv.col = (x->partition_info->bmi[i].mv.as_mv.col - - best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount, 1); - if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { - mv.row = (x->partition_info->bmi[i].second_mv.as_mv.row - - second_best_ref_mv->as_mv.row); - mv.col = (x->partition_info->bmi[i].second_mv.as_mv.col - - second_best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &second_best_ref_mv->as_mv, - &cpi->NMVcount, 1); - } - } else { - mv.row = (x->partition_info->bmi[i].mv.as_mv.row - - best_ref_mv->as_mv.row); - mv.col = (x->partition_info->bmi[i].mv.as_mv.col - - best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount, 0); - if (x->e_mbd.mode_info_context->mbmi.second_ref_frame) { - mv.row = (x->partition_info->bmi[i].second_mv.as_mv.row - - second_best_ref_mv->as_mv.row); - mv.col = (x->partition_info->bmi[i].second_mv.as_mv.col - - second_best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &second_best_ref_mv->as_mv, - &cpi->NMVcount, 0); - } - } - } - } - } else if (mbmi->mode == NEWMV) { - if (x->e_mbd.allow_high_precision_mv) { - mv.row = (mbmi->mv[0].as_mv.row - best_ref_mv->as_mv.row); - mv.col = (mbmi->mv[0].as_mv.col - best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount, 1); - if (mbmi->second_ref_frame) { - mv.row = (mbmi->mv[1].as_mv.row - second_best_ref_mv->as_mv.row); - mv.col = (mbmi->mv[1].as_mv.col - second_best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &second_best_ref_mv->as_mv, &cpi->NMVcount, 1); - } - } else { - mv.row = (mbmi->mv[0].as_mv.row - best_ref_mv->as_mv.row); - mv.col = (mbmi->mv[0].as_mv.col - best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount, 0); - if (mbmi->second_ref_frame) { - mv.row = (mbmi->mv[1].as_mv.row - second_best_ref_mv->as_mv.row); - mv.col = (mbmi->mv[1].as_mv.col - second_best_ref_mv->as_mv.col); - vp8_increment_nmv(&mv, &second_best_ref_mv->as_mv, &cpi->NMVcount, 0); - } - } - } -} - static void set_i8x8_block_modes(MACROBLOCK *x, int modes[2][4]) { int i; MACROBLOCKD *xd = &x->e_mbd; @@ -3297,9 +3233,6 @@ void setup_buffer_inter(VP8_COMP *cpi, MACROBLOCK *x, int idx, int frame_type, int recon_yoffset, int recon_uvoffset, int_mv frame_nearest_mv[4], int_mv frame_near_mv[4], int_mv frame_best_ref_mv[4], -#if CONFIG_NEWBESTREFMV - int_mv ref_mv[MAX_REF_FRAMES], -#endif int frame_mdcounts[4][4], unsigned char *y_buffer[4], unsigned char *u_buffer[4], unsigned char *v_buffer[4]) { @@ -3319,15 +3252,11 @@ void setup_buffer_inter(VP8_COMP *cpi, MACROBLOCK *x, int idx, int frame_type, v_buffer[frame_type] = yv12->v_buffer + recon_uvoffset; #if CONFIG_NEWBESTREFMV - // Update stats on relative distance of chosen vector to the - // possible best reference vectors. - { - find_mv_refs(xd, xd->mode_info_context, - xd->prev_mode_info_context, - frame_type, - mbmi->ref_mvs[frame_type], - cpi->common.ref_frame_sign_bias ); - } + find_mv_refs(xd, xd->mode_info_context, + xd->prev_mode_info_context, + frame_type, + mbmi->ref_mvs[frame_type], + cpi->common.ref_frame_sign_bias); vp8_find_best_ref_mvs(xd, y_buffer[frame_type], yv12->y_stride, @@ -3335,7 +3264,6 @@ void setup_buffer_inter(VP8_COMP *cpi, MACROBLOCK *x, int idx, int frame_type, &frame_best_ref_mv[frame_type], &frame_nearest_mv[frame_type], &frame_near_mv[frame_type]); - ref_mv[frame_type].as_int = frame_best_ref_mv[frame_type].as_int; #endif } @@ -3377,10 +3305,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int #if CONFIG_PRED_FILTER int best_filter_state; #endif -#if CONFIG_NEWBESTREFMV - int_mv ref_mv[MAX_REF_FRAMES] = {{0}}; -#endif - int switchable_filter_index = 0; MB_PREDICTION_MODE uv_intra_mode; @@ -3424,9 +3348,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int setup_buffer_inter(cpi, x, cpi->common.lst_fb_idx, LAST_FRAME, recon_yoffset, recon_uvoffset, frame_mv[NEARESTMV], frame_mv[NEARMV], frame_best_ref_mv, -#if CONFIG_NEWBESTREFMV - ref_mv, -#endif frame_mdcounts, y_buffer, u_buffer, v_buffer); } @@ -3434,9 +3355,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int setup_buffer_inter(cpi, x, cpi->common.gld_fb_idx, GOLDEN_FRAME, recon_yoffset, recon_uvoffset, frame_mv[NEARESTMV], frame_mv[NEARMV], frame_best_ref_mv, -#if CONFIG_NEWBESTREFMV - ref_mv, -#endif frame_mdcounts, y_buffer, u_buffer, v_buffer); } @@ -3444,9 +3362,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int setup_buffer_inter(cpi, x, cpi->common.alt_fb_idx, ALTREF_FRAME, recon_yoffset, recon_uvoffset, frame_mv[NEARESTMV], frame_mv[NEARMV], frame_best_ref_mv, -#if CONFIG_NEWBESTREFMV - ref_mv, -#endif frame_mdcounts, y_buffer, u_buffer, v_buffer); } @@ -3500,10 +3415,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int mbmi->ref_frame = vp8_mode_order[mode_index].ref_frame; mbmi->second_ref_frame = vp8_mode_order[mode_index].second_ref_frame; is_comp_pred = x->e_mbd.mode_info_context->mbmi.second_ref_frame != 0; -#if CONFIG_NEWBESTREFMV - mbmi->ref_mv = ref_mv[mbmi->ref_frame]; - mbmi->second_ref_mv = ref_mv[mbmi->second_ref_frame]; -#endif #if CONFIG_PRED_FILTER mbmi->pred_filter_enabled = 0; #endif @@ -4237,10 +4148,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int // macroblock modes vpx_memcpy(mbmi, &best_mbmode, sizeof(MB_MODE_INFO)); -#if CONFIG_NEWBESTREFMV - mbmi->ref_mv = ref_mv[best_mbmode.ref_frame]; - mbmi->second_ref_mv = ref_mv[best_mbmode.second_ref_frame]; -#endif if (best_mbmode.mode == B_PRED) { for (i = 0; i < 16; i++) { xd->mode_info_context->bmi[i].as_mode = best_bmodes[i].as_mode; |