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 * @GST_MPEG_VIDEO_LEVEL_HIGH_P: High-P level (HL Progressive) 121 * 122 * Mpeg-2 Levels. 123 **/ 124 typedef enum { 125 GST_MPEG_VIDEO_LEVEL_HIGH_P = 0x02, 126 GST_MPEG_VIDEO_LEVEL_HIGH = 0x04, 127 GST_MPEG_VIDEO_LEVEL_HIGH_1440 = 0x06, 128 GST_MPEG_VIDEO_LEVEL_MAIN = 0x08, 129 GST_MPEG_VIDEO_LEVEL_LOW = 0x0a 130 } GstMpegVideoLevel; 131 132 /** 133 * GstMpegVideoProfile: 134 * @GST_MPEG_VIDEO_PROFILE_422: 4:2:2 profile (422) 135 * @GST_MPEG_VIDEO_PROFILE_HIGH: High profile (HP) 136 * @GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE: Spatially Scalable profile (Spatial) 137 * @GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE: SNR Scalable profile (SNR) 138 * @GST_MPEG_VIDEO_PROFILE_MAIN: Main profile (MP) 139 * @GST_MPEG_VIDEO_PROFILE_SIMPLE: Simple profile (SP) 140 * 141 * Mpeg-2 Profiles. 142 **/ 143 typedef enum { 144 GST_MPEG_VIDEO_PROFILE_422 = 0x00, 145 GST_MPEG_VIDEO_PROFILE_HIGH = 0x01, 146 GST_MPEG_VIDEO_PROFILE_SPATIALLY_SCALABLE = 0x02, 147 GST_MPEG_VIDEO_PROFILE_SNR_SCALABLE = 0x03, 148 GST_MPEG_VIDEO_PROFILE_MAIN = 0x04, 149 GST_MPEG_VIDEO_PROFILE_SIMPLE = 0x05 150 } GstMpegVideoProfile; 151 152 /** 153 * GstMpegVideoChromaFormat: 154 * @GST_MPEG_VIDEO_CHROMA_RES: Invalid (reserved for future use) 155 * @GST_MPEG_VIDEO_CHROMA_420: 4:2:0 subsampling 156 * @GST_MPEG_VIDEO_CHROMA_422: 4:2:2 subsampling 157 * @GST_MPEG_VIDEO_CHROMA_444: 4:4:4 (non-subsampled) 158 * 159 * Chroma subsampling type. 160 */ 161 typedef enum { 162 GST_MPEG_VIDEO_CHROMA_RES = 0x00, 163 GST_MPEG_VIDEO_CHROMA_420 = 0x01, 164 GST_MPEG_VIDEO_CHROMA_422 = 0x02, 165 GST_MPEG_VIDEO_CHROMA_444 = 0x03, 166 } GstMpegVideoChromaFormat; 167 168 /** 169 * GstMpegVideoPictureType: 170 * @GST_MPEG_VIDEO_PICTURE_TYPE_I: Intra-coded (I) frame 171 * @GST_MPEG_VIDEO_PICTURE_TYPE_P: Predictive-codec (P) frame 172 * @GST_MPEG_VIDEO_PICTURE_TYPE_B: Bidirectionally predictive-coded (B) frame 173 * @GST_MPEG_VIDEO_PICTURE_TYPE_D: D frame 174 * 175 * Picture type. 176 */ 177 typedef enum { 178 GST_MPEG_VIDEO_PICTURE_TYPE_I = 0x01, 179 GST_MPEG_VIDEO_PICTURE_TYPE_P = 0x02, 180 GST_MPEG_VIDEO_PICTURE_TYPE_B = 0x03, 181 GST_MPEG_VIDEO_PICTURE_TYPE_D = 0x04 182 } GstMpegVideoPictureType; 183 184 /** 185 * GstMpegVideoPictureStructure: 186 * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD: Top field 187 * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD: Bottom field 188 * @GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME: Frame picture 189 * 190 * Picture structure type. 191 */ 192 typedef enum { 193 GST_MPEG_VIDEO_PICTURE_STRUCTURE_TOP_FIELD = 0x01, 194 GST_MPEG_VIDEO_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02, 195 GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME = 0x03 196 } GstMpegVideoPictureStructure; 197 198 typedef struct _GstMpegVideoSequenceHdr GstMpegVideoSequenceHdr; 199 typedef struct _GstMpegVideoSequenceExt GstMpegVideoSequenceExt; 200 typedef struct _GstMpegVideoSequenceDisplayExt GstMpegVideoSequenceDisplayExt; 201 typedef struct _GstMpegVideoSequenceScalableExt GstMpegVideoSequenceScalableExt; 202 typedef struct _GstMpegVideoPictureHdr GstMpegVideoPictureHdr; 203 typedef struct _GstMpegVideoGop GstMpegVideoGop; 204 typedef struct _GstMpegVideoPictureExt GstMpegVideoPictureExt; 205 typedef struct _GstMpegVideoQuantMatrixExt GstMpegVideoQuantMatrixExt; 206 typedef struct _GstMpegVideoSliceHdr GstMpegVideoSliceHdr; 207 typedef struct _GstMpegVideoPacket GstMpegVideoPacket; 208 209 /** 210 * GstMpegVideoSequenceHdr: 211 * @width: Width of each frame 212 * @height: Height of each frame 213 * @par_w: Calculated Pixel Aspect Ratio width 214 * @par_h: Calculated Pixel Aspect Ratio height 215 * @fps_n: Calculated Framrate nominator 216 * @fps_d: Calculated Framerate denominator 217 * @bitrate_value: Value of the bitrate as is in the stream (400bps unit) 218 * @bitrate: the real bitrate of the Mpeg video stream in bits per second, 0 if VBR stream 219 * @constrained_parameters_flag: %TRUE if this stream uses constrained parameters. 220 * @load_intra_quantiser_matrix: %TRUE indicates the presence of intra_quantiser_matrix 221 * @intra_quantizer_matrix: intra-quantization table, in zigzag scan order 222 * @load_non_intra_quantiser_matrix: %TRUE indicates the presence of non_intra_quantiser_matrix 223 * @non_intra_quantizer_matrix: non-intra quantization table, in zigzag scan order 224 * 225 * The Mpeg2 Video Sequence Header structure. 226 */ 227 struct _GstMpegVideoSequenceHdr 228 { 229 guint16 width, height; 230 guint8 aspect_ratio_info; 231 guint8 frame_rate_code; 232 guint32 bitrate_value; 233 guint16 vbv_buffer_size_value; 234 235 guint8 constrained_parameters_flag; 236 237 guint8 load_intra_quantiser_matrix; 238 guint8 intra_quantizer_matrix[64]; 239 guint8 load_non_intra_quantiser_matrix; 240 guint8 non_intra_quantizer_matrix[64]; 241 242 /* Calculated values */ 243 guint par_w, par_h; 244 guint fps_n, fps_d; 245 guint bitrate; 246 }; 247 248 /** 249 * GstMpegVideoSequenceExt: 250 * @profile: mpeg2 decoder profile 251 * @level: mpeg2 decoder level 252 * @progressive: %TRUE if the frames are progressive %FALSE otherwise 253 * @chroma_format: indicates the chrominance format 254 * @horiz_size_ext: Horizontal size 255 * @vert_size_ext: Vertical size 256 * @bitrate_ext: The bitrate 257 * @vbv_buffer_size_extension: VBV buffer size 258 * @low_delay: %TRUE if the sequence doesn't contain any B-pictures, %FALSE 259 * otherwise 260 * @fps_n_ext: Framerate nominator code 261 * @fps_d_ext: Framerate denominator code 262 * @profile_level_escape_bit: Escape bit. If set, the meaning of the 263 * @profile and @level fields is different. 264 * 265 * The Mpeg2 Video Sequence Extension structure. 266 **/ 267 struct _GstMpegVideoSequenceExt 268 { 269 /* mpeg2 decoder profile */ 270 guint8 profile; 271 /* mpeg2 decoder level */ 272 guint8 level; 273 274 guint8 progressive; 275 guint8 chroma_format; 276 277 guint8 horiz_size_ext, vert_size_ext; 278 279 guint16 bitrate_ext; 280 guint8 vbv_buffer_size_extension; 281 guint8 low_delay; 282 guint8 fps_n_ext, fps_d_ext; 283 284 /* Additional information */ 285 guint8 profile_level_escape_bit; 286 }; 287 288 /** 289 * GstMpegVideoSequenceDisplayExt: 290 * @video_format: 3-bit video_format field indicating PAL/NTSC etc. 291 * @colour_description_flag: %TRUE if colour information was provided 292 * @colour_primaries: Valid if colour_description_flag is set 293 * @transfer_characteristics: Valid if colour_description_flag is set 294 * @matrix_coefficients: Valid if colour_description_flag is set 295 * @display_horizontal_size: width of decoded frame sub-region to display 296 * @display_vertical_size: height of decoded frame sub-region to display 297 */ 298 struct _GstMpegVideoSequenceDisplayExt 299 { 300 guint8 video_format; 301 guint8 colour_description_flag; 302 303 /* if colour_description_flag: */ 304 guint8 colour_primaries; 305 guint8 transfer_characteristics; 306 guint8 matrix_coefficients; 307 308 guint16 display_horizontal_size; 309 guint16 display_vertical_size; 310 }; 311 312 /** 313 * GstMpegVideoSequenceScalableExt: 314 * @scalable_mode: 315 * @layer_id: 316 * @lower_layer_prediction_horizontal_size: 317 * @lower_layer_prediction_vertical_size: 318 * @horizontal_subsampling_factor_m: 319 * @horizontal_subsampling_factor_n: 320 * @vertical_subsampling_factor_m: 321 * @vertical_subsampling_factor_n: 322 * @picture_mux_enable: 323 * @mux_to_progressive_sequence: 324 * @picture_mux_order: 325 * @picture_mux_factor: 326 * 327 * The Sequence Scalable Extension structure. 328 * 329 * Since: 1.2 330 */ 331 struct _GstMpegVideoSequenceScalableExt 332 { 333 guint8 scalable_mode; 334 guint8 layer_id; 335 336 /* if spatial scalability */ 337 guint16 lower_layer_prediction_horizontal_size; 338 guint16 lower_layer_prediction_vertical_size; 339 guint8 horizontal_subsampling_factor_m; 340 guint8 horizontal_subsampling_factor_n; 341 guint8 vertical_subsampling_factor_m; 342 guint8 vertical_subsampling_factor_n; 343 344 /* if temporal scalability */ 345 guint8 picture_mux_enable; 346 guint8 mux_to_progressive_sequence; 347 guint8 picture_mux_order; 348 guint8 picture_mux_factor; 349 }; 350 351 /** 352 * GstMpegVideoQuantMatrixExt: 353 * @load_intra_quantiser_matrix: 354 * @intra_quantiser_matrix: 355 * @load_non_intra_quantiser_matrix: 356 * @non_intra_quantiser_matrix: 357 * @load_chroma_intra_quantiser_matrix: 358 * @chroma_intra_quantiser_matrix: 359 * @load_chroma_non_intra_quantiser_matrix: 360 * @chroma_non_intra_quantiser_matrix: 361 * 362 * The Quant Matrix Extension structure that exposes quantization 363 * matrices in zigzag scan order. i.e. the original encoded scan 364 * order. 365 */ 366 struct _GstMpegVideoQuantMatrixExt 367 { 368 guint8 load_intra_quantiser_matrix; 369 guint8 intra_quantiser_matrix[64]; 370 guint8 load_non_intra_quantiser_matrix; 371 guint8 non_intra_quantiser_matrix[64]; 372 guint8 load_chroma_intra_quantiser_matrix; 373 guint8 chroma_intra_quantiser_matrix[64]; 374 guint8 load_chroma_non_intra_quantiser_matrix; 375 guint8 chroma_non_intra_quantiser_matrix[64]; 376 }; 377 378 /** 379 * GstMpegVideoPictureHdr: 380 * @tsn: Temporal Sequence Number 381 * @pic_type: Type of the frame 382 * @full_pel_forward_vector: the full pel forward flag of 383 * the frame: 0 or 1. 384 * @full_pel_backward_vector: the full pel backward flag 385 * of the frame: 0 or 1. 386 * @f_code: F code 387 * 388 * The Mpeg2 Video Picture Header structure. 389 */ 390 struct _GstMpegVideoPictureHdr 391 { 392 guint16 tsn; 393 guint8 pic_type; 394 guint16 vbv_delay; 395 396 guint8 full_pel_forward_vector, full_pel_backward_vector; 397 398 guint8 f_code[2][2]; 399 }; 400 401 /** 402 * GstMpegVideoPictureExt: 403 * @intra_dc_precision: Intra DC precision 404 * @picture_structure: Structure of the picture 405 * @top_field_first: Top field first 406 * @frame_pred_frame_dct: Frame 407 * @concealment_motion_vectors: Concealment Motion Vectors 408 * @q_scale_type: Q Scale Type 409 * @intra_vlc_format: Intra Vlc Format 410 * @alternate_scan: Alternate Scan 411 * @repeat_first_field: Repeat First Field 412 * @chroma_420_type: Chroma 420 Type 413 * @progressive_frame: %TRUE if the frame is progressive %FALSE otherwise 414 * 415 * The Mpeg2 Video Picture Extension structure. 416 */ 417 struct _GstMpegVideoPictureExt 418 { 419 guint8 f_code[2][2]; 420 421 guint8 intra_dc_precision; 422 guint8 picture_structure; 423 guint8 top_field_first; 424 guint8 frame_pred_frame_dct; 425 guint8 concealment_motion_vectors; 426 guint8 q_scale_type; 427 guint8 intra_vlc_format; 428 guint8 alternate_scan; 429 guint8 repeat_first_field; 430 guint8 chroma_420_type; 431 guint8 progressive_frame; 432 guint8 composite_display; 433 guint8 v_axis; 434 guint8 field_sequence; 435 guint8 sub_carrier; 436 guint8 burst_amplitude; 437 guint8 sub_carrier_phase; 438 }; 439 440 /** 441 * GstMpegVideoGop: 442 * @drop_frame_flag: Drop Frame Flag 443 * @hour: Hour (0-23) 444 * @minute: Minute (O-59) 445 * @second: Second (0-59) 446 * @frame: Frame (0-59) 447 * @closed_gop: Closed Gop 448 * @broken_link: Broken link 449 * 450 * The Mpeg Video Group of Picture structure. 451 */ 452 struct _GstMpegVideoGop 453 { 454 guint8 drop_frame_flag; 455 456 guint8 hour, minute, second, frame; 457 458 guint8 closed_gop; 459 guint8 broken_link; 460 }; 461 462 /** 463 * GstMpegVideoSliceHdr: 464 * @vertical_position: slice vertical position 465 * @vertical_position_extension: Extension to slice_vertical_position 466 * @priority_breakpoint: Point where the bitstream shall be partitioned 467 * @quantiser_scale_code: Quantiser value (range: 1-31) 468 * @slice_ext_flag: Slice Extension flag 469 * @intra_slice: Equal to one if all the macroblocks are intra macro blocks. 470 * @slice_picture_id_enable: controls the semantics of slice_picture_id 471 * @slice_picture_id: Intended to aid recovery on severe bursts of 472 * errors for certain types of applications 473 * 474 * The Mpeg2 Video Slice Header structure. 475 * 476 * Since: 1.2 477 */ 478 struct _GstMpegVideoSliceHdr 479 { 480 guint8 vertical_position; 481 guint8 vertical_position_ext; 482 483 guint8 priority_breakpoint; 484 guint8 quantiser_scale_code; 485 guint8 slice_ext_flag; 486 guint8 intra_slice; 487 guint8 slice_picture_id_enable; 488 guint8 slice_picture_id; 489 490 /* Calculated values */ 491 guint header_size; /* slice_header size in bits */ 492 gint mb_row; /* macroblock row */ 493 gint mb_column; /* macroblock column */ 494 }; 495 496 /** 497 * GstMpegVideoPacket: 498 * @type: the type of the packet that start at @offset, as a #GstMpegVideoPacketTypeCode 499 * @data: the data containing the packet starting at @offset 500 * @offset: the offset of the packet start in bytes from @data. This is the 501 * start of the packet itself without the sync code 502 * @size: The size in bytes of the packet or -1 if the end wasn't found. This 503 * is the size of the packet itself without the sync code 504 * 505 * A structure that contains the type of a packet, its offset and its size 506 */ 507 struct _GstMpegVideoPacket 508 { 509 const guint8 *data; 510 guint8 type; 511 guint offset; 512 gint size; 513 }; 514 515 GST_CODEC_PARSERS_API 516 gboolean gst_mpeg_video_parse (GstMpegVideoPacket * packet, 517 const guint8 * data, gsize size, guint offset); 518 519 GST_CODEC_PARSERS_API 520 gboolean gst_mpeg_video_packet_parse_sequence_header (const GstMpegVideoPacket * packet, 521 GstMpegVideoSequenceHdr * seqhdr); 522 523 GST_CODEC_PARSERS_API 524 gboolean gst_mpeg_video_packet_parse_sequence_extension (const GstMpegVideoPacket * packet, 525 GstMpegVideoSequenceExt * seqext); 526 527 GST_CODEC_PARSERS_API 528 gboolean gst_mpeg_video_packet_parse_sequence_display_extension (const GstMpegVideoPacket * packet, 529 GstMpegVideoSequenceDisplayExt * seqdisplayext); 530 531 GST_CODEC_PARSERS_API 532 gboolean gst_mpeg_video_packet_parse_sequence_scalable_extension (const GstMpegVideoPacket * packet, 533 GstMpegVideoSequenceScalableExt * seqscaleext); 534 535 GST_CODEC_PARSERS_API 536 gboolean gst_mpeg_video_packet_parse_picture_header (const GstMpegVideoPacket * packet, 537 GstMpegVideoPictureHdr* pichdr); 538 539 GST_CODEC_PARSERS_API 540 gboolean gst_mpeg_video_packet_parse_picture_extension (const GstMpegVideoPacket * packet, 541 GstMpegVideoPictureExt *picext); 542 543 GST_CODEC_PARSERS_API 544 gboolean gst_mpeg_video_packet_parse_gop (const GstMpegVideoPacket * packet, 545 GstMpegVideoGop * gop); 546 547 GST_CODEC_PARSERS_API 548 gboolean gst_mpeg_video_packet_parse_slice_header (const GstMpegVideoPacket * packet, 549 GstMpegVideoSliceHdr * slice_hdr, 550 GstMpegVideoSequenceHdr * seq_hdr, 551 GstMpegVideoSequenceScalableExt * seqscaleext); 552 553 GST_CODEC_PARSERS_API 554 gboolean gst_mpeg_video_packet_parse_quant_matrix_extension (const GstMpegVideoPacket * packet, 555 GstMpegVideoQuantMatrixExt * quant); 556 557 /* seqext and displayext may be NULL if not received */ 558 559 GST_CODEC_PARSERS_API 560 gboolean gst_mpeg_video_finalise_mpeg2_sequence_header (GstMpegVideoSequenceHdr *hdr, 561 GstMpegVideoSequenceExt *seqext, GstMpegVideoSequenceDisplayExt *displayext); 562 563 GST_CODEC_PARSERS_API 564 void gst_mpeg_video_quant_matrix_get_raster_from_zigzag (guint8 out_quant[64], 565 const guint8 quant[64]); 566 567 GST_CODEC_PARSERS_API 568 void gst_mpeg_video_quant_matrix_get_zigzag_from_raster (guint8 out_quant[64], 569 const guint8 quant[64]); 570 571 G_END_DECLS 572 573 #endif 574