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