Merge "mvc: Set minimum bitstream buffser size correctly"

This commit is contained in:
Treehugger Robot 2022-08-14 20:41:32 +00:00 committed by Gerrit Code Review
commit 5d36aabe47
3 changed files with 6 additions and 3 deletions

View file

@ -242,7 +242,7 @@ static IV_API_CALL_STATUS_T imvcd_view_ctxt_init(imvcd_create_ip_t *ps_ip,
memset(pv_buf, 0, i4_mem_size); memset(pv_buf, 0, i4_mem_size);
ps_view_ctxt->pv_scratch_sps_pps = pv_buf; ps_view_ctxt->pv_scratch_sps_pps = pv_buf;
ps_view_ctxt->u4_static_bits_buf_size = 256000; ps_view_ctxt->u4_static_bits_buf_size = MIN_BITSTREAMS_BUF_SIZE;
pv_buf = pv_buf =
pf_aligned_alloc(pv_mem_ctxt, i4_default_alignment, ps_view_ctxt->u4_static_bits_buf_size); pf_aligned_alloc(pv_mem_ctxt, i4_default_alignment, ps_view_ctxt->u4_static_bits_buf_size);
RETURN_IF((NULL == pv_buf), IV_FAIL); RETURN_IF((NULL == pv_buf), IV_FAIL);

View file

@ -374,8 +374,9 @@ IV_API_CALL_STATUS_T imvcd_bitstream_buf_alloc(dec_struct_t *ps_view_ctxt, UWORD
{ {
UWORD32 u4_size; UWORD32 u4_size;
u4_size = ((ps_view_ctxt->u2_pic_wd * ps_view_ctxt->u2_pic_ht * 3 / 2) + EXTRA_BS_OFFSET) * u4_size = MAX(MIN_BITSTREAMS_BUF_SIZE,
u2_num_views * sizeof(ps_view_ctxt->pu1_bits_buf_dynamic[0]); ((ps_view_ctxt->u2_pic_wd * ps_view_ctxt->u2_pic_ht * 3 / 2) + EXTRA_BS_OFFSET) *
u2_num_views * sizeof(ps_view_ctxt->pu1_bits_buf_dynamic[0]));
ps_view_ctxt->pu1_bits_buf_dynamic = ps_view_ctxt->pu1_bits_buf_dynamic =
ps_view_ctxt->pf_aligned_alloc(ps_view_ctxt->pv_mem_ctxt, 128, u4_size); ps_view_ctxt->pf_aligned_alloc(ps_view_ctxt->pv_mem_ctxt, 128, u4_size);
RETURN_IF((NULL == ps_view_ctxt->pu1_bits_buf_dynamic), IV_FAIL); RETURN_IF((NULL == ps_view_ctxt->pu1_bits_buf_dynamic), IV_FAIL);

View file

@ -34,4 +34,6 @@
is still greater than any possible value of u1_pic_buf_id */ is still greater than any possible value of u1_pic_buf_id */
#define IVP_PIC_BUF_ID UINT8_MAX #define IVP_PIC_BUF_ID UINT8_MAX
#define MIN_BITSTREAMS_BUF_SIZE 256000
#endif #endif