aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/media/h264-ctrls.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-04-04 00:13:41 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-21 13:46:40 +0200
commit624922a2739b96b83aaf1655d0519b41d30140f7 (patch)
tree20159722c44c060221f94cc179adbd828dc0170a /include/media/h264-ctrls.h
parentmedia: rkisp1: Fix wrong PHY config dependency (diff)
downloadwireguard-linux-624922a2739b96b83aaf1655d0519b41d30140f7.tar.xz
wireguard-linux-624922a2739b96b83aaf1655d0519b41d30140f7.zip
media: v4l2-core: Add helpers to build the H264 P/B0/B1 reflists
Building those list is a standard procedure described in section '8.2.4 Decoding process for reference picture lists construction' of the H264 specification. We already have 2 drivers needing the same logic (hantro and rkvdec) and I suspect we will soon have more. Let's provide generic helpers to create those lists. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'include/media/h264-ctrls.h')
-rw-r--r--include/media/h264-ctrls.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h
index 1c6ff7d63bca..080fd1293c42 100644
--- a/include/media/h264-ctrls.h
+++ b/include/media/h264-ctrls.h
@@ -13,6 +13,12 @@
#include <linux/videodev2.h>
+/*
+ * Maximum DPB size, as specified by section 'A.3.1 Level limits
+ * common to the Baseline, Main, and Extended profiles'.
+ */
+#define V4L2_H264_NUM_DPB_ENTRIES 16
+
/* Our pixel format isn't stable at the moment */
#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
@@ -201,7 +207,7 @@ struct v4l2_h264_dpb_entry {
#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
struct v4l2_ctrl_h264_decode_params {
- struct v4l2_h264_dpb_entry dpb[16];
+ struct v4l2_h264_dpb_entry dpb[V4L2_H264_NUM_DPB_ENTRIES];
__u16 num_slices;
__u16 nal_ref_idc;
__s32 top_field_order_cnt;