Mercurial > libavcodec.hg
annotate avcodec.h @ 955:8f5d4c666806 libavcodec
pts encoding fix patch by (Thomas Jarosch <tomj at simonv dot com>)
author | michaelni |
---|---|
date | Sun, 05 Jan 2003 17:17:14 +0000 |
parents | 13aec7e50c52 |
children | c5aef83c6a3f |
rev | line source |
---|---|
92 | 1 #ifndef AVCODEC_H |
2 #define AVCODEC_H | |
3 | |
0 | 4 #include "common.h" |
5 | |
322 | 6 #define LIBAVCODEC_VERSION_INT 0x000406 |
7 #define LIBAVCODEC_VERSION "0.4.6" | |
954 | 8 #define LIBAVCODEC_BUILD 4652 |
9 #define LIBAVCODEC_BUILD_STR "4652" | |
322 | 10 |
0 | 11 enum CodecID { |
12 CODEC_ID_NONE, | |
13 CODEC_ID_MPEG1VIDEO, | |
14 CODEC_ID_H263, | |
15 CODEC_ID_RV10, | |
16 CODEC_ID_MP2, | |
260
e1bacfb3f51f
- Added MP3 encoding through libmp3lame contributed by Lennert Buytenhek.
pulento
parents:
252
diff
changeset
|
17 CODEC_ID_MP3LAME, |
636
57b9a37546a0
oggvorbis support patch by (Mark Hills <mark at pogo dot org dot uk>)
michaelni
parents:
630
diff
changeset
|
18 CODEC_ID_VORBIS, |
0 | 19 CODEC_ID_AC3, |
20 CODEC_ID_MJPEG, | |
881 | 21 CODEC_ID_MJPEGB, |
67 | 22 CODEC_ID_MPEG4, |
0 | 23 CODEC_ID_RAWVIDEO, |
307 | 24 CODEC_ID_MSMPEG4V1, |
25 CODEC_ID_MSMPEG4V2, | |
26 CODEC_ID_MSMPEG4V3, | |
311 | 27 CODEC_ID_WMV1, |
485 | 28 CODEC_ID_WMV2, |
0 | 29 CODEC_ID_H263P, |
30 CODEC_ID_H263I, | |
521 | 31 CODEC_ID_SVQ1, |
724 | 32 CODEC_ID_DVVIDEO, |
33 CODEC_ID_DVAUDIO, | |
783 | 34 CODEC_ID_WMAV1, |
35 CODEC_ID_WMAV2, | |
827
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
36 CODEC_ID_MACE3, |
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
37 CODEC_ID_MACE6, |
866 | 38 CODEC_ID_HUFFYUV, |
92 | 39 |
40 /* various pcm "codecs" */ | |
41 CODEC_ID_PCM_S16LE, | |
42 CODEC_ID_PCM_S16BE, | |
43 CODEC_ID_PCM_U16LE, | |
44 CODEC_ID_PCM_U16BE, | |
45 CODEC_ID_PCM_S8, | |
46 CODEC_ID_PCM_U8, | |
47 CODEC_ID_PCM_MULAW, | |
48 CODEC_ID_PCM_ALAW, | |
573
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
49 |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
50 /* various adpcm codecs */ |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
51 CODEC_ID_ADPCM_IMA_QT, |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
52 CODEC_ID_ADPCM_IMA_WAV, |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
53 CODEC_ID_ADPCM_MS, |
0 | 54 }; |
55 | |
56 enum CodecType { | |
371
8187bb132d85
* Start using enumerated types (makes debugging much easier)
philipjsg
parents:
367
diff
changeset
|
57 CODEC_TYPE_UNKNOWN = -1, |
0 | 58 CODEC_TYPE_VIDEO, |
59 CODEC_TYPE_AUDIO, | |
60 }; | |
61 | |
62 enum PixelFormat { | |
63 PIX_FMT_YUV420P, | |
64 PIX_FMT_YUV422, | |
65 PIX_FMT_RGB24, | |
66 PIX_FMT_BGR24, | |
27
b8723ec6c80f
added 422P and 444P formats (need to patch ffmpeg.c so that it is handled in all the program)
glantau
parents:
24
diff
changeset
|
67 PIX_FMT_YUV422P, |
b8723ec6c80f
added 422P and 444P formats (need to patch ffmpeg.c so that it is handled in all the program)
glantau
parents:
24
diff
changeset
|
68 PIX_FMT_YUV444P, |
583 | 69 PIX_FMT_RGBA32, |
70 PIX_FMT_BGRA32, | |
733 | 71 PIX_FMT_YUV410P, |
867
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
72 PIX_FMT_YUV411P, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
73 PIX_FMT_RGB565, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
74 PIX_FMT_RGB555, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
75 // PIX_FMT_RGB5551, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
76 PIX_FMT_BGR565, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
77 PIX_FMT_BGR555, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
78 // PIX_FMT_GBR565, |
48215b2c3888
16-bit and 15-bit rgb/bgr patch by (Joel Yliluoma <joel dot yliluoma at w-create dot com>) (note, rare formats disabled)
michaelni
parents:
866
diff
changeset
|
79 // PIX_FMT_GBR555 |
0 | 80 }; |
81 | |
92 | 82 /* currently unused, may be used if 24/32 bits samples ever supported */ |
83 enum SampleFormat { | |
84 SAMPLE_FMT_S16 = 0, /* signed 16 bits */ | |
85 }; | |
86 | |
0 | 87 /* in bytes */ |
783 | 88 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 131072 |
0 | 89 |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
90 /** |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
91 * Required number of zero bytes at the end of the input bitstream for decoding. |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
92 * to avoid overreading (and possibly segfaulting) |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
93 */ |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
94 #define FF_INPUT_BUFFER_PADDING_SIZE 8 |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
95 |
320
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
96 /* motion estimation type, EPZS by default */ |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
97 enum Motion_Est_ID { |
321 | 98 ME_ZERO = 1, |
320
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
99 ME_FULL, |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
100 ME_LOG, |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
101 ME_PHODS, |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
102 ME_EPZS, |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
103 ME_X1 |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
104 }; |
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
105 |
613 | 106 typedef struct RcOverride{ |
107 int start_frame; | |
108 int end_frame; | |
109 int qscale; // if this is 0 then quality_factor will be used instead | |
110 float quality_factor; | |
111 } RcOverride; | |
112 | |
321 | 113 /* only for ME compatiblity with old apps */ |
114 extern int motion_estimation_method; | |
115 | |
320
cda7d0857baf
- ME setting moved to AVCodecContext/MpegEncContext, no longer a global.
pulento
parents:
317
diff
changeset
|
116 /* ME algos sorted by quality */ |
367 | 117 static const int Motion_Est_QTab[] = { ME_ZERO, ME_PHODS, ME_LOG, |
118 ME_X1, ME_EPZS, ME_FULL }; | |
0 | 119 |
625
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
618
diff
changeset
|
120 |
924 | 121 #define FF_MAX_B_FRAMES 8 |
324 | 122 |
681 | 123 /* encoding support |
124 these flags can be passed in AVCodecContext.flags before initing | |
125 Note: note not everything is supported yet | |
126 */ | |
0 | 127 |
684 | 128 #define CODEC_FLAG_HQ 0x0001 /* brute force MB-type decission mode (slow) */ |
129 #define CODEC_FLAG_QSCALE 0x0002 /* use fixed qscale */ | |
130 #define CODEC_FLAG_4MV 0x0004 /* 4 MV per MB allowed */ | |
131 #define CODEC_FLAG_QPEL 0x0010 /* use qpel MC */ | |
132 #define CODEC_FLAG_GMC 0x0020 /* use GMC */ | |
133 #define CODEC_FLAG_PART 0x0080 /* use data partitioning */ | |
324 | 134 /* parent program gurantees that the input for b-frame containing streams is not written to |
135 for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */ | |
329 | 136 #define CODEC_FLAG_INPUT_PRESERVED 0x0100 |
684 | 137 #define CODEC_FLAG_PASS1 0x0200 /* use internal 2pass ratecontrol in first pass mode */ |
138 #define CODEC_FLAG_PASS2 0x0400 /* use internal 2pass ratecontrol in second pass mode */ | |
349
34f6c77ff01a
Support for external huffman table and various fixes by Alex Beregszaszi <alex@naxine.org>
arpi_esp
parents:
345
diff
changeset
|
139 #define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */ |
684 | 140 #define CODEC_FLAG_GRAY 0x2000 /* only decode/encode grayscale */ |
553 | 141 #define CODEC_FLAG_EMU_EDGE 0x4000/* dont draw edges */ |
909
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
142 #define CODEC_FLAG_PSNR 0x8000 /* error[?] variables will be set during encoding */ |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
143 #define CODEC_FLAG_TRUNCATED 0x00010000 /* input bitstream might be truncated at a random location instead |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
144 of only at frame boundaries */ |
690
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
145 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 /* normalize adaptive quantization */ |
697 | 146 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 /* use interlaced dct */ |
831 | 147 #define CODEC_FLAG_LOW_DELAY 0x00080000 /* force low delay / will fail on b frames */ |
880 | 148 #define CODEC_FLAG_ALT_SCAN 0x00100000 /* use alternate scan */ |
945 | 149 #define CODEC_FLAG_TRELLIS_QUANT 0x00200000 /* use trellis quantization */ |
953 | 150 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 /* place global headers in extradata instead of every keyframe */ |
690
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
151 |
67 | 152 /* codec capabilities */ |
153 | |
684 | 154 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 /* decoder can use draw_horiz_band callback */ |
553 | 155 #define CODEC_CAP_DR1 0x0002 /* direct rendering method 1 */ |
581
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
156 /* if 'parse_only' field is true, then avcodec_parse_frame() can be |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
157 used */ |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
158 #define CODEC_CAP_PARSE_ONLY 0x0004 |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
159 #define CODEC_CAP_TRUNCATED 0x0008 |
67 | 160 |
0 | 161 #define FRAME_RATE_BASE 10000 |
162 | |
925 | 163 #define FF_COMMON_FRAME \ |
903 | 164 uint8_t *data[4];\ |
165 int linesize[4];\ | |
166 /**\ | |
914 | 167 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\ |
903 | 168 * this isnt used by lavc unless the default get/release_buffer() is used\ |
169 * encoding: \ | |
170 * decoding: \ | |
171 */\ | |
172 uint8_t *base[4];\ | |
173 /**\ | |
174 * 1 -> keyframe, 0-> not\ | |
175 * encoding: set by lavc\ | |
176 * decoding: set by lavc\ | |
177 */\ | |
178 int key_frame;\ | |
179 \ | |
180 /**\ | |
181 * picture type of the frame, see ?_TYPE below\ | |
182 * encoding: set by lavc for coded_picture (and set by user for input)\ | |
183 * decoding: set by lavc\ | |
184 */\ | |
185 int pict_type;\ | |
186 \ | |
187 /**\ | |
188 * presentation timestamp in micro seconds (time when frame should be shown to user)\ | |
189 * if 0 then the frame_rate will be used as reference\ | |
190 * encoding: MUST be set by user\ | |
191 * decoding: set by lavc\ | |
192 */\ | |
193 long long int pts;\ | |
194 \ | |
195 /**\ | |
196 * picture number in bitstream order.\ | |
197 * encoding: set by\ | |
198 * decoding: set by lavc\ | |
199 */\ | |
200 int coded_picture_number;\ | |
201 /**\ | |
202 * encoding: set by\ | |
203 * decoding: set by lavc\ | |
204 * picture number in display order.\ | |
205 */\ | |
206 int display_picture_number;\ | |
207 \ | |
208 /**\ | |
209 * quality (between 1 (good) and 31 (bad)) \ | |
210 * encoding: set by lavc for coded_picture (and set by user for input)\ | |
211 * decoding: set by lavc\ | |
212 */\ | |
213 float quality; \ | |
214 \ | |
215 /**\ | |
216 * buffer age (1->was last buffer and dint change, 2->..., ...).\ | |
217 * set to something large if the buffer has not been used yet \ | |
218 * encoding: unused\ | |
219 * decoding: MUST be set by get_buffer()\ | |
220 */\ | |
221 int age;\ | |
222 \ | |
223 /**\ | |
224 * is this picture used as reference\ | |
225 * encoding: unused\ | |
226 * decoding: set by lavc (before get_buffer() call))\ | |
227 */\ | |
228 int reference;\ | |
229 \ | |
230 /**\ | |
231 * QP table\ | |
232 * encoding: unused\ | |
233 * decoding: set by lavc\ | |
234 */\ | |
235 int8_t *qscale_table;\ | |
236 /**\ | |
237 * QP store stride\ | |
238 * encoding: unused\ | |
239 * decoding: set by lavc\ | |
240 */\ | |
241 int qstride;\ | |
242 \ | |
243 /**\ | |
244 * mbskip_table[mb]>=1 if MB didnt change\ | |
245 * stride= mb_width = (width+15)>>4\ | |
246 * encoding: unused\ | |
247 * decoding: set by lavc\ | |
248 */\ | |
249 uint8_t *mbskip_table;\ | |
250 \ | |
251 /**\ | |
252 * for some private data of the user\ | |
253 * encoding: unused\ | |
254 * decoding: set by user\ | |
255 */\ | |
256 void *opaque;\ | |
909
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
257 \ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
258 /**\ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
259 * error\ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
260 * encoding: set by lavc if flags&CODEC_FLAG_PSNR\ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
261 * decoding: unused\ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
262 */\ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
263 uint64_t error[4];\ |
924 | 264 \ |
265 /**\ | |
266 * type of the buffer (to keep track of who has to dealloc data[*])\ | |
267 * encoding: set by the one who allocs it\ | |
268 * decoding: set by the one who allocs it\ | |
269 * Note: user allocated (direct rendering) & internal buffers can not coexist currently\ | |
270 */\ | |
271 int type;\ | |
272 | |
273 #define FF_BUFFER_TYPE_INTERNAL 1 | |
274 #define FF_BUFFER_TYPE_USER 2 // Direct rendering buffers | |
275 #define FF_BUFFER_TYPE_SHARED 4 // input frame for encoding(wont be dealloced) | |
276 | |
903 | 277 |
909
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
278 #define FF_I_TYPE 1 // Intra |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
279 #define FF_P_TYPE 2 // Predicted |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
280 #define FF_B_TYPE 3 // Bi-dir predicted |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
281 #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4 |
903 | 282 |
925 | 283 typedef struct AVFrame { |
284 FF_COMMON_FRAME | |
285 } AVFrame; | |
903 | 286 |
0 | 287 typedef struct AVCodecContext { |
684 | 288 /** |
289 * the average bitrate | |
290 * encoding: set by user. unused for constant quantizer encoding | |
291 * decoding: set by lavc. 0 or some bitrate if this info is available in the stream | |
292 */ | |
0 | 293 int bit_rate; |
684 | 294 |
295 /** | |
296 * number of bits the bitstream is allowed to diverge from the reference | |
297 * the reference can be CBR (for CBR pass1) or VBR (for pass2) | |
298 * encoding: set by user. unused for constant quantizer encoding | |
299 * decoding: unused | |
300 */ | |
301 int bit_rate_tolerance; | |
302 | |
303 /** | |
304 * CODEC_FLAG_* | |
305 * encoding: set by user. | |
306 * decoding: set by user. | |
307 */ | |
0 | 308 int flags; |
684 | 309 |
310 /** | |
311 * some codecs needs additionnal format info. It is stored here | |
312 * encoding: set by user. | |
313 * decoding: set by lavc. (FIXME is this ok?) | |
314 */ | |
315 int sub_id; | |
316 | |
317 /** | |
318 * motion estimation algorithm used for video coding | |
903 | 319 * encoding: MUST be set by user. |
684 | 320 * decoding: unused |
321 */ | |
322 int me_method; | |
323 | |
324 /** | |
325 * some codecs need / can use extra-data like huffman tables | |
326 * mjpeg: huffman tables | |
327 * rv10: additional flags | |
747
3d4377531f6c
mpeg4 header parser clenup (needed for parsing of VOL header in avctx->extradata)
michaelni
parents:
745
diff
changeset
|
328 * mpeg4: global headers (they can be in the bitstream or here) |
690
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
329 * encoding: set/allocated/freed by lavc. |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
330 * decoding: set/allocated/freed by user. |
684 | 331 */ |
349
34f6c77ff01a
Support for external huffman table and various fixes by Alex Beregszaszi <alex@naxine.org>
arpi_esp
parents:
345
diff
changeset
|
332 void *extradata; |
34f6c77ff01a
Support for external huffman table and various fixes by Alex Beregszaszi <alex@naxine.org>
arpi_esp
parents:
345
diff
changeset
|
333 int extradata_size; |
34f6c77ff01a
Support for external huffman table and various fixes by Alex Beregszaszi <alex@naxine.org>
arpi_esp
parents:
345
diff
changeset
|
334 |
0 | 335 /* video only */ |
684 | 336 /** |
337 * frames per sec multiplied by FRAME_RATE_BASE | |
338 * for variable fps this is the precission, so if the timestamps | |
339 * can be specified in msec precssion then this is 1000*FRAME_RATE_BASE | |
903 | 340 * encoding: MUST be set by user |
684 | 341 * decoding: set by lavc. 0 or the frame_rate if available |
342 */ | |
343 int frame_rate; | |
344 | |
345 /** | |
903 | 346 * encoding: MUST be set by user. |
684 | 347 * decoding: set by user, some codecs might override / change it during playback |
348 */ | |
0 | 349 int width, height; |
684 | 350 |
282 | 351 #define FF_ASPECT_SQUARE 1 |
352 #define FF_ASPECT_4_3_625 2 | |
353 #define FF_ASPECT_4_3_525 3 | |
354 #define FF_ASPECT_16_9_625 4 | |
355 #define FF_ASPECT_16_9_525 5 | |
618 | 356 #define FF_ASPECT_EXTENDED 15 |
684 | 357 |
358 /** | |
359 * the number of pictures in a group of pitures, or 0 for intra_only | |
360 * encoding: set by user. | |
361 * decoding: unused | |
362 */ | |
363 int gop_size; | |
364 | |
365 /** | |
366 * pixel format, see PIX_FMT_xxx | |
367 * encoding: unused | |
368 * decoding: set by lavc. | |
369 */ | |
370 enum PixelFormat pix_fmt; | |
371 | |
383
e6b64bc3bc87
- repeat_pict meaning changed, now it signals the extra delay for the
pulento
parents:
382
diff
changeset
|
372 int repeat_pict; /* when decoding, this signal how much the picture */ |
e6b64bc3bc87
- repeat_pict meaning changed, now it signals the extra delay for the
pulento
parents:
382
diff
changeset
|
373 /* must be delayed. */ |
e6b64bc3bc87
- repeat_pict meaning changed, now it signals the extra delay for the
pulento
parents:
382
diff
changeset
|
374 /* extra_delay = (repeat_pict / 2) * (1/fps) */ |
684 | 375 |
376 /** | |
377 * if non NULL, 'draw_horiz_band' is called by the libavcodec | |
378 * decoder to draw an horizontal band. It improve cache usage. Not | |
379 * all codecs can do that. You must check the codec capabilities | |
380 * before | |
381 * encoding: unused | |
382 * decoding: set by user. | |
383 */ | |
67 | 384 void (*draw_horiz_band)(struct AVCodecContext *s, |
385 UINT8 **src_ptr, int linesize, | |
386 int y, int width, int height); | |
387 | |
0 | 388 /* audio only */ |
389 int sample_rate; /* samples per sec */ | |
390 int channels; | |
92 | 391 int sample_fmt; /* sample format, currenly unused */ |
0 | 392 |
393 /* the following data should not be initialized */ | |
376 | 394 int frame_size; /* in samples, initialized when calling 'init' */ |
395 int frame_number; /* audio or video frame number */ | |
396 int real_pict_num; /* returns the real picture number of | |
397 previous encoded frame */ | |
903 | 398 |
684 | 399 /** |
400 * number of frames the decoded output will be delayed relative to | |
401 * the encoded input | |
402 * encoding: set by lavc. | |
403 * decoding: unused | |
404 */ | |
405 int delay; | |
336 | 406 |
407 /* encoding parameters */ | |
268 | 408 float qcompress; /* amount of qscale change between easy & hard scenes (0.0-1.0)*/ |
409 float qblur; /* amount of qscale smoothing over time (0.0-1.0) */ | |
684 | 410 |
411 /** | |
412 * minimum quantizer | |
413 * encoding: set by user. | |
414 * decoding: unused | |
415 */ | |
416 int qmin; | |
417 | |
418 /** | |
419 * maximum quantizer | |
420 * encoding: set by user. | |
421 * decoding: unused | |
422 */ | |
423 int qmax; | |
424 | |
425 /** | |
426 * maximum quantizer difference etween frames | |
427 * encoding: set by user. | |
428 * decoding: unused | |
429 */ | |
430 int max_qdiff; | |
431 | |
432 /** | |
433 * maximum number of b frames between non b frames | |
434 * note: the output will be delayed by max_b_frames+1 relative to the input | |
435 * encoding: set by user. | |
436 * decoding: unused | |
437 */ | |
438 int max_b_frames; | |
439 | |
440 /** | |
441 * qscale factor between ip and b frames | |
442 * encoding: set by user. | |
443 * decoding: unused | |
444 */ | |
445 float b_quant_factor; | |
446 | |
447 /** obsolete FIXME remove */ | |
448 int rc_strategy; | |
329 | 449 int b_frame_strategy; |
324 | 450 |
684 | 451 /** |
452 * encoding: unused | |
845
32de034be20e
hurry_up>=5 -> skip everything except header & set pict_type&key_frame
michaelni
parents:
843
diff
changeset
|
453 * decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header |
684 | 454 */ |
455 int hurry_up; | |
345 | 456 |
0 | 457 struct AVCodec *codec; |
684 | 458 |
0 | 459 void *priv_data; |
460 | |
162 | 461 /* The following data is for RTP friendly coding */ |
460 | 462 /* By now only H.263/H.263+/MPEG4 coder honours this */ |
162 | 463 int rtp_mode; /* 1 for activate RTP friendly-mode */ |
464 /* highers numbers represent more error-prone */ | |
465 /* enviroments, by now just "1" exist */ | |
466 | |
467 int rtp_payload_size; /* The size of the RTP payload, the coder will */ | |
468 /* do it's best to deliver a chunk with size */ | |
469 /* below rtp_payload_size, the chunk will start */ | |
470 /* with a start code on some codecs like H.263 */ | |
471 /* This doesn't take account of any particular */ | |
472 /* headers inside the transmited RTP payload */ | |
231 | 473 |
474 | |
475 /* The RTP callcack: This function is called */ | |
476 /* every time the encoder as a packet to send */ | |
477 /* Depends on the encoder if the data starts */ | |
478 /* with a Start Code (it should) H.263 does */ | |
479 void (*rtp_callback)(void *data, int size, int packet_number); | |
480 | |
286 | 481 /* statistics, used for 2-pass encoding */ |
482 int mv_bits; | |
483 int header_bits; | |
484 int i_tex_bits; | |
485 int p_tex_bits; | |
486 int i_count; | |
487 int p_count; | |
488 int skip_count; | |
684 | 489 int misc_bits; |
490 | |
491 /** | |
492 * number of bits used for the previously encoded frame | |
493 * encoding: set by lavc | |
849 | 494 * decoding: - for audio - bits_per_sample |
684 | 495 */ |
286 | 496 int frame_bits; |
162 | 497 |
684 | 498 /** |
499 * private data of the user, can be used to carry app specific stuff | |
500 * encoding: set by user | |
501 * decoding: set by user | |
502 */ | |
503 void *opaque; | |
504 | |
0 | 505 char codec_name[32]; |
371
8187bb132d85
* Start using enumerated types (makes debugging much easier)
philipjsg
parents:
367
diff
changeset
|
506 enum CodecType codec_type; /* see CODEC_TYPE_xxx */ |
8187bb132d85
* Start using enumerated types (makes debugging much easier)
philipjsg
parents:
367
diff
changeset
|
507 enum CodecID codec_id; /* see CODEC_ID_xxx */ |
0 | 508 unsigned int codec_tag; /* codec tag, only used if unknown codec */ |
411
5c8b3a717929
workaround dc_scale bug in old ffmpeg msmpeg4v3 encoder (set workaround_bugs=1 for this)
michaelni
parents:
399
diff
changeset
|
509 |
684 | 510 /** |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
511 * workaround bugs in encoders which sometimes cannot be detected automatically |
684 | 512 * encoding: unused |
513 * decoding: set by user | |
514 */ | |
515 int workaround_bugs; | |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
516 #define FF_BUG_AUTODETECT 1 //autodetection |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
517 #define FF_BUG_OLD_MSMPEG4 2 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
518 #define FF_BUG_XVID_ILACE 4 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
519 #define FF_BUG_UMP4 8 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
520 #define FF_BUG_NO_PADDING 16 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
521 #define FF_BUG_AC_VLC 32 |
760 | 522 #define FF_BUG_QPEL_CHROMA 64 |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
523 //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100% |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
524 |
684 | 525 /** |
526 * encoding: set by user | |
527 * decoding: unused | |
528 */ | |
460 | 529 int luma_elim_threshold; |
684 | 530 |
531 /** | |
532 * encoding: set by user | |
533 * decoding: unused | |
534 */ | |
460 | 535 int chroma_elim_threshold; |
684 | 536 |
537 /** | |
538 * strictly follow the std (MPEG4, ...) | |
539 * encoding: set by user | |
540 * decoding: unused | |
541 */ | |
542 int strict_std_compliance; | |
543 | |
544 /** | |
545 * qscale offset between ip and b frames | |
686
83d2c9d50d7d
fixing i_quant_factor, this should finally fix the bitrate bug with ffserver hopefully
michaelni
parents:
684
diff
changeset
|
546 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) |
83d2c9d50d7d
fixing i_quant_factor, this should finally fix the bitrate bug with ffserver hopefully
michaelni
parents:
684
diff
changeset
|
547 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
684 | 548 * encoding: set by user. |
549 * decoding: unused | |
550 */ | |
551 float b_quant_offset; | |
552 | |
553 /** | |
905
2b93dc762f9a
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
michaelni
parents:
903
diff
changeset
|
554 * error resilience higher values will detect more errors but may missdetect |
684 | 555 * some more or less valid parts as errors |
556 * encoding: unused | |
557 * decoding: set by user | |
558 */ | |
460 | 559 int error_resilience; |
905
2b93dc762f9a
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
michaelni
parents:
903
diff
changeset
|
560 #define FF_ER_CAREFULL 1 |
2b93dc762f9a
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
michaelni
parents:
903
diff
changeset
|
561 #define FF_ER_COMPLIANT 2 |
2b93dc762f9a
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
michaelni
parents:
903
diff
changeset
|
562 #define FF_ER_AGGRESSIVE 3 |
2b93dc762f9a
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
michaelni
parents:
903
diff
changeset
|
563 #define FF_ER_VERY_AGGRESSIVE 4 |
466
805714c0c10f
new field for communicating with external postprocessing
nickols_k
parents:
460
diff
changeset
|
564 |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
565 /** |
903 | 566 * called at the beginning of each frame to get a buffer for it. |
567 * if pic.reference is set then the frame will be read later by lavc | |
568 * encoding: unused | |
569 * decoding: set by lavc, user can override | |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
570 */ |
925 | 571 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); |
684 | 572 |
573 /** | |
903 | 574 * called to release buffers which where allocated with get_buffer. |
575 * a released buffer can be reused in get_buffer() | |
576 * pic.data[*] must be set to NULL | |
684 | 577 * encoding: unused |
903 | 578 * decoding: set by lavc, user can override |
684 | 579 */ |
925 | 580 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); |
556 | 581 |
684 | 582 /** |
583 * is 1 if the decoded stream contains b frames, 0 otherwise | |
584 * encoding: unused | |
585 * decoding: set by lavc | |
586 */ | |
587 int has_b_frames; | |
588 | |
783 | 589 int block_align; /* used by some WAV based audio codecs */ |
613 | 590 |
581
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
591 int parse_only; /* decoding only: if true, only parsing is done |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
592 (function avcodec_parse_frame()). The frame |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
593 data is returned. Only MPEG codecs support this now. */ |
613 | 594 |
684 | 595 /** |
596 * 0-> h263 quant 1-> mpeg quant | |
597 * encoding: set by user. | |
598 * decoding: unused | |
599 */ | |
600 int mpeg_quant; | |
613 | 601 |
684 | 602 /** |
603 * pass1 encoding statistics output buffer | |
604 * encoding: set by lavc | |
605 * decoding: unused | |
606 */ | |
613 | 607 char *stats_out; /* encoding statistics output buffer */ |
684 | 608 |
609 /** | |
610 * pass2 encoding statistics input buffer. | |
611 * concatenated stuff from stats_out of pass1 should be placed here | |
612 * encoding: allocated/set/freed by user | |
613 * decoding: unused | |
614 */ | |
615 char *stats_in; | |
616 | |
617 /** | |
618 * ratecontrol qmin qmax limiting method | |
619 * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax | |
620 * encoding: set by user. | |
621 * decoding: unused | |
622 */ | |
613 | 623 float rc_qsquish; |
684 | 624 |
613 | 625 float rc_qmod_amp; |
626 int rc_qmod_freq; | |
684 | 627 |
628 /** | |
629 * ratecontrol override, see RcOverride | |
630 * encoding: allocated/set/freed by user. | |
631 * decoding: unused | |
632 */ | |
613 | 633 RcOverride *rc_override; |
634 int rc_override_count; | |
684 | 635 |
636 /** | |
637 * rate control equation | |
638 * encoding: set by user | |
639 * decoding: unused | |
640 */ | |
613 | 641 char *rc_eq; |
684 | 642 |
643 /** | |
644 * maximum bitrate | |
645 * encoding: set by user. | |
646 * decoding: unused | |
647 */ | |
613 | 648 int rc_max_rate; |
684 | 649 |
650 /** | |
651 * minimum bitrate | |
652 * encoding: set by user. | |
653 * decoding: unused | |
654 */ | |
613 | 655 int rc_min_rate; |
684 | 656 |
657 /** | |
658 * decoder bitstream buffer size | |
659 * encoding: set by user. | |
660 * decoding: unused | |
661 */ | |
613 | 662 int rc_buffer_size; |
663 float rc_buffer_aggressivity; | |
684 | 664 |
665 /** | |
666 * qscale factor between p and i frames | |
667 * encoding: set by user. | |
668 * decoding: unused | |
669 */ | |
670 float i_quant_factor; | |
671 | |
672 /** | |
673 * qscale offset between p and i frames | |
686
83d2c9d50d7d
fixing i_quant_factor, this should finally fix the bitrate bug with ffserver hopefully
michaelni
parents:
684
diff
changeset
|
674 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) |
83d2c9d50d7d
fixing i_quant_factor, this should finally fix the bitrate bug with ffserver hopefully
michaelni
parents:
684
diff
changeset
|
675 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
684 | 676 * encoding: set by user. |
677 * decoding: unused | |
678 */ | |
679 float i_quant_offset; | |
680 | |
681 /** | |
682 * initial complexity for pass1 ratecontrol | |
683 * encoding: set by user. | |
684 * decoding: unused | |
685 */ | |
613 | 686 float rc_initial_cplx; |
581
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
687 |
684 | 688 /** |
689 * dct algorithm, see FF_DCT_* below | |
690 * encoding: set by user | |
691 * decoding: unused | |
692 */ | |
625
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
618
diff
changeset
|
693 int dct_algo; |
628
f596db4aa871
sun solaris compilation bugfix, patch by (Martin Olschewski <olschewski at zpr dot uni-koeln dot de>)
michaelni
parents:
625
diff
changeset
|
694 #define FF_DCT_AUTO 0 |
625
bb6a69f9d409
slow but accurate integer dct from IJG (should be ok with the LGPL as the old DCT is the fast integer DCT from IJG)
michaelni
parents:
618
diff
changeset
|
695 #define FF_DCT_FASTINT 1 |
628
f596db4aa871
sun solaris compilation bugfix, patch by (Martin Olschewski <olschewski at zpr dot uni-koeln dot de>)
michaelni
parents:
625
diff
changeset
|
696 #define FF_DCT_INT 2 |
f596db4aa871
sun solaris compilation bugfix, patch by (Martin Olschewski <olschewski at zpr dot uni-koeln dot de>)
michaelni
parents:
625
diff
changeset
|
697 #define FF_DCT_MMX 3 |
f596db4aa871
sun solaris compilation bugfix, patch by (Martin Olschewski <olschewski at zpr dot uni-koeln dot de>)
michaelni
parents:
625
diff
changeset
|
698 #define FF_DCT_MLIB 4 |
828
ace3ccd18dd2
Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents:
827
diff
changeset
|
699 #define FF_DCT_ALTIVEC 5 |
690
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
700 |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
701 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
702 * luminance masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
703 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
704 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
705 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
706 float lumi_masking; |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
707 |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
708 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
709 * temporary complexity masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
710 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
711 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
712 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
713 float temporal_cplx_masking; |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
714 |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
715 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
716 * spatial complexity masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
717 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
718 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
719 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
720 float spatial_cplx_masking; |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
721 |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
722 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
723 * p block masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
724 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
725 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
726 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
727 float p_masking; |
654 | 728 |
693
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
729 /** |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
730 * darkness masking (0-> disabled) |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
731 * encoding: set by user |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
732 * decoding: unused |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
733 */ |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
734 float dark_masking; |
700
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
735 |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
736 /** |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
737 * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A') |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
738 * this is used to workaround some encoder bugs |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
739 * encoding: unused |
701 | 740 * decoding: set by user, will be converted to upper case by lavc during init |
700
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
741 */ |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
742 int fourcc; |
693
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
743 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
744 /** |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
745 * idct algorithm, see FF_IDCT_* below |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
746 * encoding: set by user |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
747 * decoding: set by user |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
748 */ |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
749 int idct_algo; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
750 #define FF_IDCT_AUTO 0 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
751 #define FF_IDCT_INT 1 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
752 #define FF_IDCT_SIMPLE 2 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
753 #define FF_IDCT_SIMPLEMMX 3 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
754 #define FF_IDCT_LIBMPEG2MMX 4 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
755 #define FF_IDCT_PS2 5 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
756 #define FF_IDCT_MLIB 6 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
757 #define FF_IDCT_ARM 7 |
828
ace3ccd18dd2
Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents:
827
diff
changeset
|
758 #define FF_IDCT_ALTIVEC 8 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
759 |
713
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
760 /** |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
761 * slice count |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
762 * encoding: set by lavc |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
763 * decoding: set by user (or 0) |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
764 */ |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
765 int slice_count; |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
766 /** |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
767 * slice offsets in the frame in bytes |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
768 * encoding: set/allocated by lavc |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
769 * decoding: set/allocated by user (or NULL) |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
770 */ |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
771 int *slice_offset; |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
772 |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
773 /** |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
774 * error concealment flags |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
775 * encoding: unused |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
776 * decoding: set by user |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
777 */ |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
778 int error_concealment; |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
779 #define FF_EC_GUESS_MVS 1 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
780 #define FF_EC_DEBLOCK 2 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
781 |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
782 /** |
849 | 783 * dsp_mask could be used to disable unwanted |
784 * CPU features (i.e. MMX, SSE. ...) | |
785 */ | |
786 unsigned dsp_mask; | |
866 | 787 |
788 /** | |
789 * bits per sample/pixel from the demuxer (needed for huffyuv) | |
903 | 790 * encoding: set by lavc |
866 | 791 * decoding: set by user |
792 */ | |
793 int bits_per_sample; | |
794 | |
795 /** | |
796 * prediction method (needed for huffyuv) | |
903 | 797 * encoding: set by user |
866 | 798 * decoding: unused |
799 */ | |
800 int prediction_method; | |
801 #define FF_PRED_LEFT 0 | |
802 #define FF_PRED_PLANE 1 | |
803 #define FF_PRED_MEDIAN 2 | |
880 | 804 |
805 /** | |
806 * aspect ratio. (0 if unknown) | |
807 * encoding: set by user. | |
808 * decoding: set by lavc. | |
809 */ | |
810 float aspect_ratio; | |
903 | 811 |
812 /** | |
813 * the picture in the bitstream | |
814 * encoding: set by lavc | |
815 * decoding: set by lavc | |
816 */ | |
925 | 817 AVFrame *coded_frame; |
906 | 818 |
819 /** | |
820 * debug | |
821 * encoding: set by user. | |
822 * decoding: set by user. | |
823 */ | |
824 int debug; | |
825 #define FF_DEBUG_PICT_INFO 1 | |
826 #define FF_DEBUG_RC 2 | |
827 #define FF_DEBUG_BITSTREAM 4 | |
828 #define FF_DEBUG_MB_TYPE 8 | |
829 #define FF_DEBUG_QP 16 | |
830 #define FF_DEBUG_MV 32 | |
942 | 831 #define FF_DEBUG_VIS_MV 0x00000040 |
832 #define FF_DEBUG_SKIP 0x00000080 | |
833 #define FF_DEBUG_STARTCODE 0x00000100 | |
834 #define FF_DEBUG_PTS 0x00000200 | |
909
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
835 |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
836 /** |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
837 * error |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
838 * encoding: set by lavc if flags&CODEC_FLAG_PSNR |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
839 * decoding: unused |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
840 */ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
841 uint64_t error[4]; |
932 | 842 |
843 /** | |
844 * minimum MB quantizer | |
845 * encoding: set by user. | |
846 * decoding: unused | |
847 */ | |
848 int mb_qmin; | |
849 | |
850 /** | |
851 * maximum MB quantizer | |
852 * encoding: set by user. | |
853 * decoding: unused | |
854 */ | |
855 int mb_qmax; | |
936 | 856 |
857 /** | |
858 * motion estimation compare function | |
859 * encoding: set by user. | |
860 * decoding: unused | |
861 */ | |
862 int me_cmp; | |
863 /** | |
864 * subpixel motion estimation compare function | |
865 * encoding: set by user. | |
866 * decoding: unused | |
867 */ | |
868 int me_sub_cmp; | |
869 /** | |
870 * macroblock compare function (not supported yet) | |
871 * encoding: set by user. | |
872 * decoding: unused | |
873 */ | |
874 int mb_cmp; | |
875 #define FF_CMP_SAD 0 | |
876 #define FF_CMP_SSE 1 | |
877 #define FF_CMP_SATD 2 | |
878 #define FF_CMP_DCT 3 | |
879 #define FF_CMP_PSNR 4 | |
880 #define FF_CMP_BIT 5 | |
881 #define FF_CMP_RD 6 | |
882 #define FF_CMP_ZERO 7 | |
883 #define FF_CMP_CHROMA 256 | |
884 | |
885 /** | |
948 | 886 * ME diamond size & shape |
936 | 887 * encoding: set by user. |
888 * decoding: unused | |
889 */ | |
890 int dia_size; | |
948 | 891 |
892 /** | |
893 * amount of previous MV predictors (2a+1 x 2a+1 square) | |
894 * encoding: set by user. | |
895 * decoding: unused | |
896 */ | |
897 int last_predictor_count; | |
953 | 898 |
951 | 899 /** |
900 * pre pass for motion estimation | |
901 * encoding: set by user. | |
902 * decoding: unused | |
903 */ | |
904 int pre_me; | |
948 | 905 |
953 | 906 /** |
907 * motion estimation pre pass compare function | |
908 * encoding: set by user. | |
909 * decoding: unused | |
910 */ | |
911 int me_pre_cmp; | |
954 | 912 |
953 | 913 /** |
914 * ME pre pass diamond size & shape | |
915 * encoding: set by user. | |
916 * decoding: unused | |
917 */ | |
918 int pre_dia_size; | |
919 | |
954 | 920 /** |
921 * subpel ME quality | |
922 * encoding: set by user. | |
923 * decoding: unused | |
924 */ | |
925 int me_subpel_quality; | |
926 | |
0 | 927 } AVCodecContext; |
928 | |
929 typedef struct AVCodec { | |
862 | 930 const char *name; |
0 | 931 int type; |
932 int id; | |
933 int priv_data_size; | |
934 int (*init)(AVCodecContext *); | |
935 int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data); | |
936 int (*close)(AVCodecContext *); | |
556 | 937 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, |
0 | 938 UINT8 *buf, int buf_size); |
67 | 939 int capabilities; |
0 | 940 struct AVCodec *next; |
941 } AVCodec; | |
942 | |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
943 /** |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
944 * four components are given, that's all. |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
945 * the last component is alpha |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
946 */ |
0 | 947 typedef struct AVPicture { |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
948 UINT8 *data[4]; |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
949 int linesize[4]; |
0 | 950 } AVPicture; |
951 | |
952 extern AVCodec ac3_encoder; | |
953 extern AVCodec mp2_encoder; | |
260
e1bacfb3f51f
- Added MP3 encoding through libmp3lame contributed by Lennert Buytenhek.
pulento
parents:
252
diff
changeset
|
954 extern AVCodec mp3lame_encoder; |
636
57b9a37546a0
oggvorbis support patch by (Mark Hills <mark at pogo dot org dot uk>)
michaelni
parents:
630
diff
changeset
|
955 extern AVCodec oggvorbis_encoder; |
0 | 956 extern AVCodec mpeg1video_encoder; |
957 extern AVCodec h263_encoder; | |
958 extern AVCodec h263p_encoder; | |
959 extern AVCodec rv10_encoder; | |
960 extern AVCodec mjpeg_encoder; | |
67 | 961 extern AVCodec mpeg4_encoder; |
307 | 962 extern AVCodec msmpeg4v1_encoder; |
963 extern AVCodec msmpeg4v2_encoder; | |
964 extern AVCodec msmpeg4v3_encoder; | |
500 | 965 extern AVCodec wmv1_encoder; |
966 extern AVCodec wmv2_encoder; | |
866 | 967 extern AVCodec huffyuv_encoder; |
0 | 968 |
969 extern AVCodec h263_decoder; | |
67 | 970 extern AVCodec mpeg4_decoder; |
307 | 971 extern AVCodec msmpeg4v1_decoder; |
972 extern AVCodec msmpeg4v2_decoder; | |
973 extern AVCodec msmpeg4v3_decoder; | |
311 | 974 extern AVCodec wmv1_decoder; |
500 | 975 extern AVCodec wmv2_decoder; |
0 | 976 extern AVCodec mpeg_decoder; |
977 extern AVCodec h263i_decoder; | |
978 extern AVCodec rv10_decoder; | |
521 | 979 extern AVCodec svq1_decoder; |
724 | 980 extern AVCodec dvvideo_decoder; |
981 extern AVCodec dvaudio_decoder; | |
783 | 982 extern AVCodec wmav1_decoder; |
983 extern AVCodec wmav2_decoder; | |
24 | 984 extern AVCodec mjpeg_decoder; |
881 | 985 extern AVCodec mjpegb_decoder; |
322 | 986 extern AVCodec mp2_decoder; |
92 | 987 extern AVCodec mp3_decoder; |
827
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
988 extern AVCodec mace3_decoder; |
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
989 extern AVCodec mace6_decoder; |
866 | 990 extern AVCodec huffyuv_decoder; |
883 | 991 extern AVCodec oggvorbis_decoder; |
0 | 992 |
92 | 993 /* pcm codecs */ |
994 #define PCM_CODEC(id, name) \ | |
995 extern AVCodec name ## _decoder; \ | |
846
ade627a74709
avoid duplicate ";" warnings (based upon a patch by mru at users dot sourceforge dot net (Mns Rullgrd))
michaelni
parents:
845
diff
changeset
|
996 extern AVCodec name ## _encoder |
92 | 997 |
998 PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le); | |
999 PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be); | |
1000 PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le); | |
1001 PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be); | |
1002 PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8); | |
1003 PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8); | |
1004 PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw); | |
1005 PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw); | |
1006 | |
573
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1007 /* adpcm codecs */ |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1008 |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1009 PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt); |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1010 PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav); |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1011 PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms); |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1012 |
92 | 1013 #undef PCM_CODEC |
1014 | |
1015 /* dummy raw video codec */ | |
0 | 1016 extern AVCodec rawvideo_codec; |
1017 | |
1018 /* the following codecs use external GPL libs */ | |
1019 extern AVCodec ac3_decoder; | |
1020 | |
1021 /* resample.c */ | |
1022 | |
1023 struct ReSampleContext; | |
1024 | |
1025 typedef struct ReSampleContext ReSampleContext; | |
1026 | |
1027 ReSampleContext *audio_resample_init(int output_channels, int input_channels, | |
1028 int output_rate, int input_rate); | |
1029 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); | |
1030 void audio_resample_close(ReSampleContext *s); | |
1031 | |
1032 /* YUV420 format is assumed ! */ | |
1033 | |
1034 struct ImgReSampleContext; | |
1035 | |
1036 typedef struct ImgReSampleContext ImgReSampleContext; | |
1037 | |
1038 ImgReSampleContext *img_resample_init(int output_width, int output_height, | |
1039 int input_width, int input_height); | |
630
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1040 |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1041 ImgReSampleContext *img_resample_full_init(int owidth, int oheight, |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1042 int iwidth, int iheight, |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1043 int topBand, int bottomBand, |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1044 int leftBand, int rightBand); |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1045 |
0 | 1046 void img_resample(ImgReSampleContext *s, |
1047 AVPicture *output, AVPicture *input); | |
1048 | |
1049 void img_resample_close(ImgReSampleContext *s); | |
1050 | |
49 | 1051 void avpicture_fill(AVPicture *picture, UINT8 *ptr, |
1052 int pix_fmt, int width, int height); | |
1053 int avpicture_get_size(int pix_fmt, int width, int height); | |
903 | 1054 void avcodec_get_chroma_sub_sample(int fmt, int *h_shift, int *v_shift); |
49 | 1055 |
1056 /* convert among pixel formats */ | |
1057 int img_convert(AVPicture *dst, int dst_pix_fmt, | |
1058 AVPicture *src, int pix_fmt, | |
1059 int width, int height); | |
1060 | |
1061 /* deinterlace a picture */ | |
1062 int avpicture_deinterlace(AVPicture *dst, AVPicture *src, | |
0 | 1063 int pix_fmt, int width, int height); |
1064 | |
1065 /* external high level API */ | |
1066 | |
1067 extern AVCodec *first_avcodec; | |
1068 | |
362 | 1069 /* returns LIBAVCODEC_VERSION_INT constant */ |
399 | 1070 unsigned avcodec_version(void); |
379 | 1071 /* returns LIBAVCODEC_BUILD constant */ |
399 | 1072 unsigned avcodec_build(void); |
0 | 1073 void avcodec_init(void); |
1074 | |
399 | 1075 void avcodec_set_bit_exact(void); |
1076 | |
0 | 1077 void register_avcodec(AVCodec *format); |
1078 AVCodec *avcodec_find_encoder(enum CodecID id); | |
177 | 1079 AVCodec *avcodec_find_encoder_by_name(const char *name); |
0 | 1080 AVCodec *avcodec_find_decoder(enum CodecID id); |
1081 AVCodec *avcodec_find_decoder_by_name(const char *name); | |
1082 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); | |
1083 | |
903 | 1084 void avcodec_get_context_defaults(AVCodecContext *s); |
703 | 1085 AVCodecContext *avcodec_alloc_context(void); |
925 | 1086 AVFrame *avcodec_alloc_frame(void); |
903 | 1087 |
925 | 1088 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); |
1089 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); | |
903 | 1090 |
0 | 1091 int avcodec_open(AVCodecContext *avctx, AVCodec *codec); |
1092 int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples, | |
1093 int *frame_size_ptr, | |
1094 UINT8 *buf, int buf_size); | |
925 | 1095 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, |
0 | 1096 int *got_picture_ptr, |
1097 UINT8 *buf, int buf_size); | |
581
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
1098 int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata, |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
1099 int *data_size_ptr, |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
1100 UINT8 *buf, int buf_size); |
0 | 1101 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, |
1102 const short *samples); | |
1103 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, | |
925 | 1104 const AVFrame *pict); |
0 | 1105 |
1106 int avcodec_close(AVCodecContext *avctx); | |
1107 | |
1108 void avcodec_register_all(void); | |
92 | 1109 |
341 | 1110 void avcodec_flush_buffers(AVCodecContext *avctx); |
1111 | |
382 | 1112 /** |
1113 * Interface for 0.5.0 version | |
1114 * | |
1115 * do not even think about it's usage for this moment | |
1116 */ | |
1117 | |
1118 typedef struct { | |
1119 // compressed size used from given memory buffer | |
1120 int size; | |
1121 /// I/P/B frame type | |
1122 int frame_type; | |
1123 } avc_enc_result_t; | |
1124 | |
1125 /** | |
1126 * Commands | |
1127 * order can't be changed - once it was defined | |
1128 */ | |
1129 typedef enum { | |
1130 // general commands | |
1131 AVC_OPEN_BY_NAME = 0xACA000, | |
1132 AVC_OPEN_BY_CODEC_ID, | |
1133 AVC_OPEN_BY_FOURCC, | |
1134 AVC_CLOSE, | |
1135 | |
1136 AVC_FLUSH, | |
1137 // pin - struct { uint8_t* src, uint_t src_size } | |
1138 // pout - struct { AVPicture* img, consumed_bytes, | |
1139 AVC_DECODE, | |
1140 // pin - struct { AVPicture* img, uint8_t* dest, uint_t dest_size } | |
1141 // pout - uint_t used_from_dest_size | |
1142 AVC_ENCODE, | |
1143 | |
1144 // query/get video commands | |
1145 AVC_GET_VERSION = 0xACB000, | |
1146 AVC_GET_WIDTH, | |
1147 AVC_GET_HEIGHT, | |
1148 AVC_GET_DELAY, | |
1149 AVC_GET_QUANT_TABLE, | |
1150 // ... | |
1151 | |
1152 // query/get audio commands | |
1153 AVC_GET_FRAME_SIZE = 0xABC000, | |
1154 | |
1155 // maybe define some simple structure which | |
1156 // might be passed to the user - but they can't | |
1157 // contain any codec specific parts and these | |
1158 // calls are usualy necessary only few times | |
1159 | |
1160 // set video commands | |
1161 AVC_SET_WIDTH = 0xACD000, | |
1162 AVC_SET_HEIGHT, | |
1163 | |
1164 // set video encoding commands | |
1165 AVC_SET_FRAME_RATE = 0xACD800, | |
1166 AVC_SET_QUALITY, | |
1167 AVC_SET_HURRY_UP, | |
1168 | |
1169 // set audio commands | |
1170 AVC_SET_SAMPLE_RATE = 0xACE000, | |
1171 AVC_SET_CHANNELS, | |
1172 | |
1173 } avc_cmd_t; | |
1174 | |
1175 /** | |
1176 * \param handle allocated private structure by libavcodec | |
1177 * for initialization pass NULL - will be returned pout | |
1178 * user is supposed to know nothing about its structure | |
1179 * \param cmd type of operation to be performed | |
1180 * \param pint input parameter | |
1181 * \param pout output parameter | |
1182 * | |
1183 * \returns command status - eventually for query command it might return | |
1184 * integer resulting value | |
1185 */ | |
1186 int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout); | |
1187 | |
492 | 1188 /* memory */ |
862 | 1189 void *av_malloc(unsigned int size); |
1190 void *av_mallocz(unsigned int size); | |
492 | 1191 void av_free(void *ptr); |
1192 void __av_freep(void **ptr); | |
1193 #define av_freep(p) __av_freep((void **)(p)) | |
902
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1194 /* for static data only */ |
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1195 /* call av_free_static to release all staticaly allocated tables */ |
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1196 void av_free_static(); |
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1197 void *__av_mallocz_static(void** location, unsigned int size); |
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1198 #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s) |
492 | 1199 |
92 | 1200 #endif /* AVCODEC_H */ |