Index: source/libvpx/vp8/encoder/pickinter.c |
=================================================================== |
--- source/libvpx/vp8/encoder/pickinter.c (revision 290053) |
+++ source/libvpx/vp8/encoder/pickinter.c (working copy) |
@@ -40,7 +40,6 @@ |
extern int vp8_cost_mv_ref(MB_PREDICTION_MODE m, const int near_mv_ref_ct[4]); |
- |
int vp8_skip_fractional_mv_step(MACROBLOCK *mb, BLOCK *b, BLOCKD *d, |
int_mv *bestmv, int_mv *ref_mv, |
int error_per_bit, |
@@ -506,16 +505,11 @@ |
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, *distortion2); |
- /* Adjust rd to bias to ZEROMV */ |
- if(this_mode == ZEROMV) |
+ // Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame. |
+ if (this_mode == ZEROMV && |
+ x->e_mbd.mode_info_context->mbmi.ref_frame == LAST_FRAME && |
+ cpi->closest_reference_frame == LAST_FRAME) |
{ |
- /* Bias to ZEROMV on LAST_FRAME reference when it is available. */ |
- if ((cpi->ref_frame_flags & VP8_LAST_FRAME & |
- cpi->common.refresh_last_frame) |
- && x->e_mbd.mode_info_context->mbmi.ref_frame != LAST_FRAME) |
- rd_adj = 100; |
- |
- // rd_adj <= 100 |
this_rd = ((int64_t)this_rd) * rd_adj / 100; |
} |
@@ -694,6 +688,13 @@ |
*/ |
calculate_zeromv_rd_adjustment(cpi, x, &rd_adjustment); |
+#if CONFIG_TEMPORAL_DENOISING |
+ if (cpi->oxcf.noise_sensitivity) { |
+ rd_adjustment = (int)(rd_adjustment * |
+ cpi->denoiser.denoise_pars.pickmode_mv_bias / 100); |
+ } |
+#endif |
+ |
/* if we encode a new mv this is important |
* find the best new motion vector |
*/ |
@@ -1168,7 +1169,6 @@ |
#if CONFIG_TEMPORAL_DENOISING |
if (cpi->oxcf.noise_sensitivity) |
{ |
- int uv_denoise = (cpi->oxcf.noise_sensitivity == 2) ? 1 : 0; |
int block_index = mb_row * cpi->common.mb_cols + mb_col; |
if (x->best_sse_inter_mode == DC_PRED) |
{ |
@@ -1183,9 +1183,8 @@ |
vp8_denoiser_denoise_mb(&cpi->denoiser, x, best_sse, zero_mv_sse, |
recon_yoffset, recon_uvoffset, |
&cpi->common.lf_info, mb_row, mb_col, |
- block_index, uv_denoise); |
+ block_index); |
- |
/* Reevaluate ZEROMV after denoising. */ |
if (best_mbmode.ref_frame == INTRA_FRAME && |
x->best_zeromv_reference_frame != INTRA_FRAME) |