Linux-Media Archive on lore.kernel.org
 help / Atom feed
* [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction
@ 2019-01-08 17:13 Philipp Zabel
  2019-01-08 17:13 ` [PATCH 2/4] media: v4l2-ctrl: Add control for h.264 chroma qp offset Philipp Zabel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Philipp Zabel @ 2019-01-08 17:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

Allow to enable h.264 constrained intra prediction (macroblocks using
intra prediction modes are not allowed to use residual data and decoded
samples of neighboring macroblocks coded using inter prediction modes).
This control directly corresponds to the constrained_intra_pred_flag
field in the h.264 picture parameter set.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 Documentation/media/uapi/v4l/extended-controls.rst | 4 ++++
 drivers/media/v4l2-core/v4l2-ctrls.c               | 2 ++
 include/uapi/linux/v4l2-controls.h                 | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
index af4273aa5e85..235d0c293983 100644
--- a/Documentation/media/uapi/v4l/extended-controls.rst
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -1154,6 +1154,10 @@ enum v4l2_mpeg_video_h264_entropy_mode -
 ``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
     Enable 8X8 transform for H264. Applicable to the H264 encoder.
 
+``V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (boolean)``
+    Enable constrained intra prediction for H264. Applicable to the H264
+    encoder.
+
 ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
     Cyclic intra macroblock refresh. This is the number of continuous
     macroblocks refreshed every frame. Each frame a successive set of
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index e3bd441fa29a..1f2fd279f37d 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -825,6 +825,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of HC Layers";
 	case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP:
 								return "H264 Set QP Value for HC Layers";
+	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
+								return "H264 Constrained Intra Prediction";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP:		return "MPEG4 I-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP:		return "MPEG4 P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP:		return "MPEG4 B-Frame QP Value";
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 3dcfc6148f99..fd65c710b144 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -533,6 +533,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type {
 };
 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER	(V4L2_CID_MPEG_BASE+381)
 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP	(V4L2_CID_MPEG_BASE+382)
+#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION	(V4L2_CID_MPEG_BASE+383)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP	(V4L2_CID_MPEG_BASE+400)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP	(V4L2_CID_MPEG_BASE+401)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP	(V4L2_CID_MPEG_BASE+402)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] media: v4l2-ctrl: Add control for h.264 chroma qp offset
  2019-01-08 17:13 [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Philipp Zabel
@ 2019-01-08 17:13 ` Philipp Zabel
  2019-01-08 17:13 ` [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction Philipp Zabel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Philipp Zabel @ 2019-01-08 17:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

Allow to add fixed quantization parameter offset between luma and
chroma quantization parameters. This control directly corresponds
to the chroma_qp_index_offset field of the h.264 picture parameter
set.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 Documentation/media/uapi/v4l/extended-controls.rst | 5 +++++
 drivers/media/v4l2-core/v4l2-ctrls.c               | 1 +
 include/uapi/linux/v4l2-controls.h                 | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
index 235d0c293983..00934efdc9e4 100644
--- a/Documentation/media/uapi/v4l/extended-controls.rst
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -1158,6 +1158,11 @@ enum v4l2_mpeg_video_h264_entropy_mode -
     Enable constrained intra prediction for H264. Applicable to the H264
     encoder.
 
+``V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (integer)``
+    Specify the offset that should be added to the luma quantization
+    parameter to determine the chroma quantization parameter. Applicable
+    to the H264 encoder.
+
 ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
     Cyclic intra macroblock refresh. This is the number of continuous
     macroblocks refreshed every frame. Each frame a successive set of
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 1f2fd279f37d..6d06f9852522 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -827,6 +827,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 								return "H264 Set QP Value for HC Layers";
 	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
 								return "H264 Constrained Intra Prediction";
+	case V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET:	return "H264 Chroma QP Index Offset";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP:		return "MPEG4 I-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP:		return "MPEG4 P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP:		return "MPEG4 B-Frame QP Value";
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index fd65c710b144..06479f2fb3ae 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -534,6 +534,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type {
 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER	(V4L2_CID_MPEG_BASE+381)
 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP	(V4L2_CID_MPEG_BASE+382)
 #define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION	(V4L2_CID_MPEG_BASE+383)
+#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET		(V4L2_CID_MPEG_BASE+384)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP	(V4L2_CID_MPEG_BASE+400)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP	(V4L2_CID_MPEG_BASE+401)
 #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP	(V4L2_CID_MPEG_BASE+402)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction
  2019-01-08 17:13 [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Philipp Zabel
  2019-01-08 17:13 ` [PATCH 2/4] media: v4l2-ctrl: Add control for h.264 chroma qp offset Philipp Zabel
@ 2019-01-08 17:13 ` Philipp Zabel
  2019-01-09  8:05   ` Ian Arkver
  2019-01-08 17:13 ` [PATCH 4/4] media: coda: Add control for h.264 chroma qp index offset Philipp Zabel
  2019-01-10 10:37 ` [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Hans Verkuil
  3 siblings, 1 reply; 6+ messages in thread
From: Philipp Zabel @ 2019-01-08 17:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

Allow to enable constrained intra prediction in the h.264 encoder.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-bit.c    | 4 +++-
 drivers/media/platform/coda/coda-common.c | 6 ++++++
 drivers/media/platform/coda/coda.h        | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 8e0194993a52..5e5accc3ae62 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1010,7 +1010,9 @@ static int coda_start_encoding(struct coda_ctx *ctx)
 			 CODA_264PARAM_DEBLKFILTEROFFSETALPHA_OFFSET) |
 			((ctx->params.h264_slice_beta_offset_div2 &
 			  CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK) <<
-			 CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET);
+			 CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET) |
+			(!!ctx->params.h264_constrained_intra_pred_flag <<
+			 CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET);
 		coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
 		break;
 	case V4L2_PIX_FMT_JPEG:
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 7518f01c48f7..f6c9273805bb 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1839,6 +1839,9 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
 		ctx->params.h264_disable_deblocking_filter_idc = ctrl->val;
 		break;
+	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
+		ctx->params.h264_constrained_intra_pred_flag = ctrl->val;
+		break;
 	case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
 		/* TODO: switch between baseline and constrained baseline */
 		if (ctx->inst_type == CODA_INST_ENCODER)
@@ -1925,6 +1928,9 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
 		V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
 		V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY,
 		0x0, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED);
+	v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,
+		V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION, 0, 1, 1,
+		0);
 	v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
 		V4L2_CID_MPEG_VIDEO_H264_PROFILE,
 		V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h
index 31cea72f5b2a..f3d0cff4ef3a 100644
--- a/drivers/media/platform/coda/coda.h
+++ b/drivers/media/platform/coda/coda.h
@@ -118,6 +118,7 @@ struct coda_params {
 	u8			h264_disable_deblocking_filter_idc;
 	s8			h264_slice_alpha_c0_offset_div2;
 	s8			h264_slice_beta_offset_div2;
+	bool			h264_constrained_intra_pred_flag;
 	u8			h264_profile_idc;
 	u8			h264_level_idc;
 	u8			mpeg4_intra_qp;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/4] media: coda: Add control for h.264 chroma qp index offset
  2019-01-08 17:13 [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Philipp Zabel
  2019-01-08 17:13 ` [PATCH 2/4] media: v4l2-ctrl: Add control for h.264 chroma qp offset Philipp Zabel
  2019-01-08 17:13 ` [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction Philipp Zabel
@ 2019-01-08 17:13 ` Philipp Zabel
  2019-01-10 10:37 ` [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Hans Verkuil
  3 siblings, 0 replies; 6+ messages in thread
From: Philipp Zabel @ 2019-01-08 17:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

Allow to set a fixed quantization parameter offset between luma and
chroma in the h.264 encoder.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-bit.c    | 4 +++-
 drivers/media/platform/coda/coda-common.c | 5 +++++
 drivers/media/platform/coda/coda.h        | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 5e5accc3ae62..5ec70ab9f1b2 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1012,7 +1012,9 @@ static int coda_start_encoding(struct coda_ctx *ctx)
 			  CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK) <<
 			 CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET) |
 			(!!ctx->params.h264_constrained_intra_pred_flag <<
-			 CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET);
+			 CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET) |
+			(ctx->params.h264_chroma_qp_index_offset &
+			 CODA_264PARAM_CHROMAQPOFFSET_MASK);
 		coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
 		break;
 	case V4L2_PIX_FMT_JPEG:
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index f6c9273805bb..390d1ce6ab32 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1842,6 +1842,9 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
 		ctx->params.h264_constrained_intra_pred_flag = ctrl->val;
 		break;
+	case V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET:
+		ctx->params.h264_chroma_qp_index_offset = ctrl->val;
+		break;
 	case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
 		/* TODO: switch between baseline and constrained baseline */
 		if (ctx->inst_type == CODA_INST_ENCODER)
@@ -1931,6 +1934,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
 	v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,
 		V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION, 0, 1, 1,
 		0);
+	v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,
+		V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET, -12, 12, 1, 0);
 	v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
 		V4L2_CID_MPEG_VIDEO_H264_PROFILE,
 		V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h
index f3d0cff4ef3a..31c80bda2c0b 100644
--- a/drivers/media/platform/coda/coda.h
+++ b/drivers/media/platform/coda/coda.h
@@ -119,6 +119,7 @@ struct coda_params {
 	s8			h264_slice_alpha_c0_offset_div2;
 	s8			h264_slice_beta_offset_div2;
 	bool			h264_constrained_intra_pred_flag;
+	s8			h264_chroma_qp_index_offset;
 	u8			h264_profile_idc;
 	u8			h264_level_idc;
 	u8			mpeg4_intra_qp;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction
  2019-01-08 17:13 ` [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction Philipp Zabel
@ 2019-01-09  8:05   ` Ian Arkver
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Arkver @ 2019-01-09  8:05 UTC (permalink / raw)
  To: Philipp Zabel, linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

Hi Philipp

On 08/01/2019 17:13, Philipp Zabel wrote:
> Allow to enable constrained intra prediction in the h.264 encoder.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>   drivers/media/platform/coda/coda-bit.c    | 4 +++-
>   drivers/media/platform/coda/coda-common.c | 6 ++++++
>   drivers/media/platform/coda/coda.h        | 1 +
>   3 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
> index 8e0194993a52..5e5accc3ae62 100644
> --- a/drivers/media/platform/coda/coda-bit.c
> +++ b/drivers/media/platform/coda/coda-bit.c
> @@ -1010,7 +1010,9 @@ static int coda_start_encoding(struct coda_ctx *ctx)
>   			 CODA_264PARAM_DEBLKFILTEROFFSETALPHA_OFFSET) |
>   			((ctx->params.h264_slice_beta_offset_div2 &
>   			  CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK) <<
> -			 CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET);
> +			 CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET) |
> +			(!!ctx->params.h264_constrained_intra_pred_flag <<

Shouldn't need !! as it's already a bool.

Regards,
Ian
> +			 CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET);
>   		coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
>   		break;
>   	case V4L2_PIX_FMT_JPEG:
> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> index 7518f01c48f7..f6c9273805bb 100644
> --- a/drivers/media/platform/coda/coda-common.c
> +++ b/drivers/media/platform/coda/coda-common.c
> @@ -1839,6 +1839,9 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
>   	case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
>   		ctx->params.h264_disable_deblocking_filter_idc = ctrl->val;
>   		break;
> +	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
> +		ctx->params.h264_constrained_intra_pred_flag = ctrl->val;
> +		break;
>   	case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
>   		/* TODO: switch between baseline and constrained baseline */
>   		if (ctx->inst_type == CODA_INST_ENCODER)
> @@ -1925,6 +1928,9 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
>   		V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
>   		V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY,
>   		0x0, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED);
> +	v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,
> +		V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION, 0, 1, 1,
> +		0);
>   	v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
>   		V4L2_CID_MPEG_VIDEO_H264_PROFILE,
>   		V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
> diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h
> index 31cea72f5b2a..f3d0cff4ef3a 100644
> --- a/drivers/media/platform/coda/coda.h
> +++ b/drivers/media/platform/coda/coda.h
> @@ -118,6 +118,7 @@ struct coda_params {
>   	u8			h264_disable_deblocking_filter_idc;
>   	s8			h264_slice_alpha_c0_offset_div2;
>   	s8			h264_slice_beta_offset_div2;
> +	bool			h264_constrained_intra_pred_flag;
>   	u8			h264_profile_idc;
>   	u8			h264_level_idc;
>   	u8			mpeg4_intra_qp;
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction
  2019-01-08 17:13 [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Philipp Zabel
                   ` (2 preceding siblings ...)
  2019-01-08 17:13 ` [PATCH 4/4] media: coda: Add control for h.264 chroma qp index offset Philipp Zabel
@ 2019-01-10 10:37 ` Hans Verkuil
  3 siblings, 0 replies; 6+ messages in thread
From: Hans Verkuil @ 2019-01-10 10:37 UTC (permalink / raw)
  To: Philipp Zabel, linux-media; +Cc: Hans Verkuil, Mauro Carvalho Chehab

On 01/08/19 18:13, Philipp Zabel wrote:
> Allow to enable h.264 constrained intra prediction (macroblocks using
> intra prediction modes are not allowed to use residual data and decoded
> samples of neighboring macroblocks coded using inter prediction modes).
> This control directly corresponds to the constrained_intra_pred_flag
> field in the h.264 picture parameter set.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  Documentation/media/uapi/v4l/extended-controls.rst | 4 ++++
>  drivers/media/v4l2-core/v4l2-ctrls.c               | 2 ++
>  include/uapi/linux/v4l2-controls.h                 | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> index af4273aa5e85..235d0c293983 100644
> --- a/Documentation/media/uapi/v4l/extended-controls.rst
> +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> @@ -1154,6 +1154,10 @@ enum v4l2_mpeg_video_h264_entropy_mode -
>  ``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
>      Enable 8X8 transform for H264. Applicable to the H264 encoder.
>  
> +``V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (boolean)``
> +    Enable constrained intra prediction for H264. Applicable to the H264
> +    encoder.
> +
>  ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
>      Cyclic intra macroblock refresh. This is the number of continuous
>      macroblocks refreshed every frame. Each frame a successive set of
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index e3bd441fa29a..1f2fd279f37d 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -825,6 +825,8 @@ const char *v4l2_ctrl_get_name(u32 id)
>  	case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of HC Layers";
>  	case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP:
>  								return "H264 Set QP Value for HC Layers";
> +	case V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION:
> +								return "H264 Constrained Intra Prediction";

This string is too long. The one above it ("H264 Set QP Value for HC Layers") has exactly 31
characters, which is the maximum. Perhaps abbreviating "Prediction" by "Pred" will work.

>  	case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP:		return "MPEG4 I-Frame QP Value";
>  	case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP:		return "MPEG4 P-Frame QP Value";
>  	case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP:		return "MPEG4 B-Frame QP Value";
> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
> index 3dcfc6148f99..fd65c710b144 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -533,6 +533,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type {
>  };
>  #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER	(V4L2_CID_MPEG_BASE+381)
>  #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP	(V4L2_CID_MPEG_BASE+382)
> +#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION	(V4L2_CID_MPEG_BASE+383)
>  #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP	(V4L2_CID_MPEG_BASE+400)
>  #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP	(V4L2_CID_MPEG_BASE+401)
>  #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP	(V4L2_CID_MPEG_BASE+402)
> 

Regards,

	Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 17:13 [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Philipp Zabel
2019-01-08 17:13 ` [PATCH 2/4] media: v4l2-ctrl: Add control for h.264 chroma qp offset Philipp Zabel
2019-01-08 17:13 ` [PATCH 3/4] media: coda: Add control for h.264 constrained intra prediction Philipp Zabel
2019-01-09  8:05   ` Ian Arkver
2019-01-08 17:13 ` [PATCH 4/4] media: coda: Add control for h.264 chroma qp index offset Philipp Zabel
2019-01-10 10:37 ` [PATCH 1/4] media: v4l2-ctrl: Add control to enable h.264 constrained intra prediction Hans Verkuil

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org linux-media@archiver.kernel.org
	public-inbox-index linux-media


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/ public-inbox