video: driver: Change to support ROI with CBR
- Enable ROI for VBR, CBR_CFR, CBR_CFR bitrate modes. - Disable ROI feature, when rotation, downscaling/scaling enable, - Disable adaptive blur, when ROI feature is enable. Change-Id: If645a255bca93b90fe5cee5a735d7ffcd2a6bc5c Signed-off-by: Roopangkumar Patel <quic_rooppate@quicinc.com>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
80e463004e
commit
0f28bde3c5
@@ -1840,7 +1840,7 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_kala
|
|||||||
msm_vidc_set_u32},
|
msm_vidc_set_u32},
|
||||||
|
|
||||||
{BLUR_TYPES, ENC, H264|HEVC,
|
{BLUR_TYPES, ENC, H264|HEVC,
|
||||||
{PIX_FMTS, BITRATE_MODE, MIN_QUALITY},
|
{PIX_FMTS, BITRATE_MODE, MIN_QUALITY, META_ROI_INFO},
|
||||||
{BLUR_RESOLUTION},
|
{BLUR_RESOLUTION},
|
||||||
msm_vidc_adjust_blur_type,
|
msm_vidc_adjust_blur_type,
|
||||||
msm_vidc_set_u32_enum},
|
msm_vidc_set_u32_enum},
|
||||||
|
|||||||
@@ -2355,7 +2355,7 @@ int msm_vidc_adjust_blur_type(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
struct msm_vidc_inst_capability *capability;
|
struct msm_vidc_inst_capability *capability;
|
||||||
s32 adjusted_value;
|
s32 adjusted_value;
|
||||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||||
s32 rc_type = -1;
|
s32 rc_type = -1, roi_enable = -1;
|
||||||
s32 pix_fmts = -1, min_quality = -1;
|
s32 pix_fmts = -1, min_quality = -1;
|
||||||
|
|
||||||
if (!inst || !inst->capabilities) {
|
if (!inst || !inst->capabilities) {
|
||||||
@@ -2375,7 +2375,9 @@ int msm_vidc_adjust_blur_type(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
msm_vidc_get_parent_value(inst, BLUR_TYPES, PIX_FMTS,
|
msm_vidc_get_parent_value(inst, BLUR_TYPES, PIX_FMTS,
|
||||||
&pix_fmts, __func__) ||
|
&pix_fmts, __func__) ||
|
||||||
msm_vidc_get_parent_value(inst, BLUR_TYPES, MIN_QUALITY,
|
msm_vidc_get_parent_value(inst, BLUR_TYPES, MIN_QUALITY,
|
||||||
&min_quality, __func__))
|
&min_quality, __func__) ||
|
||||||
|
msm_vidc_get_parent_value(inst, BLUR_TYPES, META_ROI_INFO,
|
||||||
|
&roi_enable, __func__))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (adjusted_value == VIDC_BLUR_EXTERNAL) {
|
if (adjusted_value == VIDC_BLUR_EXTERNAL) {
|
||||||
@@ -2387,7 +2389,7 @@ int msm_vidc_adjust_blur_type(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
(rc_type != HFI_RC_VBR_CFR &&
|
(rc_type != HFI_RC_VBR_CFR &&
|
||||||
rc_type != HFI_RC_CBR_CFR &&
|
rc_type != HFI_RC_CBR_CFR &&
|
||||||
rc_type != HFI_RC_CBR_VFR) ||
|
rc_type != HFI_RC_CBR_VFR) ||
|
||||||
is_10bit_colorformat(pix_fmts)) {
|
is_10bit_colorformat(pix_fmts) || roi_enable) {
|
||||||
adjusted_value = VIDC_BLUR_NONE;
|
adjusted_value = VIDC_BLUR_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2834,7 +2836,9 @@ int msm_vidc_adjust_roi_info(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
&pix_fmt, __func__))
|
&pix_fmt, __func__))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (rc_type != HFI_RC_VBR_CFR || !is_8bit_colorformat(pix_fmt))
|
if ((rc_type != HFI_RC_VBR_CFR && rc_type != HFI_RC_CBR_CFR
|
||||||
|
&& rc_type != HFI_RC_CBR_VFR) || !is_8bit_colorformat(pix_fmt)
|
||||||
|
|| is_scaling_enabled(inst) || is_rotation_90_or_270(inst))
|
||||||
adjusted_value = 0;
|
adjusted_value = 0;
|
||||||
|
|
||||||
msm_vidc_update_cap_value(inst, META_ROI_INFO,
|
msm_vidc_update_cap_value(inst, META_ROI_INFO,
|
||||||
|
|||||||
Reference in New Issue
Block a user