@@ -191,6 +191,7 @@ struct vdec_controls {
u32 post_loop_deb_mode;
u32 profile;
u32 level;
+ bool intra_only;
};
struct venc_controls {
@@ -625,6 +625,13 @@ static int vdec_set_properties(struct venus_inst *inst)
return ret;
}
+ if (ctr->intra_only) {
+ ptype = HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE;
+ ret = hfi_session_set_property(inst, ptype, &en);
+ if (ret)
+ return ret;
+ }
+
return 0;
}
@@ -28,6 +28,9 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
ctr->level = ctrl->val;
break;
+ case V4L2_CID_MPEG_VIDEO_DECODE_INTRA_FRAMES_ONLY:
+ ctr->intra_only = ctrl->val;
+ break;
default:
return -EINVAL;
}
@@ -86,7 +89,7 @@ int vdec_ctrl_init(struct venus_inst *inst)
struct v4l2_ctrl *ctrl;
int ret;
- ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 7);
+ ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 8);
if (ret)
return ret;
@@ -141,6 +144,10 @@ int vdec_ctrl_init(struct venus_inst *inst)
if (ctrl)
ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
+ v4l2_ctrl_new_std(&inst->ctrl_handler, &vdec_ctrl_ops,
+ V4L2_CID_MPEG_VIDEO_DECODE_INTRA_FRAMES_ONLY,
+ 0, 1, 1, 0);
+
ret = inst->ctrl_handler.error;
if (ret) {
v4l2_ctrl_handler_free(&inst->ctrl_handler);
Adds support in the decoder for intra frames only decode. The implementation in the Venus use HFI property for thumbnail generation to lower memory usage and when the control is enabled the number of decoder output buffers for progressive stream will be one (for interlace two). We assume that the client will queue on the decoder input intra frames only but this is not mandatory. If the client queue non-intra frames on decoder input they will be returned on decoder output with an error. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 7 +++++++ drivers/media/platform/qcom/venus/vdec_ctrls.c | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) -- 2.17.1