ref: 5750f78d6107f924ca4c808c95d7a6d31f59892d
parent: e727bcf7ceaa96c96bacd4a36b2a4ee684fb07b7
parent: 9e190dfbfe5a5d4662370f6580ff08de3c0a8d01
author: Jim Bankoski <[email protected]>
date: Fri Feb 14 04:08:52 EST 2014
Merge "fast approximate model_rd_from_var_lapndz"
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -444,8 +444,21 @@
if (i == 0)
x->pred_sse[ref] = sse;
- if (cpi->sf.use_pick_mode) {
- dist_sum += (int)sse;
+
+ // Fast approximate the modelling function.
+ if (cpi->oxcf.cpu_used < -4) {
+ int rate;
+ int64_t dist;
+ int64_t square_error = sse;
+ int quantizer = (pd->dequant[1] >> 3);
+
+ if ( quantizer < 120)
+ rate = (square_error * (280-quantizer) )>> 8;
+ else
+ rate = 0;
+ dist = (square_error * quantizer) >> 8;
+ rate_sum += rate;
+ dist_sum += dist;
} else {
int rate;
int64_t dist;