* Re: [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features
@ 2012-10-02 5:59 Arun Kumar K
0 siblings, 0 replies; 3+ messages in thread
From: Arun Kumar K @ 2012-10-02 5:59 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media@vger.kernel.org, Kamil Debski, Jeongtae Park,
Jang-Hyuck Kim, peter Oh, NAVEEN KRISHNA CHATRADHI,
Marek Szyprowski, Sylwester Nawrocki, kmpark@infradead.org,
SUNIL JOSHI
Hi Hans,
Thank you for the review.
Will make all the suggested changes and post updated patch.
Regards
Arun
------- Original Message -------
Sender : Hans Verkuil<hverkuil@xs4all.nl>
Date : Oct 01, 2012 19:57 (GMT+05:30)
Title : Re: [PATCH v8 2/6] [media] v4l: Add control definitions for new H264
encoder features
Hi Arun,
I've got a bunch of comments below, all pretty much small stuff...
On Tue October 2 2012 00:04:55 Arun Kumar K wrote:
> New controls are added for supporting H264 encoding features like
> - MVC frame packing
> - Flexible macroblock ordering
> - Arbitrary slice ordering
> - Hierarchial coding
>
> Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
> ---
> Documentation/DocBook/media/v4l/controls.xml | 268 +++++++++++++++++++++++++-
> drivers/media/v4l2-core/v4l2-ctrls.c | 42 ++++
> include/linux/v4l2-controls.h | 41 ++++
> 3 files changed, 350 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> index 272a5f7..ce2cfd3 100644
> --- a/Documentation/DocBook/media/v4l/controls.xml
> +++ b/Documentation/DocBook/media/v4l/controls.xml
> @@ -1586,7 +1586,6 @@ frame counter of the frame that is currently displayed (decoded). This value is
> the decoder is started.</entry>
> </row>
>
> -
> <row><entry></entry></row>
> <row>
> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry>
> @@ -2270,6 +2269,14 @@ Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry>
> </row>
>
> <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-vbv-delay">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_DELAY</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Sets the initial delay in milliseconds for
> +VBV buffer control.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> <row>
> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry>
> <entry>integer</entry>
> @@ -2334,6 +2341,265 @@ Applicable to the MPEG4 decoder.</entry>
> </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry>
> </row>
>
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enable generation of frame packing supplemental enhancement information in the encoded bitstream.
> +The frame packing SEI message contains the arrangement of L and R planes for 3D viewing. Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Sets current frame as frame0 in frame packing SEI.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-sei-fp-arrangement-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_sei_fp_arrangement_type</entry>
> + </row>
> + <row><entry spanname="descr">Frame packing arrangement type for H264 SEI.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD</constant> </entry>
> + <entry>Pixels are alternatively from L and R.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN</constant> </entry>
> + <entry>L and R are interlaced by column.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW</constant> </entry>
> + <entry>L and R are interlaced by row.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE</constant> </entry>
> + <entry>L is on the left, R on the right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM</constant> </entry>
> + <entry>L is on top, R on bottom.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL</constant> </entry>
> + <entry>One view per frame.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables flexible macroblock ordering in the encoded bitstream. It is a technique
> +used for restructuring the ordering of macroblocks in pictures. Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-fmo-map-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_fmo_map_type</entry>
> + </row>
> + <row><entry spanname="descr">When using FMO, the map type divides the image in different scan patterns of macroblocks.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES</constant> </entry>
> + <entry>Slices are interleaved one after other with macroblocks in run length order.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES</constant> </entry>
> + <entry>Scatters the macroblocks based on a mathematical function known to both encoder and decoder.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER</constant> </entry>
> + <entry>Macroblocks arranged in rectangular areas or regions of interest.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT</constant> </entry>
> + <entry>Slice groups grow in a cyclic way from centre to outwards.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN</constant> </entry>
> + <entry>Slice groups grow in raster scan pattern from left to right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN</constant> </entry>
> + <entry>Slice groups grow in wipe scan pattern from top to bottom.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT</constant> </entry>
> + <entry>User defined map type.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Number of slice groups in FMO.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-fmo-change-direction">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_fmo_change_dir</entry>
> + </row>
> + <row><entry spanname="descr">Specifies a direction of the slice group change for raster and wipe maps.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT</constant> </entry>
> + <entry>Raster scan or wipe right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT</constant> </entry>
> + <entry>Reverse raster scan or wipe left.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the size of the first slice group for raster and wipe map.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the number of consecutive macroblocks for the interleaved map.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables arbitrary slice ordering in encoded bitstream.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Specifies the slice order in ASO. Applicable to the H264 encoder.
> +The supplied 32-bit integer is interpreted as follows (bit
> +0 = least significant bit):</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry>Bit 0:15</entry>
> + <entry>Slice ID</entry>
> + </row>
> + <row>
> + <entry>Bit 16:32</entry>
> + <entry>Slice position or order</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables H264 hierarchial coding.
hierarchial -> hierarchical
This same typo is made in quite a few places, so please to a case-insensitive
search for this.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-hierarchial-coding-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_hierarchical_coding_type</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the hierarchial coding type.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B</constant> </entry>
> + <entry>Hierarchial B coding.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P</constant> </entry>
> + <entry>Hierarchial P coding.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the number of hierarchial coding layers.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Specifies a user defined QP for each layer. Applicable to the H264 encoder.
> +The supplied 32-bit integer is interpreted as follows (bit
> +0 = least significant bit):</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry>Bit 0:15</entry>
> + <entry>QP value</entry>
> + </row>
> + <row>
> + <entry>Bit 16:32</entry>
> + <entry>Layer number</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> </tbody>
> </tgroup>
> </table>
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index f400035..a7518cb 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -384,6 +384,25 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> "Extended SAR",
> NULL,
> };
> + static const char * const h264_fp_arrangement_type[] = {
> + "Checkerboard",
> + "Column",
> + "Row",
> + "Side by side",
"Side by Side"
> + "Top Bottom",
> + "Temporal",
> + NULL,
> + };
> + static const char * const h264_fmo_map_type[] = {
> + "Interleaved Slices",
> + "Scattered Slices",
> + "Foreground With Leftover",
With -> with
I can't help the weird capitalization rules in English w.r.t. titles :-)
> + "Box Out",
> + "Raster Scan",
> + "Wipe Scan",
> + "Explicit",
> + NULL,
> + };
> static const char * const mpeg_mpeg4_level[] = {
> "0",
> "0b",
> @@ -508,6 +527,10 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> return h264_profile;
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
> return vui_sar_idc;
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
> + return h264_fp_arrangement_type;
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
> + return h264_fmo_map_type;
> case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
> return mpeg_mpeg4_level;
> case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
> @@ -643,6 +666,22 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH: return "Horizontal Size of SAR";
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE: return "Aspect Ratio VUI Enable";
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC: return "VUI Aspect Ratio IDC";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING: return "H264 Enable Frame Packing SEI";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0: return "H264 Set Current Frame as Frame0";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE: return "H264 Frame Packing Arrangement Type";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO: return "H264 Flexible Macroblock Ordering";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE: return "H264 Map Type for FMO";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP: return "H264 FMO Number of Slice Groups";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION: return "H264 FMO Direction of the Slice Group Change";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE: return "H264 FMO Size of the First Slice Group";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH: return "H264 FMO Number of Consecutive MBs";
> + case V4L2_CID_MPEG_VIDEO_H264_ASO: return "H264 Arbitrary Slice Ordering";
> + case V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER: return "H264 ASO Slice Order";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING: return "Enable H264 Hierarchial Coding";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE: return "H264 Hierarchial Coding Type";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of Hierarchial Coding Layers";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP:
> + return "H264 Set QP Value for Hierarchial Coding Layers";
Note that the string can only be 32 chars long (including the terminating zero),
so quite a few of these strings are too long. The control framework will just
cut off the string.
> case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value";
> @@ -657,6 +696,7 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size";
> case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS";
> case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count";
> + case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Buffer Control";
>
> /* CAMERA controls */
> /* Keep the order of the 'case's the same as in videodev2.h! */
> @@ -853,6 +893,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
> case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
> case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
> case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
> case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> index 421d24c..86e79af 100644
> --- a/include/linux/v4l2-controls.h
> +++ b/include/linux/v4l2-controls.h
> @@ -349,6 +349,7 @@ enum v4l2_mpeg_video_multi_slice_mode {
> #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
> #define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
> #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
> +#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
>
> #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
> #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
> @@ -439,6 +440,46 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {
> V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
> V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
> };
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
> +enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD = 0,
Typo: CHEKER -> CHECKER
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
> +enum v4l2_mpeg_video_h264_fmo_map_type {
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
> +enum v4l2_mpeg_video_h264_fmo_change_dir {
> + V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
> + V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
> +#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
> +#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
> +enum v4l2_mpeg_video_h264_hierarchical_coding_type {
> + V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
> + V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
>
Regards,
Hans
<p> </p><p> </p>
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v8 0/6] Update MFC v4l2 driver to support MFC6.x
@ 2012-10-01 22:04 Arun Kumar K
2012-10-01 22:04 ` [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features Arun Kumar K
0 siblings, 1 reply; 3+ messages in thread
From: Arun Kumar K @ 2012-10-01 22:04 UTC (permalink / raw)
To: linux-media
Cc: k.debski, jtp.park, janghyuck.kim, jaeryul.oh, ch.naveen, arun.kk,
m.szyprowski, s.nawrocki, kmpark, joshi
The patchset adds support for MFCv6 firmware in s5p-mfc driver.
The patches are rebased to the latest media-tree.
Changelog v8
- Addressed comments by Sylwester Nawrocki
http://www.mail-archive.com/linux-media@vger.kernel.org/msg52942.html
Changelog v7
- Removed unused macros from register files
Changelog v6
- Use s5p_mfc_hw_call macro to call all HW related ops and cmds
- Rebased onto latest media-tree
- Resending patches adding required v4l controls
- Addressed review comments of Patch v5
Changelog v5
- Modified ops mechanism for macro based function call
- Addressed all other review comments on Patch v4
Changelog v4
- Separate patch for callback based architecture.
- Patches divided to enable incremental compilation.
- Working MFCv6 encoder and decoder.
- Addressed review comments given for v3 patchset.
Changelog v3
- Supports MFCv5 and v6 co-existence.
- Tested for encoding & decoding in MFCv5.
- Supports only decoding in MFCv6 now.
- Can be compiled with kernel image and as module.
- Config macros for MFC version selection removed.
- All previous review comments addressed.
Changelog v2
- Addressed review comments received
http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/45189
Changelog v1
- Fixed crash issue in Exynos4 SoCs running MFC 5.1
- Encoder not tested
Arun Kumar K (4):
[media] v4l: Add fourcc definitions for new formats
[media] v4l: Add control definitions for new H264 encoder features
[media] s5p-mfc: Update MFCv5 driver for callback based architecture
[media] s5p-mfc: Add MFC variant data to device context
Jeongtae Park (2):
[media] s5p-mfc: MFCv6 register definitions
[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x
Documentation/DocBook/media/v4l/controls.xml | 268 +++-
Documentation/DocBook/media/v4l/pixfmt-nv12m.xml | 17 +-
Documentation/DocBook/media/v4l/pixfmt.xml | 10 +
drivers/media/platform/Kconfig | 4 +-
drivers/media/platform/s5p-mfc/Makefile | 7 +-
drivers/media/platform/s5p-mfc/regs-mfc-v6.h | 409 +++++
drivers/media/platform/s5p-mfc/regs-mfc.h | 41 +
drivers/media/platform/s5p-mfc/s5p_mfc.c | 296 +++--
drivers/media/platform/s5p-mfc/s5p_mfc_cmd.c | 109 +--
drivers/media/platform/s5p-mfc/s5p_mfc_cmd.h | 15 +-
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c | 166 ++
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.h | 20 +
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c | 156 ++
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.h | 20 +
drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 191 ++-
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 194 ++-
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.h | 1 +
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 258 ++-
drivers/media/platform/s5p-mfc/s5p_mfc_dec.h | 1 +
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 239 ++--
drivers/media/platform/s5p-mfc/s5p_mfc_enc.h | 1 +
drivers/media/platform/s5p-mfc/s5p_mfc_intr.c | 11 +-
drivers/media/platform/s5p-mfc/s5p_mfc_opr.c | 1386 +---------------
drivers/media/platform/s5p-mfc/s5p_mfc_opr.h | 133 +-
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 1763 +++++++++++++++++++
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.h | 85 +
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 1956 ++++++++++++++++++++++
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h | 50 +
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 3 +-
drivers/media/platform/s5p-mfc/s5p_mfc_shm.c | 47 -
drivers/media/platform/s5p-mfc/s5p_mfc_shm.h | 90 -
drivers/media/v4l2-core/v4l2-ctrls.c | 42 +
include/linux/v4l2-controls.h | 41 +
include/linux/videodev2.h | 4 +
34 files changed, 5941 insertions(+), 2093 deletions(-)
create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v6.h
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.h
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.h
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.h
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h
delete mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_shm.c
delete mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_shm.h
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features
2012-10-01 22:04 [PATCH v8 0/6] Update MFC v4l2 driver to support MFC6.x Arun Kumar K
@ 2012-10-01 22:04 ` Arun Kumar K
2012-10-01 14:27 ` Hans Verkuil
0 siblings, 1 reply; 3+ messages in thread
From: Arun Kumar K @ 2012-10-01 22:04 UTC (permalink / raw)
To: linux-media
Cc: k.debski, jtp.park, janghyuck.kim, jaeryul.oh, ch.naveen, arun.kk,
m.szyprowski, s.nawrocki, kmpark, joshi
New controls are added for supporting H264 encoding features like
- MVC frame packing
- Flexible macroblock ordering
- Arbitrary slice ordering
- Hierarchial coding
Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
---
Documentation/DocBook/media/v4l/controls.xml | 268 +++++++++++++++++++++++++-
drivers/media/v4l2-core/v4l2-ctrls.c | 42 ++++
include/linux/v4l2-controls.h | 41 ++++
3 files changed, 350 insertions(+), 1 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index 272a5f7..ce2cfd3 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -1586,7 +1586,6 @@ frame counter of the frame that is currently displayed (decoded). This value is
the decoder is started.</entry>
</row>
-
<row><entry></entry></row>
<row>
<entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry>
@@ -2270,6 +2269,14 @@ Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry>
</row>
<row><entry></entry></row>
+ <row id="v4l2-mpeg-video-vbv-delay">
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_DELAY</constant> </entry>
+ <entry>integer</entry>
+ </row><row><entry spanname="descr">Sets the initial delay in milliseconds for
+VBV buffer control.</entry>
+ </row>
+
+ <row><entry></entry></row>
<row>
<entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry>
<entry>integer</entry>
@@ -2334,6 +2341,265 @@ Applicable to the MPEG4 decoder.</entry>
</row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry>
</row>
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING</constant> </entry>
+ <entry>boolean</entry>
+ </row>
+ <row><entry spanname="descr">Enable generation of frame packing supplemental enhancement information in the encoded bitstream.
+The frame packing SEI message contains the arrangement of L and R planes for 3D viewing. Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0</constant> </entry>
+ <entry>boolean</entry>
+ </row>
+ <row><entry spanname="descr">Sets current frame as frame0 in frame packing SEI.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row id="v4l2-mpeg-video-h264-sei-fp-arrangement-type">
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE</constant> </entry>
+ <entry>enum v4l2_mpeg_video_h264_sei_fp_arrangement_type</entry>
+ </row>
+ <row><entry spanname="descr">Frame packing arrangement type for H264 SEI.
+Applicable to the H264 encoder.
+Possible values are:</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD</constant> </entry>
+ <entry>Pixels are alternatively from L and R.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN</constant> </entry>
+ <entry>L and R are interlaced by column.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW</constant> </entry>
+ <entry>L and R are interlaced by row.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE</constant> </entry>
+ <entry>L is on the left, R on the right.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM</constant> </entry>
+ <entry>L is on top, R on bottom.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL</constant> </entry>
+ <entry>One view per frame.</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO</constant> </entry>
+ <entry>boolean</entry>
+ </row>
+ <row><entry spanname="descr">Enables flexible macroblock ordering in the encoded bitstream. It is a technique
+used for restructuring the ordering of macroblocks in pictures. Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row id="v4l2-mpeg-video-h264-fmo-map-type">
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE</constant> </entry>
+ <entry>enum v4l2_mpeg_video_h264_fmo_map_type</entry>
+ </row>
+ <row><entry spanname="descr">When using FMO, the map type divides the image in different scan patterns of macroblocks.
+Applicable to the H264 encoder.
+Possible values are:</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES</constant> </entry>
+ <entry>Slices are interleaved one after other with macroblocks in run length order.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES</constant> </entry>
+ <entry>Scatters the macroblocks based on a mathematical function known to both encoder and decoder.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER</constant> </entry>
+ <entry>Macroblocks arranged in rectangular areas or regions of interest.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT</constant> </entry>
+ <entry>Slice groups grow in a cyclic way from centre to outwards.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN</constant> </entry>
+ <entry>Slice groups grow in raster scan pattern from left to right.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN</constant> </entry>
+ <entry>Slice groups grow in wipe scan pattern from top to bottom.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT</constant> </entry>
+ <entry>User defined map type.</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP</constant> </entry>
+ <entry>integer</entry>
+ </row>
+ <row><entry spanname="descr">Number of slice groups in FMO.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row id="v4l2-mpeg-video-h264-fmo-change-direction">
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION</constant> </entry>
+ <entry>enum v4l2_mpeg_video_h264_fmo_change_dir</entry>
+ </row>
+ <row><entry spanname="descr">Specifies a direction of the slice group change for raster and wipe maps.
+Applicable to the H264 encoder.
+Possible values are:</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT</constant> </entry>
+ <entry>Raster scan or wipe right.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT</constant> </entry>
+ <entry>Reverse raster scan or wipe left.</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE</constant> </entry>
+ <entry>integer</entry>
+ </row>
+ <row><entry spanname="descr">Specifies the size of the first slice group for raster and wipe map.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH</constant> </entry>
+ <entry>integer</entry>
+ </row>
+ <row><entry spanname="descr">Specifies the number of consecutive macroblocks for the interleaved map.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO</constant> </entry>
+ <entry>boolean</entry>
+ </row>
+ <row><entry spanname="descr">Enables arbitrary slice ordering in encoded bitstream.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER</constant> </entry>
+ <entry>integer</entry>
+ </row><row><entry spanname="descr">Specifies the slice order in ASO. Applicable to the H264 encoder.
+The supplied 32-bit integer is interpreted as follows (bit
+0 = least significant bit):</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry>Bit 0:15</entry>
+ <entry>Slice ID</entry>
+ </row>
+ <row>
+ <entry>Bit 16:32</entry>
+ <entry>Slice position or order</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING</constant> </entry>
+ <entry>boolean</entry>
+ </row>
+ <row><entry spanname="descr">Enables H264 hierarchial coding.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row id="v4l2-mpeg-video-h264-hierarchial-coding-type">
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE</constant> </entry>
+ <entry>enum v4l2_mpeg_video_h264_hierarchical_coding_type</entry>
+ </row>
+ <row><entry spanname="descr">Specifies the hierarchial coding type.
+Applicable to the H264 encoder.
+Possible values are:</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B</constant> </entry>
+ <entry>Hierarchial B coding.</entry>
+ </row>
+ <row>
+ <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P</constant> </entry>
+ <entry>Hierarchial P coding.</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER</constant> </entry>
+ <entry>integer</entry>
+ </row>
+ <row><entry spanname="descr">Specifies the number of hierarchial coding layers.
+Applicable to the H264 encoder.</entry>
+ </row>
+
+ <row><entry></entry></row>
+ <row>
+ <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP</constant> </entry>
+ <entry>integer</entry>
+ </row><row><entry spanname="descr">Specifies a user defined QP for each layer. Applicable to the H264 encoder.
+The supplied 32-bit integer is interpreted as follows (bit
+0 = least significant bit):</entry>
+ </row>
+ <row>
+ <entrytbl spanname="descr" cols="2">
+ <tbody valign="top">
+ <row>
+ <entry>Bit 0:15</entry>
+ <entry>QP value</entry>
+ </row>
+ <row>
+ <entry>Bit 16:32</entry>
+ <entry>Layer number</entry>
+ </row>
+ </tbody>
+ </entrytbl>
+ </row>
+
</tbody>
</tgroup>
</table>
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index f400035..a7518cb 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -384,6 +384,25 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Extended SAR",
NULL,
};
+ static const char * const h264_fp_arrangement_type[] = {
+ "Checkerboard",
+ "Column",
+ "Row",
+ "Side by side",
+ "Top Bottom",
+ "Temporal",
+ NULL,
+ };
+ static const char * const h264_fmo_map_type[] = {
+ "Interleaved Slices",
+ "Scattered Slices",
+ "Foreground With Leftover",
+ "Box Out",
+ "Raster Scan",
+ "Wipe Scan",
+ "Explicit",
+ NULL,
+ };
static const char * const mpeg_mpeg4_level[] = {
"0",
"0b",
@@ -508,6 +527,10 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return h264_profile;
case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
return vui_sar_idc;
+ case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
+ return h264_fp_arrangement_type;
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
+ return h264_fmo_map_type;
case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
return mpeg_mpeg4_level;
case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
@@ -643,6 +666,22 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH: return "Horizontal Size of SAR";
case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE: return "Aspect Ratio VUI Enable";
case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC: return "VUI Aspect Ratio IDC";
+ case V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING: return "H264 Enable Frame Packing SEI";
+ case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0: return "H264 Set Current Frame as Frame0";
+ case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE: return "H264 Frame Packing Arrangement Type";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO: return "H264 Flexible Macroblock Ordering";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE: return "H264 Map Type for FMO";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP: return "H264 FMO Number of Slice Groups";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION: return "H264 FMO Direction of the Slice Group Change";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE: return "H264 FMO Size of the First Slice Group";
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH: return "H264 FMO Number of Consecutive MBs";
+ case V4L2_CID_MPEG_VIDEO_H264_ASO: return "H264 Arbitrary Slice Ordering";
+ case V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER: return "H264 ASO Slice Order";
+ case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING: return "Enable H264 Hierarchial Coding";
+ case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE: return "H264 Hierarchial Coding Type";
+ case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of Hierarchial Coding Layers";
+ case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP:
+ return "H264 Set QP Value for Hierarchial Coding Layers";
case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value";
case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value";
case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value";
@@ -657,6 +696,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size";
case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS";
case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count";
+ case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Buffer Control";
/* CAMERA controls */
/* Keep the order of the 'case's the same as in videodev2.h! */
@@ -853,6 +893,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
+ case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
+ case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
index 421d24c..86e79af 100644
--- a/include/linux/v4l2-controls.h
+++ b/include/linux/v4l2-controls.h
@@ -349,6 +349,7 @@ enum v4l2_mpeg_video_multi_slice_mode {
#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
+#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
@@ -439,6 +440,46 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
};
+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
+#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
+enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD = 0,
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
+ V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
+};
+#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
+#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
+enum v4l2_mpeg_video_h264_fmo_map_type {
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
+ V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
+};
+#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
+#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
+enum v4l2_mpeg_video_h264_fmo_change_dir {
+ V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
+ V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
+#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
+#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
+#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
+enum v4l2_mpeg_video_h264_hierarchical_coding_type {
+ V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
+ V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
+#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features
2012-10-01 22:04 ` [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features Arun Kumar K
@ 2012-10-01 14:27 ` Hans Verkuil
0 siblings, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2012-10-01 14:27 UTC (permalink / raw)
To: Arun Kumar K
Cc: linux-media, k.debski, jtp.park, janghyuck.kim, jaeryul.oh,
ch.naveen, m.szyprowski, s.nawrocki, kmpark, joshi
Hi Arun,
I've got a bunch of comments below, all pretty much small stuff...
On Tue October 2 2012 00:04:55 Arun Kumar K wrote:
> New controls are added for supporting H264 encoding features like
> - MVC frame packing
> - Flexible macroblock ordering
> - Arbitrary slice ordering
> - Hierarchial coding
>
> Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
> ---
> Documentation/DocBook/media/v4l/controls.xml | 268 +++++++++++++++++++++++++-
> drivers/media/v4l2-core/v4l2-ctrls.c | 42 ++++
> include/linux/v4l2-controls.h | 41 ++++
> 3 files changed, 350 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> index 272a5f7..ce2cfd3 100644
> --- a/Documentation/DocBook/media/v4l/controls.xml
> +++ b/Documentation/DocBook/media/v4l/controls.xml
> @@ -1586,7 +1586,6 @@ frame counter of the frame that is currently displayed (decoded). This value is
> the decoder is started.</entry>
> </row>
>
> -
> <row><entry></entry></row>
> <row>
> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry>
> @@ -2270,6 +2269,14 @@ Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry>
> </row>
>
> <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-vbv-delay">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_DELAY</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Sets the initial delay in milliseconds for
> +VBV buffer control.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> <row>
> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry>
> <entry>integer</entry>
> @@ -2334,6 +2341,265 @@ Applicable to the MPEG4 decoder.</entry>
> </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry>
> </row>
>
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enable generation of frame packing supplemental enhancement information in the encoded bitstream.
> +The frame packing SEI message contains the arrangement of L and R planes for 3D viewing. Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Sets current frame as frame0 in frame packing SEI.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-sei-fp-arrangement-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_sei_fp_arrangement_type</entry>
> + </row>
> + <row><entry spanname="descr">Frame packing arrangement type for H264 SEI.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD</constant> </entry>
> + <entry>Pixels are alternatively from L and R.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN</constant> </entry>
> + <entry>L and R are interlaced by column.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW</constant> </entry>
> + <entry>L and R are interlaced by row.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE</constant> </entry>
> + <entry>L is on the left, R on the right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM</constant> </entry>
> + <entry>L is on top, R on bottom.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL</constant> </entry>
> + <entry>One view per frame.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables flexible macroblock ordering in the encoded bitstream. It is a technique
> +used for restructuring the ordering of macroblocks in pictures. Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-fmo-map-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_fmo_map_type</entry>
> + </row>
> + <row><entry spanname="descr">When using FMO, the map type divides the image in different scan patterns of macroblocks.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES</constant> </entry>
> + <entry>Slices are interleaved one after other with macroblocks in run length order.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES</constant> </entry>
> + <entry>Scatters the macroblocks based on a mathematical function known to both encoder and decoder.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER</constant> </entry>
> + <entry>Macroblocks arranged in rectangular areas or regions of interest.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT</constant> </entry>
> + <entry>Slice groups grow in a cyclic way from centre to outwards.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN</constant> </entry>
> + <entry>Slice groups grow in raster scan pattern from left to right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN</constant> </entry>
> + <entry>Slice groups grow in wipe scan pattern from top to bottom.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT</constant> </entry>
> + <entry>User defined map type.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Number of slice groups in FMO.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-fmo-change-direction">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_fmo_change_dir</entry>
> + </row>
> + <row><entry spanname="descr">Specifies a direction of the slice group change for raster and wipe maps.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT</constant> </entry>
> + <entry>Raster scan or wipe right.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT</constant> </entry>
> + <entry>Reverse raster scan or wipe left.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the size of the first slice group for raster and wipe map.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the number of consecutive macroblocks for the interleaved map.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables arbitrary slice ordering in encoded bitstream.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Specifies the slice order in ASO. Applicable to the H264 encoder.
> +The supplied 32-bit integer is interpreted as follows (bit
> +0 = least significant bit):</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry>Bit 0:15</entry>
> + <entry>Slice ID</entry>
> + </row>
> + <row>
> + <entry>Bit 16:32</entry>
> + <entry>Slice position or order</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING</constant> </entry>
> + <entry>boolean</entry>
> + </row>
> + <row><entry spanname="descr">Enables H264 hierarchial coding.
hierarchial -> hierarchical
This same typo is made in quite a few places, so please to a case-insensitive
search for this.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row id="v4l2-mpeg-video-h264-hierarchial-coding-type">
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE</constant> </entry>
> + <entry>enum v4l2_mpeg_video_h264_hierarchical_coding_type</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the hierarchial coding type.
> +Applicable to the H264 encoder.
> +Possible values are:</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B</constant> </entry>
> + <entry>Hierarchial B coding.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P</constant> </entry>
> + <entry>Hierarchial P coding.</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER</constant> </entry>
> + <entry>integer</entry>
> + </row>
> + <row><entry spanname="descr">Specifies the number of hierarchial coding layers.
> +Applicable to the H264 encoder.</entry>
> + </row>
> +
> + <row><entry></entry></row>
> + <row>
> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP</constant> </entry>
> + <entry>integer</entry>
> + </row><row><entry spanname="descr">Specifies a user defined QP for each layer. Applicable to the H264 encoder.
> +The supplied 32-bit integer is interpreted as follows (bit
> +0 = least significant bit):</entry>
> + </row>
> + <row>
> + <entrytbl spanname="descr" cols="2">
> + <tbody valign="top">
> + <row>
> + <entry>Bit 0:15</entry>
> + <entry>QP value</entry>
> + </row>
> + <row>
> + <entry>Bit 16:32</entry>
> + <entry>Layer number</entry>
> + </row>
> + </tbody>
> + </entrytbl>
> + </row>
> +
> </tbody>
> </tgroup>
> </table>
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index f400035..a7518cb 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -384,6 +384,25 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> "Extended SAR",
> NULL,
> };
> + static const char * const h264_fp_arrangement_type[] = {
> + "Checkerboard",
> + "Column",
> + "Row",
> + "Side by side",
"Side by Side"
> + "Top Bottom",
> + "Temporal",
> + NULL,
> + };
> + static const char * const h264_fmo_map_type[] = {
> + "Interleaved Slices",
> + "Scattered Slices",
> + "Foreground With Leftover",
With -> with
I can't help the weird capitalization rules in English w.r.t. titles :-)
> + "Box Out",
> + "Raster Scan",
> + "Wipe Scan",
> + "Explicit",
> + NULL,
> + };
> static const char * const mpeg_mpeg4_level[] = {
> "0",
> "0b",
> @@ -508,6 +527,10 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
> return h264_profile;
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
> return vui_sar_idc;
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
> + return h264_fp_arrangement_type;
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
> + return h264_fmo_map_type;
> case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
> return mpeg_mpeg4_level;
> case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
> @@ -643,6 +666,22 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH: return "Horizontal Size of SAR";
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE: return "Aspect Ratio VUI Enable";
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC: return "VUI Aspect Ratio IDC";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING: return "H264 Enable Frame Packing SEI";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0: return "H264 Set Current Frame as Frame0";
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE: return "H264 Frame Packing Arrangement Type";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO: return "H264 Flexible Macroblock Ordering";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE: return "H264 Map Type for FMO";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP: return "H264 FMO Number of Slice Groups";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION: return "H264 FMO Direction of the Slice Group Change";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE: return "H264 FMO Size of the First Slice Group";
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH: return "H264 FMO Number of Consecutive MBs";
> + case V4L2_CID_MPEG_VIDEO_H264_ASO: return "H264 Arbitrary Slice Ordering";
> + case V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER: return "H264 ASO Slice Order";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING: return "Enable H264 Hierarchial Coding";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE: return "H264 Hierarchial Coding Type";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of Hierarchial Coding Layers";
> + case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP:
> + return "H264 Set QP Value for Hierarchial Coding Layers";
Note that the string can only be 32 chars long (including the terminating zero),
so quite a few of these strings are too long. The control framework will just
cut off the string.
> case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value";
> case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value";
> @@ -657,6 +696,7 @@ const char *v4l2_ctrl_get_name(u32 id)
> case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size";
> case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS";
> case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count";
> + case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Buffer Control";
>
> /* CAMERA controls */
> /* Keep the order of the 'case's the same as in videodev2.h! */
> @@ -853,6 +893,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
> case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
> case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC:
> + case V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE:
> + case V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE:
> case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
> case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
> case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
> index 421d24c..86e79af 100644
> --- a/include/linux/v4l2-controls.h
> +++ b/include/linux/v4l2-controls.h
> @@ -349,6 +349,7 @@ enum v4l2_mpeg_video_multi_slice_mode {
> #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
> #define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
> #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
> +#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
>
> #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
> #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
> @@ -439,6 +440,46 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {
> V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
> V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
> };
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
> +#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
> +enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD = 0,
Typo: CHEKER -> CHECKER
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
> + V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
> +enum v4l2_mpeg_video_h264_fmo_map_type {
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
> + V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
> +enum v4l2_mpeg_video_h264_fmo_change_dir {
> + V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
> + V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
> +#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
> +#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
> +#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
> +enum v4l2_mpeg_video_h264_hierarchical_coding_type {
> + V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
> + V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
> +};
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
> +#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
> #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
>
Regards,
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-02 5:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 5:59 [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features Arun Kumar K
-- strict thread matches above, loose matches on Subject: below --
2012-10-01 22:04 [PATCH v8 0/6] Update MFC v4l2 driver to support MFC6.x Arun Kumar K
2012-10-01 22:04 ` [PATCH v8 2/6] [media] v4l: Add control definitions for new H264 encoder features Arun Kumar K
2012-10-01 14:27 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox