summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-04-20 10:17:57 -0700
committerJohn Koleszar <jkoleszar@google.com>2012-04-20 11:09:12 -0700
commit8e858f90f36e5f00f63fe2f386e50a2f2a446872 (patch)
tree67b96fc23cedf3f72c008cb5cc75dc3079742355
parentc311b3b3a9ceb0e45e0d5969bb20f1e95dbd9059 (diff)
downloadlibvpx-8e858f90f36e5f00f63fe2f386e50a2f2a446872.tar.gz
vp8_change_config: don't force kf with spatial resampling
Look for changes in the codec's configured w/h instead of its active w/h when forcing keyframes. Otherwise calls to vp8_change_config() will force a keyframe when spatial resampling is active. Change-Id: Ie0d20e70507004e714ad40b640aa5b434251eb32
-rw-r--r--vp8/encoder/onyx_if.c15
-rw-r--r--vp8/encoder/onyx_int.h2
2 files changed, 9 insertions, 8 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 7bf05e0ae..ff01ff81e 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1418,6 +1418,9 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
vp8_setup_version(cm);
}
+ last_w = cpi->oxcf.Width;
+ last_h = cpi->oxcf.Height;
+
cpi->oxcf = *oxcf;
switch (cpi->oxcf.Mode)
@@ -1617,14 +1620,14 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
- last_w = cm->Width;
- last_h = cm->Height;
-
cm->Width = cpi->oxcf.Width;
cm->Height = cpi->oxcf.Height;
- cm->horiz_scale = cpi->horiz_scale;
- cm->vert_scale = cpi->vert_scale;
+ /* TODO(jkoleszar): if an internal spatial resampling is active,
+ * and we downsize the input image, maybe we should clear the
+ * internal scale immediately rather than waiting for it to
+ * correct.
+ */
// VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs)
if (cpi->oxcf.Sharpness > 7)
@@ -1645,7 +1648,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
}
- if (last_w != cm->Width || last_h != cm->Height)
+ if (last_w != cpi->oxcf.Width || last_h != cpi->oxcf.Height)
cpi->force_next_frame_intra = 1;
if (((cm->Width + 15) & 0xfffffff0) !=
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index c7a1de8e8..ea5980146 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -485,8 +485,6 @@ typedef struct VP8_COMP
int goldfreq;
int auto_worst_q;
int cpu_used;
- int horiz_scale;
- int vert_scale;
int pass;