From: Jim Bankoski Date: Tue, 28 Jan 2014 21:51:06 +0000 (-0800) Subject: Reintroduce modelling for some speeds X-Git-Tag: v1.4.0~2567^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79af1858911bff4b151e177fc3f59c986d4e1572;p=libvpx Reintroduce modelling for some speeds Change-Id: Ia8fa3961eec34545465018281dc022bc6f73869a --- diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index ebe5f80f2..8d1057cc2 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -419,12 +419,22 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, struct macroblock_plane *const p = &x->plane[i]; struct macroblockd_plane *const pd = &xd->plane[i]; const BLOCK_SIZE bs = get_plane_block_size(bsize, pd); + (void) cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, &sse); + if (i == 0) x->pred_sse[ref] = sse; - - dist_sum += (int)sse; + if (cpi->compressor_speed > 2) { + dist_sum += (int)sse; + } else { + int rate; + int64_t dist; + model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs], + pd->dequant[1] >> 3, &rate, &dist); + rate_sum += rate; + dist_sum += (int)dist; + } } *out_rate_sum = rate_sum;