Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd10328d authored by Vinay Kalia's avatar Vinay Kalia Committed by Praneeth Paladugu
Browse files

msm: vidc: Implement control for VOP time resolution



Implement new control for VOP time resolution for MPEG4 encoder.

Change-Id: I0d73700b050464f6196ec6d10832f0f7be3254b4
Signed-off-by: default avatarVinay Kalia <vkalia@codeaurora.org>
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 29f51c1d
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_BITSTREAM_RESTRICT_ENABLED
#define BITSTREAM_RESTRICT_DISABLED \
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_BITSTREAM_RESTRICT_DISABLED
#define MIN_TIME_RESOLUTION 1
#define MAX_TIME_RESOLUTION 0xFFFFFF
#define DEFAULT_TIME_RESOLUTION 0x7530

static const char *const mpeg_video_rate_control[] = {
	"No Rate Control",
@@ -758,6 +761,18 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.step = 1,
		.cluster = MSM_VENC_CTRL_CLUSTER_DEINTERLACE,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_MPEG4_TIME_RESOLUTION,
		.name = "Vop time increment resolution",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = MIN_TIME_RESOLUTION,
		.maximum = MAX_TIME_RESOLUTION,
		.default_value = DEFAULT_TIME_RESOLUTION,
		.step = 1,
		.menu_skip_mask = 0,
		.qmenu = NULL,
		.cluster = 0,
	}
};

#define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls)
@@ -1305,6 +1320,7 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
	struct v4l2_ctrl *temp_ctrl = NULL;
	struct hfi_device *hdev;
	struct hal_extradata_enable extra;
	struct hal_mpeg4_time_resolution time_res;

	if (!inst || !inst->core || !inst->core->device) {
		dprintk(VIDC_ERR, "%s invalid parameters", __func__);
@@ -1971,6 +1987,11 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		preserve_text_quality.enable = ctrl->val;
		pdata = &preserve_text_quality;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_MPEG4_TIME_RESOLUTION:
		property_id = HAL_PARAM_VENC_MPEG4_TIME_RESOLUTION;
		time_res.time_increment_resolution = ctrl->val;
		pdata = &time_res;
		break;
	default:
		rc = -ENOTSUPP;
		break;
+2 −0
Original line number Diff line number Diff line
@@ -722,6 +722,8 @@ const char *v4l2_ctrl_get_name(u32 id)
		return "VP8 Profile Level";
	case V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE:
		return "Deinterlace for encoder";
	case V4L2_CID_MPEG_VIDC_VIDEO_MPEG4_TIME_RESOLUTION:
		return "Vop time increment resolution";

	/* CAMERA controls */
	/* Keep the order of the 'case's the same as in videodev2.h! */
+3 −0
Original line number Diff line number Diff line
@@ -804,6 +804,9 @@ enum v4l2_mpeg_vidc_video_deinterlace {
	V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE_ENABLED = 1
};

#define V4L2_CID_MPEG_VIDC_VIDEO_MPEG4_TIME_RESOLUTION \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 37)

/*  Camera class control IDs */

#define V4L2_CID_CAMERA_CLASS_BASE 	(V4L2_CTRL_CLASS_CAMERA | 0x900)