• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Gstreamer
2  * Copyright (C) <2011> Intel Corporation
3  * Copyright (C) <2011> Collabora Ltd.
4  * Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
5  *
6  * From bad/sys/vdpau/mpeg/mpegutil.c:
7  *   Copyright (C) <2007> Jan Schmidt <thaytan@mad.scientist.com>
8  *   Copyright (C) <2009> Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301, USA.
24  */
25 
26 #ifndef __GST_MPEG_VIDEO_UTILS_H__
27 #define __GST_MPEG_VIDEO_UTILS_H__
28 
29 #ifndef OHOS_EXT_FUNC
30 // ohos.ext.func.0013
31 #ifndef GST_USE_UNSTABLE_API
32 #warning "The Mpeg video parsing library is unstable API and may change in future."
33 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
34 #endif
35 #endif
36 
37 #include <gst/gst.h>
38 #include <gst/codecparsers/codecparsers-prelude.h>
39 
40 G_BEGIN_DECLS
41 
42 /**
43  * GstMpegVideoPacketTypeCode:
44  * @GST_MPEG_VIDEO_PACKET_PICTURE: Picture packet starting code
45  * @GST_MPEG_VIDEO_PACKET_SLICE_MIN: Slice min packet starting code
46  * @GST_MPEG_VIDEO_PACKET_SLICE_MAX: Slice max packet starting code
47  * @GST_MPEG_VIDEO_PACKET_USER_DATA: User data packet starting code
48  * @GST_MPEG_VIDEO_PACKET_SEQUENCE : Sequence packet starting code
49  * @GST_MPEG_VIDEO_PACKET_EXTENSION: Extension packet starting code
50  * @GST_MPEG_VIDEO_PACKET_SEQUENCE_END: Sequence end packet code
51  * @GST_MPEG_VIDEO_PACKET_GOP: Group of Picture packet starting code
52  * @GST_MPEG_VIDEO_PACKET_NONE: None packet code
53  *
54  * Indicates the type of MPEG packet
55  */
56 typedef enum {
57   GST_MPEG_VIDEO_PACKET_PICTURE      = 0x00,
58   GST_MPEG_VIDEO_PACKET_SLICE_MIN    = 0x01,
59   GST_MPEG_VIDEO_PACKET_SLICE_MAX    = 0xaf,
60   GST_MPEG_VIDEO_PACKET_USER_DATA    = 0xb2,
61   GST_MPEG_VIDEO_PACKET_SEQUENCE     = 0xb3,
62   GST_MPEG_VIDEO_PACKET_EXTENSION    = 0xb5,
63   GST_MPEG_VIDEO_PACKET_SEQUENCE_END = 0xb7,
64   GST_MPEG_VIDEO_PACKET_GOP          = 0xb8,
65   GST_MPEG_VIDEO_PACKET_NONE         = 0xff
66 } GstMpegVideoPacketTypeCode;
67 
68 /**
69  * GST_MPEG_VIDEO_PACKET_IS_SLICE:
70  * @typecode: The MPEG video packet type code
71  *
72  * Checks whether a packet type code is a slice.
73  *
74  * Returns: %TRUE if the packet type code corresponds to a slice,
75  * else %FALSE.
76  */
77 #define GST_MPEG_VIDEO_PACKET_IS_SLICE(typecode) ((typecode) >= GST_MPEG_VIDEO_PACKET_SLICE_MIN && \
78                                                   (typecode) <= GST_MPEG_VIDEO_PACKET_SLICE_MAX)
79 
80 /**
81  * GstMpegVideoPacketExtensionCode:
82  * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE: Sequence extension code
83  * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY: Sequence Display extension code
84  * @GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX: Quantization Matrix extension code
85  * @GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE: Sequence Scalable extension code
86  * @GST_MPEG_VIDEO_PACKET_EXT_PICTURE: Picture coding extension
87  *
88  * Indicates what type of packets are in this block, some are mutually
89  * exclusive though - ie, sequence packs are accumulated separately. GOP &
90  * Picture may occur together or separately.
91  */
92 typedef enum {
93   GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE          = 0x01,
94   GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_DISPLAY  = 0x02,
95   GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX      = 0x03,
96   GST_MPEG_VIDEO_PACKET_EXT_SEQUENCE_SCALABLE = 0x05,
97   GST_MPEG_VIDEO_PACKET_EXT_PICTURE           = 0x08
98 } GstMpegVideoPacketExtensionCode;
99 
100 /**
101  * GstMpegVideoSequenceScalableMode:
102  * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_DATA_PARTITIONING: Data partitioning
103  * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SPATIAL: Spatial Scalability
104  * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SNR: SNR Scalability
105  * @GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_TEMPORAL: Temporal Scalability
106  */
107 typedef enum {
108   GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_DATA_PARTITIONING  = 0x00,
109   GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SPATIAL            = 0x01,
110   GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_SNR                = 0x02,
111   GST_MPEG_VIDEO_SEQ_SCALABLE_MODE_TEMPORAL           = 0x03
112 } GstMpegVideoSequenceScalableMode;
113 
114 /**
115  * GstMpegVideoLevel:
116  * @GST_MPEG_VIDEO_LEVEL_LOW: Low level (LL)
117  * @GST_MPEG_VIDEO_LEVEL_MAIN: Main level (ML)
118  * @GST_MPEG_VIDEO_LEVEL_HIGH_1440: High 1440 level (H-14)
119  * @GST_MPEG_VIDEO_LEVEL_HIGH: High level (HL)
120  *
121  * Mpeg-2 Levels.
122  **/
123 typedef enum {
124  GST_MPEG_VIDEO_LEVEL_HIGH      = 0x04,
125  GST_MPEG_VIDEO_LEVEL_HIGH_1440 = 0x06,
126  GST_MPEG_VIDEO_LEVEL_MAIN      = 0x08,
127  GST_MPEG_VIDEO_LEVEL_LOW       = 0x0a
128 } GstMpegVideoLevel;
129 
130 /**
131  * GstMpegVideoProfile:
132  * @GST_MPEG_VIDEO_PROFILE_422: 4:2:2 profile (422)
133  * @GST_MPEG_VIDEO_PROFILE_HIGH: High profile (HP)
134  * @GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE: Spatially Scalable profile (Spatial)
135  * @GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE: SNR Scalable profile (SNR)
136  * @GST_MPEG_VIDEO_PROFILE_MAIN: Main profile (MP)
137  * @GST_MPEG_VIDEO_PROFILE_SIMPLE: Simple profile (SP)
138  *
139  * Mpeg-2 Profiles.
140  **/
141 typedef enum {
142   GST_MPEG_VIDEO_PROFILE_422                 = 0x00,
143   GST_MPEG_VIDEO_PROFILE_HIGH                = 0x01,
144   GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE  = 0x02,
145   GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE        = 0x03,
146   GST_MPEG_VIDEO_PROFILE_MAIN                = 0x04,
147   GST_MPEG_VIDEO_PROFILE_SIMPLE              = 0x05
148 } GstMpegVideoProfile;
149 
150 /**
151  * GstMpegVideoChromaFormat:
152  * @GST_MPEG_VIDEO_CHROMA_RES: Invalid (reserved for future use)
153  * @GST_MPEG_VIDEO_CHROMA_420: 4:2:0 subsampling
154  * @GST_MPEG_VIDEO_CHROMA_422: 4:2:2 subsampling
155  * @GST_MPEG_VIDEO_CHROMA_444: 4:4:4 (non-subsampled)
156  *
157  * Chroma subsampling type.
158  */
159 typedef enum {
160   GST_MPEG_VIDEO_CHROMA_RES = 0x00,
161   GST_MPEG_VIDEO_CHROMA_420 = 0x01,
162   GST_MPEG_VIDEO_CHROMA_422 = 0x02,
163   GST_MPEG_VIDEO_CHROMA_444 = 0x03,
164 } GstMpegVideoChromaFormat;
165 
166 /**
167  * GstMpegVideoPictureType:
168  * @GST_MPEG_VIDEO_PICTURE_TYPE_I: Intra-coded (I) frame
169  * @GST_MPEG_VIDEO_PICTURE_TYPE_P: Predictive-codec (P) frame
170  * @GST_MPEG_VIDEO_PICTURE_TYPE_B: Bidirectionally predictive-coded (B) frame
171  * @GST_MPEG_VIDEO_PICTURE_TYPE_D: D frame
172  *
173  * Picture type.
174  */
175 typedef enum {
176   GST_MPEG_VIDEO_PICTURE_TYPE_I = 0x01,
177   GST_MPEG_VIDEO_PICTURE_TYPE_P = 0x02,
178   GST_MPEG_VIDEO_PICTURE_TYPE_B = 0x03,
179   GST_MPEG_VIDEO_PICTURE_TYPE_D = 0x04
180 } GstMpegVideoPictureType;
181 
182 /**
183  * GstMpegVideoPictureStructure:
184  * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD: Top field
185  * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD: Bottom field
186  * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME: Frame picture
187  *
188  * Picture structure type.
189  */
190 typedef enum {
191     GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD    = 0x01,
192     GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02,
193     GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME        = 0x03
194 } GstMpegVideoPictureStructure;
195 
196 typedef struct _GstMpegVideoSequenceHdr     GstMpegVideoSequenceHdr;
197 typedef struct _GstMpegVideoSequenceExt     GstMpegVideoSequenceExt;
198 typedef struct _GstMpegVideoSequenceDisplayExt GstMpegVideoSequenceDisplayExt;
199 typedef struct _GstMpegVideoSequenceScalableExt GstMpegVideoSequenceScalableExt;
200 typedef struct _GstMpegVideoPictureHdr      GstMpegVideoPictureHdr;
201 typedef struct _GstMpegVideoGop             GstMpegVideoGop;
202 typedef struct _GstMpegVideoPictureExt      GstMpegVideoPictureExt;
203 typedef struct _GstMpegVideoQuantMatrixExt  GstMpegVideoQuantMatrixExt;
204 typedef struct _GstMpegVideoSliceHdr        GstMpegVideoSliceHdr;
205 typedef struct _GstMpegVideoPacket          GstMpegVideoPacket;
206 
207 /**
208  * GstMpegVideoSequenceHdr:
209  * @width: Width of each frame
210  * @height: Height of each frame
211  * @par_w: Calculated Pixel Aspect Ratio width
212  * @par_h: Calculated Pixel Aspect Ratio height
213  * @fps_n: Calculated Framrate nominator
214  * @fps_d: Calculated Framerate denominator
215  * @bitrate_value: Value of the bitrate as is in the stream (400bps unit)
216  * @bitrate: the real bitrate of the Mpeg video stream in bits per second, 0 if VBR stream
217  * @constrained_parameters_flag: %TRUE if this stream uses contrained parameters.
218  * @load_intra_quantiser_matrix: %TRUE indicates the presence of intra_quantiser_matrix
219  * @intra_quantizer_matrix: intra-quantization table, in zigzag scan order
220  * @load_non_intra_quantiser_matrix: %TRUE indicates the presence of non_intra_quantiser_matrix
221  * @non_intra_quantizer_matrix: non-intra quantization table, in zigzag scan order
222  *
223  * The Mpeg2 Video Sequence Header structure.
224  */
225 struct _GstMpegVideoSequenceHdr
226 {
227   guint16 width, height;
228   guint8  aspect_ratio_info;
229   guint8  frame_rate_code;
230   guint32 bitrate_value;
231   guint16 vbv_buffer_size_value;
232 
233   guint8  constrained_parameters_flag;
234 
235   guint8  load_intra_quantiser_matrix;
236   guint8  intra_quantizer_matrix[64];
237   guint8  load_non_intra_quantiser_matrix;
238   guint8  non_intra_quantizer_matrix[64];
239 
240   /* Calculated values */
241   guint   par_w, par_h;
242   guint   fps_n, fps_d;
243   guint   bitrate;
244 };
245 
246 /**
247  * GstMpegVideoSequenceExt:
248  * @profile: mpeg2 decoder profile
249  * @level: mpeg2 decoder level
250  * @progressive: %TRUE if the frames are progressive %FALSE otherwise
251  * @chroma_format: indicates the chrominance format
252  * @horiz_size_ext: Horizontal size
253  * @vert_size_ext: Vertical size
254  * @bitrate_ext: The bitrate
255  * @vbv_buffer_size_extension: VBV vuffer size
256  * @low_delay: %TRUE if the sequence doesn't contain any B-pictures, %FALSE
257  * otherwise
258  * @fps_n_ext: Framerate nominator code
259  * @fps_d_ext: Framerate denominator code
260  * @profile_level_escape_bit: Escape bit. If set, the meaning of the
261  *    @profile and @level fields is different.
262  *
263  * The Mpeg2 Video Sequence Extension structure.
264  **/
265 struct _GstMpegVideoSequenceExt
266 {
267   /* mpeg2 decoder profile */
268   guint8 profile;
269   /* mpeg2 decoder level */
270   guint8 level;
271 
272   guint8 progressive;
273   guint8 chroma_format;
274 
275   guint8 horiz_size_ext, vert_size_ext;
276 
277   guint16 bitrate_ext;
278   guint8 vbv_buffer_size_extension;
279   guint8 low_delay;
280   guint8 fps_n_ext, fps_d_ext;
281 
282   /* Additional information */
283   guint8 profile_level_escape_bit;
284 };
285 
286 /**
287  * GstMpegVideoSequenceDisplayExt:
288  * @profile: mpeg2 decoder profil
289 
290  */
291 struct _GstMpegVideoSequenceDisplayExt
292 {
293   guint8 video_format;
294   guint8 colour_description_flag;
295 
296   /* if colour_description_flag: */
297     guint8 colour_primaries;
298     guint8 transfer_characteristics;
299     guint8 matrix_coefficients;
300 
301   guint16 display_horizontal_size;
302   guint16 display_vertical_size;
303 };
304 
305 /**
306  * GstMpegVideoSequenceScalableExt:
307  * @scalable_mode:
308  * @layer_id:
309  * @lower_layer_prediction_horizontal_size:
310  * @lower_layer_prediction_vertical_size:
311  * @horizontal_subsampling_factor_m:
312  * @horizontal_subsampling_factor_n:
313  * @vertical_subsampling_factor_m:
314  * @vertical_subsampling_factor_n:
315  * @picture_mux_enable:
316  * @mux_to_progressive_sequence:
317  * @picture_mux_order:
318  * @picture_mux_factor:
319  *
320  * The Sequence Scalable Extension structure.
321  *
322  * Since: 1.2
323  */
324 struct _GstMpegVideoSequenceScalableExt
325 {
326   guint8 scalable_mode;
327   guint8 layer_id;
328 
329   /* if spatial scalability */
330   guint16 lower_layer_prediction_horizontal_size;
331   guint16 lower_layer_prediction_vertical_size;
332   guint8 horizontal_subsampling_factor_m;
333   guint8 horizontal_subsampling_factor_n;
334   guint8 vertical_subsampling_factor_m;
335   guint8 vertical_subsampling_factor_n;
336 
337   /* if temporal scalability */
338   guint8 picture_mux_enable;
339   guint8 mux_to_progressive_sequence;
340   guint8 picture_mux_order;
341   guint8 picture_mux_factor;
342 };
343 
344 /**
345  * GstMpegVideoQuantMatrixExt:
346  * @load_intra_quantiser_matrix:
347  * @intra_quantiser_matrix:
348  * @load_non_intra_quantiser_matrix:
349  * @non_intra_quantiser_matrix:
350  * @load_chroma_intra_quantiser_matrix:
351  * @chroma_intra_quantiser_matrix:
352  * @load_chroma_non_intra_quantiser_matrix:
353  * @chroma_non_intra_quantiser_matrix:
354  *
355  * The Quant Matrix Extension structure that exposes quantization
356  * matrices in zigzag scan order. i.e. the original encoded scan
357  * order.
358  */
359 struct _GstMpegVideoQuantMatrixExt
360 {
361  guint8 load_intra_quantiser_matrix;
362  guint8 intra_quantiser_matrix[64];
363  guint8 load_non_intra_quantiser_matrix;
364  guint8 non_intra_quantiser_matrix[64];
365  guint8 load_chroma_intra_quantiser_matrix;
366  guint8 chroma_intra_quantiser_matrix[64];
367  guint8 load_chroma_non_intra_quantiser_matrix;
368  guint8 chroma_non_intra_quantiser_matrix[64];
369 };
370 
371 /**
372  * GstMpegVideoPictureHdr:
373  * @tsn: Temporal Sequence Number
374  * @pic_type: Type of the frame
375  * @full_pel_forward_vector: the full pel forward flag of
376  *  the frame: 0 or 1.
377  * @full_pel_backward_vector: the full pel backward flag
378  *  of the frame: 0 or 1.
379  * @f_code: F code
380  *
381  * The Mpeg2 Video Picture Header structure.
382  */
383 struct _GstMpegVideoPictureHdr
384 {
385   guint16 tsn;
386   guint8 pic_type;
387   guint16 vbv_delay;
388 
389   guint8 full_pel_forward_vector, full_pel_backward_vector;
390 
391   guint8 f_code[2][2];
392 };
393 
394 /**
395  * GstMpegVideoPictureExt:
396  * @intra_dc_precision: Intra DC precision
397  * @picture_structure: Structure of the picture
398  * @top_field_first: Top field first
399  * @frame_pred_frame_dct: Frame
400  * @concealment_motion_vectors: Concealment Motion Vectors
401  * @q_scale_type: Q Scale Type
402  * @intra_vlc_format: Intra Vlc Format
403  * @alternate_scan: Alternate Scan
404  * @repeat_first_field: Repeat First Field
405  * @chroma_420_type: Chroma 420 Type
406  * @progressive_frame: %TRUE if the frame is progressive %FALSE otherwise
407  *
408  * The Mpeg2 Video Picture Extension structure.
409  */
410 struct _GstMpegVideoPictureExt
411 {
412   guint8 f_code[2][2];
413 
414   guint8 intra_dc_precision;
415   guint8 picture_structure;
416   guint8 top_field_first;
417   guint8 frame_pred_frame_dct;
418   guint8 concealment_motion_vectors;
419   guint8 q_scale_type;
420   guint8 intra_vlc_format;
421   guint8 alternate_scan;
422   guint8 repeat_first_field;
423   guint8 chroma_420_type;
424   guint8 progressive_frame;
425   guint8 composite_display;
426   guint8 v_axis;
427   guint8 field_sequence;
428   guint8 sub_carrier;
429   guint8 burst_amplitude;
430   guint8 sub_carrier_phase;
431 };
432 
433 /**
434  * GstMpegVideoGop:
435  * @drop_frame_flag: Drop Frame Flag
436  * @hour: Hour (0-23)
437  * @minute: Minute (O-59)
438  * @second: Second (0-59)
439  * @frame: Frame (0-59)
440  * @closed_gop: Closed Gop
441  * @broken_link: Broken link
442  *
443  * The Mpeg Video Group of Picture structure.
444  */
445 struct _GstMpegVideoGop
446 {
447   guint8 drop_frame_flag;
448 
449   guint8 hour, minute, second, frame;
450 
451   guint8 closed_gop;
452   guint8 broken_link;
453 };
454 
455 /**
456  * GstMpegVideoSliceHdr:
457  * @vertical_position: slice vertical position
458  * @vertical_position_extension: Extension to slice_vertical_position
459  * @priority_breakpoint: Point where the bitstream shall be partitioned
460  * @quantiser_scale_code: Quantiser value (range: 1-31)
461  * @slice_ext_flag: Slice Extension flag
462  * @intra_slice: Equal to one if all the macroblocks are intra macro blocks.
463  * @slice_picture_id_enable: controls the semantics of slice_picture_id
464  * @slice_picture_id: Intended to aid recovery on severe bursts of
465  *   errors for certain types of applications
466  *
467  * The Mpeg2 Video Slice Header structure.
468  *
469  * Since: 1.2
470  */
471 struct _GstMpegVideoSliceHdr
472 {
473   guint8 vertical_position;
474   guint8 vertical_position_ext;
475 
476   guint8 priority_breakpoint;
477   guint8 quantiser_scale_code;
478   guint8 slice_ext_flag;
479   guint8 intra_slice;
480   guint8 slice_picture_id_enable;
481   guint8 slice_picture_id;
482 
483   /* Calculated values */
484   guint header_size;            /* slice_header size in bits */
485   gint mb_row;                  /* macroblock row */
486   gint mb_column;               /* macroblock column */
487 };
488 
489 /**
490  * GstMpegVideoPacket:
491  * @type: the type of the packet that start at @offset, as a #GstMpegVideoPacketTypeCode
492  * @data: the data containing the packet starting at @offset
493  * @offset: the offset of the packet start in bytes from @data. This is the
494  *     start of the packet itself without the sync code
495  * @size: The size in bytes of the packet or -1 if the end wasn't found. This
496  *     is the size of the packet itself without the sync code
497  *
498  * A structure that contains the type of a packet, its offset and its size
499  */
500 struct _GstMpegVideoPacket
501 {
502   const guint8 *data;
503   guint8 type;
504   guint  offset;
505   gint   size;
506 };
507 
508 GST_CODEC_PARSERS_API
509 gboolean gst_mpeg_video_parse                         (GstMpegVideoPacket * packet,
510                                                        const guint8 * data, gsize size, guint offset);
511 
512 GST_CODEC_PARSERS_API
513 gboolean gst_mpeg_video_packet_parse_sequence_header    (const GstMpegVideoPacket * packet,
514                                                          GstMpegVideoSequenceHdr * seqhdr);
515 
516 GST_CODEC_PARSERS_API
517 gboolean gst_mpeg_video_packet_parse_sequence_extension (const GstMpegVideoPacket * packet,
518                                                          GstMpegVideoSequenceExt * seqext);
519 
520 GST_CODEC_PARSERS_API
521 gboolean gst_mpeg_video_packet_parse_sequence_display_extension (const GstMpegVideoPacket * packet,
522                                                          GstMpegVideoSequenceDisplayExt * seqdisplayext);
523 
524 GST_CODEC_PARSERS_API
525 gboolean gst_mpeg_video_packet_parse_sequence_scalable_extension (const GstMpegVideoPacket * packet,
526                                                          GstMpegVideoSequenceScalableExt * seqscaleext);
527 
528 GST_CODEC_PARSERS_API
529 gboolean gst_mpeg_video_packet_parse_picture_header     (const GstMpegVideoPacket * packet,
530                                                          GstMpegVideoPictureHdr* pichdr);
531 
532 GST_CODEC_PARSERS_API
533 gboolean gst_mpeg_video_packet_parse_picture_extension  (const GstMpegVideoPacket * packet,
534                                                          GstMpegVideoPictureExt *picext);
535 
536 GST_CODEC_PARSERS_API
537 gboolean gst_mpeg_video_packet_parse_gop                (const GstMpegVideoPacket * packet,
538                                                          GstMpegVideoGop * gop);
539 
540 GST_CODEC_PARSERS_API
541 gboolean gst_mpeg_video_packet_parse_slice_header       (const GstMpegVideoPacket * packet,
542                                                          GstMpegVideoSliceHdr * slice_hdr,
543                                                          GstMpegVideoSequenceHdr * seq_hdr,
544                                                          GstMpegVideoSequenceScalableExt * seqscaleext);
545 
546 GST_CODEC_PARSERS_API
547 gboolean gst_mpeg_video_packet_parse_quant_matrix_extension (const GstMpegVideoPacket * packet,
548                                                          GstMpegVideoQuantMatrixExt * quant);
549 
550 /* seqext and displayext may be NULL if not received */
551 
552 GST_CODEC_PARSERS_API
553 gboolean gst_mpeg_video_finalise_mpeg2_sequence_header (GstMpegVideoSequenceHdr *hdr,
554    GstMpegVideoSequenceExt *seqext, GstMpegVideoSequenceDisplayExt *displayext);
555 
556 GST_CODEC_PARSERS_API
557 void     gst_mpeg_video_quant_matrix_get_raster_from_zigzag (guint8 out_quant[64],
558                                                              const guint8 quant[64]);
559 
560 GST_CODEC_PARSERS_API
561 void     gst_mpeg_video_quant_matrix_get_zigzag_from_raster (guint8 out_quant[64],
562                                                              const guint8 quant[64]);
563 
564 G_END_DECLS
565 
566 #endif
567