summaryrefslogtreecommitdiffstats
path: root/encoder
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2015-05-25 14:42:53 +0300
committerLajos Molnar <lajos@google.com>2015-06-03 08:35:02 -0700
commitdf06a38c5bc7fdcb741b387b6bdfd3377d3f3164 (patch)
tree762168884b9a37043e3b1f54b0907093ceabb450 /encoder
parenteb7b34579c51cc416ad8b84436e38cbbfeda835e (diff)
downloadandroid_external_libavc-df06a38c5bc7fdcb741b387b6bdfd3377d3f3164.tar.gz
android_external_libavc-df06a38c5bc7fdcb741b387b6bdfd3377d3f3164.tar.bz2
android_external_libavc-df06a38c5bc7fdcb741b387b6bdfd3377d3f3164.zip
Include space for chroma in the padding allocated in ih264e_get_total_pic_buf_size
Chroma is already accounted for in e.g. num_samples by multiplying the number of luma samples by 3/2, so include it in the padding calculation as well. This fixes encoding 176x144 at level 1.0 - normally this isn't an issue since the padding is a bit overestimated, but for this particular resolution/level combination, it fails unless this is calculated properly. Change-Id: Id5df6e5aee4d3d78f4c28a3b7d5fed6fe42a1f2c
Diffstat (limited to 'encoder')
-rw-r--r--encoder/ih264e_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/encoder/ih264e_utils.c b/encoder/ih264e_utils.c
index f0086cb..44e4cc0 100644
--- a/encoder/ih264e_utils.c
+++ b/encoder/ih264e_utils.c
@@ -366,7 +366,7 @@ WORD32 ih264e_get_total_pic_buf_size(WORD32 pic_size,
size = num_samples * max_num_bufs;
/* Account for padding area */
- size += ((pad * pad) + pad * (max_wd + min_ht)) * max_num_bufs;
+ size += ((pad * pad) + pad * (max_wd + min_ht)) * 3 / 2 * max_num_bufs;
return size;
}