FFmpeg  4.0
cbs_mpeg2.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_CBS_MPEG2_H
20 #define AVCODEC_CBS_MPEG2_H
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #include "libavutil/buffer.h"
26 
27 
28 enum {
38 };
39 
40 #define MPEG2_START_IS_SLICE(type) \
41  ((type) >= MPEG2_START_SLICE_MIN && \
42  (type) <= MPEG2_START_SLICE_MAX)
43 
44 enum {
56 };
57 
58 
59 typedef struct MPEG2RawSequenceHeader {
61 
66  uint32_t bit_rate_value;
69 
75 
76 typedef struct MPEG2RawUserData {
78 
83 
84 typedef struct MPEG2RawSequenceExtension {
96 
99 
104 
108 
111 
112  uint32_t time_code;
116 
117 typedef struct MPEG2RawPictureHeader {
119 
122  uint16_t vbv_delay;
123 
128 
131 
133  uint8_t f_code[2][2];
134 
146 
154 
161  uint8_t chroma_intra_quantiser_matrix[64];
163  uint8_t chroma_non_intra_quantiser_matrix[64];
165 
167  uint16_t frame_centre_horizontal_offset[3];
168  uint16_t frame_centre_vertical_offset[3];
170 
171 typedef struct MPEG2RawExtensionData {
174 
175  union {
181  } data;
183 
184 typedef struct MPEG2RawSliceHeader {
186 
189 
191 
196 
198 
203 
204 typedef struct MPEG2RawSlice {
206 
208  size_t data_size;
211 } MPEG2RawSlice;
212 
213 
215  // Elements stored in headers which are required for other decoding.
216  uint16_t horizontal_size;
217  uint16_t vertical_size;
222 
223  // Write buffer.
227 
228 
229 #endif /* AVCODEC_CBS_MPEG2_H */
uint8_t full_pel_backward_vector
Definition: cbs_mpeg2.h:126
MPEG2RawPictureDisplayExtension picture_display
Definition: cbs_mpeg2.h:180
uint8_t load_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:72
uint8_t picture_start_code
Definition: cbs_mpeg2.h:118
uint8_t extension_start_code_identifier
Definition: cbs_mpeg2.h:173
uint8_t number_of_frame_centre_offsets
Definition: cbs_mpeg2.h:221
uint8_t * data
Definition: cbs_mpeg2.h:207
MPEG2RawSequenceExtension sequence
Definition: cbs_mpeg2.h:176
uint16_t vertical_size_value
Definition: cbs_mpeg2.h:63
uint8_t
uint8_t load_intra_quantiser_matrix
Definition: cbs_mpeg2.h:70
AVBufferRef * extra_information_ref
Definition: cbs_mpeg2.h:201
uint8_t priority_breakpoint
Definition: cbs_mpeg2.h:188
const char data[16]
Definition: mxf.c:90
MPEG2RawQuantMatrixExtension quant_matrix
Definition: cbs_mpeg2.h:178
uint8_t slice_vertical_position
Definition: cbs_mpeg2.h:185
size_t extra_information_length
Definition: cbs_mpeg2.h:199
uint8_t non_intra_quantiser_matrix[64]
Definition: cbs_mpeg2.h:73
uint8_t constrained_parameters_flag
Definition: cbs_mpeg2.h:68
MPEG2RawPictureCodingExtension picture_coding
Definition: cbs_mpeg2.h:179
uint8_t quantiser_scale_code
Definition: cbs_mpeg2.h:190
uint8_t slice_vertical_position_extension
Definition: cbs_mpeg2.h:187
uint8_t intra_quantiser_matrix[64]
Definition: cbs_mpeg2.h:71
AVBufferRef * user_data_ref
Definition: cbs_mpeg2.h:81
uint8_t * extra_information
Definition: cbs_mpeg2.h:200
uint8_t load_chroma_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:162
uint8_t extra_bit_slice
Definition: cbs_mpeg2.h:197
uint8_t load_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:158
uint8_t horizontal_size_extension
Definition: cbs_mpeg2.h:88
uint8_t * user_data
Definition: cbs_mpeg2.h:79
int data_bit_start
Definition: cbs_mpeg2.h:209
uint8_t load_chroma_intra_quantiser_matrix
Definition: cbs_mpeg2.h:160
MPEG2RawSequenceDisplayExtension sequence_display
Definition: cbs_mpeg2.h:177
uint8_t full_pel_forward_vector
Definition: cbs_mpeg2.h:124
uint8_t frame_rate_extension_n
Definition: cbs_mpeg2.h:93
uint8_t vbv_buffer_size_extension
Definition: cbs_mpeg2.h:91
uint8_t sequence_header_code
Definition: cbs_mpeg2.h:60
uint8_t frame_rate_extension_d
Definition: cbs_mpeg2.h:94
uint8_t extension_start_code
Definition: cbs_mpeg2.h:172
uint16_t horizontal_size_value
Definition: cbs_mpeg2.h:62
refcounted data buffer API
size_t user_data_length
Definition: cbs_mpeg2.h:80
uint16_t temporal_reference
Definition: cbs_mpeg2.h:120
uint8_t aspect_ratio_information
Definition: cbs_mpeg2.h:64
uint8_t extra_bit_picture
Definition: cbs_mpeg2.h:129
uint8_t slice_picture_id
Definition: cbs_mpeg2.h:195
uint8_t picture_coding_type
Definition: cbs_mpeg2.h:121
MPEG2RawSliceHeader header
Definition: cbs_mpeg2.h:205
A reference to a data buffer.
Definition: buffer.h:81
uint16_t vbv_buffer_size_value
Definition: cbs_mpeg2.h:67
uint32_t bit_rate_value
Definition: cbs_mpeg2.h:66
uint8_t slice_extension_flag
Definition: cbs_mpeg2.h:192
uint8_t user_data_start_code
Definition: cbs_mpeg2.h:77
uint8_t profile_and_level_indication
Definition: cbs_mpeg2.h:85
uint8_t vertical_size_extension
Definition: cbs_mpeg2.h:89
AVBufferRef * data_ref
Definition: cbs_mpeg2.h:210
size_t data_size
Definition: cbs_mpeg2.h:208
uint8_t slice_picture_id_enable
Definition: cbs_mpeg2.h:194