summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorMarco <marpan@chromium.org>2015-09-03 12:55:51 -0700
committerMarco <marpan@chromium.org>2015-09-03 13:30:26 -0700
commitbe3489eaf46dc1501f11a694033931228f4df546 (patch)
treeb3f5de4ee42cadd3fec6975fe4fc719902dec61d /vp9
parente5732bcf0595ae85c658a7acac46a8230230772e (diff)
downloadlibvpx-be3489eaf46dc1501f11a694033931228f4df546.tar
libvpx-be3489eaf46dc1501f11a694033931228f4df546.tar.gz
libvpx-be3489eaf46dc1501f11a694033931228f4df546.tar.bz2
libvpx-be3489eaf46dc1501f11a694033931228f4df546.zip
Fix to dynamic resize mode under change_config().
If the encoder dynamic resize is triggered and change config() is then called, it will reset the current (resized) codec width/height back to the the config (unresized) width/height (which will then prevent the resizing action from occurring in encoder_loop). Avoid this by checking for a change in the config width/height before resetting the cm->width/height. Change-Id: Id9d50c0ee8a943abe4b6c72bbaa02d9696f93177
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encoder.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 40d0ce905..a9622cbd8 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1453,6 +1453,8 @@ static void realloc_segmentation_maps(VP9_COMP *cpi) {
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 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
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) {