Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a16c6173 authored by Shi Zhongbo's avatar Shi Zhongbo
Browse files

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: default avatarShi Zhongbo <zhongbos@codeaurora.org>
parent 06325259
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1557,6 +1557,8 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		rc = msm_venc_resolve_rate_control(inst, ctrl);
		rc = msm_venc_resolve_rate_control(inst, ctrl);
		if (rc)
		if (rc)
			s_vpr_e(sid, "%s: set bitrate mode failed\n", __func__);
			s_vpr_e(sid, "%s: set bitrate mode failed\n", __func__);
		if (inst->state < MSM_VIDC_LOAD_RESOURCES)
			msm_vidc_calculate_buffer_counts(inst);
		break;
		break;
	}
	}
	case V4L2_CID_MPEG_VIDEO_BITRATE:
	case V4L2_CID_MPEG_VIDEO_BITRATE:
@@ -1615,7 +1617,6 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		inst->flags &= ~VIDC_TURBO;
		inst->flags &= ~VIDC_TURBO;
		if (ctrl->val == INT_MAX)
		if (ctrl->val == INT_MAX)
			inst->flags |= VIDC_TURBO;
			inst->flags |= VIDC_TURBO;

		if (inst->state < MSM_VIDC_LOAD_RESOURCES)
		if (inst->state < MSM_VIDC_LOAD_RESOURCES)
			msm_vidc_calculate_buffer_counts(inst);
			msm_vidc_calculate_buffer_counts(inst);
		if (inst->state == MSM_VIDC_START_DONE) {
		if (inst->state == MSM_VIDC_START_DONE) {
+10 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,9 @@
/* extra output buffers for encoder HFR usecase */
/* extra output buffers for encoder HFR usecase */
#define HFR_ENC_TOTAL_OUTPUT_BUFFERS 12
#define HFR_ENC_TOTAL_OUTPUT_BUFFERS 12


/* 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_WIDTH 32
#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT 8
#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT 8
#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH 16
#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH 16
@@ -833,6 +836,13 @@ static int msm_vidc_get_extra_output_buff_count(struct msm_vidc_inst *inst)
	if (!is_realtime_session(inst) || is_thumbnail_session(inst))
	if (!is_realtime_session(inst) || is_thumbnail_session(inst))
		return extra_output_count;
		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;
	}

	/*
	/*
	 * Batch mode and HFR not supported for resolution greater than
	 * Batch mode and HFR not supported for resolution greater than
	 * UHD. Hence extra buffers are not required.
	 * UHD. Hence extra buffers are not required.