Commit | Line | Data |
---|---|---|
04d7f601 DB |
1 | /* |
2 | * copyright (c) 2001 Fabrice Bellard | |
3 | * | |
2912e87a | 4 | * This file is part of Libav. |
b78e7197 | 5 | * |
2912e87a | 6 | * Libav 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 | * |
2912e87a | 11 | * Libav 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 | |
2912e87a | 17 | * License along with Libav; 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 | 24 | /** |
ba87f080 | 25 | * @file |
f5bccd85 | 26 | * external API header |
36df8805 MN |
27 | */ |
28 | ||
c60208e7 | 29 | #include <errno.h> |
737eb597 | 30 | #include "libavutil/samplefmt.h" |
76a448ed | 31 | #include "libavutil/avutil.h" |
7160bb71 | 32 | #include "libavutil/cpu.h" |
0b950fe2 | 33 | #include "libavutil/dict.h" |
abc78a5a | 34 | #include "libavutil/log.h" |
d49ea4af | 35 | #include "libavutil/pixfmt.h" |
e91709ca | 36 | #include "libavutil/rational.h" |
de6d9b64 | 37 | |
3dd851c4 | 38 | #include "libavcodec/version.h" |
eda7c983 | 39 | |
7ebf5927 | 40 | /** |
48966b02 | 41 | * Identify the syntax and semantics of the bitstream. |
6b0cdb6e NG |
42 | * The principle is roughly: |
43 | * Two decoders with the same ID can decode the same streams. | |
44 | * Two encoders with the same ID can encode compatible streams. | |
45 | * There may be slight deviations from the principle due to implementation | |
46 | * details. | |
7ebf5927 | 47 | * |
f5bccd85 DB |
48 | * If you add a codec ID to this list, add it so that |
49 | * 1. no value of a existing codec ID changes (that would break ABI), | |
50 | * 2. it is as close as possible to similar codecs. | |
7ebf5927 | 51 | */ |
de6d9b64 | 52 | enum CodecID { |
115329f1 | 53 | CODEC_ID_NONE, |
ba0dabbf DB |
54 | |
55 | /* video codecs */ | |
de6d9b64 | 56 | CODEC_ID_MPEG1VIDEO, |
0e373b95 | 57 | CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding |
fb364ada | 58 | CODEC_ID_MPEG2VIDEO_XVMC, |
c6148de2 | 59 | CODEC_ID_H261, |
de6d9b64 FB |
60 | CODEC_ID_H263, |
61 | CODEC_ID_RV10, | |
68b94c35 | 62 | CODEC_ID_RV20, |
de6d9b64 | 63 | CODEC_ID_MJPEG, |
b135d9fb | 64 | CODEC_ID_MJPEGB, |
b1e6b355 | 65 | CODEC_ID_LJPEG, |
5e83dec4 | 66 | CODEC_ID_SP5X, |
5639729b | 67 | CODEC_ID_JPEGLS, |
bf89e6b1 | 68 | CODEC_ID_MPEG4, |
de6d9b64 | 69 | CODEC_ID_RAWVIDEO, |
84afee34 MN |
70 | CODEC_ID_MSMPEG4V1, |
71 | CODEC_ID_MSMPEG4V2, | |
72 | CODEC_ID_MSMPEG4V3, | |
e1a9dbff | 73 | CODEC_ID_WMV1, |
b50eef3a | 74 | CODEC_ID_WMV2, |
de6d9b64 FB |
75 | CODEC_ID_H263P, |
76 | CODEC_ID_H263I, | |
d4f5d74a | 77 | CODEC_ID_FLV1, |
be8ffec9 | 78 | CODEC_ID_SVQ1, |
8b82a956 | 79 | CODEC_ID_SVQ3, |
020fcc94 | 80 | CODEC_ID_DVVIDEO, |
11f18faf | 81 | CODEC_ID_HUFFYUV, |
f70f7c6d | 82 | CODEC_ID_CYUV, |
0da71265 | 83 | CODEC_ID_H264, |
deabd4fd | 84 | CODEC_ID_INDEO3, |
d86053a4 | 85 | CODEC_ID_VP3, |
f44ee2c3 | 86 | CODEC_ID_THEORA, |
3d2e8cce | 87 | CODEC_ID_ASV1, |
9b56edf5 | 88 | CODEC_ID_ASV2, |
5e20f836 | 89 | CODEC_ID_FFV1, |
e2a7bb28 | 90 | CODEC_ID_4XM, |
be3564ed | 91 | CODEC_ID_VCR1, |
3aff069b | 92 | CODEC_ID_CLJR, |
c3bf0288 | 93 | CODEC_ID_MDEC, |
3ef8be2b MM |
94 | CODEC_ID_ROQ, |
95 | CODEC_ID_INTERPLAY_VIDEO, | |
9937e686 MM |
96 | CODEC_ID_XAN_WC3, |
97 | CODEC_ID_XAN_WC4, | |
2fdf638b MM |
98 | CODEC_ID_RPZA, |
99 | CODEC_ID_CINEPAK, | |
100 | CODEC_ID_WS_VQA, | |
101 | CODEC_ID_MSRLE, | |
102 | CODEC_ID_MSVIDEO1, | |
4120a53a | 103 | CODEC_ID_IDCIN, |
1dc1ed99 | 104 | CODEC_ID_8BPS, |
11e29a41 | 105 | CODEC_ID_SMC, |
42cad81a | 106 | CODEC_ID_FLIC, |
9a4117d5 | 107 | CODEC_ID_TRUEMOTION1, |
fafa0b75 | 108 | CODEC_ID_VMDVIDEO, |
a273bbfb RT |
109 | CODEC_ID_MSZH, |
110 | CODEC_ID_ZLIB, | |
070ed1bc | 111 | CODEC_ID_QTRLE, |
791e7b83 | 112 | CODEC_ID_SNOW, |
9d53d58e | 113 | CODEC_ID_TSCC, |
d0a0bbd2 | 114 | CODEC_ID_ULTI, |
d08d7142 | 115 | CODEC_ID_QDRAW, |
ab711b3c | 116 | CODEC_ID_VIXL, |
acfd8f0f | 117 | CODEC_ID_QPEG, |
17179d2d MN |
118 | CODEC_ID_PNG, |
119 | CODEC_ID_PPM, | |
120 | CODEC_ID_PBM, | |
121 | CODEC_ID_PGM, | |
122 | CODEC_ID_PGMYUV, | |
123 | CODEC_ID_PAM, | |
f37b9768 | 124 | CODEC_ID_FFVHUFF, |
3f05305d MN |
125 | CODEC_ID_RV30, |
126 | CODEC_ID_RV40, | |
10b9c374 | 127 | CODEC_ID_VC1, |
21aa398f | 128 | CODEC_ID_WMV3, |
9c7fb608 | 129 | CODEC_ID_LOCO, |
a8a15e9d | 130 | CODEC_ID_WNV1, |
589f8220 | 131 | CODEC_ID_AASC, |
856dbbff | 132 | CODEC_ID_INDEO2, |
b81f8949 | 133 | CODEC_ID_FRAPS, |
64af6168 | 134 | CODEC_ID_TRUEMOTION2, |
9fa62f2a | 135 | CODEC_ID_BMP, |
e0f80bd7 | 136 | CODEC_ID_CSCD, |
4e114829 | 137 | CODEC_ID_MMVIDEO, |
9c8d8e84 | 138 | CODEC_ID_ZMBV, |
26376701 | 139 | CODEC_ID_AVS, |
348efc18 | 140 | CODEC_ID_SMACKVIDEO, |
dfca23e3 | 141 | CODEC_ID_NUV, |
fd7b1991 | 142 | CODEC_ID_KMVC, |
0919e788 | 143 | CODEC_ID_FLASHSV, |
20ffddb9 | 144 | CODEC_ID_CAVS, |
f31065f6 | 145 | CODEC_ID_JPEG2000, |
eb57c889 | 146 | CODEC_ID_VMNC, |
5ce117c3 AJ |
147 | CODEC_ID_VP5, |
148 | CODEC_ID_VP6, | |
149 | CODEC_ID_VP6F, | |
3689cf16 | 150 | CODEC_ID_TARGA, |
72450e50 | 151 | CODEC_ID_DSICINVIDEO, |
29f86228 | 152 | CODEC_ID_TIERTEXSEQVIDEO, |
a991b1fe | 153 | CODEC_ID_TIFF, |
06d392a7 | 154 | CODEC_ID_GIF, |
0e288b8c | 155 | #if LIBAVCODEC_VERSION_MAJOR == 53 |
3edeab82 | 156 | CODEC_ID_FFH264, |
0e288b8c | 157 | #endif |
33a0dd37 | 158 | CODEC_ID_DXA, |
52b6bad2 | 159 | CODEC_ID_DNXHD, |
efb0c399 | 160 | CODEC_ID_THP, |
2d99eed1 | 161 | CODEC_ID_SGI, |
9a0ddd09 | 162 | CODEC_ID_C93, |
1e6c6759 | 163 | CODEC_ID_BETHSOFTVID, |
b46d68c6 | 164 | CODEC_ID_PTX, |
1ca779e7 | 165 | CODEC_ID_TXD, |
91fc2cf1 | 166 | CODEC_ID_VP6A, |
8787d837 | 167 | CODEC_ID_AMV, |
66f7679c | 168 | CODEC_ID_VB, |
b4abe1d1 | 169 | CODEC_ID_PCX, |
d43df959 | 170 | CODEC_ID_SUNRAST, |
800b9c24 BL |
171 | CODEC_ID_INDEO4, |
172 | CODEC_ID_INDEO5, | |
a7129de5 | 173 | CODEC_ID_MIMIC, |
975cdc8f | 174 | CODEC_ID_RL2, |
19900d60 | 175 | #if LIBAVCODEC_VERSION_MAJOR == 53 |
cb21e0a7 JM |
176 | CODEC_ID_8SVX_EXP, |
177 | CODEC_ID_8SVX_FIB, | |
19900d60 | 178 | #endif |
40d26273 | 179 | CODEC_ID_ESCAPE124, |
782a58ec | 180 | CODEC_ID_DIRAC, |
b64c096b | 181 | CODEC_ID_BFI, |
495900f7 | 182 | CODEC_ID_CMV, |
974e0eee | 183 | CODEC_ID_MOTIONPIXELS, |
cfc78718 | 184 | CODEC_ID_TGV, |
42b30357 | 185 | CODEC_ID_TGQ, |
d8964f3a | 186 | CODEC_ID_TQI, |
c21fbefb KS |
187 | CODEC_ID_AURA, |
188 | CODEC_ID_AURA2, | |
97f92143 | 189 | CODEC_ID_V210X, |
a1fd2bc3 | 190 | CODEC_ID_TMV, |
ca0bb1c4 | 191 | CODEC_ID_V210, |
94d3d6a4 | 192 | CODEC_ID_DPX, |
c63ea92b | 193 | CODEC_ID_MAD, |
d8b35b85 | 194 | CODEC_ID_FRWU, |
0aa6a518 | 195 | CODEC_ID_FLASHSV2, |
a3d995c1 | 196 | CODEC_ID_CDGRAPHICS, |
4aaab0a3 | 197 | CODEC_ID_R210, |
a1ae40fd | 198 | CODEC_ID_ANM, |
4e5f42dd | 199 | CODEC_ID_BINKVIDEO, |
b9e06ddd PR |
200 | CODEC_ID_IFF_ILBM, |
201 | CODEC_ID_IFF_BYTERUN1, | |
bf354122 | 202 | CODEC_ID_KGV1, |
148bcae9 | 203 | CODEC_ID_YOP, |
a98c2dfa | 204 | CODEC_ID_VP8, |
a526d619 | 205 | CODEC_ID_PICTOR, |
beaa963c | 206 | CODEC_ID_ANSI, |
40c5ee99 TB |
207 | CODEC_ID_A64_MULTI, |
208 | CODEC_ID_A64_MULTI5, | |
43836928 | 209 | CODEC_ID_R10K, |
9d09ebf1 | 210 | CODEC_ID_MXPEG, |
d267b339 | 211 | CODEC_ID_LAGARITH, |
f5b82f45 | 212 | CODEC_ID_PRORES, |
0697440c | 213 | CODEC_ID_JV, |
42315dab | 214 | CODEC_ID_DFA, |
45ecda85 AD |
215 | CODEC_ID_WMV3IMAGE, |
216 | CODEC_ID_VC1IMAGE, | |
463ea05a | 217 | #if LIBAVCODEC_VERSION_MAJOR == 53 |
12bd8532 DB |
218 | CODEC_ID_G723_1, |
219 | CODEC_ID_G729, | |
463ea05a | 220 | #endif |
0d8506b8 | 221 | CODEC_ID_UTVIDEO, |
f545e006 | 222 | CODEC_ID_BMV_VIDEO, |
c433a3f9 | 223 | CODEC_ID_VBLE, |
40c5ee99 | 224 | |
f5bccd85 | 225 | /* various PCM "codecs" */ |
bca06e77 | 226 | CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs |
66760b30 | 227 | CODEC_ID_PCM_S16LE = 0x10000, |
a96b68b7 FB |
228 | CODEC_ID_PCM_S16BE, |
229 | CODEC_ID_PCM_U16LE, | |
230 | CODEC_ID_PCM_U16BE, | |
231 | CODEC_ID_PCM_S8, | |
232 | CODEC_ID_PCM_U8, | |
233 | CODEC_ID_PCM_MULAW, | |
234 | CODEC_ID_PCM_ALAW, | |
b461b3bc RD |
235 | CODEC_ID_PCM_S32LE, |
236 | CODEC_ID_PCM_S32BE, | |
237 | CODEC_ID_PCM_U32LE, | |
238 | CODEC_ID_PCM_U32BE, | |
239 | CODEC_ID_PCM_S24LE, | |
240 | CODEC_ID_PCM_S24BE, | |
241 | CODEC_ID_PCM_U24LE, | |
242 | CODEC_ID_PCM_U24BE, | |
243 | CODEC_ID_PCM_S24DAUD, | |
a11c2a2c | 244 | CODEC_ID_PCM_ZORK, |
725d86bf | 245 | CODEC_ID_PCM_S16LE_PLANAR, |
1472b7dd | 246 | CODEC_ID_PCM_DVD, |
aa29709e | 247 | CODEC_ID_PCM_F32BE, |
143a5d6f PR |
248 | CODEC_ID_PCM_F32LE, |
249 | CODEC_ID_PCM_F64BE, | |
250 | CODEC_ID_PCM_F64LE, | |
5dd3707b | 251 | CODEC_ID_PCM_BLURAY, |
fbeabfca | 252 | CODEC_ID_PCM_LXF, |
9aa91043 | 253 | CODEC_ID_S302M, |
f1f6d361 | 254 | CODEC_ID_PCM_S8_PLANAR, |
0147f198 | 255 | |
f5bccd85 | 256 | /* various ADPCM codecs */ |
66760b30 | 257 | CODEC_ID_ADPCM_IMA_QT = 0x11000, |
0147f198 | 258 | CODEC_ID_ADPCM_IMA_WAV, |
9937e686 MM |
259 | CODEC_ID_ADPCM_IMA_DK3, |
260 | CODEC_ID_ADPCM_IMA_DK4, | |
2fdf638b | 261 | CODEC_ID_ADPCM_IMA_WS, |
7d8379f2 | 262 | CODEC_ID_ADPCM_IMA_SMJPEG, |
0147f198 | 263 | CODEC_ID_ADPCM_MS, |
e2a7bb28 | 264 | CODEC_ID_ADPCM_4XM, |
fc384777 MM |
265 | CODEC_ID_ADPCM_XA, |
266 | CODEC_ID_ADPCM_ADX, | |
7d8379f2 | 267 | CODEC_ID_ADPCM_EA, |
e5966052 | 268 | CODEC_ID_ADPCM_G726, |
b3bfb299 | 269 | CODEC_ID_ADPCM_CT, |
659c3692 | 270 | CODEC_ID_ADPCM_SWF, |
2ff4524e | 271 | CODEC_ID_ADPCM_YAMAHA, |
2433f24f AJ |
272 | CODEC_ID_ADPCM_SBPRO_4, |
273 | CODEC_ID_ADPCM_SBPRO_3, | |
274 | CODEC_ID_ADPCM_SBPRO_2, | |
d1e0d21f | 275 | CODEC_ID_ADPCM_THP, |
3a7f5d07 | 276 | CODEC_ID_ADPCM_IMA_AMV, |
e7583962 PR |
277 | CODEC_ID_ADPCM_EA_R1, |
278 | CODEC_ID_ADPCM_EA_R3, | |
279 | CODEC_ID_ADPCM_EA_R2, | |
7bb65d89 | 280 | CODEC_ID_ADPCM_IMA_EA_SEAD, |
fac84d3c | 281 | CODEC_ID_ADPCM_IMA_EA_EACS, |
271b4095 | 282 | CODEC_ID_ADPCM_EA_XAS, |
861c63a2 | 283 | CODEC_ID_ADPCM_EA_MAXIS_XA, |
055dc116 | 284 | CODEC_ID_ADPCM_IMA_ISS, |
58e37eaf | 285 | CODEC_ID_ADPCM_G722, |
891f64b3 | 286 | |
17179d2d | 287 | /* AMR */ |
66760b30 | 288 | CODEC_ID_AMR_NB = 0x12000, |
d663a1fd MN |
289 | CODEC_ID_AMR_WB, |
290 | ||
b8414bbd | 291 | /* RealAudio codecs*/ |
66760b30 | 292 | CODEC_ID_RA_144 = 0x13000, |
b8414bbd | 293 | CODEC_ID_RA_288, |
3ef8be2b MM |
294 | |
295 | /* various DPCM codecs */ | |
66760b30 | 296 | CODEC_ID_ROQ_DPCM = 0x14000, |
3ef8be2b | 297 | CODEC_ID_INTERPLAY_DPCM, |
9937e686 | 298 | CODEC_ID_XAN_DPCM, |
d08d7142 | 299 | CODEC_ID_SOL_DPCM, |
115329f1 | 300 | |
ba0dabbf | 301 | /* audio codecs */ |
66760b30 | 302 | CODEC_ID_MP2 = 0x15000, |
0e373b95 | 303 | CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 |
17179d2d | 304 | CODEC_ID_AAC, |
17179d2d MN |
305 | CODEC_ID_AC3, |
306 | CODEC_ID_DTS, | |
307 | CODEC_ID_VORBIS, | |
308 | CODEC_ID_DVAUDIO, | |
309 | CODEC_ID_WMAV1, | |
310 | CODEC_ID_WMAV2, | |
311 | CODEC_ID_MACE3, | |
312 | CODEC_ID_MACE6, | |
313 | CODEC_ID_VMDAUDIO, | |
0e288b8c | 314 | #if LIBAVCODEC_VERSION_MAJOR == 53 |
17179d2d MN |
315 | CODEC_ID_SONIC, |
316 | CODEC_ID_SONIC_LS, | |
0e288b8c | 317 | #endif |
ac2570a8 | 318 | CODEC_ID_FLAC, |
1ede228a | 319 | CODEC_ID_MP3ADU, |
d2a7718d | 320 | CODEC_ID_MP3ON4, |
85ad5695 | 321 | CODEC_ID_SHORTEN, |
5df8a0c6 | 322 | CODEC_ID_ALAC, |
034eeaa1 | 323 | CODEC_ID_WESTWOOD_SND1, |
0e373b95 | 324 | CODEC_ID_GSM, ///< as in Berlin toast format |
d9b1c197 | 325 | CODEC_ID_QDM2, |
e0f7e329 | 326 | CODEC_ID_COOK, |
bf3027c8 | 327 | CODEC_ID_TRUESPEECH, |
a24c4a2a | 328 | CODEC_ID_TTA, |
348efc18 | 329 | CODEC_ID_SMACKAUDIO, |
6c496518 | 330 | CODEC_ID_QCELP, |
730581f3 | 331 | CODEC_ID_WAVPACK, |
72450e50 | 332 | CODEC_ID_DSICINAUDIO, |
84ed36da | 333 | CODEC_ID_IMC, |
185c7b6b | 334 | CODEC_ID_MUSEPACK7, |
aad512b4 | 335 | CODEC_ID_MLP, |
f5bccd85 | 336 | CODEC_ID_GSM_MS, /* as found in WAV */ |
10e26bc7 | 337 | CODEC_ID_ATRAC3, |
8950f828 | 338 | CODEC_ID_VOXWARE, |
bf4a1f17 | 339 | CODEC_ID_APE, |
636b13c5 | 340 | CODEC_ID_NELLYMOSER, |
12877faf | 341 | CODEC_ID_MUSEPACK8, |
cb4ddf77 | 342 | CODEC_ID_SPEEX, |
7bb8d51c BL |
343 | CODEC_ID_WMAVOICE, |
344 | CODEC_ID_WMAPRO, | |
800b9c24 | 345 | CODEC_ID_WMALOSSLESS, |
b339f0c6 | 346 | CODEC_ID_ATRAC3P, |
2988c93d | 347 | CODEC_ID_EAC3, |
faeedbbb | 348 | CODEC_ID_SIPR, |
7f507b2d | 349 | CODEC_ID_MP1, |
616e899c | 350 | CODEC_ID_TWINVQ, |
9ba4821d | 351 | CODEC_ID_TRUEHD, |
b24bbbb4 | 352 | CODEC_ID_MP4ALS, |
223e8df1 | 353 | CODEC_ID_ATRAC1, |
4e5f42dd DV |
354 | CODEC_ID_BINKAUDIO_RDFT, |
355 | CODEC_ID_BINKAUDIO_DCT, | |
136e19e1 | 356 | CODEC_ID_AAC_LATM, |
ed19fafd | 357 | CODEC_ID_QDMC, |
4ca59d19 | 358 | CODEC_ID_CELT, |
463ea05a DB |
359 | #if LIBAVCODEC_VERSION_MAJOR > 53 |
360 | CODEC_ID_G723_1, | |
361 | CODEC_ID_G729, | |
19900d60 KS |
362 | CODEC_ID_8SVX_EXP, |
363 | CODEC_ID_8SVX_FIB, | |
463ea05a | 364 | #endif |
f545e006 | 365 | CODEC_ID_BMV_AUDIO, |
115329f1 | 366 | |
240c1657 | 367 | /* subtitle codecs */ |
bca06e77 | 368 | CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. |
66760b30 | 369 | CODEC_ID_DVD_SUBTITLE = 0x17000, |
115329f1 | 370 | CODEC_ID_DVB_SUBTITLE, |
0e373b95 | 371 | CODEC_ID_TEXT, ///< raw UTF-8 text |
7e2643ae | 372 | CODEC_ID_XSUB, |
f9a9b350 | 373 | CODEC_ID_SSA, |
cc8c2c6a | 374 | CODEC_ID_MOV_TEXT, |
c58b82a2 | 375 | CODEC_ID_HDMV_PGS_SUBTITLE, |
e58992e4 | 376 | CODEC_ID_DVB_TELETEXT, |
ba2c508d | 377 | CODEC_ID_SRT, |
115329f1 | 378 | |
7ce68923 | 379 | /* other specific kind of codecs (generally used for attachments) */ |
bca06e77 | 380 | CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. |
66760b30 | 381 | CODEC_ID_TTF = 0x18000, |
f8d7c9d3 | 382 | |
66760b30 | 383 | CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it |
0bef08e5 | 384 | |
66760b30 | 385 | CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS |
f5bccd85 | 386 | * stream (only used by libavformat) */ |
77b5c82b AC |
387 | CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems |
388 | * stream (only used by libavformat) */ | |
66760b30 | 389 | CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. |
de6d9b64 | 390 | }; |
dcedf586 | 391 | |
262d1c5d SS |
392 | #if FF_API_OLD_SAMPLE_FMT |
393 | #define SampleFormat AVSampleFormat | |
394 | ||
395 | #define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE | |
396 | #define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8 | |
397 | #define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16 | |
398 | #define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32 | |
399 | #define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT | |
400 | #define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL | |
401 | #define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB | |
402 | #endif | |
a96b68b7 | 403 | |
176a6157 | 404 | #if FF_API_OLD_AUDIOCONVERT |
737eb597 | 405 | #include "libavutil/audioconvert.h" |
176a6157 | 406 | |
0d72e7d0 | 407 | /* Audio channel masks */ |
176a6157 SS |
408 | #define CH_FRONT_LEFT AV_CH_FRONT_LEFT |
409 | #define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT | |
410 | #define CH_FRONT_CENTER AV_CH_FRONT_CENTER | |
411 | #define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY | |
412 | #define CH_BACK_LEFT AV_CH_BACK_LEFT | |
413 | #define CH_BACK_RIGHT AV_CH_BACK_RIGHT | |
414 | #define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER | |
415 | #define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER | |
416 | #define CH_BACK_CENTER AV_CH_BACK_CENTER | |
417 | #define CH_SIDE_LEFT AV_CH_SIDE_LEFT | |
418 | #define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT | |
419 | #define CH_TOP_CENTER AV_CH_TOP_CENTER | |
420 | #define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT | |
421 | #define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER | |
422 | #define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT | |
423 | #define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT | |
424 | #define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER | |
425 | #define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT | |
426 | #define CH_STEREO_LEFT AV_CH_STEREO_LEFT | |
427 | #define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT | |
0d72e7d0 | 428 | |
31557166 JR |
429 | /** Channel mask value used for AVCodecContext.request_channel_layout |
430 | to indicate that the user requests the channel order of the decoder output | |
431 | to be the native codec channel order. */ | |
176a6157 | 432 | #define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE |
31557166 | 433 | |
0d72e7d0 | 434 | /* Audio channel convenience macros */ |
176a6157 SS |
435 | #define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO |
436 | #define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO | |
437 | #define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1 | |
438 | #define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND | |
439 | #define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0 | |
440 | #define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2 | |
441 | #define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD | |
442 | #define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0 | |
443 | #define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1 | |
444 | #define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK | |
445 | #define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK | |
446 | #define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0 | |
447 | #define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1 | |
448 | #define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE | |
449 | #define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX | |
450 | #endif | |
0d72e7d0 | 451 | |
de6d9b64 | 452 | /* in bytes */ |
8170e5fb | 453 | #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio |
de6d9b64 | 454 | |
d7425f59 | 455 | /** |
cf713bb8 | 456 | * Required number of additionally allocated bytes at the end of the input bitstream for decoding. |
171b7b91 AC |
457 | * This is mainly needed because some optimized bitstream readers read |
458 | * 32 or 64 bit at once and could read over the end.<br> | |
f5bccd85 DB |
459 | * Note: If the first 23 bits of the additional bytes are not 0, then damaged |
460 | * MPEG bitstreams could cause overread and segfault. | |
d7425f59 | 461 | */ |
171b7b91 | 462 | #define FF_INPUT_BUFFER_PADDING_SIZE 8 |
d7425f59 | 463 | |
0ecca7a4 | 464 | /** |
f5bccd85 DB |
465 | * minimum encoding buffer size |
466 | * Used to avoid some checks during header writing. | |
0ecca7a4 MN |
467 | */ |
468 | #define FF_MIN_BUFFER_SIZE 16384 | |
469 | ||
47146dfb | 470 | |
0e373b95 | 471 | /** |
bafc102b | 472 | * motion estimation type. |
0e373b95 | 473 | */ |
e4986da9 | 474 | enum Motion_Est_ID { |
9b4dd1b8 | 475 | ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed |
e4986da9 J |
476 | ME_FULL, |
477 | ME_LOG, | |
478 | ME_PHODS, | |
9b4dd1b8 MN |
479 | ME_EPZS, ///< enhanced predictive zonal search |
480 | ME_X1, ///< reserved for experiments | |
481 | ME_HEX, ///< hexagon based search | |
482 | ME_UMH, ///< uneven multi-hexagon search | |
483 | ME_ITER, ///< iterative search | |
359bbdab | 484 | ME_TESA, ///< transformed exhaustive search algorithm |
e4986da9 J |
485 | }; |
486 | ||
8c3eba7c | 487 | enum AVDiscard{ |
f5bccd85 DB |
488 | /* We leave some space between them for extensions (drop some |
489 | * keyframes for intra-only or drop just some bidir frames). */ | |
8c3eba7c MN |
490 | AVDISCARD_NONE =-16, ///< discard nothing |
491 | AVDISCARD_DEFAULT= 0, ///< discard useless packets like 0 size packets in avi | |
492 | AVDISCARD_NONREF = 8, ///< discard all non reference | |
493 | AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames | |
494 | AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes | |
495 | AVDISCARD_ALL = 48, ///< discard all | |
496 | }; | |
497 | ||
4ee6a5c1 MN |
498 | enum AVColorPrimaries{ |
499 | AVCOL_PRI_BT709 =1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B | |
500 | AVCOL_PRI_UNSPECIFIED=2, | |
501 | AVCOL_PRI_BT470M =4, | |
502 | AVCOL_PRI_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM | |
503 | AVCOL_PRI_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC | |
504 | AVCOL_PRI_SMPTE240M =7, ///< functionally identical to above | |
505 | AVCOL_PRI_FILM =8, | |
506 | AVCOL_PRI_NB , ///< Not part of ABI | |
507 | }; | |
508 | ||
509 | enum AVColorTransferCharacteristic{ | |
510 | AVCOL_TRC_BT709 =1, ///< also ITU-R BT1361 | |
511 | AVCOL_TRC_UNSPECIFIED=2, | |
512 | AVCOL_TRC_GAMMA22 =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM | |
513 | AVCOL_TRC_GAMMA28 =5, ///< also ITU-R BT470BG | |
514 | AVCOL_TRC_NB , ///< Not part of ABI | |
515 | }; | |
516 | ||
517 | enum AVColorSpace{ | |
518 | AVCOL_SPC_RGB =0, | |
519 | AVCOL_SPC_BT709 =1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B | |
520 | AVCOL_SPC_UNSPECIFIED=2, | |
521 | AVCOL_SPC_FCC =4, | |
522 | AVCOL_SPC_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 | |
523 | AVCOL_SPC_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above | |
524 | AVCOL_SPC_SMPTE240M =7, | |
525 | AVCOL_SPC_NB , ///< Not part of ABI | |
526 | }; | |
527 | ||
528 | enum AVColorRange{ | |
529 | AVCOL_RANGE_UNSPECIFIED=0, | |
530 | AVCOL_RANGE_MPEG =1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges | |
531 | AVCOL_RANGE_JPEG =2, ///< the normal 2^n-1 "JPEG" YUV ranges | |
532 | AVCOL_RANGE_NB , ///< Not part of ABI | |
533 | }; | |
534 | ||
580a7465 DC |
535 | /** |
536 | * X X 3 4 X X are luma samples, | |
537 | * 1 2 1-6 are possible chroma positions | |
538 | * X X 5 6 X 0 is undefined/unknown position | |
539 | */ | |
540 | enum AVChromaLocation{ | |
541 | AVCHROMA_LOC_UNSPECIFIED=0, | |
542 | AVCHROMA_LOC_LEFT =1, ///< mpeg2/4, h264 default | |
543 | AVCHROMA_LOC_CENTER =2, ///< mpeg1, jpeg, h263 | |
544 | AVCHROMA_LOC_TOPLEFT =3, ///< DV | |
545 | AVCHROMA_LOC_TOP =4, | |
546 | AVCHROMA_LOC_BOTTOMLEFT =5, | |
547 | AVCHROMA_LOC_BOTTOM =6, | |
548 | AVCHROMA_LOC_NB , ///< Not part of ABI | |
549 | }; | |
550 | ||
188dea1d | 551 | #if FF_API_FLAC_GLOBAL_OPTS |
23940f14 JR |
552 | /** |
553 | * LPC analysis type | |
554 | */ | |
1b6da627 | 555 | enum AVLPCType { |
23940f14 JR |
556 | AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type |
557 | AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients | |
558 | AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients | |
559 | AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion | |
560 | AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization | |
561 | AV_LPC_TYPE_NB , ///< Not part of ABI | |
562 | }; | |
188dea1d | 563 | #endif |
23940f14 | 564 | |
34b47d7c JR |
565 | enum AVAudioServiceType { |
566 | AV_AUDIO_SERVICE_TYPE_MAIN = 0, | |
567 | AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, | |
568 | AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, | |
569 | AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, | |
570 | AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, | |
571 | AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, | |
572 | AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, | |
573 | AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, | |
574 | AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, | |
575 | AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI | |
576 | }; | |
577 | ||
ce980a95 MN |
578 | typedef struct RcOverride{ |
579 | int start_frame; | |
580 | int end_frame; | |
f5bccd85 | 581 | int qscale; // If this is 0 then quality_factor will be used instead. |
ce980a95 MN |
582 | float quality_factor; |
583 | } RcOverride; | |
584 | ||
b0ec9efd | 585 | #define FF_MAX_B_FRAMES 16 |
9dbcbd92 | 586 | |
a949d72e | 587 | /* encoding support |
f5bccd85 DB |
588 | These flags can be passed in AVCodecContext.flags before initialization. |
589 | Note: Not everything is supported yet. | |
a949d72e | 590 | */ |
de6d9b64 | 591 | |
f5bccd85 DB |
592 | #define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale. |
593 | #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263. | |
594 | #define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC. | |
595 | #define CODEC_FLAG_GMC 0x0020 ///< Use GMC. | |
596 | #define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>. | |
1ba8f5eb MN |
597 | /** |
598 | * The parent program guarantees that the input for B-frames containing | |
f5bccd85 | 599 | * streams is not written to for at least s->max_b_frames+1 frames, if |
1ba8f5eb MN |
600 | * this is not set the input will be copied. |
601 | */ | |
8b4c7dbc | 602 | #define CODEC_FLAG_INPUT_PRESERVED 0x0100 |
273b0cd3 DB |
603 | #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode. |
604 | #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode. | |
273b0cd3 DB |
605 | #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale. |
606 | #define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges. | |
607 | #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding. | |
608 | #define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random | |
609 | location instead of only at frame boundaries. */ | |
f5bccd85 DB |
610 | #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization. |
611 | #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT. | |
612 | #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay. | |
f5bccd85 DB |
613 | #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe. |
614 | #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT). | |
21e59552 | 615 | /* Fx : Flag for h263+ extra options */ |
f5bccd85 | 616 | #define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction |
f5bccd85 DB |
617 | #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp. |
618 | #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon. | |
332f9ac4 | 619 | #define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter |
bb198e19 | 620 | #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation |
f3eec1cf | 621 | #define CODEC_FLAG_CLOSED_GOP 0x80000000 |
f5bccd85 DB |
622 | #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks. |
623 | #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. | |
624 | #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. | |
625 | #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. | |
f013cb81 AK |
626 | #define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping |
627 | #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. | |
628 | /** | |
629 | * @defgroup deprecated_flags Deprecated codec flags | |
630 | * Use corresponding private codec options instead. | |
631 | * @{ | |
632 | */ | |
633 | #if FF_API_MPEGVIDEO_GLOBAL_OPTS | |
634 | #define CODEC_FLAG_OBMC 0x00000001 ///< OBMC | |
635 | #define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC | |
636 | #define CODEC_FLAG_PART 0x0080 ///< Use data partitioning. | |
637 | #define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan. | |
638 | #define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector | |
639 | #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000 | |
640 | #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data. | |
641 | #define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table. | |
642 | #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. | |
643 | #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer. | |
644 | #endif | |
645 | #if FF_API_MJPEG_GLOBAL_OPTS | |
646 | #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). | |
647 | #endif | |
34dda125 | 648 | #if FF_API_X264_GLOBAL_OPTS |
f5bccd85 DB |
649 | #define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references. |
650 | #define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames | |
d3075ed5 | 651 | #define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock |
58f7833e RS |
652 | #define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform |
653 | #define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip | |
654 | #define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters | |
f5bccd85 | 655 | #define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization |
f013cb81 AK |
656 | #define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only) |
657 | #define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations. | |
658 | #define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined. | |
659 | #define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes. | |
297d9cb3 | 660 | #endif |
0cc06b9e | 661 | #if FF_API_SNOW_GLOBAL_OPTS |
f5bccd85 | 662 | #define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). |
0cc06b9e | 663 | #endif |
a7cec3a0 | 664 | #if FF_API_LAME_GLOBAL_OPTS |
f1618fd9 | 665 | #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible |
a7cec3a0 | 666 | #endif |
f013cb81 AK |
667 | /** |
668 | * @} | |
669 | */ | |
6fc5b059 | 670 | |
21e59552 | 671 | /* Unsupported options : |
bb270c08 DB |
672 | * Syntax Arithmetic coding (SAC) |
673 | * Reference Picture Selection | |
eafcac6a | 674 | * Independent Segment Decoding */ |
21e59552 | 675 | /* /Fx */ |
bf89e6b1 FB |
676 | /* codec capabilities */ |
677 | ||
f5bccd85 | 678 | #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback. |
6814a25c | 679 | /** |
9b489e02 RD |
680 | * Codec uses get_buffer() for allocating buffers and supports custom allocators. |
681 | * If not set, it might not use get_buffer() at all or use operations that | |
682 | * assume the buffer was allocated by avcodec_default_get_buffer. | |
6814a25c MN |
683 | */ |
684 | #define CODEC_CAP_DR1 0x0002 | |
512557b2 | 685 | #if FF_API_PARSE_FRAME |
f5bccd85 | 686 | /* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */ |
917e06c8 | 687 | #define CODEC_CAP_PARSE_ONLY 0x0004 |
512557b2 | 688 | #endif |
d7425f59 | 689 | #define CODEC_CAP_TRUNCATED 0x0008 |
f5bccd85 | 690 | /* Codec can export data for HW decoding (XvMC). */ |
5e5c247a | 691 | #define CODEC_CAP_HWACCEL 0x0010 |
115329f1 | 692 | /** |
ffeeae92 JR |
693 | * Codec has a nonzero delay and needs to be fed with avpkt->data=NULL, |
694 | * avpkt->size=0 at the end to get the delayed data until the decoder no longer | |
695 | * returns frames. If this is not set, the codec is guaranteed to never be fed | |
696 | * with NULL data. | |
934982c4 | 697 | */ |
6f824977 | 698 | #define CODEC_CAP_DELAY 0x0020 |
cef7cc72 JR |
699 | /** |
700 | * Codec can be fed a final frame with a smaller size. | |
701 | * This can be used to prevent truncation of the last audio samples. | |
702 | */ | |
703 | #define CODEC_CAP_SMALL_LAST_FRAME 0x0040 | |
369122dd NC |
704 | /** |
705 | * Codec can export data for HW decoding (VDPAU). | |
706 | */ | |
707 | #define CODEC_CAP_HWACCEL_VDPAU 0x0080 | |
d859bb1d SS |
708 | /** |
709 | * Codec can output multiple frames per AVPacket | |
e9e949cf MN |
710 | * Normally demuxers return one frame at a time, demuxers which do not do |
711 | * are connected to a parser to split what they return into proper frames. | |
712 | * This flag is reserved to the very rare category of codecs which have a | |
713 | * bitstream that cannot be split into frames without timeconsuming | |
714 | * operations like full decoding. Demuxers carring such bitstreams thus | |
715 | * may return multiple frames in a packet. This has many disadvantages like | |
716 | * prohibiting stream copy in many cases thus it should only be considered | |
717 | * as a last resort. | |
d859bb1d SS |
718 | */ |
719 | #define CODEC_CAP_SUBFRAMES 0x0100 | |
93ebfeea JG |
720 | /** |
721 | * Codec is experimental and is thus avoided in favor of non experimental | |
722 | * encoders | |
723 | */ | |
724 | #define CODEC_CAP_EXPERIMENTAL 0x0200 | |
62784e37 BL |
725 | /** |
726 | * Codec should fill in channel configuration and samplerate instead of container | |
727 | */ | |
728 | #define CODEC_CAP_CHANNEL_CONF 0x0400 | |
16cfc961 SS |
729 | /** |
730 | * Codec is able to deal with negative linesizes | |
731 | */ | |
732 | #define CODEC_CAP_NEG_LINESIZES 0x0800 | |
37b00b47 AS |
733 | /** |
734 | * Codec supports frame-level multithreading. | |
735 | */ | |
736 | #define CODEC_CAP_FRAME_THREADS 0x1000 | |
94f7451a RB |
737 | /** |
738 | * Codec supports slice-based (or partition-based) multithreading. | |
739 | */ | |
740 | #define CODEC_CAP_SLICE_THREADS 0x2000 | |
bf89e6b1 | 741 | |
f5bccd85 | 742 | //The following defines may change, don't expect compatibility if you use them. |
8d7ec294 | 743 | #define MB_TYPE_INTRA4x4 0x0001 |
f5bccd85 DB |
744 | #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific |
745 | #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific | |
8d7ec294 WH |
746 | #define MB_TYPE_16x16 0x0008 |
747 | #define MB_TYPE_16x8 0x0010 | |
748 | #define MB_TYPE_8x16 0x0020 | |
749 | #define MB_TYPE_8x8 0x0040 | |
750 | #define MB_TYPE_INTERLACED 0x0080 | |
273b0cd3 | 751 | #define MB_TYPE_DIRECT2 0x0100 //FIXME |
8d7ec294 WH |
752 | #define MB_TYPE_ACPRED 0x0200 |
753 | #define MB_TYPE_GMC 0x0400 | |
754 | #define MB_TYPE_SKIP 0x0800 | |
755 | #define MB_TYPE_P0L0 0x1000 | |
756 | #define MB_TYPE_P1L0 0x2000 | |
757 | #define MB_TYPE_P0L1 0x4000 | |
758 | #define MB_TYPE_P1L1 0x8000 | |
759 | #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) | |
760 | #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) | |
761 | #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) | |
762 | #define MB_TYPE_QUANT 0x00010000 | |
763 | #define MB_TYPE_CBP 0x00020000 | |
764 | //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) | |
765 | ||
fa384dcc MN |
766 | /** |
767 | * Pan Scan area. | |
f5bccd85 DB |
768 | * This specifies the area which should be displayed. |
769 | * Note there may be multiple such areas for one frame. | |
fa384dcc MN |
770 | */ |
771 | typedef struct AVPanScan{ | |
772 | /** | |
f5bccd85 DB |
773 | * id |
774 | * - encoding: Set by user. | |
775 | * - decoding: Set by libavcodec. | |
fa384dcc MN |
776 | */ |
777 | int id; | |
778 | ||
779 | /** | |
780 | * width and height in 1/16 pel | |
f5bccd85 DB |
781 | * - encoding: Set by user. |
782 | * - decoding: Set by libavcodec. | |
fa384dcc MN |
783 | */ |
784 | int width; | |
785 | int height; | |
786 | ||
787 | /** | |
f5bccd85 DB |
788 | * position of the top left corner in 1/16 pel for up to 3 fields/frames |
789 | * - encoding: Set by user. | |
790 | * - decoding: Set by libavcodec. | |
fa384dcc MN |
791 | */ |
792 | int16_t position[3][2]; | |
793 | }AVPanScan; | |
794 | ||
bb270c08 DB |
795 | #define FF_QSCALE_TYPE_MPEG1 0 |
796 | #define FF_QSCALE_TYPE_MPEG2 1 | |
797 | #define FF_QSCALE_TYPE_H264 2 | |
800274f8 | 798 | #define FF_QSCALE_TYPE_VP56 3 |
4e00e76b MN |
799 | |
800 | #define FF_BUFFER_TYPE_INTERNAL 1 | |
f5bccd85 DB |
801 | #define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user) |
802 | #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. | |
803 | #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. | |
4e00e76b | 804 | |
bebe72f4 SS |
805 | #if FF_API_OLD_FF_PICT_TYPES |
806 | /* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ | |
807 | #define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra | |
808 | #define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted | |
809 | #define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted | |
810 | #define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 | |
811 | #define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra | |
812 | #define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted | |
813 | #define FF_BI_TYPE AV_PICTURE_TYPE_BI | |
814 | #endif | |
1e491e29 | 815 | |
f5bccd85 DB |
816 | #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). |
817 | #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. | |
818 | #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. | |
819 | #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update). | |
074c4ca7 | 820 | |
4de339e2 KS |
821 | enum AVPacketSideDataType { |
822 | AV_PKT_DATA_PALETTE, | |
823 | }; | |
824 | ||
18c915ee TB |
825 | typedef struct AVPacket { |
826 | /** | |
7b356d39 RS |
827 | * Presentation timestamp in AVStream->time_base units; the time at which |
828 | * the decompressed packet will be presented to the user. | |
18c915ee TB |
829 | * Can be AV_NOPTS_VALUE if it is not stored in the file. |
830 | * pts MUST be larger or equal to dts as presentation cannot happen before | |
831 | * decompression, unless one wants to view hex dumps. Some formats misuse | |
832 | * the terms dts and pts/cts to mean something different. Such timestamps | |
833 | * must be converted to true pts/dts before they are stored in AVPacket. | |
834 | */ | |
835 | int64_t pts; | |
836 | /** | |
7b356d39 RS |
837 | * Decompression timestamp in AVStream->time_base units; the time at which |
838 | * the packet is decompressed. | |
18c915ee TB |
839 | * Can be AV_NOPTS_VALUE if it is not stored in the file. |
840 | */ | |
841 | int64_t dts; | |
842 | uint8_t *data; | |
843 | int size; | |
844 | int stream_index; | |
9d39cbf6 LB |
845 | /** |
846 | * A combination of AV_PKT_FLAG values | |
847 | */ | |
18c915ee TB |
848 | int flags; |
849 | /** | |
4de339e2 KS |
850 | * Additional packet data that can be provided by the container. |
851 | * Packet can contain several types of side information. | |
852 | */ | |
853 | struct { | |
854 | uint8_t *data; | |
855 | int size; | |
856 | enum AVPacketSideDataType type; | |
857 | } *side_data; | |
858 | int side_data_elems; | |
859 | ||
860 | /** | |
7b356d39 | 861 | * Duration of this packet in AVStream->time_base units, 0 if unknown. |
18c915ee TB |
862 | * Equals next_pts - this_pts in presentation order. |
863 | */ | |
864 | int duration; | |
865 | void (*destruct)(struct AVPacket *); | |
866 | void *priv; | |
867 | int64_t pos; ///< byte position in stream, -1 if unknown | |
868 | ||
869 | /** | |
7b356d39 | 870 | * Time difference in AVStream->time_base units from the pts of this |
18c915ee TB |
871 | * packet to the point at which the output from the decoder has converged |
872 | * independent from the availability of previous frames. That is, the | |
873 | * frames are virtually identical no matter if decoding started from | |
874 | * the very first frame or from this keyframe. | |
875 | * Is AV_NOPTS_VALUE if unknown. | |
876 | * This field is not the display duration of the current packet. | |
8ee82f40 AJ |
877 | * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY |
878 | * set. | |
18c915ee TB |
879 | * |
880 | * The purpose of this field is to allow seeking in streams that have no | |
881 | * keyframes in the conventional sense. It corresponds to the | |
882 | * recovery point SEI in H.264 and match_time_delta in NUT. It is also | |
883 | * essential for some types of subtitle streams to ensure that all | |
884 | * subtitles are correctly displayed after seeking. | |
885 | */ | |
886 | int64_t convergence_duration; | |
887 | } AVPacket; | |
9d39cbf6 LB |
888 | #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe |
889 | #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted | |
18c915ee | 890 | |
0da71265 MN |
891 | /** |
892 | * Audio Video Frame. | |
657ccb5a DB |
893 | * New fields can be added to the end of AVFRAME with minor version |
894 | * bumps. Removal, reordering and changes to existing fields require | |
895 | * a major version bump. | |
8bfb108b | 896 | * sizeof(AVFrame) must not be used outside libav*. |
0da71265 | 897 | */ |
492cd3a9 | 898 | typedef struct AVFrame { |
657ccb5a DB |
899 | /** |
900 | * pointer to the picture planes. | |
901 | * This might be different from the first allocated byte | |
902 | * - encoding: | |
903 | * - decoding: | |
904 | */ | |
905 | uint8_t *data[4]; | |
906 | int linesize[4]; | |
907 | /** | |
908 | * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. | |
909 | * This isn't used by libavcodec unless the default get/release_buffer() is used. | |
910 | * - encoding: | |
911 | * - decoding: | |
912 | */ | |
913 | uint8_t *base[4]; | |
914 | /** | |
915 | * 1 -> keyframe, 0-> not | |
916 | * - encoding: Set by libavcodec. | |
917 | * - decoding: Set by libavcodec. | |
918 | */ | |
919 | int key_frame; | |
920 | ||
921 | /** | |
922 | * Picture type of the frame, see ?_TYPE below. | |
923 | * - encoding: Set by libavcodec. for coded_picture (and set by user for input). | |
924 | * - decoding: Set by libavcodec. | |
925 | */ | |
926 | enum AVPictureType pict_type; | |
927 | ||
928 | /** | |
929 | * presentation timestamp in time_base units (time when frame should be shown to user) | |
930 | * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. | |
931 | * - encoding: MUST be set by user. | |
932 | * - decoding: Set by libavcodec. | |
933 | */ | |
934 | int64_t pts; | |
935 | ||
936 | /** | |
937 | * picture number in bitstream order | |
938 | * - encoding: set by | |
939 | * - decoding: Set by libavcodec. | |
940 | */ | |
941 | int coded_picture_number; | |
942 | /** | |
943 | * picture number in display order | |
944 | * - encoding: set by | |
945 | * - decoding: Set by libavcodec. | |
946 | */ | |
947 | int display_picture_number; | |
948 | ||
949 | /** | |
950 | * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) | |
951 | * - encoding: Set by libavcodec. for coded_picture (and set by user for input). | |
952 | * - decoding: Set by libavcodec. | |
953 | */ | |
954 | int quality; | |
955 | ||
956 | /** | |
957 | * buffer age (1->was last buffer and dint change, 2->..., ...). | |
958 | * Set to INT_MAX if the buffer has not been used yet. | |
959 | * - encoding: unused | |
960 | * - decoding: MUST be set by get_buffer(). | |
961 | */ | |
962 | int age; | |
963 | ||
964 | /** | |
965 | * is this picture used as reference | |
966 | * The values for this are the same as the MpegEncContext.picture_structure | |
967 | * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. | |
968 | * Set to 4 for delayed, non-reference frames. | |
969 | * - encoding: unused | |
970 | * - decoding: Set by libavcodec. (before get_buffer() call)). | |
971 | */ | |
972 | int reference; | |
973 | ||
974 | /** | |
975 | * QP table | |
976 | * - encoding: unused | |
977 | * - decoding: Set by libavcodec. | |
978 | */ | |
979 | int8_t *qscale_table; | |
980 | /** | |
981 | * QP store stride | |
982 | * - encoding: unused | |
983 | * - decoding: Set by libavcodec. | |
984 | */ | |
985 | int qstride; | |
986 | ||
987 | /** | |
988 | * mbskip_table[mb]>=1 if MB didn't change | |
989 | * stride= mb_width = (width+15)>>4 | |
990 | * - encoding: unused | |
991 | * - decoding: Set by libavcodec. | |
992 | */ | |
993 | uint8_t *mbskip_table; | |
994 | ||
995 | /** | |
996 | * motion vector table | |
997 | * @code | |
998 | * example: | |
999 | * int mv_sample_log2= 4 - motion_subsample_log2; | |
1000 | * int mb_width= (width+15)>>4; | |
1001 | * int mv_stride= (mb_width << mv_sample_log2) + 1; | |
1002 | * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; | |
1003 | * @endcode | |
1004 | * - encoding: Set by user. | |
1005 | * - decoding: Set by libavcodec. | |
1006 | */ | |
1007 | int16_t (*motion_val[2])[2]; | |
1008 | ||
1009 | /** | |
1010 | * macroblock type table | |
1011 | * mb_type_base + mb_width + 2 | |
1012 | * - encoding: Set by user. | |
1013 | * - decoding: Set by libavcodec. | |
1014 | */ | |
1015 | uint32_t *mb_type; | |
1016 | ||
1017 | /** | |
1018 | * log2 of the size of the block which a single vector in motion_val represents: | |
1019 | * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) | |
1020 | * - encoding: unused | |
1021 | * - decoding: Set by libavcodec. | |
1022 | */ | |
1023 | uint8_t motion_subsample_log2; | |
1024 | ||
1025 | /** | |
1026 | * for some private data of the user | |
1027 | * - encoding: unused | |
1028 | * - decoding: Set by user. | |
1029 | */ | |
1030 | void *opaque; | |
1031 | ||
1032 | /** | |
1033 | * error | |
1034 | * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. | |
1035 | * - decoding: unused | |
1036 | */ | |
1037 | uint64_t error[4]; | |
1038 | ||
1039 | /** | |
1040 | * type of the buffer (to keep track of who has to deallocate data[*]) | |
1041 | * - encoding: Set by the one who allocates it. | |
1042 | * - decoding: Set by the one who allocates it. | |
1043 | * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. | |
1044 | */ | |
1045 | int type; | |
1046 | ||
1047 | /** | |
1048 | * When decoding, this signals how much the picture must be delayed. | |
1049 | * extra_delay = repeat_pict / (2*fps) | |
1050 | * - encoding: unused | |
1051 | * - decoding: Set by libavcodec. | |
1052 | */ | |
1053 | int repeat_pict; | |
1054 | ||
1055 | /** | |
1056 | * | |
1057 | */ | |
1058 | int qscale_type; | |
1059 | ||
1060 | /** | |
1061 | * The content of the picture is interlaced. | |
1062 | * - encoding: Set by user. | |
1063 | * - decoding: Set by libavcodec. (default 0) | |
1064 | */ | |
1065 | int interlaced_frame; | |
1066 | ||
1067 | /** | |
1068 | * If the content is interlaced, is top field displayed first. | |
1069 | * - encoding: Set by user. | |
1070 | * - decoding: Set by libavcodec. | |
1071 | */ | |
1072 | int top_field_first; | |
1073 | ||
1074 | /** | |
1075 | * Pan scan. | |
1076 | * - encoding: Set by user. | |
1077 | * - decoding: Set by libavcodec. | |
1078 | */ | |
1079 | AVPanScan *pan_scan; | |
1080 | ||
1081 | /** | |
1082 | * Tell user application that palette has changed from previous frame. | |
1083 | * - encoding: ??? (no palette-enabled encoder yet) | |
1084 | * - decoding: Set by libavcodec. (default 0). | |
1085 | */ | |
1086 | int palette_has_changed; | |
1087 | ||
1088 | /** | |
1089 | * codec suggestion on buffer type if != 0 | |
1090 | * - encoding: unused | |
1091 | * - decoding: Set by libavcodec. (before get_buffer() call)). | |
1092 | */ | |
1093 | int buffer_hints; | |
1094 | ||
1095 | /** | |
1096 | * DCT coefficients | |
1097 | * - encoding: unused | |
1098 | * - decoding: Set by libavcodec. | |
1099 | */ | |
1100 | short *dct_coeff; | |
1101 | ||
1102 | /** | |
1103 | * motion reference frame index | |
1104 | * the order in which these are stored can depend on the codec. | |
1105 | * - encoding: Set by user. | |
1106 | * - decoding: Set by libavcodec. | |
1107 | */ | |
1108 | int8_t *ref_index[2]; | |
1109 | ||
1110 | /** | |
1111 | * reordered opaque 64bit (generally an integer or a double precision float | |
1112 | * PTS but can be anything). | |
1113 | * The user sets AVCodecContext.reordered_opaque to represent the input at | |
1114 | * that time, | |
1115 | * the decoder reorders values as needed and sets AVFrame.reordered_opaque | |
1116 | * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque | |
1117 | * @deprecated in favor of pkt_pts | |
1118 | * - encoding: unused | |
1119 | * - decoding: Read by user. | |
1120 | */ | |
1121 | int64_t reordered_opaque; | |
1122 | ||
1123 | /** | |
1124 | * hardware accelerator private data (Libav-allocated) | |
1125 | * - encoding: unused | |
1126 | * - decoding: Set by libavcodec | |
1127 | */ | |
1128 | void *hwaccel_picture_private; | |
1129 | ||
1130 | /** | |
1131 | * reordered pts from the last AVPacket that has been input into the decoder | |
1132 | * - encoding: unused | |
1133 | * - decoding: Read by user. | |
1134 | */ | |
1135 | int64_t pkt_pts; | |
1136 | ||
1137 | /** | |
1138 | * dts from the last AVPacket that has been input into the decoder | |
1139 | * - encoding: unused | |
1140 | * - decoding: Read by user. | |
1141 | */ | |
1142 | int64_t pkt_dts; | |
1143 | ||
1144 | /** | |
1145 | * the AVCodecContext which ff_thread_get_buffer() was last called on | |
1146 | * - encoding: Set by libavcodec. | |
1147 | * - decoding: Set by libavcodec. | |
1148 | */ | |
1149 | struct AVCodecContext *owner; | |
1150 | ||
1151 | /** | |
1152 | * used by multithreading to store frame-specific info | |
1153 | * - encoding: Set by libavcodec. | |
1154 | * - decoding: Set by libavcodec. | |
1155 | */ | |
1156 | void *thread_opaque; | |
492cd3a9 | 1157 | } AVFrame; |
1e491e29 | 1158 | |
f3a29b75 JR |
1159 | struct AVCodecInternal; |
1160 | ||
d33c949c | 1161 | /** |
252f17e2 MN |
1162 | * main external API structure. |
1163 | * New fields can be added to the end with minor version bumps. | |
8bfb108b | 1164 | * Removal, reordering and changes to existing fields require a major |
252f17e2 | 1165 | * version bump. |
8bfb108b | 1166 | * sizeof(AVCodecContext) must not be used outside libav*. |
d33c949c | 1167 | */ |
de6d9b64 | 1168 | typedef struct AVCodecContext { |
b71901e6 | 1169 | /** |
f5bccd85 | 1170 | * information on struct for av_log |
bc874dae MB |
1171 | * - set by avcodec_alloc_context |
1172 | */ | |
d42a814e | 1173 | const AVClass *av_class; |
bc874dae | 1174 | /** |
f5bccd85 DB |
1175 | * the average bitrate |
1176 | * - encoding: Set by user; unused for constant quantizer encoding. | |
1177 | * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. | |
b71901e6 | 1178 | */ |
de6d9b64 | 1179 | int bit_rate; |
b71901e6 MN |
1180 | |
1181 | /** | |
64863965 | 1182 | * number of bits the bitstream is allowed to diverge from the reference. |
b71901e6 | 1183 | * the reference can be CBR (for CBR pass1) or VBR (for pass2) |
f5bccd85 | 1184 | * - encoding: Set by user; unused for constant quantizer encoding. |
64863965 | 1185 | * - decoding: unused |
b71901e6 | 1186 | */ |
115329f1 | 1187 | int bit_rate_tolerance; |
b71901e6 MN |
1188 | |
1189 | /** | |
64863965 | 1190 | * CODEC_FLAG_*. |
f5bccd85 DB |
1191 | * - encoding: Set by user. |
1192 | * - decoding: Set by user. | |
b71901e6 | 1193 | */ |
de6d9b64 | 1194 | int flags; |
b71901e6 MN |
1195 | |
1196 | /** | |
f5bccd85 DB |
1197 | * Some codecs need additional format info. It is stored here. |
1198 | * If any muxer uses this then ALL demuxers/parsers AND encoders for the | |
1199 | * specific codec MUST set it correctly otherwise stream copy breaks. | |
1200 | * In general use of this field by muxers is not recommanded. | |
1201 | * - encoding: Set by libavcodec. | |
1202 | * - decoding: Set by libavcodec. (FIXME: Is this OK?) | |
b71901e6 MN |
1203 | */ |
1204 | int sub_id; | |
1205 | ||
1206 | /** | |
f5bccd85 | 1207 | * Motion estimation algorithm used for video coding. |
58f7833e | 1208 | * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), |
89223ef6 | 1209 | * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] |
64863965 MN |
1210 | * - encoding: MUST be set by user. |
1211 | * - decoding: unused | |
b71901e6 MN |
1212 | */ |
1213 | int me_method; | |
1214 | ||
1215 | /** | |
f5bccd85 DB |
1216 | * some codecs need / can use extradata like Huffman tables. |
1217 | * mjpeg: Huffman tables | |
b71901e6 | 1218 | * rv10: additional flags |
b704e742 | 1219 | * mpeg4: global headers (they can be in the bitstream or here) |
f5bccd85 DB |
1220 | * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger |
1221 | * than extradata_size to avoid prolems if it is read with the bitstream reader. | |
1222 | * The bytewise contents of extradata must not depend on the architecture or CPU endianness. | |
1223 | * - encoding: Set/allocated/freed by libavcodec. | |
1224 | * - decoding: Set/allocated/freed by user. | |
b71901e6 | 1225 | */ |
58f2a4b0 | 1226 | uint8_t *extradata; |
e84c31dc | 1227 | int extradata_size; |
115329f1 | 1228 | |
b71901e6 | 1229 | /** |
f5bccd85 DB |
1230 | * This is the fundamental unit of time (in seconds) in terms |
1231 | * of which frame timestamps are represented. For fixed-fps content, | |
5b28c8c3 MN |
1232 | * timebase should be 1/framerate and timestamp increments should be |
1233 | * identically 1. | |
f5bccd85 DB |
1234 | * - encoding: MUST be set by user. |
1235 | * - decoding: Set by libavcodec. | |
b71901e6 | 1236 | */ |
c0df9d75 | 1237 | AVRational time_base; |
115329f1 | 1238 | |
5b28c8c3 | 1239 | /* video only */ |
14bea432 | 1240 | /** |
21adafec | 1241 | * picture width / height. |
115329f1 | 1242 | * - encoding: MUST be set by user. |
f5bccd85 DB |
1243 | * - decoding: Set by libavcodec. |
1244 | * Note: For compatibility it is possible to set this instead of | |
1245 | * coded_width/height before decoding. | |
b71901e6 | 1246 | */ |
de6d9b64 | 1247 | int width, height; |
115329f1 | 1248 | |
e769f053 | 1249 | #define FF_ASPECT_EXTENDED 15 |
b71901e6 MN |
1250 | |
1251 | /** | |
f5bccd85 DB |
1252 | * the number of pictures in a group of pictures, or 0 for intra_only |
1253 | * - encoding: Set by user. | |
64863965 | 1254 | * - decoding: unused |
b71901e6 MN |
1255 | */ |
1256 | int gop_size; | |
1257 | ||
1258 | /** | |
f5bccd85 | 1259 | * Pixel format, see PIX_FMT_xxx. |
c1bdc930 TH |
1260 | * May be set by the demuxer if known from headers. |
1261 | * May be overriden by the decoder if it knows better. | |
f5bccd85 | 1262 | * - encoding: Set by user. |
c1bdc930 | 1263 | * - decoding: Set by user if known, overridden by libavcodec if known |
b71901e6 | 1264 | */ |
e4eadb4b | 1265 | enum PixelFormat pix_fmt; |
115329f1 | 1266 | |
b71901e6 | 1267 | /** |
f5bccd85 DB |
1268 | * If non NULL, 'draw_horiz_band' is called by the libavcodec |
1269 | * decoder to draw a horizontal band. It improves cache usage. Not | |
b71901e6 | 1270 | * all codecs can do that. You must check the codec capabilities |
f5bccd85 | 1271 | * beforehand. |
37b00b47 AS |
1272 | * When multithreading is used, it may be called from multiple threads |
1273 | * at the same time; threads might draw different parts of the same AVFrame, | |
1274 | * or multiple AVFrames, and there is no guarantee that slices will be drawn | |
1275 | * in order. | |
24b1583a IK |
1276 | * The function is also used by hardware acceleration APIs. |
1277 | * It is called at least once during frame decoding to pass | |
1278 | * the data needed for hardware render. | |
1279 | * In that mode instead of pixel data, AVFrame points to | |
1280 | * a structure specific to the acceleration API. The application | |
1281 | * reads the structure and can change some fields to indicate progress | |
1282 | * or mark state. | |
64863965 | 1283 | * - encoding: unused |
f5bccd85 | 1284 | * - decoding: Set by user. |
3bb07d61 MN |
1285 | * @param height the height of the slice |
1286 | * @param y the y position of the slice | |
1287 | * @param type 1->top field, 2->bottom field, 3->frame | |
1288 | * @param offset offset into the AVFrame.data from which the slice should be read | |
b71901e6 | 1289 | */ |
bf89e6b1 | 1290 | void (*draw_horiz_band)(struct AVCodecContext *s, |
da64ecc3 | 1291 | const AVFrame *src, int offset[4], |
3bb07d61 | 1292 | int y, int type, int height); |
bf89e6b1 | 1293 | |
de6d9b64 | 1294 | /* audio only */ |
f5bccd85 | 1295 | int sample_rate; ///< samples per second |
5fcc4a23 | 1296 | int channels; ///< number of audio channels |
a3a5f4d6 MN |
1297 | |
1298 | /** | |
f5bccd85 DB |
1299 | * audio sample format |
1300 | * - encoding: Set by user. | |
1301 | * - decoding: Set by libavcodec. | |
a3a5f4d6 | 1302 | */ |
5d6e4c16 | 1303 | enum AVSampleFormat sample_fmt; ///< sample format |
de6d9b64 | 1304 | |
f5bccd85 | 1305 | /* The following data should not be initialized. */ |
718b27a7 | 1306 | /** |
f5bccd85 | 1307 | * Samples per packet, initialized when calling 'init'. |
718b27a7 MN |
1308 | */ |
1309 | int frame_size; | |
115329f1 | 1310 | int frame_number; ///< audio or video frame number |
115329f1 | 1311 | |
b71901e6 | 1312 | /** |
f5bccd85 | 1313 | * Number of frames the decoded output will be delayed relative to |
64863965 | 1314 | * the encoded input. |
f5bccd85 | 1315 | * - encoding: Set by libavcodec. |
64863965 | 1316 | * - decoding: unused |
b71901e6 MN |
1317 | */ |
1318 | int delay; | |
115329f1 | 1319 | |
64863965 MN |
1320 | /* - encoding parameters */ |
1321 | float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) | |
115329f1 DB |
1322 | float qblur; ///< amount of qscale smoothing over time (0.0-1.0) |
1323 | ||
b71901e6 | 1324 | /** |
f5bccd85 DB |
1325 | * minimum quantizer |
1326 | * - encoding: Set by user. | |
64863965 | 1327 | * - decoding: unused |
b71901e6 MN |
1328 | */ |
1329 | int qmin; | |
1330 | ||
1331 | /** | |
f5bccd85 DB |
1332 | * maximum quantizer |
1333 | * - encoding: Set by user. | |
64863965 | 1334 | * - decoding: unused |
b71901e6 MN |
1335 | */ |
1336 | int qmax; | |
1337 | ||
1338 | /** | |
f5bccd85 DB |
1339 | * maximum quantizer difference between frames |
1340 | * - encoding: Set by user. | |
64863965 | 1341 | * - decoding: unused |
b71901e6 MN |
1342 | */ |
1343 | int max_qdiff; | |
1344 | ||
1345 | /** | |
f5bccd85 DB |
1346 | * maximum number of B-frames between non-B-frames |
1347 | * Note: The output will be delayed by max_b_frames+1 relative to the input. | |
1348 | * - encoding: Set by user. | |
64863965 | 1349 | * - decoding: unused |
b71901e6 MN |
1350 | */ |
1351 | int max_b_frames; | |
1352 | ||
1353 | /** | |
f5bccd85 | 1354 | * qscale factor between IP and B-frames |
662e5411 | 1355 | * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). |
1356 | * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). | |
f5bccd85 | 1357 | * - encoding: Set by user. |
64863965 | 1358 | * - decoding: unused |
b71901e6 MN |
1359 | */ |
1360 | float b_quant_factor; | |
115329f1 | 1361 | |
b71901e6 MN |
1362 | /** obsolete FIXME remove */ |
1363 | int rc_strategy; | |
64b7c5b6 MN |
1364 | #define FF_RC_STRATEGY_XVID 1 |
1365 | ||
8b4c7dbc | 1366 | int b_frame_strategy; |
9dbcbd92 | 1367 | |
de6d9b64 | 1368 | struct AVCodec *codec; |
115329f1 | 1369 | |
de6d9b64 FB |
1370 | void *priv_data; |
1371 | ||
bb628dae | 1372 | int rtp_payload_size; /* The size of the RTP payload: the coder will */ |
f5bccd85 | 1373 | /* do its best to deliver a chunk with size */ |
644d98a4 | 1374 | /* below rtp_payload_size, the chunk will start */ |
f5bccd85 | 1375 | /* with a start code on some codecs like H.263. */ |
644d98a4 | 1376 | /* This doesn't take account of any particular */ |
f5bccd85 | 1377 | /* headers inside the transmitted RTP payload. */ |
81401c1f | 1378 | |
115329f1 | 1379 | |
f5bccd85 DB |
1380 | /* The RTP callback: This function is called */ |
1381 | /* every time the encoder has a packet to send. */ | |
1382 | /* It depends on the encoder if the data starts */ | |
1383 | /* with a Start Code (it should). H.263 does. */ | |
1384 | /* mb_nb contains the number of macroblocks */ | |
1385 | /* encoded in the RTP payload. */ | |
115329f1 | 1386 | void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); |
81401c1f | 1387 | |
098eefe1 MN |
1388 | /* statistics, used for 2-pass encoding */ |
1389 | int mv_bits; | |
1390 | int header_bits; | |
1391 | int i_tex_bits; | |
1392 | int p_tex_bits; | |
1393 | int i_count; | |
1394 | int p_count; | |
1395 | int skip_count; | |
b71901e6 | 1396 | int misc_bits; |
115329f1 | 1397 | |
b71901e6 | 1398 | /** |
f5bccd85 DB |
1399 | * number of bits used for the previously encoded frame |
1400 | * - encoding: Set by libavcodec. | |
7004ffb3 | 1401 | * - decoding: unused |
b71901e6 | 1402 | */ |
098eefe1 | 1403 | int frame_bits; |
7004ffb3 | 1404 | |
b71901e6 | 1405 | /** |
f5bccd85 DB |
1406 | * Private data of the user, can be used to carry app specific stuff. |
1407 | * - encoding: Set by user. | |
1408 | * - decoding: Set by user. | |
b71901e6 MN |
1409 | */ |
1410 | void *opaque; | |
1411 | ||
de6d9b64 | 1412 | char codec_name[32]; |
72415b2a | 1413 | enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ |
4a663d80 | 1414 | enum CodecID codec_id; /* see CODEC_ID_xxx */ |
115329f1 | 1415 | |
7004ffb3 MN |
1416 | /** |
1417 | * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). | |
f5bccd85 DB |
1418 | * This is used to work around some encoder bugs. |
1419 | * A demuxer should set this to what is stored in the field used to identify the codec. | |
1420 | * If there are multiple such fields in a container then the demuxer should choose the one | |
1421 | * which maximizes the information about the used codec. | |
be73d76b | 1422 | * If the codec tag field in a container is larger than 32 bits then the demuxer should |
f5bccd85 | 1423 | * remap the longer ID to 32 bits with a table or other structure. Alternatively a new |
47bbf8a7 | 1424 | * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated |
f5bccd85 DB |
1425 | * first. |
1426 | * - encoding: Set by user, if not then the default based on codec_id will be used. | |
1427 | * - decoding: Set by user, will be converted to uppercase by libavcodec during init. | |
7004ffb3 MN |
1428 | */ |
1429 | unsigned int codec_tag; | |
115329f1 | 1430 | |
b71901e6 | 1431 | /** |
f5bccd85 DB |
1432 | * Work around bugs in encoders which sometimes cannot be detected automatically. |
1433 | * - encoding: Set by user | |
1434 | * - decoding: Set by user | |
b71901e6 MN |
1435 | */ |
1436 | int workaround_bugs; | |
64863965 | 1437 | #define FF_BUG_AUTODETECT 1 ///< autodetection |
4d2858de MN |
1438 | #define FF_BUG_OLD_MSMPEG4 2 |
1439 | #define FF_BUG_XVID_ILACE 4 | |
1440 | #define FF_BUG_UMP4 8 | |
1441 | #define FF_BUG_NO_PADDING 16 | |
3116cb14 | 1442 | #define FF_BUG_AMV 32 |
f5bccd85 | 1443 | #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default. |
03e93d35 | 1444 | #define FF_BUG_QPEL_CHROMA 64 |
db794953 | 1445 | #define FF_BUG_STD_QPEL 128 |
36df8805 | 1446 | #define FF_BUG_QPEL_CHROMA2 256 |
c40c3482 | 1447 | #define FF_BUG_DIRECT_BLOCKSIZE 512 |
1c6dcb0f | 1448 | #define FF_BUG_EDGE 1024 |
b44bdf7e | 1449 | #define FF_BUG_HPEL_CHROMA 2048 |
4ccde216 | 1450 | #define FF_BUG_DC_CLIP 4096 |
f5bccd85 | 1451 | #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. |
3566042a | 1452 | #define FF_BUG_TRUNCATED 16384 |
f5bccd85 | 1453 | //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%. |
115329f1 | 1454 | |
b71901e6 | 1455 | /** |
f5bccd85 DB |
1456 | * luma single coefficient elimination threshold |
1457 | * - encoding: Set by user. | |
64863965 | 1458 | * - decoding: unused |
b71901e6 | 1459 | */ |
1f6b6e50 | 1460 | int luma_elim_threshold; |
115329f1 | 1461 | |
b71901e6 | 1462 | /** |
f5bccd85 DB |
1463 | * chroma single coeff elimination threshold |
1464 | * - encoding: Set by user. | |
64863965 | 1465 | * - decoding: unused |
b71901e6 | 1466 | */ |
1f6b6e50 | 1467 | int chroma_elim_threshold; |
115329f1 | 1468 | |
b71901e6 | 1469 | /** |
f5bccd85 DB |
1470 | * strictly follow the standard (MPEG4, ...). |
1471 | * - encoding: Set by user. | |
5771b2c3 MN |
1472 | * - decoding: Set by user. |
1473 | * Setting this to STRICT or higher means the encoder and decoder will | |
2d525ef4 | 1474 | * generally do stupid things, whereas setting it to unofficial or lower |
538c0e13 RB |
1475 | * will mean the encoder might produce output that is not supported by all |
1476 | * spec-compliant decoders. Decoders don't differentiate between normal, | |
2d525ef4 | 1477 | * unofficial and experimental (that is, they always try to decode things |
538c0e13 | 1478 | * when they can) unless they are explicitly asked to behave stupidly |
5771b2c3 | 1479 | * (=strictly conform to the specs) |
b71901e6 MN |
1480 | */ |
1481 | int strict_std_compliance; | |
538c0e13 | 1482 | #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. |
f5bccd85 | 1483 | #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. |
9cd81798 | 1484 | #define FF_COMPLIANCE_NORMAL 0 |
2d525ef4 | 1485 | #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions |
f5bccd85 | 1486 | #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. |
9cd81798 | 1487 | |
b71901e6 | 1488 | /** |
f5bccd85 | 1489 | * qscale offset between IP and B-frames |
f5bccd85 | 1490 | * - encoding: Set by user. |
64863965 | 1491 | * - decoding: unused |
b71901e6 MN |
1492 | */ |
1493 | float b_quant_offset; | |
115329f1 | 1494 | |
582f2311 | 1495 | #if FF_API_ER |
b71901e6 | 1496 | /** |
b2700a5c | 1497 | * Error recognition; higher values will detect more errors but may |
f5bccd85 | 1498 | * misdetect some more or less valid parts as errors. |
64863965 | 1499 | * - encoding: unused |
f5bccd85 | 1500 | * - decoding: Set by user. |
b71901e6 | 1501 | */ |
582f2311 | 1502 | attribute_deprecated int error_recognition; |
1471c6c2 | 1503 | #define FF_ER_CAREFUL 1 |
ce3bcaed MN |
1504 | #define FF_ER_COMPLIANT 2 |
1505 | #define FF_ER_AGGRESSIVE 3 | |
1506 | #define FF_ER_VERY_AGGRESSIVE 4 | |
2a11952f | 1507 | #define FF_ER_EXPLODE 5 |
ac90a714 | 1508 | #endif /* FF_API_ER */ |
115329f1 | 1509 | |
6b72ac63 | 1510 | /** |
f5bccd85 DB |
1511 | * Called at the beginning of each frame to get a buffer for it. |
1512 | * If pic.reference is set then the frame will be read later by libavcodec. | |
eb285cfe | 1513 | * avcodec_align_dimensions2() should be used to find the required width and |
f5bccd85 | 1514 | * height, as they normally need to be rounded up to the next multiple of 16. |
f1b99cc6 MN |
1515 | * if CODEC_CAP_DR1 is not set then get_buffer() must call |
1516 | * avcodec_default_get_buffer() instead of providing buffers allocated by | |
1517 | * some other means. | |
37b00b47 AS |
1518 | * If frame multithreading is used and thread_safe_callbacks is set, |
1519 | * it may be called from a different thread, but not from more than one at once. | |
1520 | * Does not need to be reentrant. | |
64863965 | 1521 | * - encoding: unused |
53128bc3 | 1522 | * - decoding: Set by libavcodec, user can override. |
b71901e6 | 1523 | */ |
492cd3a9 | 1524 | int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); |
115329f1 | 1525 | |
b71901e6 | 1526 | /** |
69b192ac | 1527 | * Called to release buffers which were allocated with get_buffer. |
f5bccd85 DB |
1528 | * A released buffer can be reused in get_buffer(). |
1529 | * pic.data[*] must be set to NULL. | |
37b00b47 AS |
1530 | * May be called from a different thread if frame multithreading is used, |
1531 | * but not by more than one thread at once, so does not need to be reentrant. | |
64863965 | 1532 | * - encoding: unused |
53128bc3 | 1533 | * - decoding: Set by libavcodec, user can override. |
b71901e6 | 1534 | */ |
492cd3a9 | 1535 | void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); |
0fd90455 | 1536 | |
b71901e6 | 1537 | /** |
eb8a25c8 | 1538 | * Size of the frame reordering buffer in the decoder. |
2d7b0560 | 1539 | * For MPEG-2 it is 1 IPB or 0 low delay IP. |
f5bccd85 DB |
1540 | * - encoding: Set by libavcodec. |
1541 | * - decoding: Set by libavcodec. | |
b71901e6 MN |
1542 | */ |
1543 | int has_b_frames; | |
718b27a7 MN |
1544 | |
1545 | /** | |
1546 | * number of bytes per packet if constant and known or 0 | |
f5bccd85 | 1547 | * Used by some WAV based audio codecs. |
718b27a7 MN |
1548 | */ |
1549 | int block_align; | |
115329f1 | 1550 | |
512557b2 JR |
1551 | #if FF_API_PARSE_FRAME |
1552 | /** | |
1553 | * If true, only parsing is done. The frame data is returned. | |
1554 | * Only MPEG audio decoders support this now. | |
1555 | * - encoding: unused | |
1556 | * - decoding: Set by user | |
1557 | */ | |
1558 | attribute_deprecated int parse_only; | |
1559 | #endif | |
115329f1 | 1560 | |
b71901e6 | 1561 | /** |
f5bccd85 DB |
1562 | * 0-> h263 quant 1-> mpeg quant |
1563 | * - encoding: Set by user. | |
64863965 | 1564 | * - decoding: unused |
b71901e6 MN |
1565 | */ |
1566 | int mpeg_quant; | |
115329f1 | 1567 | |
b71901e6 | 1568 | /** |
f5bccd85 DB |
1569 | * pass1 encoding statistics output buffer |
1570 | * - encoding: Set by libavcodec. | |
64863965 | 1571 | * - decoding: unused |
b71901e6 | 1572 | */ |
64863965 | 1573 | char *stats_out; |
115329f1 | 1574 | |
b71901e6 | 1575 | /** |
f5bccd85 DB |
1576 | * pass2 encoding statistics input buffer |
1577 | * Concatenated stuff from stats_out of pass1 should be placed here. | |
1578 | * - encoding: Allocated/set/freed by user. | |
64863965 | 1579 | * - decoding: unused |
b71901e6 MN |
1580 | */ |
1581 | char *stats_in; | |
115329f1 | 1582 | |
b71901e6 | 1583 | /** |
f5bccd85 DB |
1584 | * ratecontrol qmin qmax limiting method |
1585 | * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. | |
1586 | * - encoding: Set by user. | |
64863965 | 1587 | * - decoding: unused |
b71901e6 | 1588 | */ |
ce980a95 | 1589 | float rc_qsquish; |
b71901e6 | 1590 | |
ce980a95 MN |
1591 | float rc_qmod_amp; |
1592 | int rc_qmod_freq; | |
115329f1 | 1593 | |
b71901e6 | 1594 | /** |
f5bccd85 DB |
1595 | * ratecontrol override, see RcOverride |
1596 | * - encoding: Allocated/set/freed by user. | |
64863965 | 1597 | * - decoding: unused |
b71901e6 | 1598 | */ |
ce980a95 MN |
1599 | RcOverride *rc_override; |
1600 | int rc_override_count; | |
115329f1 | 1601 | |
b71901e6 | 1602 | /** |
f5bccd85 DB |
1603 | * rate control equation |
1604 | * - encoding: Set by user | |
64863965 | 1605 | * - decoding: unused |
b71901e6 | 1606 | */ |
6881b8e5 | 1607 | const char *rc_eq; |
115329f1 | 1608 | |
b71901e6 | 1609 | /** |
f5bccd85 DB |
1610 | * maximum bitrate |
1611 | * - encoding: Set by user. | |
64863965 | 1612 | * - decoding: unused |
b71901e6 | 1613 | */ |
ce980a95 | 1614 | int rc_max_rate; |
115329f1 | 1615 | |
b71901e6 | 1616 | /** |
f5bccd85 DB |
1617 | * minimum bitrate |
1618 | * - encoding: Set by user. | |
64863965 | 1619 | * - decoding: unused |
b71901e6 | 1620 | */ |
ce980a95 | 1621 | int rc_min_rate; |
115329f1 | 1622 | |
b71901e6 | 1623 | /** |
f5bccd85 DB |
1624 | * decoder bitstream buffer size |
1625 | * - encoding: Set by user. | |
64863965 | 1626 | * - decoding: unused |
b71901e6 | 1627 | */ |
ce980a95 MN |
1628 | int rc_buffer_size; |
1629 | float rc_buffer_aggressivity; | |
b71901e6 MN |
1630 | |
1631 | /** | |
f5bccd85 DB |
1632 | * qscale factor between P and I-frames |
1633 | * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). | |
1634 | * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). | |
1635 | * - encoding: Set by user. | |
64863965 | 1636 | * - decoding: unused |
b71901e6 MN |
1637 | */ |
1638 | float i_quant_factor; | |
115329f1 | 1639 | |
b71901e6 | 1640 | /** |
f5bccd85 DB |
1641 | * qscale offset between P and I-frames |
1642 | * - encoding: Set by user. | |
64863965 | 1643 | * - decoding: unused |
b71901e6 MN |
1644 | */ |
1645 | float i_quant_offset; | |
115329f1 | 1646 | |
b71901e6 | 1647 | /** |
f5bccd85 DB |
1648 | * initial complexity for pass1 ratecontrol |
1649 | * - encoding: Set by user. | |
64863965 | 1650 | * - decoding: unused |
b71901e6 | 1651 | */ |
ce980a95 | 1652 | float rc_initial_cplx; |
917e06c8 | 1653 | |
b71901e6 | 1654 | /** |
f5bccd85 DB |
1655 | * DCT algorithm, see FF_DCT_* below |
1656 | * - encoding: Set by user. | |
64863965 | 1657 | * - decoding: unused |
b71901e6 | 1658 | */ |
28db7fce | 1659 | int dct_algo; |
c7e07931 | 1660 | #define FF_DCT_AUTO 0 |
28db7fce | 1661 | #define FF_DCT_FASTINT 1 |
c7e07931 MO |
1662 | #define FF_DCT_INT 2 |
1663 | #define FF_DCT_MMX 3 | |
1664 | #define FF_DCT_MLIB 4 | |
05c4072b | 1665 | #define FF_DCT_ALTIVEC 5 |
65e4c8c9 | 1666 | #define FF_DCT_FAAN 6 |
115329f1 | 1667 | |
c5d309f2 | 1668 | /** |
f5bccd85 DB |
1669 | * luminance masking (0-> disabled) |
1670 | * - encoding: Set by user. | |
64863965 | 1671 | * - decoding: unused |
c5d309f2 MN |
1672 | */ |
1673 | float lumi_masking; | |
115329f1 | 1674 | |
c5d309f2 | 1675 | /** |
f5bccd85 DB |
1676 | * temporary complexity masking (0-> disabled) |
1677 | * - encoding: Set by user. | |
64863965 | 1678 | * - decoding: unused |
c5d309f2 MN |
1679 | */ |
1680 | float temporal_cplx_masking; | |
115329f1 | 1681 | |
c5d309f2 | 1682 | /** |
f5bccd85 DB |
1683 | * spatial complexity masking (0-> disabled) |
1684 | * - encoding: Set by user. | |
64863965 | 1685 | * - decoding: unused |
c5d309f2 MN |
1686 | */ |
1687 | float spatial_cplx_masking; | |
115329f1 | 1688 | |
c5d309f2 | 1689 | /** |
f5bccd85 DB |
1690 | * p block masking (0-> disabled) |
1691 | * - encoding: Set by user. | |
64863965 | 1692 | * - decoding: unused |
c5d309f2 MN |
1693 | */ |
1694 | float p_masking; | |
15415af4 | 1695 | |
5e746b99 | 1696 | /** |
f5bccd85 DB |
1697 | * darkness masking (0-> disabled) |
1698 | * - encoding: Set by user. | |
64863965 | 1699 | * - decoding: unused |
5e746b99 MN |
1700 | */ |
1701 | float dark_masking; | |
115329f1 | 1702 | |
0c2dd16e | 1703 | /** |
f5bccd85 DB |
1704 | * IDCT algorithm, see FF_IDCT_* below. |
1705 | * - encoding: Set by user. | |
1706 | * - decoding: Set by user. | |
2ad1516a MN |
1707 | */ |
1708 | int idct_algo; | |
273b0cd3 DB |
1709 | #define FF_IDCT_AUTO 0 |
1710 | #define FF_IDCT_INT 1 | |
1711 | #define FF_IDCT_SIMPLE 2 | |
1712 | #define FF_IDCT_SIMPLEMMX 3 | |
1713 | #define FF_IDCT_LIBMPEG2MMX 4 | |
1714 | #define FF_IDCT_PS2 5 | |
1715 | #define FF_IDCT_MLIB 6 | |
1716 | #define FF_IDCT_ARM 7 | |
1717 | #define FF_IDCT_ALTIVEC 8 | |
1718 | #define FF_IDCT_SH4 9 | |
1719 | #define FF_IDCT_SIMPLEARM 10 | |
1720 | #define FF_IDCT_H264 11 | |
1721 | #define FF_IDCT_VP3 12 | |
1722 | #define FF_IDCT_IPP 13 | |
1723 | #define FF_IDCT_XVIDMMX 14 | |
1724 | #define FF_IDCT_CAVS 15 | |
a0403006 | 1725 | #define FF_IDCT_SIMPLEARMV5TE 16 |
273b0cd3 | 1726 | #define FF_IDCT_SIMPLEARMV6 17 |
d9420d4d | 1727 | #define FF_IDCT_SIMPLEVIS 18 |
9abc7e0f | 1728 | #define FF_IDCT_WMV2 19 |
6f08c541 | 1729 | #define FF_IDCT_FAAN 20 |
42b30357 | 1730 | #define FF_IDCT_EA 21 |
7eec4328 | 1731 | #define FF_IDCT_SIMPLENEON 22 |
74c47463 | 1732 | #define FF_IDCT_SIMPLEALPHA 23 |
342c7dfd | 1733 | #define FF_IDCT_BINK 24 |
2ad1516a | 1734 | |
144f0625 | 1735 | /** |
f5bccd85 DB |
1736 | * slice count |
1737 | * - encoding: Set by libavcodec. | |
1738 | * - decoding: Set by user (or 0). | |
144f0625 MN |
1739 | */ |
1740 | int slice_count; | |
1741 | /** | |
f5bccd85 DB |
1742 | * slice offsets in the frame in bytes |
1743 | * - encoding: Set/allocated by libavcodec. | |
1744 | * - decoding: Set/allocated by user (or NULL). | |
144f0625 MN |
1745 | */ |
1746 | int *slice_offset; | |
1747 | ||
4d2858de | 1748 | /** |
f5bccd85 | 1749 | * error concealment flags |
64863965 | 1750 | * - encoding: unused |
f5bccd85 | 1751 | * - decoding: Set by user. |
4d2858de MN |
1752 | */ |
1753 | int error_concealment; | |
1754 | #define FF_EC_GUESS_MVS 1 | |
1755 | #define FF_EC_DEBLOCK 2 | |
1756 | ||
6b72ac63 | 1757 | /** |
bec89a84 | 1758 | * dsp_mask could be add used to disable unwanted CPU features |
8350df97 | 1759 | * CPU features (i.e. MMX, SSE. ...) |
bec89a84 | 1760 | * |
f5bccd85 DB |
1761 | * With the FORCE flag you may instead enable given CPU features. |
1762 | * (Dangerous: Usable in case of misdetection, improper usage however will | |
1763 | * result into program crash.) | |
bec89a84 ZK |
1764 | */ |
1765 | unsigned dsp_mask; | |
7160bb71 | 1766 | |
11f18faf | 1767 | /** |
64863965 | 1768 | * bits per sample/pixel from the demuxer (needed for huffyuv). |
f5bccd85 DB |
1769 | * - encoding: Set by libavcodec. |
1770 | * - decoding: Set by user. | |
11f18faf | 1771 | */ |
46a73068 | 1772 | int bits_per_coded_sample; |
115329f1 | 1773 | |
11f18faf | 1774 | /** |
f5bccd85 DB |
1775 | * prediction method (needed for huffyuv) |
1776 | * - encoding: Set by user. | |
64863965 | 1777 | * - decoding: unused |
11f18faf MN |
1778 | */ |
1779 | int prediction_method; | |
1780 | #define FF_PRED_LEFT 0 | |
1781 | #define FF_PRED_PLANE 1 | |
1782 | #define FF_PRED_MEDIAN 2 | |
115329f1 | 1783 | |
5d3cea3a | 1784 | /** |
f5bccd85 | 1785 | * sample aspect ratio (0 if unknown) |
8e5af7a6 | 1786 | * That is the width of a pixel divided by the height of the pixel. |
f5bccd85 DB |
1787 | * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. |
1788 | * - encoding: Set by user. | |
1789 | * - decoding: Set by libavcodec. | |
5d3cea3a | 1790 | */ |
5ff85f1d | 1791 | AVRational sample_aspect_ratio; |
1e491e29 MN |
1792 | |
1793 | /** | |
f5bccd85 DB |
1794 | * the picture in the bitstream |
1795 | * - encoding: Set by libavcodec. | |
1796 | * - decoding: Set by libavcodec. | |
1e491e29 | 1797 | */ |
492cd3a9 | 1798 | AVFrame *coded_frame; |
c8c437bc MN |
1799 | |
1800 | /** | |
f5bccd85 DB |
1801 | * debug |
1802 | * - encoding: Set by user. | |
1803 | * - decoding: Set by user. | |
c8c437bc MN |
1804 | */ |
1805 | int debug; | |
273b0cd3 DB |
1806 | #define FF_DEBUG_PICT_INFO 1 |
1807 | #define FF_DEBUG_RC 2 | |
1808 | #define FF_DEBUG_BITSTREAM 4 | |
1809 | #define FF_DEBUG_MB_TYPE 8 | |
1810 | #define FF_DEBUG_QP 16 | |
1811 | #define FF_DEBUG_MV 32 | |
1812 | #define FF_DEBUG_DCT_COEFF 0x00000040 | |
1813 | #define FF_DEBUG_SKIP 0x00000080 | |
1814 | #define FF_DEBUG_STARTCODE 0x00000100 | |
1815 | #define FF_DEBUG_PTS 0x00000200 | |
1816 | #define FF_DEBUG_ER 0x00000400 | |
1817 | #define FF_DEBUG_MMCO 0x00000800 | |
1818 | #define FF_DEBUG_BUGS 0x00001000 | |
1819 | #define FF_DEBUG_VIS_QP 0x00002000 | |
864119b6 | 1820 | #define FF_DEBUG_VIS_MB_TYPE 0x00004000 |
385c820b | 1821 | #define FF_DEBUG_BUFFERS 0x00008000 |
37b00b47 | 1822 | #define FF_DEBUG_THREADS 0x00010000 |
115329f1 | 1823 | |
140cb663 | 1824 | /** |
f5bccd85 DB |
1825 | * debug |
1826 | * - encoding: Set by user. | |
1827 | * - decoding: Set by user. | |
0c9bbaec WH |
1828 | */ |
1829 | int debug_mv; | |
1830 | #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames | |
1831 | #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames | |
1832 | #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames | |
1833 | ||
1834 | /** | |
f5bccd85 DB |
1835 | * error |
1836 | * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. | |
64863965 | 1837 | * - decoding: unused |
140cb663 MN |
1838 | */ |
1839 | uint64_t error[4]; | |
115329f1 | 1840 | |
1457ab52 | 1841 | /** |
f5bccd85 DB |
1842 | * motion estimation comparison function |
1843 | * - encoding: Set by user. | |
64863965 | 1844 | * - decoding: unused |
1457ab52 MN |
1845 | */ |
1846 | int me_cmp; | |
1847 | /** | |
f5bccd85 DB |
1848 | * subpixel motion estimation comparison function |
1849 | * - encoding: Set by user. | |
64863965 | 1850 | * - decoding: unused |
1457ab52 MN |
1851 | */ |
1852 | int me_sub_cmp; | |
1853 | /** | |
f5bccd85 DB |
1854 | * macroblock comparison function (not supported yet) |
1855 | * - encoding: Set by user. | |
64863965 | 1856 | * - decoding: unused |
1457ab52 MN |
1857 | */ |
1858 | int mb_cmp; | |
622348f9 | 1859 | /** |
f5bccd85 DB |
1860 | * interlaced DCT comparison function |
1861 | * - encoding: Set by user. | |
622348f9 MN |
1862 | * - decoding: unused |
1863 | */ | |
1864 | int ildct_cmp; | |
273b0cd3 DB |
1865 | #define FF_CMP_SAD 0 |
1866 | #define FF_CMP_SSE 1 | |
1867 | #define FF_CMP_SATD 2 | |
1868 | #define FF_CMP_DCT 3 | |
1869 | #define FF_CMP_PSNR 4 | |
1870 | #define FF_CMP_BIT 5 | |
1871 | #define FF_CMP_RD 6 | |
1872 | #define FF_CMP_ZERO 7 | |
1873 | #define FF_CMP_VSAD 8 | |
1874 | #define FF_CMP_VSSE 9 | |
1875 | #define FF_CMP_NSSE 10 | |
1876 | #define FF_CMP_W53 11 | |
1877 | #define FF_CMP_W97 12 | |
0fd6aea1 | 1878 | #define FF_CMP_DCTMAX 13 |
27c61ac5 | 1879 | #define FF_CMP_DCT264 14 |
1457ab52 | 1880 | #define FF_CMP_CHROMA 256 |
115329f1 | 1881 | |
1457ab52 | 1882 | /** |
f5bccd85 DB |
1883 | * ME diamond size & shape |
1884 | * - encoding: Set by user. | |
64863965 | 1885 | * - decoding: unused |
1457ab52 MN |
1886 | */ |
1887 | int dia_size; | |
b07a5980 MN |
1888 | |
1889 | /** | |
f5bccd85 DB |
1890 | * amount of previous MV predictors (2a+1 x 2a+1 square) |
1891 | * - encoding: Set by user. | |
64863965 | 1892 | * - decoding: unused |
b07a5980 MN |
1893 | */ |
1894 | int last_predictor_count; | |
70ac76c0 | 1895 | |
f5fb6b34 | 1896 | /** |
f5bccd85 DB |
1897 | * prepass for motion estimation |
1898 | * - encoding: Set by user. | |
64863965 | 1899 | * - decoding: unused |
f5fb6b34 MN |
1900 | */ |
1901 | int pre_me; | |
b07a5980 | 1902 | |
70ac76c0 | 1903 | /** |
f5bccd85 DB |
1904 | * motion estimation prepass comparison function |
1905 | * - encoding: Set by user. | |
64863965 | 1906 | * - decoding: unused |
70ac76c0 MN |
1907 | */ |
1908 | int me_pre_cmp; | |
826f429a | 1909 | |
70ac76c0 | 1910 | /** |
f5bccd85 DB |
1911 | * ME prepass diamond size & shape |
1912 | * - encoding: Set by user. | |
64863965 | 1913 | * - decoding: unused |
70ac76c0 MN |
1914 | */ |
1915 | int pre_dia_size; | |
1916 | ||
826f429a | 1917 | /** |
f5bccd85 DB |
1918 | * subpel ME quality |
1919 | * - encoding: Set by user. | |
64863965 | 1920 | * - decoding: unused |
826f429a MN |
1921 | */ |
1922 | int me_subpel_quality; | |
1923 | ||
a33c7159 | 1924 | /** |
f5bccd85 | 1925 | * callback to negotiate the pixelFormat |
a33c7159 | 1926 | * @param fmt is the list of formats which are supported by the codec, |
f5bccd85 DB |
1927 | * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. |
1928 | * The first is always the native one. | |
1929 | * @return the chosen format | |
64863965 | 1930 | * - encoding: unused |
f5bccd85 | 1931 | * - decoding: Set by user, if not set the native format will be chosen. |
a33c7159 | 1932 | */ |
494c56d3 | 1933 | enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt); |
e2f9490e FB |
1934 | |
1935 | /** | |
f5bccd85 DB |
1936 | * DTG active format information (additional aspect ratio |
1937 | * information only used in DVB MPEG-2 transport streams) | |
1938 | * 0 if not set. | |
115329f1 | 1939 | * |
f5bccd85 DB |
1940 | * - encoding: unused |
1941 | * - decoding: Set by decoder. | |
e2f9490e FB |
1942 | */ |
1943 | int dtg_active_format; | |
1944 | #define FF_DTG_AFD_SAME 8 | |
1945 | #define FF_DTG_AFD_4_3 9 | |
1946 | #define FF_DTG_AFD_16_9 10 | |
1947 | #define FF_DTG_AFD_14_9 11 | |
1948 | #define FF_DTG_AFD_4_3_SP_14_9 13 | |
1949 | #define FF_DTG_AFD_16_9_SP_14_9 14 | |
1950 | #define FF_DTG_AFD_SP_4_3 15 | |
1951 | ||
ebbcdc9a | 1952 | /** |
f5bccd85 DB |
1953 | * maximum motion estimation search range in subpel units |
1954 | * If 0 then no limit. | |
115329f1 | 1955 | * |
f5bccd85 DB |
1956 | * - encoding: Set by user. |
1957 | * - decoding: unused | |
ebbcdc9a | 1958 | */ |
59e0ac8e | 1959 | int me_range; |
ebbcdc9a | 1960 | |
65f7062d | 1961 | /** |
f5bccd85 DB |
1962 | * intra quantizer bias |
1963 | * - encoding: Set by user. | |
1984f635 MN |
1964 | * - decoding: unused |
1965 | */ | |
1966 | int intra_quant_bias; | |
1967 | #define FF_DEFAULT_QUANT_BIAS 999999 | |
115329f1 | 1968 | |
1984f635 | 1969 | /** |
f5bccd85 DB |
1970 | * inter quantizer bias |
1971 | * - encoding: Set by user. | |
1984f635 MN |
1972 | * - decoding: unused |
1973 | */ | |
1974 | int inter_quant_bias; | |
5cd62665 ZK |
1975 | |
1976 | /** | |
f5bccd85 DB |
1977 | * color table ID |
1978 | * - encoding: unused | |
1979 | * - decoding: Which clrtable should be used for 8bit RGB images. | |
1980 | * Tables have to be stored somewhere. FIXME | |
5cd62665 ZK |
1981 | */ |
1982 | int color_table_id; | |
115329f1 | 1983 | |
f3a29b75 | 1984 | #if FF_API_INTERNAL_CONTEXT |
d90cf87b | 1985 | /** |
f5bccd85 DB |
1986 | * internal_buffer count |
1987 | * Don't touch, used by libavcodec default_get_buffer(). | |
f3a29b75 | 1988 | * @deprecated this field was moved to an internal context |
d90cf87b | 1989 | */ |
f3a29b75 | 1990 | attribute_deprecated int internal_buffer_count; |
115329f1 | 1991 | |
d90cf87b | 1992 | /** |
f5bccd85 DB |
1993 | * internal_buffers |
1994 | * Don't touch, used by libavcodec default_get_buffer(). | |
f3a29b75 | 1995 | * @deprecated this field was moved to an internal context |
d90cf87b | 1996 | */ |
f3a29b75 JR |
1997 | attribute_deprecated void *internal_buffer; |
1998 | #endif | |
158c7f05 | 1999 | |
3d2e8cce | 2000 | /** |
f5bccd85 DB |
2001 | * Global quality for codecs which cannot change it per frame. |
2002 | * This should be proportional to MPEG-1/2/4 qscale. | |
2003 | * - encoding: Set by user. | |
3d2e8cce MN |
2004 | * - decoding: unused |
2005 | */ | |
2006 | int global_quality; | |
115329f1 | 2007 | |
bd446bb1 MN |
2008 | #define FF_CODER_TYPE_VLC 0 |
2009 | #define FF_CODER_TYPE_AC 1 | |
f87459e4 KN |
2010 | #define FF_CODER_TYPE_RAW 2 |
2011 | #define FF_CODER_TYPE_RLE 3 | |
2012 | #define FF_CODER_TYPE_DEFLATE 4 | |
11e659c2 MN |
2013 | /** |
2014 | * coder type | |
f5bccd85 | 2015 | * - encoding: Set by user. |
11e659c2 MN |
2016 | * - decoding: unused |
2017 | */ | |
2018 | int coder_type; | |
2019 | ||
2020 | /** | |
2021 | * context model | |
f5bccd85 | 2022 | * - encoding: Set by user. |
11e659c2 MN |
2023 | * - decoding: unused |
2024 | */ | |
2025 | int context_model; | |
5639729b MN |
2026 | #if 0 |
2027 | /** | |
2028 | * | |
2029 | * - encoding: unused | |
f5bccd85 | 2030 | * - decoding: Set by user. |
5639729b MN |
2031 | */ |
2032 | uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size); | |
2033 | #endif | |
115329f1 | 2034 | |
3bb07d61 MN |
2035 | /** |
2036 | * slice flags | |
2037 | * - encoding: unused | |
f5bccd85 | 2038 | * - decoding: Set by user. |
3bb07d61 MN |
2039 | */ |
2040 | int slice_flags; | |
2041 | #define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display | |
2042 | #define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics) | |
2043 | #define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) | |
2044 | ||
fb364ada IK |
2045 | /** |
2046 | * XVideo Motion Acceleration | |
2047 | * - encoding: forbidden | |
2048 | * - decoding: set by decoder | |
2049 | */ | |
2050 | int xvmc_acceleration; | |
115329f1 | 2051 | |
7d1c3fc1 MN |
2052 | /** |
2053 | * macroblock decision mode | |
f5bccd85 | 2054 | * - encoding: Set by user. |
7d1c3fc1 MN |
2055 | * - decoding: unused |
2056 | */ | |
2057 | int mb_decision; | |
2058 | #define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp | |
2059 | #define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits | |
e6dba5df | 2060 | #define FF_MB_DECISION_RD 2 ///< rate distortion |
d6eb3c50 MN |
2061 | |
2062 | /** | |
2063 | * custom intra quantization matrix | |
f5bccd85 DB |
2064 | * - encoding: Set by user, can be NULL. |
2065 | * - decoding: Set by libavcodec. | |
d6eb3c50 MN |
2066 | */ |
2067 | uint16_t *intra_matrix; | |
2068 | ||
2069 | /** | |
2070 | * custom inter quantization matrix | |
f5bccd85 DB |
2071 | * - encoding: Set by user, can be NULL. |
2072 | * - decoding: Set by libavcodec. | |
d6eb3c50 MN |
2073 | */ |
2074 | uint16_t *inter_matrix; | |
115329f1 | 2075 | |
541ae140 MN |
2076 | /** |
2077 | * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). | |
f5bccd85 | 2078 | * This is used to work around some encoder bugs. |
541ae140 | 2079 | * - encoding: unused |
f5bccd85 | 2080 | * - decoding: Set by user, will be converted to uppercase by libavcodec during init. |
541ae140 MN |
2081 | */ |
2082 | unsigned int stream_codec_tag; | |
05fbd0a2 MN |
2083 | |
2084 | /** | |
f5bccd85 DB |
2085 | * scene change detection threshold |
2086 | * 0 is default, larger means fewer detected scene changes. | |
2087 | * - encoding: Set by user. | |
05fbd0a2 MN |
2088 | * - decoding: unused |
2089 | */ | |
2090 | int scenechange_threshold; | |
158c7f05 MN |
2091 | |
2092 | /** | |
f5bccd85 DB |
2093 | * minimum Lagrange multipler |
2094 | * - encoding: Set by user. | |
158c7f05 MN |
2095 | * - decoding: unused |
2096 | */ | |
2097 | int lmin; | |
2098 | ||
2099 | /** | |
f5bccd85 DB |
2100 | * maximum Lagrange multipler |
2101 | * - encoding: Set by user. | |
158c7f05 MN |
2102 | * - decoding: unused |
2103 | */ | |
2104 | int lmax; | |
2a2bbcb0 | 2105 | |
eda7c983 | 2106 | #if FF_API_PALETTE_CONTROL |
2a2bbcb0 | 2107 | /** |
f5bccd85 | 2108 | * palette control structure |
2a2bbcb0 | 2109 | * - encoding: ??? (no palette-enabled encoder yet) |
f5bccd85 | 2110 | * - decoding: Set by user. |
2a2bbcb0 MM |
2111 | */ |
2112 | struct AVPaletteControl *palctrl; | |
eda7c983 | 2113 | #endif |
821cb11f MN |
2114 | |
2115 | /** | |
2116 | * noise reduction strength | |
f5bccd85 | 2117 | * - encoding: Set by user. |
821cb11f MN |
2118 | * - decoding: unused |
2119 | */ | |
2120 | int noise_reduction; | |
115329f1 | 2121 | |
074c4ca7 | 2122 | /** |
f5bccd85 DB |
2123 | * Called at the beginning of a frame to get cr buffer for it. |
2124 | * Buffer type (size, hints) must be the same. libavcodec won't check it. | |
2125 | * libavcodec will pass previous buffer in pic, function should return | |
e1c2a5a0 | 2126 | * same buffer or new buffer with old frame "painted" into it. |
f5bccd85 | 2127 | * If pic.data[0] == NULL must behave like get_buffer(). |
f1b99cc6 MN |
2128 | * if CODEC_CAP_DR1 is not set then reget_buffer() must call |
2129 | * avcodec_default_reget_buffer() instead of providing buffers allocated by | |
2130 | * some other means. | |
074c4ca7 | 2131 | * - encoding: unused |
53128bc3 | 2132 | * - decoding: Set by libavcodec, user can override. |
074c4ca7 | 2133 | */ |
e1c2a5a0 | 2134 | int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic); |
ba58dabc MN |
2135 | |
2136 | /** | |
f5bccd85 DB |
2137 | * Number of bits which should be loaded into the rc buffer before decoding starts. |
2138 | * - encoding: Set by user. | |
ba58dabc MN |
2139 | * - decoding: unused |
2140 | */ | |
2141 | int rc_initial_buffer_occupancy; | |
2142 | ||
2143 | /** | |
2144 | * | |
f5bccd85 | 2145 | * - encoding: Set by user. |
ba58dabc MN |
2146 | * - decoding: unused |
2147 | */ | |
2148 | int inter_threshold; | |
2149 | ||
2150 | /** | |
f5bccd85 DB |
2151 | * CODEC_FLAG2_* |
2152 | * - encoding: Set by user. | |
2153 | * - decoding: Set by user. | |
ba58dabc MN |
2154 | */ |
2155 | int flags2; | |
7ebfc0ea MN |
2156 | |
2157 | /** | |
f5bccd85 DB |
2158 | * Simulates errors in the bitstream to test error concealment. |
2159 | * - encoding: Set by user. | |
2160 | * - decoding: unused | |
7ebfc0ea MN |
2161 | */ |
2162 | int error_rate; | |
115329f1 | 2163 | |
4e3945fd | 2164 | #if FF_API_ANTIALIAS_ALGO |
a1e257b2 MN |
2165 | /** |
2166 | * MP3 antialias algorithm, see FF_AA_* below. | |
2167 | * - encoding: unused | |
f5bccd85 | 2168 | * - decoding: Set by user. |
a1e257b2 | 2169 | */ |
4e3945fd | 2170 | attribute_deprecated int antialias_algo; |
a1e257b2 MN |
2171 | #define FF_AA_AUTO 0 |
2172 | #define FF_AA_FASTINT 1 //not implemented yet | |
2173 | #define FF_AA_INT 2 | |
2174 | #define FF_AA_FLOAT 3 | |
4e3945fd AK |
2175 | #endif |
2176 | ||
77ea0d4b | 2177 | /** |
f5bccd85 DB |
2178 | * quantizer noise shaping |
2179 | * - encoding: Set by user. | |
77ea0d4b MN |
2180 | * - decoding: unused |
2181 | */ | |
2182 | int quantizer_noise_shaping; | |
9c3d33d6 MN |
2183 | |
2184 | /** | |
f5bccd85 | 2185 | * thread count |
eafcac6a | 2186 | * is used to decide how many independent tasks should be passed to execute() |
f5bccd85 DB |
2187 | * - encoding: Set by user. |
2188 | * - decoding: Set by user. | |
9c3d33d6 MN |
2189 | */ |
2190 | int thread_count; | |
115329f1 | 2191 | |
9c3d33d6 | 2192 | /** |
f5bccd85 DB |
2193 | * The codec may call this to execute several independent things. |
2194 | * It will return only after finishing all tasks. | |
2195 | * The user may replace this with some multithreaded implementation, | |
2196 | * the default implementation will execute the parts serially. | |
399cec2f | 2197 | * @param count the number of things to execute |
f5bccd85 DB |
2198 | * - encoding: Set by libavcodec, user can override. |
2199 | * - decoding: Set by libavcodec, user can override. | |
9c3d33d6 | 2200 | */ |
3a84713a | 2201 | int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size); |
115329f1 | 2202 | |
9c3d33d6 | 2203 | /** |
f5bccd85 DB |
2204 | * thread opaque |
2205 | * Can be used by execute() to store some per AVCodecContext stuff. | |
9c3d33d6 MN |
2206 | * - encoding: set by execute() |
2207 | * - decoding: set by execute() | |
2208 | */ | |
2209 | void *thread_opaque; | |
a4d36c11 MN |
2210 | |
2211 | /** | |
f5bccd85 DB |
2212 | * Motion estimation threshold below which no motion estimation is |
2213 | * performed, but instead the user specified motion vectors are used. | |
115329f1 | 2214 | * |
f5bccd85 | 2215 | * - encoding: Set by user. |
f20f8a8b | 2216 | * - decoding: unused |
a4d36c11 | 2217 | */ |
2750b827 | 2218 | int me_threshold; |
f20f8a8b MN |
2219 | |
2220 | /** | |
f5bccd85 DB |
2221 | * Macroblock threshold below which the user specified macroblock types will be used. |
2222 | * - encoding: Set by user. | |
f20f8a8b MN |
2223 | * - decoding: unused |
2224 | */ | |
2225 | int mb_threshold; | |
bf266e19 MN |
2226 | |
2227 | /** | |
f5bccd85 DB |
2228 | * precision of the intra DC coefficient - 8 |
2229 | * - encoding: Set by user. | |
bf266e19 MN |
2230 | * - decoding: unused |
2231 | */ | |
2232 | int intra_dc_precision; | |
d4c5d2ad MN |
2233 | |
2234 | /** | |
f5bccd85 DB |
2235 | * noise vs. sse weight for the nsse comparsion function |
2236 | * - encoding: Set by user. | |
d4c5d2ad MN |
2237 | * - decoding: unused |
2238 | */ | |
2239 | int nsse_weight; | |
0dfd33c3 MN |
2240 | |
2241 | /** | |
f5bccd85 | 2242 | * Number of macroblock rows at the top which are skipped. |
0dfd33c3 | 2243 | * - encoding: unused |
f5bccd85 | 2244 | * - decoding: Set by user. |
0dfd33c3 MN |
2245 | */ |
2246 | int skip_top; | |
2247 | ||
2248 | /** | |
f5bccd85 | 2249 | * Number of macroblock rows at the bottom which are skipped. |
0dfd33c3 | 2250 | * - encoding: unused |
f5bccd85 | 2251 | * - decoding: Set by user. |
0dfd33c3 MN |
2252 | */ |
2253 | int skip_bottom; | |
baced9f5 MN |
2254 | |
2255 | /** | |
2256 | * profile | |
f5bccd85 DB |
2257 | * - encoding: Set by user. |
2258 | * - decoding: Set by libavcodec. | |
baced9f5 MN |
2259 | */ |
2260 | int profile; | |
2261 | #define FF_PROFILE_UNKNOWN -99 | |
aecd0a44 | 2262 | #define FF_PROFILE_RESERVED -100 |
dd0cd3d2 | 2263 | |
4f2c36ac | 2264 | #define FF_PROFILE_AAC_MAIN 0 |
273b0cd3 DB |
2265 | #define FF_PROFILE_AAC_LOW 1 |
2266 | #define FF_PROFILE_AAC_SSR 2 | |
2267 | #define FF_PROFILE_AAC_LTP 3 | |
baced9f5 | 2268 | |
f5a2d285 AH |
2269 | #define FF_PROFILE_DTS 20 |
2270 | #define FF_PROFILE_DTS_ES 30 | |
2271 | #define FF_PROFILE_DTS_96_24 40 | |
2272 | #define FF_PROFILE_DTS_HD_HRA 50 | |
2273 | #define FF_PROFILE_DTS_HD_MA 60 | |
2274 | ||
aecd0a44 BL |
2275 | #define FF_PROFILE_MPEG2_422 0 |
2276 | #define FF_PROFILE_MPEG2_HIGH 1 | |
2277 | #define FF_PROFILE_MPEG2_SS 2 | |
2278 | #define FF_PROFILE_MPEG2_SNR_SCALABLE 3 | |
2279 | #define FF_PROFILE_MPEG2_MAIN 4 | |
2280 | #define FF_PROFILE_MPEG2_SIMPLE 5 | |
2281 | ||
fe9a3fbe JG |
2282 | #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag |
2283 | #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag | |
2284 | ||
2285 | #define FF_PROFILE_H264_BASELINE 66 | |
2286 | #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED) | |
2287 | #define FF_PROFILE_H264_MAIN 77 | |
2288 | #define FF_PROFILE_H264_EXTENDED 88 | |
2289 | #define FF_PROFILE_H264_HIGH 100 | |
2290 | #define FF_PROFILE_H264_HIGH_10 110 | |
2291 | #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA) | |
2292 | #define FF_PROFILE_H264_HIGH_422 122 | |
2293 | #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA) | |
440b6169 | 2294 | #define FF_PROFILE_H264_HIGH_444 144 |
fe9a3fbe JG |
2295 | #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 |
2296 | #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA) | |
2297 | #define FF_PROFILE_H264_CAVLC_444 44 | |
dd0cd3d2 | 2298 | |
0215006a HL |
2299 | #define FF_PROFILE_VC1_SIMPLE 0 |
2300 | #define FF_PROFILE_VC1_MAIN 1 | |
2301 | #define FF_PROFILE_VC1_COMPLEX 2 | |
2302 | #define FF_PROFILE_VC1_ADVANCED 3 | |
2303 | ||
c4ab43ff TF |
2304 | #define FF_PROFILE_MPEG4_SIMPLE 0 |
2305 | #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 | |
2306 | #define FF_PROFILE_MPEG4_CORE 2 | |
2307 | #define FF_PROFILE_MPEG4_MAIN 3 | |
2308 | #define FF_PROFILE_MPEG4_N_BIT 4 | |
2309 | #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 | |
2310 | #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 | |
2311 | #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 | |
2312 | #define FF_PROFILE_MPEG4_HYBRID 8 | |
2313 | #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 | |
2314 | #define FF_PROFILE_MPEG4_CORE_SCALABLE 10 | |
2315 | #define FF_PROFILE_MPEG4_ADVANCED_CODING 11 | |
2316 | #define FF_PROFILE_MPEG4_ADVANCED_CORE 12 | |
2317 | #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 | |
2318 | #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 | |
2319 | #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 | |
2320 | ||
baced9f5 MN |
2321 | /** |
2322 | * level | |
f5bccd85 DB |
2323 | * - encoding: Set by user. |
2324 | * - decoding: Set by libavcodec. | |
baced9f5 MN |
2325 | */ |
2326 | int level; | |
2327 | #define FF_LEVEL_UNKNOWN -99 | |
178fcca8 MN |
2328 | |
2329 | /** | |
f5bccd85 | 2330 | * low resolution decoding, 1-> 1/2 size, 2->1/4 size |
178fcca8 | 2331 | * - encoding: unused |
f5bccd85 | 2332 | * - decoding: Set by user. |
178fcca8 MN |
2333 | */ |
2334 | int lowres; | |
21adafec MN |
2335 | |
2336 | /** | |
dde37293 | 2337 | * Bitstream width / height, may be different from width/height if lowres enabled. |
21adafec | 2338 | * - encoding: unused |
f5bccd85 | 2339 | * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. |
21adafec MN |
2340 | */ |
2341 | int coded_width, coded_height; | |
bbf18b21 MN |
2342 | |
2343 | /** | |
2344 | * frame skip threshold | |
f5bccd85 | 2345 | * - encoding: Set by user. |
bbf18b21 MN |
2346 | * - decoding: unused |
2347 | */ | |
2348 | int frame_skip_threshold; | |
2349 | ||
2350 | /** | |
2351 | * frame skip factor | |
f5bccd85 | 2352 | * - encoding: Set by user. |
bbf18b21 MN |
2353 | * - decoding: unused |
2354 | */ | |
2355 | int frame_skip_factor; | |
0fd6aea1 MN |
2356 | |
2357 | /** | |
2358 | * frame skip exponent | |
f5bccd85 | 2359 | * - encoding: Set by user. |
0fd6aea1 MN |
2360 | * - decoding: unused |
2361 | */ | |
2362 | int frame_skip_exp; | |
2363 | ||
2364 | /** | |
f5bccd85 DB |
2365 | * frame skip comparison function |
2366 | * - encoding: Set by user. | |
0fd6aea1 MN |
2367 | * - decoding: unused |
2368 | */ | |
2369 | int frame_skip_cmp; | |
957c743a CM |
2370 | |
2371 | /** | |
f5bccd85 | 2372 | * Border processing masking, raises the quantizer for mbs on the borders |
957c743a | 2373 | * of the picture. |
f5bccd85 | 2374 | * - encoding: Set by user. |
957c743a CM |
2375 | * - decoding: unused |
2376 | */ | |
2377 | float border_masking; | |
6e0d8c06 MN |
2378 | |
2379 | /** | |
f5bccd85 DB |
2380 | * minimum MB lagrange multipler |
2381 | * - encoding: Set by user. | |
6e0d8c06 MN |
2382 | * - decoding: unused |
2383 | */ | |
2384 | int mb_lmin; | |
2385 | ||
2386 | /** | |
f5bccd85 DB |
2387 | * maximum MB lagrange multipler |
2388 | * - encoding: Set by user. | |
6e0d8c06 MN |
2389 | * - decoding: unused |
2390 | */ | |
2391 | int mb_lmax; | |
09c3e44e MN |
2392 | |
2393 | /** | |
115329f1 | 2394 | * |
f5bccd85 | 2395 | * - encoding: Set by user. |
09c3e44e MN |
2396 | * - decoding: unused |
2397 | */ | |
2398 | int me_penalty_compensation; | |
8c3eba7c MN |
2399 | |
2400 | /** | |
115329f1 | 2401 | * |
8c3eba7c | 2402 | * - encoding: unused |
f5bccd85 | 2403 | * - decoding: Set by user. |
8c3eba7c MN |
2404 | */ |
2405 | enum AVDiscard skip_loop_filter; | |
2406 | ||
2407 | /** | |
115329f1 | 2408 | * |
8c3eba7c | 2409 | * - encoding: unused |
f5bccd85 | 2410 | * - decoding: Set by user. |
8c3eba7c MN |
2411 | */ |
2412 | enum AVDiscard skip_idct; | |
2413 | ||
2414 | /** | |
115329f1 | 2415 | * |
8c3eba7c | 2416 | * - encoding: unused |
f5bccd85 | 2417 | * - decoding: Set by user. |
8c3eba7c MN |
2418 | */ |
2419 | enum AVDiscard skip_frame; | |
316a2ec8 MN |
2420 | |
2421 | /** | |
2422 | * | |
f5bccd85 | 2423 | * - encoding: Set by user. |
316a2ec8 MN |
2424 | * - decoding: unused |
2425 | */ | |
2426 | int bidir_refine; | |
e8501c93 MN |
2427 | |
2428 | /** | |
2429 | * | |
f5bccd85 | 2430 | * - encoding: Set by user. |
e8501c93 MN |
2431 | * - decoding: unused |
2432 | */ | |
2433 | int brd_scale; | |
58f7833e | 2434 | |
d5dc8cc2 | 2435 | #if FF_API_X264_GLOBAL_OPTS |
58f7833e RS |
2436 | /** |
2437 | * constant rate factor - quality-based VBR - values ~correspond to qps | |
f5bccd85 | 2438 | * - encoding: Set by user. |
58f7833e | 2439 | * - decoding: unused |
d5dc8cc2 | 2440 | * @deprecated use 'crf' libx264 private option |
58f7833e | 2441 | */ |
d5dc8cc2 | 2442 | attribute_deprecated float crf; |
58f7833e RS |
2443 | |
2444 | /** | |
2445 | * constant quantization parameter rate control method | |
f5bccd85 | 2446 | * - encoding: Set by user. |
58f7833e | 2447 | * - decoding: unused |
9d508e49 | 2448 | * @deprecated use 'cqp' libx264 private option |
58f7833e | 2449 | */ |
9d508e49 AK |
2450 | attribute_deprecated int cqp; |
2451 | #endif | |
58f7833e RS |
2452 | |
2453 | /** | |
f5bccd85 DB |
2454 | * minimum GOP size |
2455 | * - encoding: Set by user. | |
58f7833e RS |
2456 | * - decoding: unused |
2457 | */ | |
2458 | int keyint_min; | |
2459 | ||
2460 | /** | |
2461 | * number of reference frames | |
f5bccd85 | 2462 | * - encoding: Set by user. |
53d55e9e | 2463 | * - decoding: Set by lavc. |
58f7833e RS |
2464 | */ |
2465 | int refs; | |
2466 | ||
2467 | /** | |
2468 | * chroma qp offset from luma | |
f5bccd85 | 2469 | * - encoding: Set by user. |
58f7833e RS |
2470 | * - decoding: unused |
2471 | */ | |
2472 | int chromaoffset; | |
2473 | ||
f83c4518 | 2474 | #if FF_API_X264_GLOBAL_OPTS |
58f7833e | 2475 | /** |
f5bccd85 DB |
2476 | * Influences how often B-frames are used. |
2477 | * - encoding: Set by user. | |
58f7833e RS |
2478 | * - decoding: unused |
2479 | */ | |
f83c4518 AK |
2480 | attribute_deprecated int bframebias; |
2481 | #endif | |
58f7833e RS |
2482 | |
2483 | /** | |
2484 | * trellis RD quantization | |
f5bccd85 | 2485 | * - encoding: Set by user. |
58f7833e RS |
2486 | * - decoding: unused |
2487 | */ | |
2488 | int trellis; | |
2489 | ||
70423376 | 2490 | #if FF_API_X264_GLOBAL_OPTS |
58f7833e | 2491 | /** |
f5bccd85 DB |
2492 | * Reduce fluctuations in qp (before curve compression). |
2493 | * - encoding: Set by user. | |
58f7833e RS |
2494 | * - decoding: unused |
2495 | */ | |
70423376 | 2496 | attribute_deprecated float complexityblur; |
58f7833e RS |
2497 | |
2498 | /** | |
2499 | * in-loop deblocking filter alphac0 parameter | |
2500 | * alpha is in the range -6...6 | |
f5bccd85 | 2501 | * - encoding: Set by user. |
58f7833e RS |
2502 | * - decoding: unused |
2503 | */ | |
71b5f442 | 2504 | attribute_deprecated int deblockalpha; |
58f7833e RS |
2505 | |
2506 | /** | |
2507 | * in-loop deblocking filter beta parameter | |
2508 | * beta is in the range -6...6 | |
f5bccd85 | 2509 | * - encoding: Set by user. |
58f7833e RS |
2510 | * - decoding: unused |
2511 | */ | |
71b5f442 | 2512 | attribute_deprecated int deblockbeta; |
58f7833e RS |
2513 | |
2514 | /** | |
2515 | * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 | |
f5bccd85 | 2516 | * - encoding: Set by user. |
58f7833e RS |
2517 | * - decoding: unused |
2518 | */ | |
0635a8aa | 2519 | attribute_deprecated int partitions; |
56cc85a0 DB |
2520 | #define X264_PART_I4X4 0x001 /* Analyze i4x4 */ |
2521 | #define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */ | |
2522 | #define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */ | |
2523 | #define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */ | |
2524 | #define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */ | |
58f7833e RS |
2525 | |
2526 | /** | |
30ab4ded | 2527 | * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) |
f5bccd85 | 2528 | * - encoding: Set by user. |
58f7833e RS |
2529 | * - decoding: unused |
2530 | */ | |
9c684fea AK |
2531 | attribute_deprecated int directpred; |
2532 | #endif | |
4f59b684 | 2533 | |
14f0c8e2 | 2534 | /** |
02c164c1 | 2535 | * Audio cutoff bandwidth (0 means "automatic") |
f5bccd85 | 2536 | * - encoding: Set by user. |
14f0c8e2 LA |
2537 | * - decoding: unused |
2538 | */ | |
2539 | int cutoff; | |
39a64e30 CH |
2540 | |
2541 | /** | |
f5bccd85 DB |
2542 | * Multiplied by qscale for each frame and added to scene_change_score. |
2543 | * - encoding: Set by user. | |
39a64e30 CH |
2544 | * - decoding: unused |
2545 | */ | |
2546 | int scenechange_factor; | |
1dd509b1 MN |
2547 | |
2548 | /** | |
2549 | * | |
f5bccd85 DB |
2550 | * Note: Value depends upon the compare function used for fullpel ME. |
2551 | * - encoding: Set by user. | |
1dd509b1 MN |
2552 | * - decoding: unused |
2553 | */ | |
2554 | int mv0_threshold; | |
f9243d34 CH |
2555 | |
2556 | /** | |
f5bccd85 DB |
2557 | * Adjusts sensitivity of b_frame_strategy 1. |
2558 | * - encoding: Set by user. | |
f9243d34 CH |
2559 | * - decoding: unused |
2560 | */ | |
2561 | int b_sensitivity; | |
a403fc03 JR |
2562 | |
2563 | /** | |
f5bccd85 | 2564 | * - encoding: Set by user. |
a403fc03 JR |
2565 | * - decoding: unused |
2566 | */ | |
2567 | int compression_level; | |
2568 | #define FF_COMPRESSION_DEFAULT -1 | |
2569 | ||
a403fc03 | 2570 | /** |
f5bccd85 DB |
2571 | * - encoding: Set by user. |
2572 | * - decoding: unused | |
a403fc03 | 2573 | */ |
188dea1d | 2574 | int min_prediction_order; |
a403fc03 JR |
2575 | |
2576 | /** | |
f5bccd85 DB |
2577 | * - encoding: Set by user. |
2578 | * - decoding: unused | |
a403fc03 | 2579 | */ |
188dea1d AK |
2580 | int max_prediction_order; |
2581 | ||
2582 | #if FF_API_FLAC_GLOBAL_OPTS | |
2583 | /** | |
21a19b79 | 2584 | * @name FLAC options |
188dea1d AK |
2585 | * @deprecated Use FLAC encoder private options instead. |
2586 | * @{ | |
2587 | */ | |
a403fc03 JR |
2588 | |
2589 | /** | |
188dea1d | 2590 | * LPC coefficient precision - used by FLAC encoder |
f5bccd85 DB |
2591 | * - encoding: Set by user. |
2592 | * - decoding: unused | |
a403fc03 | 2593 | */ |
188dea1d | 2594 | attribute_deprecated int lpc_coeff_precision; |
a403fc03 JR |
2595 | |
2596 | /** | |
2597 | * search method for selecting prediction order | |
f5bccd85 DB |
2598 | * - encoding: Set by user. |
2599 | * - decoding: unused | |
a403fc03 | 2600 | */ |
188dea1d | 2601 | attribute_deprecated int prediction_order_method; |
a403fc03 JR |
2602 | |
2603 | /** | |
f5bccd85 DB |
2604 | * - encoding: Set by user. |
2605 | * - decoding: unused | |
a403fc03 | 2606 | */ |
188dea1d | 2607 | attribute_deprecated int min_partition_order; |
a403fc03 JR |
2608 | |
2609 | /** | |
f5bccd85 DB |
2610 | * - encoding: Set by user. |
2611 | * - decoding: unused | |
a403fc03 | 2612 | */ |
188dea1d AK |
2613 | attribute_deprecated int max_partition_order; |
2614 | /** | |
2615 | * @} | |
2616 | */ | |
2617 | #endif | |
80d617f5 BC |
2618 | |
2619 | /** | |
2620 | * GOP timecode frame start number, in non drop frame format | |
f5bccd85 DB |
2621 | * - encoding: Set by user. |
2622 | * - decoding: unused | |
80d617f5 BC |
2623 | */ |
2624 | int64_t timecode_frame_start; | |
b1ec601f | 2625 | |
9f5ddd1e | 2626 | #if FF_API_REQUEST_CHANNELS |
b1ec601f | 2627 | /** |
85947156 VS |
2628 | * Decoder should decode to this many channels if it can (0 for default) |
2629 | * - encoding: unused | |
2630 | * - decoding: Set by user. | |
0d72e7d0 | 2631 | * @deprecated Deprecated in favor of request_channel_layout. |
b1ec601f RD |
2632 | */ |
2633 | int request_channels; | |
0d72e7d0 | 2634 | #endif |
1408352a | 2635 | |
9b83919f | 2636 | #if FF_API_DRC_SCALE |
1408352a JR |
2637 | /** |
2638 | * Percentage of dynamic range compression to be applied by the decoder. | |
2639 | * The default value is 1.0, corresponding to full compression. | |
2640 | * - encoding: unused | |
2641 | * - decoding: Set by user. | |
9b83919f | 2642 | * @deprecated use AC3 decoder private option instead. |
1408352a | 2643 | */ |
9b83919f AK |
2644 | attribute_deprecated float drc_scale; |
2645 | #endif | |
79de84f2 MN |
2646 | |
2647 | /** | |
2648 | * opaque 64bit number (generally a PTS) that will be reordered and | |
2649 | * output in AVFrame.reordered_opaque | |
81c623fa | 2650 | * @deprecated in favor of pkt_pts |
79de84f2 MN |
2651 | * - encoding: unused |
2652 | * - decoding: Set by user. | |
2653 | */ | |
2654 | int64_t reordered_opaque; | |
312420f3 PR |
2655 | |
2656 | /** | |
2657 | * Bits per sample/pixel of internal libavcodec pixel/sample format. | |
312420f3 PR |
2658 | * - encoding: set by user. |
2659 | * - decoding: set by libavcodec. | |
2660 | */ | |
2661 | int bits_per_raw_sample; | |
0d72e7d0 PR |
2662 | |
2663 | /** | |
2664 | * Audio channel layout. | |
2665 | * - encoding: set by user. | |
2666 | * - decoding: set by libavcodec. | |
2667 | */ | |
2668 | int64_t channel_layout; | |
2669 | ||
2670 | /** | |
2671 | * Request decoder to use this channel layout if it can (0 for default) | |
2672 | * - encoding: unused | |
2673 | * - decoding: Set by user. | |
2674 | */ | |
2675 | int64_t request_channel_layout; | |
3bff4d8b BC |
2676 | |
2677 | /** | |
2678 | * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. | |
2679 | * - encoding: Set by user. | |
2680 | * - decoding: unused. | |
2681 | */ | |
2682 | float rc_max_available_vbv_use; | |
2683 | ||
2684 | /** | |
2685 | * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow. | |
2686 | * - encoding: Set by user. | |
2687 | * - decoding: unused. | |
2688 | */ | |
2689 | float rc_min_vbv_overflow_use; | |
40e5d31b GB |
2690 | |
2691 | /** | |
2692 | * Hardware accelerator in use | |
2693 | * - encoding: unused. | |
2694 | * - decoding: Set by libavcodec | |
2695 | */ | |
2696 | struct AVHWAccel *hwaccel; | |
3797c74b MN |
2697 | |
2698 | /** | |
2699 | * For some codecs, the time base is closer to the field rate than the frame rate. | |
2700 | * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration | |
2701 | * if no telecine is used ... | |
2702 | * | |
2703 | * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. | |
2704 | */ | |
2705 | int ticks_per_frame; | |
1aea7018 GB |
2706 | |
2707 | /** | |
2708 | * Hardware accelerator context. | |
2709 | * For some hardware accelerators, a global context needs to be | |
2710 | * provided by the user. In that case, this holds display-dependent | |
43fb279f DB |
2711 | * data Libav cannot instantiate itself. Please refer to the |
2712 | * Libav HW accelerator documentation to know how to fill this | |
1aea7018 GB |
2713 | * is. e.g. for VA API, this is a struct vaapi_context. |
2714 | * - encoding: unused | |
2715 | * - decoding: Set by user | |
2716 | */ | |
2717 | void *hwaccel_context; | |
4ee6a5c1 MN |
2718 | |
2719 | /** | |
2720 | * Chromaticity coordinates of the source primaries. | |
2721 | * - encoding: Set by user | |
2722 | * - decoding: Set by libavcodec | |
2723 | */ | |
2724 | enum AVColorPrimaries color_primaries; | |
2725 | ||
2726 | /** | |
2727 | * Color Transfer Characteristic. | |
2728 | * - encoding: Set by user | |
2729 | * - decoding: Set by libavcodec | |
2730 | */ | |
2731 | enum AVColorTransferCharacteristic color_trc; | |
2732 | ||
2733 | /** | |
2734 | * YUV colorspace type. | |
2735 | * - encoding: Set by user | |
2736 | * - decoding: Set by libavcodec | |
2737 | */ | |
2738 | enum AVColorSpace colorspace; | |
2739 | ||
2740 | /** | |
2741 | * MPEG vs JPEG YUV range. | |
2742 | * - encoding: Set by user | |
2743 | * - decoding: Set by libavcodec | |
2744 | */ | |
2745 | enum AVColorRange color_range; | |
580a7465 DC |
2746 | |
2747 | /** | |
2748 | * This defines the location of chroma samples. | |
2749 | * - encoding: Set by user | |
2750 | * - decoding: Set by libavcodec | |
2751 | */ | |
8ea08bec | 2752 | enum AVChromaLocation chroma_sample_location; |
8d23a86f RD |
2753 | |
2754 | /** | |
2755 | * The codec may call this to execute several independent things. | |
2756 | * It will return only after finishing all tasks. | |
2757 | * The user may replace this with some multithreaded implementation, | |
2758 | * the default implementation will execute the parts serially. | |
2759 | * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. | |
2760 | * @param c context passed also to func | |
2761 | * @param count the number of things to execute | |
2762 | * @param arg2 argument passed unchanged to func | |
2763 | * @param ret return values of executed functions, must have space for "count" values. May be NULL. | |
2764 | * @param func function that will be called count times, with jobnr from 0 to count-1. | |
2765 | * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no | |
2766 | * two instances of func executing at the same time will have the same threadnr. | |
2767 | * @return always 0 currently, but code should handle a future improvement where when any call to func | |
2768 | * returns < 0 no further calls to func may be done and < 0 is returned. | |
2769 | * - encoding: Set by libavcodec, user can override. | |
2770 | * - decoding: Set by libavcodec, user can override. | |
2771 | */ | |
2772 | int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); | |
096c87f6 | 2773 | |
c5dd0bc4 | 2774 | #if FF_API_X264_GLOBAL_OPTS |
096c87f6 JGG |
2775 | /** |
2776 | * explicit P-frame weighted prediction analysis method | |
2777 | * 0: off | |
2778 | * 1: fast blind weighting (one reference duplicate with -1 offset) | |
2779 | * 2: smart weighting (full fade detection analysis) | |
2780 | * - encoding: Set by user. | |
2781 | * - decoding: unused | |
2782 | */ | |
c5dd0bc4 | 2783 | attribute_deprecated int weighted_p_pred; |
f3b3b489 BC |
2784 | |
2785 | /** | |
2786 | * AQ mode | |
2787 | * 0: Disabled | |
2788 | * 1: Variance AQ (complexity mask) | |
2789 | * 2: Auto-variance AQ (experimental) | |
2790 | * - encoding: Set by user | |
2791 | * - decoding: unused | |
2792 | */ | |
85254fcb | 2793 | attribute_deprecated int aq_mode; |
f3b3b489 BC |
2794 | |
2795 | /** | |
2796 | * AQ strength | |
2797 | * Reduces blocking and blurring in flat and textured areas. | |
2798 | * - encoding: Set by user | |
2799 | * - decoding: unused | |
2800 | */ | |
5c75b2a0 | 2801 | attribute_deprecated float aq_strength; |
f3b3b489 BC |
2802 | |
2803 | /** | |
2804 | * PSY RD | |
2805 | * Strength of psychovisual optimization | |
2806 | * - encoding: Set by user | |
2807 | * - decoding: unused | |
2808 | */ | |
93e623c6 | 2809 | attribute_deprecated float psy_rd; |
f3b3b489 BC |
2810 | |
2811 | /** | |
2812 | * PSY trellis | |
2813 | * Strength of psychovisual optimization | |
2814 | * - encoding: Set by user | |
2815 | * - decoding: unused | |
2816 | */ | |
2a44a8f6 | 2817 | attribute_deprecated float psy_trellis; |
f3b3b489 BC |
2818 | |
2819 | /** | |
2820 | * RC lookahead | |
2821 | * Number of frames for frametype and ratecontrol lookahead | |
2822 | * - encoding: Set by user | |
2823 | * - decoding: unused | |
2824 | */ | |
d4b96713 | 2825 | attribute_deprecated int rc_lookahead; |
e8c7fca9 JGG |
2826 | |
2827 | /** | |
2828 | * Constant rate factor maximum | |
2829 | * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse | |
2830 | * than crf_max, even if doing so would violate VBV restrictions. | |
2831 | * - encoding: Set by user. | |
2832 | * - decoding: unused | |
2833 | */ | |
4ae30cac AK |
2834 | attribute_deprecated float crf_max; |
2835 | #endif | |
fecd7b45 SS |
2836 | |
2837 | int log_level_offset; | |
23940f14 | 2838 | |
188dea1d | 2839 | #if FF_API_FLAC_GLOBAL_OPTS |
23940f14 JR |
2840 | /** |
2841 | * Determines which LPC analysis algorithm to use. | |
2842 | * - encoding: Set by user | |
2843 | * - decoding: unused | |
2844 | */ | |
188dea1d | 2845 | attribute_deprecated enum AVLPCType lpc_type; |
23940f14 JR |
2846 | |
2847 | /** | |
2848 | * Number of passes to use for Cholesky factorization during LPC analysis | |
2849 | * - encoding: Set by user | |
2850 | * - decoding: unused | |
2851 | */ | |
188dea1d AK |
2852 | attribute_deprecated int lpc_passes; |
2853 | #endif | |
2aa72ecc JZ |
2854 | |
2855 | /** | |
2856 | * Number of slices. | |
2857 | * Indicates number of picture subdivisions. Used for parallelized | |
2858 | * decoding. | |
2859 | * - encoding: Set by user | |
2860 | * - decoding: unused | |
2861 | */ | |
2862 | int slices; | |
cb2c971d AJ |
2863 | |
2864 | /** | |
2865 | * Header containing style information for text subtitles. | |
2866 | * For SUBTITLE_ASS subtitle type, it should contain the whole ASS | |
2867 | * [Script Info] and [V4+ Styles] section, plus the [Events] line and | |
2868 | * the Format line following. It shouldn't include any Dialogue line. | |
2869 | * - encoding: Set/allocated/freed by user (before avcodec_open()) | |
2870 | * - decoding: Set/allocated/freed by libavcodec (by avcodec_open()) | |
2871 | */ | |
2872 | uint8_t *subtitle_header; | |
2873 | int subtitle_header_size; | |
393cbb96 MN |
2874 | |
2875 | /** | |
2876 | * Current packet as passed into the decoder, to avoid having | |
2877 | * to pass the packet into every function. Currently only valid | |
2878 | * inside lavc and get/release_buffer callbacks. | |
2879 | * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts | |
2880 | * - encoding: unused | |
2881 | */ | |
2882 | AVPacket *pkt; | |
37b00b47 | 2883 | |
f3a29b75 | 2884 | #if FF_API_INTERNAL_CONTEXT |
37b00b47 AS |
2885 | /** |
2886 | * Whether this is a copy of the context which had init() called on it. | |
2887 | * This is used by multithreading - shared tables and picture pointers | |
2888 | * should be freed from the original context only. | |
2889 | * - encoding: Set by libavcodec. | |
2890 | * - decoding: Set by libavcodec. | |
f3a29b75 JR |
2891 | * |
2892 | * @deprecated this field has been moved to an internal context | |
37b00b47 | 2893 | */ |
f3a29b75 JR |
2894 | attribute_deprecated int is_copy; |
2895 | #endif | |
37b00b47 AS |
2896 | |
2897 | /** | |
2898 | * Which multithreading methods to use. | |
2899 | * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, | |
2900 | * so clients which cannot provide future frames should not use it. | |
2901 | * | |
2902 | * - encoding: Set by user, otherwise the default is used. | |
2903 | * - decoding: Set by user, otherwise the default is used. | |
2904 | */ | |
2905 | int thread_type; | |
02494787 DB |
2906 | #define FF_THREAD_FRAME 1 ///< Decode more than one frame at once |
2907 | #define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once | |
37b00b47 AS |
2908 | |
2909 | /** | |
2910 | * Which multithreading methods are in use by the codec. | |
2911 | * - encoding: Set by libavcodec. | |
2912 | * - decoding: Set by libavcodec. | |
2913 | */ | |
2914 | int active_thread_type; | |
2915 | ||
2916 | /** | |
2917 | * Set by the client if its custom get_buffer() callback can be called | |
2918 | * from another thread, which allows faster multithreaded decoding. | |
2919 | * draw_horiz_band() will be called from other threads regardless of this setting. | |
2920 | * Ignored if the default get_buffer() is used. | |
2921 | * - encoding: Set by user. | |
2922 | * - decoding: Set by user. | |
2923 | */ | |
2924 | int thread_safe_callbacks; | |
55bad0c6 CM |
2925 | |
2926 | /** | |
2927 | * VBV delay coded in the last frame (in periods of a 27 MHz clock). | |
2928 | * Used for compliant TS muxing. | |
2929 | * - encoding: Set by libavcodec. | |
2930 | * - decoding: unused. | |
2931 | */ | |
2932 | uint64_t vbv_delay; | |
34b47d7c JR |
2933 | |
2934 | /** | |
2935 | * Type of service that the audio stream conveys. | |
2936 | * - encoding: Set by user. | |
2937 | * - decoding: Set by libavcodec. | |
2938 | */ | |
2939 | enum AVAudioServiceType audio_service_type; | |
64150ff0 JR |
2940 | |
2941 | /** | |
2942 | * Used to request a sample format from the decoder. | |
2943 | * - encoding: unused. | |
2944 | * - decoding: Set by user. | |
2945 | */ | |
2946 | enum AVSampleFormat request_sample_fmt; | |
582f2311 DB |
2947 | |
2948 | /** | |
2949 | * Error recognition; may misdetect some more or less valid parts as errors. | |
2950 | * - encoding: unused | |
2951 | * - decoding: Set by user. | |
2952 | */ | |
204e6132 | 2953 | int err_recognition; |
6b1f93fa DB |
2954 | #define AV_EF_CRCCHECK (1<<0) |
2955 | #define AV_EF_BITSTREAM (1<<1) | |
2956 | #define AV_EF_BUFFER (1<<2) | |
2957 | #define AV_EF_EXPLODE (1<<3) | |
f3a29b75 JR |
2958 | |
2959 | /** | |
2960 | * Private context used for internal data. | |
2961 | * | |
2962 | * Unlike priv_data, this is not codec-specific. It is used in general | |
2963 | * libavcodec functions. | |
2964 | */ | |
2965 | struct AVCodecInternal *internal; | |
de6d9b64 FB |
2966 | } AVCodecContext; |
2967 | ||
64863965 | 2968 | /** |
060ec0a8 AH |
2969 | * AVProfile. |
2970 | */ | |
2971 | typedef struct AVProfile { | |
2972 | int profile; | |
2973 | const char *name; ///< short name for the profile | |
2974 | } AVProfile; | |
2975 | ||
84626b36 AK |
2976 | typedef struct AVCodecDefault AVCodecDefault; |
2977 | ||
060ec0a8 | 2978 | /** |
64863965 MN |
2979 | * AVCodec. |
2980 | */ | |
de6d9b64 | 2981 | typedef struct AVCodec { |
6b0cdb6e NG |
2982 | /** |
2983 | * Name of the codec implementation. | |
2984 | * The name is globally unique among encoders and among decoders (but an | |
2985 | * encoder and a decoder can share the same name). | |
2986 | * This is the primary way to find a codec from the user perspective. | |
2987 | */ | |
18f77016 | 2988 | const char *name; |
72415b2a | 2989 | enum AVMediaType type; |
9297ddd3 | 2990 | enum CodecID id; |
de6d9b64 FB |
2991 | int priv_data_size; |
2992 | int (*init)(AVCodecContext *); | |
0c1a9eda | 2993 | int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); |
de6d9b64 | 2994 | int (*close)(AVCodecContext *); |
7a00bbad | 2995 | int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); |
a2d11246 MN |
2996 | /** |
2997 | * Codec capabilities. | |
2998 | * see CODEC_CAP_* | |
2999 | */ | |
bf89e6b1 | 3000 | int capabilities; |
de6d9b64 | 3001 | struct AVCodec *next; |
c8cf325a MN |
3002 | /** |
3003 | * Flush buffers. | |
3004 | * Will be called when seeking | |
3005 | */ | |
7a06ff14 | 3006 | void (*flush)(AVCodecContext *); |
716e31ea | 3007 | const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} |
1beb670a | 3008 | const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 |
fe4bf374 | 3009 | /** |
bf7e799c SS |
3010 | * Descriptive name for the codec, meant to be more human readable than name. |
3011 | * You should use the NULL_IF_CONFIG_SMALL() macro to define it. | |
fe4bf374 SS |
3012 | */ |
3013 | const char *long_name; | |
3ade5d56 | 3014 | const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 |
5d6e4c16 | 3015 | const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 |
0d72e7d0 | 3016 | const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 |
0fd0ef79 | 3017 | uint8_t max_lowres; ///< maximum value for lowres supported by the decoder |
567ad0e3 | 3018 | const AVClass *priv_class; ///< AVClass for the private context |
060ec0a8 | 3019 | const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} |
37b00b47 AS |
3020 | |
3021 | /** | |
21a19b79 | 3022 | * @name Frame-level threading support functions |
37b00b47 AS |
3023 | * @{ |
3024 | */ | |
3025 | /** | |
3026 | * If defined, called on thread contexts when they are created. | |
3027 | * If the codec allocates writable tables in init(), re-allocate them here. | |
3028 | * priv_data will be set to a copy of the original. | |
3029 | */ | |
3030 | int (*init_thread_copy)(AVCodecContext *); | |
3031 | /** | |
3032 | * Copy necessary context variables from a previous thread context to the current one. | |
3033 | * If not defined, the next thread will start automatically; otherwise, the codec | |
3034 | * must call ff_thread_finish_setup(). | |
3035 | * | |
3036 | * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. | |
3037 | */ | |
3038 | int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); | |
3039 | /** @} */ | |
84626b36 AK |
3040 | |
3041 | /** | |
3042 | * Private codec-specific defaults. | |
3043 | */ | |
3044 | const AVCodecDefault *defaults; | |
d97efd7f AK |
3045 | |
3046 | /** | |
3047 | * Initialize codec static data, called from avcodec_register(). | |
3048 | */ | |
3049 | void (*init_static_data)(struct AVCodec *codec); | |
de6d9b64 FB |
3050 | } AVCodec; |
3051 | ||
97d96aaa | 3052 | /** |
40e5d31b GB |
3053 | * AVHWAccel. |
3054 | */ | |
3055 | typedef struct AVHWAccel { | |
3056 | /** | |
3057 | * Name of the hardware accelerated codec. | |
3058 | * The name is globally unique among encoders and among decoders (but an | |
3059 | * encoder and a decoder can share the same name). | |
3060 | */ | |
3061 | const char *name; | |
3062 | ||
3063 | /** | |
3064 | * Type of codec implemented by the hardware accelerator. | |
3065 | * | |
72415b2a | 3066 | * See AVMEDIA_TYPE_xxx |
40e5d31b | 3067 | */ |
72415b2a | 3068 | enum AVMediaType type; |
40e5d31b GB |
3069 | |
3070 | /** | |
3071 | * Codec implemented by the hardware accelerator. | |
3072 | * | |
3073 | * See CODEC_ID_xxx | |
3074 | */ | |
3075 | enum CodecID id; | |
3076 | ||
3077 | /** | |
3078 | * Supported pixel format. | |
3079 | * | |
3080 | * Only hardware accelerated formats are supported here. | |
3081 | */ | |
3082 | enum PixelFormat pix_fmt; | |
3083 | ||
3084 | /** | |
3085 | * Hardware accelerated codec capabilities. | |
3086 | * see FF_HWACCEL_CODEC_CAP_* | |
3087 | */ | |
3088 | int capabilities; | |
3089 | ||
3090 | struct AVHWAccel *next; | |
3091 | ||
3092 | /** | |
3093 | * Called at the beginning of each frame or field picture. | |
3094 | * | |
3095 | * Meaningful frame information (codec specific) is guaranteed to | |
3096 | * be parsed at this point. This function is mandatory. | |
3097 | * | |
bf7e799c | 3098 | * Note that buf can be NULL along with buf_size set to 0. |
40e5d31b GB |
3099 | * Otherwise, this means the whole frame is available at this point. |
3100 | * | |
3101 | * @param avctx the codec context | |
3102 | * @param buf the frame data buffer base | |
3103 | * @param buf_size the size of the frame in bytes | |
3104 | * @return zero if successful, a negative value otherwise | |
3105 | */ | |
3106 | int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); | |
3107 | ||
3108 | /** | |
3109 | * Callback for each slice. | |
3110 | * | |
3111 | * Meaningful slice information (codec specific) is guaranteed to | |
3112 | * be parsed at this point. This function is mandatory. | |
3113 | * | |
3114 | * @param avctx the codec context | |
3115 | * @param buf the slice data buffer base | |
3116 | * @param buf_size the size of the slice in bytes | |
3117 | * @return zero if successful, a negative value otherwise | |
3118 | */ | |
3119 | int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); | |
3120 | ||
3121 | /** | |
3122 | * Called at the end of each frame or field picture. | |
3123 | * | |
3124 | * The whole picture is parsed at this point and can now be sent | |
3125 | * to the hardware accelerator. This function is mandatory. | |
3126 | * | |
3127 | * @param avctx the codec context | |
3128 | * @return zero if successful, a negative value otherwise | |
3129 | */ | |
3130 | int (*end_frame)(AVCodecContext *avctx); | |
68e5d523 GB |
3131 | |
3132 | /** | |
3133 | * Size of HW accelerator private data. | |
3134 | * | |
cd823ff9 GB |
3135 | * Private data is allocated with av_mallocz() before |
3136 | * AVCodecContext.get_buffer() and deallocated after | |
3137 | * AVCodecContext.release_buffer(). | |
68e5d523 GB |
3138 | */ |
3139 | int priv_data_size; | |
40e5d31b GB |
3140 | } AVHWAccel; |
3141 | ||
3142 | /** | |
d7425f59 MN |
3143 | * four components are given, that's all. |
3144 | * the last component is alpha | |
3145 | */ | |
de6d9b64 | 3146 | typedef struct AVPicture { |
0c1a9eda | 3147 | uint8_t *data[4]; |
cd394651 | 3148 | int linesize[4]; ///< number of bytes per line |
de6d9b64 FB |
3149 | } AVPicture; |
3150 | ||
63e4c8a6 AK |
3151 | #define AVPALETTE_SIZE 1024 |
3152 | #define AVPALETTE_COUNT 256 | |
eda7c983 | 3153 | #if FF_API_PALETTE_CONTROL |
ba118447 | 3154 | /** |
85947156 VS |
3155 | * AVPaletteControl |
3156 | * This structure defines a method for communicating palette changes | |
3157 | * between and demuxer and a decoder. | |
3158 | * | |
671adb17 | 3159 | * @deprecated Use AVPacket to send palette changes instead. |
85947156 | 3160 | * This is totally broken. |
ba118447 MM |
3161 | */ |
3162 | typedef struct AVPaletteControl { | |
3163 | ||
f5bccd85 DB |
3164 | /* Demuxer sets this to 1 to indicate the palette has changed; |
3165 | * decoder resets to 0. */ | |
ba118447 MM |
3166 | int palette_changed; |
3167 | ||
2a2bbcb0 MM |
3168 | /* 4-byte ARGB palette entries, stored in native byte order; note that |
3169 | * the individual palette components should be on a 8-bit scale; if | |
f5bccd85 DB |
3170 | * the palette data comes from an IBM VGA native format, the component |
3171 | * data is probably 6 bits in size and needs to be scaled. */ | |
2e99641b | 3172 | unsigned int palette[AVPALETTE_COUNT]; |
ba118447 | 3173 | |
18239edf | 3174 | } AVPaletteControl attribute_deprecated; |
2bbd8571 | 3175 | #endif |
ba118447 | 3176 | |
c66216ed MN |
3177 | enum AVSubtitleType { |
3178 | SUBTITLE_NONE, | |
3179 | ||
3180 | SUBTITLE_BITMAP, ///< A bitmap, pict will be set | |
3181 | ||
3182 | /** | |
3183 | * Plain text, the text field must be set by the decoder and is | |
3184 | * authoritative. ass and pict fields may contain approximations. | |
3185 | */ | |
3186 | SUBTITLE_TEXT, | |
3187 | ||
3188 | /** | |
3189 | * Formatted text, the ass field must be set by the decoder and is | |
3190 | * authoritative. pict and text fields may contain approximations. | |
3191 | */ | |
3192 | SUBTITLE_ASS, | |
3193 | }; | |
3194 | ||
c6ec28b1 | 3195 | typedef struct AVSubtitleRect { |
ebc466bb MN |
3196 | int x; ///< top left corner of pict, undefined when pict is not set |
3197 | int y; ///< top left corner of pict, undefined when pict is not set | |
3198 | int w; ///< width of pict, undefined when pict is not set | |
3199 | int h; ///< height of pict, undefined when pict is not set | |
3200 | int nb_colors; ///< number of colors in pict, undefined when pict is not set | |
25b4c651 MN |
3201 | |
3202 | /** | |
3203 | * data+linesize for the bitmap of this subtitle. | |
3204 | * can be set for text/ass as well once they where rendered | |
3205 | */ | |
3206 | AVPicture pict; | |
f656106f MN |
3207 | enum AVSubtitleType type; |
3208 | ||
3209< |