FFmpeg
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 MPEG2RawExtraInformation {
122 
123 typedef struct MPEG2RawPictureHeader {
125 
128  uint16_t vbv_delay;
129 
134 
137 
139  uint8_t f_code[2][2];
140 
152 
160 
167  uint8_t chroma_intra_quantiser_matrix[64];
169  uint8_t chroma_non_intra_quantiser_matrix[64];
171 
173  int16_t frame_centre_horizontal_offset[3];
174  int16_t frame_centre_vertical_offset[3];
176 
177 typedef struct MPEG2RawExtensionData {
180 
181  union {
187  } data;
189 
190 typedef struct MPEG2RawSliceHeader {
192 
195 
197 
202 
205 
206 typedef struct MPEG2RawSlice {
208 
210  size_t data_size;
213 } MPEG2RawSlice;
214 
215 typedef struct MPEG2RawSequenceEnd {
218 
219 
221  // Elements stored in headers which are required for other decoding.
222  uint16_t horizontal_size;
223  uint16_t vertical_size;
229 
230 
231 #endif /* AVCODEC_CBS_MPEG2_H */
MPEG2RawExtraInformation extra_information_slice
Definition: cbs_mpeg2.h:203
uint8_t full_pel_backward_vector
Definition: cbs_mpeg2.h:132
MPEG2RawPictureDisplayExtension picture_display
Definition: cbs_mpeg2.h:186
uint8_t load_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:72
uint8_t picture_start_code
Definition: cbs_mpeg2.h:124
uint8_t extension_start_code_identifier
Definition: cbs_mpeg2.h:179
uint8_t number_of_frame_centre_offsets
Definition: cbs_mpeg2.h:227
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:100
uint8_t * data
Definition: cbs_mpeg2.h:209
MPEG2RawSequenceExtension sequence
Definition: cbs_mpeg2.h:182
uint8_t sequence_end_code
Definition: cbs_mpeg2.h:216
uint16_t vertical_size_value
Definition: cbs_mpeg2.h:63
uint8_t
uint8_t load_intra_quantiser_matrix
Definition: cbs_mpeg2.h:70
uint8_t priority_breakpoint
Definition: cbs_mpeg2.h:194
MPEG2RawQuantMatrixExtension quant_matrix
Definition: cbs_mpeg2.h:184
uint8_t slice_vertical_position
Definition: cbs_mpeg2.h:191
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:185
uint8_t quantiser_scale_code
Definition: cbs_mpeg2.h:196
uint8_t slice_vertical_position_extension
Definition: cbs_mpeg2.h:193
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:118
uint8_t load_chroma_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:168
uint8_t load_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:164
uint8_t horizontal_size_extension
Definition: cbs_mpeg2.h:88
AVBufferRef * extra_information_ref
Definition: cbs_mpeg2.h:119
uint8_t * user_data
Definition: cbs_mpeg2.h:79
int data_bit_start
Definition: cbs_mpeg2.h:211
uint8_t load_chroma_intra_quantiser_matrix
Definition: cbs_mpeg2.h:166
MPEG2RawSequenceDisplayExtension sequence_display
Definition: cbs_mpeg2.h:183
uint8_t full_pel_forward_vector
Definition: cbs_mpeg2.h:130
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:178
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:126
uint8_t aspect_ratio_information
Definition: cbs_mpeg2.h:64
uint8_t slice_picture_id
Definition: cbs_mpeg2.h:201
uint8_t picture_coding_type
Definition: cbs_mpeg2.h:127
MPEG2RawSliceHeader header
Definition: cbs_mpeg2.h:207
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:198
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:212
size_t data_size
Definition: cbs_mpeg2.h:210
uint8_t slice_picture_id_enable
Definition: cbs_mpeg2.h:200
MPEG2RawExtraInformation extra_information_picture
Definition: cbs_mpeg2.h:135