summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_scale.h
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2014-06-16 16:22:28 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-06-23 11:45:13 -0700
commit8c1f071f1ea03b33bcf31edc1eec3d549d134b37 (patch)
tree7979527caa82ca03bb0df36cc5cf72ffd5fa7e8f /vp9/common/vp9_scale.h
parent97d0cb58f845571755182006ec79223d2781233c (diff)
downloadlibvpx-8c1f071f1ea03b33bcf31edc1eec3d549d134b37.tar
libvpx-8c1f071f1ea03b33bcf31edc1eec3d549d134b37.tar.gz
libvpx-8c1f071f1ea03b33bcf31edc1eec3d549d134b37.tar.bz2
libvpx-8c1f071f1ea03b33bcf31edc1eec3d549d134b37.zip
Allocate buffers based on correct chroma format
The encoder currently allocates frame buffers before it establishes what the chroma sub-sampling factor is, always allocating based on the 4:4:4 format. This patch detects the chroma format as early as possible allowing the encoder to allocate buffers of the correct size. Future patches will change the encoder to allocate frame buffers on demand to further reduce the memory profile of the encoder and rationalize the buffer management in the encoder and decoder. Change-Id: Ifd41dd96e67d0011719ba40fada0bae74f3a0d57
Diffstat (limited to 'vp9/common/vp9_scale.h')
-rw-r--r--vp9/common/vp9_scale.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vp9/common/vp9_scale.h b/vp9/common/vp9_scale.h
index a9dda1889..04aae659f 100644
--- a/vp9/common/vp9_scale.h
+++ b/vp9/common/vp9_scale.h
@@ -46,8 +46,8 @@ static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) {
}
static INLINE int vp9_is_scaled(const struct scale_factors *sf) {
- return sf->x_scale_fp != REF_NO_SCALE ||
- sf->y_scale_fp != REF_NO_SCALE;
+ return vp9_is_valid_scale(sf) &&
+ (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
}
#ifdef __cplusplus