Statistics
| Branch: | Revision:

ffmpeg / libavcodec / avcodec.h @ cba322d7

History | View | Annotate | Download (131 KB)

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