Alloc extra bytes for bits buf for parse optimzation am: 4cf597a518 am: 847da962ca am: 1a4160b448

am: 0f0d14ee95

Change-Id: I41874af1fe263bd3b532d7034b0294d143fcf2b1
This commit is contained in:
Naveen Kumar P 2017-10-10 01:20:50 +00:00 • committed by android-build-merger
commit 1f1b528420

View file

@ -1215,7 +1215,7 @@ WORD32 ihevcd_allocate_static_bufs(iv_obj_t **pps_codec_obj,
/* Request memory for static bitstream buffer which holds bitstream after emulation prevention */
size = MIN_BITSBUF_SIZE;
pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
RETURN_IF((NULL == pv_buf), IV_FAIL);
ps_codec->pu1_bitsbuf_static = pv_buf;
ps_codec->u4_bitsbuf_size_static = size;
@ -1908,7 +1908,7 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec)
size = wd * ht;
if(size > MIN_BITSBUF_SIZE)
{
pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
RETURN_IF((NULL == pv_buf), IV_FAIL);
ps_codec->pu1_bitsbuf_dynamic = pv_buf;
ps_codec->u4_bitsbuf_size_dynamic = size;