v4l2-h264.h (8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17) v4l2-h264.h (2e2c3d6c0ef88ffac0d6b5079ee88cf8408f5f3b)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Helper functions for H264 codecs.
4 *
5 * Copyright (c) 2019 Collabora, Ltd.
6 *
7 * Author: Boris Brezillon <boris.brezillon@collabora.com>
8 */

--- 23 unchanged lines hidden (view full) ---

32struct v4l2_h264_reflist_builder {
33 struct {
34 s32 pic_order_count;
35 int frame_num;
36 u32 pic_num;
37 u16 longterm : 1;
38 } refs[V4L2_H264_NUM_DPB_ENTRIES];
39 s32 cur_pic_order_count;
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Helper functions for H264 codecs.
4 *
5 * Copyright (c) 2019 Collabora, Ltd.
6 *
7 * Author: Boris Brezillon <boris.brezillon@collabora.com>
8 */

--- 23 unchanged lines hidden (view full) ---

32struct v4l2_h264_reflist_builder {
33 struct {
34 s32 pic_order_count;
35 int frame_num;
36 u32 pic_num;
37 u16 longterm : 1;
38 } refs[V4L2_H264_NUM_DPB_ENTRIES];
39 s32 cur_pic_order_count;
40 u8 unordered_reflist[V4L2_H264_NUM_DPB_ENTRIES];
40 struct v4l2_h264_reference unordered_reflist[V4L2_H264_NUM_DPB_ENTRIES];
41 u8 num_valid;
42};
43
44void
45v4l2_h264_init_reflist_builder(struct v4l2_h264_reflist_builder *b,
46 const struct v4l2_ctrl_h264_decode_params *dec_params,
47 const struct v4l2_ctrl_h264_sps *sps,
48 const struct v4l2_h264_dpb_entry dpb[V4L2_H264_NUM_DPB_ENTRIES]);
49
50/**
51 * v4l2_h264_build_b_ref_lists() - Build the B0/B1 reference lists
52 *
53 * @builder: reference list builder context
41 u8 num_valid;
42};
43
44void
45v4l2_h264_init_reflist_builder(struct v4l2_h264_reflist_builder *b,
46 const struct v4l2_ctrl_h264_decode_params *dec_params,
47 const struct v4l2_ctrl_h264_sps *sps,
48 const struct v4l2_h264_dpb_entry dpb[V4L2_H264_NUM_DPB_ENTRIES]);
49
50/**
51 * v4l2_h264_build_b_ref_lists() - Build the B0/B1 reference lists
52 *
53 * @builder: reference list builder context
54 * @b0_reflist: 16-bytes array used to store the B0 reference list. Each entry
55 * is an index in the DPB
56 * @b1_reflist: 16-bytes array used to store the B1 reference list. Each entry
57 * is an index in the DPB
54 * @b0_reflist: 16 sized array used to store the B0 reference list. Each entry
55 * is a v4l2_h264_reference structure
56 * @b1_reflist: 16 sized array used to store the B1 reference list. Each entry
57 * is a v4l2_h264_reference structure
58 *
59 * This functions builds the B0/B1 reference lists. This procedure is described
60 * in section '8.2.4 Decoding process for reference picture lists construction'
61 * of the H264 spec. This function can be used by H264 decoder drivers that
62 * need to pass B0/B1 reference lists to the hardware.
63 */
64void
65v4l2_h264_build_b_ref_lists(const struct v4l2_h264_reflist_builder *builder,
58 *
59 * This functions builds the B0/B1 reference lists. This procedure is described
60 * in section '8.2.4 Decoding process for reference picture lists construction'
61 * of the H264 spec. This function can be used by H264 decoder drivers that
62 * need to pass B0/B1 reference lists to the hardware.
63 */
64void
65v4l2_h264_build_b_ref_lists(const struct v4l2_h264_reflist_builder *builder,
66 u8 *b0_reflist, u8 *b1_reflist);
66 struct v4l2_h264_reference *b0_reflist,
67 struct v4l2_h264_reference *b1_reflist);
67
68/**
69 * v4l2_h264_build_p_ref_list() - Build the P reference list
70 *
71 * @builder: reference list builder context
68
69/**
70 * v4l2_h264_build_p_ref_list() - Build the P reference list
71 *
72 * @builder: reference list builder context
72 * @reflist: 16-bytes array used to store the P reference list. Each entry
73 * is an index in the DPB
73 * @reflist: 16 sized array used to store the P reference list. Each entry
74 * is a v4l2_h264_reference structure
74 *
75 * This functions builds the P reference lists. This procedure is describe in
76 * section '8.2.4 Decoding process for reference picture lists construction'
77 * of the H264 spec. This function can be used by H264 decoder drivers that
78 * need to pass a P reference list to the hardware.
79 */
80void
81v4l2_h264_build_p_ref_list(const struct v4l2_h264_reflist_builder *builder,
75 *
76 * This functions builds the P reference lists. This procedure is describe in
77 * section '8.2.4 Decoding process for reference picture lists construction'
78 * of the H264 spec. This function can be used by H264 decoder drivers that
79 * need to pass a P reference list to the hardware.
80 */
81void
82v4l2_h264_build_p_ref_list(const struct v4l2_h264_reflist_builder *builder,
82 u8 *reflist);
83 struct v4l2_h264_reference *reflist);
83
84#endif /* _MEDIA_V4L2_H264_H */
84
85#endif /* _MEDIA_V4L2_H264_H */