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