From 36d91e66e0fe1e93f1035e16b05d1af894e170a2 Mon Sep 17 00:00:00 2001 From: Govindaraj Rajagopal Date: Tue, 11 Aug 2020 11:50:52 +0530 Subject: [PATCH] msm: vidc: set chroma_qp_offset only for client set cases Set chroma_qp_offset hfi to firmware only for client set cases. Supported value: 0 & -12 If hfi not set, firmware proceeds with its own default value. 10-bit: default: 0 8-bit : default: Adaptive chroma_qp Change-Id: I40262aae87b2a385c6cd7d60faa19b6adfe8b151 Signed-off-by: Govindaraj Rajagopal --- msm/vidc/msm_venc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index cf7b502ce8f5..bf3184fe1040 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -32,8 +32,6 @@ #define DEFAULT_QP 0xA #define DEFAULT_QP_PACKED 0xA0A0A #define MIN_CHROMA_QP_OFFSET -12 -#define MAX_CHROMA_QP_OFFSET 0 -#define DEFAULT_CHROMA_QP_OFFSET 0 #define MAX_INTRA_REFRESH_MBS ((7680 * 4320) >> 8) #define MAX_LTR_FRAME_COUNT 10 #define MAX_NUM_B_FRAMES 1 @@ -927,8 +925,8 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { .name = "Chroma QP Index Offset", .type = V4L2_CTRL_TYPE_INTEGER, .minimum = MIN_CHROMA_QP_OFFSET, - .maximum = MAX_CHROMA_QP_OFFSET, - .default_value = DEFAULT_CHROMA_QP_OFFSET, + .maximum = INT_MAX, + .default_value = INT_MAX, .step = 1, }, { @@ -3381,7 +3379,7 @@ int msm_venc_set_chroma_qp_offset(struct msm_vidc_inst *inst) hdev = inst->core->device; chr = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET); - if (chr->val != MIN_CHROMA_QP_OFFSET) + if (chr->val == INT_MAX || (chr->val != 0 && chr->val != -12)) return 0; f = &inst->fmts[INPUT_PORT].v4l2_fmt;