shithub: libvpx

Download patch

ref: 4679af1ce96c5eeaac74febb7471d56ff8a9d1a7
parent: ecd34e6494599fb44ccc1f68a7c4ee988bc0307c
parent: be3489eaf46dc1501f11a694033931228f4df546
author: Adrian Grange <[email protected]>
date: Thu Sep 3 17:44:45 EDT 2015

Merge "Fix to dynamic resize mode under change_config()."

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1453,6 +1453,8 @@
 void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
   VP9_COMMON *const cm = &cpi->common;
   RATE_CONTROL *const rc = &cpi->rc;
+  int last_w = cpi->oxcf.width;
+  int last_h = cpi->oxcf.height;
 
   if (cm->profile != oxcf->profile)
     cm->profile = oxcf->profile;
@@ -1505,8 +1507,10 @@
 
   cm->display_width = cpi->oxcf.width;
   cm->display_height = cpi->oxcf.height;
-  cm->width = cpi->oxcf.width;
-  cm->height = cpi->oxcf.height;
+  if (last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) {
+    cm->width = cpi->oxcf.width;
+    cm->height = cpi->oxcf.height;
+  }
 
   if (cpi->initial_width) {
     if (cm->width > cpi->initial_width || cm->height > cpi->initial_height) {