]> granicus.if.org Git - libvpx/commitdiff
Make cpi->speed always positive
authorDeb Mukherjee <debargha@google.com>
Fri, 14 Feb 2014 19:15:29 +0000 (11:15 -0800)
committerDeb Mukherjee <debargha@google.com>
Fri, 14 Feb 2014 22:28:58 +0000 (14:28 -0800)
Minor fix to ensure that positive and negative cpu_used
values produce the same output.

Change-Id: I9157d05cb9a7c0bd57a4d8a9f268205a825b9b0b

vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_rdopt.c

index 84a0e6069af2fd3d4c4853d4b6e1dba8b15a2326..69372bd59a31eed6aba9b81f0ccd5406966bdd4f 100644 (file)
@@ -1496,7 +1496,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
     update_layer_context_change_config(cpi, cpi->oxcf.target_bandwidth);
   }
 
-  cpi->speed = cpi->oxcf.cpu_used;
+  cpi->speed = abs(cpi->oxcf.cpu_used);
 
   if (cpi->oxcf.lag_in_frames == 0) {
     // Force allow_lag to 0 if lag_in_frames is 0.
index dfe39e8716a30ad0e8cdc5e870d33c6d47b937dd..a3e879b821e100d32a892d1b6f8c57f056f1cfa0 100644 (file)
@@ -447,7 +447,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
       x->pred_sse[ref] = sse;
 
     // Fast approximate the modelling function.
-    if (cpi->oxcf.cpu_used < -4) {
+    if (cpi->speed > 4) {
       int rate;
       int64_t dist;
       int64_t square_error = sse;