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

Commit 24478498 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Add support for Hybrid Hier-P mode"

parents a248dd49 2fdbf82d
Loading
Loading
Loading
Loading
+40 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define MAX_INTRA_REFRESH_MBS ((4096 * 2304) >> 8)
#define MAX_NUM_B_FRAMES 4
#define MAX_LTR_FRAME_COUNT 10
#define MAX_HYBRID_HIER_P_LAYERS 6

#define L_MODE V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY
#define CODING V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY
@@ -880,7 +881,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.name = "Set Hier P num layers",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0,
		.maximum = 3,
		.maximum = 6,
		.default_value = 0,
		.step = 1,
		.qmenu = NULL,
@@ -1138,6 +1139,17 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = {
		.default_value = V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI_DISABLE,
		.step = 1,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VENC_PARAM_LAYER_BITRATE,
		.name = "Layer wise bitrate for H264/H265 Hybrid HP",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = MIN_BIT_RATE,
		.maximum = MAX_BIT_RATE,
		.default_value = DEFAULT_BIT_RATE,
		.step = BIT_RATE_STEP,
		.menu_skip_mask = 0,
		.qmenu = NULL,
	},
};

#define NUM_CTRLS ARRAY_SIZE(msm_venc_ctrls)
@@ -2909,6 +2921,7 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
	struct msm_vidc_core_capability *cap = NULL;
	struct hal_initial_quantization quant;
	struct hal_aspect_ratio sar;
	struct hal_bitrate bitrate;

	if (!inst || !inst->core || !inst->core->device || !ctrl) {
		dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
@@ -3011,6 +3024,32 @@ static int try_set_ext_ctrl(struct msm_vidc_inst *inst,
			property_id = HAL_PROPERTY_PARAM_VENC_ASPECT_RATIO;
			pdata = &sar;
			break;
		case V4L2_CID_MPEG_VIDC_VENC_PARAM_LAYER_BITRATE:
		{
			if (control[i].value) {
				bitrate.layer_id = i;
				bitrate.bit_rate = control[i].value;
				property_id = HAL_CONFIG_VENC_TARGET_BITRATE;
				pdata = &bitrate;
				dprintk(VIDC_DBG, "layerwise bitrate for %d\n",
					i);
				rc = call_hfi_op(hdev, session_set_property,
					(void *)inst->session, property_id,
					 pdata);
				if (rc) {
					dprintk(VIDC_DBG, "prop %x failed\n",
						property_id);
					return rc;
				}
				if (i == MAX_HYBRID_HIER_P_LAYERS - 1) {
					dprintk(VIDC_DBG, "HAL property=%x\n",
						property_id);
					property_id = 0;
					rc = 0;
				}
			}
			break;
		}
		default:
			dprintk(VIDC_ERR, "Invalid id set: %d\n",
				control[i].id);
+3 −0
Original line number Diff line number Diff line
@@ -1092,6 +1092,9 @@ enum v4l2_mpeg_vidc_video_vqzip_sei_enable {
	V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI_ENABLE	= 1
};

#define V4L2_CID_MPEG_VIDC_VENC_PARAM_LAYER_BITRATE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 82)

/*  Camera class control IDs */

#define V4L2_CID_CAMERA_CLASS_BASE 	(V4L2_CTRL_CLASS_CAMERA | 0x900)