From 667bc5c161625dfd6c3d9c0150a9e01026ba3b45 Mon Sep 17 00:00:00 2001 From: Firefly Date: Fri, 31 Jul 2015 14:24:48 +0530 Subject: [PATCH] [external/libhevc] Align pic_width_in_luma_samples and pic_width_in_luma_samples to 8 Spec mandates these to be multiples of min_cb_size. Bug fix: 22278703 Change-Id: I17f0c2242519a9277598b8fb5b05717e1ce7469b (cherry picked from commit dde3d8a3c7638dcc024ce25fdab420703a53f16b) --- external/libhevc/decoder/ihevcd_parse_headers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/external/libhevc/decoder/ihevcd_parse_headers.c b/external/libhevc/decoder/ihevcd_parse_headers.c index 2f84d12166..00fc9cb63c 100644 --- a/external/libhevc/decoder/ihevcd_parse_headers.c +++ b/external/libhevc/decoder/ihevcd_parse_headers.c @@ -1257,6 +1257,12 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) if((0 >= ps_sps->i2_pic_width_in_luma_samples) || (0 >= ps_sps->i2_pic_height_in_luma_samples)) return IHEVCD_INVALID_PARAMETER; + /* i2_pic_width_in_luma_samples and i2_pic_height_in_luma_samples + should be multiples of min_cb_size. Here these are aligned to 8, + i.e. smallest CB size */ + ps_sps->i2_pic_width_in_luma_samples = ALIGN8(ps_sps->i2_pic_width_in_luma_samples); + ps_sps->i2_pic_height_in_luma_samples = ALIGN8(ps_sps->i2_pic_height_in_luma_samples); + if((ps_sps->i2_pic_width_in_luma_samples > ps_codec->i4_max_wd) || (ps_sps->i2_pic_width_in_luma_samples * ps_sps->i2_pic_height_in_luma_samples > ps_codec->i4_max_wd * ps_codec->i4_max_ht) ||