gstmpegvideoparser.h 19 KB

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