Merge "msm: vidc: Enable Average QP extradata"

This commit is contained in:
qctecmdr 2020-11-05 21:15:22 -08:00 committed by Gerrit - the friendly Code Review server
commit 0e572d9975
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_HDR10PLUS = 8,
EXTRADATA_ENC_INPUT_CVP = 16,
EXTRADATA_ENC_FRAME_QP = 32,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_VUI_TIMING_INFO \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 19)

View File

@ -522,7 +522,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
.minimum = EXTRADATA_NONE,
.maximum = EXTRADATA_ADVANCED | EXTRADATA_ENC_INPUT_ROI |
EXTRADATA_ENC_INPUT_HDR10PLUS |
EXTRADATA_ENC_INPUT_CVP,
EXTRADATA_ENC_INPUT_CVP | EXTRADATA_ENC_FRAME_QP,
.default_value = EXTRADATA_NONE,
.menu_skip_mask = 0,
.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);
}
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->fmt.pix_mp.num_planes = 2;
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,
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)
// Enable ROIQP Extradata
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)
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 */
if (size)
size += sizeof(struct msm_vidc_extradata_header);