Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1617528 > unrolled thread
| Started by | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| First post | 2017-04-06 08:20 +0200 |
| Last post | 2017-04-06 08:20 +0200 |
| Articles | 12 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[Patch v4 00/12] Add MFC v10.10 support Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
[Patch v4 01/12] [media] s5p-mfc: Rename IS_MFCV8 macro Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
[Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Hans Verkuil <hverkuil@xs4all.nl> - 2017-04-06 15:40 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Smitha T Murthy <smitha.t@samsung.com> - 2017-04-07 10:40 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Sylwester Nawrocki <s.nawrocki@samsung.com> - 2017-04-06 16:50 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Smitha T Murthy <smitha.t@samsung.com> - 2017-04-07 12:10 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Sylwester Nawrocki <s.nawrocki@samsung.com> - 2017-04-07 12:30 +0200
Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs Smitha T Murthy <smitha.t@samsung.com> - 2017-04-07 14:10 +0200
[Patch v4 03/12] [media] s5p-mfc: Use min scratch buffer size as provided by F/W Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
[Patch v4 09/12] [media] s5p-mfc: Add VP9 decoder support Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
[Patch v4 04/12] [media] s5p-mfc: Support MFCv10.10 buffer requirements Smitha T Murthy <smitha.t@samsung.com> - 2017-04-06 08:20 +0200
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 00/12] Add MFC v10.10 support |
| Message-ID | <tt8VY-4N0-3@gated-at.bofh.it> |
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 -- 2.7.4
[toc] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 01/12] [media] s5p-mfc: Rename IS_MFCV8 macro |
| Message-ID | <tt8VZ-4N0-43@gated-at.bofh.it> |
| In reply to | #1617528 |
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.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
---
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(-)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 4220914..5fb2684 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -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)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
index 69ef9c2..3769d22 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
@@ -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);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 8937b0a..42e9351 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -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;
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 85880e9..d52f23c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -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.
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <tt8VZ-4N0-49@gated-at.bofh.it> |
| In reply to | #1617528 |
Added V4l2 controls for HEVC encoder
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
---
Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
1 file changed, 391 insertions(+)
diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
index abb1057..85a668d 100644
--- a/Documentation/media/uapi/v4l/extended-controls.rst
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -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
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Hans Verkuil <hverkuil@xs4all.nl> |
|---|---|
| Date | 2017-04-06 15:40 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttfNM-DZ-23@gated-at.bofh.it> |
| In reply to | #1617530 |
On 04/06/2017 08:11 AM, Smitha T Murthy wrote:
> Added V4l2 controls for HEVC encoder
>
> Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
General comment: don't forget to build the pdf and check that as well.
> ---
> Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
> 1 file changed, 391 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> index abb1057..85a668d 100644
> --- a/Documentation/media/uapi/v4l/extended-controls.rst
> +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> @@ -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``
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.
> + 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
s/upto/up to/
So "one modulo time" == "one second"? Perhaps just say that instead?
> + 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/
> + 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
s/ID/value/
> + 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.
> +
> +``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.
> +
> +.. _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.
Add space after CRA.
> + * - ``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/
> + 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)
> + 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/
> +
> +``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.
> +
> +``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
>
Regards,
Hans
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-07 10:40 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttxB0-4Hw-15@gated-at.bofh.it> |
| In reply to | #1618011 |
On Thu, 2017-04-06 at 15:33 +0200, Hans Verkuil wrote:
> On 04/06/2017 08:11 AM, Smitha T Murthy wrote:
> > Added V4l2 controls for HEVC encoder
> >
> > Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
>
> 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.
> > ---
> > Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
> > 1 file changed, 391 insertions(+)
> >
> > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> > index abb1057..85a668d 100644
> > --- a/Documentation/media/uapi/v4l/extended-controls.rst
> > +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> > @@ -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``
>
> 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.
> > + 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
>
> s/upto/up to/
>
> So "one modulo time" == "one second"? Perhaps just say that instead?
>
I will change it to one second.
> > + 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.
> > + 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
>
> s/ID/value/
>
I will correct it.
> > + 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.
>
I will remove this.
> > +
> > +``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.
> > +
> > +.. _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.
>
> Add space after CRA.
>
I will add it.
> > + * - ``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/
>
I will correct this.
> > + 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.
> > + 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.
> > +
> > +``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.
> > +
> > +``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
> >
>
> Regards,
>
> Hans
>
Thank you for the review.
Regards,
Smitha
[toc] | [prev] | [next] | [standalone]
| From | Sylwester Nawrocki <s.nawrocki@samsung.com> |
|---|---|
| Date | 2017-04-06 16:50 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttgTv-1Cx-9@gated-at.bofh.it> |
| In reply to | #1617530 |
On 04/06/2017 08:11 AM, Smitha T Murthy wrote:
> Added V4l2 controls for HEVC encoder
s/HEVC/H.265/HEVC ?
> Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> ---
> Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
> 1 file changed, 391 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> index abb1057..85a668d 100644
> --- a/Documentation/media/uapi/v4l/extended-controls.rst
> +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> @@ -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" ?
> +---------------------
> +
> +The HEVC controls include controls for encoding parameters of HEVC video
> +codec.
s/'HEVC'/'HEVC/H.265' ?
> +
> +
> +.. _hevc-control-id:
> +
> +HEVC Control IDs
s/'HEVC'/'HEVC/H.265' ?
> +^^^^^^^^^^^^^^^
> +
> +``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
s/upto/up to/
> + 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.
> +.. 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.
"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?
> +
> +``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.
> +``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.
> +.. _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.
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..."
> +``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.
> +``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.
> +``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB``
> + Setting the control ID to 1 enables general picture buffers for HEVC
s/control ID/control/
> + 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?
> + setting the control ID to 1.
s/control ID/control/
> +``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/ ?
> + 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/
> + 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.
> + 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.
> +``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.
"S5P and Exynos" ?
> +
> +.. _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 ?
> + 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.
> +``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?
--
Regards,
Sylwester
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-07 12:10 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttz06-5HY-17@gated-at.bofh.it> |
| In reply to | #1618080 |
On Thu, 2017-04-06 at 16:47 +0200, Sylwester Nawrocki wrote:
> On 04/06/2017 08:11 AM, Smitha T Murthy wrote:
> > Added V4l2 controls for HEVC encoder
>
> s/HEVC/H.265/HEVC ?
>
Ok I will change it.
> > Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> > ---
> > Documentation/media/uapi/v4l/extended-controls.rst | 391 +++++++++++++++++++++
> > 1 file changed, 391 insertions(+)
> >
> > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> > index abb1057..85a668d 100644
> > --- a/Documentation/media/uapi/v4l/extended-controls.rst
> > +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> > @@ -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" ?
>
I will change it.
> > +---------------------
> > +
> > +The HEVC controls include controls for encoding parameters of HEVC video
> > +codec.
>
> s/'HEVC'/'HEVC/H.265' ?
>
Ok I will change it.
> > +
> > +
> > +.. _hevc-control-id:
> > +
> > +HEVC Control IDs
>
> s/'HEVC'/'HEVC/H.265' ?
>
I will change it.
> > +^^^^^^^^^^^^^^^
> > +
> > +``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
>
> s/upto/up to/
>
I will change it.
> > + 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.
>
Yes correct demanding in terms of requiring high bit rate. I will make
it more clear.
> > +.. 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.
>
> "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.
> > +
> > +``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.
>
I will remove it.
> > +``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.
> > +.. _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.
>
> 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..."
>
Yes I will add sentences describing the behaviour for all the controls.
> > +``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.
>
> > +``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.
>
> > +``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.
> > + 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.
> > + setting the control ID to 1.
>
> s/control ID/control/
>
I will change it.
> > +``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.
> > + 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/
>
I will correct it.
> > + 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.
> > + 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.
> > +``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.
>
> "S5P and Exynos" ?
>
Ok I will add Exynos too.
> > +
> > +.. _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.
> > + 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.
>
I will add the value and corresponding behaviour.
> > +``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.
> 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
[toc] | [prev] | [next] | [standalone]
| From | Sylwester Nawrocki <s.nawrocki@samsung.com> |
|---|---|
| Date | 2017-04-07 12:30 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttzjr-5Oz-17@gated-at.bofh.it> |
| In reply to | #1618654 |
On 04/07/2017 12:03 PM, Smitha T Murthy wrote: >>> +``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? >> >>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
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-07 14:10 +0200 |
| Subject | Re: [Patch v4 12/12] Documention: v4l: Documentation for HEVC CIDs |
| Message-ID | <ttASe-6SI-23@gated-at.bofh.it> |
| In reply to | #1618661 |
On Fri, 2017-04-07 at 12:26 +0200, Sylwester Nawrocki wrote: > On 04/07/2017 12:03 PM, Smitha T Murthy wrote: > >>> +``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? > >> > >>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 > 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
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 03/12] [media] s5p-mfc: Use min scratch buffer size as provided by F/W |
| Message-ID | <tt8VZ-4N0-63@gated-at.bofh.it> |
| In reply to | #1617528 |
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.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
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(-)
diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v8.h b/drivers/media/platform/s5p-mfc/regs-mfc-v8.h
index 75f5f75..bd639ae 100644
--- a/drivers/media/platform/s5p-mfc/regs-mfc-v8.h
+++ b/drivers/media/platform/s5p-mfc/regs-mfc-v8.h
@@ -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
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index c63d764..a0e9e0f 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -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
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index eb0cf5e..e65e1c3 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -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)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 64b6b6d..eb5352a 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -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;
}
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
index 16d553f..e7a2d46 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
@@ -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);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 73bcf86..0030b6f 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -110,7 +110,9 @@ 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_PLUS(dev))
+ if (IS_MFCV10(dev))
+ mfc_debug(2, "Use min scratch buffer size\n");
+ else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_H264_DEC_V8(
mb_width,
@@ -127,7 +129,9 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
(ctx->mv_count * ctx->mv_size);
break;
case S5P_MFC_CODEC_MPEG4_DEC:
- if (IS_MFCV7_PLUS(dev)) {
+ if (IS_MFCV10(dev))
+ mfc_debug(2, "Use min scratch buffer size\n");
+ else if (IS_MFCV7_PLUS(dev)) {
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_DEC_V7(
mb_width,
@@ -145,10 +149,14 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
break;
case S5P_MFC_CODEC_VC1RCV_DEC:
case S5P_MFC_CODEC_VC1_DEC:
- ctx->scratch_buf_size =
- S5P_FIMV_SCRATCH_BUF_SIZE_VC1_DEC_V6(
- mb_width,
- mb_height);
+ if (IS_MFCV10(dev))
+ mfc_debug(2, "Use min scratch buffer size\n");
+ else
+ ctx->scratch_buf_size =
+ S5P_FIMV_SCRATCH_BUF_SIZE_VC1_DEC_V6(
+ mb_width,
+ mb_height);
+
ctx->scratch_buf_size = ALIGN(ctx->scratch_buf_size,
S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
ctx->bank1.size = ctx->scratch_buf_size;
@@ -158,16 +166,21 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
ctx->bank2.size = 0;
break;
case S5P_MFC_CODEC_H263_DEC:
- ctx->scratch_buf_size =
- S5P_FIMV_SCRATCH_BUF_SIZE_H263_DEC_V6(
- mb_width,
- mb_height);
+ if (IS_MFCV10(dev))
+ mfc_debug(2, "Use min scratch buffer size\n");
+ else
+ ctx->scratch_buf_size =
+ S5P_FIMV_SCRATCH_BUF_SIZE_H263_DEC_V6(
+ mb_width,
+ mb_height);
ctx->scratch_buf_size = ALIGN(ctx->scratch_buf_size,
S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
ctx->bank1.size = ctx->scratch_buf_size;
break;
case S5P_MFC_CODEC_VP8_DEC:
- if (IS_MFCV8_PLUS(dev))
+ if (IS_MFCV10(dev))
+ mfc_debug(2, "Use min scratch buffer size\n");
+ else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_VP8_DEC_V8(
mb_width,
@@ -182,7 +195,9 @@ 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_PLUS(dev))
+ if (IS_MFCV10(dev)) {
+ mfc_debug(2, "Use min scratch buffer size\n");
+ } else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V8(
mb_width,
@@ -202,10 +217,13 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
break;
case S5P_MFC_CODEC_MPEG4_ENC:
case S5P_MFC_CODEC_H263_ENC:
- ctx->scratch_buf_size =
- S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_ENC_V6(
- mb_width,
- mb_height);
+ if (IS_MFCV10(dev)) {
+ mfc_debug(2, "Use min scratch buffer size\n");
+ } else
+ ctx->scratch_buf_size =
+ S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_ENC_V6(
+ mb_width,
+ mb_height);
ctx->scratch_buf_size = ALIGN(ctx->scratch_buf_size,
S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
ctx->bank1.size =
@@ -215,7 +233,9 @@ 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_PLUS(dev))
+ if (IS_MFCV10(dev)) {
+ mfc_debug(2, "Use min scratch buffer size\n");
+ } else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_VP8_ENC_V8(
mb_width,
@@ -1900,6 +1920,16 @@ static int s5p_mfc_get_mv_count_v6(struct s5p_mfc_dev *dev)
return readl(dev->mfc_regs->d_min_num_mv);
}
+static int s5p_mfc_get_min_scratch_buf_size(struct s5p_mfc_dev *dev)
+{
+ return readl(dev->mfc_regs->d_min_scratch_buffer_size);
+}
+
+static int s5p_mfc_get_e_min_scratch_buf_size(struct s5p_mfc_dev *dev)
+{
+ return readl(dev->mfc_regs->e_min_scratch_buffer_size);
+}
+
static int s5p_mfc_get_inst_no_v6(struct s5p_mfc_dev *dev)
{
return readl(dev->mfc_regs->ret_instance_id);
@@ -2158,6 +2188,7 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev)
R(d_ret_picture_tag_bot, S5P_FIMV_D_RET_PICTURE_TAG_BOT_V8);
R(d_display_crop_info1, S5P_FIMV_D_DISPLAY_CROP_INFO1_V8);
R(d_display_crop_info2, S5P_FIMV_D_DISPLAY_CROP_INFO2_V8);
+ R(d_min_scratch_buffer_size, S5P_FIMV_D_MIN_SCRATCH_BUFFER_SIZE_V8);
/* encoder registers */
R(e_padding_ctrl, S5P_FIMV_E_PADDING_CTRL_V8);
@@ -2173,6 +2204,7 @@ const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev)
R(e_aspect_ratio, S5P_FIMV_E_ASPECT_RATIO_V8);
R(e_extended_sar, S5P_FIMV_E_EXTENDED_SAR_V8);
R(e_h264_options, S5P_FIMV_E_H264_OPTIONS_V8);
+ R(e_min_scratch_buffer_size, S5P_FIMV_E_MIN_SCRATCH_BUFFER_SIZE_V8);
done:
return &mfc_regs;
@@ -2221,6 +2253,8 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = {
.get_pic_type_bot = s5p_mfc_get_pic_type_bot_v6,
.get_crop_info_h = s5p_mfc_get_crop_info_h_v6,
.get_crop_info_v = s5p_mfc_get_crop_info_v_v6,
+ .get_min_scratch_buf_size = s5p_mfc_get_min_scratch_buf_size,
+ .get_e_min_scratch_buf_size = s5p_mfc_get_e_min_scratch_buf_size,
};
struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void)
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 09/12] [media] s5p-mfc: Add VP9 decoder support |
| Message-ID | <tt8VZ-4N0-57@gated-at.bofh.it> |
| In reply to | #1617528 |
Add support for codec definition and corresponding buffer
requirements for VP9 decoder.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
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(+)
diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
index 953a073..6754477 100644
--- a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
+++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
@@ -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) \
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
index 76eca67..102b47e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
@@ -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;
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 828e07e..b49f220 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -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
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 4749355..5cf4d99 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -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)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
index e7a2d46..57f4560 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
@@ -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;
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 979c4ce..cb0380b 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -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
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Smitha T Murthy <smitha.t@samsung.com> |
|---|---|
| Date | 2017-04-06 08:20 +0200 |
| Subject | [Patch v4 04/12] [media] s5p-mfc: Support MFCv10.10 buffer requirements |
| Message-ID | <tt8VZ-4N0-53@gated-at.bofh.it> |
| In reply to | #1617528 |
Aligning the luma_dpb_size, chroma_dpb_size, mv_size and me_buffer_size
for MFCv10.10.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
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(-)
diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
index 1ca09d6..3f0dab3 100644
--- a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
+++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
@@ -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*/
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 0030b6f..2d26b1b 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -64,6 +64,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
{
struct s5p_mfc_dev *dev = ctx->dev;
unsigned int mb_width, mb_height;
+ unsigned int lcu_width = 0, lcu_height = 0;
int ret;
mb_width = MB_WIDTH(ctx->img_width);
@@ -74,7 +75,9 @@ 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_PLUS(dev))
+ if (IS_MFCV10(dev)) {
+ ctx->tmv_buffer_size = 0;
+ } else 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);
@@ -82,13 +85,36 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
ctx->tmv_buffer_size = S5P_FIMV_NUM_TMV_BUFFERS_V6 *
ALIGN(S5P_FIMV_TMV_BUFFER_SIZE_V6(mb_width, mb_height),
S5P_FIMV_TMV_BUFFER_ALIGN_V6);
-
- ctx->luma_dpb_size = ALIGN((mb_width * mb_height) *
- S5P_FIMV_LUMA_MB_TO_PIXEL_V6,
- S5P_FIMV_LUMA_DPB_BUFFER_ALIGN_V6);
- 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_MFCV10(dev)) {
+ lcu_width = enc_lcu_width(ctx->img_width);
+ lcu_height = enc_lcu_height(ctx->img_height);
+ if (ctx->codec_mode != S5P_FIMV_CODEC_HEVC_ENC) {
+ ctx->luma_dpb_size =
+ ALIGN((mb_width * 16), 64)
+ * ALIGN((mb_height * 16), 32)
+ + 64;
+ ctx->chroma_dpb_size =
+ ALIGN((mb_width * 16), 64)
+ * (mb_height * 8)
+ + 64;
+ } else {
+ ctx->luma_dpb_size =
+ ALIGN((lcu_width * 32), 64)
+ * ALIGN((lcu_height * 32), 32)
+ + 64;
+ ctx->chroma_dpb_size =
+ ALIGN((lcu_width * 32), 64)
+ * (lcu_height * 16)
+ + 64;
+ }
+ } else {
+ ctx->luma_dpb_size = ALIGN((mb_width * mb_height) *
+ S5P_FIMV_LUMA_MB_TO_PIXEL_V6,
+ S5P_FIMV_LUMA_DPB_BUFFER_ALIGN_V6);
+ 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_PLUS(dev))
ctx->me_buffer_size = ALIGN(S5P_FIMV_ME_BUFFER_SIZE_V8(
ctx->img_width, ctx->img_height,
@@ -197,6 +223,8 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
case S5P_MFC_CODEC_H264_ENC:
if (IS_MFCV10(dev)) {
mfc_debug(2, "Use min scratch buffer size\n");
+ ctx->me_buffer_size =
+ ALIGN(ENC_V100_H264_ME_SIZE(mb_width, mb_height), 16);
} else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V8(
@@ -219,6 +247,9 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
case S5P_MFC_CODEC_H263_ENC:
if (IS_MFCV10(dev)) {
mfc_debug(2, "Use min scratch buffer size\n");
+ ctx->me_buffer_size =
+ ALIGN(ENC_V100_MPEG4_ME_SIZE(mb_width,
+ mb_height), 16);
} else
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_ENC_V6(
@@ -235,7 +266,10 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
case S5P_MFC_CODEC_VP8_ENC:
if (IS_MFCV10(dev)) {
mfc_debug(2, "Use min scratch buffer size\n");
- } else if (IS_MFCV8_PLUS(dev))
+ ctx->me_buffer_size =
+ ALIGN(ENC_V100_VP8_ME_SIZE(mb_width, mb_height),
+ 16);
+ } else if (IS_MFCV8_PLUS(dev))
ctx->scratch_buf_size =
S5P_FIMV_SCRATCH_BUF_SIZE_VP8_ENC_V8(
mb_width,
@@ -393,13 +427,13 @@ 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) {
- if (IS_MFCV10(dev))
+ if (IS_MFCV10(dev)) {
ctx->mv_size = S5P_MFC_DEC_MV_SIZE_V10(ctx->img_width,
ctx->img_height);
- else
+ } 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;
}
@@ -596,15 +630,34 @@ static int s5p_mfc_set_enc_ref_buffer_v6(struct s5p_mfc_ctx *ctx)
mfc_debug(2, "Buf1: %p (%d)\n", (void *)buf_addr1, buf_size1);
- for (i = 0; i < ctx->pb_count; i++) {
- writel(buf_addr1, mfc_regs->e_luma_dpb + (4 * i));
- buf_addr1 += ctx->luma_dpb_size;
- writel(buf_addr1, mfc_regs->e_chroma_dpb + (4 * i));
- buf_addr1 += ctx->chroma_dpb_size;
- writel(buf_addr1, mfc_regs->e_me_buffer + (4 * i));
- buf_addr1 += ctx->me_buffer_size;
- buf_size1 -= (ctx->luma_dpb_size + ctx->chroma_dpb_size +
- ctx->me_buffer_size);
+ if (IS_MFCV10(dev)) {
+ /* start address of per buffer is aligned */
+ for (i = 0; i < ctx->pb_count; i++) {
+ writel(buf_addr1, mfc_regs->e_luma_dpb + (4 * i));
+ buf_addr1 += ctx->luma_dpb_size;
+ buf_size1 -= ctx->luma_dpb_size;
+ }
+ for (i = 0; i < ctx->pb_count; i++) {
+ writel(buf_addr1, mfc_regs->e_chroma_dpb + (4 * i));
+ buf_addr1 += ctx->chroma_dpb_size;
+ buf_size1 -= ctx->chroma_dpb_size;
+ }
+ for (i = 0; i < ctx->pb_count; i++) {
+ writel(buf_addr1, mfc_regs->e_me_buffer + (4 * i));
+ buf_addr1 += ctx->me_buffer_size;
+ buf_size1 -= ctx->me_buffer_size;
+ }
+ } else {
+ for (i = 0; i < ctx->pb_count; i++) {
+ writel(buf_addr1, mfc_regs->e_luma_dpb + (4 * i));
+ buf_addr1 += ctx->luma_dpb_size;
+ writel(buf_addr1, mfc_regs->e_chroma_dpb + (4 * i));
+ buf_addr1 += ctx->chroma_dpb_size;
+ writel(buf_addr1, mfc_regs->e_me_buffer + (4 * i));
+ buf_addr1 += ctx->me_buffer_size;
+ buf_size1 -= (ctx->luma_dpb_size + ctx->chroma_dpb_size
+ + ctx->me_buffer_size);
+ }
}
writel(buf_addr1, mfc_regs->e_scratch_buffer_addr);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h
index 021b8db..975bbc5 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h
@@ -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)
--
2.7.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web