From: Urvang Joshi Date: Wed, 19 Oct 2016 18:25:52 +0000 (+0000) Subject: Merge changes I3922dea2,I3bab2848,I21f7478a,Ida5de713,Ib9f0eefe, ... into nextgenv2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66b1fcc92402a2bed05040bce6ecda42178d2f61;p=libvpx Merge changes I3922dea2,I3bab2848,I21f7478a,Ida5de713,Ib9f0eefe, ... into nextgenv2 * changes: Fix warnings reported by -Wshadow: Part4: main directory Fix warnings reported by -Wshadow: Part3: test/ directory Fix warnings reported by -Wshadow: Part2b: more from av1 directory Fix warnings reported by -Wshadow: Part2: av1 directory Fix warnings reported by -Wshadow: Part1b: scan_order struct and variable Fix warnings reported by -Wshadow: Part1: aom_dsp directory Move STAT_TYPE enum to source file. Code cleanup: mainly rd_pick_partition and methods called from there. --- 66b1fcc92402a2bed05040bce6ecda42178d2f61 diff --cc av1/encoder/rdopt.c index fef590128,8399a850a..463570a4a --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@@ -7799,8 -7810,49 +7810,8 @@@ void av1_rd_pick_intra_mode_sb(const AV rd_cost->rdcost = RDCOST(x->rdmult, x->rddiv, rd_cost->rate, rd_cost->dist); } -// This function is designed to apply a bias or adjustment to an rd value based -// on the relative variance of the source and reconstruction. -#define LOW_VAR_THRESH 16 -#define VLOW_ADJ_MAX 25 -#define VHIGH_ADJ_MAX 8 -static void rd_variance_adjustment(MACROBLOCK *x, int64_t *this_rd, - MV_REFERENCE_FRAME ref_frame, - unsigned int source_variance) { - unsigned int recon_variance = x->recon_variance; - unsigned int absvar_diff = 0; - int64_t var_error = 0; - int64_t var_factor = 0; - - if (*this_rd == INT64_MAX) return; - - if ((source_variance + recon_variance) > LOW_VAR_THRESH) { - absvar_diff = (source_variance > recon_variance) - ? (source_variance - recon_variance) - : (recon_variance - source_variance); - - var_error = ((int64_t)200 * source_variance * recon_variance) / - (((int64_t)source_variance * source_variance) + - ((int64_t)recon_variance * recon_variance)); - var_error = 100 - var_error; - } - - // Source variance above a threshold and ref frame is intra. - // This case is targeted mainly at discouraging intra modes that give rise - // to a predictor with a low spatial complexity compared to the source. - if ((source_variance > LOW_VAR_THRESH) && (ref_frame == INTRA_FRAME) && - (source_variance > recon_variance)) { - var_factor = AOMMIN(absvar_diff, AOMMIN(VLOW_ADJ_MAX, var_error)); - // A second possible case of interest is where the source variance - // is very low and we wish to discourage false texture or motion trails. - } else if ((source_variance < (LOW_VAR_THRESH >> 1)) && - (recon_variance > source_variance)) { - var_factor = AOMMIN(absvar_diff, AOMMIN(VHIGH_ADJ_MAX, var_error)); - } - *this_rd += (*this_rd * var_factor) / 100; -} - // Do we have an internal image edge (e.g. formatting bars). - int av1_internal_image_edge(AV1_COMP *cpi) { + int av1_internal_image_edge(const AV1_COMP *cpi) { return (cpi->oxcf.pass == 2) && ((cpi->twopass.this_frame_stats.inactive_zone_rows > 0) || (cpi->twopass.this_frame_stats.inactive_zone_cols > 0));