From 18c386f2f55913658fcfbd235292ad7ff2975e4e Mon Sep 17 00:00:00 2001 From: Govindaraj Rajagopal Date: Wed, 27 Nov 2019 11:56:16 +0530 Subject: [PATCH] msm: venc: increase output buffer size only for hevc 10 bit support is available only for hevc codec type. So increase encoder output buffer size(factor - 1.25) only for hevc. Change-Id: I49f6bccc074814d8c737f47fd82907a018ac169a Signed-off-by: Govindaraj Rajagopal --- msm/vidc/msm_vidc_buffer_calculations.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/msm/vidc/msm_vidc_buffer_calculations.c b/msm/vidc/msm_vidc_buffer_calculations.c index cf4379993bbf..f10ec687dc86 100644 --- a/msm/vidc/msm_vidc_buffer_calculations.c +++ b/msm/vidc/msm_vidc_buffer_calculations.c @@ -1014,15 +1014,9 @@ u32 msm_vidc_calculate_enc_output_frame_size(struct msm_vidc_inst *inst) if (inst->rc_type == RATE_CONTROL_LOSSLESS) frame_size = (width * height * 9) >> 2; - /* - * In case of opaque color format bitdepth will be known - * with first ETB, buffers allocated already with 8 bit - * won't be sufficient for 10 bit - * calculate size considering 10-bit by default - * For 10-bit cases size = size * 1.25 - */ - frame_size *= 5; - frame_size /= 4; + /* multiply by 10/8 (1.25) to get size for 10 bit case */ + if (f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC) + frame_size = frame_size + (frame_size >> 2); return ALIGN(frame_size, SZ_4K); }