From 5ffcf2bdc2123131c0bf3709a6e0619f2feff328 Mon Sep 17 00:00:00 2001 From: Shi Zhongbo Date: Tue, 10 Sep 2019 14:55:01 +0800 Subject: [PATCH] msm_vidc: venc: update HEIF output buffer count 1. Update buffer count after setting bitrate mode 2. Update HEIF output buffer count to 12 Change-Id: Ibbe80bc219b51db7d9c10cb001932d8e55a6f086 Signed-off-by: Shi Zhongbo --- msm/vidc/msm_vidc_buffer_calculations.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/msm/vidc/msm_vidc_buffer_calculations.c b/msm/vidc/msm_vidc_buffer_calculations.c index b17c8a1ebb0f..94ab5874c0a5 100644 --- a/msm/vidc/msm_vidc_buffer_calculations.c +++ b/msm/vidc/msm_vidc_buffer_calculations.c @@ -24,6 +24,9 @@ /* minimum number of output buffers */ #define MIN_ENC_OUTPUT_BUFFERS 4 +/* extra output buffers for encoder HEIF usecase */ +#define HEIF_ENC_TOTAL_OUTPUT_BUFFERS 12 + #define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH 32 #define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT 8 #define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH 16 @@ -803,6 +806,13 @@ static int msm_vidc_get_extra_output_buff_count(struct msm_vidc_inst *inst) if (!is_realtime_session(inst) || is_thumbnail_session(inst)) return extra_output_count; + /* For HEIF, we are increasing buffer count */ + if (is_image_session(inst)) { + extra_output_count = (HEIF_ENC_TOTAL_OUTPUT_BUFFERS - + MIN_ENC_OUTPUT_BUFFERS); + return extra_output_count; + } + if (is_decode_session(inst)) { /* add 4 extra buffers for dcvs */ if (core->resources.dcvs)