shithub: libvpx

Download patch

ref: e8a4a3e2b1a4b6ff62a33ca47841617c0e75e288
parent: 6ddbc845cc85c8835e3938834b6ba1ca386a4855
author: Marco <[email protected]>
date: Fri Sep 11 07:23:26 EDT 2015

Avoid scaling last_source, unless needed.

Save some encoding time, for the case of spatial layers
or under dynamic resizing mode.

Change-Id: If4a8eb6f0376c3d2dde8465fde6bfd86ab704920

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3201,7 +3201,13 @@
   cpi->Source = vp9_scale_if_required(cm,
                                       cpi->un_scaled_source,
                                       &cpi->scaled_source);
-  if (cpi->unscaled_last_source != NULL)
+
+  // Avoid scaling last_source unless its needed.
+  // Last source is currently only used for screen-content mode,
+  // or if partition_search_type == SOURCE_VAR_BASED_PARTITION.
+  if (cpi->unscaled_last_source != NULL &&
+      (cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
+      cpi->sf.partition_search_type == SOURCE_VAR_BASED_PARTITION))
     cpi->Last_Source = vp9_scale_if_required(cm,
                                              cpi->unscaled_last_source,
                                              &cpi->scaled_last_source);