Mercurial > libavcodec.hg
annotate avcodec.h @ 984:e162c09efbe7 libavcodec
qpel fix
author | michaelni |
---|---|
date | Thu, 09 Jan 2003 20:42:37 +0000 |
parents | c5aef83c6a3f |
children | 295ec9bebf93 |
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" | |
984 | 8 #define LIBAVCODEC_BUILD 4653 |
9 #define LIBAVCODEC_BUILD_STR "4653" | |
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 |
984 | 523 #define FF_BUG_STD_QPEL 128 |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
524 //#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
|
525 |
684 | 526 /** |
527 * encoding: set by user | |
528 * decoding: unused | |
529 */ | |
460 | 530 int luma_elim_threshold; |
684 | 531 |
532 /** | |
533 * encoding: set by user | |
534 * decoding: unused | |
535 */ | |
460 | 536 int chroma_elim_threshold; |
684 | 537 |
538 /** | |
539 * strictly follow the std (MPEG4, ...) | |
540 * encoding: set by user | |
541 * decoding: unused | |
542 */ | |
543 int strict_std_compliance; | |
544 | |
545 /** | |
546 * 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
|
547 * 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
|
548 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
684 | 549 * encoding: set by user. |
550 * decoding: unused | |
551 */ | |
552 float b_quant_offset; | |
553 | |
554 /** | |
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
|
555 * error resilience higher values will detect more errors but may missdetect |
684 | 556 * some more or less valid parts as errors |
557 * encoding: unused | |
558 * decoding: set by user | |
559 */ | |
460 | 560 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
|
561 #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
|
562 #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
|
563 #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
|
564 #define FF_ER_VERY_AGGRESSIVE 4 |
466
805714c0c10f
new field for communicating with external postprocessing
nickols_k
parents:
460
diff
changeset
|
565 |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
566 /** |
903 | 567 * called at the beginning of each frame to get a buffer for it. |
568 * if pic.reference is set then the frame will be read later by lavc | |
569 * encoding: unused | |
570 * decoding: set by lavc, user can override | |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
571 */ |
925 | 572 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); |
684 | 573 |
574 /** | |
903 | 575 * called to release buffers which where allocated with get_buffer. |
576 * a released buffer can be reused in get_buffer() | |
577 * pic.data[*] must be set to NULL | |
684 | 578 * encoding: unused |
903 | 579 * decoding: set by lavc, user can override |
684 | 580 */ |
925 | 581 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); |
556 | 582 |
684 | 583 /** |
584 * is 1 if the decoded stream contains b frames, 0 otherwise | |
585 * encoding: unused | |
586 * decoding: set by lavc | |
587 */ | |
588 int has_b_frames; | |
589 | |
783 | 590 int block_align; /* used by some WAV based audio codecs */ |
613 | 591 |
581
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
592 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
|
593 (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
|
594 data is returned. Only MPEG codecs support this now. */ |
613 | 595 |
684 | 596 /** |
597 * 0-> h263 quant 1-> mpeg quant | |
598 * encoding: set by user. | |
599 * decoding: unused | |
600 */ | |
601 int mpeg_quant; | |
613 | 602 |
684 | 603 /** |
604 * pass1 encoding statistics output buffer | |
605 * encoding: set by lavc | |
606 * decoding: unused | |
607 */ | |
613 | 608 char *stats_out; /* encoding statistics output buffer */ |
684 | 609 |
610 /** | |
611 * pass2 encoding statistics input buffer. | |
612 * concatenated stuff from stats_out of pass1 should be placed here | |
613 * encoding: allocated/set/freed by user | |
614 * decoding: unused | |
615 */ | |
616 char *stats_in; | |
617 | |
618 /** | |
619 * ratecontrol qmin qmax limiting method | |
620 * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax | |
621 * encoding: set by user. | |
622 * decoding: unused | |
623 */ | |
613 | 624 float rc_qsquish; |
684 | 625 |
613 | 626 float rc_qmod_amp; |
627 int rc_qmod_freq; | |
684 | 628 |
629 /** | |
630 * ratecontrol override, see RcOverride | |
631 * encoding: allocated/set/freed by user. | |
632 * decoding: unused | |
633 */ | |
613 | 634 RcOverride *rc_override; |
635 int rc_override_count; | |
684 | 636 |
637 /** | |
638 * rate control equation | |
639 * encoding: set by user | |
640 * decoding: unused | |
641 */ | |
613 | 642 char *rc_eq; |
684 | 643 |
644 /** | |
645 * maximum bitrate | |
646 * encoding: set by user. | |
647 * decoding: unused | |
648 */ | |
613 | 649 int rc_max_rate; |
684 | 650 |
651 /** | |
652 * minimum bitrate | |
653 * encoding: set by user. | |
654 * decoding: unused | |
655 */ | |
613 | 656 int rc_min_rate; |
684 | 657 |
658 /** | |
659 * decoder bitstream buffer size | |
660 * encoding: set by user. | |
661 * decoding: unused | |
662 */ | |
613 | 663 int rc_buffer_size; |
664 float rc_buffer_aggressivity; | |
684 | 665 |
666 /** | |
667 * qscale factor between p and i frames | |
668 * encoding: set by user. | |
669 * decoding: unused | |
670 */ | |
671 float i_quant_factor; | |
672 | |
673 /** | |
674 * 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
|
675 * 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
|
676 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
684 | 677 * encoding: set by user. |
678 * decoding: unused | |
679 */ | |
680 float i_quant_offset; | |
681 | |
682 /** | |
683 * initial complexity for pass1 ratecontrol | |
684 * encoding: set by user. | |
685 * decoding: unused | |
686 */ | |
613 | 687 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
|
688 |
684 | 689 /** |
690 * dct algorithm, see FF_DCT_* below | |
691 * encoding: set by user | |
692 * decoding: unused | |
693 */ | |
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
|
694 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
|
695 #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
|
696 #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
|
697 #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
|
698 #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
|
699 #define FF_DCT_MLIB 4 |
828
ace3ccd18dd2
Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents:
827
diff
changeset
|
700 #define FF_DCT_ALTIVEC 5 |
690
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 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
703 * luminance masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
704 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
705 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
706 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
707 float lumi_masking; |
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 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
710 * temporary complexity masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
711 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
712 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
713 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
714 float temporal_cplx_masking; |
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 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
717 * spatial complexity masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
718 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
719 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
720 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
721 float spatial_cplx_masking; |
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 /** |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
724 * p block masking (0-> disabled) |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
725 * encoding: set by user |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
726 * decoding: unused |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
727 */ |
a1c69cb685b3
adaptive quantization (lumi/temporal & spatial complexity masking)
michaelni
parents:
686
diff
changeset
|
728 float p_masking; |
654 | 729 |
693
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
730 /** |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
731 * darkness masking (0-> disabled) |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
732 * encoding: set by user |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
733 * decoding: unused |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
734 */ |
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
735 float dark_masking; |
700
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 /** |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
738 * 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
|
739 * this is used to workaround some encoder bugs |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
740 * encoding: unused |
701 | 741 * 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
|
742 */ |
0fb4c66527e1
autodetect UMP4 (by adding a fourcc field to AVCodecContext)
michaelni
parents:
697
diff
changeset
|
743 int fourcc; |
693
b6a7ff92df57
darkness masking (lumi masking does only bright stuff now)
michaelni
parents:
690
diff
changeset
|
744 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
745 /** |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
746 * idct algorithm, see FF_IDCT_* below |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
747 * encoding: set by user |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
748 * decoding: set by user |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
749 */ |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
750 int idct_algo; |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
751 #define FF_IDCT_AUTO 0 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
752 #define FF_IDCT_INT 1 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
753 #define FF_IDCT_SIMPLE 2 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
754 #define FF_IDCT_SIMPLEMMX 3 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
755 #define FF_IDCT_LIBMPEG2MMX 4 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
756 #define FF_IDCT_PS2 5 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
757 #define FF_IDCT_MLIB 6 |
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
758 #define FF_IDCT_ARM 7 |
828
ace3ccd18dd2
Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents:
827
diff
changeset
|
759 #define FF_IDCT_ALTIVEC 8 |
706
e65798d228ea
idct permutation cleanup, idct can be selected per context now
michaelni
parents:
703
diff
changeset
|
760 |
713
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
761 /** |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
762 * slice count |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
763 * 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
|
764 * 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
|
765 */ |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
766 int slice_count; |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
767 /** |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
768 * 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
|
769 * 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
|
770 * 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
|
771 */ |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
772 int *slice_offset; |
e74a563eb643
rv10 cleanup (de)muxer still needs to be cleaned up (still searching volunteer for that ;) )
michaelni
parents:
706
diff
changeset
|
773 |
745
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
774 /** |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
775 * error concealment flags |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
776 * encoding: unused |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
777 * decoding: set by user |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
778 */ |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
779 int error_concealment; |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
780 #define FF_EC_GUESS_MVS 1 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
781 #define FF_EC_DEBLOCK 2 |
25d7fb7c89be
better/cleaner error resilience (done in a 2nd pass after decoding)
michaelni
parents:
733
diff
changeset
|
782 |
803
08423289ec57
exporting the internal qscale table, this allso fixes the ordering
michaelni
parents:
783
diff
changeset
|
783 /** |
849 | 784 * dsp_mask could be used to disable unwanted |
785 * CPU features (i.e. MMX, SSE. ...) | |
786 */ | |
787 unsigned dsp_mask; | |
866 | 788 |
789 /** | |
790 * bits per sample/pixel from the demuxer (needed for huffyuv) | |
903 | 791 * encoding: set by lavc |
866 | 792 * decoding: set by user |
793 */ | |
794 int bits_per_sample; | |
795 | |
796 /** | |
797 * prediction method (needed for huffyuv) | |
903 | 798 * encoding: set by user |
866 | 799 * decoding: unused |
800 */ | |
801 int prediction_method; | |
802 #define FF_PRED_LEFT 0 | |
803 #define FF_PRED_PLANE 1 | |
804 #define FF_PRED_MEDIAN 2 | |
880 | 805 |
806 /** | |
807 * aspect ratio. (0 if unknown) | |
808 * encoding: set by user. | |
809 * decoding: set by lavc. | |
810 */ | |
811 float aspect_ratio; | |
903 | 812 |
813 /** | |
814 * the picture in the bitstream | |
815 * encoding: set by lavc | |
816 * decoding: set by lavc | |
817 */ | |
925 | 818 AVFrame *coded_frame; |
906 | 819 |
820 /** | |
821 * debug | |
822 * encoding: set by user. | |
823 * decoding: set by user. | |
824 */ | |
825 int debug; | |
826 #define FF_DEBUG_PICT_INFO 1 | |
827 #define FF_DEBUG_RC 2 | |
828 #define FF_DEBUG_BITSTREAM 4 | |
829 #define FF_DEBUG_MB_TYPE 8 | |
830 #define FF_DEBUG_QP 16 | |
831 #define FF_DEBUG_MV 32 | |
942 | 832 #define FF_DEBUG_VIS_MV 0x00000040 |
833 #define FF_DEBUG_SKIP 0x00000080 | |
834 #define FF_DEBUG_STARTCODE 0x00000100 | |
835 #define FF_DEBUG_PTS 0x00000200 | |
909
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 /** |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
838 * error |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
839 * encoding: set by lavc if flags&CODEC_FLAG_PSNR |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
840 * decoding: unused |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
841 */ |
8ae1e4c24e91
new PSNR code (now works with chroma, b frames, ...)
michaelni
parents:
906
diff
changeset
|
842 uint64_t error[4]; |
932 | 843 |
844 /** | |
845 * minimum MB quantizer | |
846 * encoding: set by user. | |
847 * decoding: unused | |
848 */ | |
849 int mb_qmin; | |
850 | |
851 /** | |
852 * maximum MB quantizer | |
853 * encoding: set by user. | |
854 * decoding: unused | |
855 */ | |
856 int mb_qmax; | |
936 | 857 |
858 /** | |
859 * motion estimation compare function | |
860 * encoding: set by user. | |
861 * decoding: unused | |
862 */ | |
863 int me_cmp; | |
864 /** | |
865 * subpixel motion estimation compare function | |
866 * encoding: set by user. | |
867 * decoding: unused | |
868 */ | |
869 int me_sub_cmp; | |
870 /** | |
871 * macroblock compare function (not supported yet) | |
872 * encoding: set by user. | |
873 * decoding: unused | |
874 */ | |
875 int mb_cmp; | |
876 #define FF_CMP_SAD 0 | |
877 #define FF_CMP_SSE 1 | |
878 #define FF_CMP_SATD 2 | |
879 #define FF_CMP_DCT 3 | |
880 #define FF_CMP_PSNR 4 | |
881 #define FF_CMP_BIT 5 | |
882 #define FF_CMP_RD 6 | |
883 #define FF_CMP_ZERO 7 | |
884 #define FF_CMP_CHROMA 256 | |
885 | |
886 /** | |
948 | 887 * ME diamond size & shape |
936 | 888 * encoding: set by user. |
889 * decoding: unused | |
890 */ | |
891 int dia_size; | |
948 | 892 |
893 /** | |
894 * amount of previous MV predictors (2a+1 x 2a+1 square) | |
895 * encoding: set by user. | |
896 * decoding: unused | |
897 */ | |
898 int last_predictor_count; | |
953 | 899 |
951 | 900 /** |
901 * pre pass for motion estimation | |
902 * encoding: set by user. | |
903 * decoding: unused | |
904 */ | |
905 int pre_me; | |
948 | 906 |
953 | 907 /** |
908 * motion estimation pre pass compare function | |
909 * encoding: set by user. | |
910 * decoding: unused | |
911 */ | |
912 int me_pre_cmp; | |
954 | 913 |
953 | 914 /** |
915 * ME pre pass diamond size & shape | |
916 * encoding: set by user. | |
917 * decoding: unused | |
918 */ | |
919 int pre_dia_size; | |
920 | |
954 | 921 /** |
922 * subpel ME quality | |
923 * encoding: set by user. | |
924 * decoding: unused | |
925 */ | |
926 int me_subpel_quality; | |
927 | |
0 | 928 } AVCodecContext; |
929 | |
930 typedef struct AVCodec { | |
862 | 931 const char *name; |
0 | 932 int type; |
933 int id; | |
934 int priv_data_size; | |
935 int (*init)(AVCodecContext *); | |
936 int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data); | |
937 int (*close)(AVCodecContext *); | |
556 | 938 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, |
0 | 939 UINT8 *buf, int buf_size); |
67 | 940 int capabilities; |
0 | 941 struct AVCodec *next; |
942 } AVCodec; | |
943 | |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
944 /** |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
945 * four components are given, that's all. |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
946 * the last component is alpha |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
947 */ |
0 | 948 typedef struct AVPicture { |
842
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
949 UINT8 *data[4]; |
e460775adb38
cleanup (breaks compatibility, requested by fabrice)
michaelni
parents:
831
diff
changeset
|
950 int linesize[4]; |
0 | 951 } AVPicture; |
952 | |
953 extern AVCodec ac3_encoder; | |
954 extern AVCodec mp2_encoder; | |
260
e1bacfb3f51f
- Added MP3 encoding through libmp3lame contributed by Lennert Buytenhek.
pulento
parents:
252
diff
changeset
|
955 extern AVCodec mp3lame_encoder; |
636
57b9a37546a0
oggvorbis support patch by (Mark Hills <mark at pogo dot org dot uk>)
michaelni
parents:
630
diff
changeset
|
956 extern AVCodec oggvorbis_encoder; |
0 | 957 extern AVCodec mpeg1video_encoder; |
958 extern AVCodec h263_encoder; | |
959 extern AVCodec h263p_encoder; | |
960 extern AVCodec rv10_encoder; | |
961 extern AVCodec mjpeg_encoder; | |
67 | 962 extern AVCodec mpeg4_encoder; |
307 | 963 extern AVCodec msmpeg4v1_encoder; |
964 extern AVCodec msmpeg4v2_encoder; | |
965 extern AVCodec msmpeg4v3_encoder; | |
500 | 966 extern AVCodec wmv1_encoder; |
967 extern AVCodec wmv2_encoder; | |
866 | 968 extern AVCodec huffyuv_encoder; |
0 | 969 |
970 extern AVCodec h263_decoder; | |
67 | 971 extern AVCodec mpeg4_decoder; |
307 | 972 extern AVCodec msmpeg4v1_decoder; |
973 extern AVCodec msmpeg4v2_decoder; | |
974 extern AVCodec msmpeg4v3_decoder; | |
311 | 975 extern AVCodec wmv1_decoder; |
500 | 976 extern AVCodec wmv2_decoder; |
0 | 977 extern AVCodec mpeg_decoder; |
978 extern AVCodec h263i_decoder; | |
979 extern AVCodec rv10_decoder; | |
521 | 980 extern AVCodec svq1_decoder; |
724 | 981 extern AVCodec dvvideo_decoder; |
982 extern AVCodec dvaudio_decoder; | |
783 | 983 extern AVCodec wmav1_decoder; |
984 extern AVCodec wmav2_decoder; | |
24 | 985 extern AVCodec mjpeg_decoder; |
881 | 986 extern AVCodec mjpegb_decoder; |
322 | 987 extern AVCodec mp2_decoder; |
92 | 988 extern AVCodec mp3_decoder; |
827
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
989 extern AVCodec mace3_decoder; |
770578c6c300
added MACE (Macintosh Audio Compression/Expansion) 3:1 & 6:1 support
michaelni
parents:
803
diff
changeset
|
990 extern AVCodec mace6_decoder; |
866 | 991 extern AVCodec huffyuv_decoder; |
883 | 992 extern AVCodec oggvorbis_decoder; |
0 | 993 |
92 | 994 /* pcm codecs */ |
995 #define PCM_CODEC(id, name) \ | |
996 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
|
997 extern AVCodec name ## _encoder |
92 | 998 |
999 PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le); | |
1000 PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be); | |
1001 PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le); | |
1002 PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be); | |
1003 PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8); | |
1004 PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8); | |
1005 PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw); | |
1006 PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw); | |
1007 | |
573
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1008 /* adpcm codecs */ |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1009 |
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_QT, adpcm_ima_qt); |
b0f52172f4c5
beos/mov/adpcm patch by Franois Revol <revol at free dot fr>
michaelni
parents:
556
diff
changeset
|
1011 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
|
1012 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
|
1013 |
92 | 1014 #undef PCM_CODEC |
1015 | |
1016 /* dummy raw video codec */ | |
0 | 1017 extern AVCodec rawvideo_codec; |
1018 | |
1019 /* the following codecs use external GPL libs */ | |
1020 extern AVCodec ac3_decoder; | |
1021 | |
1022 /* resample.c */ | |
1023 | |
1024 struct ReSampleContext; | |
1025 | |
1026 typedef struct ReSampleContext ReSampleContext; | |
1027 | |
1028 ReSampleContext *audio_resample_init(int output_channels, int input_channels, | |
1029 int output_rate, int input_rate); | |
1030 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); | |
1031 void audio_resample_close(ReSampleContext *s); | |
1032 | |
1033 /* YUV420 format is assumed ! */ | |
1034 | |
1035 struct ImgReSampleContext; | |
1036 | |
1037 typedef struct ImgReSampleContext ImgReSampleContext; | |
1038 | |
1039 ImgReSampleContext *img_resample_init(int output_width, int output_height, | |
1040 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
|
1041 |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1042 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
|
1043 int iwidth, int iheight, |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1044 int topBand, int bottomBand, |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1045 int leftBand, int rightBand); |
b4ee42142ad1
croping patch by (talus25 at speakeasy dot net) with fixes from atmos & me
michaelni
parents:
628
diff
changeset
|
1046 |
0 | 1047 void img_resample(ImgReSampleContext *s, |
1048 AVPicture *output, AVPicture *input); | |
1049 | |
1050 void img_resample_close(ImgReSampleContext *s); | |
1051 | |
49 | 1052 void avpicture_fill(AVPicture *picture, UINT8 *ptr, |
1053 int pix_fmt, int width, int height); | |
1054 int avpicture_get_size(int pix_fmt, int width, int height); | |
903 | 1055 void avcodec_get_chroma_sub_sample(int fmt, int *h_shift, int *v_shift); |
49 | 1056 |
1057 /* convert among pixel formats */ | |
1058 int img_convert(AVPicture *dst, int dst_pix_fmt, | |
1059 AVPicture *src, int pix_fmt, | |
1060 int width, int height); | |
1061 | |
1062 /* deinterlace a picture */ | |
1063 int avpicture_deinterlace(AVPicture *dst, AVPicture *src, | |
0 | 1064 int pix_fmt, int width, int height); |
1065 | |
1066 /* external high level API */ | |
1067 | |
1068 extern AVCodec *first_avcodec; | |
1069 | |
362 | 1070 /* returns LIBAVCODEC_VERSION_INT constant */ |
399 | 1071 unsigned avcodec_version(void); |
379 | 1072 /* returns LIBAVCODEC_BUILD constant */ |
399 | 1073 unsigned avcodec_build(void); |
0 | 1074 void avcodec_init(void); |
1075 | |
399 | 1076 void avcodec_set_bit_exact(void); |
1077 | |
0 | 1078 void register_avcodec(AVCodec *format); |
1079 AVCodec *avcodec_find_encoder(enum CodecID id); | |
177 | 1080 AVCodec *avcodec_find_encoder_by_name(const char *name); |
0 | 1081 AVCodec *avcodec_find_decoder(enum CodecID id); |
1082 AVCodec *avcodec_find_decoder_by_name(const char *name); | |
1083 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); | |
1084 | |
903 | 1085 void avcodec_get_context_defaults(AVCodecContext *s); |
703 | 1086 AVCodecContext *avcodec_alloc_context(void); |
925 | 1087 AVFrame *avcodec_alloc_frame(void); |
903 | 1088 |
925 | 1089 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); |
1090 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); | |
903 | 1091 |
0 | 1092 int avcodec_open(AVCodecContext *avctx, AVCodec *codec); |
1093 int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples, | |
1094 int *frame_size_ptr, | |
1095 UINT8 *buf, int buf_size); | |
925 | 1096 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, |
0 | 1097 int *got_picture_ptr, |
1098 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
|
1099 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
|
1100 int *data_size_ptr, |
8adda0af04e2
added proposed API for parse_only mode to extract compressed frames from compressed streams
bellard
parents:
573
diff
changeset
|
1101 UINT8 *buf, int buf_size); |
0 | 1102 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, |
1103 const short *samples); | |
1104 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, | |
925 | 1105 const AVFrame *pict); |
0 | 1106 |
1107 int avcodec_close(AVCodecContext *avctx); | |
1108 | |
1109 void avcodec_register_all(void); | |
92 | 1110 |
341 | 1111 void avcodec_flush_buffers(AVCodecContext *avctx); |
1112 | |
962
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1113 typedef struct { |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1114 /** options' name with default value*/ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1115 const char* name; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1116 /** English text help */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1117 const char* help; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1118 /** type of variable */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1119 int type; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1120 #define FF_CONF_TYPE_BOOL 1 // boolean - true,1,on (or simply presence) |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1121 #define FF_CONF_TYPE_DOUBLE 2 // double |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1122 #define FF_CONF_TYPE_INT 3 // integer |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1123 #define FF_CONF_TYPE_STRING 4 // string (finished with \0) |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1124 #define FF_CONF_TYPE_MASK 0x1f // mask for types - upper bits are various flags |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1125 #define FF_CONF_TYPE_EXPERT 0x20 // flag for expert option |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1126 #define FF_CONF_TYPE_FLAG (FF_CONF_TYPE_BOOL | 0x40) |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1127 #define FF_CONF_TYPE_RCOVERIDE (FF_CONF_TYPE_STRING | 0x80) |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1128 /** where the parsed value should be stored */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1129 void* val; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1130 /** min value (min == max -> no limits) */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1131 double min; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1132 /** maximum value for double/int */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1133 double max; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1134 /** default boo [0,1]l/double/int value */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1135 double defval; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1136 /** |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1137 * default string value (with optional semicolon delimited extra option-list |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1138 * i.e. option1;option2;option3 |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1139 * defval might select other then first argument as default |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1140 */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1141 const char* defstr; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1142 /** char* list of supported codecs (i.e. ",msmpeg4,h263," NULL - everything */ |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1143 const char* supported; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1144 } avc_config_t; |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1145 |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1146 void avcodec_getopt(AVCodecContext* avctx, char* str, avc_config_t** config); |
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1147 |
382 | 1148 /** |
1149 * Interface for 0.5.0 version | |
1150 * | |
1151 * do not even think about it's usage for this moment | |
1152 */ | |
1153 | |
1154 typedef struct { | |
1155 // compressed size used from given memory buffer | |
1156 int size; | |
1157 /// I/P/B frame type | |
1158 int frame_type; | |
1159 } avc_enc_result_t; | |
1160 | |
1161 /** | |
1162 * Commands | |
1163 * order can't be changed - once it was defined | |
1164 */ | |
1165 typedef enum { | |
1166 // general commands | |
1167 AVC_OPEN_BY_NAME = 0xACA000, | |
1168 AVC_OPEN_BY_CODEC_ID, | |
1169 AVC_OPEN_BY_FOURCC, | |
1170 AVC_CLOSE, | |
1171 | |
1172 AVC_FLUSH, | |
1173 // pin - struct { uint8_t* src, uint_t src_size } | |
1174 // pout - struct { AVPicture* img, consumed_bytes, | |
1175 AVC_DECODE, | |
1176 // pin - struct { AVPicture* img, uint8_t* dest, uint_t dest_size } | |
1177 // pout - uint_t used_from_dest_size | |
1178 AVC_ENCODE, | |
1179 | |
1180 // query/get video commands | |
1181 AVC_GET_VERSION = 0xACB000, | |
1182 AVC_GET_WIDTH, | |
1183 AVC_GET_HEIGHT, | |
1184 AVC_GET_DELAY, | |
1185 AVC_GET_QUANT_TABLE, | |
1186 // ... | |
1187 | |
1188 // query/get audio commands | |
1189 AVC_GET_FRAME_SIZE = 0xABC000, | |
1190 | |
1191 // maybe define some simple structure which | |
1192 // might be passed to the user - but they can't | |
1193 // contain any codec specific parts and these | |
1194 // calls are usualy necessary only few times | |
1195 | |
1196 // set video commands | |
1197 AVC_SET_WIDTH = 0xACD000, | |
1198 AVC_SET_HEIGHT, | |
1199 | |
1200 // set video encoding commands | |
1201 AVC_SET_FRAME_RATE = 0xACD800, | |
1202 AVC_SET_QUALITY, | |
1203 AVC_SET_HURRY_UP, | |
1204 | |
1205 // set audio commands | |
1206 AVC_SET_SAMPLE_RATE = 0xACE000, | |
1207 AVC_SET_CHANNELS, | |
1208 | |
1209 } avc_cmd_t; | |
1210 | |
1211 /** | |
1212 * \param handle allocated private structure by libavcodec | |
1213 * for initialization pass NULL - will be returned pout | |
1214 * user is supposed to know nothing about its structure | |
1215 * \param cmd type of operation to be performed | |
1216 * \param pint input parameter | |
1217 * \param pout output parameter | |
1218 * | |
1219 * \returns command status - eventually for query command it might return | |
1220 * integer resulting value | |
1221 */ | |
1222 int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout); | |
1223 | |
492 | 1224 /* memory */ |
862 | 1225 void *av_malloc(unsigned int size); |
1226 void *av_mallocz(unsigned int size); | |
492 | 1227 void av_free(void *ptr); |
1228 void __av_freep(void **ptr); | |
1229 #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
|
1230 /* for static data only */ |
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1231 /* call av_free_static to release all staticaly allocated tables */ |
962
c5aef83c6a3f
* first shot for generaly usable option parser for codecs
kabi
parents:
954
diff
changeset
|
1232 void av_free_static(void); |
902
6acc8394960d
* two functions to handle allocation of static data more simple
kabi
parents:
883
diff
changeset
|
1233 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
|
1234 #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s) |
492 | 1235 |
92 | 1236 #endif /* AVCODEC_H */ |