Statistics
| Branch: | Revision:

ffmpeg / libavcodec / avcodec.h @ 4de339e2

History | View | Annotate | Download (139 KB)

1 04d7f601 Diego Biurrun
/*
2
 * copyright (c) 2001 Fabrice Bellard
3
 *
4 2912e87a Mans Rullgard
 * This file is part of Libav.
5 b78e7197 Diego Biurrun
 *
6 2912e87a Mans Rullgard
 * Libav is free software; you can redistribute it and/or
7 04d7f601 Diego Biurrun
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9 b78e7197 Diego Biurrun
 * version 2.1 of the License, or (at your option) any later version.
10 04d7f601 Diego Biurrun
 *
11 2912e87a Mans Rullgard
 * Libav is distributed in the hope that it will be useful,
12 04d7f601 Diego Biurrun
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17 2912e87a Mans Rullgard
 * License along with Libav; if not, write to the Free Software
18 e5a389a1 Diego Biurrun
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 04d7f601 Diego Biurrun
 */
20
21 98790382 Stefano Sabatini
#ifndef AVCODEC_AVCODEC_H
22
#define AVCODEC_AVCODEC_H
23 a96b68b7 Fabrice Bellard
24 36df8805 Michael Niedermayer
/**
25 ba87f080 Diego Biurrun
 * @file
26 f5bccd85 Diego Biurrun
 * external API header
27 36df8805 Michael Niedermayer
 */
28
29 c60208e7 Diego Biurrun
#include <errno.h>
30 737eb597 Reinhard Tartler
#include "libavutil/samplefmt.h"
31 76a448ed Måns Rullgård
#include "libavutil/avutil.h"
32 7160bb71 Stefano Sabatini
#include "libavutil/cpu.h"
33 de6d9b64 Fabrice Bellard
34 3dd851c4 Anton Khirnov
#include "libavcodec/version.h"
35 eda7c983 Aurelien Jacobs
36 372c3f82 Michael Niedermayer
#if LIBAVCODEC_VERSION_MAJOR < 53
37
#   define FF_INTERNALC_MEM_TYPE unsigned int
38
#else
39
#   define FF_INTERNALC_MEM_TYPE size_t
40
#endif
41
42 7ebf5927 Michael Niedermayer
/**
43 48966b02 Måns Rullgård
 * Identify the syntax and semantics of the bitstream.
44 6b0cdb6e Nicolas George
 * The principle is roughly:
45
 * Two decoders with the same ID can decode the same streams.
46
 * Two encoders with the same ID can encode compatible streams.
47
 * There may be slight deviations from the principle due to implementation
48
 * details.
49 7ebf5927 Michael Niedermayer
 *
50 f5bccd85 Diego Biurrun
 * If you add a codec ID to this list, add it so that
51
 * 1. no value of a existing codec ID changes (that would break ABI),
52
 * 2. it is as close as possible to similar codecs.
53 7ebf5927 Michael Niedermayer
 */
54 de6d9b64 Fabrice Bellard
enum CodecID {
55 115329f1 Diego Biurrun
    CODEC_ID_NONE,
56 ba0dabbf Diego Biurrun
57
    /* video codecs */
58 de6d9b64 Fabrice Bellard
    CODEC_ID_MPEG1VIDEO,
59 0e373b95 Michael Niedermayer
    CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
60 fb364ada Ivan Kalvachev
    CODEC_ID_MPEG2VIDEO_XVMC,
61 c6148de2 Michael Niedermayer
    CODEC_ID_H261,
62 de6d9b64 Fabrice Bellard
    CODEC_ID_H263,
63
    CODEC_ID_RV10,
64 68b94c35 Michael Niedermayer
    CODEC_ID_RV20,
65 de6d9b64 Fabrice Bellard
    CODEC_ID_MJPEG,
66 b135d9fb Alex Beregszaszi
    CODEC_ID_MJPEGB,
67 b1e6b355 Michael Niedermayer
    CODEC_ID_LJPEG,
68 5e83dec4 Alex Beregszaszi
    CODEC_ID_SP5X,
69 5639729b Michael Niedermayer
    CODEC_ID_JPEGLS,
70 bf89e6b1 Fabrice Bellard
    CODEC_ID_MPEG4,
71 de6d9b64 Fabrice Bellard
    CODEC_ID_RAWVIDEO,
72 84afee34 Michael Niedermayer
    CODEC_ID_MSMPEG4V1,
73
    CODEC_ID_MSMPEG4V2,
74
    CODEC_ID_MSMPEG4V3,
75 e1a9dbff Michael Niedermayer
    CODEC_ID_WMV1,
76 b50eef3a Michael Niedermayer
    CODEC_ID_WMV2,
77 de6d9b64 Fabrice Bellard
    CODEC_ID_H263P,
78
    CODEC_ID_H263I,
79 d4f5d74a Garrick Meeker
    CODEC_ID_FLV1,
80 be8ffec9 Nick Kurshev
    CODEC_ID_SVQ1,
81 8b82a956 Michael Niedermayer
    CODEC_ID_SVQ3,
82 020fcc94 Fabrice Bellard
    CODEC_ID_DVVIDEO,
83 11f18faf Michael Niedermayer
    CODEC_ID_HUFFYUV,
84 f70f7c6d Michael Niedermayer
    CODEC_ID_CYUV,
85 0da71265 Michael Niedermayer
    CODEC_ID_H264,
86 deabd4fd Mike Melanson
    CODEC_ID_INDEO3,
87 d86053a4 Mike Melanson
    CODEC_ID_VP3,
88 f44ee2c3 Alex Beregszaszi
    CODEC_ID_THEORA,
89 3d2e8cce Michael Niedermayer
    CODEC_ID_ASV1,
90 9b56edf5 Michael Niedermayer
    CODEC_ID_ASV2,
91 5e20f836 Michael Niedermayer
    CODEC_ID_FFV1,
92 e2a7bb28 Mike Melanson
    CODEC_ID_4XM,
93 be3564ed Michael Niedermayer
    CODEC_ID_VCR1,
94 3aff069b Alex Beregszaszi
    CODEC_ID_CLJR,
95 c3bf0288 Michael Niedermayer
    CODEC_ID_MDEC,
96 3ef8be2b Mike Melanson
    CODEC_ID_ROQ,
97
    CODEC_ID_INTERPLAY_VIDEO,
98 9937e686 Mike Melanson
    CODEC_ID_XAN_WC3,
99
    CODEC_ID_XAN_WC4,
100 2fdf638b Mike Melanson
    CODEC_ID_RPZA,
101
    CODEC_ID_CINEPAK,
102
    CODEC_ID_WS_VQA,
103
    CODEC_ID_MSRLE,
104
    CODEC_ID_MSVIDEO1,
105 4120a53a Mike Melanson
    CODEC_ID_IDCIN,
106 1dc1ed99 Roberto Togni
    CODEC_ID_8BPS,
107 11e29a41 Mike Melanson
    CODEC_ID_SMC,
108 42cad81a Mike Melanson
    CODEC_ID_FLIC,
109 9a4117d5 Mike Melanson
    CODEC_ID_TRUEMOTION1,
110 fafa0b75 Mike Melanson
    CODEC_ID_VMDVIDEO,
111 a273bbfb Roberto Togni
    CODEC_ID_MSZH,
112
    CODEC_ID_ZLIB,
113 070ed1bc Mike Melanson
    CODEC_ID_QTRLE,
114 791e7b83 Michael Niedermayer
    CODEC_ID_SNOW,
115 9d53d58e Mike Melanson
    CODEC_ID_TSCC,
116 d0a0bbd2 Mike Melanson
    CODEC_ID_ULTI,
117 d08d7142 Mike Melanson
    CODEC_ID_QDRAW,
118 ab711b3c Mike Melanson
    CODEC_ID_VIXL,
119 acfd8f0f Mike Melanson
    CODEC_ID_QPEG,
120 382b5b3a Aurelien Jacobs
#if LIBAVCODEC_VERSION_MAJOR < 53
121 17179d2d Michael Niedermayer
    CODEC_ID_XVID,
122 382b5b3a Aurelien Jacobs
#endif
123 17179d2d Michael Niedermayer
    CODEC_ID_PNG,
124
    CODEC_ID_PPM,
125
    CODEC_ID_PBM,
126
    CODEC_ID_PGM,
127
    CODEC_ID_PGMYUV,
128
    CODEC_ID_PAM,
129 f37b9768 Loren Merritt
    CODEC_ID_FFVHUFF,
130 3f05305d Michael Niedermayer
    CODEC_ID_RV30,
131
    CODEC_ID_RV40,
132 10b9c374 Kostya Shishkov
    CODEC_ID_VC1,
133 21aa398f Alex Beregszaszi
    CODEC_ID_WMV3,
134 9c7fb608 Mike Melanson
    CODEC_ID_LOCO,
135 a8a15e9d Mike Melanson
    CODEC_ID_WNV1,
136 589f8220 Mike Melanson
    CODEC_ID_AASC,
137 856dbbff Michael Niedermayer
    CODEC_ID_INDEO2,
138 b81f8949 Mike Melanson
    CODEC_ID_FRAPS,
139 64af6168 Mike Melanson
    CODEC_ID_TRUEMOTION2,
140 9fa62f2a Måns Rullgård
    CODEC_ID_BMP,
141 e0f80bd7 Reimar Döffinger
    CODEC_ID_CSCD,
142 4e114829 Mike Melanson
    CODEC_ID_MMVIDEO,
143 9c8d8e84 Mike Melanson
    CODEC_ID_ZMBV,
144 26376701 Mike Melanson
    CODEC_ID_AVS,
145 348efc18 Kostya Shishkov
    CODEC_ID_SMACKVIDEO,
146 dfca23e3 Reimar Döffinger
    CODEC_ID_NUV,
147 fd7b1991 Kostya Shishkov
    CODEC_ID_KMVC,
148 0919e788 Benjamin Larsson
    CODEC_ID_FLASHSV,
149 20ffddb9 Stefan Gehrer
    CODEC_ID_CAVS,
150 f31065f6 Baptiste Coudurier
    CODEC_ID_JPEG2000,
151 eb57c889 Kostya Shishkov
    CODEC_ID_VMNC,
152 5ce117c3 Aurelien Jacobs
    CODEC_ID_VP5,
153
    CODEC_ID_VP6,
154
    CODEC_ID_VP6F,
155 3689cf16 Kostya Shishkov
    CODEC_ID_TARGA,
156 72450e50 Baptiste Coudurier
    CODEC_ID_DSICINVIDEO,
157 29f86228 Baptiste Coudurier
    CODEC_ID_TIERTEXSEQVIDEO,
158 a991b1fe Kostya Shishkov
    CODEC_ID_TIFF,
159 06d392a7 Baptiste Coudurier
    CODEC_ID_GIF,
160 3edeab82 Panagiotis Issaris
    CODEC_ID_FFH264,
161 33a0dd37 Kostya Shishkov
    CODEC_ID_DXA,
162 52b6bad2 Baptiste Coudurier
    CODEC_ID_DNXHD,
163 efb0c399 Diego Biurrun
    CODEC_ID_THP,
164 2d99eed1 Xiaohui Sun
    CODEC_ID_SGI,
165 9a0ddd09 Anssi Hannula
    CODEC_ID_C93,
166 1e6c6759 Nicholas Tung
    CODEC_ID_BETHSOFTVID,
167 b46d68c6 Ivo van Poorten
    CODEC_ID_PTX,
168 1ca779e7 Ivo van Poorten
    CODEC_ID_TXD,
169 91fc2cf1 Aurelien Jacobs
    CODEC_ID_VP6A,
170 8787d837 Vladimir Voroshilov
    CODEC_ID_AMV,
171 66f7679c Kostya Shishkov
    CODEC_ID_VB,
172 b4abe1d1 Ivo van Poorten
    CODEC_ID_PCX,
173 d43df959 Ivo van Poorten
    CODEC_ID_SUNRAST,
174 800b9c24 Benjamin Larsson
    CODEC_ID_INDEO4,
175
    CODEC_ID_INDEO5,
176 a7129de5 Ramiro Polla
    CODEC_ID_MIMIC,
177 975cdc8f Sascha Sommer
    CODEC_ID_RL2,
178 cb21e0a7 Jai Menon
    CODEC_ID_8SVX_EXP,
179
    CODEC_ID_8SVX_FIB,
180 40d26273 Eli Friedman
    CODEC_ID_ESCAPE124,
181 782a58ec Michael Niedermayer
    CODEC_ID_DIRAC,
182 b64c096b Sisir Koppaka
    CODEC_ID_BFI,
183 495900f7 Peter Ross
    CODEC_ID_CMV,
184 974e0eee Gregory Montoir
    CODEC_ID_MOTIONPIXELS,
185 cfc78718 Peter Ross
    CODEC_ID_TGV,
186 42b30357 Peter Ross
    CODEC_ID_TGQ,
187 d8964f3a Peter Ross
    CODEC_ID_TQI,
188 c21fbefb Kostya Shishkov
    CODEC_ID_AURA,
189
    CODEC_ID_AURA2,
190 97f92143 Michael Niedermayer
    CODEC_ID_V210X,
191 a1fd2bc3 Daniel Verkamp
    CODEC_ID_TMV,
192 ca0bb1c4 Baptiste Coudurier
    CODEC_ID_V210,
193 94d3d6a4 Jimmy Christensen
    CODEC_ID_DPX,
194 c63ea92b Peter Ross
    CODEC_ID_MAD,
195 d8b35b85 Reimar Döffinger
    CODEC_ID_FRWU,
196 0aa6a518 Daniel Verkamp
    CODEC_ID_FLASHSV2,
197 a3d995c1 Michael Tison
    CODEC_ID_CDGRAPHICS,
198 4aaab0a3 Reimar Döffinger
    CODEC_ID_R210,
199 a1ae40fd Peter Ross
    CODEC_ID_ANM,
200 4e5f42dd Daniel Verkamp
    CODEC_ID_BINKVIDEO,
201 b9e06ddd Peter Ross
    CODEC_ID_IFF_ILBM,
202
    CODEC_ID_IFF_BYTERUN1,
203 bf354122 Daniel Verkamp
    CODEC_ID_KGV1,
204 148bcae9 Mohamed Naufal
    CODEC_ID_YOP,
205 a98c2dfa Google
    CODEC_ID_VP8,
206 a526d619 Peter Ross
    CODEC_ID_PICTOR,
207 beaa963c Peter Ross
    CODEC_ID_ANSI,
208 40c5ee99 Tobias Bindhammer
    CODEC_ID_A64_MULTI,
209
    CODEC_ID_A64_MULTI5,
210 43836928 Zhou Zongyi
    CODEC_ID_R10K,
211 9d09ebf1 Anatoly Nenashev
    CODEC_ID_MXPEG,
212 d267b339 Carl Eugen Hoyos
    CODEC_ID_LAGARITH,
213 f5b82f45 Tomas Härdin
    CODEC_ID_PRORES,
214 0697440c Peter Ross
    CODEC_ID_JV,
215 42315dab Kostya Shishkov
    CODEC_ID_DFA,
216 40c5ee99 Tobias Bindhammer
217 f5bccd85 Diego Biurrun
    /* various PCM "codecs" */
218 17179d2d Michael Niedermayer
    CODEC_ID_PCM_S16LE= 0x10000,
219 a96b68b7 Fabrice Bellard
    CODEC_ID_PCM_S16BE,
220
    CODEC_ID_PCM_U16LE,
221
    CODEC_ID_PCM_U16BE,
222
    CODEC_ID_PCM_S8,
223
    CODEC_ID_PCM_U8,
224
    CODEC_ID_PCM_MULAW,
225
    CODEC_ID_PCM_ALAW,
226 b461b3bc Reimar Döffinger
    CODEC_ID_PCM_S32LE,
227
    CODEC_ID_PCM_S32BE,
228
    CODEC_ID_PCM_U32LE,
229
    CODEC_ID_PCM_U32BE,
230
    CODEC_ID_PCM_S24LE,
231
    CODEC_ID_PCM_S24BE,
232
    CODEC_ID_PCM_U24LE,
233
    CODEC_ID_PCM_U24BE,
234
    CODEC_ID_PCM_S24DAUD,
235 a11c2a2c Michael Niedermayer
    CODEC_ID_PCM_ZORK,
236 725d86bf Aurelien Jacobs
    CODEC_ID_PCM_S16LE_PLANAR,
237 1472b7dd Lars Täuber
    CODEC_ID_PCM_DVD,
238 aa29709e Peter Ross
    CODEC_ID_PCM_F32BE,
239 143a5d6f Peter Ross
    CODEC_ID_PCM_F32LE,
240
    CODEC_ID_PCM_F64BE,
241
    CODEC_ID_PCM_F64LE,
242 5dd3707b Christian Schmidt
    CODEC_ID_PCM_BLURAY,
243 fbeabfca Tomas Härdin
    CODEC_ID_PCM_LXF,
244 0147f198 François Revol
245 f5bccd85 Diego Biurrun
    /* various ADPCM codecs */
246 17179d2d Michael Niedermayer
    CODEC_ID_ADPCM_IMA_QT= 0x11000,
247 0147f198 François Revol
    CODEC_ID_ADPCM_IMA_WAV,
248 9937e686 Mike Melanson
    CODEC_ID_ADPCM_IMA_DK3,
249
    CODEC_ID_ADPCM_IMA_DK4,
250 2fdf638b Mike Melanson
    CODEC_ID_ADPCM_IMA_WS,
251 7d8379f2 Mike Melanson
    CODEC_ID_ADPCM_IMA_SMJPEG,
252 0147f198 François Revol
    CODEC_ID_ADPCM_MS,
253 e2a7bb28 Mike Melanson
    CODEC_ID_ADPCM_4XM,
254 fc384777 Mike Melanson
    CODEC_ID_ADPCM_XA,
255
    CODEC_ID_ADPCM_ADX,
256 7d8379f2 Mike Melanson
    CODEC_ID_ADPCM_EA,
257 e5966052 Roman Shaposhnik
    CODEC_ID_ADPCM_G726,
258 b3bfb299 Mike Melanson
    CODEC_ID_ADPCM_CT,
259 659c3692 Alex Beregszaszi
    CODEC_ID_ADPCM_SWF,
260 2ff4524e Vidar Madsen
    CODEC_ID_ADPCM_YAMAHA,
261 2433f24f Aurelien Jacobs
    CODEC_ID_ADPCM_SBPRO_4,
262
    CODEC_ID_ADPCM_SBPRO_3,
263
    CODEC_ID_ADPCM_SBPRO_2,
264 d1e0d21f Marco Gerards
    CODEC_ID_ADPCM_THP,
265 3a7f5d07 Vitor Sessak
    CODEC_ID_ADPCM_IMA_AMV,
266 e7583962 Peter Ross
    CODEC_ID_ADPCM_EA_R1,
267
    CODEC_ID_ADPCM_EA_R3,
268
    CODEC_ID_ADPCM_EA_R2,
269 7bb65d89 Peter Ross
    CODEC_ID_ADPCM_IMA_EA_SEAD,
270 fac84d3c Peter Ross
    CODEC_ID_ADPCM_IMA_EA_EACS,
271 271b4095 Aurelien Jacobs
    CODEC_ID_ADPCM_EA_XAS,
272 861c63a2 Robert Marston
    CODEC_ID_ADPCM_EA_MAXIS_XA,
273 055dc116 Stefan Gehrer
    CODEC_ID_ADPCM_IMA_ISS,
274 58e37eaf Martin Storsjö
    CODEC_ID_ADPCM_G722,
275 891f64b3 joca@rixmail.se
276 17179d2d Michael Niedermayer
    /* AMR */
277
    CODEC_ID_AMR_NB= 0x12000,
278 d663a1fd Michael Niedermayer
    CODEC_ID_AMR_WB,
279
280 b8414bbd Nick Kurshev
    /* RealAudio codecs*/
281 17179d2d Michael Niedermayer
    CODEC_ID_RA_144= 0x13000,
282 b8414bbd Nick Kurshev
    CODEC_ID_RA_288,
283 3ef8be2b Mike Melanson
284
    /* various DPCM codecs */
285 17179d2d Michael Niedermayer
    CODEC_ID_ROQ_DPCM= 0x14000,
286 3ef8be2b Mike Melanson
    CODEC_ID_INTERPLAY_DPCM,
287 9937e686 Mike Melanson
    CODEC_ID_XAN_DPCM,
288 d08d7142 Mike Melanson
    CODEC_ID_SOL_DPCM,
289 115329f1 Diego Biurrun
290 ba0dabbf Diego Biurrun
    /* audio codecs */
291 17179d2d Michael Niedermayer
    CODEC_ID_MP2= 0x15000,
292 0e373b95 Michael Niedermayer
    CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
293 17179d2d Michael Niedermayer
    CODEC_ID_AAC,
294
    CODEC_ID_AC3,
295
    CODEC_ID_DTS,
296
    CODEC_ID_VORBIS,
297
    CODEC_ID_DVAUDIO,
298
    CODEC_ID_WMAV1,
299
    CODEC_ID_WMAV2,
300
    CODEC_ID_MACE3,
301
    CODEC_ID_MACE6,
302
    CODEC_ID_VMDAUDIO,
303
    CODEC_ID_SONIC,
304
    CODEC_ID_SONIC_LS,
305 ac2570a8 Michael Niedermayer
    CODEC_ID_FLAC,
306 1ede228a Roberto Togni
    CODEC_ID_MP3ADU,
307 d2a7718d Roberto Togni
    CODEC_ID_MP3ON4,
308 85ad5695 Michael Niedermayer
    CODEC_ID_SHORTEN,
309 5df8a0c6 Michael Niedermayer
    CODEC_ID_ALAC,
310 034eeaa1 Mike Melanson
    CODEC_ID_WESTWOOD_SND1,
311 0e373b95 Michael Niedermayer
    CODEC_ID_GSM, ///< as in Berlin toast format
312 d9b1c197 Roberto Togni
    CODEC_ID_QDM2,
313 e0f7e329 Benjamin Larsson
    CODEC_ID_COOK,
314 bf3027c8 Diego Biurrun
    CODEC_ID_TRUESPEECH,
315 a24c4a2a Alex Beregszaszi
    CODEC_ID_TTA,
316 348efc18 Kostya Shishkov
    CODEC_ID_SMACKAUDIO,
317 6c496518 Benjamin Larsson
    CODEC_ID_QCELP,
318 730581f3 Kostya Shishkov
    CODEC_ID_WAVPACK,
319 72450e50 Baptiste Coudurier
    CODEC_ID_DSICINAUDIO,
320 84ed36da Kostya Shishkov
    CODEC_ID_IMC,
321 185c7b6b Kostya Shishkov
    CODEC_ID_MUSEPACK7,
322 aad512b4 Michael Niedermayer
    CODEC_ID_MLP,
323 f5bccd85 Diego Biurrun
    CODEC_ID_GSM_MS, /* as found in WAV */
324 10e26bc7 Benjamin Larsson
    CODEC_ID_ATRAC3,
325 8950f828 Michael Niedermayer
    CODEC_ID_VOXWARE,
326 bf4a1f17 Kostya Shishkov
    CODEC_ID_APE,
327 636b13c5 Benjamin Larsson
    CODEC_ID_NELLYMOSER,
328 12877faf Kostya Shishkov
    CODEC_ID_MUSEPACK8,
329 cb4ddf77 Reimar Döffinger
    CODEC_ID_SPEEX,
330 7bb8d51c Benjamin Larsson
    CODEC_ID_WMAVOICE,
331
    CODEC_ID_WMAPRO,
332 800b9c24 Benjamin Larsson
    CODEC_ID_WMALOSSLESS,
333 b339f0c6 Benjamin Larsson
    CODEC_ID_ATRAC3P,
334 2988c93d Justin Ruggles
    CODEC_ID_EAC3,
335 faeedbbb Benjamin Larsson
    CODEC_ID_SIPR,
336 7f507b2d Michael Niedermayer
    CODEC_ID_MP1,
337 616e899c Vitor Sessak
    CODEC_ID_TWINVQ,
338 9ba4821d Ramiro Polla
    CODEC_ID_TRUEHD,
339 b24bbbb4 Jai Menon
    CODEC_ID_MP4ALS,
340 223e8df1 Benjamin Larsson
    CODEC_ID_ATRAC1,
341 4e5f42dd Daniel Verkamp
    CODEC_ID_BINKAUDIO_RDFT,
342
    CODEC_ID_BINKAUDIO_DCT,
343 136e19e1 Janne Grunau
    CODEC_ID_AAC_LATM,
344 ed19fafd Sascha Sommer
    CODEC_ID_QDMC,
345 115329f1 Diego Biurrun
346 240c1657 Fabrice Bellard
    /* subtitle codecs */
347 115329f1 Diego Biurrun
    CODEC_ID_DVD_SUBTITLE= 0x17000,
348
    CODEC_ID_DVB_SUBTITLE,
349 0e373b95 Michael Niedermayer
    CODEC_ID_TEXT,  ///< raw UTF-8 text
350 7e2643ae Reimar Döffinger
    CODEC_ID_XSUB,
351 f9a9b350 Evgeniy Stepanov
    CODEC_ID_SSA,
352 cc8c2c6a Reimar Döffinger
    CODEC_ID_MOV_TEXT,
353 c58b82a2 Stephen Backway
    CODEC_ID_HDMV_PGS_SUBTITLE,
354 e58992e4 Francesco Lavra
    CODEC_ID_DVB_TELETEXT,
355 ba2c508d Aurelien Jacobs
    CODEC_ID_SRT,
356 115329f1 Diego Biurrun
357 7ce68923 Diego Biurrun
    /* other specific kind of codecs (generally used for attachments) */
358 f8d7c9d3 Evgeniy Stepanov
    CODEC_ID_TTF= 0x18000,
359
360 0bef08e5 Michael Niedermayer
    CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
361
362 0e373b95 Michael Niedermayer
    CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
363 f5bccd85 Diego Biurrun
                                * stream (only used by libavformat) */
364 fd5b124d Anton Khirnov
    CODEC_ID_FFMETADATA=0x21000,   ///< Dummy codec for streams containing only metadata information.
365 de6d9b64 Fabrice Bellard
};
366 dcedf586 Fabrice Bellard
367 72415b2a Stefano Sabatini
#if LIBAVCODEC_VERSION_MAJOR < 53
368
#define CodecType AVMediaType
369
370
#define CODEC_TYPE_UNKNOWN    AVMEDIA_TYPE_UNKNOWN
371
#define CODEC_TYPE_VIDEO      AVMEDIA_TYPE_VIDEO
372
#define CODEC_TYPE_AUDIO      AVMEDIA_TYPE_AUDIO
373
#define CODEC_TYPE_DATA       AVMEDIA_TYPE_DATA
374
#define CODEC_TYPE_SUBTITLE   AVMEDIA_TYPE_SUBTITLE
375
#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
376
#define CODEC_TYPE_NB         AVMEDIA_TYPE_NB
377
#endif
378
379 262d1c5d Stefano Sabatini
#if FF_API_OLD_SAMPLE_FMT
380
#define SampleFormat AVSampleFormat
381
382
#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE
383
#define SAMPLE_FMT_U8   AV_SAMPLE_FMT_U8
384
#define SAMPLE_FMT_S16  AV_SAMPLE_FMT_S16
385
#define SAMPLE_FMT_S32  AV_SAMPLE_FMT_S32
386
#define SAMPLE_FMT_FLT  AV_SAMPLE_FMT_FLT
387
#define SAMPLE_FMT_DBL  AV_SAMPLE_FMT_DBL
388
#define SAMPLE_FMT_NB   AV_SAMPLE_FMT_NB
389
#endif
390 a96b68b7 Fabrice Bellard
391 176a6157 Stefano Sabatini
#if FF_API_OLD_AUDIOCONVERT
392 737eb597 Reinhard Tartler
#include "libavutil/audioconvert.h"
393 176a6157 Stefano Sabatini
394 0d72e7d0 Peter Ross
/* Audio channel masks */
395 176a6157 Stefano Sabatini
#define CH_FRONT_LEFT            AV_CH_FRONT_LEFT
396
#define CH_FRONT_RIGHT           AV_CH_FRONT_RIGHT
397
#define CH_FRONT_CENTER          AV_CH_FRONT_CENTER
398
#define CH_LOW_FREQUENCY         AV_CH_LOW_FREQUENCY
399
#define CH_BACK_LEFT             AV_CH_BACK_LEFT
400
#define CH_BACK_RIGHT            AV_CH_BACK_RIGHT
401
#define CH_FRONT_LEFT_OF_CENTER  AV_CH_FRONT_LEFT_OF_CENTER
402
#define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER
403
#define CH_BACK_CENTER           AV_CH_BACK_CENTER
404
#define CH_SIDE_LEFT             AV_CH_SIDE_LEFT
405
#define CH_SIDE_RIGHT            AV_CH_SIDE_RIGHT
406
#define CH_TOP_CENTER            AV_CH_TOP_CENTER
407
#define CH_TOP_FRONT_LEFT        AV_CH_TOP_FRONT_LEFT
408
#define CH_TOP_FRONT_CENTER      AV_CH_TOP_FRONT_CENTER
409
#define CH_TOP_FRONT_RIGHT       AV_CH_TOP_FRONT_RIGHT
410
#define CH_TOP_BACK_LEFT         AV_CH_TOP_BACK_LEFT
411
#define CH_TOP_BACK_CENTER       AV_CH_TOP_BACK_CENTER
412
#define CH_TOP_BACK_RIGHT        AV_CH_TOP_BACK_RIGHT
413
#define CH_STEREO_LEFT           AV_CH_STEREO_LEFT
414
#define CH_STEREO_RIGHT          AV_CH_STEREO_RIGHT
415 0d72e7d0 Peter Ross
416 31557166 Justin Ruggles
/** Channel mask value used for AVCodecContext.request_channel_layout
417
    to indicate that the user requests the channel order of the decoder output
418
    to be the native codec channel order. */
419 176a6157 Stefano Sabatini
#define CH_LAYOUT_NATIVE         AV_CH_LAYOUT_NATIVE
420 31557166 Justin Ruggles
421 0d72e7d0 Peter Ross
/* Audio channel convenience macros */
422 176a6157 Stefano Sabatini
#define CH_LAYOUT_MONO           AV_CH_LAYOUT_MONO
423
#define CH_LAYOUT_STEREO         AV_CH_LAYOUT_STEREO
424
#define CH_LAYOUT_2_1            AV_CH_LAYOUT_2_1
425
#define CH_LAYOUT_SURROUND       AV_CH_LAYOUT_SURROUND
426
#define CH_LAYOUT_4POINT0        AV_CH_LAYOUT_4POINT0
427
#define CH_LAYOUT_2_2            AV_CH_LAYOUT_2_2
428
#define CH_LAYOUT_QUAD           AV_CH_LAYOUT_QUAD
429
#define CH_LAYOUT_5POINT0        AV_CH_LAYOUT_5POINT0
430
#define CH_LAYOUT_5POINT1        AV_CH_LAYOUT_5POINT1
431
#define CH_LAYOUT_5POINT0_BACK   AV_CH_LAYOUT_5POINT0_BACK
432
#define CH_LAYOUT_5POINT1_BACK   AV_CH_LAYOUT_5POINT1_BACK
433
#define CH_LAYOUT_7POINT0        AV_CH_LAYOUT_7POINT0
434
#define CH_LAYOUT_7POINT1        AV_CH_LAYOUT_7POINT1
435
#define CH_LAYOUT_7POINT1_WIDE   AV_CH_LAYOUT_7POINT1_WIDE
436
#define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX
437
#endif
438 0d72e7d0 Peter Ross
439 de6d9b64 Fabrice Bellard
/* in bytes */
440 8170e5fb Alex Beregszaszi
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
441 de6d9b64 Fabrice Bellard
442 d7425f59 Michael Niedermayer
/**
443 cf713bb8 Michael Niedermayer
 * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
444 171b7b91 Alex Converse
 * This is mainly needed because some optimized bitstream readers read
445
 * 32 or 64 bit at once and could read over the end.<br>
446 f5bccd85 Diego Biurrun
 * Note: If the first 23 bits of the additional bytes are not 0, then damaged
447
 * MPEG bitstreams could cause overread and segfault.
448 d7425f59 Michael Niedermayer
 */
449 171b7b91 Alex Converse
#define FF_INPUT_BUFFER_PADDING_SIZE 8
450 d7425f59 Michael Niedermayer
451 0ecca7a4 Michael Niedermayer
/**
452 f5bccd85 Diego Biurrun
 * minimum encoding buffer size
453
 * Used to avoid some checks during header writing.
454 0ecca7a4 Michael Niedermayer
 */
455
#define FF_MIN_BUFFER_SIZE 16384
456
457 47146dfb Michael Niedermayer
458 0e373b95 Michael Niedermayer
/**
459 bafc102b Michael Niedermayer
 * motion estimation type.
460 0e373b95 Michael Niedermayer
 */
461 e4986da9 Juanjo
enum Motion_Est_ID {
462 9b4dd1b8 Michael Niedermayer
    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
463 e4986da9 Juanjo
    ME_FULL,
464
    ME_LOG,
465
    ME_PHODS,
466 9b4dd1b8 Michael Niedermayer
    ME_EPZS,        ///< enhanced predictive zonal search
467
    ME_X1,          ///< reserved for experiments
468
    ME_HEX,         ///< hexagon based search
469
    ME_UMH,         ///< uneven multi-hexagon search
470
    ME_ITER,        ///< iterative search
471 359bbdab Loren Merritt
    ME_TESA,        ///< transformed exhaustive search algorithm
472 e4986da9 Juanjo
};
473
474 8c3eba7c Michael Niedermayer
enum AVDiscard{
475 f5bccd85 Diego Biurrun
    /* We leave some space between them for extensions (drop some
476
     * keyframes for intra-only or drop just some bidir frames). */
477 8c3eba7c Michael Niedermayer
    AVDISCARD_NONE   =-16, ///< discard nothing
478
    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
479
    AVDISCARD_NONREF =  8, ///< discard all non reference
480
    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
481
    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
482
    AVDISCARD_ALL    = 48, ///< discard all
483
};
484
485 4ee6a5c1 Michael Niedermayer
enum AVColorPrimaries{
486
    AVCOL_PRI_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
487
    AVCOL_PRI_UNSPECIFIED=2,
488
    AVCOL_PRI_BT470M     =4,
489
    AVCOL_PRI_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
490
    AVCOL_PRI_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
491
    AVCOL_PRI_SMPTE240M  =7, ///< functionally identical to above
492
    AVCOL_PRI_FILM       =8,
493
    AVCOL_PRI_NB           , ///< Not part of ABI
494
};
495
496
enum AVColorTransferCharacteristic{
497
    AVCOL_TRC_BT709      =1, ///< also ITU-R BT1361
498
    AVCOL_TRC_UNSPECIFIED=2,
499
    AVCOL_TRC_GAMMA22    =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
500
    AVCOL_TRC_GAMMA28    =5, ///< also ITU-R BT470BG
501
    AVCOL_TRC_NB           , ///< Not part of ABI
502
};
503
504
enum AVColorSpace{
505
    AVCOL_SPC_RGB        =0,
506
    AVCOL_SPC_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
507
    AVCOL_SPC_UNSPECIFIED=2,
508
    AVCOL_SPC_FCC        =4,
509
    AVCOL_SPC_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
510
    AVCOL_SPC_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
511
    AVCOL_SPC_SMPTE240M  =7,
512
    AVCOL_SPC_NB           , ///< Not part of ABI
513
};
514
515
enum AVColorRange{
516
    AVCOL_RANGE_UNSPECIFIED=0,
517
    AVCOL_RANGE_MPEG       =1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
518
    AVCOL_RANGE_JPEG       =2, ///< the normal     2^n-1   "JPEG" YUV ranges
519
    AVCOL_RANGE_NB           , ///< Not part of ABI
520
};
521
522 580a7465 David Conrad
/**
523
 *  X   X      3 4 X      X are luma samples,
524
 *             1 2        1-6 are possible chroma positions
525
 *  X   X      5 6 X      0 is undefined/unknown position
526
 */
527
enum AVChromaLocation{
528
    AVCHROMA_LOC_UNSPECIFIED=0,
529
    AVCHROMA_LOC_LEFT       =1, ///< mpeg2/4, h264 default
530
    AVCHROMA_LOC_CENTER     =2, ///< mpeg1, jpeg, h263
531
    AVCHROMA_LOC_TOPLEFT    =3, ///< DV
532
    AVCHROMA_LOC_TOP        =4,
533
    AVCHROMA_LOC_BOTTOMLEFT =5,
534
    AVCHROMA_LOC_BOTTOM     =6,
535
    AVCHROMA_LOC_NB           , ///< Not part of ABI
536
};
537
538 23940f14 Justin Ruggles
/**
539
 * LPC analysis type
540
 */
541
enum AVLPCType {
542
    AV_LPC_TYPE_DEFAULT     = -1, ///< use the codec default LPC type
543
    AV_LPC_TYPE_NONE        =  0, ///< do not use LPC prediction or use all zero coefficients
544
    AV_LPC_TYPE_FIXED       =  1, ///< fixed LPC coefficients
545
    AV_LPC_TYPE_LEVINSON    =  2, ///< Levinson-Durbin recursion
546
    AV_LPC_TYPE_CHOLESKY    =  3, ///< Cholesky factorization
547
    AV_LPC_TYPE_NB              , ///< Not part of ABI
548
};
549
550 34b47d7c Justin Ruggles
enum AVAudioServiceType {
551
    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
552
    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
553
    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
554
    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
555
    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
556
    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
557
    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
558
    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
559
    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
560
    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
561
};
562
563 ce980a95 Michael Niedermayer
typedef struct RcOverride{
564
    int start_frame;
565
    int end_frame;
566 f5bccd85 Diego Biurrun
    int qscale; // If this is 0 then quality_factor will be used instead.
567 ce980a95 Michael Niedermayer
    float quality_factor;
568
} RcOverride;
569
570 b0ec9efd Erik Slagter
#define FF_MAX_B_FRAMES 16
571 9dbcbd92 Michael Niedermayer
572 a949d72e Michael Niedermayer
/* encoding support
573 f5bccd85 Diego Biurrun
   These flags can be passed in AVCodecContext.flags before initialization.
574
   Note: Not everything is supported yet.
575 a949d72e Michael Niedermayer
*/
576 de6d9b64 Fabrice Bellard
577 f5bccd85 Diego Biurrun
#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
578
#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
579
#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
580
#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
581
#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
582
#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
583 1ba8f5eb Michael Niedermayer
/**
584
 * The parent program guarantees that the input for B-frames containing
585 f5bccd85 Diego Biurrun
 * streams is not written to for at least s->max_b_frames+1 frames, if
586 1ba8f5eb Michael Niedermayer
 * this is not set the input will be copied.
587
 */
588 8b4c7dbc Michael Niedermayer
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
589 273b0cd3 Diego Biurrun
#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
590
#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
591
#define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
592
#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
593
#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
594
#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
595
#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
596
                                                  location instead of only at frame boundaries. */
597 f5bccd85 Diego Biurrun
#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
598
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
599
#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
600
#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
601
#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
602
#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
603 21e59552 Michael Niedermayer
/* Fx : Flag for h263+ extra options */
604 f5bccd85 Diego Biurrun
#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
605
#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
606
#define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
607
#define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
608
#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
609 332f9ac4 Michael Niedermayer
#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
610
#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
611 bb198e19 Michael Niedermayer
#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
612
#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
613 f5bccd85 Diego Biurrun
#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
614 f3eec1cf Michael Niedermayer
#define CODEC_FLAG_CLOSED_GOP     0x80000000
615 f5bccd85 Diego Biurrun
#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
616
#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
617
#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
618
#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
619
#define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be used as references.
620
#define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction for B-frames
621 d3075ed5 Panagiotis Issaris
#define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
622 58f7833e Robert Swain
#define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 transform
623
#define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
624
#define CODEC_FLAG2_AUD           0x00000200 ///< H.264 access unit delimiters
625 f5bccd85 Diego Biurrun
#define CODEC_FLAG2_BRDO          0x00000400 ///< B-frame rate-distortion optimization
626
#define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
627
#define CODEC_FLAG2_MEMC_ONLY     0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
628
#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
629
#define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
630
#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
631
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
632 f1618fd9 Paul Kelly
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
633 25a42948 Erik Slagter
#define CODEC_FLAG2_MBTREE        0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
634 f3b3b489 Baptiste Coudurier
#define CODEC_FLAG2_PSY           0x00080000 ///< Use psycho visual optimizations.
635
#define CODEC_FLAG2_SSIM          0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
636 e8c7fca9 Jason Garrett-Glaser
#define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes.
637 6fc5b059 Michael Niedermayer
638 21e59552 Michael Niedermayer
/* Unsupported options :
639 bb270c08 Diego Biurrun
 *              Syntax Arithmetic coding (SAC)
640
 *              Reference Picture Selection
641 eafcac6a Diego Biurrun
 *              Independent Segment Decoding */
642 21e59552 Michael Niedermayer
/* /Fx */
643 bf89e6b1 Fabrice Bellard
/* codec capabilities */
644
645 f5bccd85 Diego Biurrun
#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
646 6814a25c Michael Niedermayer
/**
647 9b489e02 Reimar Döffinger
 * Codec uses get_buffer() for allocating buffers and supports custom allocators.
648
 * If not set, it might not use get_buffer() at all or use operations that
649
 * assume the buffer was allocated by avcodec_default_get_buffer.
650 6814a25c Michael Niedermayer
 */
651
#define CODEC_CAP_DR1             0x0002
652 f5bccd85 Diego Biurrun
/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
653 917e06c8 Fabrice Bellard
#define CODEC_CAP_PARSE_ONLY      0x0004
654 d7425f59 Michael Niedermayer
#define CODEC_CAP_TRUNCATED       0x0008
655 f5bccd85 Diego Biurrun
/* Codec can export data for HW decoding (XvMC). */
656 5e5c247a Ivan Kalvachev
#define CODEC_CAP_HWACCEL         0x0010
657 115329f1 Diego Biurrun
/**
658 f5bccd85 Diego Biurrun
 * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
659
 * If this is not set, the codec is guaranteed to never be fed with NULL data.
660 934982c4 Michael Niedermayer
 */
661 6f824977 Michael Niedermayer
#define CODEC_CAP_DELAY           0x0020
662 cef7cc72 Justin Ruggles
/**
663
 * Codec can be fed a final frame with a smaller size.
664
 * This can be used to prevent truncation of the last audio samples.
665
 */
666
#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
667 369122dd NVIDIA Corporation
/**
668
 * Codec can export data for HW decoding (VDPAU).
669
 */
670
#define CODEC_CAP_HWACCEL_VDPAU    0x0080
671 d859bb1d Sascha Sommer
/**
672
 * Codec can output multiple frames per AVPacket
673 e9e949cf Michael Niedermayer
 * Normally demuxers return one frame at a time, demuxers which do not do
674
 * are connected to a parser to split what they return into proper frames.
675
 * This flag is reserved to the very rare category of codecs which have a
676
 * bitstream that cannot be split into frames without timeconsuming
677
 * operations like full decoding. Demuxers carring such bitstreams thus
678
 * may return multiple frames in a packet. This has many disadvantages like
679
 * prohibiting stream copy in many cases thus it should only be considered
680
 * as a last resort.
681 d859bb1d Sascha Sommer
 */
682
#define CODEC_CAP_SUBFRAMES        0x0100
683 93ebfeea Janne Grunau
/**
684
 * Codec is experimental and is thus avoided in favor of non experimental
685
 * encoders
686
 */
687
#define CODEC_CAP_EXPERIMENTAL     0x0200
688 62784e37 Benjamin Larsson
/**
689
 * Codec should fill in channel configuration and samplerate instead of container
690
 */
691
#define CODEC_CAP_CHANNEL_CONF     0x0400
692 16cfc961 Stefano Sabatini
/**
693
 * Codec is able to deal with negative linesizes
694
 */
695
#define CODEC_CAP_NEG_LINESIZES    0x0800
696 37b00b47 Alexander Strange
/**
697
 * Codec supports frame-level multithreading.
698
 */
699
#define CODEC_CAP_FRAME_THREADS    0x1000
700 bf89e6b1 Fabrice Bellard
701 f5bccd85 Diego Biurrun
//The following defines may change, don't expect compatibility if you use them.
702 8d7ec294 Wolfgang Hesseler
#define MB_TYPE_INTRA4x4   0x0001
703 f5bccd85 Diego Biurrun
#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
704
#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
705 8d7ec294 Wolfgang Hesseler
#define MB_TYPE_16x16      0x0008
706
#define MB_TYPE_16x8       0x0010
707
#define MB_TYPE_8x16       0x0020
708
#define MB_TYPE_8x8        0x0040
709
#define MB_TYPE_INTERLACED 0x0080
710 273b0cd3 Diego Biurrun
#define MB_TYPE_DIRECT2    0x0100 //FIXME
711 8d7ec294 Wolfgang Hesseler
#define MB_TYPE_ACPRED     0x0200
712
#define MB_TYPE_GMC        0x0400
713
#define MB_TYPE_SKIP       0x0800
714
#define MB_TYPE_P0L0       0x1000
715
#define MB_TYPE_P1L0       0x2000
716
#define MB_TYPE_P0L1       0x4000
717
#define MB_TYPE_P1L1       0x8000
718
#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
719
#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
720
#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
721
#define MB_TYPE_QUANT      0x00010000
722
#define MB_TYPE_CBP        0x00020000
723
//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
724
725 fa384dcc Michael Niedermayer
/**
726
 * Pan Scan area.
727 f5bccd85 Diego Biurrun
 * This specifies the area which should be displayed.
728
 * Note there may be multiple such areas for one frame.
729 fa384dcc Michael Niedermayer
 */
730
typedef struct AVPanScan{
731
    /**
732 f5bccd85 Diego Biurrun
     * id
733
     * - encoding: Set by user.
734
     * - decoding: Set by libavcodec.
735 fa384dcc Michael Niedermayer
     */
736
    int id;
737
738
    /**
739
     * width and height in 1/16 pel
740 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
741
     * - decoding: Set by libavcodec.
742 fa384dcc Michael Niedermayer
     */
743
    int width;
744
    int height;
745
746
    /**
747 f5bccd85 Diego Biurrun
     * position of the top left corner in 1/16 pel for up to 3 fields/frames
748
     * - encoding: Set by user.
749
     * - decoding: Set by libavcodec.
750 fa384dcc Michael Niedermayer
     */
751
    int16_t position[3][2];
752
}AVPanScan;
753
754 492cd3a9 Michael Niedermayer
#define FF_COMMON_FRAME \
755 b536d0aa Michael Niedermayer
    /**\
756
     * pointer to the picture planes.\
757 f5bccd85 Diego Biurrun
     * This might be different from the first allocated byte\
758 b536d0aa Michael Niedermayer
     * - encoding: \
759
     * - decoding: \
760
     */\
761 1e491e29 Michael Niedermayer
    uint8_t *data[4];\
762
    int linesize[4];\
763
    /**\
764 f5bccd85 Diego Biurrun
     * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
765
     * This isn't used by libavcodec unless the default get/release_buffer() is used.\
766 64863965 Michael Niedermayer
     * - encoding: \
767
     * - decoding: \
768 1e491e29 Michael Niedermayer
     */\
769
    uint8_t *base[4];\
770
    /**\
771
     * 1 -> keyframe, 0-> not\
772 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec.\
773
     * - decoding: Set by libavcodec.\
774 1e491e29 Michael Niedermayer
     */\
775
    int key_frame;\
776
\
777
    /**\
778 f5bccd85 Diego Biurrun
     * Picture type of the frame, see ?_TYPE below.\
779
     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
780
     * - decoding: Set by libavcodec.\
781 1e491e29 Michael Niedermayer
     */\
782
    int pict_type;\
783
\
784
    /**\
785 c0df9d75 Michael Niedermayer
     * presentation timestamp in time_base units (time when frame should be shown to user)\
786 f5bccd85 Diego Biurrun
     * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
787
     * - encoding: MUST be set by user.\
788
     * - decoding: Set by libavcodec.\
789 1e491e29 Michael Niedermayer
     */\
790 be6784dc Richard Hodges
    int64_t pts;\
791 1e491e29 Michael Niedermayer
\
792
    /**\
793 f5bccd85 Diego Biurrun
     * picture number in bitstream order\
794 64863965 Michael Niedermayer
     * - encoding: set by\
795 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
796 1e491e29 Michael Niedermayer
     */\
797
    int coded_picture_number;\
798
    /**\
799 f5bccd85 Diego Biurrun
     * picture number in display order\
800 64863965 Michael Niedermayer
     * - encoding: set by\
801 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
802 1e491e29 Michael Niedermayer
     */\
803
    int display_picture_number;\
804
\
805
    /**\
806 158c7f05 Michael Niedermayer
     * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
807 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
808
     * - decoding: Set by libavcodec.\
809 1e491e29 Michael Niedermayer
     */\
810 158c7f05 Michael Niedermayer
    int quality; \
811 1e491e29 Michael Niedermayer
\
812
    /**\
813
     * buffer age (1->was last buffer and dint change, 2->..., ...).\
814 f5bccd85 Diego Biurrun
     * Set to INT_MAX if the buffer has not been used yet.\
815 64863965 Michael Niedermayer
     * - encoding: unused\
816 f5bccd85 Diego Biurrun
     * - decoding: MUST be set by get_buffer().\
817 1e491e29 Michael Niedermayer
     */\
818
    int age;\
819
\
820
    /**\
821
     * is this picture used as reference\
822 8474f58e Michael Niedermayer
     * The values for this are the same as the MpegEncContext.picture_structure\
823
     * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
824 5fe2a515 Carl Eugen Hoyos
     * Set to 4 for delayed, non-reference frames.\
825 64863965 Michael Niedermayer
     * - encoding: unused\
826 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec. (before get_buffer() call)).\
827 1e491e29 Michael Niedermayer
     */\
828
    int reference;\
829
\
830
    /**\
831
     * QP table\
832 64863965 Michael Niedermayer
     * - encoding: unused\
833 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
834 1e491e29 Michael Niedermayer
     */\
835
    int8_t *qscale_table;\
836
    /**\
837
     * QP store stride\
838 64863965 Michael Niedermayer
     * - encoding: unused\
839 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
840 1e491e29 Michael Niedermayer
     */\
841
    int qstride;\
842
\
843
    /**\
844 f5bccd85 Diego Biurrun
     * mbskip_table[mb]>=1 if MB didn't change\
845 1e491e29 Michael Niedermayer
     * stride= mb_width = (width+15)>>4\
846 64863965 Michael Niedermayer
     * - encoding: unused\
847 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
848 1e491e29 Michael Niedermayer
     */\
849
    uint8_t *mbskip_table;\
850
\
851
    /**\
852 f5bccd85 Diego Biurrun
     * motion vector table\
853 61436073 Michael Niedermayer
     * @code\
854
     * example:\
855
     * int mv_sample_log2= 4 - motion_subsample_log2;\
856
     * int mb_width= (width+15)>>4;\
857
     * int mv_stride= (mb_width << mv_sample_log2) + 1;\
858
     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
859
     * @endcode\
860 f5bccd85 Diego Biurrun
     * - encoding: Set by user.\
861
     * - decoding: Set by libavcodec.\
862 8d7ec294 Wolfgang Hesseler
     */\
863
    int16_t (*motion_val[2])[2];\
864
\
865
    /**\
866 f5bccd85 Diego Biurrun
     * macroblock type table\
867 8d7ec294 Wolfgang Hesseler
     * mb_type_base + mb_width + 2\
868 f5bccd85 Diego Biurrun
     * - encoding: Set by user.\
869
     * - decoding: Set by libavcodec.\
870 8d7ec294 Wolfgang Hesseler
     */\
871
    uint32_t *mb_type;\
872
\
873
    /**\
874 f0b77c69 Michael Niedermayer
     * log2 of the size of the block which a single vector in motion_val represents: \
875
     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
876 8d7ec294 Wolfgang Hesseler
     * - encoding: unused\
877 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
878 8d7ec294 Wolfgang Hesseler
     */\
879
    uint8_t motion_subsample_log2;\
880
\
881
    /**\
882 1e491e29 Michael Niedermayer
     * for some private data of the user\
883 64863965 Michael Niedermayer
     * - encoding: unused\
884 f5bccd85 Diego Biurrun
     * - decoding: Set by user.\
885 1e491e29 Michael Niedermayer
     */\
886
    void *opaque;\
887 140cb663 Michael Niedermayer
\
888
    /**\
889
     * error\
890 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
891 64863965 Michael Niedermayer
     * - decoding: unused\
892 140cb663 Michael Niedermayer
     */\
893
    uint64_t error[4];\
894 4e00e76b Michael Niedermayer
\
895
    /**\
896 f5bccd85 Diego Biurrun
     * type of the buffer (to keep track of who has to deallocate data[*])\
897
     * - encoding: Set by the one who allocates it.\
898
     * - decoding: Set by the one who allocates it.\
899
     * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
900 4e00e76b Michael Niedermayer
     */\
901
    int type;\
902 2ec23b6d Michael Niedermayer
    \
903
    /**\
904 f5bccd85 Diego Biurrun
     * When decoding, this signals how much the picture must be delayed.\
905 2ec23b6d Michael Niedermayer
     * extra_delay = repeat_pict / (2*fps)\
906 64863965 Michael Niedermayer
     * - encoding: unused\
907 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
908 2ec23b6d Michael Niedermayer
     */\
909 0426af31 Michael Niedermayer
    int repeat_pict;\
910
    \
911
    /**\
912
     * \
913
     */\
914
    int qscale_type;\
915 2744ca9a Roman Shaposhnik
    \
916
    /**\
917
     * The content of the picture is interlaced.\
918 f5bccd85 Diego Biurrun
     * - encoding: Set by user.\
919
     * - decoding: Set by libavcodec. (default 0)\
920 2744ca9a Roman Shaposhnik
     */\
921
    int interlaced_frame;\
922
    \
923
    /**\
924 f5bccd85 Diego Biurrun
     * If the content is interlaced, is top field displayed first.\
925
     * - encoding: Set by user.\
926
     * - decoding: Set by libavcodec.\
927 2744ca9a Roman Shaposhnik
     */\
928 9dad924e Michael Niedermayer
    int top_field_first;\
929 fa384dcc Michael Niedermayer
    \
930
    /**\
931
     * Pan scan.\
932 f5bccd85 Diego Biurrun
     * - encoding: Set by user.\
933
     * - decoding: Set by libavcodec.\
934 fa384dcc Michael Niedermayer
     */\
935
    AVPanScan *pan_scan;\
936 2a2bbcb0 Mike Melanson
    \
937
    /**\
938 f5bccd85 Diego Biurrun
     * Tell user application that palette has changed from previous frame.\
939 2a2bbcb0 Mike Melanson
     * - encoding: ??? (no palette-enabled encoder yet)\
940 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec. (default 0).\
941 2a2bbcb0 Mike Melanson
     */\
942
    int palette_has_changed;\
943 074c4ca7 Roberto Togni
    \
944
    /**\
945 f5bccd85 Diego Biurrun
     * codec suggestion on buffer type if != 0\
946 074c4ca7 Roberto Togni
     * - encoding: unused\
947 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec. (before get_buffer() call)).\
948 074c4ca7 Roberto Togni
     */\
949
    int buffer_hints;\
950 8289c6fa Wolfgang Hesseler
\
951
    /**\
952 f5bccd85 Diego Biurrun
     * DCT coefficients\
953 8289c6fa Wolfgang Hesseler
     * - encoding: unused\
954 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.\
955 8289c6fa Wolfgang Hesseler
     */\
956
    short *dct_coeff;\
957 a4d36c11 Michael Niedermayer
\
958
    /**\
959 58184187 Benoit Fouet
     * motion reference frame index\
960
     * the order in which these are stored can depend on the codec.\
961 f5bccd85 Diego Biurrun
     * - encoding: Set by user.\
962
     * - decoding: Set by libavcodec.\
963 a4d36c11 Michael Niedermayer
     */\
964 79de84f2 Michael Niedermayer
    int8_t *ref_index[2];\
965
\
966
    /**\
967 421167b0 Stefano Sabatini
     * reordered opaque 64bit (generally an integer or a double precision float\
968 e75229fa Michael Niedermayer
     * PTS but can be anything). \
969
     * The user sets AVCodecContext.reordered_opaque to represent the input at\
970 421167b0 Stefano Sabatini
     * that time,\
971
     * the decoder reorders values as needed and sets AVFrame.reordered_opaque\
972 e75229fa Michael Niedermayer
     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque \
973 81c623fa Michael Niedermayer
     * @deprecated in favor of pkt_pts\
974 79de84f2 Michael Niedermayer
     * - encoding: unused\
975
     * - decoding: Read by user.\
976
     */\
977
    int64_t reordered_opaque;\
978 68e5d523 Gwenole Beauchesne
\
979
    /**\
980
     * hardware accelerator private data (FFmpeg allocated)\
981
     * - encoding: unused\
982
     * - decoding: Set by libavcodec\
983
     */\
984 952e2083 Gwenole Beauchesne
    void *hwaccel_picture_private;\
985 393cbb96 Michael Niedermayer
\
986
    /**\
987
     * reordered pts from the last AVPacket that has been input into the decoder\
988
     * - encoding: unused\
989
     * - decoding: Read by user.\
990
     */\
991
    int64_t pkt_pts;\
992 1919feaf Michael Niedermayer
\
993
    /**\
994
     * dts from the last AVPacket that has been input into the decoder\
995
     * - encoding: unused\
996
     * - decoding: Read by user.\
997
     */\
998
    int64_t pkt_dts;\
999 37b00b47 Alexander Strange
\
1000
    /**\
1001
     * the AVCodecContext which ff_thread_get_buffer() was last called on\
1002
     * - encoding: Set by libavcodec.\
1003
     * - decoding: Set by libavcodec.\
1004
     */\
1005
    struct AVCodecContext *owner;\
1006
\
1007
    /**\
1008
     * used by multithreading to store frame-specific info\
1009
     * - encoding: Set by libavcodec.\
1010
     * - decoding: Set by libavcodec.\
1011
     */\
1012 2a03e873 Ronald S. Bultje
    void *thread_opaque;\
1013 2ec23b6d Michael Niedermayer
1014 bb270c08 Diego Biurrun
#define FF_QSCALE_TYPE_MPEG1 0
1015
#define FF_QSCALE_TYPE_MPEG2 1
1016
#define FF_QSCALE_TYPE_H264  2
1017 800274f8 Reimar Döffinger
#define FF_QSCALE_TYPE_VP56  3
1018 4e00e76b Michael Niedermayer
1019
#define FF_BUFFER_TYPE_INTERNAL 1
1020 f5bccd85 Diego Biurrun
#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
1021
#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
1022
#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
1023 4e00e76b Michael Niedermayer
1024 1e491e29 Michael Niedermayer
1025 dc85e859 Aurelien Jacobs
#define FF_I_TYPE  1 ///< Intra
1026
#define FF_P_TYPE  2 ///< Predicted
1027
#define FF_B_TYPE  3 ///< Bi-dir predicted
1028
#define FF_S_TYPE  4 ///< S(GMC)-VOP MPEG4
1029
#define FF_SI_TYPE 5 ///< Switching Intra
1030
#define FF_SP_TYPE 6 ///< Switching Predicted
1031 48d533e6 Aurelien Jacobs
#define FF_BI_TYPE 7
1032 1e491e29 Michael Niedermayer
1033 f5bccd85 Diego Biurrun
#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
1034
#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
1035
#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
1036
#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
1037 074c4ca7 Roberto Togni
1038 4de339e2 Kostya Shishkov
enum AVPacketSideDataType {
1039
    AV_PKT_DATA_PALETTE,
1040
};
1041
1042 18c915ee Thilo Borgmann
typedef struct AVPacket {
1043
    /**
1044 7b356d39 Robert Swain
     * Presentation timestamp in AVStream->time_base units; the time at which
1045
     * the decompressed packet will be presented to the user.
1046 18c915ee Thilo Borgmann
     * Can be AV_NOPTS_VALUE if it is not stored in the file.
1047
     * pts MUST be larger or equal to dts as presentation cannot happen before
1048
     * decompression, unless one wants to view hex dumps. Some formats misuse
1049
     * the terms dts and pts/cts to mean something different. Such timestamps
1050
     * must be converted to true pts/dts before they are stored in AVPacket.
1051
     */
1052
    int64_t pts;
1053
    /**
1054 7b356d39 Robert Swain
     * Decompression timestamp in AVStream->time_base units; the time at which
1055
     * the packet is decompressed.
1056 18c915ee Thilo Borgmann
     * Can be AV_NOPTS_VALUE if it is not stored in the file.
1057
     */
1058
    int64_t dts;
1059
    uint8_t *data;
1060
    int   size;
1061
    int   stream_index;
1062
    int   flags;
1063
    /**
1064 4de339e2 Kostya Shishkov
     * Additional packet data that can be provided by the container.
1065
     * Packet can contain several types of side information.
1066
     */
1067
    struct {
1068
        uint8_t *data;
1069
        int      size;
1070
        enum AVPacketSideDataType type;
1071
    } *side_data;
1072
    int side_data_elems;
1073
1074
    /**
1075 7b356d39 Robert Swain
     * Duration of this packet in AVStream->time_base units, 0 if unknown.
1076 18c915ee Thilo Borgmann
     * Equals next_pts - this_pts in presentation order.
1077
     */
1078
    int   duration;
1079
    void  (*destruct)(struct AVPacket *);
1080
    void  *priv;
1081
    int64_t pos;                            ///< byte position in stream, -1 if unknown
1082
1083
    /**
1084 7b356d39 Robert Swain
     * Time difference in AVStream->time_base units from the pts of this
1085 18c915ee Thilo Borgmann
     * packet to the point at which the output from the decoder has converged
1086
     * independent from the availability of previous frames. That is, the
1087
     * frames are virtually identical no matter if decoding started from
1088
     * the very first frame or from this keyframe.
1089
     * Is AV_NOPTS_VALUE if unknown.
1090
     * This field is not the display duration of the current packet.
1091 8ee82f40 Aurelien Jacobs
     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
1092
     * set.
1093 18c915ee Thilo Borgmann
     *
1094
     * The purpose of this field is to allow seeking in streams that have no
1095
     * keyframes in the conventional sense. It corresponds to the
1096
     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
1097
     * essential for some types of subtitle streams to ensure that all
1098
     * subtitles are correctly displayed after seeking.
1099
     */
1100
    int64_t convergence_duration;
1101
} AVPacket;
1102 8f3f2e06 Reimar Döffinger
#define AV_PKT_FLAG_KEY   0x0001
1103
#if LIBAVCODEC_VERSION_MAJOR < 53
1104
#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
1105
#endif
1106 18c915ee Thilo Borgmann
1107 0da71265 Michael Niedermayer
/**
1108
 * Audio Video Frame.
1109 ba66ae94 Michael Niedermayer
 * New fields can be added to the end of FF_COMMON_FRAME with minor version
1110
 * bumps.
1111 8bfb108b Diego Biurrun
 * Removal, reordering and changes to existing fields require a major
1112 ba66ae94 Michael Niedermayer
 * version bump. No fields should be added into AVFrame before or after
1113
 * FF_COMMON_FRAME!
1114 8bfb108b Diego Biurrun
 * sizeof(AVFrame) must not be used outside libav*.
1115 0da71265 Michael Niedermayer
 */
1116 492cd3a9 Michael Niedermayer
typedef struct AVFrame {
1117
    FF_COMMON_FRAME
1118
} AVFrame;
1119 1e491e29 Michael Niedermayer
1120 d33c949c Michael Niedermayer
/**
1121 252f17e2 Michael Niedermayer
 * main external API structure.
1122
 * New fields can be added to the end with minor version bumps.
1123 8bfb108b Diego Biurrun
 * Removal, reordering and changes to existing fields require a major
1124 252f17e2 Michael Niedermayer
 * version bump.
1125 8bfb108b Diego Biurrun
 * sizeof(AVCodecContext) must not be used outside libav*.
1126 d33c949c Michael Niedermayer
 */
1127 de6d9b64 Fabrice Bellard
typedef struct AVCodecContext {
1128 b71901e6 Michael Niedermayer
    /**
1129 f5bccd85 Diego Biurrun
     * information on struct for av_log
1130 bc874dae Michel Bardiaux
     * - set by avcodec_alloc_context
1131
     */
1132 d42a814e Panagiotis Issaris
    const AVClass *av_class;
1133 bc874dae Michel Bardiaux
    /**
1134 f5bccd85 Diego Biurrun
     * the average bitrate
1135
     * - encoding: Set by user; unused for constant quantizer encoding.
1136
     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
1137 b71901e6 Michael Niedermayer
     */
1138 de6d9b64 Fabrice Bellard
    int bit_rate;
1139 b71901e6 Michael Niedermayer
1140
    /**
1141 64863965 Michael Niedermayer
     * number of bits the bitstream is allowed to diverge from the reference.
1142 b71901e6 Michael Niedermayer
     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
1143 f5bccd85 Diego Biurrun
     * - encoding: Set by user; unused for constant quantizer encoding.
1144 64863965 Michael Niedermayer
     * - decoding: unused
1145 b71901e6 Michael Niedermayer
     */
1146 115329f1 Diego Biurrun
    int bit_rate_tolerance;
1147 b71901e6 Michael Niedermayer
1148
    /**
1149 64863965 Michael Niedermayer
     * CODEC_FLAG_*.
1150 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
1151
     * - decoding: Set by user.
1152 b71901e6 Michael Niedermayer
     */
1153 de6d9b64 Fabrice Bellard
    int flags;
1154 b71901e6 Michael Niedermayer
1155
    /**
1156 f5bccd85 Diego Biurrun
     * Some codecs need additional format info. It is stored here.
1157
     * If any muxer uses this then ALL demuxers/parsers AND encoders for the
1158
     * specific codec MUST set it correctly otherwise stream copy breaks.
1159
     * In general use of this field by muxers is not recommanded.
1160
     * - encoding: Set by libavcodec.
1161
     * - decoding: Set by libavcodec. (FIXME: Is this OK?)
1162 b71901e6 Michael Niedermayer
     */
1163
    int sub_id;
1164
1165
    /**
1166 f5bccd85 Diego Biurrun
     * Motion estimation algorithm used for video coding.
1167 58f7833e Robert Swain
     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
1168 89223ef6 Baptiste Coudurier
     * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
1169 64863965 Michael Niedermayer
     * - encoding: MUST be set by user.
1170
     * - decoding: unused
1171 b71901e6 Michael Niedermayer
     */
1172
    int me_method;
1173
1174
    /**
1175 f5bccd85 Diego Biurrun
     * some codecs need / can use extradata like Huffman tables.
1176
     * mjpeg: Huffman tables
1177 b71901e6 Michael Niedermayer
     * rv10: additional flags
1178 b704e742 Michael Niedermayer
     * mpeg4: global headers (they can be in the bitstream or here)
1179 f5bccd85 Diego Biurrun
     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
1180
     * than extradata_size to avoid prolems if it is read with the bitstream reader.
1181
     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
1182
     * - encoding: Set/allocated/freed by libavcodec.
1183
     * - decoding: Set/allocated/freed by user.
1184 b71901e6 Michael Niedermayer
     */
1185 58f2a4b0 Baptiste Coudurier
    uint8_t *extradata;
1186 e84c31dc Arpi
    int extradata_size;
1187 115329f1 Diego Biurrun
1188 b71901e6 Michael Niedermayer
    /**
1189 f5bccd85 Diego Biurrun
     * This is the fundamental unit of time (in seconds) in terms
1190
     * of which frame timestamps are represented. For fixed-fps content,
1191 5b28c8c3 Michael Niedermayer
     * timebase should be 1/framerate and timestamp increments should be
1192
     * identically 1.
1193 f5bccd85 Diego Biurrun
     * - encoding: MUST be set by user.
1194
     * - decoding: Set by libavcodec.
1195 b71901e6 Michael Niedermayer
     */
1196 c0df9d75 Michael Niedermayer
    AVRational time_base;
1197 115329f1 Diego Biurrun
1198 5b28c8c3 Michael Niedermayer
    /* video only */
1199 14bea432 Michael Niedermayer
    /**
1200 21adafec Michael Niedermayer
     * picture width / height.
1201 115329f1 Diego Biurrun
     * - encoding: MUST be set by user.
1202 f5bccd85 Diego Biurrun
     * - decoding: Set by libavcodec.
1203
     * Note: For compatibility it is possible to set this instead of
1204
     * coded_width/height before decoding.
1205 b71901e6 Michael Niedermayer
     */
1206 de6d9b64 Fabrice Bellard
    int width, height;
1207 115329f1 Diego Biurrun
1208 e769f053 Alex Beregszaszi
#define FF_ASPECT_EXTENDED 15
1209 b71901e6 Michael Niedermayer
1210
    /**
1211 f5bccd85 Diego Biurrun
     * the number of pictures in a group of pictures, or 0 for intra_only
1212
     * - encoding: Set by user.
1213 64863965 Michael Niedermayer
     * - decoding: unused
1214 b71901e6 Michael Niedermayer
     */
1215
    int gop_size;
1216
1217
    /**
1218 f5bccd85 Diego Biurrun
     * Pixel format, see PIX_FMT_xxx.
1219 c1bdc930 Tomas Härdin
     * May be set by the demuxer if known from headers.
1220
     * May be overriden by the decoder if it knows better.
1221 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
1222 c1bdc930 Tomas Härdin
     * - decoding: Set by user if known, overridden by libavcodec if known
1223 b71901e6 Michael Niedermayer
     */
1224 e4eadb4b Michael Niedermayer
    enum PixelFormat pix_fmt;
1225 115329f1 Diego Biurrun
1226 ed5fcd60 Anton Khirnov
#if FF_API_RATE_EMU
1227 bdfcbbed Max Krasnyansky
    /**
1228 f5bccd85 Diego Biurrun
     * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
1229 bdfcbbed Max Krasnyansky
     * has to read frames at native frame rate.
1230 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
1231
     * - decoding: unused
1232 bdfcbbed Max Krasnyansky
     */
1233 ed5fcd60 Anton Khirnov
    attribute_deprecated int rate_emu;
1234
#endif
1235 115329f1 Diego Biurrun
1236 b71901e6 Michael Niedermayer
    /**
1237 f5bccd85 Diego Biurrun
     * If non NULL, 'draw_horiz_band' is called by the libavcodec
1238
     * decoder to draw a horizontal band. It improves cache usage. Not
1239 b71901e6 Michael Niedermayer
     * all codecs can do that. You must check the codec capabilities
1240 f5bccd85 Diego Biurrun
     * beforehand.
1241 37b00b47 Alexander Strange
     * When multithreading is used, it may be called from multiple threads
1242
     * at the same time; threads might draw different parts of the same AVFrame,
1243
     * or multiple AVFrames, and there is no guarantee that slices will be drawn
1244
     * in order.
1245 24b1583a Ivan Kalvachev
     * The function is also used by hardware acceleration APIs.
1246
     * It is called at least once during frame decoding to pass
1247
     * the data needed for hardware render.
1248
     * In that mode instead of pixel data, AVFrame points to
1249
     * a structure specific to the acceleration API. The application
1250
     * reads the structure and can change some fields to indicate progress
1251
     * or mark state.
1252 64863965 Michael Niedermayer
     * - encoding: unused
1253 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
1254 3bb07d61 Michael Niedermayer
     * @param height the height of the slice
1255
     * @param y the y position of the slice
1256
     * @param type 1->top field, 2->bottom field, 3->frame
1257
     * @param offset offset into the AVFrame.data from which the slice should be read
1258 b71901e6 Michael Niedermayer
     */
1259 bf89e6b1 Fabrice Bellard
    void (*draw_horiz_band)(struct AVCodecContext *s,
1260 da64ecc3 Drew Hess
                            const AVFrame *src, int offset[4],
1261 3bb07d61 Michael Niedermayer
                            int y, int type, int height);
1262 bf89e6b1 Fabrice Bellard
1263 de6d9b64 Fabrice Bellard
    /* audio only */
1264 f5bccd85 Diego Biurrun
    int sample_rate; ///< samples per second
1265 5fcc4a23 Stefano Sabatini
    int channels;    ///< number of audio channels
1266 a3a5f4d6 Michael Niedermayer
1267
    /**
1268 f5bccd85 Diego Biurrun
     * audio sample format
1269
     * - encoding: Set by user.
1270
     * - decoding: Set by libavcodec.
1271 a3a5f4d6 Michael Niedermayer
     */
1272 5d6e4c16 Stefano Sabatini
    enum AVSampleFormat sample_fmt;  ///< sample format
1273 de6d9b64 Fabrice Bellard
1274 f5bccd85 Diego Biurrun
    /* The following data should not be initialized. */
1275 718b27a7 Michael Niedermayer
    /**
1276 f5bccd85 Diego Biurrun
     * Samples per packet, initialized when calling 'init'.
1277 718b27a7 Michael Niedermayer
     */
1278
    int frame_size;
1279 115329f1 Diego Biurrun
    int frame_number;   ///< audio or video frame number
1280 c0601d70 Baptiste Coudurier
#if LIBAVCODEC_VERSION_MAJOR < 53
1281 f5bccd85 Diego Biurrun
    int real_pict_num;  ///< Returns the real picture number of previous encoded frame.
1282 c0601d70 Baptiste Coudurier
#endif
1283 115329f1 Diego Biurrun
1284 b71901e6 Michael Niedermayer
    /**
1285 f5bccd85 Diego Biurrun
     * Number of frames the decoded output will be delayed relative to
1286 64863965 Michael Niedermayer
     * the encoded input.
1287 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec.
1288 64863965 Michael Niedermayer
     * - decoding: unused
1289 b71901e6 Michael Niedermayer
     */
1290
    int delay;
1291 115329f1 Diego Biurrun
1292 64863965 Michael Niedermayer
    /* - encoding parameters */
1293
    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
1294 115329f1 Diego Biurrun
    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
1295
1296 b71901e6 Michael Niedermayer
    /**
1297 f5bccd85 Diego Biurrun
     * minimum quantizer
1298
     * - encoding: Set by user.
1299 64863965 Michael Niedermayer
     * - decoding: unused
1300 b71901e6 Michael Niedermayer
     */
1301
    int qmin;
1302
1303
    /**
1304 f5bccd85 Diego Biurrun
     * maximum quantizer
1305
     * - encoding: Set by user.
1306 64863965 Michael Niedermayer
     * - decoding: unused
1307 b71901e6 Michael Niedermayer
     */
1308
    int qmax;
1309
1310
    /**
1311 f5bccd85 Diego Biurrun
     * maximum quantizer difference between frames
1312
     * - encoding: Set by user.
1313 64863965 Michael Niedermayer
     * - decoding: unused
1314 b71901e6 Michael Niedermayer
     */
1315
    int max_qdiff;
1316
1317
    /**
1318 f5bccd85 Diego Biurrun
     * maximum number of B-frames between non-B-frames
1319
     * Note: The output will be delayed by max_b_frames+1 relative to the input.
1320
     * - encoding: Set by user.
1321 64863965 Michael Niedermayer
     * - decoding: unused
1322 b71901e6 Michael Niedermayer
     */
1323
    int max_b_frames;
1324
1325
    /**
1326 f5bccd85 Diego Biurrun
     * qscale factor between IP and B-frames
1327 662e5411 tripp
     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
1328
     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
1329 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
1330 64863965 Michael Niedermayer
     * - decoding: unused
1331 b71901e6 Michael Niedermayer
     */
1332
    float b_quant_factor;
1333 115329f1 Diego Biurrun
1334 b71901e6 Michael Niedermayer
    /** obsolete FIXME remove */
1335
    int rc_strategy;
1336 64b7c5b6 Michael Niedermayer
#define FF_RC_STRATEGY_XVID 1
1337
1338 8b4c7dbc Michael Niedermayer
    int b_frame_strategy;
1339 9dbcbd92 Michael Niedermayer
1340 8ed2ae09 Anton Khirnov
#if FF_API_HURRY_UP
1341 b71901e6 Michael Niedermayer
    /**
1342 85947156 Vitor Sessak
     * hurry up amount
1343
     * - encoding: unused
1344
     * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
1345 f9ec0aa1 Panagiotis Issaris
     * @deprecated Deprecated in favor of skip_idct and skip_frame.
1346 b71901e6 Michael Niedermayer
     */
1347 8ed2ae09 Anton Khirnov
    attribute_deprecated int hurry_up;
1348
#endif
1349 115329f1 Diego Biurrun
1350 de6d9b64 Fabrice Bellard
    struct AVCodec *codec;
1351 115329f1 Diego Biurrun
1352 de6d9b64 Fabrice Bellard
    void *priv_data;
1353
1354 bb628dae Diego Biurrun
    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
1355 f5bccd85 Diego Biurrun
                            /* do its best to deliver a chunk with size     */
1356 644d98a4 Juanjo
                            /* below rtp_payload_size, the chunk will start */
1357 f5bccd85 Diego Biurrun
                            /* with a start code on some codecs like H.263. */
1358 644d98a4 Juanjo
                            /* This doesn't take account of any particular  */
1359 f5bccd85 Diego Biurrun
                            /* headers inside the transmitted RTP payload.  */
1360 81401c1f Juanjo
1361 115329f1 Diego Biurrun
1362 f5bccd85 Diego Biurrun
    /* The RTP callback: This function is called    */
1363
    /* every time the encoder has a packet to send. */
1364
    /* It depends on the encoder if the data starts */
1365
    /* with a Start Code (it should). H.263 does.   */
1366
    /* mb_nb contains the number of macroblocks     */
1367
    /* encoded in the RTP payload.                  */
1368 115329f1 Diego Biurrun
    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
1369 81401c1f Juanjo
1370 098eefe1 Michael Niedermayer
    /* statistics, used for 2-pass encoding */
1371
    int mv_bits;
1372
    int header_bits;
1373
    int i_tex_bits;
1374
    int p_tex_bits;
1375
    int i_count;
1376
    int p_count;
1377
    int skip_count;
1378 b71901e6 Michael Niedermayer
    int misc_bits;
1379 115329f1 Diego Biurrun
1380 b71901e6 Michael Niedermayer
    /**
1381 f5bccd85 Diego Biurrun
     * number of bits used for the previously encoded frame
1382
     * - encoding: Set by libavcodec.
1383 7004ffb3 Michael Niedermayer
     * - decoding: unused
1384 b71901e6 Michael Niedermayer
     */
1385 098eefe1 Michael Niedermayer
    int frame_bits;
1386 7004ffb3 Michael Niedermayer
1387 b71901e6 Michael Niedermayer
    /**
1388 f5bccd85 Diego Biurrun
     * Private data of the user, can be used to carry app specific stuff.
1389
     * - encoding: Set by user.
1390
     * - decoding: Set by user.
1391 b71901e6 Michael Niedermayer
     */
1392
    void *opaque;
1393
1394 de6d9b64 Fabrice Bellard
    char codec_name[32];
1395 72415b2a Stefano Sabatini
    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1396 4a663d80 Philip Gladstone
    enum CodecID codec_id; /* see CODEC_ID_xxx */
1397 115329f1 Diego Biurrun
1398 7004ffb3 Michael Niedermayer
    /**
1399
     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
1400 f5bccd85 Diego Biurrun
     * This is used to work around some encoder bugs.
1401
     * A demuxer should set this to what is stored in the field used to identify the codec.
1402
     * If there are multiple such fields in a container then the demuxer should choose the one
1403
     * which maximizes the information about the used codec.
1404
     * If the codec tag field in a container is larger then 32 bits then the demuxer should
1405
     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
1406 47bbf8a7 Michael Niedermayer
     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
1407 f5bccd85 Diego Biurrun
     * first.
1408
     * - encoding: Set by user, if not then the default based on codec_id will be used.
1409
     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
1410 7004ffb3 Michael Niedermayer
     */
1411
    unsigned int codec_tag;
1412 115329f1 Diego Biurrun
1413 b71901e6 Michael Niedermayer
    /**
1414 f5bccd85 Diego Biurrun
     * Work around bugs in encoders which sometimes cannot be detected automatically.
1415
     * - encoding: Set by user
1416
     * - decoding: Set by user
1417 b71901e6 Michael Niedermayer
     */
1418
    int workaround_bugs;
1419 64863965 Michael Niedermayer
#define FF_BUG_AUTODETECT       1  ///< autodetection
1420 4d2858de Michael Niedermayer
#define FF_BUG_OLD_MSMPEG4      2
1421
#define FF_BUG_XVID_ILACE       4
1422
#define FF_BUG_UMP4             8
1423
#define FF_BUG_NO_PADDING       16
1424 3116cb14 Michael Niedermayer
#define FF_BUG_AMV              32
1425 f5bccd85 Diego Biurrun
#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
1426 03e93d35 Michael Niedermayer
#define FF_BUG_QPEL_CHROMA      64
1427 db794953 Michael Niedermayer
#define FF_BUG_STD_QPEL         128
1428 36df8805 Michael Niedermayer
#define FF_BUG_QPEL_CHROMA2     256
1429 c40c3482 Michael Niedermayer
#define FF_BUG_DIRECT_BLOCKSIZE 512
1430 1c6dcb0f Michael Niedermayer
#define FF_BUG_EDGE             1024
1431 b44bdf7e Michael Niedermayer
#define FF_BUG_HPEL_CHROMA      2048
1432 4ccde216 Michael Niedermayer
#define FF_BUG_DC_CLIP          4096
1433 f5bccd85 Diego Biurrun
#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
1434 3566042a Michael Niedermayer
#define FF_BUG_TRUNCATED       16384
1435 f5bccd85 Diego Biurrun
//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
1436 115329f1 Diego Biurrun
1437 b71901e6 Michael Niedermayer
    /**
1438 f5bccd85 Diego Biurrun
     * luma single coefficient elimination threshold
1439
     * - encoding: Set by user.
1440 64863965 Michael Niedermayer
     * - decoding: unused
1441 b71901e6 Michael Niedermayer
     */
1442 1f6b6e50 Michael Niedermayer
    int luma_elim_threshold;
1443 115329f1 Diego Biurrun
1444 b71901e6 Michael Niedermayer
    /**
1445 f5bccd85 Diego Biurrun
     * chroma single coeff elimination threshold
1446
     * - encoding: Set by user.
1447 64863965 Michael Niedermayer
     * - decoding: unused
1448 b71901e6 Michael Niedermayer
     */
1449 1f6b6e50 Michael Niedermayer
    int chroma_elim_threshold;
1450 115329f1 Diego Biurrun
1451 b71901e6 Michael Niedermayer
    /**
1452 f5bccd85 Diego Biurrun
     * strictly follow the standard (MPEG4, ...).
1453
     * - encoding: Set by user.
1454 5771b2c3 Michael Niedermayer
     * - decoding: Set by user.
1455
     * Setting this to STRICT or higher means the encoder and decoder will
1456 2d525ef4 Rodney Baker
     * generally do stupid things, whereas setting it to unofficial or lower
1457 538c0e13 Rodney Baker
     * will mean the encoder might produce output that is not supported by all
1458
     * spec-compliant decoders. Decoders don't differentiate between normal,
1459 2d525ef4 Rodney Baker
     * unofficial and experimental (that is, they always try to decode things
1460 538c0e13 Rodney Baker
     * when they can) unless they are explicitly asked to behave stupidly
1461 5771b2c3 Michael Niedermayer
     * (=strictly conform to the specs)
1462 b71901e6 Michael Niedermayer
     */
1463
    int strict_std_compliance;
1464 538c0e13 Rodney Baker
#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
1465 f5bccd85 Diego Biurrun
#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
1466 9cd81798 Michael Niedermayer
#define FF_COMPLIANCE_NORMAL        0
1467 59b4e5ba Aurelien Jacobs
#if FF_API_INOFFICIAL
1468 2d525ef4 Rodney Baker
#define FF_COMPLIANCE_INOFFICIAL   -1 ///< Allow inofficial extensions (deprecated - use FF_COMPLIANCE_UNOFFICIAL instead).
1469
#endif
1470
#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
1471 f5bccd85 Diego Biurrun
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
1472 9cd81798 Michael Niedermayer
1473 b71901e6 Michael Niedermayer
    /**
1474 f5bccd85 Diego Biurrun
     * qscale offset between IP and B-frames
1475
     * - encoding: Set by user.
1476 64863965 Michael Niedermayer
     * - decoding: unused
1477 b71901e6 Michael Niedermayer
     */
1478
    float b_quant_offset;
1479 115329f1 Diego Biurrun
1480 b71901e6 Michael Niedermayer
    /**
1481 047599a4 Michael Niedermayer
     * Error recognization; higher values will detect more errors but may
1482 f5bccd85 Diego Biurrun
     * misdetect some more or less valid parts as errors.
1483 64863965 Michael Niedermayer
     * - encoding: unused
1484 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
1485 b71901e6 Michael Niedermayer
     */
1486 047599a4 Michael Niedermayer
    int error_recognition;
1487 1471c6c2 Diego Biurrun
#define FF_ER_CAREFUL         1
1488 ce3bcaed Michael Niedermayer
#define FF_ER_COMPLIANT       2
1489
#define FF_ER_AGGRESSIVE      3
1490
#define FF_ER_VERY_AGGRESSIVE 4
1491 115329f1 Diego Biurrun
1492 6b72ac63 Michael Niedermayer
    /**
1493 f5bccd85 Diego Biurrun
     * Called at the beginning of each frame to get a buffer for it.
1494
     * If pic.reference is set then the frame will be read later by libavcodec.
1495 eb285cfe Reimar Döffinger
     * avcodec_align_dimensions2() should be used to find the required width and
1496 f5bccd85 Diego Biurrun
     * height, as they normally need to be rounded up to the next multiple of 16.
1497 f1b99cc6 Michael Niedermayer
     * if CODEC_CAP_DR1 is not set then get_buffer() must call
1498
     * avcodec_default_get_buffer() instead of providing buffers allocated by
1499
     * some other means.
1500 37b00b47 Alexander Strange
     * If frame multithreading is used and thread_safe_callbacks is set,
1501
     * it may be called from a different thread, but not from more than one at once.
1502
     * Does not need to be reentrant.
1503 64863965 Michael Niedermayer
     * - encoding: unused
1504 53128bc3 Peter Ross
     * - decoding: Set by libavcodec, user can override.
1505 b71901e6 Michael Niedermayer
     */
1506 492cd3a9 Michael Niedermayer
    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
1507 115329f1 Diego Biurrun
1508 b71901e6 Michael Niedermayer
    /**
1509 69b192ac Ramiro Polla
     * Called to release buffers which were allocated with get_buffer.
1510 f5bccd85 Diego Biurrun
     * A released buffer can be reused in get_buffer().
1511
     * pic.data[*] must be set to NULL.
1512 37b00b47 Alexander Strange
     * May be called from a different thread if frame multithreading is used,
1513
     * but not by more than one thread at once, so does not need to be reentrant.
1514 64863965 Michael Niedermayer
     * - encoding: unused
1515 53128bc3 Peter Ross
     * - decoding: Set by libavcodec, user can override.
1516 b71901e6 Michael Niedermayer
     */
1517 492cd3a9 Michael Niedermayer
    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
1518 0fd90455 Michael Niedermayer
1519 b71901e6 Michael Niedermayer
    /**
1520 eb8a25c8 Michael Niedermayer
     * Size of the frame reordering buffer in the decoder.
1521 2d7b0560 Diego Biurrun
     * For MPEG-2 it is 1 IPB or 0 low delay IP.
1522 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec.
1523
     * - decoding: Set by libavcodec.
1524 b71901e6 Michael Niedermayer
     */
1525
    int has_b_frames;
1526 718b27a7 Michael Niedermayer
1527
    /**
1528
     * number of bytes per packet if constant and known or 0
1529 f5bccd85 Diego Biurrun
     * Used by some WAV based audio codecs.
1530 718b27a7 Michael Niedermayer
     */
1531
    int block_align;
1532 115329f1 Diego Biurrun
1533 f5bccd85 Diego Biurrun
    int parse_only; /* - decoding only: If true, only parsing is done
1534 917e06c8 Fabrice Bellard
                       (function avcodec_parse_frame()). The frame
1535
                       data is returned. Only MPEG codecs support this now. */
1536 115329f1 Diego Biurrun
1537 b71901e6 Michael Niedermayer
    /**
1538 f5bccd85 Diego Biurrun
     * 0-> h263 quant 1-> mpeg quant
1539
     * - encoding: Set by user.
1540 64863965 Michael Niedermayer
     * - decoding: unused
1541 b71901e6 Michael Niedermayer
     */
1542
    int mpeg_quant;
1543 115329f1 Diego Biurrun
1544 b71901e6 Michael Niedermayer
    /**
1545 f5bccd85 Diego Biurrun
     * pass1 encoding statistics output buffer
1546
     * - encoding: Set by libavcodec.
1547 64863965 Michael Niedermayer
     * - decoding: unused
1548 b71901e6 Michael Niedermayer
     */
1549 64863965 Michael Niedermayer
    char *stats_out;
1550 115329f1 Diego Biurrun
1551 b71901e6 Michael Niedermayer
    /**
1552 f5bccd85 Diego Biurrun
     * pass2 encoding statistics input buffer
1553
     * Concatenated stuff from stats_out of pass1 should be placed here.
1554
     * - encoding: Allocated/set/freed by user.
1555 64863965 Michael Niedermayer
     * - decoding: unused
1556 b71901e6 Michael Niedermayer
     */
1557
    char *stats_in;
1558 115329f1 Diego Biurrun
1559 b71901e6 Michael Niedermayer
    /**
1560 f5bccd85 Diego Biurrun
     * ratecontrol qmin qmax limiting method
1561
     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
1562
     * - encoding: Set by user.
1563 64863965 Michael Niedermayer
     * - decoding: unused
1564 b71901e6 Michael Niedermayer
     */
1565 ce980a95 Michael Niedermayer
    float rc_qsquish;
1566 b71901e6 Michael Niedermayer
1567 ce980a95 Michael Niedermayer
    float rc_qmod_amp;
1568
    int rc_qmod_freq;
1569 115329f1 Diego Biurrun
1570 b71901e6 Michael Niedermayer
    /**
1571 f5bccd85 Diego Biurrun
     * ratecontrol override, see RcOverride
1572
     * - encoding: Allocated/set/freed by user.
1573 64863965 Michael Niedermayer
     * - decoding: unused
1574 b71901e6 Michael Niedermayer
     */
1575 ce980a95 Michael Niedermayer
    RcOverride *rc_override;
1576
    int rc_override_count;
1577 115329f1 Diego Biurrun
1578 b71901e6 Michael Niedermayer
    /**
1579 f5bccd85 Diego Biurrun
     * rate control equation
1580
     * - encoding: Set by user
1581 64863965 Michael Niedermayer
     * - decoding: unused
1582 b71901e6 Michael Niedermayer
     */
1583 6881b8e5 Luca Abeni
    const char *rc_eq;
1584 115329f1 Diego Biurrun
1585 b71901e6 Michael Niedermayer
    /**
1586 f5bccd85 Diego Biurrun
     * maximum bitrate
1587
     * - encoding: Set by user.
1588 64863965 Michael Niedermayer
     * - decoding: unused
1589 b71901e6 Michael Niedermayer
     */
1590 ce980a95 Michael Niedermayer
    int rc_max_rate;
1591 115329f1 Diego Biurrun
1592 b71901e6 Michael Niedermayer
    /**
1593 f5bccd85 Diego Biurrun
     * minimum bitrate
1594
     * - encoding: Set by user.
1595 64863965 Michael Niedermayer
     * - decoding: unused
1596 b71901e6 Michael Niedermayer
     */
1597 ce980a95 Michael Niedermayer
    int rc_min_rate;
1598 115329f1 Diego Biurrun
1599 b71901e6 Michael Niedermayer
    /**
1600 f5bccd85 Diego Biurrun
     * decoder bitstream buffer size
1601
     * - encoding: Set by user.
1602 64863965 Michael Niedermayer
     * - decoding: unused
1603 b71901e6 Michael Niedermayer
     */
1604 ce980a95 Michael Niedermayer
    int rc_buffer_size;
1605
    float rc_buffer_aggressivity;
1606 b71901e6 Michael Niedermayer
1607
    /**
1608 f5bccd85 Diego Biurrun
     * qscale factor between P and I-frames
1609
     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
1610
     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
1611
     * - encoding: Set by user.
1612 64863965 Michael Niedermayer
     * - decoding: unused
1613 b71901e6 Michael Niedermayer
     */
1614
    float i_quant_factor;
1615 115329f1 Diego Biurrun
1616 b71901e6 Michael Niedermayer
    /**
1617 f5bccd85 Diego Biurrun
     * qscale offset between P and I-frames
1618
     * - encoding: Set by user.
1619 64863965 Michael Niedermayer
     * - decoding: unused
1620 b71901e6 Michael Niedermayer
     */
1621
    float i_quant_offset;
1622 115329f1 Diego Biurrun
1623 b71901e6 Michael Niedermayer
    /**
1624 f5bccd85 Diego Biurrun
     * initial complexity for pass1 ratecontrol
1625
     * - encoding: Set by user.
1626 64863965 Michael Niedermayer
     * - decoding: unused
1627 b71901e6 Michael Niedermayer
     */
1628 ce980a95 Michael Niedermayer
    float rc_initial_cplx;
1629 917e06c8 Fabrice Bellard
1630 b71901e6 Michael Niedermayer
    /**
1631 f5bccd85 Diego Biurrun
     * DCT algorithm, see FF_DCT_* below
1632
     * - encoding: Set by user.
1633 64863965 Michael Niedermayer
     * - decoding: unused
1634 b71901e6 Michael Niedermayer
     */
1635 28db7fce Michael Niedermayer
    int dct_algo;
1636 c7e07931 Martin Olschewski
#define FF_DCT_AUTO    0
1637 28db7fce Michael Niedermayer
#define FF_DCT_FASTINT 1
1638 c7e07931 Martin Olschewski
#define FF_DCT_INT     2
1639
#define FF_DCT_MMX     3
1640
#define FF_DCT_MLIB    4
1641 05c4072b Michael Niedermayer
#define FF_DCT_ALTIVEC 5
1642 65e4c8c9 Michael Niedermayer
#define FF_DCT_FAAN    6
1643 115329f1 Diego Biurrun
1644 c5d309f2 Michael Niedermayer
    /**
1645 f5bccd85 Diego Biurrun
     * luminance masking (0-> disabled)
1646
     * - encoding: Set by user.
1647 64863965 Michael Niedermayer
     * - decoding: unused
1648 c5d309f2 Michael Niedermayer
     */
1649
    float lumi_masking;
1650 115329f1 Diego Biurrun
1651 c5d309f2 Michael Niedermayer
    /**
1652 f5bccd85 Diego Biurrun
     * temporary complexity masking (0-> disabled)
1653
     * - encoding: Set by user.
1654 64863965 Michael Niedermayer
     * - decoding: unused
1655 c5d309f2 Michael Niedermayer
     */
1656
    float temporal_cplx_masking;
1657 115329f1 Diego Biurrun
1658 c5d309f2 Michael Niedermayer
    /**
1659 f5bccd85 Diego Biurrun
     * spatial complexity masking (0-> disabled)
1660
     * - encoding: Set by user.
1661 64863965 Michael Niedermayer
     * - decoding: unused
1662 c5d309f2 Michael Niedermayer
     */
1663
    float spatial_cplx_masking;
1664 115329f1 Diego Biurrun
1665 c5d309f2 Michael Niedermayer
    /**
1666 f5bccd85 Diego Biurrun
     * p block masking (0-> disabled)
1667
     * - encoding: Set by user.
1668 64863965 Michael Niedermayer
     * - decoding: unused
1669 c5d309f2 Michael Niedermayer
     */
1670
    float p_masking;
1671 15415af4 Michael Niedermayer
1672 5e746b99 Michael Niedermayer
    /**
1673 f5bccd85 Diego Biurrun
     * darkness masking (0-> disabled)
1674
     * - encoding: Set by user.
1675 64863965 Michael Niedermayer
     * - decoding: unused
1676 5e746b99 Michael Niedermayer
     */
1677
    float dark_masking;
1678 115329f1 Diego Biurrun
1679 0c2dd16e Michael Niedermayer
    /**
1680 f5bccd85 Diego Biurrun
     * IDCT algorithm, see FF_IDCT_* below.
1681
     * - encoding: Set by user.
1682
     * - decoding: Set by user.
1683 2ad1516a Michael Niedermayer
     */
1684
    int idct_algo;
1685 273b0cd3 Diego Biurrun
#define FF_IDCT_AUTO          0
1686
#define FF_IDCT_INT           1
1687
#define FF_IDCT_SIMPLE        2
1688
#define FF_IDCT_SIMPLEMMX     3
1689
#define FF_IDCT_LIBMPEG2MMX   4
1690
#define FF_IDCT_PS2           5
1691
#define FF_IDCT_MLIB          6
1692
#define FF_IDCT_ARM           7
1693
#define FF_IDCT_ALTIVEC       8
1694
#define FF_IDCT_SH4           9
1695
#define FF_IDCT_SIMPLEARM     10
1696
#define FF_IDCT_H264          11
1697
#define FF_IDCT_VP3           12
1698
#define FF_IDCT_IPP           13
1699
#define FF_IDCT_XVIDMMX       14
1700
#define FF_IDCT_CAVS          15
1701 a0403006 Måns Rullgård
#define FF_IDCT_SIMPLEARMV5TE 16
1702 273b0cd3 Diego Biurrun
#define FF_IDCT_SIMPLEARMV6   17
1703 d9420d4d Denes Balatoni
#define FF_IDCT_SIMPLEVIS     18
1704 9abc7e0f Michael Niedermayer
#define FF_IDCT_WMV2          19
1705 6f08c541 Michael Niedermayer
#define FF_IDCT_FAAN          20
1706 42b30357 Peter Ross
#define FF_IDCT_EA            21
1707 7eec4328 Måns Rullgård
#define FF_IDCT_SIMPLENEON    22
1708 74c47463 Måns Rullgård
#define FF_IDCT_SIMPLEALPHA   23
1709 342c7dfd Kostya Shishkov
#define FF_IDCT_BINK          24
1710 2ad1516a Michael Niedermayer
1711 144f0625 Michael Niedermayer
    /**
1712 f5bccd85 Diego Biurrun
     * slice count
1713
     * - encoding: Set by libavcodec.
1714
     * - decoding: Set by user (or 0).
1715 144f0625 Michael Niedermayer
     */
1716
    int slice_count;
1717
    /**
1718 f5bccd85 Diego Biurrun
     * slice offsets in the frame in bytes
1719
     * - encoding: Set/allocated by libavcodec.
1720
     * - decoding: Set/allocated by user (or NULL).
1721 144f0625 Michael Niedermayer
     */
1722
    int *slice_offset;
1723
1724 4d2858de Michael Niedermayer
    /**
1725 f5bccd85 Diego Biurrun
     * error concealment flags
1726 64863965 Michael Niedermayer
     * - encoding: unused
1727 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
1728 4d2858de Michael Niedermayer
     */
1729
    int error_concealment;
1730
#define FF_EC_GUESS_MVS   1
1731
#define FF_EC_DEBLOCK     2
1732
1733 6b72ac63 Michael Niedermayer
    /**
1734 bec89a84 Zdenek Kabelac
     * dsp_mask could be add used to disable unwanted CPU features
1735 8350df97 Zdenek Kabelac
     * CPU features (i.e. MMX, SSE. ...)
1736 bec89a84 Zdenek Kabelac
     *
1737 f5bccd85 Diego Biurrun
     * With the FORCE flag you may instead enable given CPU features.
1738
     * (Dangerous: Usable in case of misdetection, improper usage however will
1739
     * result into program crash.)
1740 bec89a84 Zdenek Kabelac
     */
1741
    unsigned dsp_mask;
1742 7160bb71 Stefano Sabatini
1743
#if FF_API_MM_FLAGS
1744
#define FF_MM_FORCE      AV_CPU_FLAG_FORCE
1745
#define FF_MM_MMX        AV_CPU_FLAG_MMX
1746
#define FF_MM_3DNOW      AV_CPU_FLAG_3DNOW
1747
#define FF_MM_MMXEXT     AV_CPU_FLAG_MMX2
1748
#define FF_MM_MMX2       AV_CPU_FLAG_MMX2
1749
#define FF_MM_SSE        AV_CPU_FLAG_SSE
1750
#define FF_MM_SSE2       AV_CPU_FLAG_SSE2
1751
#define FF_MM_SSE2SLOW   AV_CPU_FLAG_SSE2SLOW
1752
#define FF_MM_3DNOWEXT   AV_CPU_FLAG_3DNOWEXT
1753
#define FF_MM_SSE3       AV_CPU_FLAG_SSE3
1754
#define FF_MM_SSE3SLOW   AV_CPU_FLAG_SSE3SLOW
1755
#define FF_MM_SSSE3      AV_CPU_FLAG_SSSE3
1756
#define FF_MM_SSE4       AV_CPU_FLAG_SSE4
1757
#define FF_MM_SSE42      AV_CPU_FLAG_SSE42
1758
#define FF_MM_IWMMXT     AV_CPU_FLAG_IWMMXT
1759
#define FF_MM_ALTIVEC    AV_CPU_FLAG_ALTIVEC
1760 6b434361 Stefano Sabatini
#endif
1761 11f18faf Michael Niedermayer
1762
    /**
1763 64863965 Michael Niedermayer
     * bits per sample/pixel from the demuxer (needed for huffyuv).
1764 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec.
1765
     * - decoding: Set by user.
1766 11f18faf Michael Niedermayer
     */
1767 46a73068 Peter Ross
     int bits_per_coded_sample;
1768 115329f1 Diego Biurrun
1769 11f18faf Michael Niedermayer
    /**
1770 f5bccd85 Diego Biurrun
     * prediction method (needed for huffyuv)
1771
     * - encoding: Set by user.
1772 64863965 Michael Niedermayer
     * - decoding: unused
1773 11f18faf Michael Niedermayer
     */
1774
     int prediction_method;
1775
#define FF_PRED_LEFT   0
1776
#define FF_PRED_PLANE  1
1777
#define FF_PRED_MEDIAN 2
1778 115329f1 Diego Biurrun
1779 5d3cea3a Michael Niedermayer
    /**
1780 f5bccd85 Diego Biurrun
     * sample aspect ratio (0 if unknown)
1781 8e5af7a6 Michael Niedermayer
     * That is the width of a pixel divided by the height of the pixel.
1782 f5bccd85 Diego Biurrun
     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
1783
     * - encoding: Set by user.
1784
     * - decoding: Set by libavcodec.
1785 5d3cea3a Michael Niedermayer
     */
1786 5ff85f1d Michael Niedermayer
    AVRational sample_aspect_ratio;
1787 1e491e29 Michael Niedermayer
1788
    /**
1789 f5bccd85 Diego Biurrun
     * the picture in the bitstream
1790
     * - encoding: Set by libavcodec.
1791
     * - decoding: Set by libavcodec.
1792 1e491e29 Michael Niedermayer
     */
1793 492cd3a9 Michael Niedermayer
    AVFrame *coded_frame;
1794 c8c437bc Michael Niedermayer
1795
    /**
1796 f5bccd85 Diego Biurrun
     * debug
1797
     * - encoding: Set by user.
1798
     * - decoding: Set by user.
1799 c8c437bc Michael Niedermayer
     */
1800
    int debug;
1801 273b0cd3 Diego Biurrun
#define FF_DEBUG_PICT_INFO   1
1802
#define FF_DEBUG_RC          2
1803
#define FF_DEBUG_BITSTREAM   4
1804
#define FF_DEBUG_MB_TYPE     8
1805
#define FF_DEBUG_QP          16
1806
#define FF_DEBUG_MV          32
1807
#define FF_DEBUG_DCT_COEFF   0x00000040
1808
#define FF_DEBUG_SKIP        0x00000080
1809
#define FF_DEBUG_STARTCODE   0x00000100
1810
#define FF_DEBUG_PTS         0x00000200
1811
#define FF_DEBUG_ER          0x00000400
1812
#define FF_DEBUG_MMCO        0x00000800
1813
#define FF_DEBUG_BUGS        0x00001000
1814
#define FF_DEBUG_VIS_QP      0x00002000
1815 864119b6 Michael Niedermayer
#define FF_DEBUG_VIS_MB_TYPE 0x00004000
1816 385c820b Alexander Strange
#define FF_DEBUG_BUFFERS     0x00008000
1817 37b00b47 Alexander Strange
#define FF_DEBUG_THREADS     0x00010000
1818 115329f1 Diego Biurrun
1819 140cb663 Michael Niedermayer
    /**
1820 f5bccd85 Diego Biurrun
     * debug
1821
     * - encoding: Set by user.
1822
     * - decoding: Set by user.
1823 0c9bbaec Wolfgang Hesseler
     */
1824
    int debug_mv;
1825
#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
1826
#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
1827
#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
1828
1829
    /**
1830 f5bccd85 Diego Biurrun
     * error
1831
     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
1832 64863965 Michael Niedermayer
     * - decoding: unused
1833 140cb663 Michael Niedermayer
     */
1834
    uint64_t error[4];
1835 115329f1 Diego Biurrun
1836 4a49d2d5 Anton Khirnov
#if FF_API_MB_Q
1837 17a70fde Michael Niedermayer
    /**
1838 f5bccd85 Diego Biurrun
     * minimum MB quantizer
1839 6e0d8c06 Michael Niedermayer
     * - encoding: unused
1840 64863965 Michael Niedermayer
     * - decoding: unused
1841 17a70fde Michael Niedermayer
     */
1842 4a49d2d5 Anton Khirnov
    attribute_deprecated int mb_qmin;
1843 17a70fde Michael Niedermayer
1844
    /**
1845 f5bccd85 Diego Biurrun
     * maximum MB quantizer
1846 6e0d8c06 Michael Niedermayer
     * - encoding: unused
1847 64863965 Michael Niedermayer
     * - decoding: unused
1848 17a70fde Michael Niedermayer
     */
1849 4a49d2d5 Anton Khirnov
    attribute_deprecated int mb_qmax;
1850
#endif
1851 115329f1 Diego Biurrun
1852 1457ab52 Michael Niedermayer
    /**
1853 f5bccd85 Diego Biurrun
     * motion estimation comparison function
1854
     * - encoding: Set by user.
1855 64863965 Michael Niedermayer
     * - decoding: unused
1856 1457ab52 Michael Niedermayer
     */
1857
    int me_cmp;
1858
    /**
1859 f5bccd85 Diego Biurrun
     * subpixel motion estimation comparison function
1860
     * - encoding: Set by user.
1861 64863965 Michael Niedermayer
     * - decoding: unused
1862 1457ab52 Michael Niedermayer
     */
1863
    int me_sub_cmp;
1864
    /**
1865 f5bccd85 Diego Biurrun
     * macroblock comparison function (not supported yet)
1866
     * - encoding: Set by user.
1867 64863965 Michael Niedermayer
     * - decoding: unused
1868 1457ab52 Michael Niedermayer
     */
1869
    int mb_cmp;
1870 622348f9 Michael Niedermayer
    /**
1871 f5bccd85 Diego Biurrun
     * interlaced DCT comparison function
1872
     * - encoding: Set by user.
1873 622348f9 Michael Niedermayer
     * - decoding: unused
1874
     */
1875
    int ildct_cmp;
1876 273b0cd3 Diego Biurrun
#define FF_CMP_SAD    0
1877
#define FF_CMP_SSE    1
1878
#define FF_CMP_SATD   2
1879
#define FF_CMP_DCT    3
1880
#define FF_CMP_PSNR   4
1881
#define FF_CMP_BIT    5
1882
#define FF_CMP_RD     6
1883
#define FF_CMP_ZERO   7
1884
#define FF_CMP_VSAD   8
1885
#define FF_CMP_VSSE   9
1886
#define FF_CMP_NSSE   10
1887
#define FF_CMP_W53    11
1888
#define FF_CMP_W97    12
1889 0fd6aea1 Michael Niedermayer
#define FF_CMP_DCTMAX 13
1890 27c61ac5 Michael Niedermayer
#define FF_CMP_DCT264 14
1891 1457ab52 Michael Niedermayer
#define FF_CMP_CHROMA 256
1892 115329f1 Diego Biurrun
1893 1457ab52 Michael Niedermayer
    /**
1894 f5bccd85 Diego Biurrun
     * ME diamond size & shape
1895
     * - encoding: Set by user.
1896 64863965 Michael Niedermayer
     * - decoding: unused
1897 1457ab52 Michael Niedermayer
     */
1898
    int dia_size;
1899 b07a5980 Michael Niedermayer
1900
    /**
1901 f5bccd85 Diego Biurrun
     * amount of previous MV predictors (2a+1 x 2a+1 square)
1902
     * - encoding: Set by user.
1903 64863965 Michael Niedermayer
     * - decoding: unused
1904 b07a5980 Michael Niedermayer
     */
1905
    int last_predictor_count;
1906 70ac76c0 Michael Niedermayer
1907 f5fb6b34 Michael Niedermayer
    /**
1908 f5bccd85 Diego Biurrun
     * prepass for motion estimation
1909
     * - encoding: Set by user.
1910 64863965 Michael Niedermayer
     * - decoding: unused
1911 f5fb6b34 Michael Niedermayer
     */
1912
    int pre_me;
1913 b07a5980 Michael Niedermayer
1914 70ac76c0 Michael Niedermayer
    /**
1915 f5bccd85 Diego Biurrun
     * motion estimation prepass comparison function
1916
     * - encoding: Set by user.
1917 64863965 Michael Niedermayer
     * - decoding: unused
1918 70ac76c0 Michael Niedermayer
     */
1919
    int me_pre_cmp;
1920 826f429a Michael Niedermayer
1921 70ac76c0 Michael Niedermayer
    /**
1922 f5bccd85 Diego Biurrun
     * ME prepass diamond size & shape
1923
     * - encoding: Set by user.
1924 64863965 Michael Niedermayer
     * - decoding: unused
1925 70ac76c0 Michael Niedermayer
     */
1926
    int pre_dia_size;
1927
1928 826f429a Michael Niedermayer
    /**
1929 f5bccd85 Diego Biurrun
     * subpel ME quality
1930
     * - encoding: Set by user.
1931 64863965 Michael Niedermayer
     * - decoding: unused
1932 826f429a Michael Niedermayer
     */
1933
    int me_subpel_quality;
1934
1935 a33c7159 Michael Niedermayer
    /**
1936 f5bccd85 Diego Biurrun
     * callback to negotiate the pixelFormat
1937 a33c7159 Michael Niedermayer
     * @param fmt is the list of formats which are supported by the codec,
1938 f5bccd85 Diego Biurrun
     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
1939
     * The first is always the native one.
1940
     * @return the chosen format
1941 64863965 Michael Niedermayer
     * - encoding: unused
1942 f5bccd85 Diego Biurrun
     * - decoding: Set by user, if not set the native format will be chosen.
1943 a33c7159 Michael Niedermayer
     */
1944 494c56d3 Ivan Kalvachev
    enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
1945 e2f9490e Fabrice Bellard
1946
    /**
1947 f5bccd85 Diego Biurrun
     * DTG active format information (additional aspect ratio
1948
     * information only used in DVB MPEG-2 transport streams)
1949
     * 0 if not set.
1950 115329f1 Diego Biurrun
     *
1951 f5bccd85 Diego Biurrun
     * - encoding: unused
1952
     * - decoding: Set by decoder.
1953 e2f9490e Fabrice Bellard
     */
1954
    int dtg_active_format;
1955
#define FF_DTG_AFD_SAME         8
1956
#define FF_DTG_AFD_4_3          9
1957
#define FF_DTG_AFD_16_9         10
1958
#define FF_DTG_AFD_14_9         11
1959
#define FF_DTG_AFD_4_3_SP_14_9  13
1960
#define FF_DTG_AFD_16_9_SP_14_9 14
1961
#define FF_DTG_AFD_SP_4_3       15
1962
1963 ebbcdc9a Michael Niedermayer
    /**
1964 f5bccd85 Diego Biurrun
     * maximum motion estimation search range in subpel units
1965
     * If 0 then no limit.
1966 115329f1 Diego Biurrun
     *
1967 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
1968
     * - decoding: unused
1969 ebbcdc9a Michael Niedermayer
     */
1970 59e0ac8e Zdenek Kabelac
    int me_range;
1971 ebbcdc9a Michael Niedermayer
1972 65f7062d Michael Niedermayer
    /**
1973 f5bccd85 Diego Biurrun
     * intra quantizer bias
1974
     * - encoding: Set by user.
1975 1984f635 Michael Niedermayer
     * - decoding: unused
1976
     */
1977
    int intra_quant_bias;
1978
#define FF_DEFAULT_QUANT_BIAS 999999
1979 115329f1 Diego Biurrun
1980 1984f635 Michael Niedermayer
    /**
1981 f5bccd85 Diego Biurrun
     * inter quantizer bias
1982
     * - encoding: Set by user.
1983 1984f635 Michael Niedermayer
     * - decoding: unused
1984
     */
1985
    int inter_quant_bias;
1986 5cd62665 Zdenek Kabelac
1987
    /**
1988 f5bccd85 Diego Biurrun
     * color table ID
1989
     * - encoding: unused
1990
     * - decoding: Which clrtable should be used for 8bit RGB images.
1991
     *             Tables have to be stored somewhere. FIXME
1992 5cd62665 Zdenek Kabelac
     */
1993
    int color_table_id;
1994 115329f1 Diego Biurrun
1995 d90cf87b Michael Niedermayer
    /**
1996 f5bccd85 Diego Biurrun
     * internal_buffer count
1997
     * Don't touch, used by libavcodec default_get_buffer().
1998 d90cf87b Michael Niedermayer
     */
1999
    int internal_buffer_count;
2000 115329f1 Diego Biurrun
2001 d90cf87b Michael Niedermayer
    /**
2002 f5bccd85 Diego Biurrun
     * internal_buffers
2003
     * Don't touch, used by libavcodec default_get_buffer().
2004 d90cf87b Michael Niedermayer
     */
2005
    void *internal_buffer;
2006 158c7f05 Michael Niedermayer
2007 3d2e8cce Michael Niedermayer
    /**
2008 f5bccd85 Diego Biurrun
     * Global quality for codecs which cannot change it per frame.
2009
     * This should be proportional to MPEG-1/2/4 qscale.
2010
     * - encoding: Set by user.
2011 3d2e8cce Michael Niedermayer
     * - decoding: unused
2012
     */
2013
    int global_quality;
2014 115329f1 Diego Biurrun
2015 bd446bb1 Michael Niedermayer
#define FF_CODER_TYPE_VLC       0
2016
#define FF_CODER_TYPE_AC        1
2017 f87459e4 Kamil Nowosad
#define FF_CODER_TYPE_RAW       2
2018
#define FF_CODER_TYPE_RLE       3
2019
#define FF_CODER_TYPE_DEFLATE   4
2020 11e659c2 Michael Niedermayer
    /**
2021
     * coder type
2022 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2023 11e659c2 Michael Niedermayer
     * - decoding: unused
2024
     */
2025
    int coder_type;
2026
2027
    /**
2028
     * context model
2029 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2030 11e659c2 Michael Niedermayer
     * - decoding: unused
2031
     */
2032
    int context_model;
2033 5639729b Michael Niedermayer
#if 0
2034
    /**
2035
     *
2036
     * - encoding: unused
2037 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2038 5639729b Michael Niedermayer
     */
2039
    uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
2040
#endif
2041 115329f1 Diego Biurrun
2042 3bb07d61 Michael Niedermayer
    /**
2043
     * slice flags
2044
     * - encoding: unused
2045 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2046 3bb07d61 Michael Niedermayer
     */
2047
    int slice_flags;
2048
#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
2049
#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
2050
#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
2051
2052 fb364ada Ivan Kalvachev
    /**
2053
     * XVideo Motion Acceleration
2054
     * - encoding: forbidden
2055
     * - decoding: set by decoder
2056
     */
2057
    int xvmc_acceleration;
2058 115329f1 Diego Biurrun
2059 7d1c3fc1 Michael Niedermayer
    /**
2060
     * macroblock decision mode
2061 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2062 7d1c3fc1 Michael Niedermayer
     * - decoding: unused
2063
     */
2064
    int mb_decision;
2065
#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
2066
#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
2067 e6dba5df Ramiro Polla
#define FF_MB_DECISION_RD     2        ///< rate distortion
2068 d6eb3c50 Michael Niedermayer
2069
    /**
2070
     * custom intra quantization matrix
2071 f5bccd85 Diego Biurrun
     * - encoding: Set by user, can be NULL.
2072
     * - decoding: Set by libavcodec.
2073 d6eb3c50 Michael Niedermayer
     */
2074
    uint16_t *intra_matrix;
2075
2076
    /**
2077
     * custom inter quantization matrix
2078 f5bccd85 Diego Biurrun
     * - encoding: Set by user, can be NULL.
2079
     * - decoding: Set by libavcodec.
2080 d6eb3c50 Michael Niedermayer
     */
2081
    uint16_t *inter_matrix;
2082 115329f1 Diego Biurrun
2083 541ae140 Michael Niedermayer
    /**
2084
     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
2085 f5bccd85 Diego Biurrun
     * This is used to work around some encoder bugs.
2086 541ae140 Michael Niedermayer
     * - encoding: unused
2087 f5bccd85 Diego Biurrun
     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
2088 541ae140 Michael Niedermayer
     */
2089
    unsigned int stream_codec_tag;
2090 05fbd0a2 Michael Niedermayer
2091
    /**
2092 f5bccd85 Diego Biurrun
     * scene change detection threshold
2093
     * 0 is default, larger means fewer detected scene changes.
2094
     * - encoding: Set by user.
2095 05fbd0a2 Michael Niedermayer
     * - decoding: unused
2096
     */
2097
    int scenechange_threshold;
2098 158c7f05 Michael Niedermayer
2099
    /**
2100 f5bccd85 Diego Biurrun
     * minimum Lagrange multipler
2101
     * - encoding: Set by user.
2102 158c7f05 Michael Niedermayer
     * - decoding: unused
2103
     */
2104
    int lmin;
2105
2106
    /**
2107 f5bccd85 Diego Biurrun
     * maximum Lagrange multipler
2108
     * - encoding: Set by user.
2109 158c7f05 Michael Niedermayer
     * - decoding: unused
2110
     */
2111
    int lmax;
2112 2a2bbcb0 Mike Melanson
2113 eda7c983 Aurelien Jacobs
#if FF_API_PALETTE_CONTROL
2114 2a2bbcb0 Mike Melanson
    /**
2115 f5bccd85 Diego Biurrun
     * palette control structure
2116 2a2bbcb0 Mike Melanson
     * - encoding: ??? (no palette-enabled encoder yet)
2117 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2118 2a2bbcb0 Mike Melanson
     */
2119
    struct AVPaletteControl *palctrl;
2120 eda7c983 Aurelien Jacobs
#endif
2121 821cb11f Michael Niedermayer
2122
    /**
2123
     * noise reduction strength
2124 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2125 821cb11f Michael Niedermayer
     * - decoding: unused
2126
     */
2127
    int noise_reduction;
2128 115329f1 Diego Biurrun
2129 074c4ca7 Roberto Togni
    /**
2130 f5bccd85 Diego Biurrun
     * Called at the beginning of a frame to get cr buffer for it.
2131
     * Buffer type (size, hints) must be the same. libavcodec won't check it.
2132
     * libavcodec will pass previous buffer in pic, function should return
2133 e1c2a5a0 Roberto Togni
     * same buffer or new buffer with old frame "painted" into it.
2134 f5bccd85 Diego Biurrun
     * If pic.data[0] == NULL must behave like get_buffer().
2135 f1b99cc6 Michael Niedermayer
     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
2136
     * avcodec_default_reget_buffer() instead of providing buffers allocated by
2137
     * some other means.
2138 074c4ca7 Roberto Togni
     * - encoding: unused
2139 53128bc3 Peter Ross
     * - decoding: Set by libavcodec, user can override.
2140 074c4ca7 Roberto Togni
     */
2141 e1c2a5a0 Roberto Togni
    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
2142 ba58dabc Michael Niedermayer
2143
    /**
2144 f5bccd85 Diego Biurrun
     * Number of bits which should be loaded into the rc buffer before decoding starts.
2145
     * - encoding: Set by user.
2146 ba58dabc Michael Niedermayer
     * - decoding: unused
2147
     */
2148
    int rc_initial_buffer_occupancy;
2149
2150
    /**
2151
     *
2152 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2153 ba58dabc Michael Niedermayer
     * - decoding: unused
2154
     */
2155
    int inter_threshold;
2156
2157
    /**
2158 f5bccd85 Diego Biurrun
     * CODEC_FLAG2_*
2159
     * - encoding: Set by user.
2160
     * - decoding: Set by user.
2161 ba58dabc Michael Niedermayer
     */
2162
    int flags2;
2163 7ebfc0ea Michael Niedermayer
2164
    /**
2165 f5bccd85 Diego Biurrun
     * Simulates errors in the bitstream to test error concealment.
2166
     * - encoding: Set by user.
2167
     * - decoding: unused
2168 7ebfc0ea Michael Niedermayer
     */
2169
    int error_rate;
2170 115329f1 Diego Biurrun
2171 4e3945fd Anton Khirnov
#if FF_API_ANTIALIAS_ALGO
2172 a1e257b2 Michael Niedermayer
    /**
2173
     * MP3 antialias algorithm, see FF_AA_* below.
2174
     * - encoding: unused
2175 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2176 a1e257b2 Michael Niedermayer
     */
2177 4e3945fd Anton Khirnov
    attribute_deprecated int antialias_algo;
2178 a1e257b2 Michael Niedermayer
#define FF_AA_AUTO    0
2179
#define FF_AA_FASTINT 1 //not implemented yet
2180
#define FF_AA_INT     2
2181
#define FF_AA_FLOAT   3
2182 4e3945fd Anton Khirnov
#endif
2183
2184 77ea0d4b Michael Niedermayer
    /**
2185 f5bccd85 Diego Biurrun
     * quantizer noise shaping
2186
     * - encoding: Set by user.
2187 77ea0d4b Michael Niedermayer
     * - decoding: unused
2188
     */
2189
    int quantizer_noise_shaping;
2190 9c3d33d6 Michael Niedermayer
2191
    /**
2192 f5bccd85 Diego Biurrun
     * thread count
2193 eafcac6a Diego Biurrun
     * is used to decide how many independent tasks should be passed to execute()
2194 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2195
     * - decoding: Set by user.
2196 9c3d33d6 Michael Niedermayer
     */
2197
    int thread_count;
2198 115329f1 Diego Biurrun
2199 9c3d33d6 Michael Niedermayer
    /**
2200 f5bccd85 Diego Biurrun
     * The codec may call this to execute several independent things.
2201
     * It will return only after finishing all tasks.
2202
     * The user may replace this with some multithreaded implementation,
2203
     * the default implementation will execute the parts serially.
2204 399cec2f Michael Niedermayer
     * @param count the number of things to execute
2205 f5bccd85 Diego Biurrun
     * - encoding: Set by libavcodec, user can override.
2206
     * - decoding: Set by libavcodec, user can override.
2207 9c3d33d6 Michael Niedermayer
     */
2208 3a84713a Roman Shaposhnik
    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
2209 115329f1 Diego Biurrun
2210 9c3d33d6 Michael Niedermayer
    /**
2211 f5bccd85 Diego Biurrun
     * thread opaque
2212
     * Can be used by execute() to store some per AVCodecContext stuff.
2213 9c3d33d6 Michael Niedermayer
     * - encoding: set by execute()
2214
     * - decoding: set by execute()
2215
     */
2216
    void *thread_opaque;
2217 a4d36c11 Michael Niedermayer
2218
    /**
2219 f5bccd85 Diego Biurrun
     * Motion estimation threshold below which no motion estimation is
2220
     * performed, but instead the user specified motion vectors are used.
2221 115329f1 Diego Biurrun
     *
2222 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2223 f20f8a8b Michael Niedermayer
     * - decoding: unused
2224 a4d36c11 Michael Niedermayer
     */
2225 2750b827 Michael Niedermayer
     int me_threshold;
2226 f20f8a8b Michael Niedermayer
2227
    /**
2228 f5bccd85 Diego Biurrun
     * Macroblock threshold below which the user specified macroblock types will be used.
2229
     * - encoding: Set by user.
2230 f20f8a8b Michael Niedermayer
     * - decoding: unused
2231
     */
2232
     int mb_threshold;
2233 bf266e19 Michael Niedermayer
2234
    /**
2235 f5bccd85 Diego Biurrun
     * precision of the intra DC coefficient - 8
2236
     * - encoding: Set by user.
2237 bf266e19 Michael Niedermayer
     * - decoding: unused
2238
     */
2239
     int intra_dc_precision;
2240 d4c5d2ad Michael Niedermayer
2241
    /**
2242 f5bccd85 Diego Biurrun
     * noise vs. sse weight for the nsse comparsion function
2243
     * - encoding: Set by user.
2244 d4c5d2ad Michael Niedermayer
     * - decoding: unused
2245
     */
2246
     int nsse_weight;
2247 0dfd33c3 Michael Niedermayer
2248
    /**
2249 f5bccd85 Diego Biurrun
     * Number of macroblock rows at the top which are skipped.
2250 0dfd33c3 Michael Niedermayer
     * - encoding: unused
2251 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2252 0dfd33c3 Michael Niedermayer
     */
2253
     int skip_top;
2254
2255
    /**
2256 f5bccd85 Diego Biurrun
     * Number of macroblock rows at the bottom which are skipped.
2257 0dfd33c3 Michael Niedermayer
     * - encoding: unused
2258 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2259 0dfd33c3 Michael Niedermayer
     */
2260
     int skip_bottom;
2261 baced9f5 Michael Niedermayer
2262
    /**
2263
     * profile
2264 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2265
     * - decoding: Set by libavcodec.
2266 baced9f5 Michael Niedermayer
     */
2267
     int profile;
2268
#define FF_PROFILE_UNKNOWN -99
2269 aecd0a44 Benjamin Larsson
#define FF_PROFILE_RESERVED -100
2270 dd0cd3d2 Rafaël Carré
2271 4f2c36ac Nicolas George
#define FF_PROFILE_AAC_MAIN 0
2272 273b0cd3 Diego Biurrun
#define FF_PROFILE_AAC_LOW  1
2273
#define FF_PROFILE_AAC_SSR  2
2274
#define FF_PROFILE_AAC_LTP  3
2275 baced9f5 Michael Niedermayer
2276 f5a2d285 Anssi Hannula
#define FF_PROFILE_DTS         20
2277
#define FF_PROFILE_DTS_ES      30
2278
#define FF_PROFILE_DTS_96_24   40
2279
#define FF_PROFILE_DTS_HD_HRA  50
2280
#define FF_PROFILE_DTS_HD_MA   60
2281
2282 aecd0a44 Benjamin Larsson
#define FF_PROFILE_MPEG2_422    0
2283
#define FF_PROFILE_MPEG2_HIGH   1
2284
#define FF_PROFILE_MPEG2_SS     2
2285
#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
2286
#define FF_PROFILE_MPEG2_MAIN   4
2287
#define FF_PROFILE_MPEG2_SIMPLE 5
2288
2289 fe9a3fbe Janne Grunau
#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
2290
#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
2291
2292
#define FF_PROFILE_H264_BASELINE             66
2293
#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2294
#define FF_PROFILE_H264_MAIN                 77
2295
#define FF_PROFILE_H264_EXTENDED             88
2296
#define FF_PROFILE_H264_HIGH                 100
2297
#define FF_PROFILE_H264_HIGH_10              110
2298
#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
2299
#define FF_PROFILE_H264_HIGH_422             122
2300
#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
2301 440b6169 Janne Grunau
#define FF_PROFILE_H264_HIGH_444             144
2302 fe9a3fbe Janne Grunau
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
2303
#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
2304
#define FF_PROFILE_H264_CAVLC_444            44
2305 dd0cd3d2 Rafaël Carré
2306 0215006a Hendrik Leppkes
#define FF_PROFILE_VC1_SIMPLE   0
2307
#define FF_PROFILE_VC1_MAIN     1
2308
#define FF_PROFILE_VC1_COMPLEX  2
2309
#define FF_PROFILE_VC1_ADVANCED 3
2310
2311 baced9f5 Michael Niedermayer
    /**
2312
     * level
2313 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2314
     * - decoding: Set by libavcodec.
2315 baced9f5 Michael Niedermayer
     */
2316
     int level;
2317
#define FF_LEVEL_UNKNOWN -99
2318 178fcca8 Michael Niedermayer
2319
    /**
2320 f5bccd85 Diego Biurrun
     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
2321 178fcca8 Michael Niedermayer
     * - encoding: unused
2322 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2323 178fcca8 Michael Niedermayer
     */
2324
     int lowres;
2325 21adafec Michael Niedermayer
2326
    /**
2327 f5bccd85 Diego Biurrun
     * Bitstream width / height, may be different from width/height if lowres
2328
     * or other things are used.
2329 21adafec Michael Niedermayer
     * - encoding: unused
2330 f5bccd85 Diego Biurrun
     * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
2331 21adafec Michael Niedermayer
     */
2332
    int coded_width, coded_height;
2333 bbf18b21 Michael Niedermayer
2334
    /**
2335
     * frame skip threshold
2336 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2337 bbf18b21 Michael Niedermayer
     * - decoding: unused
2338
     */
2339
    int frame_skip_threshold;
2340
2341
    /**
2342
     * frame skip factor
2343 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2344 bbf18b21 Michael Niedermayer
     * - decoding: unused
2345
     */
2346
    int frame_skip_factor;
2347 0fd6aea1 Michael Niedermayer
2348
    /**
2349
     * frame skip exponent
2350 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2351 0fd6aea1 Michael Niedermayer
     * - decoding: unused
2352
     */
2353
    int frame_skip_exp;
2354
2355
    /**
2356 f5bccd85 Diego Biurrun
     * frame skip comparison function
2357
     * - encoding: Set by user.
2358 0fd6aea1 Michael Niedermayer
     * - decoding: unused
2359
     */
2360
    int frame_skip_cmp;
2361 957c743a Christophe Massiot
2362
    /**
2363 f5bccd85 Diego Biurrun
     * Border processing masking, raises the quantizer for mbs on the borders
2364 957c743a Christophe Massiot
     * of the picture.
2365 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2366 957c743a Christophe Massiot
     * - decoding: unused
2367
     */
2368
    float border_masking;
2369 6e0d8c06 Michael Niedermayer
2370
    /**
2371 f5bccd85 Diego Biurrun
     * minimum MB lagrange multipler
2372
     * - encoding: Set by user.
2373 6e0d8c06 Michael Niedermayer
     * - decoding: unused
2374
     */
2375
    int mb_lmin;
2376
2377
    /**
2378 f5bccd85 Diego Biurrun
     * maximum MB lagrange multipler
2379
     * - encoding: Set by user.
2380 6e0d8c06 Michael Niedermayer
     * - decoding: unused
2381
     */
2382
    int mb_lmax;
2383 09c3e44e Michael Niedermayer
2384
    /**
2385 115329f1 Diego Biurrun
     *
2386 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2387 09c3e44e Michael Niedermayer
     * - decoding: unused
2388
     */
2389
    int me_penalty_compensation;
2390 8c3eba7c Michael Niedermayer
2391
    /**
2392 115329f1 Diego Biurrun
     *
2393 8c3eba7c Michael Niedermayer
     * - encoding: unused
2394 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2395 8c3eba7c Michael Niedermayer
     */
2396
    enum AVDiscard skip_loop_filter;
2397
2398
    /**
2399 115329f1 Diego Biurrun
     *
2400 8c3eba7c Michael Niedermayer
     * - encoding: unused
2401 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2402 8c3eba7c Michael Niedermayer
     */
2403
    enum AVDiscard skip_idct;
2404
2405
    /**
2406 115329f1 Diego Biurrun
     *
2407 8c3eba7c Michael Niedermayer
     * - encoding: unused
2408 f5bccd85 Diego Biurrun
     * - decoding: Set by user.
2409 8c3eba7c Michael Niedermayer
     */
2410
    enum AVDiscard skip_frame;
2411 316a2ec8 Michael Niedermayer
2412
    /**
2413
     *
2414 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2415 316a2ec8 Michael Niedermayer
     * - decoding: unused
2416
     */
2417
    int bidir_refine;
2418 e8501c93 Michael Niedermayer
2419
    /**
2420
     *
2421 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2422 e8501c93 Michael Niedermayer
     * - decoding: unused
2423
     */
2424
    int brd_scale;
2425 58f7833e Robert Swain
2426
    /**
2427
     * constant rate factor - quality-based VBR - values ~correspond to qps
2428 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2429 58f7833e Robert Swain
     * - decoding: unused
2430
     */
2431 9f1c1c99 Luca Barbato
    float crf;
2432 58f7833e Robert Swain
2433
    /**
2434
     * constant quantization parameter rate control method
2435 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2436 58f7833e Robert Swain
     * - decoding: unused
2437
     */
2438
    int cqp;
2439
2440
    /**
2441 f5bccd85 Diego Biurrun
     * minimum GOP size
2442
     * - encoding: Set by user.
2443 58f7833e Robert Swain
     * - decoding: unused
2444
     */
2445
    int keyint_min;
2446
2447
    /**
2448
     * number of reference frames
2449 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2450 53d55e9e Michael Niedermayer
     * - decoding: Set by lavc.
2451 58f7833e Robert Swain
     */
2452
    int refs;
2453
2454
    /**
2455
     * chroma qp offset from luma
2456 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2457 58f7833e Robert Swain
     * - decoding: unused
2458
     */
2459
    int chromaoffset;
2460
2461
    /**
2462 f5bccd85 Diego Biurrun
     * Influences how often B-frames are used.
2463
     * - encoding: Set by user.
2464 58f7833e Robert Swain
     * - decoding: unused
2465
     */
2466
    int bframebias;
2467
2468
    /**
2469
     * trellis RD quantization
2470 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2471 58f7833e Robert Swain
     * - decoding: unused
2472
     */
2473
    int trellis;
2474
2475
    /**
2476 f5bccd85 Diego Biurrun
     * Reduce fluctuations in qp (before curve compression).
2477
     * - encoding: Set by user.
2478 58f7833e Robert Swain
     * - decoding: unused
2479
     */
2480
    float complexityblur;
2481
2482
    /**
2483
     * in-loop deblocking filter alphac0 parameter
2484
     * alpha is in the range -6...6
2485 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2486 58f7833e Robert Swain
     * - decoding: unused
2487
     */
2488
    int deblockalpha;
2489
2490
    /**
2491
     * in-loop deblocking filter beta parameter
2492
     * beta is in the range -6...6
2493 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2494 58f7833e Robert Swain
     * - decoding: unused
2495
     */
2496
    int deblockbeta;
2497
2498
    /**
2499
     * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
2500 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2501 58f7833e Robert Swain
     * - decoding: unused
2502
     */
2503
    int partitions;
2504 56cc85a0 Diego Biurrun
#define X264_PART_I4X4 0x001  /* Analyze i4x4 */
2505
#define X264_PART_I8X8 0x002  /* Analyze i8x8 (requires 8x8 transform) */
2506
#define X264_PART_P8X8 0x010  /* Analyze p16x8, p8x16 and p8x8 */
2507
#define X264_PART_P4X4 0x020  /* Analyze p8x4, p4x8, p4x4 */
2508
#define X264_PART_B8X8 0x100  /* Analyze b16x8, b8x16 and b8x8 */
2509 58f7833e Robert Swain
2510
    /**
2511 30ab4ded Francesco Cosoleto
     * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
2512 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2513 58f7833e Robert Swain
     * - decoding: unused
2514
     */
2515
    int directpred;
2516 4f59b684 Diego Biurrun
2517 14f0c8e2 Luca Abeni
    /**
2518 02c164c1 Justin Ruggles
     * Audio cutoff bandwidth (0 means "automatic")
2519 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2520 14f0c8e2 Luca Abeni
     * - decoding: unused
2521
     */
2522
    int cutoff;
2523 39a64e30 Corey Hickey
2524
    /**
2525 f5bccd85 Diego Biurrun
     * Multiplied by qscale for each frame and added to scene_change_score.
2526
     * - encoding: Set by user.
2527 39a64e30 Corey Hickey
     * - decoding: unused
2528
     */
2529
    int scenechange_factor;
2530 1dd509b1 Michael Niedermayer
2531
    /**
2532
     *
2533 f5bccd85 Diego Biurrun
     * Note: Value depends upon the compare function used for fullpel ME.
2534
     * - encoding: Set by user.
2535 1dd509b1 Michael Niedermayer
     * - decoding: unused
2536
     */
2537
    int mv0_threshold;
2538 f9243d34 Corey Hickey
2539
    /**
2540 f5bccd85 Diego Biurrun
     * Adjusts sensitivity of b_frame_strategy 1.
2541
     * - encoding: Set by user.
2542 f9243d34 Corey Hickey
     * - decoding: unused
2543
     */
2544
    int b_sensitivity;
2545 a403fc03 Justin Ruggles
2546
    /**
2547 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2548 a403fc03 Justin Ruggles
     * - decoding: unused
2549
     */
2550
    int compression_level;
2551
#define FF_COMPRESSION_DEFAULT -1
2552
2553 0743de4f Aurelien Jacobs
#if FF_API_USE_LPC
2554 a403fc03 Justin Ruggles
    /**
2555 f5bccd85 Diego Biurrun
     * Sets whether to use LPC mode - used by FLAC encoder.
2556
     * - encoding: Set by user.
2557
     * - decoding: unused
2558 23940f14 Justin Ruggles
     * @deprecated Deprecated in favor of lpc_type and lpc_passes.
2559 a403fc03 Justin Ruggles
     */
2560
    int use_lpc;
2561 23940f14 Justin Ruggles
#endif
2562 a403fc03 Justin Ruggles
2563
    /**
2564
     * LPC coefficient precision - used by FLAC encoder
2565 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2566
     * - decoding: unused
2567 a403fc03 Justin Ruggles
     */
2568
    int lpc_coeff_precision;
2569
2570
    /**
2571 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2572
     * - decoding: unused
2573 a403fc03 Justin Ruggles
     */
2574
    int min_prediction_order;
2575
2576
    /**
2577 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2578
     * - decoding: unused
2579 a403fc03 Justin Ruggles
     */
2580
    int max_prediction_order;
2581
2582
    /**
2583
     * search method for selecting prediction order
2584 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2585
     * - decoding: unused
2586 a403fc03 Justin Ruggles
     */
2587
    int prediction_order_method;
2588
2589
    /**
2590 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2591
     * - decoding: unused
2592 a403fc03 Justin Ruggles
     */
2593
    int min_partition_order;
2594
2595
    /**
2596 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2597
     * - decoding: unused
2598 a403fc03 Justin Ruggles
     */
2599
    int max_partition_order;
2600 80d617f5 Baptiste Coudurier
2601
    /**
2602
     * GOP timecode frame start number, in non drop frame format
2603 f5bccd85 Diego Biurrun
     * - encoding: Set by user.
2604
     * - decoding: unused
2605 80d617f5 Baptiste Coudurier
     */