msm: vidc: Enable Average QP extradata

Enabling Average QP extradata

Change-Id: I94edb55f57ee0c88554a98688665bf2eb805045e
Signed-off-by: Uma Mehta <umamehta@codeaurora.org>
This commit is contained in:
Uma Mehta 2020-10-21 23:49:21 +05:30 committed by Gerrit - the friendly Code Review server
parent cc97f61b4b
commit 9e9322b41d
3 changed files with 12 additions and 2 deletions

View File

@ -116,6 +116,7 @@ enum v4l2_mpeg_vidc_extradata {
EXTRADATA_ENC_INPUT_ROI = 4, EXTRADATA_ENC_INPUT_ROI = 4,
EXTRADATA_ENC_INPUT_HDR10PLUS = 8, EXTRADATA_ENC_INPUT_HDR10PLUS = 8,
EXTRADATA_ENC_INPUT_CVP = 16, EXTRADATA_ENC_INPUT_CVP = 16,
EXTRADATA_ENC_FRAME_QP = 32,
}; };
#define V4L2_CID_MPEG_VIDC_VIDEO_VUI_TIMING_INFO \ #define V4L2_CID_MPEG_VIDC_VIDEO_VUI_TIMING_INFO \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 19) (V4L2_CID_MPEG_MSM_VIDC_BASE + 19)

View File

@ -522,7 +522,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
.minimum = EXTRADATA_NONE, .minimum = EXTRADATA_NONE,
.maximum = EXTRADATA_ADVANCED | EXTRADATA_ENC_INPUT_ROI | .maximum = EXTRADATA_ADVANCED | EXTRADATA_ENC_INPUT_ROI |
EXTRADATA_ENC_INPUT_HDR10PLUS | EXTRADATA_ENC_INPUT_HDR10PLUS |
EXTRADATA_ENC_INPUT_CVP, EXTRADATA_ENC_INPUT_CVP | EXTRADATA_ENC_FRAME_QP,
.default_value = EXTRADATA_NONE, .default_value = EXTRADATA_NONE,
.menu_skip_mask = 0, .menu_skip_mask = 0,
.qmenu = NULL, .qmenu = NULL,
@ -1782,7 +1782,8 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
msm_vidc_calculate_enc_input_extra_size(inst); msm_vidc_calculate_enc_input_extra_size(inst);
} }
if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) { if ((inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) ||
(inst->prop.extradata_ctrls & EXTRADATA_ENC_FRAME_QP)) {
f = &inst->fmts[OUTPUT_PORT].v4l2_fmt; f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
f->fmt.pix_mp.num_planes = 2; f->fmt.pix_mp.num_planes = 2;
f->fmt.pix_mp.plane_fmt[1].sizeimage = f->fmt.pix_mp.plane_fmt[1].sizeimage =
@ -4604,6 +4605,11 @@ int msm_venc_set_extradata(struct msm_vidc_inst *inst)
msm_comm_set_extradata(inst, msm_comm_set_extradata(inst,
HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1); HFI_PROPERTY_PARAM_VENC_LTR_INFO, 0x1);
if (inst->prop.extradata_ctrls & EXTRADATA_ENC_FRAME_QP)
// Enable AvgQP Extradata
msm_comm_set_extradata(inst,
HFI_PROPERTY_PARAM_VENC_FRAME_QP_EXTRADATA, 0x1);
if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI) if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_ROI)
// Enable ROIQP Extradata // Enable ROIQP Extradata
msm_comm_set_extradata(inst, msm_comm_set_extradata(inst,

View File

@ -1076,6 +1076,9 @@ u32 msm_vidc_calculate_enc_output_extra_size(struct msm_vidc_inst *inst)
if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED) if (inst->prop.extradata_ctrls & EXTRADATA_ADVANCED)
size += sizeof(struct msm_vidc_metadata_ltr_payload); size += sizeof(struct msm_vidc_metadata_ltr_payload);
if (inst->prop.extradata_ctrls & EXTRADATA_ENC_FRAME_QP)
size += sizeof(struct msm_vidc_frame_qp_payload);
/* Add size for extradata none */ /* Add size for extradata none */
if (size) if (size)
size += sizeof(struct msm_vidc_extradata_header); size += sizeof(struct msm_vidc_extradata_header);