aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2015-12-15 23:16:20 +0000
committerThe Android Automerger <android-build@google.com>2015-12-17 12:29:30 -0800
commit9dc6202e5fc43e6d40f3118b3ead8d744675e18c (patch)
tree6925571d0719c04ac012e4ce0917e243ba6321a0
parent4b07ee7d2f0c7ee3f28ea8d64ccee5c2c4da93fc (diff)
downloadlibhevc-android-5.1.1_r33.tar.gz
Fix the frame size alignmentsandroid-5.1.1_r33
Change I59c996161053e313c873381c5bf6f8c36488483f aligned the number of luma samples to 64byte boundaries when calculating and creating the buffers. Unfortunately, it doesn't change all instances of that calculation, leading to mismatches between creation/allocation/destruction. Fixes android.media.cts.DecoderTest#testEOSBehaviorHEVC and android.media.cts.DecoderTest#testCodecEarlyEOSHEVC Bug: 24686670 Bug: 25070493 Bug: 25995793 Bug: 26217939 Bug: 26239053 Change-Id: I5b9dd682e08cfb03d2bc54829c4908976251dee7
-rw-r--r--decoder/ihevcd_utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/decoder/ihevcd_utils.c b/decoder/ihevcd_utils.c
index 6a58cb9..733b3c8 100644
--- a/decoder/ihevcd_utils.c
+++ b/decoder/ihevcd_utils.c
@@ -551,8 +551,8 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec)
/* Initialize MV Bank buffer manager */
ps_sps = ps_codec->s_parse.ps_sps;
- pic_size = ps_sps->i2_pic_width_in_luma_samples *
- ps_sps->i2_pic_height_in_luma_samples;
+ pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
+ ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
/* Compute the number of MB Bank buffers needed */
@@ -673,8 +673,8 @@ IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec)
/* Compute the number of MB Bank buffers needed */
level = ps_codec->i4_init_level;
max_dpb_size = ihevcd_get_dpb_size(level,
- ps_sps->i2_pic_width_in_luma_samples *
- ps_sps->i2_pic_height_in_luma_samples);
+ ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
+ ALIGN64(ps_sps->i2_pic_height_in_luma_samples));
/* Allocate one extra MV Bank to handle current frame
* In case of asynchronous parsing and processing, number of buffers should increase here