media: h264: Increase reference lists size to 32
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 13 May 2022 20:29:04 +0000 (22:29 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 17 May 2022 07:59:17 +0000 (09:59 +0200)
This is to accommodate support for field decoding, which splits the top
and the bottom references into the reference list.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-h264.c
drivers/staging/media/hantro/hantro_hw.h
drivers/staging/media/rkvdec/rkvdec-h264.c
include/media/v4l2-h264.h

index afbfcf78efe4dde57d7eeb6e798d288bd43e0dbe..4b46b36526c0d691588ca9d616e12ca62b905587 100644 (file)
@@ -212,7 +212,7 @@ static int v4l2_h264_b1_ref_list_cmp(const void *ptra, const void *ptrb,
  * v4l2_h264_build_p_ref_list() - Build the P reference list
  *
  * @builder: reference list builder context
- * @reflist: 16 sized array used to store the P reference list. Each entry
+ * @reflist: 32 sized array used to store the P reference list. Each entry
  *          is a v4l2_h264_reference structure
  *
  * This functions builds the P reference lists. This procedure is describe in
@@ -235,9 +235,9 @@ EXPORT_SYMBOL_GPL(v4l2_h264_build_p_ref_list);
  * v4l2_h264_build_b_ref_lists() - Build the B0/B1 reference lists
  *
  * @builder: reference list builder context
- * @b0_reflist: 16 sized array used to store the B0 reference list. Each entry
+ * @b0_reflist: 32 sized array used to store the B0 reference list. Each entry
  *             is a v4l2_h264_reference structure
- * @b1_reflist: 16 sized array used to store the B1 reference list. Each entry
+ * @b1_reflist: 32 sized array used to store the B1 reference list. Each entry
  *             is a v4l2_h264_reference structure
  *
  * This functions builds the B0/B1 reference lists. This procedure is described
index 3608e463290e73867d1b7f691dca2886ee0dcf8d..0b5b9da86c439138d4d2c3b5ba6670e9d2fd89be 100644 (file)
@@ -69,9 +69,9 @@ struct hantro_h264_dec_ctrls {
  * @b1:                B1 reflist
  */
 struct hantro_h264_dec_reflists {
-       struct v4l2_h264_reference p[HANTRO_H264_DPB_SIZE];
-       struct v4l2_h264_reference b0[HANTRO_H264_DPB_SIZE];
-       struct v4l2_h264_reference b1[HANTRO_H264_DPB_SIZE];
+       struct v4l2_h264_reference p[V4L2_H264_REF_LIST_LEN];
+       struct v4l2_h264_reference b0[V4L2_H264_REF_LIST_LEN];
+       struct v4l2_h264_reference b1[V4L2_H264_REF_LIST_LEN];
 };
 
 /**
index 3c7f3d87fab44a650a5874fe7e32c09e205a0c42..dff89732ddd033a25d46bcead13ec87e312a86b6 100644 (file)
@@ -100,9 +100,9 @@ struct rkvdec_h264_priv_tbl {
 #define RKVDEC_H264_DPB_SIZE 16
 
 struct rkvdec_h264_reflists {
-       struct v4l2_h264_reference p[RKVDEC_H264_DPB_SIZE];
-       struct v4l2_h264_reference b0[RKVDEC_H264_DPB_SIZE];
-       struct v4l2_h264_reference b1[RKVDEC_H264_DPB_SIZE];
+       struct v4l2_h264_reference p[V4L2_H264_REF_LIST_LEN];
+       struct v4l2_h264_reference b0[V4L2_H264_REF_LIST_LEN];
+       struct v4l2_h264_reference b1[V4L2_H264_REF_LIST_LEN];
        u8 num_valid;
 };
 
index ef9a894e3c32172248fc01dbbb62e2b43c744fd3..e282fb16ac58df07291663971857f65d8a1561bb 100644 (file)
@@ -37,7 +37,7 @@ struct v4l2_h264_reflist_builder {
                u16 longterm : 1;
        } refs[V4L2_H264_NUM_DPB_ENTRIES];
        s32 cur_pic_order_count;
-       struct v4l2_h264_reference unordered_reflist[V4L2_H264_NUM_DPB_ENTRIES];
+       struct v4l2_h264_reference unordered_reflist[V4L2_H264_REF_LIST_LEN];
        u8 num_valid;
 };
 
@@ -51,9 +51,9 @@ v4l2_h264_init_reflist_builder(struct v4l2_h264_reflist_builder *b,
  * v4l2_h264_build_b_ref_lists() - Build the B0/B1 reference lists
  *
  * @builder: reference list builder context
- * @b0_reflist: 16 sized array used to store the B0 reference list. Each entry
+ * @b0_reflist: 32 sized array used to store the B0 reference list. Each entry
  *             is a v4l2_h264_reference structure
- * @b1_reflist: 16 sized array used to store the B1 reference list. Each entry
+ * @b1_reflist: 32 sized array used to store the B1 reference list. Each entry
  *             is a v4l2_h264_reference structure
  *
  * This functions builds the B0/B1 reference lists. This procedure is described
@@ -70,7 +70,7 @@ v4l2_h264_build_b_ref_lists(const struct v4l2_h264_reflist_builder *builder,
  * v4l2_h264_build_p_ref_list() - Build the P reference list
  *
  * @builder: reference list builder context
- * @reflist: 16 sized array used to store the P reference list. Each entry
+ * @reflist: 32 sized array used to store the P reference list. Each entry
  *          is a v4l2_h264_reference structure
  *
  * This functions builds the P reference lists. This procedure is describe in