]> granicus.if.org Git - libvpx/commitdiff
vp8: restrict 1st pass cpu_used range
authorJames Zern <jzern@google.com>
Thu, 30 May 2019 22:58:12 +0000 (15:58 -0700)
committerJames Zern <jzern@google.com>
Fri, 31 May 2019 03:16:46 +0000 (20:16 -0700)
< 4 isn't meaningful in the first pass; additional analysis will be
done, but thrown out, unnecessarily increasing the runtime.

Change-Id: Ic3de77e3eaa7a8a3371f76f84693e9655c60fdba

vp8/vp8_cx_iface.c

index d65bf9652e41acd231e6f0499b057547c473552a..bda109e7a3b145aaf09d50af98b2cb2964775fdc 100644 (file)
@@ -370,6 +370,9 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
 #endif
 
   oxcf->cpu_used = vp8_cfg.cpu_used;
+  if (cfg.g_pass == VPX_RC_FIRST_PASS) {
+    oxcf->cpu_used = VPXMAX(4, oxcf->cpu_used);
+  }
   oxcf->encode_breakout = vp8_cfg.static_thresh;
   oxcf->play_alternate = vp8_cfg.enable_auto_alt_ref;
   oxcf->noise_sensitivity = vp8_cfg.noise_sensitivity;