Browse Source

include: Update controls to latest patch series

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Paul Kocialkowski 6 years ago
parent
commit
24c6b3ffaa
7 changed files with 416 additions and 405 deletions
  1. 127 127
      data/bbb-h264-32/frames.h
  2. 124 124
      data/bbb-h264-all-i-32/frames.h
  3. 128 128
      data/bbb-h264-high-32/frames.h
  4. 23 16
      include/h264-ctrls.h
  5. 10 6
      include/hevc-ctrls.h
  6. 2 2
      v4l2-request-test.h
  7. 2 2
      v4l2.c

File diff suppressed because it is too large
+ 127 - 127
data/bbb-h264-32/frames.h


File diff suppressed because it is too large
+ 124 - 124
data/bbb-h264-all-i-32/frames.h


File diff suppressed because it is too large
+ 128 - 128
data/bbb-h264-high-32/frames.h


+ 23 - 16
include/h264-ctrls.h

@@ -11,6 +11,11 @@
 #ifndef _H264_CTRLS_H_
 #define _H264_CTRLS_H_
 
+#include <linux/videodev2.h>
+
+/* Our pixel format isn't stable at the moment */
+#define V4L2_PIX_FMT_H264_SLICE_RAW v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
+
 /*
  * This is put insanely high to avoid conflicting with controls that
  * would be added during the phase where those controls are not
@@ -23,11 +28,11 @@
 #define V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS	(V4L2_CID_MPEG_BASE+1004)
 
 /* enum v4l2_ctrl_type type values */
-#define V4L2_CTRL_TYPE_H264_SPS 0x0105
-#define	V4L2_CTRL_TYPE_H264_PPS 0x0106
-#define	V4L2_CTRL_TYPE_H264_SCALING_MATRIX 0x0107
-#define	V4L2_CTRL_TYPE_H264_SLICE_PARAMS 0x0108
-#define	V4L2_CTRL_TYPE_H264_DECODE_PARAMS 0x0109
+#define V4L2_CTRL_TYPE_H264_SPS			0x0110
+#define V4L2_CTRL_TYPE_H264_PPS			0x0111
+#define V4L2_CTRL_TYPE_H264_SCALING_MATRIX	0x0112
+#define V4L2_CTRL_TYPE_H264_SLICE_PARAMS	0x0113
+#define V4L2_CTRL_TYPE_H264_DECODE_PARAMS	0x0114
 
 #define V4L2_H264_SPS_CONSTRAINT_SET0_FLAG			0x01
 #define V4L2_H264_SPS_CONSTRAINT_SET1_FLAG			0x02
@@ -94,10 +99,10 @@ struct v4l2_ctrl_h264_scaling_matrix {
 };
 
 struct v4l2_h264_weight_factors {
-	__s8 luma_weight[32];
-	__s8 luma_offset[32];
-	__s8 chroma_weight[32][2];
-	__s8 chroma_offset[32][2];
+	__s16 luma_weight[32];
+	__s16 luma_offset[32];
+	__s16 chroma_weight[32][2];
+	__s16 chroma_offset[32][2];
 };
 
 struct v4l2_h264_pred_weight_table {
@@ -117,7 +122,7 @@ struct v4l2_h264_pred_weight_table {
 #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED	0x04
 #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH		0x08
 
-struct v4l2_ctrl_h264_slice_param {
+struct v4l2_ctrl_h264_slice_params {
 	/* Size in bytes, including header */
 	__u32 size;
 	/* Offset in bits to slice_data() from the beginning of this slice. */
@@ -153,7 +158,7 @@ struct v4l2_ctrl_h264_slice_param {
 
 	/*
 	 * Entries on each list are indices into
-	 * v4l2_ctrl_h264_decode_param.dpb[].
+	 * v4l2_ctrl_h264_decode_params.dpb[].
 	 */
 	__u8 ref_pic_list0[32];
 	__u8 ref_pic_list1[32];
@@ -166,7 +171,7 @@ struct v4l2_ctrl_h264_slice_param {
 #define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM	0x04
 
 struct v4l2_h264_dpb_entry {
-	__u64 timestamp;
+	__u64 reference_ts;
 	__u16 frame_num;
 	__u16 pic_num;
 	/* Note that field is indicated by v4l2_buffer.field */
@@ -175,16 +180,18 @@ struct v4l2_h264_dpb_entry {
 	__u32 flags; /* V4L2_H264_DPB_ENTRY_FLAG_* */
 };
 
-struct v4l2_ctrl_h264_decode_param {
-	__u32 num_slices;
-	__u16 idr_pic_flag;
+#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC	0x01
+
+struct v4l2_ctrl_h264_decode_params {
+	struct v4l2_h264_dpb_entry dpb[16];
+	__u16 num_slices;
 	__u16 nal_ref_idc;
 	__u8 ref_pic_list_p0[32];
 	__u8 ref_pic_list_b0[32];
 	__u8 ref_pic_list_b1[32];
 	__s32 top_field_order_cnt;
 	__s32 bottom_field_order_cnt;
-	struct v4l2_h264_dpb_entry dpb[16];
+	__u32 flags; /* V4L2_H264_DECODE_PARAM_FLAG_* */
 };
 
 #endif

+ 10 - 6
include/hevc-ctrls.h

@@ -11,19 +11,23 @@
 #ifndef _HEVC_CTRLS_H_
 #define _HEVC_CTRLS_H_
 
-#define V4L2_CID_MPEG_VIDEO_HEVC_SPS		(V4L2_CID_MPEG_BASE + 645)
-#define V4L2_CID_MPEG_VIDEO_HEVC_PPS		(V4L2_CID_MPEG_BASE + 646)
-#define V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS	(V4L2_CID_MPEG_BASE + 647)
+/* The pixel format isn't stable at the moment and will likely be renamed. */
+#define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
+
+#define V4L2_CID_MPEG_VIDEO_HEVC_SPS		(V4L2_CID_MPEG_BASE + 1008)
+#define V4L2_CID_MPEG_VIDEO_HEVC_PPS		(V4L2_CID_MPEG_BASE + 1009)
+#define V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS	(V4L2_CID_MPEG_BASE + 1010)
 
 /* enum v4l2_ctrl_type type values */
-#define V4L2_CTRL_TYPE_HEVC_SPS 0x0110
-#define V4L2_CTRL_TYPE_HEVC_PPS 0x0111
-#define V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS 0x0112
+#define V4L2_CTRL_TYPE_HEVC_SPS 0x0120
+#define V4L2_CTRL_TYPE_HEVC_PPS 0x0121
+#define V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS 0x0122
 
 #define V4L2_HEVC_SLICE_TYPE_B	0
 #define V4L2_HEVC_SLICE_TYPE_P	1
 #define V4L2_HEVC_SLICE_TYPE_I	2
 
+/* The controls are not stable at the moment and will likely be reworked. */
 struct v4l2_ctrl_hevc_sps {
 	/* ISO/IEC 23008-2, ITU-T Rec. H.265: Sequence parameter set */
 	__u8	chroma_format_idc;

+ 2 - 2
v4l2-request-test.h

@@ -86,11 +86,11 @@ union controls {
 	} mpeg2;
 #ifdef V4L2_PIX_FMT_H264_SLICE
 	struct {
-		struct v4l2_ctrl_h264_decode_param decode_param;
+		struct v4l2_ctrl_h264_decode_params decode_params;
 		struct v4l2_ctrl_h264_pps pps;
 		struct v4l2_h264_pred_weight_table pred_weight;
 		struct v4l2_ctrl_h264_scaling_matrix scaling_matrix;
-		struct v4l2_ctrl_h264_slice_param slice_param;
+		struct v4l2_ctrl_h264_slice_params slice_params;
 		struct v4l2_ctrl_h264_sps sps;
 	} h264;
 #endif

+ 2 - 2
v4l2.c

@@ -498,7 +498,7 @@ static int set_format_controls(int video_fd, int request_fd,
 #ifdef V4L2_PIX_FMT_H264_SLICE
 		{ CODEC_TYPE_H264, "decode parameters",
 		  V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS,
-		  &frame->h264.decode_param, sizeof(frame->h264.decode_param) },
+		  &frame->h264.decode_params, sizeof(frame->h264.decode_params) },
 		{ CODEC_TYPE_H264, "picture parameter set",
 		  V4L2_CID_MPEG_VIDEO_H264_PPS, &frame->h264.pps,
 		  sizeof(frame->h264.pps) },
@@ -511,7 +511,7 @@ static int set_format_controls(int video_fd, int request_fd,
 		  sizeof(frame->h264.scaling_matrix) },
 		{ CODEC_TYPE_H264, "scaling matrix",
 		  V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS,
-		  &frame->h264.slice_param, sizeof(frame->h264.slice_param) },
+		  &frame->h264.slice_params, sizeof(frame->h264.slice_params) },
 #endif
 #ifdef V4L2_PIX_FMT_HEVC_SLICE
 		{ CODEC_TYPE_H265, "sequence parameter set",

Some files were not shown because too many files changed in this diff