avformat/mpeg: demux ivtv captions
[ffmpeg.git] / libavcodec / evc.h
blobd68dc74997312ae208f3116ec8250a455d9f2a8d
1 /*
2 * EVC definitions and enums
3 * Copyright (c) 2022 Dawid Kozinski <d.kozinski@samsung.com>
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef AVCODEC_EVC_H
23 #define AVCODEC_EVC_H
25 // The length field that indicates the length in bytes of the following NAL unit is configured to be of 4 bytes
26 #define EVC_NALU_LENGTH_PREFIX_SIZE (4) /* byte */
27 #define EVC_NALU_HEADER_SIZE (2) /* byte */
29 /**
30 * @see ISO_IEC_23094-1_2020, 7.4.2.2 NAL unit header semantic
31 * Table 4 - NAL unit type codes and NAL unit type classes
33 enum EVCNALUnitType {
34 EVC_NOIDR_NUT = 0, /* Coded slice of a non-IDR picture */
35 EVC_IDR_NUT = 1, /* Coded slice of an IDR picture */
36 EVC_RSV_VCL_NUT02 = 2,
37 EVC_RSV_VCL_NUT03 = 3,
38 EVC_RSV_VCL_NUT04 = 4,
39 EVC_RSV_VCL_NUT05 = 5,
40 EVC_RSV_VCL_NUT06 = 6,
41 EVC_RSV_VCL_NUT07 = 7,
42 EVC_RSV_VCL_NUT08 = 8,
43 EVC_RSV_VCL_NUT09 = 9,
44 EVC_RSV_VCL_NUT10 = 10,
45 EVC_RSV_VCL_NUT11 = 11,
46 EVC_RSV_VCL_NUT12 = 12,
47 EVC_RSV_VCL_NUT13 = 13,
48 EVC_RSV_VCL_NUT14 = 14,
49 EVC_RSV_VCL_NUT15 = 15,
50 EVC_RSV_VCL_NUT16 = 16,
51 EVC_RSV_VCL_NUT17 = 17,
52 EVC_RSV_VCL_NUT18 = 18,
53 EVC_RSV_VCL_NUT19 = 19,
54 EVC_RSV_VCL_NUT20 = 20,
55 EVC_RSV_VCL_NUT21 = 21,
56 EVC_RSV_VCL_NUT22 = 22,
57 EVC_RSV_VCL_NUT23 = 23,
58 EVC_SPS_NUT = 24, /* Sequence parameter set */
59 EVC_PPS_NUT = 25, /* Picture paremeter set */
60 EVC_APS_NUT = 26, /* Adaptation parameter set */
61 EVC_FD_NUT = 27, /* Filler data */
62 EVC_SEI_NUT = 28, /* Supplemental enhancement information */
63 EVC_RSV_NONVCL29 = 29,
64 EVC_RSV_NONVCL30 = 30,
65 EVC_RSV_NONVCL31 = 31,
66 EVC_RSV_NONVCL32 = 32,
67 EVC_RSV_NONVCL33 = 33,
68 EVC_RSV_NONVCL34 = 34,
69 EVC_RSV_NONVCL35 = 35,
70 EVC_RSV_NONVCL36 = 36,
71 EVC_RSV_NONVCL37 = 37,
72 EVC_RSV_NONVCL38 = 38,
73 EVC_RSV_NONVCL39 = 39,
74 EVC_RSV_NONVCL40 = 40,
75 EVC_RSV_NONVCL41 = 41,
76 EVC_RSV_NONVCL42 = 42,
77 EVC_RSV_NONVCL43 = 43,
78 EVC_RSV_NONVCL44 = 44,
79 EVC_RSV_NONVCL45 = 45,
80 EVC_RSV_NONVCL46 = 46,
81 EVC_RSV_NONVCL47 = 47,
82 EVC_RSV_NONVCL48 = 48,
83 EVC_RSV_NONVCL49 = 49,
84 EVC_RSV_NONVCL50 = 50,
85 EVC_RSV_NONVCL51 = 51,
86 EVC_RSV_NONVCL52 = 52,
87 EVC_RSV_NONVCL53 = 53,
88 EVC_RSV_NONVCL54 = 54,
89 EVC_RSV_NONVCL55 = 55,
90 EVC_UNSPEC_NUT56 = 56,
91 EVC_UNSPEC_NUT57 = 57,
92 EVC_UNSPEC_NUT58 = 58,
93 EVC_UNSPEC_NUT59 = 59,
94 EVC_UNSPEC_NUT60 = 60,
95 EVC_UNSPEC_NUT61 = 61,
96 EVC_UNSPEC_NUT62 = 62
99 // slice type
100 // @see ISO_IEC_23094-1_2020 7.4.5 Slice header semantics
102 enum EVCSliceType {
103 EVC_SLICE_TYPE_B = 0,
104 EVC_SLICE_TYPE_P = 1,
105 EVC_SLICE_TYPE_I = 2
108 enum {
109 // 7.4.3.1: sps_seq_parameter_set_id is in [0, 15].
110 EVC_MAX_SPS_COUNT = 16,
112 // 7.4.3.2: pps_pic_parameter_set_id is in [0, 63].
113 EVC_MAX_PPS_COUNT = 64,
115 // 7.4.3.3: adaptional_parameter_set_id is in [0, 31].
116 EVC_MAX_APS_COUNT = 32,
118 // 7.4.5: slice header slice_pic_parameter_set_id in [0, 63]
119 EVC_MAX_SH_COUNT = 64,
121 // E.3.2: cpb_cnt_minus1[i] is in [0, 31].
122 EVC_MAX_CPB_CNT = 32,
124 // A.4.1: in table A.1 the highest level allows a MaxLumaPs of 35 651 584.
125 EVC_MAX_LUMA_PS = 35651584,
127 EVC_MAX_NUM_REF_PICS = 21,
129 EVC_MAX_NUM_RPLS = 64,
131 // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are
132 // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/
133 // width are bounded above by sqrt(8 * 35651584) = 16888.2 samples.
134 EVC_MAX_WIDTH = 16888,
135 EVC_MAX_HEIGHT = 16888,
137 // A.4.1: table A.1 allows at most 22 tile rows for any level.
138 EVC_MAX_TILE_ROWS = 22,
139 // A.4.1: table A.1 allows at most 20 tile columns for any level.
140 EVC_MAX_TILE_COLUMNS = 20,
142 // A.4.1: table A.1 allows at most 600 slice segments for any level.
143 EVC_MAX_SLICE_SEGMENTS = 600,
146 #endif // AVCODEC_EVC_H