annotate libmpeg2/mpeg2.h @ 10261:05a50c0ce239

RealAudio 1.0 (14_4) and 2.0 (28_8) native decoders.
author rtognimp
date Sun, 08 Jun 2003 20:29:04 +0000
parents 47984e3f54ce
children d9d24093db2e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * mpeg2.h
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
3 * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
7 * See http://libmpeg2.sourceforge.net/ for updates.
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
8 *
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
12 * (at your option) any later version.
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
13 *
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * GNU General Public License for more details.
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
18 *
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
20 * along with this program; if not, write to the Free Software
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
24 #ifndef MPEG2_H
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
25 #define MPEG2_H
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
26
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
27 #define SEQ_FLAG_MPEG2 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
28 #define SEQ_FLAG_CONSTRAINED_PARAMETERS 2
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
29 #define SEQ_FLAG_PROGRESSIVE_SEQUENCE 4
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
30 #define SEQ_FLAG_LOW_DELAY 8
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
31 #define SEQ_FLAG_COLOUR_DESCRIPTION 16
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
32
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
33 #define SEQ_MASK_VIDEO_FORMAT 0xe0
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
34 #define SEQ_VIDEO_FORMAT_COMPONENT 0
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
35 #define SEQ_VIDEO_FORMAT_PAL 0x20
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
36 #define SEQ_VIDEO_FORMAT_NTSC 0x40
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
37 #define SEQ_VIDEO_FORMAT_SECAM 0x60
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
38 #define SEQ_VIDEO_FORMAT_MAC 0x80
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
39 #define SEQ_VIDEO_FORMAT_UNSPECIFIED 0xa0
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
40
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
41 typedef struct {
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
42 unsigned int width, height;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
43 unsigned int chroma_width, chroma_height;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
44 unsigned int byte_rate;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
45 unsigned int vbv_buffer_size;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
46 uint32_t flags;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
47
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
48 unsigned int picture_width, picture_height;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
49 unsigned int display_width, display_height;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
50 unsigned int pixel_width, pixel_height;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
51 unsigned int frame_period;
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
52
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
53 uint8_t profile_level_id;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
54 uint8_t colour_primaries;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
55 uint8_t transfer_characteristics;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
56 uint8_t matrix_coefficients;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
57 } sequence_t;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
58
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
59 #define PIC_MASK_CODING_TYPE 7
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
60 #define PIC_FLAG_CODING_TYPE_I 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
61 #define PIC_FLAG_CODING_TYPE_P 2
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
62 #define PIC_FLAG_CODING_TYPE_B 3
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
63 #define PIC_FLAG_CODING_TYPE_D 4
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
65 #define PIC_FLAG_TOP_FIELD_FIRST 8
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
66 #define PIC_FLAG_PROGRESSIVE_FRAME 16
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
67 #define PIC_FLAG_COMPOSITE_DISPLAY 32
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
68 #define PIC_FLAG_SKIP 64
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
69 #define PIC_FLAG_PTS 128
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
70 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
71
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
72 typedef struct {
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
73 unsigned int temporal_reference;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
74 unsigned int nb_fields;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
75 uint32_t pts;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
76 uint32_t flags;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
77 struct {
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
78 int x, y;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
79 } display_offset[3];
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
80 } picture_t;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
82 typedef struct {
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
83 uint8_t * buf[3];
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
84 void * id;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
85 } fbuf_t;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
87 typedef struct {
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
88 const sequence_t * sequence;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
89 const picture_t * current_picture;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
90 const picture_t * current_picture_2nd;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
91 const fbuf_t * current_fbuf;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
92 const picture_t * display_picture;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
93 const picture_t * display_picture_2nd;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
94 const fbuf_t * display_fbuf;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
95 const fbuf_t * discard_fbuf;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
96 const uint8_t * user_data;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
97 int user_data_len;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
98 } mpeg2_info_t;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
99
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
100 typedef struct mpeg2dec_s mpeg2dec_t;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
101 typedef struct decoder_s decoder_t;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
102
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
103 #define STATE_SEQUENCE 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
104 #define STATE_SEQUENCE_REPEATED 2
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
105 #define STATE_GOP 3
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
106 #define STATE_PICTURE 4
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
107 #define STATE_SLICE_1ST 5
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
108 #define STATE_PICTURE_2ND 6
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
109 #define STATE_SLICE 7
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
110 #define STATE_END 8
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
111 #define STATE_INVALID 9
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
112
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
113 struct convert_init_s;
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
114 void mpeg2_convert (mpeg2dec_t * mpeg2dec,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
115 void (* convert) (int, int, uint32_t, void *,
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
116 struct convert_init_s *), void * arg);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
117 void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
118 void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
119 void mpeg2_init_fbuf (decoder_t * decoder, uint8_t * current_fbuf[3],
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
120 uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
121
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
122 void mpeg2_slice (decoder_t * decoder, int code, const uint8_t * buffer);
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
123
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
124 #define MPEG2_ACCEL_X86_MMX 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
125 #define MPEG2_ACCEL_X86_3DNOW 2
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
126 #define MPEG2_ACCEL_X86_MMXEXT 4
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
127 #define MPEG2_ACCEL_PPC_ALTIVEC 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
128 #define MPEG2_ACCEL_ALPHA 1
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
129 #define MPEG2_ACCEL_ALPHA_MVI 2
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
130 #define MPEG2_ACCEL_MLIB 0x40000000
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
131 #define MPEG2_ACCEL_DETECT 0x80000000
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
132
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
133 uint32_t mpeg2_accel (uint32_t accel);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
134 mpeg2dec_t * mpeg2_init (void);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
135 const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
136 void mpeg2_close (mpeg2dec_t * mpeg2dec);
36
846535ace7a2 libmpeg2-0.2.0 merge
arpi_esp
parents: 1
diff changeset
137
9852
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
138 void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
139 int mpeg2_parse (mpeg2dec_t * mpeg2dec);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
140
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
141 void mpeg2_skip (mpeg2dec_t * mpeg2dec, int skip);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
142 void mpeg2_slice_region (mpeg2dec_t * mpeg2dec, int start, int end);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
143
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
144 void mpeg2_pts (mpeg2dec_t * mpeg2dec, uint32_t pts);
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
145
47984e3f54ce Importing libmpeg2 from mpeg2dec-0.3.1
arpi
parents: 2050
diff changeset
146 #endif /* MPEG2_H */