rename AVMetaData to AVMetadata and meta_data to metadata
[libav.git] / libavcodec / avcodec.h
CommitLineData
04d7f601
DB
1/*
2 * copyright (c) 2001 Fabrice Bellard
3 *
b78e7197
DB
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
04d7f601
DB
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
b78e7197 9 * version 2.1 of the License, or (at your option) any later version.
04d7f601 10 *
b78e7197 11 * FFmpeg is distributed in the hope that it will be useful,
04d7f601
DB
12 * 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
b78e7197 17 * License along with FFmpeg; if not, write to the Free Software
e5a389a1 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
04d7f601
DB
19 */
20
98790382
SS
21#ifndef AVCODEC_AVCODEC_H
22#define AVCODEC_AVCODEC_H
a96b68b7 23
36df8805
MN
24/**
25 * @file avcodec.h
f5bccd85 26 * external API header
36df8805
MN
27 */
28
29
76a448ed 30#include "libavutil/avutil.h"
de6d9b64 31
dd1c8f3e 32#define LIBAVCODEC_VERSION_MAJOR 52
1104a26a 33#define LIBAVCODEC_VERSION_MINOR 10
7b1454c4 34#define LIBAVCODEC_VERSION_MICRO 0
e97ac1e6 35
800c289a
MR
36#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
37 LIBAVCODEC_VERSION_MINOR, \
38 LIBAVCODEC_VERSION_MICRO)
39#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
40 LIBAVCODEC_VERSION_MINOR, \
41 LIBAVCODEC_VERSION_MICRO)
bb270c08 42#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
5aa083ee 43
bb270c08 44#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
ce2749d2 45
8da9266c 46#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
bb270c08
DB
47#define AV_TIME_BASE 1000000
48#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
9740beff 49
7ebf5927 50/**
6b0cdb6e
NG
51 * Identifies the syntax and semantics of the bitstream.
52 * The principle is roughly:
53 * Two decoders with the same ID can decode the same streams.
54 * Two encoders with the same ID can encode compatible streams.
55 * There may be slight deviations from the principle due to implementation
56 * details.
7ebf5927 57 *
f5bccd85
DB
58 * If you add a codec ID to this list, add it so that
59 * 1. no value of a existing codec ID changes (that would break ABI),
60 * 2. it is as close as possible to similar codecs.
7ebf5927 61 */
de6d9b64 62enum CodecID {
115329f1 63 CODEC_ID_NONE,
ba0dabbf
DB
64
65 /* video codecs */
de6d9b64 66 CODEC_ID_MPEG1VIDEO,
0e373b95 67 CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
fb364ada 68 CODEC_ID_MPEG2VIDEO_XVMC,
c6148de2 69 CODEC_ID_H261,
de6d9b64
FB
70 CODEC_ID_H263,
71 CODEC_ID_RV10,
68b94c35 72 CODEC_ID_RV20,
de6d9b64 73 CODEC_ID_MJPEG,
b135d9fb 74 CODEC_ID_MJPEGB,
b1e6b355 75 CODEC_ID_LJPEG,
5e83dec4 76 CODEC_ID_SP5X,
5639729b 77 CODEC_ID_JPEGLS,
bf89e6b1 78 CODEC_ID_MPEG4,
de6d9b64 79 CODEC_ID_RAWVIDEO,
84afee34
MN
80 CODEC_ID_MSMPEG4V1,
81 CODEC_ID_MSMPEG4V2,
82 CODEC_ID_MSMPEG4V3,
e1a9dbff 83 CODEC_ID_WMV1,
b50eef3a 84 CODEC_ID_WMV2,
de6d9b64
FB
85 CODEC_ID_H263P,
86 CODEC_ID_H263I,
d4f5d74a 87 CODEC_ID_FLV1,
be8ffec9 88 CODEC_ID_SVQ1,
8b82a956 89 CODEC_ID_SVQ3,
020fcc94 90 CODEC_ID_DVVIDEO,
11f18faf 91 CODEC_ID_HUFFYUV,
f70f7c6d 92 CODEC_ID_CYUV,
0da71265 93 CODEC_ID_H264,
deabd4fd 94 CODEC_ID_INDEO3,
d86053a4 95 CODEC_ID_VP3,
f44ee2c3 96 CODEC_ID_THEORA,
3d2e8cce 97 CODEC_ID_ASV1,
9b56edf5 98 CODEC_ID_ASV2,
5e20f836 99 CODEC_ID_FFV1,
e2a7bb28 100 CODEC_ID_4XM,
be3564ed 101 CODEC_ID_VCR1,
3aff069b 102 CODEC_ID_CLJR,
c3bf0288 103 CODEC_ID_MDEC,
3ef8be2b
MM
104 CODEC_ID_ROQ,
105 CODEC_ID_INTERPLAY_VIDEO,
9937e686
MM
106 CODEC_ID_XAN_WC3,
107 CODEC_ID_XAN_WC4,
2fdf638b
MM
108 CODEC_ID_RPZA,
109 CODEC_ID_CINEPAK,
110 CODEC_ID_WS_VQA,
111 CODEC_ID_MSRLE,
112 CODEC_ID_MSVIDEO1,
4120a53a 113 CODEC_ID_IDCIN,
1dc1ed99 114 CODEC_ID_8BPS,
11e29a41 115 CODEC_ID_SMC,
42cad81a 116 CODEC_ID_FLIC,
9a4117d5 117 CODEC_ID_TRUEMOTION1,
fafa0b75 118 CODEC_ID_VMDVIDEO,
a273bbfb
RT
119 CODEC_ID_MSZH,
120 CODEC_ID_ZLIB,
070ed1bc 121 CODEC_ID_QTRLE,
791e7b83 122 CODEC_ID_SNOW,
9d53d58e 123 CODEC_ID_TSCC,
d0a0bbd2 124 CODEC_ID_ULTI,
d08d7142 125 CODEC_ID_QDRAW,
ab711b3c 126 CODEC_ID_VIXL,
acfd8f0f 127 CODEC_ID_QPEG,
17179d2d
MN
128 CODEC_ID_XVID,
129 CODEC_ID_PNG,
130 CODEC_ID_PPM,
131 CODEC_ID_PBM,
132 CODEC_ID_PGM,
133 CODEC_ID_PGMYUV,
134 CODEC_ID_PAM,
f37b9768 135 CODEC_ID_FFVHUFF,
3f05305d
MN
136 CODEC_ID_RV30,
137 CODEC_ID_RV40,
10b9c374 138 CODEC_ID_VC1,
21aa398f 139 CODEC_ID_WMV3,
9c7fb608 140 CODEC_ID_LOCO,
a8a15e9d 141 CODEC_ID_WNV1,
589f8220 142 CODEC_ID_AASC,
856dbbff 143 CODEC_ID_INDEO2,
b81f8949 144 CODEC_ID_FRAPS,
64af6168 145 CODEC_ID_TRUEMOTION2,
9fa62f2a 146 CODEC_ID_BMP,
e0f80bd7 147 CODEC_ID_CSCD,
4e114829 148 CODEC_ID_MMVIDEO,
9c8d8e84 149 CODEC_ID_ZMBV,
26376701 150 CODEC_ID_AVS,
348efc18 151 CODEC_ID_SMACKVIDEO,
dfca23e3 152 CODEC_ID_NUV,
fd7b1991 153 CODEC_ID_KMVC,
0919e788 154 CODEC_ID_FLASHSV,
20ffddb9 155 CODEC_ID_CAVS,
f31065f6 156 CODEC_ID_JPEG2000,
eb57c889 157 CODEC_ID_VMNC,
5ce117c3
AJ
158 CODEC_ID_VP5,
159 CODEC_ID_VP6,
160 CODEC_ID_VP6F,
3689cf16 161 CODEC_ID_TARGA,
72450e50 162 CODEC_ID_DSICINVIDEO,
29f86228 163 CODEC_ID_TIERTEXSEQVIDEO,
a991b1fe 164 CODEC_ID_TIFF,
06d392a7 165 CODEC_ID_GIF,
3edeab82 166 CODEC_ID_FFH264,
33a0dd37 167 CODEC_ID_DXA,
52b6bad2 168 CODEC_ID_DNXHD,
efb0c399 169 CODEC_ID_THP,
2d99eed1 170 CODEC_ID_SGI,
9a0ddd09 171 CODEC_ID_C93,
1e6c6759 172 CODEC_ID_BETHSOFTVID,
b46d68c6 173 CODEC_ID_PTX,
1ca779e7 174 CODEC_ID_TXD,
91fc2cf1 175 CODEC_ID_VP6A,
8787d837 176 CODEC_ID_AMV,
66f7679c 177 CODEC_ID_VB,
b4abe1d1 178 CODEC_ID_PCX,
d43df959 179 CODEC_ID_SUNRAST,
800b9c24
BL
180 CODEC_ID_INDEO4,
181 CODEC_ID_INDEO5,
a7129de5 182 CODEC_ID_MIMIC,
975cdc8f 183 CODEC_ID_RL2,
cb21e0a7
JM
184 CODEC_ID_8SVX_EXP,
185 CODEC_ID_8SVX_FIB,
40d26273 186 CODEC_ID_ESCAPE124,
782a58ec 187 CODEC_ID_DIRAC,
b64c096b 188 CODEC_ID_BFI,
495900f7 189 CODEC_ID_CMV,
974e0eee 190 CODEC_ID_MOTIONPIXELS,
cfc78718 191 CODEC_ID_TGV,
42b30357 192 CODEC_ID_TGQ,
a96b68b7 193
f5bccd85 194 /* various PCM "codecs" */
17179d2d 195 CODEC_ID_PCM_S16LE= 0x10000,
a96b68b7
FB
196 CODEC_ID_PCM_S16BE,
197 CODEC_ID_PCM_U16LE,
198 CODEC_ID_PCM_U16BE,
199 CODEC_ID_PCM_S8,
200 CODEC_ID_PCM_U8,
201 CODEC_ID_PCM_MULAW,
202 CODEC_ID_PCM_ALAW,
b461b3bc
RD
203 CODEC_ID_PCM_S32LE,
204 CODEC_ID_PCM_S32BE,
205 CODEC_ID_PCM_U32LE,
206 CODEC_ID_PCM_U32BE,
207 CODEC_ID_PCM_S24LE,
208 CODEC_ID_PCM_S24BE,
209 CODEC_ID_PCM_U24LE,
210 CODEC_ID_PCM_U24BE,
211 CODEC_ID_PCM_S24DAUD,
a11c2a2c 212 CODEC_ID_PCM_ZORK,
725d86bf 213 CODEC_ID_PCM_S16LE_PLANAR,
1472b7dd 214 CODEC_ID_PCM_DVD,
aa29709e 215 CODEC_ID_PCM_F32BE,
143a5d6f
PR
216 CODEC_ID_PCM_F32LE,
217 CODEC_ID_PCM_F64BE,
218 CODEC_ID_PCM_F64LE,
0147f198 219
f5bccd85 220 /* various ADPCM codecs */
17179d2d 221 CODEC_ID_ADPCM_IMA_QT= 0x11000,
0147f198 222 CODEC_ID_ADPCM_IMA_WAV,
9937e686
MM
223 CODEC_ID_ADPCM_IMA_DK3,
224 CODEC_ID_ADPCM_IMA_DK4,
2fdf638b 225 CODEC_ID_ADPCM_IMA_WS,
7d8379f2 226 CODEC_ID_ADPCM_IMA_SMJPEG,
0147f198 227 CODEC_ID_ADPCM_MS,
e2a7bb28 228 CODEC_ID_ADPCM_4XM,
fc384777
MM
229 CODEC_ID_ADPCM_XA,
230 CODEC_ID_ADPCM_ADX,
7d8379f2 231 CODEC_ID_ADPCM_EA,
e5966052 232 CODEC_ID_ADPCM_G726,
b3bfb299 233 CODEC_ID_ADPCM_CT,
659c3692 234 CODEC_ID_ADPCM_SWF,
2ff4524e 235 CODEC_ID_ADPCM_YAMAHA,
2433f24f
AJ
236 CODEC_ID_ADPCM_SBPRO_4,
237 CODEC_ID_ADPCM_SBPRO_3,
238 CODEC_ID_ADPCM_SBPRO_2,
d1e0d21f 239 CODEC_ID_ADPCM_THP,
3a7f5d07 240 CODEC_ID_ADPCM_IMA_AMV,
e7583962
PR
241 CODEC_ID_ADPCM_EA_R1,
242 CODEC_ID_ADPCM_EA_R3,
243 CODEC_ID_ADPCM_EA_R2,
7bb65d89 244 CODEC_ID_ADPCM_IMA_EA_SEAD,
fac84d3c 245 CODEC_ID_ADPCM_IMA_EA_EACS,
271b4095 246 CODEC_ID_ADPCM_EA_XAS,
861c63a2 247 CODEC_ID_ADPCM_EA_MAXIS_XA,
891f64b3 248
17179d2d
MN
249 /* AMR */
250 CODEC_ID_AMR_NB= 0x12000,
d663a1fd
MN
251 CODEC_ID_AMR_WB,
252
b8414bbd 253 /* RealAudio codecs*/
17179d2d 254 CODEC_ID_RA_144= 0x13000,
b8414bbd 255 CODEC_ID_RA_288,
3ef8be2b
MM
256
257 /* various DPCM codecs */
17179d2d 258 CODEC_ID_ROQ_DPCM= 0x14000,
3ef8be2b 259 CODEC_ID_INTERPLAY_DPCM,
9937e686 260 CODEC_ID_XAN_DPCM,
d08d7142 261 CODEC_ID_SOL_DPCM,
115329f1 262
ba0dabbf 263 /* audio codecs */
17179d2d 264 CODEC_ID_MP2= 0x15000,
0e373b95 265 CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
17179d2d 266 CODEC_ID_AAC,
17179d2d
MN
267 CODEC_ID_AC3,
268 CODEC_ID_DTS,
269 CODEC_ID_VORBIS,
270 CODEC_ID_DVAUDIO,
271 CODEC_ID_WMAV1,
272 CODEC_ID_WMAV2,
273 CODEC_ID_MACE3,
274 CODEC_ID_MACE6,
275 CODEC_ID_VMDAUDIO,
276 CODEC_ID_SONIC,
277 CODEC_ID_SONIC_LS,
ac2570a8 278 CODEC_ID_FLAC,
1ede228a 279 CODEC_ID_MP3ADU,
d2a7718d 280 CODEC_ID_MP3ON4,
85ad5695 281 CODEC_ID_SHORTEN,
5df8a0c6 282 CODEC_ID_ALAC,
034eeaa1 283 CODEC_ID_WESTWOOD_SND1,
0e373b95 284 CODEC_ID_GSM, ///< as in Berlin toast format
d9b1c197 285 CODEC_ID_QDM2,
e0f7e329 286 CODEC_ID_COOK,
bf3027c8 287 CODEC_ID_TRUESPEECH,
a24c4a2a 288 CODEC_ID_TTA,
348efc18 289 CODEC_ID_SMACKAUDIO,
6c496518 290 CODEC_ID_QCELP,
730581f3 291 CODEC_ID_WAVPACK,
72450e50 292 CODEC_ID_DSICINAUDIO,
84ed36da 293 CODEC_ID_IMC,
185c7b6b 294 CODEC_ID_MUSEPACK7,
aad512b4 295 CODEC_ID_MLP,
f5bccd85 296 CODEC_ID_GSM_MS, /* as found in WAV */
10e26bc7 297 CODEC_ID_ATRAC3,
8950f828 298 CODEC_ID_VOXWARE,
bf4a1f17 299 CODEC_ID_APE,
636b13c5 300 CODEC_ID_NELLYMOSER,
12877faf 301 CODEC_ID_MUSEPACK8,
cb4ddf77 302 CODEC_ID_SPEEX,
7bb8d51c
BL
303 CODEC_ID_WMAVOICE,
304 CODEC_ID_WMAPRO,
800b9c24 305 CODEC_ID_WMALOSSLESS,
b339f0c6 306 CODEC_ID_ATRAC3P,
2988c93d 307 CODEC_ID_EAC3,
faeedbbb 308 CODEC_ID_SIPR,
115329f1 309
240c1657 310 /* subtitle codecs */
115329f1
DB
311 CODEC_ID_DVD_SUBTITLE= 0x17000,
312 CODEC_ID_DVB_SUBTITLE,
0e373b95 313 CODEC_ID_TEXT, ///< raw UTF-8 text
7e2643ae 314 CODEC_ID_XSUB,
f9a9b350 315 CODEC_ID_SSA,
cc8c2c6a 316 CODEC_ID_MOV_TEXT,
115329f1 317
7ce68923 318 /* other specific kind of codecs (generally used for attachments) */
f8d7c9d3
ES
319 CODEC_ID_TTF= 0x18000,
320
0bef08e5
MN
321 CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
322
0e373b95 323 CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
f5bccd85 324 * stream (only used by libavformat) */
de6d9b64 325};
dcedf586 326
de6d9b64 327enum CodecType {
4a663d80 328 CODEC_TYPE_UNKNOWN = -1,
de6d9b64
FB
329 CODEC_TYPE_VIDEO,
330 CODEC_TYPE_AUDIO,
985180a1 331 CODEC_TYPE_DATA,
240c1657 332 CODEC_TYPE_SUBTITLE,
f8d7c9d3 333 CODEC_TYPE_ATTACHMENT,
9ff77d17 334 CODEC_TYPE_NB
de6d9b64
FB
335};
336
0e373b95 337/**
0e373b95
MN
338 * all in native-endian format
339 */
a96b68b7 340enum SampleFormat {
9076fee4 341 SAMPLE_FMT_NONE = -1,
1319a77b
AB
342 SAMPLE_FMT_U8, ///< unsigned 8 bits
343 SAMPLE_FMT_S16, ///< signed 16 bits
115329f1 344 SAMPLE_FMT_S32, ///< signed 32 bits
a3a5f4d6 345 SAMPLE_FMT_FLT, ///< float
e06b00f3 346 SAMPLE_FMT_DBL, ///< double
88a07af7 347 SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
a96b68b7
FB
348};
349
0d72e7d0 350/* Audio channel masks */
9d9b9d32
351#define CH_FRONT_LEFT 0x00000001
352#define CH_FRONT_RIGHT 0x00000002
353#define CH_FRONT_CENTER 0x00000004
354#define CH_LOW_FREQUENCY 0x00000008
355#define CH_BACK_LEFT 0x00000010
356#define CH_BACK_RIGHT 0x00000020
357#define CH_FRONT_LEFT_OF_CENTER 0x00000040
358#define CH_FRONT_RIGHT_OF_CENTER 0x00000080
359#define CH_BACK_CENTER 0x00000100
360#define CH_SIDE_LEFT 0x00000200
361#define CH_SIDE_RIGHT 0x00000400
362#define CH_TOP_CENTER 0x00000800
363#define CH_TOP_FRONT_LEFT 0x00001000
364#define CH_TOP_FRONT_CENTER 0x00002000
365#define CH_TOP_FRONT_RIGHT 0x00004000
366#define CH_TOP_BACK_LEFT 0x00008000
367#define CH_TOP_BACK_CENTER 0x00010000
368#define CH_TOP_BACK_RIGHT 0x00020000
369#define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
370#define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT.
0d72e7d0
PR
371
372/* Audio channel convenience macros */
9d9b9d32
373#define CH_LAYOUT_MONO (CH_FRONT_CENTER)
374#define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
375#define CH_LAYOUT_SURROUND (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
376#define CH_LAYOUT_QUAD (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
377#define CH_LAYOUT_5POINT0 (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
378#define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
379#define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
380#define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_SURROUND|CH_LOW_FREQUENCY|\
381 CH_BACK_LEFT|CH_BACK_RIGHT|\
382 CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
383#define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT)
0d72e7d0 384
de6d9b64 385/* in bytes */
8170e5fb 386#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
de6d9b64 387
d7425f59 388/**
cf713bb8 389 * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
f5bccd85
DB
390 * This is mainly needed because some optimized bitstream readers read
391 * 32 or 64 bit at once and could read over the end.<br>
392 * Note: If the first 23 bits of the additional bytes are not 0, then damaged
393 * MPEG bitstreams could cause overread and segfault.
d7425f59
MN
394 */
395#define FF_INPUT_BUFFER_PADDING_SIZE 8
396
0ecca7a4 397/**
f5bccd85
DB
398 * minimum encoding buffer size
399 * Used to avoid some checks during header writing.
0ecca7a4
MN
400 */
401#define FF_MIN_BUFFER_SIZE 16384
402
47146dfb 403
0e373b95 404/**
bafc102b 405 * motion estimation type.
0e373b95 406 */
e4986da9 407enum Motion_Est_ID {
9b4dd1b8 408 ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed
e4986da9
J
409 ME_FULL,
410 ME_LOG,
411 ME_PHODS,
9b4dd1b8
MN
412 ME_EPZS, ///< enhanced predictive zonal search
413 ME_X1, ///< reserved for experiments
414 ME_HEX, ///< hexagon based search
415 ME_UMH, ///< uneven multi-hexagon search
416 ME_ITER, ///< iterative search
359bbdab 417 ME_TESA, ///< transformed exhaustive search algorithm
e4986da9
J
418};
419
8c3eba7c 420enum AVDiscard{
f5bccd85
DB
421 /* We leave some space between them for extensions (drop some
422 * keyframes for intra-only or drop just some bidir frames). */
8c3eba7c
MN
423 AVDISCARD_NONE =-16, ///< discard nothing
424 AVDISCARD_DEFAULT= 0, ///< discard useless packets like 0 size packets in avi
425 AVDISCARD_NONREF = 8, ///< discard all non reference
426 AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
427 AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
428 AVDISCARD_ALL = 48, ///< discard all
429};
430
ce980a95
MN
431typedef struct RcOverride{
432 int start_frame;
433 int end_frame;
f5bccd85 434 int qscale; // If this is 0 then quality_factor will be used instead.
ce980a95
MN
435 float quality_factor;
436} RcOverride;
437
b0ec9efd 438#define FF_MAX_B_FRAMES 16
9dbcbd92 439
a949d72e 440/* encoding support
f5bccd85
DB
441 These flags can be passed in AVCodecContext.flags before initialization.
442 Note: Not everything is supported yet.
a949d72e 443*/
de6d9b64 444
f5bccd85
DB
445#define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
446#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
447#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
448#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
449#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
450#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
1ba8f5eb
MN
451/**
452 * The parent program guarantees that the input for B-frames containing
f5bccd85 453 * streams is not written to for at least s->max_b_frames+1 frames, if
1ba8f5eb
MN
454 * this is not set the input will be copied.
455 */
8b4c7dbc 456#define CODEC_FLAG_INPUT_PRESERVED 0x0100
273b0cd3
DB
457#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
458#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
459#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
460#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
461#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
462#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
463#define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
464 location instead of only at frame boundaries. */
f5bccd85
DB
465#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
466#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
467#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
468#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
f5bccd85
DB
469#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
470#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
21e59552 471/* Fx : Flag for h263+ extra options */
f5bccd85
DB
472#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
473#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
474#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
475#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
476#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
332f9ac4
MN
477#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
478#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
bb198e19
MN
479#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
480#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
f5bccd85 481#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
f3eec1cf 482#define CODEC_FLAG_CLOSED_GOP 0x80000000
f5bccd85
DB
483#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
484#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
485#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
486#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
487#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references.
488#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames
d3075ed5 489#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
58f7833e
RS
490#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform
491#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
492#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
f5bccd85
DB
493#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization
494#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
495#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
496#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
497#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
498#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
499#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
f1618fd9 500#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
6fc5b059 501
21e59552 502/* Unsupported options :
bb270c08
DB
503 * Syntax Arithmetic coding (SAC)
504 * Reference Picture Selection
eafcac6a 505 * Independent Segment Decoding */
21e59552 506/* /Fx */
bf89e6b1
FB
507/* codec capabilities */
508
f5bccd85 509#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
6814a25c
MN
510/**
511 * Codec uses get_buffer() for allocating buffers.
512 * direct rendering method 1
513 */
514#define CODEC_CAP_DR1 0x0002
f5bccd85 515/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
917e06c8 516#define CODEC_CAP_PARSE_ONLY 0x0004
d7425f59 517#define CODEC_CAP_TRUNCATED 0x0008
f5bccd85 518/* Codec can export data for HW decoding (XvMC). */
5e5c247a 519#define CODEC_CAP_HWACCEL 0x0010
115329f1 520/**
f5bccd85
DB
521 * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
522 * If this is not set, the codec is guaranteed to never be fed with NULL data.
934982c4 523 */
6f824977 524#define CODEC_CAP_DELAY 0x0020
cef7cc72
JR
525/**
526 * Codec can be fed a final frame with a smaller size.
527 * This can be used to prevent truncation of the last audio samples.
528 */
529#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
bf89e6b1 530
f5bccd85 531//The following defines may change, don't expect compatibility if you use them.
8d7ec294 532#define MB_TYPE_INTRA4x4 0x0001
f5bccd85
DB
533#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
534#define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
8d7ec294
WH
535#define MB_TYPE_16x16 0x0008
536#define MB_TYPE_16x8 0x0010
537#define MB_TYPE_8x16 0x0020
538#define MB_TYPE_8x8 0x0040
539#define MB_TYPE_INTERLACED 0x0080
273b0cd3 540#define MB_TYPE_DIRECT2 0x0100 //FIXME
8d7ec294
WH
541#define MB_TYPE_ACPRED 0x0200
542#define MB_TYPE_GMC 0x0400
543#define MB_TYPE_SKIP 0x0800
544#define MB_TYPE_P0L0 0x1000
545#define MB_TYPE_P1L0 0x2000
546#define MB_TYPE_P0L1 0x4000
547#define MB_TYPE_P1L1 0x8000
548#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
549#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
550#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
551#define MB_TYPE_QUANT 0x00010000
552#define MB_TYPE_CBP 0x00020000
553//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
554
fa384dcc
MN
555/**
556 * Pan Scan area.
f5bccd85
DB
557 * This specifies the area which should be displayed.
558 * Note there may be multiple such areas for one frame.
fa384dcc
MN
559 */
560typedef struct AVPanScan{
561 /**
f5bccd85
DB
562 * id
563 * - encoding: Set by user.
564 * - decoding: Set by libavcodec.
fa384dcc
MN
565 */
566 int id;
567
568 /**
569 * width and height in 1/16 pel
f5bccd85
DB
570 * - encoding: Set by user.
571 * - decoding: Set by libavcodec.
fa384dcc
MN
572 */
573 int width;
574 int height;
575
576 /**
f5bccd85
DB
577 * position of the top left corner in 1/16 pel for up to 3 fields/frames
578 * - encoding: Set by user.
579 * - decoding: Set by libavcodec.
fa384dcc
MN
580 */
581 int16_t position[3][2];
582}AVPanScan;
583
492cd3a9 584#define FF_COMMON_FRAME \
b536d0aa
MN
585 /**\
586 * pointer to the picture planes.\
f5bccd85 587 * This might be different from the first allocated byte\
b536d0aa
MN
588 * - encoding: \
589 * - decoding: \
590 */\
1e491e29
MN
591 uint8_t *data[4];\
592 int linesize[4];\
593 /**\
f5bccd85
DB
594 * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
595 * This isn't used by libavcodec unless the default get/release_buffer() is used.\
64863965
MN
596 * - encoding: \
597 * - decoding: \
1e491e29
MN
598 */\
599 uint8_t *base[4];\
600 /**\
601 * 1 -> keyframe, 0-> not\
f5bccd85
DB
602 * - encoding: Set by libavcodec.\
603 * - decoding: Set by libavcodec.\
1e491e29
MN
604 */\
605 int key_frame;\
606\
607 /**\
f5bccd85
DB
608 * Picture type of the frame, see ?_TYPE below.\
609 * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
610 * - decoding: Set by libavcodec.\
1e491e29
MN
611 */\
612 int pict_type;\
613\
614 /**\
c0df9d75 615 * presentation timestamp in time_base units (time when frame should be shown to user)\
f5bccd85
DB
616 * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
617 * - encoding: MUST be set by user.\
618 * - decoding: Set by libavcodec.\
1e491e29 619 */\
be6784dc 620 int64_t pts;\
1e491e29
MN
621\
622 /**\
f5bccd85 623 * picture number in bitstream order\
64863965 624 * - encoding: set by\
f5bccd85 625 * - decoding: Set by libavcodec.\
1e491e29
MN
626 */\
627 int coded_picture_number;\
628 /**\
f5bccd85 629 * picture number in display order\
64863965 630 * - encoding: set by\
f5bccd85 631 * - decoding: Set by libavcodec.\
1e491e29
MN
632 */\
633 int display_picture_number;\
634\
635 /**\
158c7f05 636 * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
f5bccd85
DB
637 * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
638 * - decoding: Set by libavcodec.\
1e491e29 639 */\
158c7f05 640 int quality; \
1e491e29
MN
641\
642 /**\
643 * buffer age (1->was last buffer and dint change, 2->..., ...).\
f5bccd85 644 * Set to INT_MAX if the buffer has not been used yet.\
64863965 645 * - encoding: unused\
f5bccd85 646 * - decoding: MUST be set by get_buffer().\
1e491e29
MN
647 */\
648 int age;\
649\
650 /**\
651 * is this picture used as reference\
8474f58e
MN
652 * The values for this are the same as the MpegEncContext.picture_structure\
653 * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
64863965 654 * - encoding: unused\
f5bccd85 655 * - decoding: Set by libavcodec. (before get_buffer() call)).\
1e491e29
MN
656 */\
657 int reference;\
658\
659 /**\
660 * QP table\
64863965 661 * - encoding: unused\
f5bccd85 662 * - decoding: Set by libavcodec.\
1e491e29
MN
663 */\
664 int8_t *qscale_table;\
665 /**\
666 * QP store stride\
64863965 667 * - encoding: unused\
f5bccd85 668 * - decoding: Set by libavcodec.\
1e491e29
MN
669 */\
670 int qstride;\
671\
672 /**\
f5bccd85 673 * mbskip_table[mb]>=1 if MB didn't change\
1e491e29 674 * stride= mb_width = (width+15)>>4\
64863965 675 * - encoding: unused\
f5bccd85 676 * - decoding: Set by libavcodec.\
1e491e29
MN
677 */\
678 uint8_t *mbskip_table;\
679\
680 /**\
f5bccd85 681 * motion vector table\
61436073
MN
682 * @code\
683 * example:\
684 * int mv_sample_log2= 4 - motion_subsample_log2;\
685 * int mb_width= (width+15)>>4;\
686 * int mv_stride= (mb_width << mv_sample_log2) + 1;\
687 * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
688 * @endcode\
f5bccd85
DB
689 * - encoding: Set by user.\
690 * - decoding: Set by libavcodec.\
8d7ec294
WH
691 */\
692 int16_t (*motion_val[2])[2];\
693\
694 /**\
f5bccd85 695 * macroblock type table\
8d7ec294 696 * mb_type_base + mb_width + 2\
f5bccd85
DB
697 * - encoding: Set by user.\
698 * - decoding: Set by libavcodec.\
8d7ec294
WH
699 */\
700 uint32_t *mb_type;\
701\
702 /**\
f0b77c69
MN
703 * log2 of the size of the block which a single vector in motion_val represents: \
704 * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
8d7ec294 705 * - encoding: unused\
f5bccd85 706 * - decoding: Set by libavcodec.\
8d7ec294
WH
707 */\
708 uint8_t motion_subsample_log2;\
709\
710 /**\
1e491e29 711 * for some private data of the user\
64863965 712 * - encoding: unused\
f5bccd85 713 * - decoding: Set by user.\
1e491e29
MN
714 */\
715 void *opaque;\
140cb663
MN
716\
717 /**\
718 * error\
f5bccd85 719 * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
64863965 720 * - decoding: unused\
140cb663
MN
721 */\
722 uint64_t error[4];\
4e00e76b
MN
723\
724 /**\
f5bccd85
DB
725 * type of the buffer (to keep track of who has to deallocate data[*])\
726 * - encoding: Set by the one who allocates it.\
727 * - decoding: Set by the one who allocates it.\
728 * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
4e00e76b
MN
729 */\
730 int type;\
2ec23b6d
MN
731 \
732 /**\
f5bccd85 733 * When decoding, this signals how much the picture must be delayed.\
2ec23b6d 734 * extra_delay = repeat_pict / (2*fps)\
64863965 735 * - encoding: unused\
f5bccd85 736 * - decoding: Set by libavcodec.\
2ec23b6d 737 */\
0426af31
MN
738 int repeat_pict;\
739 \
740 /**\
741 * \
742 */\
743 int qscale_type;\
2744ca9a
RS
744 \
745 /**\
746 * The content of the picture is interlaced.\
f5bccd85
DB
747 * - encoding: Set by user.\
748 * - decoding: Set by libavcodec. (default 0)\
2744ca9a
RS
749 */\
750 int interlaced_frame;\
751 \
752 /**\
f5bccd85
DB
753 * If the content is interlaced, is top field displayed first.\
754 * - encoding: Set by user.\
755 * - decoding: Set by libavcodec.\
2744ca9a 756 */\
9dad924e 757 int top_field_first;\
fa384dcc
MN
758 \
759 /**\
760 * Pan scan.\
f5bccd85
DB
761 * - encoding: Set by user.\
762 * - decoding: Set by libavcodec.\
fa384dcc
MN
763 */\
764 AVPanScan *pan_scan;\
2a2bbcb0
MM
765 \
766 /**\
f5bccd85 767 * Tell user application that palette has changed from previous frame.\
2a2bbcb0 768 * - encoding: ??? (no palette-enabled encoder yet)\
f5bccd85 769 * - decoding: Set by libavcodec. (default 0).\
2a2bbcb0
MM
770 */\
771 int palette_has_changed;\
074c4ca7
RT
772 \
773 /**\
f5bccd85 774 * codec suggestion on buffer type if != 0\
074c4ca7 775 * - encoding: unused\
f5bccd85 776 * - decoding: Set by libavcodec. (before get_buffer() call)).\
074c4ca7
RT
777 */\
778 int buffer_hints;\
8289c6fa
WH
779\
780 /**\
f5bccd85 781 * DCT coefficients\
8289c6fa 782 * - encoding: unused\
f5bccd85 783 * - decoding: Set by libavcodec.\
8289c6fa
WH
784 */\
785 short *dct_coeff;\
a4d36c11
MN
786\
787 /**\
f5bccd85
DB
788 * motion referece frame index\
789 * - encoding: Set by user.\
790 * - decoding: Set by libavcodec.\
a4d36c11 791 */\
79de84f2
MN
792 int8_t *ref_index[2];\
793\
794 /**\
795 * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque\
796 * output in AVFrame.reordered_opaque\
797 * - encoding: unused\
798 * - decoding: Read by user.\
799 */\
800 int64_t reordered_opaque;\
801
2ec23b6d 802
bb270c08
DB
803#define FF_QSCALE_TYPE_MPEG1 0
804#define FF_QSCALE_TYPE_MPEG2 1
805#define FF_QSCALE_TYPE_H264 2
4e00e76b
MN
806
807#define FF_BUFFER_TYPE_INTERNAL 1
f5bccd85
DB
808#define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user)
809#define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
810#define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
4e00e76b 811
1e491e29 812
dc85e859
AJ
813#define FF_I_TYPE 1 ///< Intra
814#define FF_P_TYPE 2 ///< Predicted
815#define FF_B_TYPE 3 ///< Bi-dir predicted
816#define FF_S_TYPE 4 ///< S(GMC)-VOP MPEG4
817#define FF_SI_TYPE 5 ///< Switching Intra
818#define FF_SP_TYPE 6 ///< Switching Predicted
48d533e6 819#define FF_BI_TYPE 7
1e491e29 820
f5bccd85
DB
821#define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
822#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
823#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
824#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
074c4ca7 825
0da71265
MN
826/**
827 * Audio Video Frame.
ba66ae94
MN
828 * New fields can be added to the end of FF_COMMON_FRAME with minor version
829 * bumps.
8bfb108b 830 * Removal, reordering and changes to existing fields require a major
ba66ae94
MN
831 * version bump. No fields should be added into AVFrame before or after
832 * FF_COMMON_FRAME!
8bfb108b 833 * sizeof(AVFrame) must not be used outside libav*.
0da71265 834 */
492cd3a9
MN
835typedef struct AVFrame {
836 FF_COMMON_FRAME
837} AVFrame;
1e491e29 838
d33c949c 839/**
252f17e2
MN
840 * main external API structure.
841 * New fields can be added to the end with minor version bumps.
8bfb108b 842 * Removal, reordering and changes to existing fields require a major
252f17e2 843 * version bump.
8bfb108b 844 * sizeof(AVCodecContext) must not be used outside libav*.
d33c949c 845 */
de6d9b64 846typedef struct AVCodecContext {
b71901e6 847 /**
f5bccd85 848 * information on struct for av_log
bc874dae
MB
849 * - set by avcodec_alloc_context
850 */
d42a814e 851 const AVClass *av_class;
bc874dae 852 /**
f5bccd85
DB
853 * the average bitrate
854 * - encoding: Set by user; unused for constant quantizer encoding.
855 * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
b71901e6 856 */
de6d9b64 857 int bit_rate;
b71901e6
MN
858
859 /**
64863965 860 * number of bits the bitstream is allowed to diverge from the reference.
b71901e6 861 * the reference can be CBR (for CBR pass1) or VBR (for pass2)
f5bccd85 862 * - encoding: Set by user; unused for constant quantizer encoding.
64863965 863 * - decoding: unused
b71901e6 864 */
115329f1 865 int bit_rate_tolerance;
b71901e6
MN
866
867 /**
64863965 868 * CODEC_FLAG_*.
f5bccd85
DB
869 * - encoding: Set by user.
870 * - decoding: Set by user.
b71901e6 871 */
de6d9b64 872 int flags;
b71901e6
MN
873
874 /**
f5bccd85
DB
875 * Some codecs need additional format info. It is stored here.
876 * If any muxer uses this then ALL demuxers/parsers AND encoders for the
877 * specific codec MUST set it correctly otherwise stream copy breaks.
878 * In general use of this field by muxers is not recommanded.
879 * - encoding: Set by libavcodec.
880 * - decoding: Set by libavcodec. (FIXME: Is this OK?)
b71901e6
MN
881 */
882 int sub_id;
883
884 /**
f5bccd85 885 * Motion estimation algorithm used for video coding.
58f7833e 886 * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
89223ef6 887 * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
64863965
MN
888 * - encoding: MUST be set by user.
889 * - decoding: unused
b71901e6
MN
890 */
891 int me_method;
892
893 /**
f5bccd85
DB
894 * some codecs need / can use extradata like Huffman tables.
895 * mjpeg: Huffman tables
b71901e6 896 * rv10: additional flags
b704e742 897 * mpeg4: global headers (they can be in the bitstream or here)
f5bccd85
DB
898 * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
899 * than extradata_size to avoid prolems if it is read with the bitstream reader.
900 * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
901 * - encoding: Set/allocated/freed by libavcodec.
902 * - decoding: Set/allocated/freed by user.
b71901e6 903 */
58f2a4b0 904 uint8_t *extradata;
e84c31dc 905 int extradata_size;
115329f1 906
b71901e6 907 /**
f5bccd85
DB
908 * This is the fundamental unit of time (in seconds) in terms
909 * of which frame timestamps are represented. For fixed-fps content,
5b28c8c3
MN
910 * timebase should be 1/framerate and timestamp increments should be
911 * identically 1.
f5bccd85
DB
912 * - encoding: MUST be set by user.
913 * - decoding: Set by libavcodec.
b71901e6 914 */
c0df9d75 915 AVRational time_base;
115329f1 916
5b28c8c3 917 /* video only */
14bea432 918 /**
21adafec 919 * picture width / height.
115329f1 920 * - encoding: MUST be set by user.
f5bccd85
DB
921 * - decoding: Set by libavcodec.
922 * Note: For compatibility it is possible to set this instead of
923 * coded_width/height before decoding.
b71901e6 924 */
de6d9b64 925 int width, height;
115329f1 926
e769f053 927#define FF_ASPECT_EXTENDED 15
b71901e6
MN
928
929 /**
f5bccd85
DB
930 * the number of pictures in a group of pictures, or 0 for intra_only
931 * - encoding: Set by user.
64863965 932 * - decoding: unused
b71901e6
MN
933 */
934 int gop_size;
935
936 /**
f5bccd85
DB
937 * Pixel format, see PIX_FMT_xxx.
938 * - encoding: Set by user.
939 * - decoding: Set by libavcodec.
b71901e6 940 */
e4eadb4b 941 enum PixelFormat pix_fmt;
115329f1 942
bdfcbbed 943 /**
f5bccd85 944 * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
bdfcbbed 945 * has to read frames at native frame rate.
f5bccd85
DB
946 * - encoding: Set by user.
947 * - decoding: unused
bdfcbbed
MK
948 */
949 int rate_emu;
115329f1 950
b71901e6 951 /**
f5bccd85
DB
952 * If non NULL, 'draw_horiz_band' is called by the libavcodec
953 * decoder to draw a horizontal band. It improves cache usage. Not
b71901e6 954 * all codecs can do that. You must check the codec capabilities
f5bccd85 955 * beforehand.
64863965 956 * - encoding: unused
f5bccd85 957 * - decoding: Set by user.
3bb07d61
MN
958 * @param height the height of the slice
959 * @param y the y position of the slice
960 * @param type 1->top field, 2->bottom field, 3->frame
961 * @param offset offset into the AVFrame.data from which the slice should be read
b71901e6 962 */
bf89e6b1 963 void (*draw_horiz_band)(struct AVCodecContext *s,
da64ecc3 964 const AVFrame *src, int offset[4],
3bb07d61 965 int y, int type, int height);
bf89e6b1 966
de6d9b64 967 /* audio only */
f5bccd85 968 int sample_rate; ///< samples per second
5fcc4a23 969 int channels; ///< number of audio channels
a3a5f4d6
MN
970
971 /**
f5bccd85
DB
972 * audio sample format
973 * - encoding: Set by user.
974 * - decoding: Set by libavcodec.
a3a5f4d6 975 */
f5bccd85 976 enum SampleFormat sample_fmt; ///< sample format, currently unused
de6d9b64 977
f5bccd85 978 /* The following data should not be initialized. */
718b27a7 979 /**
f5bccd85 980 * Samples per packet, initialized when calling 'init'.
718b27a7
MN
981 */
982 int frame_size;
115329f1 983 int frame_number; ///< audio or video frame number
f5bccd85 984 int real_pict_num; ///< Returns the real picture number of previous encoded frame.
115329f1 985
b71901e6 986 /**
f5bccd85 987 * Number of frames the decoded output will be delayed relative to
64863965 988 * the encoded input.
f5bccd85 989 * - encoding: Set by libavcodec.
64863965 990 * - decoding: unused
b71901e6
MN
991 */
992 int delay;
115329f1 993
64863965
MN
994 /* - encoding parameters */
995 float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
115329f1
DB
996 float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
997
b71901e6 998 /**
f5bccd85
DB
999 * minimum quantizer
1000 * - encoding: Set by user.
64863965 1001 * - decoding: unused
b71901e6
MN
1002 */
1003 int qmin;
1004
1005 /**
f5bccd85
DB
1006 * maximum quantizer
1007 * - encoding: Set by user.
64863965 1008 * - decoding: unused
b71901e6
MN
1009 */
1010 int qmax;
1011
1012 /**
f5bccd85
DB
1013 * maximum quantizer difference between frames
1014 * - encoding: Set by user.
64863965 1015 * - decoding: unused
b71901e6
MN
1016 */
1017 int max_qdiff;
1018
1019 /**
f5bccd85
DB
1020 * maximum number of B-frames between non-B-frames
1021 * Note: The output will be delayed by max_b_frames+1 relative to the input.
1022 * - encoding: Set by user.
64863965 1023 * - decoding: unused
b71901e6
MN
1024 */
1025 int max_b_frames;
1026
1027 /**
f5bccd85 1028 * qscale factor between IP and B-frames
662e5411 1029 * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
1030 * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
f5bccd85 1031 * - encoding: Set by user.
64863965 1032 * - decoding: unused
b71901e6
MN
1033 */
1034 float b_quant_factor;
115329f1 1035
b71901e6
MN
1036 /** obsolete FIXME remove */
1037 int rc_strategy;
64b7c5b6
MN
1038#define FF_RC_STRATEGY_XVID 1
1039
8b4c7dbc 1040 int b_frame_strategy;
9dbcbd92 1041
b71901e6 1042 /**
f5bccd85 1043 * hurry up amount
64863965 1044 * - encoding: unused
f5bccd85 1045 * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
f9ec0aa1 1046 * @deprecated Deprecated in favor of skip_idct and skip_frame.
b71901e6
MN
1047 */
1048 int hurry_up;
115329f1 1049
de6d9b64 1050 struct AVCodec *codec;
115329f1 1051
de6d9b64
FB
1052 void *priv_data;
1053
bb628dae 1054 int rtp_payload_size; /* The size of the RTP payload: the coder will */
f5bccd85 1055 /* do its best to deliver a chunk with size */
644d98a4 1056 /* below rtp_payload_size, the chunk will start */
f5bccd85 1057 /* with a start code on some codecs like H.263. */
644d98a4 1058 /* This doesn't take account of any particular */
f5bccd85 1059 /* headers inside the transmitted RTP payload. */
81401c1f 1060
115329f1 1061
f5bccd85
DB
1062 /* The RTP callback: This function is called */
1063 /* every time the encoder has a packet to send. */
1064 /* It depends on the encoder if the data starts */
1065 /* with a Start Code (it should). H.263 does. */
1066 /* mb_nb contains the number of macroblocks */
1067 /* encoded in the RTP payload. */
115329f1 1068 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
81401c1f 1069
098eefe1
MN
1070 /* statistics, used for 2-pass encoding */
1071 int mv_bits;
1072 int header_bits;
1073 int i_tex_bits;
1074 int p_tex_bits;
1075 int i_count;
1076 int p_count;
1077 int skip_count;
b71901e6 1078 int misc_bits;
115329f1 1079
b71901e6 1080 /**
f5bccd85
DB
1081 * number of bits used for the previously encoded frame
1082 * - encoding: Set by libavcodec.
7004ffb3 1083 * - decoding: unused
b71901e6 1084 */
098eefe1 1085 int frame_bits;
7004ffb3 1086
b71901e6 1087 /**
f5bccd85
DB
1088 * Private data of the user, can be used to carry app specific stuff.
1089 * - encoding: Set by user.
1090 * - decoding: Set by user.
b71901e6
MN
1091 */
1092 void *opaque;
1093
de6d9b64 1094 char codec_name[32];
4a663d80
PG
1095 enum CodecType codec_type; /* see CODEC_TYPE_xxx */
1096 enum CodecID codec_id; /* see CODEC_ID_xxx */
115329f1 1097
7004ffb3
MN
1098 /**
1099 * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
f5bccd85
DB
1100 * This is used to work around some encoder bugs.
1101 * A demuxer should set this to what is stored in the field used to identify the codec.
1102 * If there are multiple such fields in a container then the demuxer should choose the one
1103 * which maximizes the information about the used codec.
1104 * If the codec tag field in a container is larger then 32 bits then the demuxer should
1105 * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
47bbf8a7 1106 * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
f5bccd85
DB
1107 * first.
1108 * - encoding: Set by user, if not then the default based on codec_id will be used.
1109 * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
7004ffb3
MN
1110 */
1111 unsigned int codec_tag;
115329f1 1112
b71901e6 1113 /**
f5bccd85
DB
1114 * Work around bugs in encoders which sometimes cannot be detected automatically.
1115 * - encoding: Set by user
1116 * - decoding: Set by user
b71901e6
MN
1117 */
1118 int workaround_bugs;
64863965 1119#define FF_BUG_AUTODETECT 1 ///< autodetection
4d2858de
MN
1120#define FF_BUG_OLD_MSMPEG4 2
1121#define FF_BUG_XVID_ILACE 4
1122#define FF_BUG_UMP4 8
1123#define FF_BUG_NO_PADDING 16
3116cb14 1124#define FF_BUG_AMV 32
f5bccd85 1125#define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default.
03e93d35 1126#define FF_BUG_QPEL_CHROMA 64
db794953 1127#define FF_BUG_STD_QPEL 128
36df8805 1128#define FF_BUG_QPEL_CHROMA2 256
c40c3482 1129#define FF_BUG_DIRECT_BLOCKSIZE 512
1c6dcb0f 1130#define FF_BUG_EDGE 1024
b44bdf7e 1131#define FF_BUG_HPEL_CHROMA 2048
4ccde216 1132#define FF_BUG_DC_CLIP 4096
f5bccd85
DB
1133#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
1134//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
115329f1 1135
b71901e6 1136 /**
f5bccd85
DB
1137 * luma single coefficient elimination threshold
1138 * - encoding: Set by user.
64863965 1139 * - decoding: unused
b71901e6 1140 */
1f6b6e50 1141 int luma_elim_threshold;
115329f1 1142
b71901e6 1143 /**
f5bccd85
DB
1144 * chroma single coeff elimination threshold
1145 * - encoding: Set by user.
64863965 1146 * - decoding: unused
b71901e6 1147 */
1f6b6e50 1148 int chroma_elim_threshold;
115329f1 1149
b71901e6 1150 /**
f5bccd85
DB
1151 * strictly follow the standard (MPEG4, ...).
1152 * - encoding: Set by user.
5771b2c3
MN
1153 * - decoding: Set by user.
1154 * Setting this to STRICT or higher means the encoder and decoder will
1155 * generally do stupid things. While setting it to inofficial or lower
1156 * will mean the encoder might use things that are not supported by all
1157 * spec compliant decoders. Decoders make no difference between normal,
1158 * inofficial and experimental, that is they always try to decode things
1159 * when they can unless they are explicitly asked to behave stupid
1160 * (=strictly conform to the specs)
b71901e6
MN
1161 */
1162 int strict_std_compliance;
f5bccd85
DB
1163#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to a older more strict version of the spec or reference software.
1164#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
9cd81798 1165#define FF_COMPLIANCE_NORMAL 0
f5bccd85
DB
1166#define FF_COMPLIANCE_INOFFICIAL -1 ///< Allow inofficial extensions.
1167#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
9cd81798 1168
b71901e6 1169 /**
f5bccd85 1170 * qscale offset between IP and B-frames
f5bccd85 1171 * - encoding: Set by user.
64863965 1172 * - decoding: unused
b71901e6
MN
1173 */
1174 float b_quant_offset;
115329f1 1175
b71901e6 1176 /**
047599a4 1177 * Error recognization; higher values will detect more errors but may
f5bccd85 1178 * misdetect some more or less valid parts as errors.
64863965 1179 * - encoding: unused
f5bccd85 1180 * - decoding: Set by user.
b71901e6 1181 */
047599a4 1182 int error_recognition;
1471c6c2 1183#define FF_ER_CAREFUL 1
ce3bcaed
MN
1184#define FF_ER_COMPLIANT 2
1185#define FF_ER_AGGRESSIVE 3
1186#define FF_ER_VERY_AGGRESSIVE 4
115329f1 1187
6b72ac63 1188 /**
f5bccd85
DB
1189 * Called at the beginning of each frame to get a buffer for it.
1190 * If pic.reference is set then the frame will be read later by libavcodec.
2b5296d2 1191 * avcodec_align_dimensions() should be used to find the required width and
f5bccd85 1192 * height, as they normally need to be rounded up to the next multiple of 16.
64863965 1193 * - encoding: unused
f5bccd85 1194 * - decoding: Set by libavcodec., user can override.
b71901e6 1195 */
492cd3a9 1196 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
115329f1 1197
b71901e6 1198 /**
69b192ac 1199 * Called to release buffers which were allocated with get_buffer.
f5bccd85
DB
1200 * A released buffer can be reused in get_buffer().
1201 * pic.data[*] must be set to NULL.
64863965 1202 * - encoding: unused
f5bccd85 1203 * - decoding: Set by libavcodec., user can override.
b71901e6 1204 */
492cd3a9 1205 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
0fd90455 1206
b71901e6 1207 /**
f5bccd85
DB
1208 * If 1 the stream has a 1 frame delay during decoding.
1209 * - encoding: Set by libavcodec.
1210 * - decoding: Set by libavcodec.
b71901e6
MN
1211 */
1212 int has_b_frames;
718b27a7
MN
1213
1214 /**
1215 * number of bytes per packet if constant and known or 0
f5bccd85 1216 * Used by some WAV based audio codecs.
718b27a7
MN
1217 */
1218 int block_align;
115329f1 1219
f5bccd85 1220 int parse_only; /* - decoding only: If true, only parsing is done
917e06c8
FB
1221 (function avcodec_parse_frame()). The frame
1222 data is returned. Only MPEG codecs support this now. */
115329f1 1223
b71901e6 1224 /**
f5bccd85
DB
1225 * 0-> h263 quant 1-> mpeg quant
1226 * - encoding: Set by user.
64863965 1227 * - decoding: unused
b71901e6
MN
1228 */
1229 int mpeg_quant;
115329f1 1230
b71901e6 1231 /**
f5bccd85
DB
1232 * pass1 encoding statistics output buffer
1233 * - encoding: Set by libavcodec.
64863965 1234 * - decoding: unused
b71901e6 1235 */
64863965 1236 char *stats_out;
115329f1 1237
b71901e6 1238 /**
f5bccd85
DB
1239 * pass2 encoding statistics input buffer
1240 * Concatenated stuff from stats_out of pass1 should be placed here.
1241 * - encoding: Allocated/set/freed by user.
64863965 1242 * - decoding: unused
b71901e6
MN
1243 */
1244 char *stats_in;
115329f1 1245
b71901e6 1246 /**
f5bccd85
DB
1247 * ratecontrol qmin qmax limiting method
1248 * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
1249 * - encoding: Set by user.
64863965 1250 * - decoding: unused
b71901e6 1251 */
ce980a95 1252 float rc_qsquish;
b71901e6 1253
ce980a95
MN
1254 float rc_qmod_amp;
1255 int rc_qmod_freq;
115329f1 1256
b71901e6 1257 /**
f5bccd85
DB
1258 * ratecontrol override, see RcOverride
1259 * - encoding: Allocated/set/freed by user.
64863965 1260 * - decoding: unused
b71901e6 1261 */
ce980a95
MN
1262 RcOverride *rc_override;
1263 int rc_override_count;
115329f1 1264
b71901e6 1265 /**
f5bccd85
DB
1266 * rate control equation
1267 * - encoding: Set by user
64863965 1268 * - decoding: unused
b71901e6 1269 */
6881b8e5 1270 const char *rc_eq;
115329f1 1271
b71901e6 1272 /**
f5bccd85
DB
1273 * maximum bitrate
1274 * - encoding: Set by user.
64863965 1275 * - decoding: unused
b71901e6 1276 */
ce980a95 1277 int rc_max_rate;
115329f1 1278
b71901e6 1279 /**
f5bccd85
DB
1280 * minimum bitrate
1281 * - encoding: Set by user.
64863965 1282 * - decoding: unused
b71901e6 1283 */
ce980a95 1284 int rc_min_rate;
115329f1 1285
b71901e6 1286 /**
f5bccd85
DB
1287 * decoder bitstream buffer size
1288 * - encoding: Set by user.
64863965 1289 * - decoding: unused
b71901e6 1290 */
ce980a95
MN
1291 int rc_buffer_size;
1292 float rc_buffer_aggressivity;
b71901e6
MN
1293
1294 /**
f5bccd85
DB
1295 * qscale factor between P and I-frames
1296 * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
1297 * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
1298 * - encoding: Set by user.
64863965 1299 * - decoding: unused
b71901e6
MN
1300 */
1301 float i_quant_factor;
115329f1 1302
b71901e6 1303 /**
f5bccd85
DB
1304 * qscale offset between P and I-frames
1305 * - encoding: Set by user.
64863965 1306 * - decoding: unused
b71901e6
MN
1307 */
1308 float i_quant_offset;
115329f1 1309
b71901e6 1310 /**
f5bccd85
DB
1311 * initial complexity for pass1 ratecontrol
1312 * - encoding: Set by user.
64863965 1313 * - decoding: unused
b71901e6 1314 */
ce980a95 1315 float rc_initial_cplx;
917e06c8 1316
b71901e6 1317 /**
f5bccd85
DB
1318 * DCT algorithm, see FF_DCT_* below
1319 * - encoding: Set by user.
64863965 1320 * - decoding: unused
b71901e6 1321 */
28db7fce 1322 int dct_algo;
c7e07931 1323#define FF_DCT_AUTO 0
28db7fce 1324#define FF_DCT_FASTINT 1
c7e07931
MO
1325#define FF_DCT_INT 2
1326#define FF_DCT_MMX 3
1327#define FF_DCT_MLIB 4
05c4072b 1328#define FF_DCT_ALTIVEC 5
65e4c8c9 1329#define FF_DCT_FAAN 6
115329f1 1330
c5d309f2 1331 /**
f5bccd85
DB
1332 * luminance masking (0-> disabled)
1333 * - encoding: Set by user.
64863965 1334 * - decoding: unused
c5d309f2
MN
1335 */
1336 float lumi_masking;
115329f1 1337
c5d309f2 1338 /**
f5bccd85
DB
1339 * temporary complexity masking (0-> disabled)
1340 * - encoding: Set by user.
64863965 1341 * - decoding: unused
c5d309f2
MN
1342 */
1343 float temporal_cplx_masking;
115329f1 1344
c5d309f2 1345 /**
f5bccd85
DB
1346 * spatial complexity masking (0-> disabled)
1347 * - encoding: Set by user.
64863965 1348 * - decoding: unused
c5d309f2
MN
1349 */
1350 float spatial_cplx_masking;
115329f1 1351
c5d309f2 1352 /**
f5bccd85
DB
1353 * p block masking (0-> disabled)
1354 * - encoding: Set by user.
64863965 1355 * - decoding: unused
c5d309f2
MN
1356 */
1357 float p_masking;
15415af4 1358
5e746b99 1359 /**
f5bccd85
DB
1360 * darkness masking (0-> disabled)
1361 * - encoding: Set by user.
64863965 1362 * - decoding: unused
5e746b99
MN
1363 */
1364 float dark_masking;
115329f1 1365
0c2dd16e 1366 /**
f5bccd85
DB
1367 * IDCT algorithm, see FF_IDCT_* below.
1368 * - encoding: Set by user.
1369 * - decoding: Set by user.
2ad1516a
MN
1370 */
1371 int idct_algo;
273b0cd3
DB
1372#define FF_IDCT_AUTO 0
1373#define FF_IDCT_INT 1
1374#define FF_IDCT_SIMPLE 2
1375#define FF_IDCT_SIMPLEMMX 3
1376#define FF_IDCT_LIBMPEG2MMX 4
1377#define FF_IDCT_PS2 5
1378#define FF_IDCT_MLIB 6
1379#define FF_IDCT_ARM 7
1380#define FF_IDCT_ALTIVEC 8
1381#define FF_IDCT_SH4 9
1382#define FF_IDCT_SIMPLEARM 10
1383#define FF_IDCT_H264 11
1384#define FF_IDCT_VP3 12
1385#define FF_IDCT_IPP 13
1386#define FF_IDCT_XVIDMMX 14
1387#define FF_IDCT_CAVS 15
a0403006 1388#define FF_IDCT_SIMPLEARMV5TE 16
273b0cd3 1389#define FF_IDCT_SIMPLEARMV6 17
d9420d4d 1390#define FF_IDCT_SIMPLEVIS 18
9abc7e0f 1391#define FF_IDCT_WMV2 19
6f08c541 1392#define FF_IDCT_FAAN 20
42b30357 1393#define FF_IDCT_EA 21
7eec4328 1394#define FF_IDCT_SIMPLENEON 22
2ad1516a 1395
144f0625 1396 /**
f5bccd85
DB
1397 * slice count
1398 * - encoding: Set by libavcodec.
1399 * - decoding: Set by user (or 0).
144f0625
MN
1400 */
1401 int slice_count;
1402 /**
f5bccd85
DB
1403 * slice offsets in the frame in bytes
1404 * - encoding: Set/allocated by libavcodec.
1405 * - decoding: Set/allocated by user (or NULL).
144f0625
MN
1406 */
1407 int *slice_offset;
1408
4d2858de 1409 /**
f5bccd85 1410 * error concealment flags
64863965 1411 * - encoding: unused
f5bccd85 1412 * - decoding: Set by user.
4d2858de
MN
1413 */
1414 int error_concealment;
1415#define FF_EC_GUESS_MVS 1
1416#define FF_EC_DEBLOCK 2
1417
6b72ac63 1418 /**
bec89a84 1419 * dsp_mask could be add used to disable unwanted CPU features
8350df97 1420 * CPU features (i.e. MMX, SSE. ...)
bec89a84 1421 *
f5bccd85
DB
1422 * With the FORCE flag you may instead enable given CPU features.
1423 * (Dangerous: Usable in case of misdetection, improper usage however will
1424 * result into program crash.)
bec89a84
ZK
1425 */
1426 unsigned dsp_mask;
f5bccd85 1427#define FF_MM_FORCE 0x80000000 /* Force usage of selected flags (OR) */
bec89a84 1428 /* lower 16 bits - CPU features */
0cd60abf
MN
1429#define FF_MM_MMX 0x0001 ///< standard MMX
1430#define FF_MM_3DNOW 0x0004 ///< AMD 3DNOW
1431#define FF_MM_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
1432#define FF_MM_SSE 0x0008 ///< SSE functions
1433#define FF_MM_SSE2 0x0010 ///< PIV SSE2 functions
1434#define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt
1435#define FF_MM_SSE3 0x0040 ///< Prescott SSE3 functions
1436#define FF_MM_SSSE3 0x0080 ///< Conroe SSSE3 functions
1437#define FF_MM_IWMMXT 0x0100 ///< XScale IWMMXT
82d1605f 1438#define FF_MM_ALTIVEC 0x0001 ///< standard AltiVec
11f18faf
MN
1439
1440 /**
64863965 1441 * bits per sample/pixel from the demuxer (needed for huffyuv).
f5bccd85
DB
1442 * - encoding: Set by libavcodec.
1443 * - decoding: Set by user.
11f18faf 1444 */
46a73068 1445 int bits_per_coded_sample;
115329f1 1446
11f18faf 1447 /**
f5bccd85
DB
1448 * prediction method (needed for huffyuv)
1449 * - encoding: Set by user.
64863965 1450 * - decoding: unused
11f18faf
MN
1451 */
1452 int prediction_method;
1453#define FF_PRED_LEFT 0
1454#define FF_PRED_PLANE 1
1455#define FF_PRED_MEDIAN 2
115329f1 1456
5d3cea3a 1457 /**
f5bccd85 1458 * sample aspect ratio (0 if unknown)
8e5af7a6 1459 * That is the width of a pixel divided by the height of the pixel.
f5bccd85
DB
1460 * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
1461 * - encoding: Set by user.
1462 * - decoding: Set by libavcodec.
5d3cea3a 1463 */
5ff85f1d 1464 AVRational sample_aspect_ratio;
1e491e29
MN
1465
1466 /**
f5bccd85
DB
1467 * the picture in the bitstream
1468 * - encoding: Set by libavcodec.
1469 * - decoding: Set by libavcodec.
1e491e29 1470 */
492cd3a9 1471 AVFrame *coded_frame;
c8c437bc
MN
1472
1473 /**
f5bccd85
DB
1474 * debug
1475 * - encoding: Set by user.
1476 * - decoding: Set by user.
c8c437bc
MN
1477 */
1478 int debug;
273b0cd3
DB
1479#define FF_DEBUG_PICT_INFO 1
1480#define FF_DEBUG_RC 2
1481#define FF_DEBUG_BITSTREAM 4
1482#define FF_DEBUG_MB_TYPE 8
1483#define FF_DEBUG_QP 16
1484#define FF_DEBUG_MV 32
1485#define FF_DEBUG_DCT_COEFF 0x00000040
1486#define FF_DEBUG_SKIP 0x00000080
1487#define FF_DEBUG_STARTCODE 0x00000100
1488#define FF_DEBUG_PTS 0x00000200
1489#define FF_DEBUG_ER 0x00000400
1490#define FF_DEBUG_MMCO 0x00000800
1491#define FF_DEBUG_BUGS 0x00001000
1492#define FF_DEBUG_VIS_QP 0x00002000
864119b6 1493#define FF_DEBUG_VIS_MB_TYPE 0x00004000
385c820b 1494#define FF_DEBUG_BUFFERS 0x00008000
115329f1 1495
140cb663 1496 /**
f5bccd85
DB
1497 * debug
1498 * - encoding: Set by user.
1499 * - decoding: Set by user.
0c9bbaec
WH
1500 */
1501 int debug_mv;
1502#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
1503#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
1504#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
1505
1506 /**
f5bccd85
DB
1507 * error
1508 * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
64863965 1509 * - decoding: unused
140cb663
MN
1510 */
1511 uint64_t error[4];
115329f1 1512
17a70fde 1513 /**
f5bccd85 1514 * minimum MB quantizer
6e0d8c06 1515 * - encoding: unused
64863965 1516 * - decoding: unused
17a70fde
MN
1517 */
1518 int mb_qmin;
1519
1520 /**
f5bccd85 1521 * maximum MB quantizer
6e0d8c06 1522 * - encoding: unused
64863965 1523 * - decoding: unused
17a70fde
MN
1524 */
1525 int mb_qmax;
115329f1 1526
1457ab52 1527 /**
f5bccd85
DB
1528 * motion estimation comparison function
1529 * - encoding: Set by user.
64863965 1530 * - decoding: unused
1457ab52
MN
1531 */
1532 int me_cmp;
1533 /**
f5bccd85
DB
1534 * subpixel motion estimation comparison function
1535 * - encoding: Set by user.
64863965 1536 * - decoding: unused
1457ab52
MN
1537 */
1538 int me_sub_cmp;
1539 /**
f5bccd85
DB
1540 * macroblock comparison function (not supported yet)
1541 * - encoding: Set by user.
64863965 1542 * - decoding: unused
1457ab52
MN
1543 */
1544 int mb_cmp;
622348f9 1545 /**
f5bccd85
DB
1546 * interlaced DCT comparison function
1547 * - encoding: Set by user.
622348f9
MN
1548 * - decoding: unused
1549 */
1550 int ildct_cmp;
273b0cd3
DB
1551#define FF_CMP_SAD 0
1552#define FF_CMP_SSE 1
1553#define FF_CMP_SATD 2
1554#define FF_CMP_DCT 3
1555#define FF_CMP_PSNR 4
1556#define FF_CMP_BIT 5
1557#define FF_CMP_RD 6
1558#define FF_CMP_ZERO 7
1559#define FF_CMP_VSAD 8
1560#define FF_CMP_VSSE 9
1561#define FF_CMP_NSSE 10
1562#define FF_CMP_W53 11
1563#define FF_CMP_W97 12
0fd6aea1 1564#define FF_CMP_DCTMAX 13
27c61ac5 1565#define FF_CMP_DCT264 14
1457ab52 1566#define FF_CMP_CHROMA 256
115329f1 1567
1457ab52 1568 /**
f5bccd85
DB
1569 * ME diamond size & shape
1570 * - encoding: Set by user.
64863965 1571 * - decoding: unused
1457ab52
MN
1572 */
1573 int dia_size;
b07a5980
MN
1574
1575 /**
f5bccd85
DB
1576 * amount of previous MV predictors (2a+1 x 2a+1 square)
1577 * - encoding: Set by user.
64863965 1578 * - decoding: unused
b07a5980
MN
1579 */
1580 int last_predictor_count;
70ac76c0 1581
f5fb6b34 1582 /**
f5bccd85
DB
1583 * prepass for motion estimation
1584 * - encoding: Set by user.
64863965 1585 * - decoding: unused
f5fb6b34
MN
1586 */
1587 int pre_me;
b07a5980 1588
70ac76c0 1589 /**
f5bccd85
DB
1590 * motion estimation prepass comparison function
1591 * - encoding: Set by user.
64863965 1592 * - decoding: unused
70ac76c0
MN
1593 */
1594 int me_pre_cmp;
826f429a 1595
70ac76c0 1596 /**
f5bccd85
DB
1597 * ME prepass diamond size & shape
1598 * - encoding: Set by user.
64863965 1599 * - decoding: unused
70ac76c0
MN
1600 */
1601 int pre_dia_size;
1602
826f429a 1603 /**
f5bccd85
DB
1604 * subpel ME quality
1605 * - encoding: Set by user.
64863965 1606 * - decoding: unused
826f429a
MN
1607 */
1608 int me_subpel_quality;
1609
a33c7159 1610 /**
f5bccd85 1611 * callback to negotiate the pixelFormat
a33c7159 1612 * @param fmt is the list of formats which are supported by the codec,
f5bccd85
DB
1613 * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
1614 * The first is always the native one.
1615 * @return the chosen format
64863965 1616 * - encoding: unused
f5bccd85 1617 * - decoding: Set by user, if not set the native format will be chosen.
a33c7159 1618 */
494c56d3 1619 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
e2f9490e
FB
1620
1621 /**
f5bccd85
DB
1622 * DTG active format information (additional aspect ratio
1623 * information only used in DVB MPEG-2 transport streams)
1624 * 0 if not set.
115329f1 1625 *
f5bccd85
DB
1626 * - encoding: unused
1627 * - decoding: Set by decoder.
e2f9490e
FB
1628 */
1629 int dtg_active_format;
1630#define FF_DTG_AFD_SAME 8
1631#define FF_DTG_AFD_4_3 9
1632#define FF_DTG_AFD_16_9 10
1633#define FF_DTG_AFD_14_9 11
1634#define FF_DTG_AFD_4_3_SP_14_9 13
1635#define FF_DTG_AFD_16_9_SP_14_9 14
1636#define FF_DTG_AFD_SP_4_3 15
1637
ebbcdc9a 1638 /**
f5bccd85
DB
1639 * maximum motion estimation search range in subpel units
1640 * If 0 then no limit.
115329f1 1641 *
f5bccd85
DB
1642 * - encoding: Set by user.
1643 * - decoding: unused
ebbcdc9a 1644 */
59e0ac8e 1645 int me_range;
ebbcdc9a 1646
65f7062d 1647 /**
f5bccd85
DB
1648 * intra quantizer bias
1649 * - encoding: Set by user.
1984f635
MN
1650 * - decoding: unused
1651 */
1652 int intra_quant_bias;
1653#define FF_DEFAULT_QUANT_BIAS 999999
115329f1 1654
1984f635 1655 /**
f5bccd85
DB
1656 * inter quantizer bias
1657 * - encoding: Set by user.
1984f635
MN
1658 * - decoding: unused
1659 */
1660 int inter_quant_bias;
5cd62665
ZK
1661
1662 /**
f5bccd85
DB
1663 * color table ID
1664 * - encoding: unused
1665 * - decoding: Which clrtable should be used for 8bit RGB images.
1666 * Tables have to be stored somewhere. FIXME
5cd62665
ZK
1667 */
1668 int color_table_id;
115329f1 1669
d90cf87b 1670 /**
f5bccd85
DB
1671 * internal_buffer count
1672 * Don't touch, used by libavcodec default_get_buffer().
d90cf87b
MN
1673 */
1674 int internal_buffer_count;
115329f1 1675
d90cf87b 1676 /**
f5bccd85
DB
1677 * internal_buffers
1678 * Don't touch, used by libavcodec default_get_buffer().
d90cf87b
MN
1679 */
1680 void *internal_buffer;
158c7f05
MN
1681
1682#define FF_LAMBDA_SHIFT 7
1683#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
1684#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
1685#define FF_LAMBDA_MAX (256*128-1)
1686
1687#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
3d2e8cce 1688 /**
f5bccd85
DB
1689 * Global quality for codecs which cannot change it per frame.
1690 * This should be proportional to MPEG-1/2/4 qscale.
1691 * - encoding: Set by user.
3d2e8cce
MN
1692 * - decoding: unused
1693 */
1694 int global_quality;
115329f1 1695
bd446bb1
MN
1696#define FF_CODER_TYPE_VLC 0
1697#define FF_CODER_TYPE_AC 1
f87459e4
KN
1698#define FF_CODER_TYPE_RAW 2
1699#define FF_CODER_TYPE_RLE 3
1700#define FF_CODER_TYPE_DEFLATE 4
11e659c2
MN
1701 /**
1702 * coder type
f5bccd85 1703 * - encoding: Set by user.
11e659c2
MN
1704 * - decoding: unused
1705 */
1706 int coder_type;
1707
1708 /**
1709 * context model
f5bccd85 1710 * - encoding: Set by user.
11e659c2
MN
1711 * - decoding: unused
1712 */
1713 int context_model;
5639729b
MN
1714#if 0
1715 /**
1716 *
1717 * - encoding: unused
f5bccd85 1718 * - decoding: Set by user.
5639729b
MN
1719 */
1720 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
1721#endif
115329f1 1722
3bb07d61
MN
1723 /**
1724 * slice flags
1725 * - encoding: unused
f5bccd85 1726 * - decoding: Set by user.
3bb07d61
MN
1727 */
1728 int slice_flags;
1729#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
1730#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
1731#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
1732
fb364ada
IK
1733 /**
1734 * XVideo Motion Acceleration
1735 * - encoding: forbidden
1736 * - decoding: set by decoder
1737 */
1738 int xvmc_acceleration;
115329f1 1739
7d1c3fc1
MN
1740 /**
1741 * macroblock decision mode
f5bccd85 1742 * - encoding: Set by user.
7d1c3fc1
MN
1743 * - decoding: unused
1744 */
1745 int mb_decision;
1746#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
1747#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
e6dba5df 1748#define FF_MB_DECISION_RD 2 ///< rate distortion
d6eb3c50
MN
1749
1750 /**
1751 * custom intra quantization matrix
f5bccd85
DB
1752 * - encoding: Set by user, can be NULL.
1753 * - decoding: Set by libavcodec.
d6eb3c50
MN
1754 */
1755 uint16_t *intra_matrix;
1756
1757 /**
1758 * custom inter quantization matrix
f5bccd85
DB
1759 * - encoding: Set by user, can be NULL.
1760 * - decoding: Set by libavcodec.
d6eb3c50
MN
1761 */
1762 uint16_t *inter_matrix;
115329f1 1763
541ae140
MN
1764 /**
1765 * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
f5bccd85 1766 * This is used to work around some encoder bugs.
541ae140 1767 * - encoding: unused
f5bccd85 1768 * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
541ae140
MN
1769 */
1770 unsigned int stream_codec_tag;
05fbd0a2
MN
1771
1772 /**
f5bccd85
DB
1773 * scene change detection threshold
1774 * 0 is default, larger means fewer detected scene changes.
1775 * - encoding: Set by user.
05fbd0a2
MN
1776 * - decoding: unused
1777 */
1778 int scenechange_threshold;
158c7f05
MN
1779
1780 /**
f5bccd85
DB
1781 * minimum Lagrange multipler
1782 * - encoding: Set by user.
158c7f05
MN
1783 * - decoding: unused
1784 */
1785 int lmin;
1786
1787 /**
f5bccd85
DB
1788 * maximum Lagrange multipler
1789 * - encoding: Set by user.
158c7f05
MN
1790 * - decoding: unused
1791 */
1792 int lmax;
2a2bbcb0
MM
1793
1794 /**
f5bccd85 1795 * palette control structure
2a2bbcb0 1796 * - encoding: ??? (no palette-enabled encoder yet)
f5bccd85 1797 * - decoding: Set by user.
2a2bbcb0
MM
1798 */
1799 struct AVPaletteControl *palctrl;
821cb11f
MN
1800
1801 /**
1802 * noise reduction strength
f5bccd85 1803 * - encoding: Set by user.
821cb11f
MN
1804 * - decoding: unused
1805 */
1806 int noise_reduction;
115329f1 1807
074c4ca7 1808 /**
f5bccd85
DB
1809 * Called at the beginning of a frame to get cr buffer for it.
1810 * Buffer type (size, hints) must be the same. libavcodec won't check it.
1811 * libavcodec will pass previous buffer in pic, function should return
e1c2a5a0 1812 * same buffer or new buffer with old frame "painted" into it.
f5bccd85 1813 * If pic.data[0] == NULL must behave like get_buffer().
074c4ca7 1814 * - encoding: unused
f5bccd85 1815 * - decoding: Set by libavcodec., user can override
074c4ca7 1816 */
e1c2a5a0 1817 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
ba58dabc
MN
1818
1819 /**
f5bccd85
DB
1820 * Number of bits which should be loaded into the rc buffer before decoding starts.
1821 * - encoding: Set by user.
ba58dabc
MN
1822 * - decoding: unused
1823 */
1824 int rc_initial_buffer_occupancy;
1825
1826 /**
1827 *
f5bccd85 1828 * - encoding: Set by user.
ba58dabc
MN
1829 * - decoding: unused
1830 */
1831 int inter_threshold;
1832
1833 /**
f5bccd85
DB
1834 * CODEC_FLAG2_*
1835 * - encoding: Set by user.
1836 * - decoding: Set by user.
ba58dabc
MN
1837 */
1838 int flags2;
7ebfc0ea
MN
1839
1840 /**
f5bccd85
DB
1841 * Simulates errors in the bitstream to test error concealment.
1842 * - encoding: Set by user.
1843 * - decoding: unused
7ebfc0ea
MN
1844 */
1845 int error_rate;
115329f1 1846
a1e257b2
MN
1847 /**
1848 * MP3 antialias algorithm, see FF_AA_* below.
1849 * - encoding: unused
f5bccd85 1850 * - decoding: Set by user.
a1e257b2
MN
1851 */
1852 int antialias_algo;
1853#define FF_AA_AUTO 0
1854#define FF_AA_FASTINT 1 //not implemented yet
1855#define FF_AA_INT 2
1856#define FF_AA_FLOAT 3
77ea0d4b 1857 /**
f5bccd85
DB
1858 * quantizer noise shaping
1859 * - encoding: Set by user.
77ea0d4b
MN
1860 * - decoding: unused
1861 */
1862 int quantizer_noise_shaping;
9c3d33d6
MN
1863
1864 /**
f5bccd85 1865 * thread count
eafcac6a 1866 * is used to decide how many independent tasks should be passed to execute()
f5bccd85
DB
1867 * - encoding: Set by user.
1868 * - decoding: Set by user.
9c3d33d6
MN
1869 */
1870 int thread_count;
115329f1 1871
9c3d33d6 1872 /**
f5bccd85
DB
1873 * The codec may call this to execute several independent things.
1874 * It will return only after finishing all tasks.
1875 * The user may replace this with some multithreaded implementation,
1876 * the default implementation will execute the parts serially.
399cec2f 1877 * @param count the number of things to execute
f5bccd85
DB
1878 * - encoding: Set by libavcodec, user can override.
1879 * - decoding: Set by libavcodec, user can override.
9c3d33d6 1880 */
3a84713a 1881 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
115329f1 1882
9c3d33d6 1883 /**
f5bccd85
DB
1884 * thread opaque
1885 * Can be used by execute() to store some per AVCodecContext stuff.
9c3d33d6
MN
1886 * - encoding: set by execute()
1887 * - decoding: set by execute()
1888 */
1889 void *thread_opaque;
a4d36c11
MN
1890
1891 /**
f5bccd85
DB
1892 * Motion estimation threshold below which no motion estimation is
1893 * performed, but instead the user specified motion vectors are used.
115329f1 1894 *
f5bccd85 1895 * - encoding: Set by user.
f20f8a8b 1896 * - decoding: unused
a4d36c11 1897 */
2750b827 1898 int me_threshold;
f20f8a8b
MN
1899
1900 /**
f5bccd85
DB
1901 * Macroblock threshold below which the user specified macroblock types will be used.
1902 * - encoding: Set by user.
f20f8a8b
MN
1903 * - decoding: unused
1904 */
1905 int mb_threshold;
bf266e19
MN
1906
1907 /**
f5bccd85
DB
1908 * precision of the intra DC coefficient - 8
1909 * - encoding: Set by user.
bf266e19
MN
1910 * - decoding: unused
1911 */
1912 int intra_dc_precision;
d4c5d2ad
MN
1913
1914 /**
f5bccd85
DB
1915 * noise vs. sse weight for the nsse comparsion function
1916 * - encoding: Set by user.
d4c5d2ad
MN
1917 * - decoding: unused
1918 */
1919 int nsse_weight;
0dfd33c3
MN
1920
1921 /**
f5bccd85 1922 * Number of macroblock rows at the top which are skipped.
0dfd33c3 1923 * - encoding: unused
f5bccd85 1924 * - decoding: Set by user.
0dfd33c3
MN
1925 */
1926 int skip_top;
1927
1928 /**
f5bccd85 1929 * Number of macroblock rows at the bottom which are skipped.
0dfd33c3 1930 * - encoding: unused
f5bccd85 1931 * - decoding: Set by user.
0dfd33c3
MN
1932 */
1933 int skip_bottom;
baced9f5
MN
1934
1935 /**
1936 * profile
f5bccd85
DB
1937 * - encoding: Set by user.
1938 * - decoding: Set by libavcodec.
baced9f5
MN
1939 */
1940 int profile;
1941#define FF_PROFILE_UNKNOWN -99
4f2c36ac 1942#define FF_PROFILE_AAC_MAIN 0
273b0cd3
DB
1943#define FF_PROFILE_AAC_LOW 1
1944#define FF_PROFILE_AAC_SSR 2
1945#define FF_PROFILE_AAC_LTP 3
baced9f5
MN
1946
1947 /**
1948 * level
f5bccd85
DB
1949 * - encoding: Set by user.
1950 * - decoding: Set by libavcodec.
baced9f5
MN
1951 */
1952 int level;
1953#define FF_LEVEL_UNKNOWN -99
178fcca8
MN
1954
1955 /**
f5bccd85 1956 * low resolution decoding, 1-> 1/2 size, 2->1/4 size
178fcca8 1957 * - encoding: unused
f5bccd85 1958 * - decoding: Set by user.
178fcca8
MN
1959 */
1960 int lowres;
21adafec
MN
1961
1962 /**
f5bccd85
DB
1963 * Bitstream width / height, may be different from width/height if lowres
1964 * or other things are used.
21adafec 1965 * - encoding: unused
f5bccd85 1966 * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
21adafec
MN
1967 */
1968 int coded_width, coded_height;
bbf18b21
MN
1969
1970 /**
1971 * frame skip threshold
f5bccd85 1972 * - encoding: Set by user.
bbf18b21
MN
1973 * - decoding: unused
1974 */
1975 int frame_skip_threshold;
1976
1977 /**
1978 * frame skip factor
f5bccd85 1979 * - encoding: Set by user.
bbf18b21
MN
1980 * - decoding: unused
1981 */
1982 int frame_skip_factor;
0fd6aea1
MN
1983
1984 /**
1985 * frame skip exponent
f5bccd85 1986 * - encoding: Set by user.
0fd6aea1
MN
1987 * - decoding: unused
1988 */
1989 int frame_skip_exp;
1990
1991 /**
f5bccd85
DB
1992 * frame skip comparison function
1993 * - encoding: Set by user.
0fd6aea1
MN
1994 * - decoding: unused
1995 */
1996 int frame_skip_cmp;
957c743a
CM
1997
1998 /**
f5bccd85 1999 * Border processing masking, raises the quantizer for mbs on the borders
957c743a 2000 * of the picture.
f5bccd85 2001 * - encoding: Set by user.
957c743a
CM
2002 * - decoding: unused
2003 */
2004 float border_masking;
6e0d8c06
MN
2005
2006 /**
f5bccd85
DB
2007 * minimum MB lagrange multipler
2008 * - encoding: Set by user.
6e0d8c06
MN
2009 * - decoding: unused
2010 */
2011 int mb_lmin;
2012
2013 /**
f5bccd85
DB
2014 * maximum MB lagrange multipler
2015 * - encoding: Set by user.
6e0d8c06
MN
2016 * - decoding: unused
2017 */
2018 int mb_lmax;
09c3e44e
MN
2019
2020 /**
115329f1 2021 *
f5bccd85 2022 * - encoding: Set by user.
09c3e44e
MN
2023 * - decoding: unused
2024 */
2025 int me_penalty_compensation;
8c3eba7c
MN
2026
2027 /**
115329f1 2028 *
8c3eba7c 2029 * - encoding: unused
f5bccd85 2030 * - decoding: Set by user.
8c3eba7c
MN
2031 */
2032 enum AVDiscard skip_loop_filter;
2033
2034 /**
115329f1 2035 *
8c3eba7c 2036 * - encoding: unused
f5bccd85 2037 * - decoding: Set by user.
8c3eba7c
MN
2038 */
2039 enum AVDiscard skip_idct;
2040
2041 /**
115329f1 2042 *
8c3eba7c 2043 * - encoding: unused
f5bccd85 2044 * - decoding: Set by user.
8c3eba7c
MN
2045 */
2046 enum AVDiscard skip_frame;
316a2ec8
MN
2047
2048 /**
2049 *
f5bccd85 2050 * - encoding: Set by user.
316a2ec8
MN
2051 * - decoding: unused
2052 */
2053 int bidir_refine;
e8501c93
MN
2054
2055 /**
2056 *
f5bccd85 2057 * - encoding: Set by user.
e8501c93
MN
2058 * - decoding: unused
2059 */
2060 int brd_scale;
58f7833e
RS
2061
2062 /**
2063 * constant rate factor - quality-based VBR - values ~correspond to qps
f5bccd85 2064 * - encoding: Set by user.
58f7833e
RS
2065 * - decoding: unused
2066 */
9f1c1c99 2067 float crf;
58f7833e
RS
2068
2069 /**
2070 * constant quantization parameter rate control method
f5bccd85 2071 * - encoding: Set by user.
58f7833e
RS
2072 * - decoding: unused
2073 */
2074 int cqp;
2075
2076 /**
f5bccd85
DB
2077 * minimum GOP size
2078 * - encoding: Set by user.
58f7833e
RS
2079 * - decoding: unused
2080 */
2081 int keyint_min;
2082
2083 /**
2084 * number of reference frames
f5bccd85 2085 * - encoding: Set by user.
53d55e9e 2086 * - decoding: Set by lavc.
58f7833e
RS
2087 */
2088 int refs;
2089
2090 /**
2091 * chroma qp offset from luma
f5bccd85 2092 * - encoding: Set by user.
58f7833e
RS
2093 * - decoding: unused
2094 */
2095 int chromaoffset;
2096
2097 /**
f5bccd85
DB
2098 * Influences how often B-frames are used.
2099 * - encoding: Set by user.
58f7833e
RS
2100 * - decoding: unused
2101 */
2102 int bframebias;
2103
2104 /**
2105 * trellis RD quantization
f5bccd85 2106 * - encoding: Set by user.
58f7833e
RS
2107 * - decoding: unused
2108 */
2109 int trellis;
2110
2111 /**
f5bccd85
DB
2112 * Reduce fluctuations in qp (before curve compression).
2113 * - encoding: Set by user.
58f7833e
RS
2114 * - decoding: unused
2115 */
2116 float complexityblur;
2117
2118 /**
2119 * in-loop deblocking filter alphac0 parameter
2120 * alpha is in the range -6...6
f5bccd85 2121 * - encoding: Set by user.
58f7833e
RS
2122 * - decoding: unused
2123 */
2124 int deblockalpha;
2125
2126 /**
2127 * in-loop deblocking filter beta parameter
2128 * beta is in the range -6...6
f5bccd85 2129 * - encoding: Set by user.
58f7833e
RS
2130 * - decoding: unused
2131 */
2132 int deblockbeta;
2133
2134 /**
2135 * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
f5bccd85 2136 * - encoding: Set by user.
58f7833e
RS
2137 * - decoding: unused
2138 */
2139 int partitions;
56cc85a0
DB
2140#define X264_PART_I4X4 0x001 /* Analyze i4x4 */
2141#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */
2142#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */
2143#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */
2144#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */
58f7833e
RS
2145
2146 /**
30ab4ded 2147 * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
f5bccd85 2148 * - encoding: Set by user.
58f7833e
RS
2149 * - decoding: unused
2150 */
2151 int directpred;
4f59b684 2152
14f0c8e2 2153 /**
02c164c1 2154 * Audio cutoff bandwidth (0 means "automatic")
f5bccd85 2155 * - encoding: Set by user.
14f0c8e2
LA
2156 * - decoding: unused
2157 */
2158 int cutoff;
39a64e30
CH
2159
2160 /**
f5bccd85
DB
2161 * Multiplied by qscale for each frame and added to scene_change_score.
2162 * - encoding: Set by user.
39a64e30
CH
2163 * - decoding: unused
2164 */
2165 int scenechange_factor;
1dd509b1
MN
2166
2167 /**
2168 *
f5bccd85
DB
2169 * Note: Value depends upon the compare function used for fullpel ME.
2170 * - encoding: Set by user.
1dd509b1
MN
2171 * - decoding: unused
2172 */
2173 int mv0_threshold;
f9243d34
CH
2174
2175 /**
f5bccd85
DB
2176 * Adjusts sensitivity of b_frame_strategy 1.
2177 * - encoding: Set by user.
f9243d34
CH
2178 * - decoding: unused
2179 */
2180 int b_sensitivity;
a403fc03
JR
2181
2182 /**
f5bccd85 2183 * - encoding: Set by user.
a403fc03
JR
2184 * - decoding: unused
2185 */
2186 int compression_level;
2187#define FF_COMPRESSION_DEFAULT -1
2188
2189 /**
f5bccd85
DB
2190 * Sets whether to use LPC mode - used by FLAC encoder.
2191 * - encoding: Set by user.
2192 * - decoding: unused
a403fc03
JR
2193 */
2194 int use_lpc;
2195
2196 /**
2197 * LPC coefficient precision - used by FLAC encoder
f5bccd85
DB
2198 * - encoding: Set by user.
2199 * - decoding: unused
a403fc03
JR
2200 */
2201 int lpc_coeff_precision;
2202
2203 /**
f5bccd85
DB
2204 * - encoding: Set by user.
2205 * - decoding: unused
a403fc03
JR
2206 */
2207 int min_prediction_order;
2208
2209 /**
f5bccd85
DB
2210 * - encoding: Set by user.
2211 * - decoding: unused
a403fc03
JR
2212 */
2213 int max_prediction_order;
2214
2215 /**
2216 * search method for selecting prediction order
f5bccd85
DB
2217 * - encoding: Set by user.
2218 * - decoding: unused
a403fc03
JR
2219 */
2220 int prediction_order_method;
2221
2222 /**
f5bccd85
DB
2223 * - encoding: Set by user.
2224 * - decoding: unused
a403fc03
JR
2225 */
2226 int min_partition_order;
2227
2228 /**
f5bccd85
DB
2229 * - encoding: Set by user.
2230 * - decoding: unused
a403fc03
JR
2231 */
2232 int max_partition_order;
80d617f5
BC
2233
2234 /**
2235 * GOP timecode frame start number, in non drop frame format
f5bccd85
DB
2236 * - encoding: Set by user.
2237 * - decoding: unused
80d617f5
BC
2238 */
2239 int64_t timecode_frame_start;
b1ec601f 2240
0d72e7d0 2241#if LIBAVCODEC_VERSION_MAJOR < 53
b1ec601f
RD
2242 /**
2243 * Decoder should decode to this many channels if it can (0 for default)
2244 * - encoding: unused
2245 * - decoding: Set by user.
0d72e7d0 2246 * @deprecated Deprecated in favor of request_channel_layout.
b1ec601f
RD
2247 */
2248 int request_channels;
0d72e7d0 2249#endif
1408352a
JR
2250
2251 /**
2252 * Percentage of dynamic range compression to be applied by the decoder.
2253 * The default value is 1.0, corresponding to full compression.
2254 * - encoding: unused
2255 * - decoding: Set by user.
2256 */
2257 float drc_scale;
79de84f2
MN
2258
2259 /**
2260 * opaque 64bit number (generally a PTS) that will be reordered and
2261 * output in AVFrame.reordered_opaque
2262 * - encoding: unused
2263 * - decoding: Set by user.
2264 */
2265 int64_t reordered_opaque;
312420f3
PR
2266
2267 /**
2268 * Bits per sample/pixel of internal libavcodec pixel/sample format.
2269 * This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
2270 * - encoding: set by user.
2271 * - decoding: set by libavcodec.
2272 */
2273 int bits_per_raw_sample;
0d72e7d0
PR
2274
2275 /**
2276 * Audio channel layout.
2277 * - encoding: set by user.
2278 * - decoding: set by libavcodec.
2279 */
2280 int64_t channel_layout;
2281
2282 /**
2283 * Request decoder to use this channel layout if it can (0 for default)
2284 * - encoding: unused
2285 * - decoding: Set by user.
2286 */
2287 int64_t request_channel_layout;
3bff4d8b
BC
2288
2289 /**
2290 * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
2291 * - encoding: Set by user.
2292 * - decoding: unused.
2293 */
2294 float rc_max_available_vbv_use;
2295
2296 /**
2297 * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
2298 * - encoding: Set by user.
2299 * - decoding: unused.
2300 */
2301 float rc_min_vbv_overflow_use;
de6d9b64
FB
2302} AVCodecContext;
2303
64863965
MN
2304/**
2305 * AVCodec.
2306 */
de6d9b64 2307typedef struct AVCodec {
6b0cdb6e
NG
2308 /**
2309 * Name of the codec implementation.
2310 * The name is globally unique among encoders and among decoders (but an
2311 * encoder and a decoder can share the same name).
2312 * This is the primary way to find a codec from the user perspective.
2313 */
18f77016 2314 const char *name;
5d234974 2315 enum CodecType type;
9297ddd3 2316 enum CodecID id;
de6d9b64
FB
2317 int priv_data_size;
2318 int (*init)(AVCodecContext *);
0c1a9eda 2319 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
de6d9b64 2320 int (*close)(AVCodecContext *);
0fd90455 2321 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
6ddaa63c 2322 const uint8_t *buf, int buf_size);
a2d11246
MN
2323 /**
2324 * Codec capabilities.
2325 * see CODEC_CAP_*
2326 */
bf89e6b1 2327 int capabilities;
de6d9b64 2328 struct AVCodec *next;
c8cf325a
MN
2329 /**
2330 * Flush buffers.
2331 * Will be called when seeking
2332 */
7a06ff14 2333 void (*flush)(AVCodecContext *);
716e31ea 2334 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
1beb670a 2335 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
fe4bf374
SS
2336 /**
2337 * Descriptive name for the codec, meant to be more human readable than \p name.
2338 * You \e should use the NULL_IF_CONFIG_SMALL() macro to define it.
2339 */
2340 const char *long_name;
3ade5d56 2341 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
88a07af7 2342 const enum SampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
0d72e7d0 2343 const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
de6d9b64
FB
2344} AVCodec;
2345
97d96aaa 2346/**
d7425f59
MN
2347 * four components are given, that's all.
2348 * the last component is alpha
2349 */
de6d9b64 2350typedef struct AVPicture {
0c1a9eda 2351 uint8_t *data[4];
cd394651 2352 int linesize[4]; ///< number of bytes per line
de6d9b64
FB
2353} AVPicture;
2354
ba118447
MM
2355/**
2356 * AVPaletteControl
2357 * This structure defines a method for communicating palette changes
2358 * between and demuxer and a decoder.
671adb17
MC
2359 *
2360 * @deprecated Use AVPacket to send palette changes instead.
2361 * This is totally broken.
ba118447 2362 */
2e99641b 2363#define AVPALETTE_SIZE 1024
432d84c3 2364#define AVPALETTE_COUNT 256
ba118447
MM
2365typedef struct AVPaletteControl {
2366
f5bccd85
DB
2367 /* Demuxer sets this to 1 to indicate the palette has changed;
2368 * decoder resets to 0. */
ba118447
MM
2369 int palette_changed;
2370
2a2bbcb0
MM
2371 /* 4-byte ARGB palette entries, stored in native byte order; note that
2372 * the individual palette components should be on a 8-bit scale; if
f5bccd85
DB
2373 * the palette data comes from an IBM VGA native format, the component
2374 * data is probably 6 bits in size and needs to be scaled. */
2e99641b 2375 unsigned int palette[AVPALETTE_COUNT];
ba118447 2376
18239edf 2377} AVPaletteControl attribute_deprecated;
ba118447 2378
c66216ed
MN
2379enum AVSubtitleType {
2380 SUBTITLE_NONE,
2381
2382 SUBTITLE_BITMAP, ///< A bitmap, pict will be set
2383
2384 /**
2385 * Plain text, the text field must be set by the decoder and is
2386 * authoritative. ass and pict fields may contain approximations.
2387 */
2388 SUBTITLE_TEXT,
2389
2390 /**
2391 * Formatted text, the ass field must be set by the decoder and is
2392 * authoritative. pict and text fields may contain approximations.
2393 */
2394 SUBTITLE_ASS,
2395};
2396
c6ec28b1 2397typedef struct AVSubtitleRect {
ebc466bb
MN
2398 int x; ///< top left corner of pict, undefined when pict is not set
2399 int y; ///< top left corner of pict, undefined when pict is not set
2400 int w; ///< width of pict, undefined when pict is not set
2401 int h; ///< height of pict, undefined when pict is not set
2402 int nb_colors; ///< number of colors in pict, undefined when pict is not set
25b4c651
MN
2403
2404 /**
2405 * data+linesize for the bitmap of this subtitle.
2406 * can be set for text/ass as well once they where rendered
2407 */
2408 AVPicture pict;
f656106f
MN
2409 enum AVSubtitleType type;
2410
2411 char *text; ///< 0 terminated plain UTF-8 text
2412
2413 /**
2414 * 0 terminated ASS/SSA compatible event line.
2415 * The pressentation of this is unaffected by the other values in this
2416 * struct.
2417 */
2418 char *ass;
c6ec28b1
MN
2419} AVSubtitleRect;
2420
2421typedef struct AVSubtitle {
2422 uint16_t format; /* 0 = graphics */
2423 uint32_t start_display_time; /* relative to packet pts, in ms */
2424 uint32_t end_display_time; /* relative to packet pts, in ms */
ebc466bb 2425 unsigned num_rects;
db4fac64 2426 AVSubtitleRect **rects;
240c1657
FB
2427} AVSubtitle;
2428
240c1657 2429
de6d9b64
FB
2430/* resample.c */
2431
2432struct ReSampleContext;
aaaf1635 2433struct AVResampleContext;
de6d9b64
FB
2434
2435typedef struct ReSampleContext ReSampleContext;
2436
115329f1 2437ReSampleContext *audio_resample_init(int output_channels, int input_channels,
de6d9b64
FB
2438 int output_rate, int input_rate);
2439int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
2440void audio_resample_close(ReSampleContext *s);
2441
6e225de2 2442struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
aaaf1635 2443int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
2d48eddd 2444void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
d88443ae 2445void av_resample_close(struct AVResampleContext *c);
aaaf1635 2446
75917b88
DH
2447/**
2448 * Allocate memory for a picture. Call avpicture_free to free it.
2449 *
f5bccd85
DB
2450 * @param picture the picture to be filled in
2451 * @param pix_fmt the format of the picture
2452 * @param width the width of the picture
2453 * @param height the height of the picture
2454 * @return zero if successful, a negative value if not
75917b88
DH
2455 */
2456int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
2457
8fc3d25c
PI
2458/**
2459 * Free a picture previously allocated by avpicture_alloc().
2460 *
f5bccd85 2461 * @param picture the AVPicture to be freed
8fc3d25c 2462 */
75917b88
DH
2463void avpicture_free(AVPicture *picture);
2464
392cf77a 2465/**
f5bccd85 2466 * Fill in the AVPicture fields.
392cf77a
PI
2467 * The fields of the given AVPicture are filled in by using the 'ptr' address
2468 * which points to the image data buffer. Depending on the specified picture
2469 * format, one or multiple image data pointers and line sizes will be set.
2470 * If a planar format is specified, several pointers will be set pointing to
2471 * the different picture planes and the line sizes of the different planes
2472 * will be stored in the lines_sizes array.
2473 *
f5bccd85 2474 * @param picture AVPicture whose fields are to be filled in
392cf77a 2475 * @param ptr Buffer which will contain or contains the actual image data
f5bccd85
DB
2476 * @param pix_fmt The format in which the picture data is stored.
2477 * @param width the width of the image in pixels
2478 * @param height the height of the image in pixels
2479 * @return size of the image data in bytes
392cf77a 2480 */
0c1a9eda 2481int avpicture_fill(AVPicture *picture, uint8_t *ptr,
2d1a4094 2482 int pix_fmt, int width, int height);
da64ecc3 2483int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
63167088 2484 unsigned char *dest, int dest_size);
392cf77a
PI
2485
2486/**
2487 * Calculate the size in bytes that a picture of the given width and height
2488 * would occupy if stored in the given picture format.
2489 *
f5bccd85
DB
2490 * @param pix_fmt the given picture format
2491 * @param width the width of the image
2492 * @param height the height of the image
392cf77a
PI
2493 * @return Image data size in bytes
2494 */
219b06c6 2495int avpicture_get_size(int pix_fmt, int width, int height);
dab64ebc
FB
2496void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
2497const char *avcodec_get_pix_fmt_name(int pix_fmt);
21adafec 2498void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
63167088 2499enum PixelFormat avcodec_get_pix_fmt(const char* name);
d07730dd 2500unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
219b06c6 2501
81299d42
PI
2502#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
2503#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
2504#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
2505#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
2506#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
2507#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
fab21997 2508
392cf77a 2509/**
81299d42
PI
2510 * Computes what kind of losses will occur when converting from one specific
2511 * pixel format to another.
2512 * When converting from one pixel format to another, information loss may occur.
2513 * For example, when converting from RGB24 to GRAY, the color information will
2514 * be lost. Similarly, other losses occur when converting from some formats to
2515 * other formats. These losses can involve loss of chroma, but also loss of
2516 * resolution, loss of color depth, loss due to the color space conversion, loss
2517 * of the alpha bits or loss due to color quantization.
f5bccd85
DB
2518 * avcodec_get_fix_fmt_loss() informs you about the various types of losses
2519 * which will occur when converting from one pixel format to another.
81299d42 2520 *
f5bccd85
DB
2521 * @param[in] dst_pix_fmt destination pixel format
2522 * @param[in] src_pix_fmt source pixel format
81299d42
PI
2523 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
2524 * @return Combination of flags informing you what kind of losses will occur.
392cf77a 2525 */
fab21997
FB
2526int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
2527 int has_alpha);
392cf77a
PI
2528
2529/**
81299d42
PI
2530 * Finds the best pixel format to convert to given a certain source pixel
2531 * format. When converting from one pixel format to another, information loss
2532 * may occur. For example, when converting from RGB24 to GRAY, the color
2533 * information will be lost. Similarly, other losses occur when converting from
2534 * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
f5bccd85
DB
2535 * the given pixel formats should be used to suffer the least amount of loss.
2536 * The pixel formats from which it chooses one, are determined by the
81299d42
PI
2537 * \p pix_fmt_mask parameter.
2538 *
2539 * @code
2540 * src_pix_fmt = PIX_FMT_YUV420P;
2541 * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
2542 * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
2543 * @endcode
2544 *
f5bccd85
DB
2545 * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
2546 * @param[in] src_pix_fmt source pixel format
81299d42
PI
2547 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
2548 * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
2549 * @return The best pixel format to convert to or -1 if none was found.
392cf77a 2550 */
9d214947 2551int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
fab21997
FB
2552 int has_alpha, int *loss_ptr);
2553
c3b95b1d
SS
2554
2555/**
2556 * Print in buf the string corresponding to the pixel format with
2557 * number pix_fmt, or an header if pix_fmt is negative.
2558 *
9bd51b9a
PI
2559 * @param[in] buf the buffer where to write the string
2560 * @param[in] buf_size the size of buf
2561 * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or
c3b95b1d
SS
2562 * a negative value to print the corresponding header.
2563 * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
2564 */
2565void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
2566
0469baf1
FB
2567#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
2568#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
392cf77a
PI
2569
2570/**
2571 * Tell if an image really has transparent alpha values.
2572 * @return ored mask of FF_ALPHA_xxx constants
2573 */
da64ecc3 2574int img_get_alpha_info(const AVPicture *src,
bb270c08 2575 int pix_fmt, int width, int height);
0469baf1 2576
219b06c6 2577/* deinterlace a picture */
392cf77a 2578/* deinterlace - if not supported return -1 */
da64ecc3 2579int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
de6d9b64
FB
2580 int pix_fmt, int width, int height);
2581
2582/* external high level API */
2583
55b9e69a 2584AVCodec *av_codec_next(AVCodec *c);
de6d9b64 2585
96afa6be
SS
2586/**
2587 * Returns the LIBAVCODEC_VERSION_INT constant.
2588 */
51a49663 2589unsigned avcodec_version(void);
96afa6be 2590
f9ec0aa1
PI
2591/**
2592 * Initializes libavcodec.
2593 *
2594 * @warning This function \e must be called before any other libavcodec
2595 * function.
2596 */
de6d9b64
FB
2597void avcodec_init(void);
2598
d1ca187f
SS
2599/**
2600 * Register the codec \p codec and initialize libavcodec.
2601 *
2602 * @see avcodec_init()
2603 */
335a761a 2604void register_avcodec(AVCodec *codec);
f9ec0aa1
PI
2605
2606/**
645f7879 2607 * Finds a registered encoder with a matching codec ID.
f9ec0aa1 2608 *
f5bccd85 2609 * @param id CodecID of the requested encoder
f9ec0aa1
PI
2610 * @return An encoder if one was found, NULL otherwise.
2611 */
de6d9b64 2612AVCodec *avcodec_find_encoder(enum CodecID id);
f9ec0aa1
PI
2613
2614/**
645f7879 2615 * Finds a registered encoder with the specified name.
f9ec0aa1 2616 *
f5bccd85 2617 * @param name name of the requested encoder
f9ec0aa1
PI
2618 * @return An encoder if one was found, NULL otherwise.
2619 */
98f3b098 2620AVCodec *avcodec_find_encoder_by_name(const char *name);
f9ec0aa1
PI
2621
2622/**
645f7879 2623 * Finds a registered decoder with a matching codec ID.
f9ec0aa1 2624 *
f5bccd85 2625 * @param id CodecID of the requested decoder
f9ec0aa1
PI
2626 * @return A decoder if one was found, NULL otherwise.
2627 */
de6d9b64 2628AVCodec *avcodec_find_decoder(enum CodecID id);
f9ec0aa1
PI
2629
2630/**
645f7879 2631 * Finds a registered decoder with the specified name.
f9ec0aa1 2632 *
f5bccd85 2633 * @param name name of the requested decoder
f9ec0aa1
PI
2634 * @return A decoder if one was found, NULL otherwise.
2635 */
de6d9b64
FB
2636AVCodec *avcodec_find_decoder_by_name(const char *name);
2637void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
2638
f9ec0aa1
PI
2639/**
2640 * Sets the fields of the given AVCodecContext to default values.
2641 *
2642 * @param s The AVCodecContext of which the fields should be set to default values.
2643 */
1e491e29 2644void avcodec_get_context_defaults(AVCodecContext *s);
f9ec0aa1 2645
29301573
MN
2646/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
2647 * we WILL change its arguments and name a few times! */
2648void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
2649
f9ec0aa1
PI
2650/**
2651 * Allocates an AVCodecContext and sets its fields to default values. The
2652 * resulting struct can be deallocated by simply calling av_free().
2653 *
2654 * @return An AVCodecContext filled with default values or NULL on failure.
2655 * @see avcodec_get_context_defaults
2656 */
7ffbb60e 2657AVCodecContext *avcodec_alloc_context(void);
f9ec0aa1 2658
29301573
MN
2659/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
2660 * we WILL change its arguments and name a few times! */
2661AVCodecContext *avcodec_alloc_context2(enum CodecType);
2662
f9ec0aa1
PI
2663/**
2664 * Sets the fields of the given AVFrame to default values.
2665 *
2666 * @param pic The AVFrame of which the fields should be set to default values.
2667 */
7906085f 2668void avcodec_get_frame_defaults(AVFrame *pic);
f9ec0aa1
PI
2669
2670/**
2671 * Allocates an AVFrame and sets its fields to default values. The resulting
2672 * struct can be deallocated by simply calling av_free().
2673 *
2674 * @return An AVFrame filled with default values or NULL on failure.
2675 * @see avcodec_get_frame_defaults
2676 */
492cd3a9 2677AVFrame *avcodec_alloc_frame(void);
1e491e29 2678
492cd3a9
MN
2679int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
2680void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
3a569751
MN
2681int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
2682void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
f9ec0aa1
PI
2683
2684/**
2685 * Checks if the given dimension of a picture is valid, meaning that all
2686 * bytes of the picture can be addressed with a signed int.
2687 *
2688 * @param[in] w Width of the picture.
2689 * @param[in] h Height of the picture.
2690 * @return Zero if valid, a negative value if invalid.
2691 */
0ecca7a4 2692int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
3a569751 2693enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
1e491e29 2694
5a815088
MN
2695int avcodec_thread_init(AVCodecContext *s, int thread_count);
2696void avcodec_thread_free(AVCodecContext *s);
3a84713a
RS
2697int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
2698int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
9c3d33d6
MN
2699//FIXME func typedef
2700
7a06ff14 2701/**
f9ec0aa1
PI
2702 * Initializes the AVCodecContext to use the given AVCodec. Prior to using this
2703 * function the context has to be allocated.
2704 *
2705 * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
2706 * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
2707 * retrieving a codec.
2708 *
f5bccd85 2709 * @warning This function is not thread safe!
f9ec0aa1
PI
2710 *
2711 * @code
c9823f05 2712 * avcodec_register_all();
f9ec0aa1
PI
2713 * codec = avcodec_find_decoder(CODEC_ID_H264);
2714 * if (!codec)
2715 * exit(1);
2716 *
2717 * context = avcodec_alloc_context();
2718 *
2719 * if (avcodec_open(context, codec) < 0)
2720 * exit(1);
2721 * @endcode
2722 *
f5bccd85 2723 * @param avctx The context which will be set up to use the given codec.
f9ec0aa1 2724 * @param codec The codec to use within the context.
f5bccd85 2725 * @return zero on success, a negative value on error
f9ec0aa1 2726 * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder
7a06ff14 2727 */
de6d9b64 2728int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
7a06ff14 2729
f9ec0aa1 2730/**
f9ec0aa1 2731 * Decodes an audio frame from \p buf into \p samples.
f5bccd85 2732 * The avcodec_decode_audio2() function decodes an audio frame from the input
f9ec0aa1 2733 * buffer \p buf of size \p buf_size. To decode it, it makes use of the
f5bccd85 2734 * audio codec which was coupled with \p avctx using avcodec_open(). The
f9ec0aa1
PI
2735 * resulting decoded frame is stored in output buffer \p samples. If no frame
2736 * could be decompressed, \p frame_size_ptr is zero. Otherwise, it is the
2737 * decompressed frame size in \e bytes.
2738 *
2739 * @warning You \e must set \p frame_size_ptr to the allocated size of the
2740 * output buffer before calling avcodec_decode_audio2().
2741 *
2742 * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than
2743 * the actual read bytes because some optimized bitstream readers read 32 or 64
2744 * bits at once and could read over the end.
2745 *
2746 * @warning The end of the input buffer \p buf should be set to 0 to ensure that
2747 * no overreading happens for damaged MPEG streams.
98145875 2748 *
f9ec0aa1 2749 * @note You might have to align the input buffer \p buf and output buffer \p
f5bccd85 2750 * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
f9ec0aa1
PI
2751 * necessary at all, on others it won't work at all if not aligned and on others
2752 * it will work but it will have an impact on performance. In practice, the
2753 * bitstream should have 4 byte alignment at minimum and all sample data should
2754 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
2755 * the linesize is not a multiple of 16 then there's no sense in aligning the
2756 * start of the buffer to 16.
2757 *
f5bccd85
DB
2758 * @param avctx the codec context
2759 * @param[out] samples the output buffer
2760 * @param[in,out] frame_size_ptr the output buffer size in bytes
2761 * @param[in] buf the input buffer
2762 * @param[in] buf_size the input buffer size in bytes
f9ec0aa1
PI
2763 * @return On error a negative value is returned, otherwise the number of bytes
2764 * used or zero if no frame could be decompressed.
98145875 2765 */
ac66834c 2766int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
de6d9b64 2767 int *frame_size_ptr,
2efa7fd1 2768 const uint8_t *buf, int buf_size);
f9ec0aa1
PI
2769
2770/**
2771 * Decodes a video frame from \p buf into \p picture.
f5bccd85 2772 * The avcodec_decode_video() function decodes a video frame from the input
f9ec0aa1 2773 * buffer \p buf of size \p buf_size. To decode it, it makes use of the
f5bccd85 2774 * video codec which was coupled with \p avctx using avcodec_open(). The
f9ec0aa1
PI
2775 * resulting decoded frame is stored in \p picture.
2776 *
2777 * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than
2778 * the actual read bytes because some optimized bitstream readers read 32 or 64
2779 * bits at once and could read over the end.
2780 *
2781 * @warning The end of the input buffer \p buf should be set to 0 to ensure that
2782 * no overreading happens for damaged MPEG streams.
2783 *
2784 * @note You might have to align the input buffer \p buf and output buffer \p
2785 * samples. The alignment requirements depend on the CPU: on some CPUs it isn't
2786 * necessary at all, on others it won't work at all if not aligned and on others
2787 * it will work but it will have an impact on performance. In practice, the
2788 * bitstream should have 4 byte alignment at minimum and all sample data should
2789 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
2790 * the linesize is not a multiple of 16 then there's no sense in aligning the
2791 * start of the buffer to 16.
2792 *
f5bccd85 2793 * @param avctx the codec context
f9ec0aa1 2794 * @param[out] picture The AVFrame in which the decoded video frame will be stored.
f5bccd85
DB
2795 * @param[in] buf the input buffer
2796 * @param[in] buf_size the size of the input buffer in bytes
2797 * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
f9ec0aa1
PI
2798 * @return On error a negative value is returned, otherwise the number of bytes
2799 * used or zero if no frame could be decompressed.
2800 */
115329f1 2801int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
de6d9b64 2802 int *got_picture_ptr,
2efa7fd1 2803 const uint8_t *buf, int buf_size);
8ab4861c 2804
f5bccd85
DB
2805/* Decode a subtitle message. Return -1 if error, otherwise return the
2806 * number of bytes used. If no subtitle could be decompressed,
2807 * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
240c1657
FB
2808int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
2809 int *got_sub_ptr,
2810 const uint8_t *buf, int buf_size);
115329f1 2811int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
917e06c8 2812 int *data_size_ptr,
0c1a9eda 2813 uint8_t *buf, int buf_size);
f9ec0aa1
PI
2814
2815/**
2816 * Encodes an audio frame from \p samples into \p buf.
f5bccd85
DB
2817 * The avcodec_encode_audio() function encodes an audio frame from the input
2818 * buffer \p samples. To encode it, it makes use of the audio codec which was
f9ec0aa1
PI
2819 * coupled with \p avctx using avcodec_open(). The resulting encoded frame is
2820 * stored in output buffer \p buf.
2821 *
2822 * @note The output buffer should be at least \c FF_MIN_BUFFER_SIZE bytes large.
2823 *
f5bccd85
DB
2824 * @param avctx the codec context
2825 * @param[out] buf the output buffer
2826 * @param[in] buf_size the output buffer size
2827 * @param[in] samples the input buffer containing the samples
0fe93f07
SS
2828 * The number of samples read from this buffer is frame_size*channels,
2829 * both of which are defined in \p avctx.
5231f101
SS
2830 * For PCM audio the number of samples read from \p samples is equal to
2831 * \p buf_size * input_sample_size / output_sample_size.
7338d368 2832 * @return On error a negative value is returned, on success zero or the number
0fe93f07 2833 * of bytes used to encode the data read from the input buffer.
f9ec0aa1 2834 */
115329f1 2835int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
de6d9b64 2836 const short *samples);
f9ec0aa1
PI
2837
2838/**
2839 * Encodes a video frame from \p pict into \p buf.
f5bccd85
DB
2840 * The avcodec_encode_video() function encodes a video frame from the input
2841 * \p pict. To encode it, it makes use of the video codec which was coupled with
f9ec0aa1
PI
2842 * \p avctx using avcodec_open(). The resulting encoded bytes representing the
2843 * frame are stored in the output buffer \p buf. The input picture should be
2844 * stored using a specific format, namely \c avctx.pix_fmt.
2845 *
f5bccd85
DB
2846 * @param avctx the codec context
2847 * @param[out] buf the output buffer for the bitstream of encoded frame
2848 * @param[in] buf_size the size of the output buffer in bytes
2849 * @param[in] pict the input picture to encode
f9ec0aa1
PI
2850 * @return On error a negative value is returned, on success zero or the number
2851 * of bytes used from the input buffer.
2852 */
115329f1 2853int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
492cd3a9 2854 const AVFrame *pict);
115329f1 2855int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
240c1657 2856 const AVSubtitle *sub);
de6d9b64
FB
2857
2858int avcodec_close(AVCodecContext *avctx);
2859
d0a01fe8
SS
2860/**
2861 * Register all the codecs, parsers and bitstream filters which were enabled at
2862 * configuration time. If you do not call this function you can select exactly
2863 * which formats you want to support, by using the individual registration
2864 * functions.
2865 *
2866 * @see register_avcodec
2867 * @see av_register_codec_parser
2868 * @see av_register_bitstream_filter
2869 */
de6d9b64 2870void avcodec_register_all(void);
a96b68b7 2871
8ab4861c
PI
2872/**
2873 * Flush buffers, should be called when seeking or when switching to a different stream.
2874 */
1c2a8c7f
MN
2875void avcodec_flush_buffers(AVCodecContext *avctx);
2876
88730be6
MR
2877void avcodec_default_free_buffers(AVCodecContext *s);
2878
85975aa9 2879/* misc useful functions */
d8085ea7
MN
2880
2881/**
8f6260af
PI
2882 * Returns a single letter to describe the given picture type \p pict_type.
2883 *
f5bccd85 2884 * @param[in] pict_type the picture type
8f6260af 2885 * @return A single character representing the picture type.
d8085ea7
MN
2886 */
2887char av_get_pict_type_char(int pict_type);
2888
ac3e1834 2889/**
2fa378a7
PI
2890 * Returns codec bits per sample.
2891 *
f5bccd85 2892 * @param[in] codec_id the codec
2fa378a7 2893 * @return Number of bits per sample or zero if unknown for the given codec.
ac3e1834
BC
2894 */
2895int av_get_bits_per_sample(enum CodecID codec_id);
2e8f2c20 2896
42c71907
DC
2897/**
2898 * Returns sample format bits per sample.
2899 *
2900 * @param[in] sample_fmt the sample format
2901 * @return Number of bits per sample or zero if unknown for the given sample format.
2902 */
2903int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
2904
8424cf50
FB
2905/* frame parsing */
2906typedef struct AVCodecParserContext {
2907 void *priv_data;
2908 struct AVCodecParser *parser;
2909 int64_t frame_offset; /* offset of the current frame */
115329f1 2910 int64_t cur_offset; /* current offset
8424cf50 2911 (incremented by each av_parser_parse()) */
26f23725 2912 int64_t next_frame_offset; /* offset of the next frame */
8424cf50 2913 /* video info */
f5bccd85
DB
2914 int pict_type; /* XXX: Put it back in AVCodecContext. */
2915 int repeat_pict; /* XXX: Put it back in AVCodecContext. */
b84f2a35
FB
2916 int64_t pts; /* pts of the current frame */
2917 int64_t dts; /* dts of the current frame */
2918
2919 /* private data */
2920 int64_t last_pts;
2921 int64_t last_dts;
a62aecce 2922 int fetch_timestamp;
b84f2a35
FB
2923
2924#define AV_PARSER_PTS_NB 4
2925 int cur_frame_start_index;
2926 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
2927 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
2928 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
115329f1 2929
7cbaa7ba
MN
2930 int flags;
2931#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
a74008a4
JP
2932
2933 int64_t offset; ///< byte offset from starting packet start
5c027f88 2934 int64_t cur_frame_end[AV_PARSER_PTS_NB];
8424cf50
FB
2935} AVCodecParserContext;
2936
2937typedef struct AVCodecParser {
99f06236 2938 int codec_ids[5]; /* several codec IDs are permitted */
8424cf50
FB
2939 int priv_data_size;
2940 int (*parser_init)(AVCodecParserContext *s);
115329f1 2941 int (*parser_parse)(AVCodecParserContext *s,
8424cf50 2942 AVCodecContext *avctx,
c53d2d90 2943 const uint8_t **poutbuf, int *poutbuf_size,
8424cf50
FB
2944 const uint8_t *buf, int buf_size);
2945 void (*parser_close)(AVCodecParserContext *s);
90ad92b3 2946 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
8424cf50
FB
2947 struct AVCodecParser *next;
2948} AVCodecParser;
2949
55b9e69a 2950AVCodecParser *av_parser_next(AVCodecParser *c);
8424cf50
FB
2951
2952void av_register_codec_parser(AVCodecParser *parser);
2953AVCodecParserContext *av_parser_init(int codec_id);
115329f1 2954int av_parser_parse(AVCodecParserContext *s,
8424cf50 2955 AVCodecContext *avctx,
115329f1 2956 uint8_t **poutbuf, int *poutbuf_size,
b84f2a35
FB
2957 const uint8_t *buf, int buf_size,
2958 int64_t pts, int64_t dts);
90ad92b3
MN
2959int av_parser_change(AVCodecParserContext *s,
2960 AVCodecContext *avctx,
115329f1 2961 uint8_t **poutbuf, int *poutbuf_size,
90ad92b3 2962 const uint8_t *buf, int buf_size, int keyframe);
8424cf50
FB
2963void av_parser_close(AVCodecParserContext *s);
2964
748c2fca
MN
2965
2966typedef struct AVBitStreamFilterContext {
514e0831 2967 void *priv_data;
748c2fca
MN
2968 struct AVBitStreamFilter *filter;
2969 AVCodecParserContext *parser;
2970 struct AVBitStreamFilterContext *next;
2971} AVBitStreamFilterContext;
2972
2973
2974typedef struct AVBitStreamFilter {
2975 const char *name;
514e0831 2976 int priv_data_size;
748c2fca
MN
2977 int (*filter)(AVBitStreamFilterContext *bsfc,
2978 AVCodecContext *avctx, const char *args,
2979 uint8_t **poutbuf, int *poutbuf_size,
2980 const uint8_t *buf, int buf_size, int keyframe);
0a1a0a80 2981 void (*close)(AVBitStreamFilterContext *bsfc);
748c2fca
MN
2982 struct AVBitStreamFilter *next;
2983} AVBitStreamFilter;
2984
748c2fca
MN
2985void av_register_bitstream_filter(AVBitStreamFilter *bsf);
2986AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
2987int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
2988 AVCodecContext *avctx, const char *args,
2989 uint8_t **poutbuf, int *poutbuf_size,
2990 const uint8_t *buf, int buf_size, int keyframe);
2991void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
2992
55b9e69a 2993AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
748c2fca 2994
544eb99c 2995/* memory */
8ab4861c
PI
2996
2997/**
4267e90d
PI
2998 * Reallocates the given block if it is not large enough, otherwise it
2999 * does nothing.
3000 *
3001 * @see av_realloc
8ab4861c 3002 */
97d96aaa 3003void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
8ab4861c 3004
392cf77a
PI
3005/**
3006 * Copy image 'src' to 'dst'.
3007 */
636d6a4a 3008void av_picture_copy(AVPicture *dst, const AVPicture *src,
e1c2a5a0
RT
3009 int pix_fmt, int width, int height);
3010
392cf77a 3011/**
f5bccd85 3012 * Crop image top and left side.
392cf77a 3013 */
636d6a4a 3014int av_picture_crop(AVPicture *dst, const AVPicture *src,
f2651e7a
BC
3015 int pix_fmt, int top_band, int left_band);
3016
392cf77a 3017/**
f5bccd85 3018 * Pad image.
392cf77a 3019 */
636d6a4a 3020int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
5341c209
LA
3021 int padtop, int padbottom, int padleft, int padright, int *color);
3022
9686df2b 3023unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
ad2b531d 3024
26ef3220
SS
3025/**
3026 * Parses \p str and put in \p width_ptr and \p height_ptr the detected values.
3027 *
755bfeab 3028 * @return 0 in case of a successful parsing, a negative value otherwise
26ef3220
SS
3029 * @param[in] str the string to parse: it has to be a string in the format
3030 * <width>x<height> or a valid video frame size abbreviation.
3031 * @param[in,out] width_ptr pointer to the variable which will contain the detected
3032 * frame width value
3033 * @param[in,out] height_ptr pointer to the variable which will contain the detected
3034 * frame height value
3035 */
3036int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
3037
3038/**
3039 * Parses \p str and put in \p frame_rate the detected values.
3040 *
755bfeab 3041 * @return 0 in case of a successful parsing, a negative value otherwise
26ef3220
SS
3042 * @param[in] str the string to parse: it has to be a string in the format
3043 * <frame_rate_nom>/<frame_rate_den>, a float number or a valid video rate abbreviation
3044 * @param[in,out] frame_rate pointer to the AVRational which will contain the detected
3045 * frame rate
3046 */
3047int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
3048
8fa36ae0
FR
3049/* error handling */
3050#if EINVAL > 0
f5bccd85
DB
3051#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
3052#define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
8fa36ae0 3053#else
f5bccd85 3054/* Some platforms have E* and errno already negated. */
8fa36ae0
FR
3055#define AVERROR(e) (e)
3056#define AVUNERROR(e) (e)
3057#endif
3058#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
f5bccd85
DB
3059#define AVERROR_IO AVERROR(EIO) /**< I/O error */
3060#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
8fa36ae0
FR
3061#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
3062#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
3063#define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
f5bccd85 3064#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
35e7f087 3065#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
f3a3c72e 3066#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
8fa36ae0 3067
98790382 3068#endif /* AVCODEC_AVCODEC_H */