X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Flibvpx%2Fsource%2Flibvpx%2Fvp8%2Fencoder%2Fpickinter.c;h=9d5556dcdeeffe37f95978e01837ebbfa32da7be;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=43f8957d14172d96fb2b46aea4603a9d2ad7aa69;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/libvpx/source/libvpx/vp8/encoder/pickinter.c b/src/third_party/libvpx/source/libvpx/vp8/encoder/pickinter.c index 43f8957..9d5556d 100644 --- a/src/third_party/libvpx/source/libvpx/vp8/encoder/pickinter.c +++ b/src/third_party/libvpx/source/libvpx/vp8/encoder/pickinter.c @@ -516,9 +516,8 @@ static int evaluate_inter_mode(unsigned int* sse, int rate2, int* distortion2, // 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 && - (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME)) - { - this_rd = ((int64_t)this_rd) * rd_adj / 100; + (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME)) { + this_rd = ((int64_t)this_rd) * rd_adj / 100; } check_for_encode_breakout(*sse, x); @@ -1083,7 +1082,14 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, { /* Store for later use by denoiser. */ - if (this_mode == ZEROMV && sse < zero_mv_sse ) + // Dont' denoise with GOLDEN OR ALTREF is they are old reference + // frames (greater than MAX_GF_ARF_DENOISE_RANGE frames in past). + int skip_old_reference = ((this_ref_frame != LAST_FRAME) && + (cpi->common.current_video_frame - + cpi->current_ref_frames[this_ref_frame] > + MAX_GF_ARF_DENOISE_RANGE)) ? 1 : 0; + if (this_mode == ZEROMV && sse < zero_mv_sse && + !skip_old_reference) { zero_mv_sse = sse; x->best_zeromv_reference_frame = @@ -1092,7 +1098,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, /* Store the best NEWMV in x for later use in the denoiser. */ if (x->e_mbd.mode_info_context->mbmi.mode == NEWMV && - sse < best_sse) + sse < best_sse && !skip_old_reference) { best_sse = sse; x->best_sse_inter_mode = NEWMV;