Skip to contentSkip to conversation

Add MFC v10.10 support

PATCH Superseded Smitha T Murthy 3 participants 25 messages Apr 6, 2017 – Jun 13, 2017 1 message not in the archive

Subsystems (3)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20170406060957epcas1p36f883512ccfaf24359d1b31a6d199d87@epcas1p3.samsung.com

#1 lore raw

v4 cover Add MFC v10.10 support

This patch series adds MFC v10.10 support. MFC v10.10 is used in some of Exynos7 variants.

This adds support for following:

* Add support for HEVC encoder and decoder
* Add support for VP9 decoder
* Update Documentation for control id definitions
* Update computation of min scratch buffer size requirement for V8 onwards

Changes since v3:
- Addressed review comments by Andrzej Hajda.
- Addressed review comments by Hans Verkuil.
- Addressed review comments by Julia Lawall.
- Rebased on latest git://linuxtv.org/snawrocki/samsung.git for-v4.12/media/next.
- Applied r-o-b from Andrzej on respective patches.

Smitha T Murthy (12):
[media] s5p-mfc: Rename IS_MFCV8 macro
[media] s5p-mfc: Adding initial support for MFC v10.10 [media] s5p-mfc: Use min scratch buffer size as provided by F/W [media] s5p-mfc: Support MFCv10.10 buffer requirements [media] videodev2.h: Add v4l2 definition for HEVC [media] v4l2-ioctl: add HEVC format description
Documentation: v4l: Documentation for HEVC v4l2 definition [media] s5p-mfc: Add support for HEVC decoder
[media] s5p-mfc: Add VP9 decoder support
[media] v4l2: Add v4l2 control IDs for HEVC encoder [media] s5p-mfc: Add support for HEVC encoder
Documention: v4l: Documentation for HEVC CIDs

 .../devicetree/bindings/media/s5p-mfc.txt          |   1 +
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++
 Documentation/media/uapi/v4l/pixfmt-013.rst        |   5 +
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h      |  88 +++
 drivers/media/platform/s5p-mfc/regs-mfc-v8.h       |   2 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c           |  28 +
 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c    |   9 +
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h    |  67 ++-
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c      |   6 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |  48 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c       | 602 ++++++++++++++++++++-
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h       |  14 +
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c    | 403 ++++++++++++--
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h    |  15 +
 drivers/media/v4l2-core/v4l2-ctrls.c               | 104 ++++
 drivers/media/v4l2-core/v4l2-ioctl.c               |   1 +
 include/uapi/linux/v4l2-controls.h                 | 132 +++++
 include/uapi/linux/videodev2.h                     |   1 +
 18 files changed, 1840 insertions(+), 77 deletions(-)
 create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v10.h
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 1/12 s5p-mfc: Rename IS_MFCV8 macro

This patch renames macro IS_MFCV8 to IS_MFCV8_PLUS so that the MFCv8 code can be resued for MFCv10.10 support. Since the MFCv8 specific code holds good for MFC v10.10 also.

---
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c   |  2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c    |  2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 18 +++++++++---------
 4 files changed, 12 insertions(+), 12 deletions(-)
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +1 -1
index 4220914..5fb2684 100644
@@ -711,7 +711,7 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
 #define IS_TWOPORT(dev)		(dev->variant->port_num == 2 ? 1 : 0)
 #define IS_MFCV6_PLUS(dev)	(dev->variant->version >= 0x60 ? 1 : 0)
 #define IS_MFCV7_PLUS(dev)	(dev->variant->version >= 0x70 ? 1 : 0)
-#define IS_MFCV8(dev)		(dev->variant->version >= 0x80 ? 1 : 0)
+#define IS_MFCV8_PLUS(dev)	(dev->variant->version >= 0x80 ? 1 : 0)
 
 #define MFC_V5_BIT	BIT(0)
 #define MFC_V6_BIT	BIT(1)
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +1 -1
index 69ef9c2..3769d22 100644
@@ -399,7 +399,7 @@ int s5p_mfc_wakeup(struct s5p_mfc_dev *dev)
 	s5p_mfc_clear_cmds(dev);
 	s5p_mfc_clean_dev_int_flags(dev);
 	/* 3. Send MFC wakeup command and wait for completion*/
-	if (IS_MFCV8(dev))
+	if (IS_MFCV8_PLUS(dev))
 		ret = s5p_mfc_v8_wait_wakeup(dev);
 	else
 		ret = s5p_mfc_wait_wakeup(dev);
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +1 -1
index 8937b0a..42e9351 100644
@@ -1177,7 +1177,7 @@ void s5p_mfc_dec_init(struct s5p_mfc_ctx *ctx)
 	struct v4l2_format f;
 	f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_H264;
 	ctx->src_fmt = find_format(&f, MFC_FMT_DEC);
-	if (IS_MFCV8(ctx->dev))
+	if (IS_MFCV8_PLUS(ctx->dev))
 		f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12M;
 	else if (IS_MFCV6_PLUS(ctx->dev))
 		f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12MT_16X16;
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +9 -9
index 85880e9..d52f23c 100644
@@ -74,7 +74,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 			  ctx->luma_size, ctx->chroma_size, ctx->mv_size);
 		mfc_debug(2, "Totals bufs: %d\n", ctx->total_dpb_count);
 	} else if (ctx->type == MFCINST_ENCODER) {
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->tmv_buffer_size = S5P_FIMV_NUM_TMV_BUFFERS_V6 *
 			ALIGN(S5P_FIMV_TMV_BUFFER_SIZE_V8(mb_width, mb_height),
 			S5P_FIMV_TMV_BUFFER_ALIGN_V6);
@@ -89,7 +89,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 		ctx->chroma_dpb_size = ALIGN((mb_width * mb_height) *
 				S5P_FIMV_CHROMA_MB_TO_PIXEL_V6,
 				S5P_FIMV_CHROMA_DPB_BUFFER_ALIGN_V6);
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->me_buffer_size = ALIGN(S5P_FIMV_ME_BUFFER_SIZE_V8(
 						ctx->img_width, ctx->img_height,
 						mb_width, mb_height),
@@ -110,7 +110,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 	switch (ctx->codec_mode) {
 	case S5P_MFC_CODEC_H264_DEC:
 	case S5P_MFC_CODEC_H264_MVC_DEC:
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->scratch_buf_size =
 				S5P_FIMV_SCRATCH_BUF_SIZE_H264_DEC_V8(
 					mb_width,
@@ -167,7 +167,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 		ctx->bank1.size = ctx->scratch_buf_size;
 		break;
 	case S5P_MFC_CODEC_VP8_DEC:
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->scratch_buf_size =
 				S5P_FIMV_SCRATCH_BUF_SIZE_VP8_DEC_V8(
 						mb_width,
@@ -182,7 +182,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 		ctx->bank1.size = ctx->scratch_buf_size;
 		break;
 	case S5P_MFC_CODEC_H264_ENC:
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->scratch_buf_size =
 				S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V8(
 					mb_width,
@@ -215,7 +215,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 		ctx->bank2.size = 0;
 		break;
 	case S5P_MFC_CODEC_VP8_ENC:
-		if (IS_MFCV8(dev))
+		if (IS_MFCV8_PLUS(dev))
 			ctx->scratch_buf_size =
 				S5P_FIMV_SCRATCH_BUF_SIZE_VP8_ENC_V8(
 					mb_width,
@@ -364,7 +364,7 @@ static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx)
 
 	ctx->luma_size = calc_plane(ctx->img_width, ctx->img_height);
 	ctx->chroma_size = calc_plane(ctx->img_width, (ctx->img_height >> 1));
-	if (IS_MFCV8(ctx->dev)) {
+	if (IS_MFCV8_PLUS(ctx->dev)) {
 		/* MFCv8 needs additional 64 bytes for luma,chroma dpb*/
 		ctx->luma_size += S5P_FIMV_D_ALIGN_PLANE_SIZE_V8;
 		ctx->chroma_size += S5P_FIMV_D_ALIGN_PLANE_SIZE_V8;
@@ -445,7 +445,7 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
 	writel(buf_addr1, mfc_regs->d_scratch_buffer_addr);
 	writel(ctx->scratch_buf_size, mfc_regs->d_scratch_buffer_size);
 
-	if (IS_MFCV8(dev)) {
+	if (IS_MFCV8_PLUS(dev)) {
 		writel(ctx->img_width,
 			mfc_regs->d_first_plane_dpb_stride_size);
 		writel(ctx->img_width,
@@ -2109,7 +2109,7 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev)
 			S5P_FIMV_E_ENCODED_SOURCE_SECOND_ADDR_V7);
 	R(e_vp8_options, S5P_FIMV_E_VP8_OPTIONS_V7);
 
-	if (!IS_MFCV8(dev))
+	if (!IS_MFCV8_PLUS(dev))
 		goto done;
 
 	/* Initialize registers used in MFC v8 only.
Signature · 1 line
2.7.4
#3 lore raw

PATCH v4 2/12 s5p-mfc: Adding initial support for MFC v10.10

In reply to Smitha T Murthy

Adding the support for MFC v10.10, with new register file and necessary hw control, decoder, encoder and structural changes.

---
 .../devicetree/bindings/media/s5p-mfc.txt          |  1 +
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h      | 36 ++++++++++++++++++++++
 drivers/media/platform/s5p-mfc/s5p_mfc.c           | 25 +++++++++++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h    |  9 +++++-
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c      |  4 +++
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       | 32 ++++++++-----------
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c       | 16 ++++------
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c    |  9 ++++--
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h    |  2 ++
 9 files changed, 101 insertions(+), 33 deletions(-)
 create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v10.h
Documentation/devicetree/bindings/media/s5p-mfc.txt +1 -0
index d3404b5..aa54c81 100644
@@ -13,6 +13,7 @@ Required properties:
 	(c) "samsung,mfc-v7" for MFC v7 present in Exynos5420 SoC
 	(d) "samsung,mfc-v8" for MFC v8 present in Exynos5800 SoC
 	(e) "samsung,exynos5433-mfc" for MFC v8 present in Exynos5433 SoC
+	(f) "samsung,mfc-v10" for MFC v10 present in Exynos7880 SoC
 
   - reg : Physical base address of the IP registers and length of memory
 	  mapped region.
drivers/media/platform/s5p-mfc/regs-mfc-v10.h new file +36 -0
new file mode 100644
index 0000000..1ca09d6
@@ -0,0 +1,36 @@
+/*
+ * Register definition file for Samsung MFC V10.x Interface (FIMV) driver
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *     http://www.samsung.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _REGS_MFC_V10_H
+#define _REGS_MFC_V10_H
+
+#include <linux/sizes.h>
+#include "regs-mfc-v8.h"
+
+/* MFCv10 register definitions*/
+#define S5P_FIMV_MFC_CLOCK_OFF_V10			0x7120
+#define S5P_FIMV_MFC_STATE_V10				0x7124
+
+/* MFCv10 Context buffer sizes */
+#define MFC_CTX_BUF_SIZE_V10		(30 * SZ_1K)
+#define MFC_H264_DEC_CTX_BUF_SIZE_V10	(2 * SZ_1M)
+#define MFC_OTHER_DEC_CTX_BUF_SIZE_V10	(20 * SZ_1K)
+#define MFC_H264_ENC_CTX_BUF_SIZE_V10	(100 * SZ_1K)
+#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10	(15 * SZ_1K)
+
+/* MFCv10 variant defines */
+#define MAX_FW_SIZE_V10		(SZ_1M)
+#define MAX_CPB_SIZE_V10	(3 * SZ_1M)
+#define MFC_VERSION_V10		0xA0
+#define MFC_NUM_PORTS_V10	1
+
+#endif /*_REGS_MFC_V10_H*/
+
drivers/media/platform/s5p-mfc/s5p_mfc.c +25 -0
index 3c353e1..c63d764 100644
@@ -1614,6 +1614,28 @@ static struct s5p_mfc_variant mfc_drvdata_v8_5433 = {
 	.num_clocks	= 3,
 };
 
+static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
+	.dev_ctx        = MFC_CTX_BUF_SIZE_V10,
+	.h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V10,
+	.other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V10,
+	.h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V10,
+	.other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
+};
+
+static struct s5p_mfc_buf_size buf_size_v10 = {
+	.fw     = MAX_FW_SIZE_V10,
+	.cpb    = MAX_CPB_SIZE_V10,
+	.priv   = &mfc_buf_size_v10,
+};
+
+static struct s5p_mfc_variant mfc_drvdata_v10 = {
+	.version        = MFC_VERSION_V10,
+	.version_bit    = MFC_V10_BIT,
+	.port_num       = MFC_NUM_PORTS_V10,
+	.buf_size       = &buf_size_v10,
+	.fw_name[0]     = "s5p-mfc-v10.fw",
+};
+
 static const struct of_device_id exynos_mfc_match[] = {
 	{
 		.compatible = "samsung,mfc-v5",
@@ -1630,6 +1652,9 @@ static const struct of_device_id exynos_mfc_match[] = {
 	}, {
 		.compatible = "samsung,exynos5433-mfc",
 		.data = &mfc_drvdata_v8_5433,
+	}, {
+		.compatible = "samsung,mfc-v10",
+		.data = &mfc_drvdata_v10,
 	},
 	{},
 };
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +8 -1
index 5fb2684..eb0cf5e 100644
@@ -23,7 +23,7 @@
 #include <media/v4l2-ioctl.h>
 #include <media/videobuf2-v4l2.h>
 #include "regs-mfc.h"
-#include "regs-mfc-v8.h"
+#include "regs-mfc-v10.h"
 
 #define S5P_MFC_NAME		"s5p-mfc"
 
@@ -712,11 +712,18 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
 #define IS_MFCV6_PLUS(dev)	(dev->variant->version >= 0x60 ? 1 : 0)
 #define IS_MFCV7_PLUS(dev)	(dev->variant->version >= 0x70 ? 1 : 0)
 #define IS_MFCV8_PLUS(dev)	(dev->variant->version >= 0x80 ? 1 : 0)
+#define IS_MFCV10(dev)		(dev->variant->version >= 0xA0 ? 1 : 0)
 
 #define MFC_V5_BIT	BIT(0)
 #define MFC_V6_BIT	BIT(1)
 #define MFC_V7_BIT	BIT(2)
 #define MFC_V8_BIT	BIT(3)
+#define MFC_V10_BIT	BIT(5)
 
+#define MFC_V5PLUS_BITS		(MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | \
+					MFC_V8_BIT | MFC_V10_BIT)
+#define MFC_V6PLUS_BITS		(MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT | \
+					MFC_V10_BIT)
+#define MFC_V7PLUS_BITS		(MFC_V7_BIT | MFC_V8_BIT | MFC_V10_BIT)
 
 #endif /* S5P_MFC_COMMON_H_ */
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +4 -0
index 3769d22..3a3dd6d 100644
@@ -239,6 +239,10 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev)
 	}
 	else
 		mfc_write(dev, 0x3ff, S5P_FIMV_SW_RESET);
+
+	if (IS_MFCV10(dev))
+		mfc_write(dev, 0x0, S5P_FIMV_MFC_CLOCK_OFF_V10);
+
 	mfc_debug(2, "Will now wait for completion of firmware transfer\n");
 	if (s5p_mfc_wait_for_done_dev(dev, S5P_MFC_R2H_CMD_FW_STATUS_RET)) {
 		mfc_err("Failed to load firmware\n");
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +12 -20
index 42e9351..81de3029 100644
@@ -54,7 +54,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_NONE,
 		.type		= MFC_FMT_RAW,
 		.num_planes	= 2,
-		.versions	= MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V6PLUS_BITS,
 	},
 	{
 		.name		= "4:2:0 2 Planes Y/CrCb",
@@ -62,7 +62,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_NONE,
 		.type		= MFC_FMT_RAW,
 		.num_planes	= 2,
-		.versions	= MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V6PLUS_BITS,
 	},
 	{
 		.name		= "H264 Encoded Stream",
@@ -70,8 +70,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_H264_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "H264/MVC Encoded Stream",
@@ -79,7 +78,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_H264_MVC_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V6PLUS_BITS,
 	},
 	{
 		.name		= "H263 Encoded Stream",
@@ -87,8 +86,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_H263_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "MPEG1 Encoded Stream",
@@ -96,8 +94,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_MPEG2_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "MPEG2 Encoded Stream",
@@ -105,8 +102,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_MPEG2_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "MPEG4 Encoded Stream",
@@ -114,8 +110,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_MPEG4_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "XviD Encoded Stream",
@@ -123,8 +118,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_MPEG4_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "VC1 Encoded Stream",
@@ -132,8 +126,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_VC1_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "VC1 RCV Encoded Stream",
@@ -141,8 +134,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_VC1RCV_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "VP8 Encoded Stream",
@@ -150,7 +142,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_VP8_DEC,
 		.type		= MFC_FMT_DEC,
 		.num_planes	= 1,
-		.versions	= MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V6PLUS_BITS,
 	},
 };
 
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +6 -10
index 2a5fd7c..64b6b6d 100644
@@ -57,8 +57,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_NONE,
 		.type		= MFC_FMT_RAW,
 		.num_planes	= 2,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "4:2:0 2 Planes Y/CrCb",
@@ -66,7 +65,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_NONE,
 		.type		= MFC_FMT_RAW,
 		.num_planes	= 2,
-		.versions	= MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V6PLUS_BITS,
 	},
 	{
 		.name		= "H264 Encoded Stream",
@@ -74,8 +73,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_H264_ENC,
 		.type		= MFC_FMT_ENC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "MPEG4 Encoded Stream",
@@ -83,8 +81,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_MPEG4_ENC,
 		.type		= MFC_FMT_ENC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "H263 Encoded Stream",
@@ -92,8 +89,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_H263_ENC,
 		.type		= MFC_FMT_ENC,
 		.num_planes	= 1,
-		.versions	= MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT |
-								MFC_V8_BIT,
+		.versions	= MFC_V5PLUS_BITS,
 	},
 	{
 		.name		= "VP8 Encoded Stream",
@@ -101,7 +97,7 @@ static struct s5p_mfc_fmt formats[] = {
 		.codec_mode	= S5P_MFC_CODEC_VP8_ENC,
 		.type		= MFC_FMT_ENC,
 		.num_planes	= 1,
-		.versions	= MFC_V7_BIT | MFC_V8_BIT,
+		.versions	= MFC_V7PLUS_BITS,
 	},
 };
 
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +7 -2
index d52f23c..73bcf86 100644
@@ -356,6 +356,7 @@ static int calc_plane(int width, int height)
 
 static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx)
 {
+	struct s5p_mfc_dev *dev = ctx->dev;
 	ctx->buf_width = ALIGN(ctx->img_width, S5P_FIMV_NV12MT_HALIGN_V6);
 	ctx->buf_height = ALIGN(ctx->img_height, S5P_FIMV_NV12MT_VALIGN_V6);
 	mfc_debug(2, "SEQ Done: Movie dimensions %dx%d,\n"
@@ -372,8 +373,12 @@ static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx)
 
 	if (ctx->codec_mode == S5P_MFC_CODEC_H264_DEC ||
 			ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC) {
-		ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V6(ctx->img_width,
-				ctx->img_height);
+		if (IS_MFCV10(dev))
+			ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V10(ctx->img_width,
+					ctx->img_height);
+		else
+			ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V6(ctx->img_width,
+					ctx->img_height);
 		ctx->mv_size = ALIGN(ctx->mv_size, 16);
 	} else {
 		ctx->mv_size = 0;
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h +2 -0
index 8055848..021b8db 100644
@@ -24,6 +24,8 @@
 #define MB_HEIGHT(y_size)		DIV_ROUND_UP(y_size, 16)
 #define S5P_MFC_DEC_MV_SIZE_V6(x, y)	(MB_WIDTH(x) * \
 					(((MB_HEIGHT(y)+1)/2)*2) * 64 + 128)
+#define S5P_MFC_DEC_MV_SIZE_V10(x, y)	(MB_WIDTH(x) * \
+					(((MB_HEIGHT(y)+1)/2)*2) * 64 + 512)
 
 /* Definition */
 #define ENC_MULTI_SLICE_MB_MAX		((1 << 30) - 1)
Signature · 1 line
2.7.4
#4 lore raw

PATCH v4 3/12 s5p-mfc: Use min scratch buffer size as provided by F/W

In reply to Smitha T Murthy

After MFC v8.0, mfc f/w lets the driver know how much scratch buffer size is required for decoder. If mfc f/w has the functionality, E_MIN_SCRATCH_BUFFER_SIZE, driver can know how much scratch buffer size is required for encoder too.

---
 drivers/media/platform/s5p-mfc/regs-mfc-v8.h    |  2 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c        |  2 +
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c    |  5 ++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h    |  4 ++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 68 ++++++++++++++++++-------
 6 files changed, 65 insertions(+), 17 deletions(-)
drivers/media/platform/s5p-mfc/regs-mfc-v8.h +2 -0
index 75f5f75..bd639ae 100644
@@ -17,6 +17,7 @@
 
 /* Additional registers for v8 */
 #define S5P_FIMV_D_MVC_NUM_VIEWS_V8		0xf104
+#define S5P_FIMV_D_MIN_SCRATCH_BUFFER_SIZE_V8	0xf108
 #define S5P_FIMV_D_FIRST_PLANE_DPB_SIZE_V8	0xf144
 #define S5P_FIMV_D_SECOND_PLANE_DPB_SIZE_V8	0xf148
 #define S5P_FIMV_D_MV_BUFFER_SIZE_V8		0xf150
@@ -84,6 +85,7 @@
 
 #define S5P_FIMV_E_VBV_BUFFER_SIZE_V8		0xf78c
 #define S5P_FIMV_E_VBV_INIT_DELAY_V8		0xf790
+#define S5P_FIMV_E_MIN_SCRATCH_BUFFER_SIZE_V8   0xf894
 
 #define S5P_FIMV_E_ASPECT_RATIO_V8		0xfb4c
 #define S5P_FIMV_E_EXTENDED_SAR_V8		0xfb50
drivers/media/platform/s5p-mfc/s5p_mfc.c +2 -0
index c63d764..a0e9e0f 100644
@@ -526,6 +526,8 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx,
 				dev);
 		ctx->mv_count = s5p_mfc_hw_call(dev->mfc_ops, get_mv_count,
 				dev);
+		ctx->scratch_buf_size = s5p_mfc_hw_call(dev->mfc_ops,
+						get_min_scratch_buf_size, dev);
 		if (ctx->img_width == 0 || ctx->img_height == 0)
 			ctx->state = MFCINST_ERROR;
 		else
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +1 -0
index eb0cf5e..e65e1c3 100644
@@ -713,6 +713,7 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
 #define IS_MFCV7_PLUS(dev)	(dev->variant->version >= 0x70 ? 1 : 0)
 #define IS_MFCV8_PLUS(dev)	(dev->variant->version >= 0x80 ? 1 : 0)
 #define IS_MFCV10(dev)		(dev->variant->version >= 0xA0 ? 1 : 0)
+#define FW_HAS_E_MIN_SCRATCH_BUF(dev) (IS_MFCV10(dev))
 
 #define MFC_V5_BIT	BIT(0)
 #define MFC_V6_BIT	BIT(1)
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +5 -0
index 64b6b6d..eb5352a 100644
@@ -813,6 +813,11 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx)
 				get_enc_dpb_count, dev);
 		if (ctx->pb_count < enc_pb_count)
 			ctx->pb_count = enc_pb_count;
+		if (FW_HAS_E_MIN_SCRATCH_BUF(dev)) {
+			ctx->scratch_buf_size = s5p_mfc_hw_call(dev->mfc_ops,
+					get_e_min_scratch_buf_size, dev);
+			ctx->bank1.size += ctx->scratch_buf_size;
+		}
 		ctx->state = MFCINST_HEAD_PRODUCED;
 	}
 
drivers/media/platform/s5p-mfc/s5p_mfc_opr.h +4 -0
index 16d553f..e7a2d46 100644
@@ -169,6 +169,7 @@ struct s5p_mfc_regs {
 	void __iomem *d_decoded_third_addr;/* only v7 */
 	void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */
 	void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */
+	void __iomem *d_min_scratch_buffer_size; /* v10 */
 
 	/* encoder registers */
 	void __iomem *e_frame_width;
@@ -268,6 +269,7 @@ struct s5p_mfc_regs {
 	void __iomem *e_vp8_hierarchical_qp_layer0;/* v7 and v8 */
 	void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */
 	void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */
+	void __iomem *e_min_scratch_buffer_size; /* v10 */
 };
 
 struct s5p_mfc_hw_ops {
@@ -311,6 +313,8 @@ struct s5p_mfc_hw_ops {
 	unsigned int (*get_pic_type_bot)(struct s5p_mfc_ctx *ctx);
 	unsigned int (*get_crop_info_h)(struct s5p_mfc_ctx *ctx);
 	unsigned int (*get_crop_info_v)(struct s5p_mfc_ctx *ctx);
+	int (*get_min_scratch_buf_size)(struct s5p_mfc_dev *dev);
+	int (*get_e_min_scratch_buf_size)(struct s5p_mfc_dev *dev);
 };
 
 void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev);
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +51 -17

139 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH v4 4/12 s5p-mfc: Support MFCv10.10 buffer requirements

In reply to Smitha T Murthy

Aligning the luma_dpb_size, chroma_dpb_size, mv_size and me_buffer_size for MFCv10.10.

---
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h   | 19 +++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 95 +++++++++++++++++++------
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |  2 +
 3 files changed, 95 insertions(+), 21 deletions(-)
drivers/media/platform/s5p-mfc/regs-mfc-v10.h +19 -0
index 1ca09d6..3f0dab3 100644
@@ -32,5 +32,24 @@
 #define MFC_VERSION_V10		0xA0
 #define MFC_NUM_PORTS_V10	1
 
+/* MFCv10 codec defines*/
+#define S5P_FIMV_CODEC_HEVC_ENC         26
+
+/* Encoder buffer size for MFC v10.0 */
+#define ENC_V100_BASE_SIZE(x, y) \
+	(((x + 3) * (y + 3) * 8) \
+	+  ((y * 64) + 1280) * DIV_ROUND_UP(x, 8))
+
+#define ENC_V100_H264_ME_SIZE(x, y) \
+	(ENC_V100_BASE_SIZE(x, y) \
+	+ (DIV_ROUND_UP(x * y, 64) * 32))
+
+#define ENC_V100_MPEG4_ME_SIZE(x, y) \
+	(ENC_V100_BASE_SIZE(x, y) \
+	+ (DIV_ROUND_UP(x * y, 128) * 16))
+
+#define ENC_V100_VP8_ME_SIZE(x, y) \
+	ENC_V100_BASE_SIZE(x, y)
+
 #endif /*_REGS_MFC_V10_H*/
 
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +74 -21

147 lines not on this page · raw message

drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h +2 -0
index 021b8db..975bbc5 100644
@@ -26,6 +26,8 @@
 					(((MB_HEIGHT(y)+1)/2)*2) * 64 + 128)
 #define S5P_MFC_DEC_MV_SIZE_V10(x, y)	(MB_WIDTH(x) * \
 					(((MB_HEIGHT(y)+1)/2)*2) * 64 + 512)
+#define enc_lcu_width(x_size)		DIV_ROUND_UP(x_size, 32)
+#define enc_lcu_height(y_size)		DIV_ROUND_UP(y_size, 32)
 
 /* Definition */
 #define ENC_MULTI_SLICE_MB_MAX		((1 << 30) - 1)
Signature · 1 line
2.7.4
#6 lore raw

PATCH v4 5/12 videodev2.h: Add v4l2 definition for HEVC

In reply to Smitha T Murthy

Add V4L2 definition for HEVC compressed format

---
 include/uapi/linux/videodev2.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/videodev2.h +1 -0
index 316be62..03d4765 100644
@@ -628,6 +628,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
 #define V4L2_PIX_FMT_VP8      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
 #define V4L2_PIX_FMT_VP9      v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
+#define V4L2_PIX_FMT_HEVC     v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC */
 
 /*  Vendor-specific formats   */
 #define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
Signature · 1 line
2.7.4
#7 lore raw

PATCH v4 6/12 v4l2-ioctl: add HEVC format description

In reply to Smitha T Murthy

HEVC is a video coding format

---
 drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/v4l2-core/v4l2-ioctl.c +1 -0
index 0c3f238..529d1f8 100644
@@ -1239,6 +1239,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 		case V4L2_PIX_FMT_VC1_ANNEX_L:	descr = "VC-1 (SMPTE 412M Annex L)"; break;
 		case V4L2_PIX_FMT_VP8:		descr = "VP8"; break;
 		case V4L2_PIX_FMT_VP9:		descr = "VP9"; break;
+		case V4L2_PIX_FMT_HEVC:		descr = "HEVC"; break;
 		case V4L2_PIX_FMT_CPIA1:	descr = "GSPCA CPiA YUV"; break;
 		case V4L2_PIX_FMT_WNVA:		descr = "WNVA"; break;
 		case V4L2_PIX_FMT_SN9C10X:	descr = "GSPCA SN9C10X"; break;
Signature · 1 line
2.7.4
#8 lore raw

PATCH v4 7/12 Documentation: v4l: Documentation for HEVC v4l2 definition

In reply to Smitha T Murthy

Add V4L2 definition for HEVC compressed format which is also known as H.265.

---
 Documentation/media/uapi/v4l/pixfmt-013.rst | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/media/uapi/v4l/pixfmt-013.rst +5 -0
index 728d7ed..abec039 100644
@@ -90,3 +90,8 @@ Compressed Formats
       - ``V4L2_PIX_FMT_VP9``
       - 'VP90'
       - VP9 video elementary stream.
+    * .. _V4L2-PIX-FMT-HEVC:
+
+      - ``V4L2_PIX_FMT_HEVC``
+      - 'HEVC'
+      - HEVC/H.265 video elementary stream.
Signature · 1 line
2.7.4
#9 lore raw

PATCH v4 8/12 s5p-mfc: Add support for HEVC decoder

In reply to Smitha T Murthy

Add support for codec definition and corresponding buffer requirements for HEVC decoder.

---
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |  3 +++
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c    |  7 +++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 17 +++++++++++++++--
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |  3 +++
 6 files changed, 30 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-mfc/regs-mfc-v10.h +1 -0
index 3f0dab3..953a073 100644
@@ -33,6 +33,7 @@
 #define MFC_NUM_PORTS_V10	1
 
 /* MFCv10 codec defines*/
+#define S5P_FIMV_CODEC_HEVC_DEC		17
 #define S5P_FIMV_CODEC_HEVC_ENC         26
 
 /* Encoder buffer size for MFC v10.0 */
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c +3 -0
index b1b1491..76eca67 100644
@@ -101,6 +101,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
 	case S5P_MFC_CODEC_VP8_DEC:
 		codec_type = S5P_FIMV_CODEC_VP8_DEC_V6;
 		break;
+	case S5P_MFC_CODEC_HEVC_DEC:
+		codec_type = S5P_FIMV_CODEC_HEVC_DEC;
+		break;
 	case S5P_MFC_CODEC_H264_ENC:
 		codec_type = S5P_FIMV_CODEC_H264_ENC_V6;
 		break;
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +1 -0
index e65e1c3..828e07e 100644
@@ -72,6 +72,7 @@
 #define S5P_MFC_CODEC_H263_DEC		5
 #define S5P_MFC_CODEC_VC1RCV_DEC	6
 #define S5P_MFC_CODEC_VP8_DEC		7
+#define S5P_MFC_CODEC_HEVC_DEC		17
 
 #define S5P_MFC_CODEC_H264_ENC		20
 #define S5P_MFC_CODEC_H264_MVC_ENC	21
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +7 -0
index 81de3029..4749355 100644
@@ -144,6 +144,13 @@ static struct s5p_mfc_fmt formats[] = {
 		.num_planes	= 1,
 		.versions	= MFC_V6PLUS_BITS,
 	},
+	{
+		.fourcc		= V4L2_PIX_FMT_HEVC,
+		.codec_mode	= S5P_FIMV_CODEC_HEVC_DEC,
+		.type		= MFC_FMT_DEC,
+		.num_planes	= 1,
+		.versions	= MFC_V10_BIT,
+	},
 };
 
 #define NUM_FORMATS ARRAY_SIZE(formats)
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +15 -2
index 2d26b1b..979c4ce 100644
@@ -220,6 +220,12 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 				S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
 		ctx->bank1.size = ctx->scratch_buf_size;
 		break;
+	case S5P_MFC_CODEC_HEVC_DEC:
+		mfc_debug(2, "Use min scratch buffer size\n");
+		ctx->bank1.size =
+			ctx->scratch_buf_size +
+			(ctx->mv_count * ctx->mv_size);
+		break;
 	case S5P_MFC_CODEC_H264_ENC:
 		if (IS_MFCV10(dev)) {
 			mfc_debug(2, "Use min scratch buffer size\n");
@@ -321,6 +327,7 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx)
 	switch (ctx->codec_mode) {
 	case S5P_MFC_CODEC_H264_DEC:
 	case S5P_MFC_CODEC_H264_MVC_DEC:
+	case S5P_MFC_CODEC_HEVC_DEC:
 		ctx->ctx.size = buf_size->h264_dec_ctx;
 		break;
 	case S5P_MFC_CODEC_MPEG4_DEC:
@@ -434,6 +441,10 @@ static void s5p_mfc_dec_calc_dpb_size_v6(struct s5p_mfc_ctx *ctx)
 			ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V6(ctx->img_width,
 					ctx->img_height);
 		}
+	} else if (ctx->codec_mode == S5P_MFC_CODEC_HEVC_DEC) {
+		ctx->mv_size = s5p_mfc_dec_hevc_mv_size(ctx->img_width,
+				ctx->img_height);
+		ctx->mv_size = ALIGN(ctx->mv_size, 32);
 	} else {
 		ctx->mv_size = 0;
 	}
@@ -515,7 +526,8 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
 	buf_size1 -= ctx->scratch_buf_size;
 
 	if (ctx->codec_mode == S5P_FIMV_CODEC_H264_DEC ||
-			ctx->codec_mode == S5P_FIMV_CODEC_H264_MVC_DEC){
+			ctx->codec_mode == S5P_FIMV_CODEC_H264_MVC_DEC ||
+			ctx->codec_mode == S5P_FIMV_CODEC_HEVC_DEC) {
 		writel(ctx->mv_size, mfc_regs->d_mv_buffer_size);
 		writel(ctx->mv_count, mfc_regs->d_num_mv);
 	}
@@ -538,7 +550,8 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
 				mfc_regs->d_second_plane_dpb + i * 4);
 	}
 	if (ctx->codec_mode == S5P_MFC_CODEC_H264_DEC ||
-			ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC) {
+			ctx->codec_mode == S5P_MFC_CODEC_H264_MVC_DEC ||
+			ctx->codec_mode == S5P_MFC_CODEC_HEVC_DEC) {
 		for (i = 0; i < ctx->mv_count; i++) {
 			/* To test alignment */
 			align_gap = buf_addr1;
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h +3 -0
index 975bbc5..2290f7e 100644
@@ -29,6 +29,9 @@
 #define enc_lcu_width(x_size)		DIV_ROUND_UP(x_size, 32)
 #define enc_lcu_height(y_size)		DIV_ROUND_UP(y_size, 32)
 
+#define s5p_mfc_dec_hevc_mv_size(x, y) \
+	(DIV_ROUND_UP(x, 64) * DIV_ROUND_UP(y, 64) * 256 + 512)
+
 /* Definition */
 #define ENC_MULTI_SLICE_MB_MAX		((1 << 30) - 1)
 #define ENC_MULTI_SLICE_BIT_MIN		2800
Signature · 1 line
2.7.4
#10 lore raw

PATCH v4 9/12 s5p-mfc: Add VP9 decoder support

In reply to Smitha T Murthy

Add support for codec definition and corresponding buffer requirements for VP9 decoder.

---
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  6 ++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |  3 +++
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c    |  7 +++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h    |  2 ++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 26 +++++++++++++++++++++++++
 6 files changed, 45 insertions(+)
drivers/media/platform/s5p-mfc/regs-mfc-v10.h +6 -0
index 953a073..6754477 100644
@@ -18,6 +18,8 @@
 /* MFCv10 register definitions*/
 #define S5P_FIMV_MFC_CLOCK_OFF_V10			0x7120
 #define S5P_FIMV_MFC_STATE_V10				0x7124
+#define S5P_FIMV_D_STATIC_BUFFER_ADDR_V10		0xF570
+#define S5P_FIMV_D_STATIC_BUFFER_SIZE_V10		0xF574
 
 /* MFCv10 Context buffer sizes */
 #define MFC_CTX_BUF_SIZE_V10		(30 * SZ_1K)
@@ -34,8 +36,12 @@
 
 /* MFCv10 codec defines*/
 #define S5P_FIMV_CODEC_HEVC_DEC		17
+#define S5P_FIMV_CODEC_VP9_DEC		18
 #define S5P_FIMV_CODEC_HEVC_ENC         26
 
+/* Decoder buffer size for MFC v10 */
+#define DEC_VP9_STATIC_BUFFER_SIZE	20480
+
 /* Encoder buffer size for MFC v10.0 */
 #define ENC_V100_BASE_SIZE(x, y) \
 	(((x + 3) * (y + 3) * 8) \
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c +3 -0
index 76eca67..102b47e 100644
@@ -104,6 +104,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
 	case S5P_MFC_CODEC_HEVC_DEC:
 		codec_type = S5P_FIMV_CODEC_HEVC_DEC;
 		break;
+	case S5P_MFC_CODEC_VP9_DEC:
+		codec_type = S5P_FIMV_CODEC_VP9_DEC;
+		break;
 	case S5P_MFC_CODEC_H264_ENC:
 		codec_type = S5P_FIMV_CODEC_H264_ENC_V6;
 		break;
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +1 -0
index 828e07e..b49f220 100644
@@ -73,6 +73,7 @@
 #define S5P_MFC_CODEC_VC1RCV_DEC	6
 #define S5P_MFC_CODEC_VP8_DEC		7
 #define S5P_MFC_CODEC_HEVC_DEC		17
+#define S5P_MFC_CODEC_VP9_DEC		18
 
 #define S5P_MFC_CODEC_H264_ENC		20
 #define S5P_MFC_CODEC_H264_MVC_ENC	21
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +7 -0
index 4749355..5cf4d99 100644
@@ -151,6 +151,13 @@ static struct s5p_mfc_fmt formats[] = {
 		.num_planes	= 1,
 		.versions	= MFC_V10_BIT,
 	},
+	{
+		.fourcc		= V4L2_PIX_FMT_VP9,
+		.codec_mode	= S5P_FIMV_CODEC_VP9_DEC,
+		.type		= MFC_FMT_DEC,
+		.num_planes	= 1,
+		.versions	= MFC_V10_BIT,
+	},
 };
 
 #define NUM_FORMATS ARRAY_SIZE(formats)
drivers/media/platform/s5p-mfc/s5p_mfc_opr.h +2 -0
index e7a2d46..57f4560 100644
@@ -170,6 +170,8 @@ struct s5p_mfc_regs {
 	void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */
 	void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */
 	void __iomem *d_min_scratch_buffer_size; /* v10 */
+	void __iomem *d_static_buffer_addr; /* v10 */
+	void __iomem *d_static_buffer_size; /* v10 */
 
 	/* encoder registers */
 	void __iomem *e_frame_width;
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +26 -0
index 979c4ce..cb0380b 100644
@@ -226,6 +226,12 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
 			ctx->scratch_buf_size +
 			(ctx->mv_count * ctx->mv_size);
 		break;
+	case S5P_MFC_CODEC_VP9_DEC:
+		mfc_debug(2, "Use min scratch buffer size\n");
+		ctx->bank1.size =
+			ctx->scratch_buf_size +
+			DEC_VP9_STATIC_BUFFER_SIZE;
+		break;
 	case S5P_MFC_CODEC_H264_ENC:
 		if (IS_MFCV10(dev)) {
 			mfc_debug(2, "Use min scratch buffer size\n");
@@ -336,6 +342,7 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx)
 	case S5P_MFC_CODEC_VC1_DEC:
 	case S5P_MFC_CODEC_MPEG2_DEC:
 	case S5P_MFC_CODEC_VP8_DEC:
+	case S5P_MFC_CODEC_VP9_DEC:
 		ctx->ctx.size = buf_size->other_dec_ctx;
 		break;
 	case S5P_MFC_CODEC_H264_ENC:
@@ -566,6 +573,13 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
 			buf_size1 -= frame_size_mv;
 		}
 	}
+	if (ctx->codec_mode == S5P_FIMV_CODEC_VP9_DEC) {
+		writel(buf_addr1, mfc_regs->d_static_buffer_addr);
+		writel(DEC_VP9_STATIC_BUFFER_SIZE,
+				mfc_regs->d_static_buffer_size);
+		buf_addr1 += DEC_VP9_STATIC_BUFFER_SIZE;
+		buf_size1 -= DEC_VP9_STATIC_BUFFER_SIZE;
+	}
 
 	mfc_debug(2, "Buf1: %zx, buf_size1: %d (frames %d)\n",
 			buf_addr1, buf_size1, ctx->total_dpb_count);
@@ -2272,6 +2286,18 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev)
 	R(e_h264_options, S5P_FIMV_E_H264_OPTIONS_V8);
 	R(e_min_scratch_buffer_size, S5P_FIMV_E_MIN_SCRATCH_BUFFER_SIZE_V8);
 
+	if (!IS_MFCV10(dev))
+		goto done;
+
+	/* Initialize registers used in MFC v10 only.
+	 * Also, over-write the registers which have
+	 * a different offset for MFC v10.
+	 */
+
+	/* decoder registers */
+	R(d_static_buffer_addr, S5P_FIMV_D_STATIC_BUFFER_ADDR_V10);
+	R(d_static_buffer_size, S5P_FIMV_D_STATIC_BUFFER_SIZE_V10);
+
 done:
 	return &mfc_regs;
 #undef S5P_MFC_REG_ADDR
Signature · 1 line
2.7.4
#11 lore raw

PATCH v4 10/12 v4l2: Add v4l2 control IDs for HEVC encoder

In reply to Smitha T Murthy

Add v4l2 controls for HEVC encoder

---
 drivers/media/v4l2-core/v4l2-ctrls.c | 104 +++++++++++++++++++++++++++
 include/uapi/linux/v4l2-controls.h   | 132 +++++++++++++++++++++++++++++++++++
 2 files changed, 236 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls.c +104 -0
index b9e08e3..b68d38b5 100644
@@ -479,6 +479,51 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
 		NULL,
 	};
 
+	static const char * const hevc_profile[] = {
+		"Main",
+		"Main Still Picture",
+		NULL,
+	};
+	static const char * const hevc_level[] = {
+		"1",
+		"2",
+		"2.1",
+		"3",
+		"3.1",
+		"4",
+		"4.1",
+		"5",
+		"5.1",
+		"5.2",
+		"6",
+		"6.1",
+		"6.2",
+		NULL,
+	};
+	static const char * const hevc_hierarchial_coding_type[] = {
+		"B",
+		"P",
+		NULL,
+	};
+	static const char * const hevc_refresh_type[] = {
+		"None",
+		"CRA",
+		"IDR",
+		NULL,
+	};
+	static const char * const hevc_size_of_length_field[] = {
+		"0",
+		"1",
+		"2",
+		"4",
+		NULL,
+	};
+	static const char * const hevc_tier_flag[] = {
+		"Main",
+		"High",
+		NULL,
+	};
+
 
 	switch (id) {
 	case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -574,6 +619,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
 		return dv_it_content_type;
 	case V4L2_CID_DETECT_MD_MODE:
 		return detect_md_mode;
+	case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
+		return hevc_profile;
+	case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
+		return hevc_level;
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE:
+		return hevc_hierarchial_coding_type;
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE:
+		return hevc_refresh_type;
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:
+		return hevc_size_of_length_field;
+	case V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG:
+		return hevc_tier_flag;
 
 	default:
 		return NULL;
@@ -775,6 +832,47 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP:		return "VPX P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_VPX_PROFILE:			return "VPX Profile";
 
+	/* HEVC controls */
+	case V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP:		return "HEVC I-Frame QP Value";
+	case V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP:		return "HEVC P-Frame QP Value";
+	case V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP:		return "HEVC B-Frame QP Value";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP:			return "HEVC Minimum QP Value";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP:			return "HEVC Maximum QP Value";
+	case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:			return "HEVC Profile";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:			return "HEVC Level";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG:		return "HEVC Tier_flag";
+	case V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION:	return "HEVC Frame Rate Resolution";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH:	return "HEVC Maximum Coding Unit Depth";
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE:		return "HEVC Refresh Type";
+	case V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED:		return "HEVC Constant Intra Prediction";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU:		return "HEVC Lossless Encoding";
+	case V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT:		return "HEVC Wavefront";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF:			return "HEVC Loop Filter";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY:	return "HEVC LF Across Slice Boundary or Not";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP:		return "HEVC QP Values";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE:	return "HEVC Hierarchical Coding Type";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER:return "HEVC Hierarchical Coding Layer";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP:return "HEVC Hierarchical Layer QP";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE:return "HEVC Hierarchical Lay 0 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE:return "HEVC Hierarchical Lay 1 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE:return "HEVC Hierarchical Lay 2 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE:return "HEVC Hierarchical Lay 3 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE:return "HEVC Hierarchical Lay 4 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE:return "HEVC Hierarchical Lay 5 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE:return "HEVC Hierarchical Lay 6 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING:		return "HEVC Sign Data Hiding";
+	case V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB:		return "HEVC General PB";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID:		return "HEVC Temporal ID";
+	case V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING:		return "HEVC Strong Intra Smoothing";
+	case V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT:		return "HEVC Intra PU Split";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION:		return "HEVC TMV Prediction";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1:	return "HEVC Max Number of Candidate MVs";
+	case V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE:	return "HEVC ENC Without Startcode";
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD:		return "HEVC Num of I Frame b/w 2 IDR";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2:	return "HEVC Loop Filter Beta Offset";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2:	return "HEVC Loop Filter tc Offset";
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:	return "HEVC Size of Length Field";
+
 	/* CAMERA controls */
 	/* Keep the order of the 'case's the same as in v4l2-controls.h! */
 	case V4L2_CID_CAMERA_CLASS:		return "Camera Controls";
@@ -1063,6 +1161,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_TUNE_DEEMPHASIS:
 	case V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL:
 	case V4L2_CID_DETECT_MD_MODE:
+	case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
+	case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE:
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE:
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:
+	case V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG:
 		*type = V4L2_CTRL_TYPE_MENU;
 		break;
 	case V4L2_CID_LINK_FREQ:
include/uapi/linux/v4l2-controls.h +132 -0

144 lines not on this page · raw message

Signature · 1 line
2.7.4
#12 lore raw

Re: [Patch v4 10/12] [media] v4l2: Add v4l2 control IDs for HEVC encoder

Quoted 5 lines · Smitha T Murthy
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
@@ -775,6 +832,47 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP:		return "VPX P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_VPX_PROFILE:			return "VPX Profile";
 
+	/* HEVC controls */

[...]

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 851

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY:	return "HEVC LF Across Slice Boundary or Not";

Please make sure the names are no longer than 31 characters to avoid truncation during control enumeration in user space.
Data structures like struct v4l2_queryctrl, struct v4l2_query_ext_ctrl have only 32 bytes long array dedicated for the control name.

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 855

Quoted 5 lines
drivers/media/v4l2-core/v4l2-ctrls.c +4 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP:		return "HEVC QP Values";
 
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE:	return "HEVC Hierarchical Coding Type";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER:return "HEVC Hierarchical Coding Layer";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP:return "HEVC Hierarchical Layer QP";

How about s/HIERARCHICAL_/HIER_ for the above 3 control IDs?

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 862

Quoted 7 lines
drivers/media/v4l2-core/v4l2-ctrls.c +7 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE:return "HEVC Hierarchical Lay 0 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE:return "HEVC Hierarchical Lay 1 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE:return "HEVC Hierarchical Lay 2 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE:return "HEVC Hierarchical Lay 3 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE:return "HEVC Hierarchical Lay 4 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE:return "HEVC Hierarchical Lay 5 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE:return "HEVC Hierarchical Lay 6 Bit Rate";

Using single letter L instead of LAYER would make the control ID shorter and more consistent with existing controls, e.g. V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BITRATE.

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 873

Quoted 11 lines
drivers/media/v4l2-core/v4l2-ctrls.c +11 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING:		return "HEVC Sign Data Hiding";
+	case V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB:		return "HEVC General PB";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID:		return "HEVC Temporal ID";
+	case V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING:		return "HEVC Strong Intra Smoothing";
+	case V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT:		return "HEVC Intra PU Split";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION:		return "HEVC TMV Prediction";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1:	return "HEVC Max Number of Candidate MVs";
+	case V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE:	return "HEVC ENC Without Startcode";
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD:		return "HEVC Num of I Frame b/w 2 IDR";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2:	return "HEVC Loop Filter Beta Offset";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2:	return "HEVC Loop Filter tc Offset";

s/tc/Tc or s/tc/TC ?

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 874

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:	return "HEVC Size of Length Field";

--
Thanks,
Sylwester

#13 lore raw

Re: [Patch v4 10/12] [media] v4l2: Add v4l2 control IDs for HEVC encoder

Quoted 5 lines · Sylwester Nawrocki
Quoted 4 lines · Smitha T Murthy
drivers/media/v4l2-core/v4l2-ctrls.c +0 -0
@@ -775,6 +832,47 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP:		return "VPX P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_VPX_PROFILE:			return "VPX Profile";
 
Quoted 8 lines
Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	/* HEVC controls */

[...]

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 851

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY:	return "HEVC LF Across Slice Boundary or Not";

Please make sure the names are no longer than 31 characters to avoid truncation during control enumeration in user space.
Data structures like struct v4l2_queryctrl, struct v4l2_query_ext_ctrl have only 32 bytes long array dedicated for the control name.

I will try to make the names less than 31 characters long without losing the context. But there are many control names in this file which are longer than 31 characters like V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP, V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD etc so I assumed it was alright to have such long names. But I will shorten them as per your suggestion.

Quoted 9 lines

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 855

Quoted 6 lines
drivers/media/v4l2-core/v4l2-ctrls.c +4 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP:		return "HEVC QP Values";
 
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE:	return "HEVC Hierarchical Coding Type";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER:return "HEVC Hierarchical Coding Layer";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP:return "HEVC Hierarchical Layer QP";

How about s/HIERARCHICAL_/HIER_ for the above 3 control IDs?

Ok I will change it.

Quoted 12 lines

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 862

Quoted 7 lines
drivers/media/v4l2-core/v4l2-ctrls.c +7 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE:return "HEVC Hierarchical Lay 0 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE:return "HEVC Hierarchical Lay 1 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE:return "HEVC Hierarchical Lay 2 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE:return "HEVC Hierarchical Lay 3 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE:return "HEVC Hierarchical Lay 4 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE:return "HEVC Hierarchical Lay 5 Bit Rate";
+	case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE:return "HEVC Hierarchical Lay 6 Bit Rate";

Using single letter L instead of LAYER would make the control ID shorter and more consistent with existing controls, e.g. V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BITRATE.

Ok I will change it.

Quoted 5 lines
Quoted 5 lines
drivers/media/v4l2-core/v4l2-ctrls.c +5 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING:		return "HEVC Sign Data Hiding";
+	case V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB:		return "HEVC General PB";
+	case V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID:		return "HEVC Temporal ID";
+	case V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING:		return "HEVC Strong Intra Smoothing";
+	case V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT:		return "HEVC Intra PU Split";
Quoted 9 lines

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 873

Quoted 6 lines
drivers/media/v4l2-core/v4l2-ctrls.c +6 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION:		return "HEVC TMV Prediction";
+	case V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1:	return "HEVC Max Number of Candidate MVs";
+	case V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE:	return "HEVC ENC Without Startcode";
+	case V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD:		return "HEVC Num of I Frame b/w 2 IDR";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2:	return "HEVC Loop Filter Beta Offset";
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2:	return "HEVC Loop Filter tc Offset";

s/tc/Tc or s/tc/TC ?

I will correct it.

Quoted 6 lines

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 874

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:	return "HEVC Size of Length Field";

--
Thanks,
Sylwester

Thank you for the review.

Regards,
Smitha

#14 lore raw

Re: [Patch v4 10/12] [media] v4l2: Add v4l2 control IDs for HEVC encoder

Quoted 14 lines · Smitha T Murthy
Quoted 5 lines · Sylwester Nawrocki
Quoted 4 lines · Smitha T Murthy
drivers/media/v4l2-core/v4l2-ctrls.c +0 -0
@@ -775,6 +832,47 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP:		return "VPX P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_VPX_PROFILE:			return "VPX Profile";
 
Quoted 7 lines
Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	/* HEVC controls */

[...]

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 851

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY:	return "HEVC LF Across Slice Boundary or Not";

Please make sure the names are no longer than 31 characters to avoid truncation during control enumeration in user space.
Data structures like struct v4l2_queryctrl, struct v4l2_query_ext_ctrl have only 32 bytes long array dedicated for the control name.

Quoted 7 lines

I will try to make the names less than 31 characters long without losing the context. But there are many control names in this file which are longer than 31 characters like V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP, V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD etc so I assumed it was alright to have such long names. But I will shorten them as per your suggestion.

Apologies if it wasn't clean enough but my comment referred to the length of the character string being returned (e.g. "HEVC LF Across Slice Boundary or Not") and not to the name of the enum.

--
Regards,
Sylwester

#15 lore raw

Re: [Patch v4 10/12] [media] v4l2: Add v4l2 control IDs for HEVC encoder

Quoted 23 lines · Sylwester Nawrocki
Quoted 14 lines · Smitha T Murthy
Quoted 5 lines · Sylwester Nawrocki
Quoted 4 lines · Smitha T Murthy
drivers/media/v4l2-core/v4l2-ctrls.c +0 -0
@@ -775,6 +832,47 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP:		return "VPX P-Frame QP Value";
 	case V4L2_CID_MPEG_VIDEO_VPX_PROFILE:			return "VPX Profile";
 
Quoted 7 lines
Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	/* HEVC controls */

[...]

drivers/media/v4l2-core/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 851

Quoted 1 line
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
+	case V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY:	return "HEVC LF Across Slice Boundary or Not";

Please make sure the names are no longer than 31 characters to avoid truncation during control enumeration in user space.
Data structures like struct v4l2_queryctrl, struct v4l2_query_ext_ctrl have only 32 bytes long array dedicated for the control name.

Quoted 7 lines

I will try to make the names less than 31 characters long without losing the context. But there are many control names in this file which are longer than 31 characters like V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP, V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD etc so I assumed it was alright to have such long names. But I will shorten them as per your suggestion.

Quoted 8 lines

Apologies if it wasn't clean enough but my comment referred to the length of the character string being returned (e.g. "HEVC LF Across Slice Boundary or Not") and not to the name of the enum.

--
Regards,
Sylwester

Sorry I misunderstood I will take care of it in the next version.

Thank you,
Smitha

#16 lore raw

PATCH v4 11/12 s5p-mfc: Add support for HEVC encoder

In reply to Smitha T Murthy

Add HEVC encoder support and necessary registers, V4L2 CIDs, and hevc encoder parameters

---
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  28 +-
 drivers/media/platform/s5p-mfc/s5p_mfc.c        |   1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  53 ++-
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c    | 581 ++++++++++++++++++++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h    |   8 +
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 188 ++++++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |   8 +
 8 files changed, 868 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-mfc/regs-mfc-v10.h +27 -1
index 6754477..7065b9d 100644
@@ -20,13 +20,35 @@
 #define S5P_FIMV_MFC_STATE_V10				0x7124
 #define S5P_FIMV_D_STATIC_BUFFER_ADDR_V10		0xF570
 #define S5P_FIMV_D_STATIC_BUFFER_SIZE_V10		0xF574
+#define S5P_FIMV_E_NUM_T_LAYER_V10			0xFBAC
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER0_V10		0xFBB0
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER1_V10		0xFBB4
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER2_V10		0xFBB8
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER3_V10		0xFBBC
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER4_V10		0xFBC0
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER5_V10		0xFBC4
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER6_V10		0xFBC8
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0_V10	0xFD18
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER1_V10	0xFD1C
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER2_V10	0xFD20
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER3_V10	0xFD24
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER4_V10	0xFD28
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER5_V10	0xFD2C
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER6_V10	0xFD30
+#define S5P_FIMV_E_HEVC_OPTIONS_V10			0xFDD4
+#define S5P_FIMV_E_HEVC_REFRESH_PERIOD_V10		0xFDD8
+#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET_V10		0xFDDC
+#define S5P_FIMV_E_HEVC_LF_BETA_OFFSET_DIV2_V10		0xFDE0
+#define S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V10		0xFDE4
+#define S5P_FIMV_E_HEVC_NAL_CONTROL_V10			0xFDE8
 
 /* MFCv10 Context buffer sizes */
 #define MFC_CTX_BUF_SIZE_V10		(30 * SZ_1K)
 #define MFC_H264_DEC_CTX_BUF_SIZE_V10	(2 * SZ_1M)
 #define MFC_OTHER_DEC_CTX_BUF_SIZE_V10	(20 * SZ_1K)
 #define MFC_H264_ENC_CTX_BUF_SIZE_V10	(100 * SZ_1K)
-#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10	(15 * SZ_1K)
+#define MFC_HEVC_ENC_CTX_BUF_SIZE_V10	(30 * SZ_1K)
+#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10  (15 * SZ_1K)
 
 /* MFCv10 variant defines */
 #define MAX_FW_SIZE_V10		(SZ_1M)
@@ -58,5 +80,9 @@
 #define ENC_V100_VP8_ME_SIZE(x, y) \
 	ENC_V100_BASE_SIZE(x, y)
 
+#define ENC_V100_HEVC_ME_SIZE(x, y)	\
+	(((x + 3) * (y + 3) * 32)	\
+	 + ((y * 128) + 1280) * DIV_ROUND_UP(x, 4))
+
 #endif /*_REGS_MFC_V10_H*/
 
drivers/media/platform/s5p-mfc/s5p_mfc.c +1 -0
index a0e9e0f..aa37f3c 100644
@@ -1621,6 +1621,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
 	.h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V10,
 	.other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V10,
 	.h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V10,
+	.hevc_enc_ctx   = MFC_HEVC_ENC_CTX_BUF_SIZE_V10,
 	.other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
 };
 
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c +3 -0
index 102b47e..7521fce 100644
@@ -122,6 +122,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
 	case S5P_MFC_CODEC_VP8_ENC:
 		codec_type = S5P_FIMV_CODEC_VP8_ENC_V7;
 		break;
+	case S5P_MFC_CODEC_HEVC_ENC:
+		codec_type = S5P_FIMV_CODEC_HEVC_ENC;
+		break;
 	default:
 		codec_type = S5P_FIMV_CODEC_NONE_V6;
 	}
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +52 -1

83 lines not on this page · raw message

drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +581 -0

605 lines not on this page · raw message

drivers/media/platform/s5p-mfc/s5p_mfc_opr.h +8 -0
index 57f4560..8c295f0 100644
@@ -272,6 +272,14 @@ struct s5p_mfc_regs {
 	void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */
 	void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */
 	void __iomem *e_min_scratch_buffer_size; /* v10 */
+	void __iomem *e_num_t_layer; /* v10 */
+	void __iomem *e_hier_qp_layer0; /* v10 */
+	void __iomem *e_hier_bit_rate_layer0; /* v10 */
+	void __iomem *e_hevc_options; /* v10 */
+	void __iomem *e_hevc_refresh_period; /* v10 */
+	void __iomem *e_hevc_lf_beta_offset_div2; /* v10 */
+	void __iomem *e_hevc_lf_tc_offset_div2; /* v10 */
+	void __iomem *e_hevc_nal_control; /* v10 */
 };
 
 struct s5p_mfc_hw_ops {
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +188 -0

218 lines not on this page · raw message

drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h +8 -0
index 2290f7e..8a7d053 100644
@@ -46,6 +46,14 @@
 #define ENC_MPEG4_VOP_TIME_RES_MAX	((1 << 16) - 1)
 #define FRAME_DELTA_H264_H263		1
 #define TIGHT_CBR_MAX			10
+#define ENC_HEVC_RC_FRAME_RATE_MAX	((1 << 16) - 1)
+#define ENC_HEVC_QP_INDEX_MIN		-12
+#define ENC_HEVC_QP_INDEX_MAX		12
+#define ENC_HEVC_LOOP_FILTER_MIN	-12
+#define ENC_HEVC_LOOP_FILTER_MAX	12
+#define ENC_HEVC_LEVEL_MAX		62
+
+#define FRAME_DELTA_DEFAULT		1
 
 struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void);
 const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev);
Signature · 1 line
2.7.4
#17 lore raw

PATCH v4 12/12 Documention: v4l: Documentation for HEVC CIDs

In reply to Smitha T Murthy

Added V4l2 controls for HEVC encoder

---
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
 1 file changed, 391 insertions(+)
Documentation/media/uapi/v4l/extended-controls.rst +391 -0
index abb1057..85a668d 100644
@@ -1960,6 +1960,397 @@ enum v4l2_vp8_golden_frame_sel -
     1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
 
 
+HEVC Control Reference
+---------------------
+
+The HEVC controls include controls for encoding parameters of HEVC video
+codec.
+
+
+.. _hevc-control-id:
+
+HEVC Control IDs
+^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP``
+    Minimum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP``
+    Maximum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP``
+    Quantization parameter for an I frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP``
+    Quantization parameter for a P frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP``
+    Quantization parameter for a B frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP``
+    HIERARCHICAL_QP allows host to specify the quantization parameter values
+    for each temporal layer through HIERARCHICAL_QP_LAYER. This is valid only
+    if HIERARCHICAL_CODING_LAYER is greater than 1.
+
+.. _v4l2-hevc-hierarchical-coding-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_coding_type -
+    Selects the hierarchical coding type for encoding. Possible values are:
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
+      - Use the P frame for hierarchical coding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER``
+    Selects the hierarchical coding layer. In normal encoding
+    (non-hierarchial coding), it should be zero. Possible values are 0 ~ 6.
+    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
+    LAYER 1 and so on.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP``
+    Indicates the hierarchical coding layer quantization parameter.
+    For HEVC it can have a value of 0-51. Hence in the control value passed
+    the LSB 16 bits will indicate the quantization parameter. The MSB 16 bit
+    will pass the layer(0-6) it is meant for.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_profile -
+    Select the desired profile for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
+      - Main profile.
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
+      - Main still picture profile.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+.. _v4l2-hevc-level:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_level -
+    Select the desired level for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
+      - Level 1.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
+      - Level 2.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
+      - Level 2.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
+      - Level 3.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
+      - Level 3.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
+      - Level 4.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
+      - Level 4.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
+      - Level 5.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
+      - Level 5.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
+      - Level 5.2
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
+      - Level 6.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
+      - Level 6.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
+      - Level 6.2
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION``
+    Indicates the number of evenly spaced subintervals, called ticks, within
+    one modulo time. One modulo time represents the fixed interval of one
+    second. This is a 16bit unsigned integer and has a maximum value upto
+    0xffff.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_tier_flag -
+    TIER_FLAG specifies tier information of the HEVC encoded picture. Tier were
+    made to deal with applications that differ in terms of maximum bit rate.
+    Setting the flag to 0 selects HEVC tier_flag as Main tier and setting this
+    flag to 1 indicates High tier. High tier is for very demanding applications
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
+      - Main tier.
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
+      - High tier.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH``
+    Selects HEVC maximum coding unit depth.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF``
+    Indicates loop filtering. Control ID 0 indicates loop filtering
+    is enabled and when set to 1 indicates no filter.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY``
+    Selects whether to apply the loop filter across the slice boundary or not.
+    If the value is 0, loop filter will not be applied across the slice boundary.
+    If the value is 1, loop filter will be applied across the slice boundary.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2``
+    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2``
+    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.
+
+.. _v4l2-hevc-refresh-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_refresh_type -
+    Selects refresh type for HEVC encoder.
+    Host has to specify the period into
+    HEVC_REFRESH_PERIOD.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
+      - Use CRA(Clean Random Access Unit) picture encoding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
+      - Use IDR picture encoding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD``
+    Selects the refresh period for HEVC encoder.
+    This specifies the number of I picture between two CRA/IDR pictures.
+    This is valid only if REFRESH_TYPE is not 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU``
+    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
+    encoding. Setting it to 1 enables lossless encoding.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED``
+    Indicates constant intra prediction for HEVC encoder. Specifies the
+    constrained intra prediction in which intra largest coding unit(LCU)
+    prediction is performed by using residual data and decoded samples of
+    neighboring intra LCU only. Setting it to 1 enables this control ID and
+    setting it to 0 disables the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT``
+    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
+    disables the control ID and setting it to 1 enables the wavefront parallel
+    processing.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING``
+    Setting it to 1 indicates sign data hiding for HEVC encoder. Setting it to
+    0 disables the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
+    Setting the control ID to 1 enables general picture buffers for HEVC
+    encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID``
+    Indicates temporal identifier specified as temporal_id in
+    nal_unit_header_svc_extension() for HEVC encoder which is enabled by
+    setting the control ID to 1.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING``
+    Indicates bi-linear interpolation is conditionally used in the intra
+    prediction filtering process in the CVS when set to 1. Indicates bi-linear
+    interpolation is not used in the CVS when set to 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1``
+    Indicates max number of merge candidate motion vectors.
+    Values are from zero to four.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT``
+    Indicates intra prediction unit split for HEVC Encoder. Setting it to 1
+    disables the feature. Setting it to 1 enables the feature.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION``
+    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
+    0 enables the prediction. Setting it to 1 disables the prediction.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE``
+    Specifies if HEVC generates a stream with a size of length field instead of
+    start code pattern. The size of the length field is configurable among 1,2
+    or 4 thorugh the SIZE_OF_LENGTH_FIELD. It is not applied at SEQ_START.
+    Setting it to 0 disables the control ID. Setting it to 1 will enables
+    the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CR``
+    Indicates the quantization parameter CR index.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CB``
+    Indicates the quantization parameter CB index.
+
+.. _v4l2-hevc-size-of-length-field:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
+(enum)
+
+enum v4l2_mpeg_video_hevc_size_of_length_field -
+    Indicates the size of length field.
+    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
+      - Generate start code pattern (Normal).
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
+      - Generate size of length field instead of start code pattern and length is 1.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
+      - Generate size of length field instead of start code pattern and length is 2.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
+      - Generate size of length field instead of start code pattern and length is 4.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE``
+    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE``
+    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE``
+    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE``
+    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE``
+    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE``
+    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE``
+    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
+
+
+MFC 10.10 MPEG Controls
+-----------------------
+
+The following MPEG class controls deal with MPEG decoding and encoding
+settings that are specific to the Multi Format Codec 10.10 device present
+in the S5P family of SoCs by Samsung.
+
+
+.. _mfc1010-control-id:
+
+MFC 10.10 Control IDs
+^^^^^^^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_REF_NUMBER_FOR_PFRAMES``
+    Selects number of P reference picture required for HEVC encoder.
+    P-Frame can use 1 or 2 frames for reference.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_DARK``
+    Indicates HEVC dark region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_SMOOTH``
+    Indicates HEVC smooth region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_STATIC``
+    Indicates HEVC static region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_ACTIVITY``
+    Indicates HEVC activity region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR``
+    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
+    disables it and setting it to one enables the feature.
+
+
 .. _camera-controls:
 
 Camera Control Reference
Signature · 1 line
2.7.4
#18 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

Quoted 3 lines · Smitha T Murthy

Added V4l2 controls for HEVC encoder

General comment: don't forget to build the pdf and check that as well.

Quoted 15 lines
---
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
 1 file changed, 391 insertions(+)
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
index abb1057..85a668d 100644
@@ -1960,6 +1960,397 @@ enum v4l2_vp8_golden_frame_sel -
     1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
 
 
+HEVC Control Reference
+---------------------
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1975

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+The HEVC controls include controls for encoding parameters of HEVC video
+codec.
+
+
+.. _hevc-control-id:
+
+HEVC Control IDs
+^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP``

You need to add the type of the control in parenthesis. It is probably '(integer)' for this one. Just follow what is done for other controls.

Quoted 131 lines
Documentation/media/uapi/v4l/extended-controls.rst +131 -0
+    Minimum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP``
+    Maximum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP``
+    Quantization parameter for an I frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP``
+    Quantization parameter for a P frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP``
+    Quantization parameter for a B frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP``
+    HIERARCHICAL_QP allows host to specify the quantization parameter values
+    for each temporal layer through HIERARCHICAL_QP_LAYER. This is valid only
+    if HIERARCHICAL_CODING_LAYER is greater than 1.
+
+.. _v4l2-hevc-hierarchical-coding-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_coding_type -
+    Selects the hierarchical coding type for encoding. Possible values are:
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
+      - Use the P frame for hierarchical coding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER``
+    Selects the hierarchical coding layer. In normal encoding
+    (non-hierarchial coding), it should be zero. Possible values are 0 ~ 6.
+    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
+    LAYER 1 and so on.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP``
+    Indicates the hierarchical coding layer quantization parameter.
+    For HEVC it can have a value of 0-51. Hence in the control value passed
+    the LSB 16 bits will indicate the quantization parameter. The MSB 16 bit
+    will pass the layer(0-6) it is meant for.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_profile -
+    Select the desired profile for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
+      - Main profile.
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
+      - Main still picture profile.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+.. _v4l2-hevc-level:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_level -
+    Select the desired level for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
+      - Level 1.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
+      - Level 2.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
+      - Level 2.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
+      - Level 3.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
+      - Level 3.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
+      - Level 4.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
+      - Level 4.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
+      - Level 5.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
+      - Level 5.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
+      - Level 5.2
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
+      - Level 6.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
+      - Level 6.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
+      - Level 6.2

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2116

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION``
+    Indicates the number of evenly spaced subintervals, called ticks, within
+    one modulo time. One modulo time represents the fixed interval of one
+    second. This is a 16bit unsigned integer and has a maximum value upto

s/upto/up to/

So "one modulo time" == "one second"? Perhaps just say that instead?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2125

Quoted 9 lines
Documentation/media/uapi/v4l/extended-controls.rst +9 -0
+    0xffff.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_tier_flag -
+    TIER_FLAG specifies tier information of the HEVC encoded picture. Tier were

s/Tier/Tiers/

Quoted 19 lines
Documentation/media/uapi/v4l/extended-controls.rst +19 -0
+    made to deal with applications that differ in terms of maximum bit rate.
+    Setting the flag to 0 selects HEVC tier_flag as Main tier and setting this
+    flag to 1 indicates High tier. High tier is for very demanding applications
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
+      - Main tier.
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
+      - High tier.
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2154

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH``
+    Selects HEVC maximum coding unit depth.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF``
+    Indicates loop filtering. Control ID 0 indicates loop filtering

s/ID/value/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2164

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+    is enabled and when set to 1 indicates no filter.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY``
+    Selects whether to apply the loop filter across the slice boundary or not.
+    If the value is 0, loop filter will not be applied across the slice boundary.
+    If the value is 1, loop filter will be applied across the slice boundary.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2``
+    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.

I'd drop this last line. The range you specify already indicates that it can be negative.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2168

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2``
+    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.

Ditto.

Quoted 15 lines
Documentation/media/uapi/v4l/extended-controls.rst +15 -0
+
+.. _v4l2-hevc-refresh-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_refresh_type -
+    Selects refresh type for HEVC encoder.
+    Host has to specify the period into
+    HEVC_REFRESH_PERIOD.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2193

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
+      - Use CRA(Clean Random Access Unit) picture encoding.

Add space after CRA.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2204

Quoted 11 lines
Documentation/media/uapi/v4l/extended-controls.rst +11 -0
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
+      - Use IDR picture encoding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD``
+    Selects the refresh period for HEVC encoder.
+    This specifies the number of I picture between two CRA/IDR pictures.

s/I picture/I pictures/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2213

Quoted 9 lines
Documentation/media/uapi/v4l/extended-controls.rst +9 -0
+    This is valid only if REFRESH_TYPE is not 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU``
+    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
+    encoding. Setting it to 1 enables lossless encoding.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED``
+    Indicates constant intra prediction for HEVC encoder. Specifies the
+    constrained intra prediction in which intra largest coding unit(LCU)

Space before (LCU)

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2216

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+    prediction is performed by using residual data and decoded samples of
+    neighboring intra LCU only. Setting it to 1 enables this control ID and
+    setting it to 0 disables the control ID.

s/control ID/feature/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2221

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT``
+    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
+    disables the control ID and setting it to 1 enables the wavefront parallel
+    processing.

Ditto. Please check this document for more mis-use of the term "control ID", I won't comment on this anymore.

Quoted 126 lines
Documentation/media/uapi/v4l/extended-controls.rst +125 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING``
+    Setting it to 1 indicates sign data hiding for HEVC encoder. Setting it to
+    0 disables the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
+    Setting the control ID to 1 enables general picture buffers for HEVC
+    encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID``
+    Indicates temporal identifier specified as temporal_id in
+    nal_unit_header_svc_extension() for HEVC encoder which is enabled by
+    setting the control ID to 1.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING``
+    Indicates bi-linear interpolation is conditionally used in the intra
+    prediction filtering process in the CVS when set to 1. Indicates bi-linear
+    interpolation is not used in the CVS when set to 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1``
+    Indicates max number of merge candidate motion vectors.
+    Values are from zero to four.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT``
+    Indicates intra prediction unit split for HEVC Encoder. Setting it to 1
+    disables the feature. Setting it to 1 enables the feature.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION``
+    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
+    0 enables the prediction. Setting it to 1 disables the prediction.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE``
+    Specifies if HEVC generates a stream with a size of length field instead of
+    start code pattern. The size of the length field is configurable among 1,2
+    or 4 thorugh the SIZE_OF_LENGTH_FIELD. It is not applied at SEQ_START.
+    Setting it to 0 disables the control ID. Setting it to 1 will enables
+    the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CR``
+    Indicates the quantization parameter CR index.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CB``
+    Indicates the quantization parameter CB index.
+
+.. _v4l2-hevc-size-of-length-field:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
+(enum)
+
+enum v4l2_mpeg_video_hevc_size_of_length_field -
+    Indicates the size of length field.
+    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
+      - Generate start code pattern (Normal).
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
+      - Generate size of length field instead of start code pattern and length is 1.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
+      - Generate size of length field instead of start code pattern and length is 2.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
+      - Generate size of length field instead of start code pattern and length is 4.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE``
+    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE``
+    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE``
+    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE``
+    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE``
+    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE``
+    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE``
+    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
+
+
+MFC 10.10 MPEG Controls
+-----------------------
+
+The following MPEG class controls deal with MPEG decoding and encoding
+settings that are specific to the Multi Format Codec 10.10 device present
+in the S5P family of SoCs by Samsung.
+
+
+.. _mfc1010-control-id:
+
+MFC 10.10 Control IDs
+^^^^^^^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_REF_NUMBER_FOR_PFRAMES``
+    Selects number of P reference picture required for HEVC encoder.
+    P-Frame can use 1 or 2 frames for reference.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_DARK``
+    Indicates HEVC dark region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_SMOOTH``
+    Indicates HEVC smooth region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_STATIC``
+    Indicates HEVC static region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_ACTIVITY``

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2356

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +7 -0
+    Indicates HEVC activity region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR``
+    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
+    disables it and setting it to one enables the feature.
+
+
 .. _camera-controls:
 
 Camera Control Reference

Regards,

Hans

#19 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

Quoted 7 lines · Hans Verkuil
Quoted 3 lines · Smitha T Murthy

Added V4l2 controls for HEVC encoder

General comment: don't forget to build the pdf and check that as well.

Yes I will build it and check before pushing the next version.

Quoted 12 lines
Quoted 12 lines
---
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
 1 file changed, 391 insertions(+)
Documentation/media/uapi/v4l/extended-controls.rst +0 -0
index abb1057..85a668d 100644
@@ -1960,6 +1960,397 @@ enum v4l2_vp8_golden_frame_sel -
     1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
 
 
Quoted 17 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1975

Quoted 13 lines
Documentation/media/uapi/v4l/extended-controls.rst +13 -0
+HEVC Control Reference
+---------------------
+
+The HEVC controls include controls for encoding parameters of HEVC video
+codec.
+
+
+.. _hevc-control-id:
+
+HEVC Control IDs
+^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP``

You need to add the type of the control in parenthesis. It is probably '(integer)' for this one. Just follow what is done for other controls.

I had missed it. I will add them in next version.

Quoted 144 lines
Quoted 131 lines
Documentation/media/uapi/v4l/extended-controls.rst +131 -0
+    Minimum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP``
+    Maximum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP``
+    Quantization parameter for an I frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP``
+    Quantization parameter for a P frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP``
+    Quantization parameter for a B frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP``
+    HIERARCHICAL_QP allows host to specify the quantization parameter values
+    for each temporal layer through HIERARCHICAL_QP_LAYER. This is valid only
+    if HIERARCHICAL_CODING_LAYER is greater than 1.
+
+.. _v4l2-hevc-hierarchical-coding-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_coding_type -
+    Selects the hierarchical coding type for encoding. Possible values are:
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
+      - Use the P frame for hierarchical coding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER``
+    Selects the hierarchical coding layer. In normal encoding
+    (non-hierarchial coding), it should be zero. Possible values are 0 ~ 6.
+    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
+    LAYER 1 and so on.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP``
+    Indicates the hierarchical coding layer quantization parameter.
+    For HEVC it can have a value of 0-51. Hence in the control value passed
+    the LSB 16 bits will indicate the quantization parameter. The MSB 16 bit
+    will pass the layer(0-6) it is meant for.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_profile -
+    Select the desired profile for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
+      - Main profile.
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
+      - Main still picture profile.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+.. _v4l2-hevc-level:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_level -
+    Select the desired level for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
+      - Level 1.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
+      - Level 2.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
+      - Level 2.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
+      - Level 3.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
+      - Level 3.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
+      - Level 4.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
+      - Level 4.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
+      - Level 5.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
+      - Level 5.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
+      - Level 5.2
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
+      - Level 6.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
+      - Level 6.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
+      - Level 6.2

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2116

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION``
+    Indicates the number of evenly spaced subintervals, called ticks, within
+    one modulo time. One modulo time represents the fixed interval of one
+    second. This is a 16bit unsigned integer and has a maximum value upto

s/upto/up to/

Quoted 2 lines

So "one modulo time" == "one second"? Perhaps just say that instead?

I will change it to one second.

Quoted 12 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2125

Quoted 9 lines
Documentation/media/uapi/v4l/extended-controls.rst +9 -0
+    0xffff.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_tier_flag -
+    TIER_FLAG specifies tier information of the HEVC encoded picture. Tier were

s/Tier/Tiers/

I will correct it.

Quoted 23 lines
Quoted 23 lines
Documentation/media/uapi/v4l/extended-controls.rst +23 -0
+    made to deal with applications that differ in terms of maximum bit rate.
+    Setting the flag to 0 selects HEVC tier_flag as Main tier and setting this
+    flag to 1 indicates High tier. High tier is for very demanding applications
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
+      - Main tier.
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
+      - High tier.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2154

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH``
+    Selects HEVC maximum coding unit depth.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF``
+    Indicates loop filtering. Control ID 0 indicates loop filtering

s/ID/value/

I will correct it.

Quoted 5 lines
Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+    is enabled and when set to 1 indicates no filter.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY``
+    Selects whether to apply the loop filter across the slice boundary or not.
+    If the value is 0, loop filter will not be applied across the slice boundary.
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2164

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+    If the value is 1, loop filter will be applied across the slice boundary.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2``
+    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.

I'd drop this last line. The range you specify already indicates that it can be negative.

I will remove this.

Quoted 7 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2168

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2``
+    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
+    This could be a negative value in the 2's complement expression.

Ditto.

I will remove this.

Quoted 19 lines
Quoted 19 lines
Documentation/media/uapi/v4l/extended-controls.rst +19 -0
+
+.. _v4l2-hevc-refresh-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_refresh_type -
+    Selects refresh type for HEVC encoder.
+    Host has to specify the period into
+    HEVC_REFRESH_PERIOD.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2193

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
+      - Use CRA(Clean Random Access Unit) picture encoding.

Add space after CRA.

I will add it.

Quoted 5 lines
Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
+      - Use IDR picture encoding.
+
+.. raw:: latex
+
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2204

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD``
+    Selects the refresh period for HEVC encoder.
+    This specifies the number of I picture between two CRA/IDR pictures.

s/I picture/I pictures/

I will correct this.

Quoted 12 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2213

Quoted 9 lines
Documentation/media/uapi/v4l/extended-controls.rst +9 -0
+    This is valid only if REFRESH_TYPE is not 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU``
+    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
+    encoding. Setting it to 1 enables lossless encoding.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED``
+    Indicates constant intra prediction for HEVC encoder. Specifies the
+    constrained intra prediction in which intra largest coding unit(LCU)

Space before (LCU)

I will add this.

Quoted 6 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2216

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+    prediction is performed by using residual data and decoded samples of
+    neighboring intra LCU only. Setting it to 1 enables this control ID and
+    setting it to 0 disables the control ID.

s/control ID/feature/

I will change all the control IDs to feature.

Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2221

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT``
+    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
+    disables the control ID and setting it to 1 enables the wavefront parallel
+    processing.

Ditto. Please check this document for more mis-use of the term "control ID", I won't comment on this anymore.

Yes I will correct it in rest of the file.

Quoted 134 lines
Quoted 134 lines
Documentation/media/uapi/v4l/extended-controls.rst +132 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING``
+    Setting it to 1 indicates sign data hiding for HEVC encoder. Setting it to
+    0 disables the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
+    Setting the control ID to 1 enables general picture buffers for HEVC
+    encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID``
+    Indicates temporal identifier specified as temporal_id in
+    nal_unit_header_svc_extension() for HEVC encoder which is enabled by
+    setting the control ID to 1.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING``
+    Indicates bi-linear interpolation is conditionally used in the intra
+    prediction filtering process in the CVS when set to 1. Indicates bi-linear
+    interpolation is not used in the CVS when set to 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1``
+    Indicates max number of merge candidate motion vectors.
+    Values are from zero to four.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT``
+    Indicates intra prediction unit split for HEVC Encoder. Setting it to 1
+    disables the feature. Setting it to 1 enables the feature.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION``
+    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
+    0 enables the prediction. Setting it to 1 disables the prediction.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE``
+    Specifies if HEVC generates a stream with a size of length field instead of
+    start code pattern. The size of the length field is configurable among 1,2
+    or 4 thorugh the SIZE_OF_LENGTH_FIELD. It is not applied at SEQ_START.
+    Setting it to 0 disables the control ID. Setting it to 1 will enables
+    the control ID.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CR``
+    Indicates the quantization parameter CR index.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CB``
+    Indicates the quantization parameter CB index.
+
+.. _v4l2-hevc-size-of-length-field:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
+(enum)
+
+enum v4l2_mpeg_video_hevc_size_of_length_field -
+    Indicates the size of length field.
+    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
+      - Generate start code pattern (Normal).
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
+      - Generate size of length field instead of start code pattern and length is 1.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
+      - Generate size of length field instead of start code pattern and length is 2.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
+      - Generate size of length field instead of start code pattern and length is 4.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE``
+    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE``
+    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE``
+    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE``
+    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE``
+    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE``
+    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE``
+    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
+
+
+MFC 10.10 MPEG Controls
+-----------------------
+
+The following MPEG class controls deal with MPEG decoding and encoding
+settings that are specific to the Multi Format Codec 10.10 device present
+in the S5P family of SoCs by Samsung.
+
+
+.. _mfc1010-control-id:
+
+MFC 10.10 Control IDs
+^^^^^^^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_REF_NUMBER_FOR_PFRAMES``
+    Selects number of P reference picture required for HEVC encoder.
+    P-Frame can use 1 or 2 frames for reference.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_DARK``
+    Indicates HEVC dark region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_SMOOTH``
+    Indicates HEVC smooth region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_STATIC``
+    Indicates HEVC static region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_ACTIVITY``
+    Indicates HEVC activity region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR``
+    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
+    disables it and setting it to one enables the feature.
+
+
 .. _camera-controls:
 
Quoted 7 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2356

Quoted 2 lines
Documentation/media/uapi/v4l/extended-controls.rst +0 -0
 Camera Control Reference

Regards,

Hans

Thank you for the review.

Regards,
Smitha

#20 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

In reply to Smitha T Murthy
Quoted 1 line · Smitha T Murthy

Added V4l2 controls for HEVC encoder

s/HEVC/H.265/HEVC ?

Quoted 10 lines
---
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
 1 file changed, 391 insertions(+)
Documentation/media/uapi/v4l/extended-controls.rst +0 -0
index abb1057..85a668d 100644

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1963

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
@@ -1960,6 +1960,397 @@ enum v4l2_vp8_golden_frame_sel -
     1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
 
 
+HEVC Control Reference

Perhaps "High Efficiency Video Coding (HEVC/H.265) Control Reference" ?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1967

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+---------------------
+
+The HEVC controls include controls for encoding parameters of HEVC video
+codec.

s/'HEVC'/'HEVC/H.265' ?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1972

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+
+
+.. _hevc-control-id:
+
+HEVC Control IDs

s/'HEVC'/'HEVC/H.265' ?

Quoted 134 lines
Documentation/media/uapi/v4l/extended-controls.rst +134 -0
+^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP``
+    Minimum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP``
+    Maximum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP``
+    Quantization parameter for an I frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP``
+    Quantization parameter for a P frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP``
+    Quantization parameter for a B frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP``
+    HIERARCHICAL_QP allows host to specify the quantization parameter values
+    for each temporal layer through HIERARCHICAL_QP_LAYER. This is valid only
+    if HIERARCHICAL_CODING_LAYER is greater than 1.
+
+.. _v4l2-hevc-hierarchical-coding-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_coding_type -
+    Selects the hierarchical coding type for encoding. Possible values are:
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
+      - Use the P frame for hierarchical coding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER``
+    Selects the hierarchical coding layer. In normal encoding
+    (non-hierarchial coding), it should be zero. Possible values are 0 ~ 6.
+    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
+    LAYER 1 and so on.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP``
+    Indicates the hierarchical coding layer quantization parameter.
+    For HEVC it can have a value of 0-51. Hence in the control value passed
+    the LSB 16 bits will indicate the quantization parameter. The MSB 16 bit
+    will pass the layer(0-6) it is meant for.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_profile -
+    Select the desired profile for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
+      - Main profile.
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
+      - Main still picture profile.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+.. _v4l2-hevc-level:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_level -
+    Select the desired level for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
+      - Level 1.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
+      - Level 2.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
+      - Level 2.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
+      - Level 3.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
+      - Level 3.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
+      - Level 4.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
+      - Level 4.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
+      - Level 5.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
+      - Level 5.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
+      - Level 5.2
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
+      - Level 6.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
+      - Level 6.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
+      - Level 6.2

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2116

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION``
+    Indicates the number of evenly spaced subintervals, called ticks, within
+    one modulo time. One modulo time represents the fixed interval of one
+    second. This is a 16bit unsigned integer and has a maximum value upto

s/upto/up to/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2128

Quoted 12 lines
Documentation/media/uapi/v4l/extended-controls.rst +12 -0
+    0xffff.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_tier_flag -
+    TIER_FLAG specifies tier information of the HEVC encoded picture. Tier were
+    made to deal with applications that differ in terms of maximum bit rate.
+    Setting the flag to 0 selects HEVC tier_flag as Main tier and setting this
+    flag to 1 indicates High tier. High tier is for very demanding applications

Demanding in terms of bit rate, i.e. requiring high bit rate? It's a bit unclear here.

Quoted 16 lines
Documentation/media/uapi/v4l/extended-controls.rst +16 -0
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
+      - Main tier.
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
+      - High tier.
+
+.. raw:: latex

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2155

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH``
+    Selects HEVC maximum coding unit depth.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF``
+    Indicates loop filtering. Control ID 0 indicates loop filtering
+    is enabled and when set to 1 indicates no filter.

"Setting this control to 0 enables loop filtering, setting this control to 1 disables loop filtering." ?

Couldn't the meaning be inverted, so setting the control to 0 disables the loop filtering?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2164

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +9 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY``
+    Selects whether to apply the loop filter across the slice boundary or not.
+    If the value is 0, loop filter will not be applied across the slice boundary.
+    If the value is 1, loop filter will be applied across the slice boundary.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2``
+    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
 
+    This could be a negative value in the 2's complement expression.

I don't think second sentence is needed.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2168

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2``
+    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
 
+    This could be a negative value in the 2's complement expression.

Ditto.

Quoted 37 lines
Documentation/media/uapi/v4l/extended-controls.rst +37 -0
+.. _v4l2-hevc-refresh-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_refresh_type -
+    Selects refresh type for HEVC encoder.
+    Host has to specify the period into
+    HEVC_REFRESH_PERIOD.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
+      - Use CRA(Clean Random Access Unit) picture encoding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
+      - Use IDR picture encoding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD``
+    Selects the refresh period for HEVC encoder.
+    This specifies the number of I picture between two CRA/IDR pictures.
+    This is valid only if REFRESH_TYPE is not 0.
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2216

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU``
+    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
+    encoding. Setting it to 1 enables lossless encoding.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED``
+    Indicates constant intra prediction for HEVC encoder. Specifies the
+    constrained intra prediction in which intra largest coding unit(LCU)
+    prediction is performed by using residual data and decoded samples of
+    neighboring intra LCU only. Setting it to 1 enables this control ID and
+    setting it to 0 disables the control ID.

Could you avoid "disables the control ID", "enables control ID" phrases? And instead describe indirectly what behaviour corresponds to each value of the control? So the last sentence becomes something like:

"Setting the control to 0 disables ..., setting the control to 1 enables..."

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2221

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT``
+    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
+    disables the control ID and setting it to 1 enables the wavefront parallel
+    processing.

Ditto.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2225

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING``
+    Setting it to 1 indicates sign data hiding for HEVC encoder. Setting it to
+    0 disables the control ID.

Ditto.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2228

Quoted 2 lines
Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
+    Setting the control ID to 1 enables general picture buffers for HEVC

s/control ID/control/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2233

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+    encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID``
+    Indicates temporal identifier specified as temporal_id in
+    nal_unit_header_svc_extension() for HEVC encoder which is enabled by

What is nal_unit_header_svc_extension(), where it comes from?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2234

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+    setting the control ID to 1.

s/control ID/control/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2242

Quoted 7 lines
Documentation/media/uapi/v4l/extended-controls.rst +7 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING``
+    Indicates bi-linear interpolation is conditionally used in the intra
+    prediction filtering process in the CVS when set to 1. Indicates bi-linear
+    interpolation is not used in the CVS when set to 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1``
+    Indicates max number of merge candidate motion vectors.

s/max/maximum/ ?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2255

Quoted 13 lines
Documentation/media/uapi/v4l/extended-controls.rst +13 -0
+    Values are from zero to four.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT``
+    Indicates intra prediction unit split for HEVC Encoder. Setting it to 1
+    disables the feature. Setting it to 1 enables the feature.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION``
+    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
+    0 enables the prediction. Setting it to 1 disables the prediction.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE``
+    Specifies if HEVC generates a stream with a size of length field instead of
+    start code pattern. The size of the length field is configurable among 1,2

s/the length/length/

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2256

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+    or 4 thorugh the SIZE_OF_LENGTH_FIELD. It is not applied at SEQ_START.

s/thorugh/through/ s/SIZE_OF_LENGTH_FIELD/V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control. I would also drop "among 1,2 or 4" as this information belongs to the V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control's description.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2258

Quoted 2 lines
Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+    Setting it to 0 disables the control ID. Setting it to 1 will enables
+    the control ID.

Again, please specify explicitly what behaviour corresponds to each value of the control.

Quoted 56 lines
Documentation/media/uapi/v4l/extended-controls.rst +56 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CR``
+    Indicates the quantization parameter CR index.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CB``
+    Indicates the quantization parameter CB index.
+
+.. _v4l2-hevc-size-of-length-field:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
+(enum)
+
+enum v4l2_mpeg_video_hevc_size_of_length_field -
+    Indicates the size of length field.
+    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
+      - Generate start code pattern (Normal).
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
+      - Generate size of length field instead of start code pattern and length is 1.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
+      - Generate size of length field instead of start code pattern and length is 2.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
+      - Generate size of length field instead of start code pattern and length is 4.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE``
+    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE``
+    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE``
+    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE``
+    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE``
+    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE``
+    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2325

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE``
+    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
+
+
+MFC 10.10 MPEG Controls
+-----------------------
+
+The following MPEG class controls deal with MPEG decoding and encoding
+settings that are specific to the Multi Format Codec 10.10 device present
+in the S5P family of SoCs by Samsung.

"S5P and Exynos" ?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2334

Quoted 8 lines
Documentation/media/uapi/v4l/extended-controls.rst +8 -0
+
+.. _mfc1010-control-id:
+
+MFC 10.10 Control IDs
+^^^^^^^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_REF_NUMBER_FOR_PFRAMES``
+    Selects number of P reference picture required for HEVC encoder.

s/picture/pictures
or s/picture/frames ?

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2347

Quoted 13 lines
Documentation/media/uapi/v4l/extended-controls.rst +13 -0
+    P-Frame can use 1 or 2 frames for reference.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_DARK``
+    Indicates HEVC dark region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_SMOOTH``
+    Indicates HEVC smooth region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_STATIC``
+    Indicates HEVC static region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_ACTIVITY``
+    Indicates HEVC activity region adaptive rate control.

For the above controls it is not clear if these are boolean controls and which value corresponds to what behaviour.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2351

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR``
+    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
+    disables it and setting it to one enables the feature.

"Setting the control to 0 disables generating SPS, PPS at every IDR,
setting the control to 1 enables generating SPS, PPS at every IDR."

How about using MFC10 instead of MFC1010 for the controls IDs?

Signature · 2 lines
Regards,
Sylwester
#21 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

Quoted 5 lines · Sylwester Nawrocki
Quoted 1 line · Smitha T Murthy

Added V4l2 controls for HEVC encoder

s/HEVC/H.265/HEVC ?

Ok I will change it.

Quoted 13 lines
Quoted 13 lines
---
 Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
 1 file changed, 391 insertions(+)
Documentation/media/uapi/v4l/extended-controls.rst +0 -0
index abb1057..85a668d 100644
@@ -1960,6 +1960,397 @@ enum v4l2_vp8_golden_frame_sel -
     1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
 
 
Quoted 4 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1963

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+HEVC Control Reference

Perhaps "High Efficiency Video Coding (HEVC/H.265) Control Reference" ?

I will change it.

Quoted 7 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1967

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+---------------------
+
+The HEVC controls include controls for encoding parameters of HEVC video
+codec.

s/'HEVC'/'HEVC/H.265' ?

Ok I will change it.

Quoted 8 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 1972

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+
+
+.. _hevc-control-id:
+
+HEVC Control IDs

s/'HEVC'/'HEVC/H.265' ?

I will change it.

Quoted 138 lines
Quoted 138 lines
Documentation/media/uapi/v4l/extended-controls.rst +138 -0
+^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP``
+    Minimum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP``
+    Maximum quantization parameter for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP``
+    Quantization parameter for an I frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP``
+    Quantization parameter for a P frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP``
+    Quantization parameter for a B frame for HEVC.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_QP``
+    HIERARCHICAL_QP allows host to specify the quantization parameter values
+    for each temporal layer through HIERARCHICAL_QP_LAYER. This is valid only
+    if HIERARCHICAL_CODING_LAYER is greater than 1.
+
+.. _v4l2-hevc-hierarchical-coding-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_coding_type -
+    Selects the hierarchical coding type for encoding. Possible values are:
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
+      - Use the P frame for hierarchical coding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER``
+    Selects the hierarchical coding layer. In normal encoding
+    (non-hierarchial coding), it should be zero. Possible values are 0 ~ 6.
+    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
+    LAYER 1 and so on.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_QP``
+    Indicates the hierarchical coding layer quantization parameter.
+    For HEVC it can have a value of 0-51. Hence in the control value passed
+    the LSB 16 bits will indicate the quantization parameter. The MSB 16 bit
+    will pass the layer(0-6) it is meant for.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_profile -
+    Select the desired profile for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
+      - Main profile.
+    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
+      - Main still picture profile.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+.. _v4l2-hevc-level:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_level -
+    Select the desired level for HEVC encoder.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
+      - Level 1.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
+      - Level 2.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
+      - Level 2.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
+      - Level 3.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
+      - Level 3.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
+      - Level 4.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
+      - Level 4.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
+      - Level 5.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
+      - Level 5.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
+      - Level 5.2
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
+      - Level 6.0
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
+      - Level 6.1
+    * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
+      - Level 6.2
+
+.. raw:: latex
+
+    \end{adjustbox}
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2116

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION``
+    Indicates the number of evenly spaced subintervals, called ticks, within
+    one modulo time. One modulo time represents the fixed interval of one
+    second. This is a 16bit unsigned integer and has a maximum value upto

s/upto/up to/

I will change it.

Quoted 7 lines
Quoted 7 lines
Documentation/media/uapi/v4l/extended-controls.rst +7 -0
+    0xffff.
+
+.. _v4l2-hevc-profile:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TIER_FLAG``
+    (enum)
+
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2128

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+enum v4l2_mpeg_video_hevc_tier_flag -
+    TIER_FLAG specifies tier information of the HEVC encoded picture. Tier were
+    made to deal with applications that differ in terms of maximum bit rate.
+    Setting the flag to 0 selects HEVC tier_flag as Main tier and setting this
+    flag to 1 indicates High tier. High tier is for very demanding applications

Demanding in terms of bit rate, i.e. requiring high bit rate? It's a bit unclear here.

Yes correct demanding in terms of requiring high bit rate. I will make it more clear.

Quoted 30 lines
Quoted 16 lines
Documentation/media/uapi/v4l/extended-controls.rst +16 -0
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
+      - Main tier.
+    * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
+      - High tier.
+
+.. raw:: latex

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2155

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH``
+    Selects HEVC maximum coding unit depth.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF``
+    Indicates loop filtering. Control ID 0 indicates loop filtering
+    is enabled and when set to 1 indicates no filter.

"Setting this control to 0 enables loop filtering, setting this control to 1 disables loop filtering." ?

Quoted 4 lines

Couldn't the meaning be inverted, so setting the control to 0 disables the loop filtering?

From register point of view, this control value needs be 0 to enable

loop filtering.

Quoted 9 lines
Quoted 8 lines
Documentation/media/uapi/v4l/extended-controls.rst +8 -0
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_SLICE_BOUNDARY``
+    Selects whether to apply the loop filter across the slice boundary or not.
+    If the value is 0, loop filter will not be applied across the slice boundary.
+    If the value is 1, loop filter will be applied across the slice boundary.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2``
+    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
Quoted 4 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2163

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+    This could be a negative value in the 2's complement expression.

I don't think second sentence is needed.

I will remove it.

Quoted 7 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2168

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2``
+    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
 
+    This could be a negative value in the 2's complement expression.

Ditto.

I will remove it.

Quoted 52 lines
Quoted 37 lines
Documentation/media/uapi/v4l/extended-controls.rst +37 -0
+.. _v4l2-hevc-refresh-type:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
+    (enum)
+
+enum v4l2_mpeg_video_hevc_hier_refresh_type -
+    Selects refresh type for HEVC encoder.
+    Host has to specify the period into
+    HEVC_REFRESH_PERIOD.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
+      - Use the B frame for hierarchical coding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
+      - Use CRA(Clean Random Access Unit) picture encoding.
+    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
+      - Use IDR picture encoding.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+
+``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD``
+    Selects the refresh period for HEVC encoder.
+    This specifies the number of I picture between two CRA/IDR pictures.
+    This is valid only if REFRESH_TYPE is not 0.
+

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2216

Quoted 10 lines
Documentation/media/uapi/v4l/extended-controls.rst +10 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU``
+    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
+    encoding. Setting it to 1 enables lossless encoding.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED``
+    Indicates constant intra prediction for HEVC encoder. Specifies the
+    constrained intra prediction in which intra largest coding unit(LCU)
+    prediction is performed by using residual data and decoded samples of
+    neighboring intra LCU only. Setting it to 1 enables this control ID and
+    setting it to 0 disables the control ID.

Could you avoid "disables the control ID", "enables control ID" phrases? And instead describe indirectly what behaviour corresponds to each value of the control? So the last sentence becomes something like:

Quoted 2 lines

"Setting the control to 0 disables ..., setting the control to 1 enables..."

Yes I will add sentences describing the behaviour for all the controls.

Quoted 11 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2221

Quoted 4 lines
Documentation/media/uapi/v4l/extended-controls.rst +4 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT``
+    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
+    disables the control ID and setting it to 1 enables the wavefront parallel
+    processing.

Ditto.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2225

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_SIGN_DATA_HIDING``
+    Setting it to 1 indicates sign data hiding for HEVC encoder. Setting it to
+    0 disables the control ID.
Quoted 7 lines

Ditto.

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2228

Quoted 2 lines
Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
+    Setting the control ID to 1 enables general picture buffers for HEVC

s/control ID/control/

I will change it.

Quoted 8 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2233

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+    encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID``
+    Indicates temporal identifier specified as temporal_id in
+    nal_unit_header_svc_extension() for HEVC encoder which is enabled by

What is nal_unit_header_svc_extension(), where it comes from?

Sorry I had to add nal_unit_header() instead of nal_unit_header_svc_extension() as specified in the H.265 codec specification document.

Quoted 4 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2234

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+    setting the control ID to 1.

s/control ID/control/

I will change it.

Quoted 10 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2242

Quoted 7 lines
Documentation/media/uapi/v4l/extended-controls.rst +7 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING``
+    Indicates bi-linear interpolation is conditionally used in the intra
+    prediction filtering process in the CVS when set to 1. Indicates bi-linear
+    interpolation is not used in the CVS when set to 0.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1``
+    Indicates max number of merge candidate motion vectors.

s/max/maximum/ ?

I will change it.

Quoted 7 lines
Quoted 7 lines
Documentation/media/uapi/v4l/extended-controls.rst +7 -0
+    Values are from zero to four.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT``
+    Indicates intra prediction unit split for HEVC Encoder. Setting it to 1
+    disables the feature. Setting it to 1 enables the feature.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION``
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2255

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
+    0 enables the prediction. Setting it to 1 disables the prediction.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE``
+    Specifies if HEVC generates a stream with a size of length field instead of
+    start code pattern. The size of the length field is configurable among 1,2

s/the length/length/

I will correct it.

Quoted 7 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2256

Quoted 1 line
Documentation/media/uapi/v4l/extended-controls.rst +1 -0
+    or 4 thorugh the SIZE_OF_LENGTH_FIELD. It is not applied at SEQ_START.

s/thorugh/through/ s/SIZE_OF_LENGTH_FIELD/V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control. I would also drop "among 1,2 or 4" as this information belongs to the V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control's description.

Ok I will correct it.

Quoted 6 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2258

Quoted 2 lines
Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+    Setting it to 0 disables the control ID. Setting it to 1 will enables
+    the control ID.

Again, please specify explicitly what behaviour corresponds to each value of the control.

Ok I will add behaviour to describe the values.

Quoted 60 lines
Quoted 60 lines
Documentation/media/uapi/v4l/extended-controls.rst +60 -0
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CR``
+    Indicates the quantization parameter CR index.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_QP_INDEX_CB``
+    Indicates the quantization parameter CB index.
+
+.. _v4l2-hevc-size-of-length-field:
+
+``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
+(enum)
+
+enum v4l2_mpeg_video_hevc_size_of_length_field -
+    Indicates the size of length field.
+    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
+
+.. raw:: latex
+
+    \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
+
+.. flat-table::
+       :header-rows:  0
+    :stub-columns: 0
+
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
+      - Generate start code pattern (Normal).
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
+      - Generate size of length field instead of start code pattern and length is 1.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
+      - Generate size of length field instead of start code pattern and length is 2.
+    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
+      - Generate size of length field instead of start code pattern and length is 4.
+
+.. raw:: latex
+
+    \end{adjustbox}
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER0_BITRATE``
+    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER1_BITRATE``
+    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER2_BITRATE``
+    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER3_BITRATE``
+    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER4_BITRATE``
+    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER5_BITRATE``
+    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
+
+``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER6_BITRATE``
+    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
+
+
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2325

Quoted 6 lines
Documentation/media/uapi/v4l/extended-controls.rst +6 -0
+MFC 10.10 MPEG Controls
+-----------------------
+
+The following MPEG class controls deal with MPEG decoding and encoding
+settings that are specific to the Multi Format Codec 10.10 device present
+in the S5P family of SoCs by Samsung.

"S5P and Exynos" ?

Ok I will add Exynos too.

Quoted 12 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2334

Quoted 8 lines
Documentation/media/uapi/v4l/extended-controls.rst +8 -0
+
+.. _mfc1010-control-id:
+
+MFC 10.10 Control IDs
+^^^^^^^^^^^^^^^^^^^^^
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_REF_NUMBER_FOR_PFRAMES``
+    Selects number of P reference picture required for HEVC encoder.

s/picture/pictures
or s/picture/frames ?

I will change it.

Quoted 8 lines
Quoted 8 lines
Documentation/media/uapi/v4l/extended-controls.rst +8 -0
+    P-Frame can use 1 or 2 frames for reference.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_DARK``
+    Indicates HEVC dark region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_SMOOTH``
+    Indicates HEVC smooth region adaptive rate control.
+
Quoted 9 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2347

Quoted 5 lines
Documentation/media/uapi/v4l/extended-controls.rst +5 -0
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_STATIC``
+    Indicates HEVC static region adaptive rate control.
+
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_ADAPTIVE_RC_ACTIVITY``
+    Indicates HEVC activity region adaptive rate control.

For the above controls it is not clear if these are boolean controls and which value corresponds to what behaviour.

I will add the value and corresponding behaviour.

Quoted 8 lines

Documentation/media/uapi/v4l/extended-controls.rst enum v4l2_vp8_golden_frame_sel - · line 2351

Quoted 3 lines
Documentation/media/uapi/v4l/extended-controls.rst +3 -0
+``V4L2_CID_MPEG_MFC1010_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR``
+    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
+    disables it and setting it to one enables the feature.

"Setting the control to 0 disables generating SPS, PPS at every IDR,
setting the control to 1 enables generating SPS, PPS at every IDR."

Ok I will change the controls description as above.

Quoted 2 lines

How about using MFC10 instead of MFC1010 for the controls IDs?

There are various version of MFC10 like MFCv10.0, MFC v10.10, MFCv10.11, MFCv10.20. I will check if these controls are specific to MFCv10.10, if not I will change it to MFC10.

Thank you for the review.

Regards,
Smitha

#22 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

Quoted 4 lines · Smitha T Murthy
Quoted 4 lines
Quoted 3 lines

+``V4L2_CID_MPEG_VIDEO_HEVC_LF``

Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+    Indicates loop filtering. Control ID 0 indicates loop filtering
+    is enabled and when set to 1 indicates no filter.
Quoted 8 lines
Quoted 7 lines

"Setting this control to 0 enables loop filtering, setting this control to 1 disables loop filtering." ?

Couldn't the meaning be inverted, so setting the control to 0 disables the loop filtering?

From register point of view, this control value needs be 0 to enable

loop filtering.

OK, this is true for our specific hardware/firmware implementation.

In general, for this user space interface I would rather define that boolean control so value 1 enables LF and value 0 disables LF. The driver could simply negate the value when writing registers.

BTW we might need to specify type of the control here as Hans suggested commenting on other control.

--
Regards,
Sylwester

#23 lore raw

Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs

Quoted 20 lines · Sylwester Nawrocki
Quoted 4 lines · Smitha T Murthy
Quoted 4 lines
Quoted 3 lines

+``V4L2_CID_MPEG_VIDEO_HEVC_LF``

Documentation/media/uapi/v4l/extended-controls.rst +2 -0
+    Indicates loop filtering. Control ID 0 indicates loop filtering
+    is enabled and when set to 1 indicates no filter.
Quoted 8 lines
Quoted 7 lines

"Setting this control to 0 enables loop filtering, setting this control to 1 disables loop filtering." ?

Couldn't the meaning be inverted, so setting the control to 0 disables the loop filtering?

From register point of view, this control value needs be 0 to enable

loop filtering.

OK, this is true for our specific hardware/firmware implementation.

In general, for this user space interface I would rather define that boolean control so value 1 enables LF and value 0 disables LF. The driver could simply negate the value when writing registers.

Quoted 7 lines

BTW we might need to specify type of the control here as Hans suggested commenting on other control.

--
Regards,
Sylwester

Ok I will change the implementation from the driver for this control. Yes in the next version I will add the type of the control for all.

Thank you for the review.

Regards,
Smitha

#24 lore raw
In reply to Smitha T Murthy
Quoted 9 lines · Smitha T Murthy

This patch series adds MFC v10.10 support. MFC v10.10 is used in some of Exynos7 variants.

This adds support for following:

* Add support for HEVC encoder and decoder
* Add support for VP9 decoder
* Update Documentation for control id definitions
* Update computation of min scratch buffer size requirement for V8 onwards

Smitha, do you have any updates on this? IIRC, there were few things which needed corrections but we were rather close to the final version.

--
Thanks,
Sylwester

#25 lore raw
Quoted 10 lines · Sylwester Nawrocki
Quoted 9 lines · Smitha T Murthy

This patch series adds MFC v10.10 support. MFC v10.10 is used in some of Exynos7 variants.

This adds support for following:

* Add support for HEVC encoder and decoder
* Add support for VP9 decoder
* Update Documentation for control id definitions
* Update computation of min scratch buffer size requirement for V8 onwards

Quoted 7 lines

Smitha, do you have any updates on this? IIRC, there were few things which needed corrections but we were rather close to the final version.

--
Thanks,
Sylwester

Hi Sylwester,

Sorry, I am currently held up with some other work. I will try to make time and work on the next the updated patch series soon.

Regards,
Smitha