1 /*
2 * H.266 / VVC shared code
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef AVCODEC_VVC_H
22 #define AVCODEC_VVC_H
23
24 /**
25 * Table 5 – NAL unit type codes and NAL unit type classes
26 * in T-REC-H.266-202008
27 */
61 };
62
67 };
68
73 };
74
75 enum {
76 //6.2 we can have 3 sample arrays
78
79 //7.4.3.3 vps_max_layers_minus1 is u(6)
81
82 //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive
84
85 //7.3.2.1 dci_num_ptls_minus1 is u(4)
87
88 //7.4.3.3 vps_num_ptls_minus1 is u(8)
90
91 //7.4.3.3 vps_num_output_layer_sets_minus2 is u(8)
93
94 // 7.3.2.3: vps_video_parameter_set_id is u(4).
96 // 7.3.2.4: sps_seq_parameter_set_id is u(4)
98 // 7.3.2.5: pps_pic_parameter_set_id is u(6)
100
101 // 7.4.4.1: ptl_num_sub_profiles is u(8)
103
104 // 7.4.3.18: The variable NumAlfFilters specifying the number of different adaptive loop
105 // filters is set equal to 25.
107
108 // A.4.2: according to (1577), MaxDpbSize is bounded above by 2 * maxDpbPicBuf(8)
110
111 //7.4.3.4 sps_num_ref_pic_lists in range [0, 64]
113
114 //7.4.11 num_ref_entries in range [0, MaxDpbSize + 13]
116
117 //7.4.3.3 sps_num_points_in_qp_table_minus1[i] in range [0, 36 − sps_qp_table_start_minus26[i]],
118 //and sps_qp_table_start_minus26[i] in range [−26 − QpBdOffset, 36].
119 //so sps_num_points_in_qp_table_minus1[i] should in range [0, 62 + QpBdOffset]
120 //since 16 bits QpBdOffset is 48, sps_num_points_in_qp_table_minus1[i] should range [0, 110]
122
123 // 7.4.6.1: hrd_cpb_cnt_minus1 is in [0, 31].
125
126 // A.4.1: the highest level allows a MaxLumaPs of 80,216,064.
128
129 // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are
130 // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/
131 // width are bounded above by sqrt(8 * 80216064) = 25332.4 samples.
134
135 // A.4.1: table A.2 allows at most 990 tiles per AU for any level.
137 // A.4.1: table A.2 did not define max tile rows.
138 // in worest a case, we can have 1x990 tiles picture.
140 // A.4.1: table A.2 allows at most 30 tile columns for any level.
142
143 // A.4.1 table A.2 allows at most 1000 slices for any level.
145
146 // 7.4.8: in the worst case (!pps_no_pic_partition_flag and
147 // sps_entropy_coding_sync_enabled_flag are both true), entry points can be
148 // placed at the beginning of every Ctb row in every tile, giving an
149 // upper bound of (num_tile_columns_minus1 + 1) * PicHeightInCtbsY - 1.
150 // Only a stream with very high resolution and perverse parameters could
151 // get near that, though, so set a lower limit here with the maximum
152 // possible value for 8K video (at most 135 32x32 Ctb rows).
154
155 // {sps, ph}_num_{ver, hor}_virtual_boundaries should in [0, 3]
157
158 // 8.4.5.3 Decoding process for palette mode - maxNumPalettePredictorSize
160 };
161
162 #endif /* AVCODEC_VVC_H */