msm: vidc: Set constrained intra refresh property
If Intra Refresh mode is enabled during encode, then enable constrained intra refresh property on firmware. Without constrained intra refresh enabled, Intra Refresh mode will not be effective. CRs-Fixed: 1001217 Change-Id: Id326c73f78f3fadb5193a1e840f295d764fb013b Signed-off-by: Arun Menon <avmenon@codeaurora.org>
This commit is contained in:
parent
ffb7a2d754
commit
44369392b0
4 changed files with 35 additions and 1 deletions
|
@ -2076,6 +2076,14 @@ int create_pkt_cmd_session_set_property(
|
|||
pkt->size += sizeof(u32) + sizeof(struct hfi_enable);
|
||||
break;
|
||||
}
|
||||
case HAL_PARAM_VENC_CONSTRAINED_INTRA_PRED:
|
||||
{
|
||||
create_pkt_enable(pkt->rg_property_data,
|
||||
HFI_PROPERTY_PARAM_VENC_CONSTRAINED_INTRA_PRED,
|
||||
((struct hal_enable *)pdata)->enable);
|
||||
pkt->size += sizeof(u32) + sizeof(struct hfi_enable);
|
||||
break;
|
||||
}
|
||||
/* FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET */
|
||||
case HAL_CONFIG_BUFFER_REQUIREMENTS:
|
||||
case HAL_CONFIG_PRIORITY:
|
||||
|
|
|
@ -2636,10 +2636,33 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
}
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_MODE: {
|
||||
struct v4l2_ctrl *air_mbs, *air_ref, *cir_mbs;
|
||||
bool is_cont_intra_supported = false;
|
||||
|
||||
air_mbs = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_AIR_MBS);
|
||||
air_ref = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_AIR_REF);
|
||||
cir_mbs = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_CIR_MBS);
|
||||
|
||||
is_cont_intra_supported =
|
||||
(inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_H264) ||
|
||||
(inst->fmts[CAPTURE_PORT]->fourcc == V4L2_PIX_FMT_HEVC);
|
||||
|
||||
if (is_cont_intra_supported) {
|
||||
if (air_mbs || air_ref || cir_mbs)
|
||||
enable.enable = true;
|
||||
else
|
||||
enable.enable = false;
|
||||
|
||||
rc = call_hfi_op(hdev, session_set_property,
|
||||
(void *)inst->session,
|
||||
HAL_PARAM_VENC_CONSTRAINED_INTRA_PRED, &enable);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to set constrained intra\n");
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
property_id = HAL_PARAM_VENC_INTRA_REFRESH;
|
||||
|
||||
intra_refresh.mode = ctrl->val;
|
||||
|
|
|
@ -232,6 +232,7 @@ enum hal_property {
|
|||
HAL_PARAM_VENC_BITRATE_TYPE,
|
||||
HAL_PARAM_VENC_H264_PIC_ORDER_CNT,
|
||||
HAL_PARAM_VENC_LOW_LATENCY,
|
||||
HAL_PARAM_VENC_CONSTRAINED_INTRA_PRED,
|
||||
};
|
||||
|
||||
enum hal_domain {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -369,6 +369,8 @@ struct hfi_buffer_info {
|
|||
(HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x028)
|
||||
#define HFI_PROPERTY_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE \
|
||||
(HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x029)
|
||||
#define HFI_PROPERTY_PARAM_VENC_CONSTRAINED_INTRA_PRED \
|
||||
(HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x02B)
|
||||
#define HFI_PROPERTY_PARAM_VENC_HIER_B_MAX_NUM_ENH_LAYER \
|
||||
(HFI_PROPERTY_PARAM_VENC_COMMON_START + 0x02C)
|
||||
#define HFI_PROPERTY_PARAM_VENC_HIER_P_HYBRID_MODE \
|
||||
|
|
Loading…
Add table
Reference in a new issue