00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVCODEC_AVCODEC_H
00022 #define AVCODEC_AVCODEC_H
00023
00029 #include <errno.h>
00030 #include "libavutil/samplefmt.h"
00031 #include "libavutil/avutil.h"
00032 #include "libavutil/cpu.h"
00033 #include "libavutil/dict.h"
00034
00035 #include "libavcodec/version.h"
00036
00049 enum CodecID {
00050 CODEC_ID_NONE,
00051
00052
00053 CODEC_ID_MPEG1VIDEO,
00054 CODEC_ID_MPEG2VIDEO,
00055 CODEC_ID_MPEG2VIDEO_XVMC,
00056 CODEC_ID_H261,
00057 CODEC_ID_H263,
00058 CODEC_ID_RV10,
00059 CODEC_ID_RV20,
00060 CODEC_ID_MJPEG,
00061 CODEC_ID_MJPEGB,
00062 CODEC_ID_LJPEG,
00063 CODEC_ID_SP5X,
00064 CODEC_ID_JPEGLS,
00065 CODEC_ID_MPEG4,
00066 CODEC_ID_RAWVIDEO,
00067 CODEC_ID_MSMPEG4V1,
00068 CODEC_ID_MSMPEG4V2,
00069 CODEC_ID_MSMPEG4V3,
00070 CODEC_ID_WMV1,
00071 CODEC_ID_WMV2,
00072 CODEC_ID_H263P,
00073 CODEC_ID_H263I,
00074 CODEC_ID_FLV1,
00075 CODEC_ID_SVQ1,
00076 CODEC_ID_SVQ3,
00077 CODEC_ID_DVVIDEO,
00078 CODEC_ID_HUFFYUV,
00079 CODEC_ID_CYUV,
00080 CODEC_ID_H264,
00081 CODEC_ID_INDEO3,
00082 CODEC_ID_VP3,
00083 CODEC_ID_THEORA,
00084 CODEC_ID_ASV1,
00085 CODEC_ID_ASV2,
00086 CODEC_ID_FFV1,
00087 CODEC_ID_4XM,
00088 CODEC_ID_VCR1,
00089 CODEC_ID_CLJR,
00090 CODEC_ID_MDEC,
00091 CODEC_ID_ROQ,
00092 CODEC_ID_INTERPLAY_VIDEO,
00093 CODEC_ID_XAN_WC3,
00094 CODEC_ID_XAN_WC4,
00095 CODEC_ID_RPZA,
00096 CODEC_ID_CINEPAK,
00097 CODEC_ID_WS_VQA,
00098 CODEC_ID_MSRLE,
00099 CODEC_ID_MSVIDEO1,
00100 CODEC_ID_IDCIN,
00101 CODEC_ID_8BPS,
00102 CODEC_ID_SMC,
00103 CODEC_ID_FLIC,
00104 CODEC_ID_TRUEMOTION1,
00105 CODEC_ID_VMDVIDEO,
00106 CODEC_ID_MSZH,
00107 CODEC_ID_ZLIB,
00108 CODEC_ID_QTRLE,
00109 CODEC_ID_SNOW,
00110 CODEC_ID_TSCC,
00111 CODEC_ID_ULTI,
00112 CODEC_ID_QDRAW,
00113 CODEC_ID_VIXL,
00114 CODEC_ID_QPEG,
00115 CODEC_ID_PNG,
00116 CODEC_ID_PPM,
00117 CODEC_ID_PBM,
00118 CODEC_ID_PGM,
00119 CODEC_ID_PGMYUV,
00120 CODEC_ID_PAM,
00121 CODEC_ID_FFVHUFF,
00122 CODEC_ID_RV30,
00123 CODEC_ID_RV40,
00124 CODEC_ID_VC1,
00125 CODEC_ID_WMV3,
00126 CODEC_ID_LOCO,
00127 CODEC_ID_WNV1,
00128 CODEC_ID_AASC,
00129 CODEC_ID_INDEO2,
00130 CODEC_ID_FRAPS,
00131 CODEC_ID_TRUEMOTION2,
00132 CODEC_ID_BMP,
00133 CODEC_ID_CSCD,
00134 CODEC_ID_MMVIDEO,
00135 CODEC_ID_ZMBV,
00136 CODEC_ID_AVS,
00137 CODEC_ID_SMACKVIDEO,
00138 CODEC_ID_NUV,
00139 CODEC_ID_KMVC,
00140 CODEC_ID_FLASHSV,
00141 CODEC_ID_CAVS,
00142 CODEC_ID_JPEG2000,
00143 CODEC_ID_VMNC,
00144 CODEC_ID_VP5,
00145 CODEC_ID_VP6,
00146 CODEC_ID_VP6F,
00147 CODEC_ID_TARGA,
00148 CODEC_ID_DSICINVIDEO,
00149 CODEC_ID_TIERTEXSEQVIDEO,
00150 CODEC_ID_TIFF,
00151 CODEC_ID_GIF,
00152 CODEC_ID_FFH264,
00153 CODEC_ID_DXA,
00154 CODEC_ID_DNXHD,
00155 CODEC_ID_THP,
00156 CODEC_ID_SGI,
00157 CODEC_ID_C93,
00158 CODEC_ID_BETHSOFTVID,
00159 CODEC_ID_PTX,
00160 CODEC_ID_TXD,
00161 CODEC_ID_VP6A,
00162 CODEC_ID_AMV,
00163 CODEC_ID_VB,
00164 CODEC_ID_PCX,
00165 CODEC_ID_SUNRAST,
00166 CODEC_ID_INDEO4,
00167 CODEC_ID_INDEO5,
00168 CODEC_ID_MIMIC,
00169 CODEC_ID_RL2,
00170 CODEC_ID_8SVX_EXP,
00171 CODEC_ID_8SVX_FIB,
00172 CODEC_ID_ESCAPE124,
00173 CODEC_ID_DIRAC,
00174 CODEC_ID_BFI,
00175 CODEC_ID_CMV,
00176 CODEC_ID_MOTIONPIXELS,
00177 CODEC_ID_TGV,
00178 CODEC_ID_TGQ,
00179 CODEC_ID_TQI,
00180 CODEC_ID_AURA,
00181 CODEC_ID_AURA2,
00182 CODEC_ID_V210X,
00183 CODEC_ID_TMV,
00184 CODEC_ID_V210,
00185 CODEC_ID_DPX,
00186 CODEC_ID_MAD,
00187 CODEC_ID_FRWU,
00188 CODEC_ID_FLASHSV2,
00189 CODEC_ID_CDGRAPHICS,
00190 CODEC_ID_R210,
00191 CODEC_ID_ANM,
00192 CODEC_ID_BINKVIDEO,
00193 CODEC_ID_IFF_ILBM,
00194 CODEC_ID_IFF_BYTERUN1,
00195 CODEC_ID_KGV1,
00196 CODEC_ID_YOP,
00197 CODEC_ID_VP8,
00198 CODEC_ID_PICTOR,
00199 CODEC_ID_ANSI,
00200 CODEC_ID_A64_MULTI,
00201 CODEC_ID_A64_MULTI5,
00202 CODEC_ID_R10K,
00203 CODEC_ID_MXPEG,
00204 CODEC_ID_LAGARITH,
00205 CODEC_ID_PRORES,
00206 CODEC_ID_JV,
00207 CODEC_ID_DFA,
00208 CODEC_ID_8SVX_RAW,
00209
00210
00211 CODEC_ID_PCM_S16LE= 0x10000,
00212 CODEC_ID_PCM_S16BE,
00213 CODEC_ID_PCM_U16LE,
00214 CODEC_ID_PCM_U16BE,
00215 CODEC_ID_PCM_S8,
00216 CODEC_ID_PCM_U8,
00217 CODEC_ID_PCM_MULAW,
00218 CODEC_ID_PCM_ALAW,
00219 CODEC_ID_PCM_S32LE,
00220 CODEC_ID_PCM_S32BE,
00221 CODEC_ID_PCM_U32LE,
00222 CODEC_ID_PCM_U32BE,
00223 CODEC_ID_PCM_S24LE,
00224 CODEC_ID_PCM_S24BE,
00225 CODEC_ID_PCM_U24LE,
00226 CODEC_ID_PCM_U24BE,
00227 CODEC_ID_PCM_S24DAUD,
00228 CODEC_ID_PCM_ZORK,
00229 CODEC_ID_PCM_S16LE_PLANAR,
00230 CODEC_ID_PCM_DVD,
00231 CODEC_ID_PCM_F32BE,
00232 CODEC_ID_PCM_F32LE,
00233 CODEC_ID_PCM_F64BE,
00234 CODEC_ID_PCM_F64LE,
00235 CODEC_ID_PCM_BLURAY,
00236 CODEC_ID_PCM_LXF,
00237 CODEC_ID_S302M,
00238
00239
00240 CODEC_ID_ADPCM_IMA_QT= 0x11000,
00241 CODEC_ID_ADPCM_IMA_WAV,
00242 CODEC_ID_ADPCM_IMA_DK3,
00243 CODEC_ID_ADPCM_IMA_DK4,
00244 CODEC_ID_ADPCM_IMA_WS,
00245 CODEC_ID_ADPCM_IMA_SMJPEG,
00246 CODEC_ID_ADPCM_MS,
00247 CODEC_ID_ADPCM_4XM,
00248 CODEC_ID_ADPCM_XA,
00249 CODEC_ID_ADPCM_ADX,
00250 CODEC_ID_ADPCM_EA,
00251 CODEC_ID_ADPCM_G726,
00252 CODEC_ID_ADPCM_CT,
00253 CODEC_ID_ADPCM_SWF,
00254 CODEC_ID_ADPCM_YAMAHA,
00255 CODEC_ID_ADPCM_SBPRO_4,
00256 CODEC_ID_ADPCM_SBPRO_3,
00257 CODEC_ID_ADPCM_SBPRO_2,
00258 CODEC_ID_ADPCM_THP,
00259 CODEC_ID_ADPCM_IMA_AMV,
00260 CODEC_ID_ADPCM_EA_R1,
00261 CODEC_ID_ADPCM_EA_R3,
00262 CODEC_ID_ADPCM_EA_R2,
00263 CODEC_ID_ADPCM_IMA_EA_SEAD,
00264 CODEC_ID_ADPCM_IMA_EA_EACS,
00265 CODEC_ID_ADPCM_EA_XAS,
00266 CODEC_ID_ADPCM_EA_MAXIS_XA,
00267 CODEC_ID_ADPCM_IMA_ISS,
00268 CODEC_ID_ADPCM_G722,
00269
00270
00271 CODEC_ID_AMR_NB= 0x12000,
00272 CODEC_ID_AMR_WB,
00273
00274
00275 CODEC_ID_RA_144= 0x13000,
00276 CODEC_ID_RA_288,
00277
00278
00279 CODEC_ID_ROQ_DPCM= 0x14000,
00280 CODEC_ID_INTERPLAY_DPCM,
00281 CODEC_ID_XAN_DPCM,
00282 CODEC_ID_SOL_DPCM,
00283
00284
00285 CODEC_ID_MP2= 0x15000,
00286 CODEC_ID_MP3,
00287 CODEC_ID_AAC,
00288 CODEC_ID_AC3,
00289 CODEC_ID_DTS,
00290 CODEC_ID_VORBIS,
00291 CODEC_ID_DVAUDIO,
00292 CODEC_ID_WMAV1,
00293 CODEC_ID_WMAV2,
00294 CODEC_ID_MACE3,
00295 CODEC_ID_MACE6,
00296 CODEC_ID_VMDAUDIO,
00297 CODEC_ID_SONIC,
00298 CODEC_ID_SONIC_LS,
00299 CODEC_ID_FLAC,
00300 CODEC_ID_MP3ADU,
00301 CODEC_ID_MP3ON4,
00302 CODEC_ID_SHORTEN,
00303 CODEC_ID_ALAC,
00304 CODEC_ID_WESTWOOD_SND1,
00305 CODEC_ID_GSM,
00306 CODEC_ID_QDM2,
00307 CODEC_ID_COOK,
00308 CODEC_ID_TRUESPEECH,
00309 CODEC_ID_TTA,
00310 CODEC_ID_SMACKAUDIO,
00311 CODEC_ID_QCELP,
00312 CODEC_ID_WAVPACK,
00313 CODEC_ID_DSICINAUDIO,
00314 CODEC_ID_IMC,
00315 CODEC_ID_MUSEPACK7,
00316 CODEC_ID_MLP,
00317 CODEC_ID_GSM_MS,
00318 CODEC_ID_ATRAC3,
00319 CODEC_ID_VOXWARE,
00320 CODEC_ID_APE,
00321 CODEC_ID_NELLYMOSER,
00322 CODEC_ID_MUSEPACK8,
00323 CODEC_ID_SPEEX,
00324 CODEC_ID_WMAVOICE,
00325 CODEC_ID_WMAPRO,
00326 CODEC_ID_WMALOSSLESS,
00327 CODEC_ID_ATRAC3P,
00328 CODEC_ID_EAC3,
00329 CODEC_ID_SIPR,
00330 CODEC_ID_MP1,
00331 CODEC_ID_TWINVQ,
00332 CODEC_ID_TRUEHD,
00333 CODEC_ID_MP4ALS,
00334 CODEC_ID_ATRAC1,
00335 CODEC_ID_BINKAUDIO_RDFT,
00336 CODEC_ID_BINKAUDIO_DCT,
00337 CODEC_ID_AAC_LATM,
00338 CODEC_ID_QDMC,
00339 CODEC_ID_CELT,
00340
00341
00342 CODEC_ID_DVD_SUBTITLE= 0x17000,
00343 CODEC_ID_DVB_SUBTITLE,
00344 CODEC_ID_TEXT,
00345 CODEC_ID_XSUB,
00346 CODEC_ID_SSA,
00347 CODEC_ID_MOV_TEXT,
00348 CODEC_ID_HDMV_PGS_SUBTITLE,
00349 CODEC_ID_DVB_TELETEXT,
00350 CODEC_ID_SRT,
00351 CODEC_ID_MICRODVD,
00352
00353
00354 CODEC_ID_TTF= 0x18000,
00355
00356 CODEC_ID_PROBE= 0x19000,
00357
00358 CODEC_ID_MPEG2TS= 0x20000,
00360 CODEC_ID_FFMETADATA=0x21000,
00361 };
00362
00363 #if FF_API_OLD_SAMPLE_FMT
00364 #define SampleFormat AVSampleFormat
00365
00366 #define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE
00367 #define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8
00368 #define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16
00369 #define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32
00370 #define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT
00371 #define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL
00372 #define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB
00373 #endif
00374
00375 #if FF_API_OLD_AUDIOCONVERT
00376 #include "libavutil/audioconvert.h"
00377
00378
00379 #define CH_FRONT_LEFT AV_CH_FRONT_LEFT
00380 #define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT
00381 #define CH_FRONT_CENTER AV_CH_FRONT_CENTER
00382 #define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY
00383 #define CH_BACK_LEFT AV_CH_BACK_LEFT
00384 #define CH_BACK_RIGHT AV_CH_BACK_RIGHT
00385 #define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER
00386 #define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER
00387 #define CH_BACK_CENTER AV_CH_BACK_CENTER
00388 #define CH_SIDE_LEFT AV_CH_SIDE_LEFT
00389 #define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT
00390 #define CH_TOP_CENTER AV_CH_TOP_CENTER
00391 #define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT
00392 #define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER
00393 #define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT
00394 #define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT
00395 #define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER
00396 #define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT
00397 #define CH_STEREO_LEFT AV_CH_STEREO_LEFT
00398 #define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT
00399
00403 #define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE
00404
00405
00406 #define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO
00407 #define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO
00408 #define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1
00409 #define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND
00410 #define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0
00411 #define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2
00412 #define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD
00413 #define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0
00414 #define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1
00415 #define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK
00416 #define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK
00417 #define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0
00418 #define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1
00419 #define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE
00420 #define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX
00421 #endif
00422
00423
00424 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00425
00433 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00434
00439 #define FF_MIN_BUFFER_SIZE 16384
00440
00441
00445 enum Motion_Est_ID {
00446 ME_ZERO = 1,
00447 ME_FULL,
00448 ME_LOG,
00449 ME_PHODS,
00450 ME_EPZS,
00451 ME_X1,
00452 ME_HEX,
00453 ME_UMH,
00454 ME_ITER,
00455 ME_TESA,
00456 };
00457
00458 enum AVDiscard{
00459
00460
00461 AVDISCARD_NONE =-16,
00462 AVDISCARD_DEFAULT= 0,
00463 AVDISCARD_NONREF = 8,
00464 AVDISCARD_BIDIR = 16,
00465 AVDISCARD_NONKEY = 32,
00466 AVDISCARD_ALL = 48,
00467 };
00468
00469 enum AVColorPrimaries{
00470 AVCOL_PRI_BT709 =1,
00471 AVCOL_PRI_UNSPECIFIED=2,
00472 AVCOL_PRI_BT470M =4,
00473 AVCOL_PRI_BT470BG =5,
00474 AVCOL_PRI_SMPTE170M =6,
00475 AVCOL_PRI_SMPTE240M =7,
00476 AVCOL_PRI_FILM =8,
00477 AVCOL_PRI_NB ,
00478 };
00479
00480 enum AVColorTransferCharacteristic{
00481 AVCOL_TRC_BT709 =1,
00482 AVCOL_TRC_UNSPECIFIED=2,
00483 AVCOL_TRC_GAMMA22 =4,
00484 AVCOL_TRC_GAMMA28 =5,
00485 AVCOL_TRC_NB ,
00486 };
00487
00488 enum AVColorSpace{
00489 AVCOL_SPC_RGB =0,
00490 AVCOL_SPC_BT709 =1,
00491 AVCOL_SPC_UNSPECIFIED=2,
00492 AVCOL_SPC_FCC =4,
00493 AVCOL_SPC_BT470BG =5,
00494 AVCOL_SPC_SMPTE170M =6,
00495 AVCOL_SPC_SMPTE240M =7,
00496 AVCOL_SPC_NB ,
00497 };
00498
00499 enum AVColorRange{
00500 AVCOL_RANGE_UNSPECIFIED=0,
00501 AVCOL_RANGE_MPEG =1,
00502 AVCOL_RANGE_JPEG =2,
00503 AVCOL_RANGE_NB ,
00504 };
00505
00511 enum AVChromaLocation{
00512 AVCHROMA_LOC_UNSPECIFIED=0,
00513 AVCHROMA_LOC_LEFT =1,
00514 AVCHROMA_LOC_CENTER =2,
00515 AVCHROMA_LOC_TOPLEFT =3,
00516 AVCHROMA_LOC_TOP =4,
00517 AVCHROMA_LOC_BOTTOMLEFT =5,
00518 AVCHROMA_LOC_BOTTOM =6,
00519 AVCHROMA_LOC_NB ,
00520 };
00521
00522 #if FF_API_FLAC_GLOBAL_OPTS
00523
00526 enum AVLPCType {
00527 AV_LPC_TYPE_DEFAULT = -1,
00528 AV_LPC_TYPE_NONE = 0,
00529 AV_LPC_TYPE_FIXED = 1,
00530 AV_LPC_TYPE_LEVINSON = 2,
00531 AV_LPC_TYPE_CHOLESKY = 3,
00532 AV_LPC_TYPE_NB ,
00533 };
00534 #endif
00535
00536 enum AVAudioServiceType {
00537 AV_AUDIO_SERVICE_TYPE_MAIN = 0,
00538 AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
00539 AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
00540 AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
00541 AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
00542 AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
00543 AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
00544 AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
00545 AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
00546 AV_AUDIO_SERVICE_TYPE_NB ,
00547 };
00548
00549 typedef struct RcOverride{
00550 int start_frame;
00551 int end_frame;
00552 int qscale;
00553 float quality_factor;
00554 } RcOverride;
00555
00556 #define FF_MAX_B_FRAMES 16
00557
00558
00559
00560
00561
00562
00563 #define CODEC_FLAG_QSCALE 0x0002
00564 #define CODEC_FLAG_4MV 0x0004
00565 #define CODEC_FLAG_QPEL 0x0010
00566 #define CODEC_FLAG_GMC 0x0020
00567 #define CODEC_FLAG_MV0 0x0040
00568 #define CODEC_FLAG_PART 0x0080
00569
00574 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00575 #define CODEC_FLAG_PASS1 0x0200
00576 #define CODEC_FLAG_PASS2 0x0400
00577 #define CODEC_FLAG_EXTERN_HUFF 0x1000
00578 #define CODEC_FLAG_GRAY 0x2000
00579 #define CODEC_FLAG_EMU_EDGE 0x4000
00580 #define CODEC_FLAG_PSNR 0x8000
00581 #define CODEC_FLAG_TRUNCATED 0x00010000
00583 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00584 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00585 #define CODEC_FLAG_LOW_DELAY 0x00080000
00586 #define CODEC_FLAG_ALT_SCAN 0x00100000
00587 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00588 #define CODEC_FLAG_BITEXACT 0x00800000
00589
00590 #define CODEC_FLAG_AC_PRED 0x01000000
00591 #define CODEC_FLAG_H263P_UMV 0x02000000
00592 #define CODEC_FLAG_CBP_RD 0x04000000
00593 #define CODEC_FLAG_QP_RD 0x08000000
00594 #define CODEC_FLAG_H263P_AIV 0x00000008
00595 #define CODEC_FLAG_OBMC 0x00000001
00596 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00597 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00598 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00599 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000
00600 #define CODEC_FLAG_CLOSED_GOP 0x80000000
00601 #define CODEC_FLAG2_FAST 0x00000001
00602 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00603 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00604 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00605 #define CODEC_FLAG2_BPYRAMID 0x00000010
00606 #define CODEC_FLAG2_WPRED 0x00000020
00607 #define CODEC_FLAG2_MIXED_REFS 0x00000040
00608 #define CODEC_FLAG2_8X8DCT 0x00000080
00609 #define CODEC_FLAG2_FASTPSKIP 0x00000100
00610 #define CODEC_FLAG2_AUD 0x00000200
00611 #define CODEC_FLAG2_BRDO 0x00000400
00612 #define CODEC_FLAG2_INTRA_VLC 0x00000800
00613 #define CODEC_FLAG2_MEMC_ONLY 0x00001000
00614 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00615 #define CODEC_FLAG2_SKIP_RD 0x00004000
00616 #define CODEC_FLAG2_CHUNKS 0x00008000
00617 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000
00618 #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000
00619 #define CODEC_FLAG2_MBTREE 0x00040000
00620 #define CODEC_FLAG2_PSY 0x00080000
00621 #define CODEC_FLAG2_SSIM 0x00100000
00622 #define CODEC_FLAG2_INTRA_REFRESH 0x00200000
00623
00624
00625
00626
00627
00628
00629
00630
00631 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00632
00637 #define CODEC_CAP_DR1 0x0002
00638
00639 #define CODEC_CAP_PARSE_ONLY 0x0004
00640 #define CODEC_CAP_TRUNCATED 0x0008
00641
00642 #define CODEC_CAP_HWACCEL 0x0010
00643
00647 #define CODEC_CAP_DELAY 0x0020
00648
00652 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00653
00656 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
00657
00668 #define CODEC_CAP_SUBFRAMES 0x0100
00669
00673 #define CODEC_CAP_EXPERIMENTAL 0x0200
00674
00677 #define CODEC_CAP_CHANNEL_CONF 0x0400
00678
00682 #define CODEC_CAP_NEG_LINESIZES 0x0800
00683
00687 #define CODEC_CAP_FRAME_THREADS 0x1000
00688
00691 #define CODEC_CAP_SLICE_THREADS 0x2000
00692
00695 #define CODEC_CAP_LOSSLESS 0x80000000
00696
00697
00698 #define MB_TYPE_INTRA4x4 0x0001
00699 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00700 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00701 #define MB_TYPE_16x16 0x0008
00702 #define MB_TYPE_16x8 0x0010
00703 #define MB_TYPE_8x16 0x0020
00704 #define MB_TYPE_8x8 0x0040
00705 #define MB_TYPE_INTERLACED 0x0080
00706 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00707 #define MB_TYPE_ACPRED 0x0200
00708 #define MB_TYPE_GMC 0x0400
00709 #define MB_TYPE_SKIP 0x0800
00710 #define MB_TYPE_P0L0 0x1000
00711 #define MB_TYPE_P1L0 0x2000
00712 #define MB_TYPE_P0L1 0x4000
00713 #define MB_TYPE_P1L1 0x8000
00714 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00715 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00716 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00717 #define MB_TYPE_QUANT 0x00010000
00718 #define MB_TYPE_CBP 0x00020000
00719
00720
00726 typedef struct AVPanScan{
00732 int id;
00733
00739 int width;
00740 int height;
00741
00747 int16_t position[3][2];
00748 }AVPanScan;
00749
00750 #define FF_COMMON_FRAME \
00751 \
00757 uint8_t *data[4];\
00758 int linesize[4];\
00759 \
00765 uint8_t *base[4];\
00766 \
00771 int key_frame;\
00772 \
00773 \
00778 enum AVPictureType pict_type;\
00779 \
00780 \
00786 int64_t pts;\
00787 \
00788 \
00793 int coded_picture_number;\
00794 \
00799 int display_picture_number;\
00800 \
00801 \
00806 int quality; \
00807 \
00808 \
00814 int age;\
00815 \
00816 \
00824 int reference;\
00825 \
00826 \
00831 int8_t *qscale_table;\
00832 \
00837 int qstride;\
00838 \
00839 \
00845 uint8_t *mbskip_table;\
00846 \
00847 \
00859 int16_t (*motion_val[2])[2];\
00860 \
00861 \
00867 uint32_t *mb_type;\
00868 \
00869 \
00875 uint8_t motion_subsample_log2;\
00876 \
00877 \
00882 void *opaque;\
00883 \
00884 \
00889 uint64_t error[4];\
00890 \
00891 \
00897 int type;\
00898 \
00899 \
00905 int repeat_pict;\
00906 \
00907 \
00910 int qscale_type;\
00911 \
00912 \
00917 int interlaced_frame;\
00918 \
00919 \
00924 int top_field_first;\
00925 \
00926 \
00931 AVPanScan *pan_scan;\
00932 \
00933 \
00938 int palette_has_changed;\
00939 \
00940 \
00945 int buffer_hints;\
00946 \
00947 \
00952 short *dct_coeff;\
00953 \
00954 \
00960 int8_t *ref_index[2];\
00961 \
00962 \
00973 int64_t reordered_opaque;\
00974 \
00975 \
00980 void *hwaccel_picture_private;\
00981 \
00982 \
00987 int64_t pkt_pts;\
00988 \
00989 \
00994 int64_t pkt_dts;\
00995 \
00996 \
01001 struct AVCodecContext *owner;\
01002 \
01003 \
01008 void *thread_opaque;\
01009 \
01010 \
01015 int64_t best_effort_timestamp;\
01016 \
01017 \
01022 int64_t pkt_pos;\
01023 \
01024 \
01029 AVRational sample_aspect_ratio;\
01030 \
01031 \
01036 int width, height;\
01037 \
01038 \
01045 int format;\
01046
01047
01048 #define FF_QSCALE_TYPE_MPEG1 0
01049 #define FF_QSCALE_TYPE_MPEG2 1
01050 #define FF_QSCALE_TYPE_H264 2
01051 #define FF_QSCALE_TYPE_VP56 3
01052
01053 #define FF_BUFFER_TYPE_INTERNAL 1
01054 #define FF_BUFFER_TYPE_USER 2
01055 #define FF_BUFFER_TYPE_SHARED 4
01056 #define FF_BUFFER_TYPE_COPY 8
01057
01058 #if FF_API_OLD_FF_PICT_TYPES
01059
01060 #define FF_I_TYPE AV_PICTURE_TYPE_I
01061 #define FF_P_TYPE AV_PICTURE_TYPE_P
01062 #define FF_B_TYPE AV_PICTURE_TYPE_B
01063 #define FF_S_TYPE AV_PICTURE_TYPE_S
01064 #define FF_SI_TYPE AV_PICTURE_TYPE_SI
01065 #define FF_SP_TYPE AV_PICTURE_TYPE_SP
01066 #define FF_BI_TYPE AV_PICTURE_TYPE_BI
01067 #endif
01068
01069 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
01070 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
01071 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
01072 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
01073
01074 enum AVPacketSideDataType {
01075 AV_PKT_DATA_PALETTE,
01076 };
01077
01078 typedef struct AVPacket {
01088 int64_t pts;
01094 int64_t dts;
01095 uint8_t *data;
01096 int size;
01097 int stream_index;
01098 int flags;
01103 struct {
01104 uint8_t *data;
01105 int size;
01106 enum AVPacketSideDataType type;
01107 } *side_data;
01108 int side_data_elems;
01109
01114 int duration;
01115 void (*destruct)(struct AVPacket *);
01116 void *priv;
01117 int64_t pos;
01118
01136 int64_t convergence_duration;
01137 } AVPacket;
01138 #define AV_PKT_FLAG_KEY 0x0001
01139
01149 typedef struct AVFrame {
01150 FF_COMMON_FRAME
01151 } AVFrame;
01152
01160 typedef struct AVCodecContext {
01165 const AVClass *av_class;
01171 int bit_rate;
01172
01179 int bit_rate_tolerance;
01180
01186 int flags;
01187
01196 int sub_id;
01197
01205 int me_method;
01206
01218 uint8_t *extradata;
01219 int extradata_size;
01220
01229 AVRational time_base;
01230
01231
01239 int width, height;
01240
01241 #define FF_ASPECT_EXTENDED 15
01242
01248 int gop_size;
01249
01257 enum PixelFormat pix_fmt;
01258
01282 void (*draw_horiz_band)(struct AVCodecContext *s,
01283 const AVFrame *src, int offset[4],
01284 int y, int type, int height);
01285
01286
01287 int sample_rate;
01288 int channels;
01289
01295 enum AVSampleFormat sample_fmt;
01296
01297
01301 int frame_size;
01302 int frame_number;
01303
01310 int delay;
01311
01312
01313 float qcompress;
01314 float qblur;
01315
01321 int qmin;
01322
01328 int qmax;
01329
01335 int max_qdiff;
01336
01343 int max_b_frames;
01344
01352 float b_quant_factor;
01353
01355 int rc_strategy;
01356 #define FF_RC_STRATEGY_XVID 1
01357
01358 int b_frame_strategy;
01359
01360 struct AVCodec *codec;
01361
01362 void *priv_data;
01363
01364 int rtp_payload_size;
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01379
01380
01381 int mv_bits;
01382 int header_bits;
01383 int i_tex_bits;
01384 int p_tex_bits;
01385 int i_count;
01386 int p_count;
01387 int skip_count;
01388 int misc_bits;
01389
01395 int frame_bits;
01396
01402 void *opaque;
01403
01404 char codec_name[32];
01405 enum AVMediaType codec_type;
01406 enum CodecID codec_id;
01407
01421 unsigned int codec_tag;
01422
01428 int workaround_bugs;
01429 #define FF_BUG_AUTODETECT 1
01430 #define FF_BUG_OLD_MSMPEG4 2
01431 #define FF_BUG_XVID_ILACE 4
01432 #define FF_BUG_UMP4 8
01433 #define FF_BUG_NO_PADDING 16
01434 #define FF_BUG_AMV 32
01435 #define FF_BUG_AC_VLC 0
01436 #define FF_BUG_QPEL_CHROMA 64
01437 #define FF_BUG_STD_QPEL 128
01438 #define FF_BUG_QPEL_CHROMA2 256
01439 #define FF_BUG_DIRECT_BLOCKSIZE 512
01440 #define FF_BUG_EDGE 1024
01441 #define FF_BUG_HPEL_CHROMA 2048
01442 #define FF_BUG_DC_CLIP 4096
01443 #define FF_BUG_MS 8192
01444 #define FF_BUG_TRUNCATED 16384
01445
01446
01452 int luma_elim_threshold;
01453
01459 int chroma_elim_threshold;
01460
01473 int strict_std_compliance;
01474 #define FF_COMPLIANCE_VERY_STRICT 2
01475 #define FF_COMPLIANCE_STRICT 1
01476 #define FF_COMPLIANCE_NORMAL 0
01477 #define FF_COMPLIANCE_UNOFFICIAL -1
01478 #define FF_COMPLIANCE_EXPERIMENTAL -2
01479
01480
01485 float b_quant_offset;
01486
01493 int error_recognition;
01494 #define FF_ER_CAREFUL 1
01495 #define FF_ER_COMPLIANT 2
01496 #define FF_ER_AGGRESSIVE 3
01497 #define FF_ER_VERY_AGGRESSIVE 4
01498
01513 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01514
01524 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01525
01532 int has_b_frames;
01533
01538 int block_align;
01539
01540 int parse_only;
01541
01542
01543
01549 int mpeg_quant;
01550
01556 char *stats_out;
01557
01564 char *stats_in;
01565
01572 float rc_qsquish;
01573
01574 float rc_qmod_amp;
01575 int rc_qmod_freq;
01576
01582 RcOverride *rc_override;
01583 int rc_override_count;
01584
01590 const char *rc_eq;
01591
01597 int rc_max_rate;
01598
01604 int rc_min_rate;
01605
01611 int rc_buffer_size;
01612 float rc_buffer_aggressivity;
01613
01621 float i_quant_factor;
01622
01628 float i_quant_offset;
01629
01635 float rc_initial_cplx;
01636
01642 int dct_algo;
01643 #define FF_DCT_AUTO 0
01644 #define FF_DCT_FASTINT 1
01645 #define FF_DCT_INT 2
01646 #define FF_DCT_MMX 3
01647 #define FF_DCT_MLIB 4
01648 #define FF_DCT_ALTIVEC 5
01649 #define FF_DCT_FAAN 6
01650
01656 float lumi_masking;
01657
01663 float temporal_cplx_masking;
01664
01670 float spatial_cplx_masking;
01671
01677 float p_masking;
01678
01684 float dark_masking;
01685
01691 int idct_algo;
01692 #define FF_IDCT_AUTO 0
01693 #define FF_IDCT_INT 1
01694 #define FF_IDCT_SIMPLE 2
01695 #define FF_IDCT_SIMPLEMMX 3
01696 #define FF_IDCT_LIBMPEG2MMX 4
01697 #define FF_IDCT_PS2 5
01698 #define FF_IDCT_MLIB 6
01699 #define FF_IDCT_ARM 7
01700 #define FF_IDCT_ALTIVEC 8
01701 #define FF_IDCT_SH4 9
01702 #define FF_IDCT_SIMPLEARM 10
01703 #define FF_IDCT_H264 11
01704 #define FF_IDCT_VP3 12
01705 #define FF_IDCT_IPP 13
01706 #define FF_IDCT_XVIDMMX 14
01707 #define FF_IDCT_CAVS 15
01708 #define FF_IDCT_SIMPLEARMV5TE 16
01709 #define FF_IDCT_SIMPLEARMV6 17
01710 #define FF_IDCT_SIMPLEVIS 18
01711 #define FF_IDCT_WMV2 19
01712 #define FF_IDCT_FAAN 20
01713 #define FF_IDCT_EA 21
01714 #define FF_IDCT_SIMPLENEON 22
01715 #define FF_IDCT_SIMPLEALPHA 23
01716 #define FF_IDCT_BINK 24
01717
01723 int slice_count;
01729 int *slice_offset;
01730
01736 int error_concealment;
01737 #define FF_EC_GUESS_MVS 1
01738 #define FF_EC_DEBLOCK 2
01739
01748 unsigned dsp_mask;
01749
01755 int bits_per_coded_sample;
01756
01762 int prediction_method;
01763 #define FF_PRED_LEFT 0
01764 #define FF_PRED_PLANE 1
01765 #define FF_PRED_MEDIAN 2
01766
01774 AVRational sample_aspect_ratio;
01775
01781 AVFrame *coded_frame;
01782
01788 int debug;
01789 #define FF_DEBUG_PICT_INFO 1
01790 #define FF_DEBUG_RC 2
01791 #define FF_DEBUG_BITSTREAM 4
01792 #define FF_DEBUG_MB_TYPE 8
01793 #define FF_DEBUG_QP 16
01794 #define FF_DEBUG_MV 32
01795 #define FF_DEBUG_DCT_COEFF 0x00000040
01796 #define FF_DEBUG_SKIP 0x00000080
01797 #define FF_DEBUG_STARTCODE 0x00000100
01798 #define FF_DEBUG_PTS 0x00000200
01799 #define FF_DEBUG_ER 0x00000400
01800 #define FF_DEBUG_MMCO 0x00000800
01801 #define FF_DEBUG_BUGS 0x00001000
01802 #define FF_DEBUG_VIS_QP 0x00002000
01803 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01804 #define FF_DEBUG_BUFFERS 0x00008000
01805 #define FF_DEBUG_THREADS 0x00010000
01806
01812 int debug_mv;
01813 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
01814 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
01815 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01816
01822 uint64_t error[4];
01823
01829 int me_cmp;
01835 int me_sub_cmp;
01841 int mb_cmp;
01847 int ildct_cmp;
01848 #define FF_CMP_SAD 0
01849 #define FF_CMP_SSE 1
01850 #define FF_CMP_SATD 2
01851 #define FF_CMP_DCT 3
01852 #define FF_CMP_PSNR 4
01853 #define FF_CMP_BIT 5
01854 #define FF_CMP_RD 6
01855 #define FF_CMP_ZERO 7
01856 #define FF_CMP_VSAD 8
01857 #define FF_CMP_VSSE 9
01858 #define FF_CMP_NSSE 10
01859 #define FF_CMP_W53 11
01860 #define FF_CMP_W97 12
01861 #define FF_CMP_DCTMAX 13
01862 #define FF_CMP_DCT264 14
01863 #define FF_CMP_CHROMA 256
01864
01870 int dia_size;
01871
01877 int last_predictor_count;
01878
01884 int pre_me;
01885
01891 int me_pre_cmp;
01892
01898 int pre_dia_size;
01899
01905 int me_subpel_quality;
01906
01916 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01917
01926 int dtg_active_format;
01927 #define FF_DTG_AFD_SAME 8
01928 #define FF_DTG_AFD_4_3 9
01929 #define FF_DTG_AFD_16_9 10
01930 #define FF_DTG_AFD_14_9 11
01931 #define FF_DTG_AFD_4_3_SP_14_9 13
01932 #define FF_DTG_AFD_16_9_SP_14_9 14
01933 #define FF_DTG_AFD_SP_4_3 15
01934
01942 int me_range;
01943
01949 int intra_quant_bias;
01950 #define FF_DEFAULT_QUANT_BIAS 999999
01951
01957 int inter_quant_bias;
01958
01965 int color_table_id;
01966
01971 int internal_buffer_count;
01972
01977 void *internal_buffer;
01978
01985 int global_quality;
01986
01987 #define FF_CODER_TYPE_VLC 0
01988 #define FF_CODER_TYPE_AC 1
01989 #define FF_CODER_TYPE_RAW 2
01990 #define FF_CODER_TYPE_RLE 3
01991 #define FF_CODER_TYPE_DEFLATE 4
01992
01997 int coder_type;
01998
02004 int context_model;
02005 #if 0
02006
02011 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
02012 #endif
02013
02019 int slice_flags;
02020 #define SLICE_FLAG_CODED_ORDER 0x0001
02021 #define SLICE_FLAG_ALLOW_FIELD 0x0002
02022 #define SLICE_FLAG_ALLOW_PLANE 0x0004
02023
02024
02029 int xvmc_acceleration;
02030
02036 int mb_decision;
02037 #define FF_MB_DECISION_SIMPLE 0
02038 #define FF_MB_DECISION_BITS 1
02039 #define FF_MB_DECISION_RD 2
02040
02041
02046 uint16_t *intra_matrix;
02047
02053 uint16_t *inter_matrix;
02054
02061 unsigned int stream_codec_tag;
02062
02069 int scenechange_threshold;
02070
02076 int lmin;
02077
02083 int lmax;
02084
02085 #if FF_API_PALETTE_CONTROL
02086
02091 struct AVPaletteControl *palctrl;
02092 #endif
02093
02099 int noise_reduction;
02100
02113 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
02114
02120 int rc_initial_buffer_occupancy;
02121
02127 int inter_threshold;
02128
02134 int flags2;
02135
02141 int error_rate;
02142
02143 #if FF_API_ANTIALIAS_ALGO
02144
02149 attribute_deprecated int antialias_algo;
02150 #define FF_AA_AUTO 0
02151 #define FF_AA_FASTINT 1 //not implemented yet
02152 #define FF_AA_INT 2
02153 #define FF_AA_FLOAT 3
02154 #endif
02155
02161 int quantizer_noise_shaping;
02162
02169 int thread_count;
02170
02180 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
02181
02188 void *thread_opaque;
02189
02197 int me_threshold;
02198
02204 int mb_threshold;
02205
02211 int intra_dc_precision;
02212
02218 int nsse_weight;
02219
02225 int skip_top;
02226
02232 int skip_bottom;
02233
02239 int profile;
02240 #define FF_PROFILE_UNKNOWN -99
02241 #define FF_PROFILE_RESERVED -100
02242
02243 #define FF_PROFILE_AAC_MAIN 0
02244 #define FF_PROFILE_AAC_LOW 1
02245 #define FF_PROFILE_AAC_SSR 2
02246 #define FF_PROFILE_AAC_LTP 3
02247
02248 #define FF_PROFILE_DTS 20
02249 #define FF_PROFILE_DTS_ES 30
02250 #define FF_PROFILE_DTS_96_24 40
02251 #define FF_PROFILE_DTS_HD_HRA 50
02252 #define FF_PROFILE_DTS_HD_MA 60
02253
02254 #define FF_PROFILE_MPEG2_422 0
02255 #define FF_PROFILE_MPEG2_HIGH 1
02256 #define FF_PROFILE_MPEG2_SS 2
02257 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
02258 #define FF_PROFILE_MPEG2_MAIN 4
02259 #define FF_PROFILE_MPEG2_SIMPLE 5
02260
02261 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
02262 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
02263
02264 #define FF_PROFILE_H264_BASELINE 66
02265 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
02266 #define FF_PROFILE_H264_MAIN 77
02267 #define FF_PROFILE_H264_EXTENDED 88
02268 #define FF_PROFILE_H264_HIGH 100
02269 #define FF_PROFILE_H264_HIGH_10 110
02270 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
02271 #define FF_PROFILE_H264_HIGH_422 122
02272 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
02273 #define FF_PROFILE_H264_HIGH_444 144
02274 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
02275 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
02276 #define FF_PROFILE_H264_CAVLC_444 44
02277
02278 #define FF_PROFILE_VC1_SIMPLE 0
02279 #define FF_PROFILE_VC1_MAIN 1
02280 #define FF_PROFILE_VC1_COMPLEX 2
02281 #define FF_PROFILE_VC1_ADVANCED 3
02282
02288 int level;
02289 #define FF_LEVEL_UNKNOWN -99
02290
02296 int lowres;
02297
02304 int coded_width, coded_height;
02305
02311 int frame_skip_threshold;
02312
02318 int frame_skip_factor;
02319
02325 int frame_skip_exp;
02326
02332 int frame_skip_cmp;
02333
02340 float border_masking;
02341
02347 int mb_lmin;
02348
02354 int mb_lmax;
02355
02361 int me_penalty_compensation;
02362
02368 enum AVDiscard skip_loop_filter;
02369
02375 enum AVDiscard skip_idct;
02376
02382 enum AVDiscard skip_frame;
02383
02389 int bidir_refine;
02390
02396 int brd_scale;
02397
02403 float crf;
02404
02410 int cqp;
02411
02417 int keyint_min;
02418
02424 int refs;
02425
02431 int chromaoffset;
02432
02438 int bframebias;
02439
02445 int trellis;
02446
02452 float complexityblur;
02453
02460 int deblockalpha;
02461
02468 int deblockbeta;
02469
02475 int partitions;
02476 #define X264_PART_I4X4 0x001
02477 #define X264_PART_I8X8 0x002
02478 #define X264_PART_P8X8 0x010
02479 #define X264_PART_P4X4 0x020
02480 #define X264_PART_B8X8 0x100
02481
02487 int directpred;
02488
02494 int cutoff;
02495
02501 int scenechange_factor;
02502
02509 int mv0_threshold;
02510
02516 int b_sensitivity;
02517
02522 int compression_level;
02523 #define FF_COMPRESSION_DEFAULT -1
02524
02529 int min_prediction_order;
02530
02535 int max_prediction_order;
02536
02537 #if FF_API_FLAC_GLOBAL_OPTS
02538
02549 attribute_deprecated int lpc_coeff_precision;
02550
02556 attribute_deprecated int prediction_order_method;
02557
02562 attribute_deprecated int min_partition_order;
02563
02568 attribute_deprecated int max_partition_order;
02572 #endif
02573
02579 int64_t timecode_frame_start;
02580
02581 #if FF_API_REQUEST_CHANNELS
02582
02588 int request_channels;
02589 #endif
02590
02597 float drc_scale;
02598
02606 int64_t reordered_opaque;
02607
02613 int bits_per_raw_sample;
02614
02620 int64_t channel_layout;
02621
02627 int64_t request_channel_layout;
02628
02634 float rc_max_available_vbv_use;
02635
02641 float rc_min_vbv_overflow_use;
02642
02648 struct AVHWAccel *hwaccel;
02649
02657 int ticks_per_frame;
02658
02669 void *hwaccel_context;
02670
02676 enum AVColorPrimaries color_primaries;
02677
02683 enum AVColorTransferCharacteristic color_trc;
02684
02690 enum AVColorSpace colorspace;
02691
02697 enum AVColorRange color_range;
02698
02704 enum AVChromaLocation chroma_sample_location;
02705
02724 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
02725
02734 int weighted_p_pred;
02735
02744 int aq_mode;
02745
02752 float aq_strength;
02753
02760 float psy_rd;
02761
02768 float psy_trellis;
02769
02776 int rc_lookahead;
02777
02785 float crf_max;
02786
02787 int log_level_offset;
02788
02789 #if FF_API_FLAC_GLOBAL_OPTS
02790
02795 attribute_deprecated enum AVLPCType lpc_type;
02796
02802 attribute_deprecated int lpc_passes;
02803 #endif
02804
02812 int slices;
02813
02822 uint8_t *subtitle_header;
02823 int subtitle_header_size;
02824
02832 AVPacket *pkt;
02833
02841 int is_copy;
02842
02851 int thread_type;
02852 #define FF_THREAD_FRAME 1 //< Decode more than one frame at once
02853 #define FF_THREAD_SLICE 2 //< Decode more than one part of a single frame at once
02854
02860 int active_thread_type;
02861
02870 int thread_safe_callbacks;
02871
02878 uint64_t vbv_delay;
02879
02885 enum AVAudioServiceType audio_service_type;
02886
02893 enum AVSampleFormat request_sample_fmt;
02894
02900 int64_t pts_correction_num_faulty_pts;
02901 int64_t pts_correction_num_faulty_dts;
02902 int64_t pts_correction_last_pts;
02903 int64_t pts_correction_last_dts;
02904
02905
02906 } AVCodecContext;
02907
02911 typedef struct AVProfile {
02912 int profile;
02913 const char *name;
02914 } AVProfile;
02915
02919 typedef struct AVCodec {
02926 const char *name;
02927 enum AVMediaType type;
02928 enum CodecID id;
02929 int priv_data_size;
02930 int (*init)(AVCodecContext *);
02931 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02932 int (*close)(AVCodecContext *);
02933 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
02938 int capabilities;
02939 struct AVCodec *next;
02944 void (*flush)(AVCodecContext *);
02945 const AVRational *supported_framerates;
02946 const enum PixelFormat *pix_fmts;
02947
02951 const char *long_name;
02952 const int *supported_samplerates;
02953 const enum AVSampleFormat *sample_fmts;
02954 const int64_t *channel_layouts;
02955 uint8_t max_lowres;
02956 const AVClass *priv_class;
02957 const AVProfile *profiles;
02958
02968 int (*init_thread_copy)(AVCodecContext *);
02976 int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
02978 } AVCodec;
02979
02983 typedef struct AVHWAccel {
02989 const char *name;
02990
02996 enum AVMediaType type;
02997
03003 enum CodecID id;
03004
03010 enum PixelFormat pix_fmt;
03011
03016 int capabilities;
03017
03018 struct AVHWAccel *next;
03019
03034 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03035
03047 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03048
03058 int (*end_frame)(AVCodecContext *avctx);
03059
03067 int priv_data_size;
03068 } AVHWAccel;
03069
03074 typedef struct AVPicture {
03075 uint8_t *data[4];
03076 int linesize[4];
03077 } AVPicture;
03078
03079 #if FF_API_PALETTE_CONTROL
03080
03088 #define AVPALETTE_SIZE 1024
03089 #define AVPALETTE_COUNT 256
03090 typedef struct AVPaletteControl {
03091
03092
03093
03094 int palette_changed;
03095
03096
03097
03098
03099
03100 unsigned int palette[AVPALETTE_COUNT];
03101
03102 } AVPaletteControl attribute_deprecated;
03103 #endif
03104
03105 enum AVSubtitleType {
03106 SUBTITLE_NONE,
03107
03108 SUBTITLE_BITMAP,
03109
03114 SUBTITLE_TEXT,
03115
03120 SUBTITLE_ASS,
03121 };
03122
03123 typedef struct AVSubtitleRect {
03124 int x;
03125 int y;
03126 int w;
03127 int h;
03128 int nb_colors;
03129
03134 AVPicture pict;
03135 enum AVSubtitleType type;
03136
03137 char *text;
03138
03144 char *ass;
03145 } AVSubtitleRect;
03146
03147 typedef struct AVSubtitle {
03148 uint16_t format;
03149 uint32_t start_display_time;
03150 uint32_t end_display_time;
03151 unsigned num_rects;
03152 AVSubtitleRect **rects;
03153 int64_t pts;
03154 } AVSubtitle;
03155
03156
03157
03161 attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
03162
03166 void av_destruct_packet(AVPacket *pkt);
03167
03173 void av_init_packet(AVPacket *pkt);
03174
03183 int av_new_packet(AVPacket *pkt, int size);
03184
03191 void av_shrink_packet(AVPacket *pkt, int size);
03192
03199 int av_grow_packet(AVPacket *pkt, int grow_by);
03200
03205 int av_dup_packet(AVPacket *pkt);
03206
03212 void av_free_packet(AVPacket *pkt);
03213
03222 uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03223 int size);
03224
03233 uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03234 int *size);
03235
03236 int av_packet_merge_side_data(AVPacket *pkt);
03237
03238 int av_packet_split_side_data(AVPacket *pkt);
03239
03240
03241
03242
03243 struct ReSampleContext;
03244 struct AVResampleContext;
03245
03246 typedef struct ReSampleContext ReSampleContext;
03247
03264 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
03265 int output_rate, int input_rate,
03266 enum AVSampleFormat sample_fmt_out,
03267 enum AVSampleFormat sample_fmt_in,
03268 int filter_length, int log2_phase_count,
03269 int linear, double cutoff);
03270
03271 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
03272
03279 void audio_resample_close(ReSampleContext *s);
03280
03281
03291 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
03292
03302 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
03303
03304
03317 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
03318 void av_resample_close(struct AVResampleContext *c);
03319
03331 int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
03332
03340 void avpicture_free(AVPicture *picture);
03341
03362 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
03363 enum PixelFormat pix_fmt, int width, int height);
03364
03380 int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
03381 unsigned char *dest, int dest_size);
03382
03395 int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
03396 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
03397
03398 #if FF_API_GET_PIX_FMT_NAME
03399
03405 attribute_deprecated
03406 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
03407 #endif
03408
03409 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
03410
03416 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
03417
03425 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
03426
03427 #define FF_LOSS_RESOLUTION 0x0001
03428 #define FF_LOSS_DEPTH 0x0002
03429 #define FF_LOSS_COLORSPACE 0x0004
03430 #define FF_LOSS_ALPHA 0x0008
03431 #define FF_LOSS_COLORQUANT 0x0010
03432 #define FF_LOSS_CHROMA 0x0020
03451 int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
03452 int has_alpha);
03453
03476 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
03477 int has_alpha, int *loss_ptr);
03478
03479 #define FF_ALPHA_TRANSP 0x0001
03480 #define FF_ALPHA_SEMI_TRANSP 0x0002
03481
03486 int img_get_alpha_info(const AVPicture *src,
03487 enum PixelFormat pix_fmt, int width, int height);
03488
03489
03490
03491 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
03492 enum PixelFormat pix_fmt, int width, int height);
03493
03494
03495
03501 AVCodec *av_codec_next(AVCodec *c);
03502
03506 unsigned avcodec_version(void);
03507
03511 const char *avcodec_configuration(void);
03512
03516 const char *avcodec_license(void);
03517
03527 void avcodec_init(void);
03528
03534 void avcodec_register(AVCodec *codec);
03535
03542 AVCodec *avcodec_find_encoder(enum CodecID id);
03543
03550 AVCodec *avcodec_find_encoder_by_name(const char *name);
03551
03558 AVCodec *avcodec_find_decoder(enum CodecID id);
03559
03566 AVCodec *avcodec_find_decoder_by_name(const char *name);
03567 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
03568
03576 const char *av_get_profile_name(const AVCodec *codec, int profile);
03577
03583 void avcodec_get_context_defaults(AVCodecContext *s);
03584
03587 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
03588
03591 int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
03592
03600 AVCodecContext *avcodec_alloc_context(void);
03601
03604 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
03605
03608 AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
03609
03621 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
03622
03628 void avcodec_get_frame_defaults(AVFrame *pic);
03629
03637 AVFrame *avcodec_alloc_frame(void);
03638
03639 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03640 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03641 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03642
03650 unsigned avcodec_get_edge_width(void);
03660 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03670 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
03671 int linesize_align[4]);
03672
03673 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
03674
03675 #if FF_API_THREAD_INIT
03676
03679 attribute_deprecated
03680 int avcodec_thread_init(AVCodecContext *s, int thread_count);
03681 #endif
03682
03683 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
03684 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
03685
03686
03687 #if FF_API_AVCODEC_OPEN
03688
03717 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
03718 #endif
03719
03751 int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
03752
03792 int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
03793 int *frame_size_ptr,
03794 AVPacket *avpkt);
03795
03836 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
03837 int *got_picture_ptr,
03838 AVPacket *avpkt);
03839
03856 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
03857 int *got_sub_ptr,
03858 AVPacket *avpkt);
03859
03865 void avsubtitle_free(AVSubtitle *sub);
03866
03867 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
03868 int *data_size_ptr,
03869 uint8_t *buf, int buf_size);
03870
03890 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03891 const short *samples);
03892
03905 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03906 const AVFrame *pict);
03907 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03908 const AVSubtitle *sub);
03909
03910 int avcodec_close(AVCodecContext *avctx);
03911
03922 void avcodec_register_all(void);
03923
03927 void avcodec_flush_buffers(AVCodecContext *avctx);
03928
03929 void avcodec_default_free_buffers(AVCodecContext *s);
03930
03931
03932
03933 #if FF_API_OLD_FF_PICT_TYPES
03934
03941 attribute_deprecated
03942 char av_get_pict_type_char(int pict_type);
03943 #endif
03944
03951 int av_get_bits_per_sample(enum CodecID codec_id);
03952
03953 #if FF_API_OLD_SAMPLE_FMT
03954
03957 attribute_deprecated
03958 int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt);
03959 #endif
03960
03961
03962 typedef struct AVCodecParserContext {
03963 void *priv_data;
03964 struct AVCodecParser *parser;
03965 int64_t frame_offset;
03966 int64_t cur_offset;
03967
03968 int64_t next_frame_offset;
03969
03970 int pict_type;
03980 int repeat_pict;
03981 int64_t pts;
03982 int64_t dts;
03983
03984
03985 int64_t last_pts;
03986 int64_t last_dts;
03987 int fetch_timestamp;
03988
03989 #define AV_PARSER_PTS_NB 4
03990 int cur_frame_start_index;
03991 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03992 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03993 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03994
03995 int flags;
03996 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
03997 #define PARSER_FLAG_ONCE 0x0002
03999 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
04000
04001 int64_t offset;
04002 int64_t cur_frame_end[AV_PARSER_PTS_NB];
04003
04010 int key_frame;
04011
04029 int64_t convergence_duration;
04030
04031
04041 int dts_sync_point;
04042
04056 int dts_ref_dts_delta;
04057
04070 int pts_dts_delta;
04071
04077 int64_t cur_frame_pos[AV_PARSER_PTS_NB];
04078
04082 int64_t pos;
04083
04087 int64_t last_pos;
04088 } AVCodecParserContext;
04089
04090 typedef struct AVCodecParser {
04091 int codec_ids[5];
04092 int priv_data_size;
04093 int (*parser_init)(AVCodecParserContext *s);
04094 int (*parser_parse)(AVCodecParserContext *s,
04095 AVCodecContext *avctx,
04096 const uint8_t **poutbuf, int *poutbuf_size,
04097 const uint8_t *buf, int buf_size);
04098 void (*parser_close)(AVCodecParserContext *s);
04099 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
04100 struct AVCodecParser *next;
04101 } AVCodecParser;
04102
04103 AVCodecParser *av_parser_next(AVCodecParser *c);
04104
04105 void av_register_codec_parser(AVCodecParser *parser);
04106 AVCodecParserContext *av_parser_init(int codec_id);
04107
04136 int av_parser_parse2(AVCodecParserContext *s,
04137 AVCodecContext *avctx,
04138 uint8_t **poutbuf, int *poutbuf_size,
04139 const uint8_t *buf, int buf_size,
04140 int64_t pts, int64_t dts,
04141 int64_t pos);
04142
04143 int av_parser_change(AVCodecParserContext *s,
04144 AVCodecContext *avctx,
04145 uint8_t **poutbuf, int *poutbuf_size,
04146 const uint8_t *buf, int buf_size, int keyframe);
04147 void av_parser_close(AVCodecParserContext *s);
04148
04149
04150 typedef struct AVBitStreamFilterContext {
04151 void *priv_data;
04152 struct AVBitStreamFilter *filter;
04153 AVCodecParserContext *parser;
04154 struct AVBitStreamFilterContext *next;
04155 } AVBitStreamFilterContext;
04156
04157
04158 typedef struct AVBitStreamFilter {
04159 const char *name;
04160 int priv_data_size;
04161 int (*filter)(AVBitStreamFilterContext *bsfc,
04162 AVCodecContext *avctx, const char *args,
04163 uint8_t **poutbuf, int *poutbuf_size,
04164 const uint8_t *buf, int buf_size, int keyframe);
04165 void (*close)(AVBitStreamFilterContext *bsfc);
04166 struct AVBitStreamFilter *next;
04167 } AVBitStreamFilter;
04168
04169 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
04170 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
04171 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
04172 AVCodecContext *avctx, const char *args,
04173 uint8_t **poutbuf, int *poutbuf_size,
04174 const uint8_t *buf, int buf_size, int keyframe);
04175 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
04176
04177 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
04178
04179
04180
04186 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
04187
04200 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
04201
04205 void av_picture_copy(AVPicture *dst, const AVPicture *src,
04206 enum PixelFormat pix_fmt, int width, int height);
04207
04211 int av_picture_crop(AVPicture *dst, const AVPicture *src,
04212 enum PixelFormat pix_fmt, int top_band, int left_band);
04213
04217 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
04218 int padtop, int padbottom, int padleft, int padright, int *color);
04219
04227 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
04228
04241 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
04242
04251 void av_log_ask_for_sample(void *avc, const char *msg, ...);
04252
04256 void av_register_hwaccel(AVHWAccel *hwaccel);
04257
04263 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
04264
04265
04269 enum AVLockOp {
04270 AV_LOCK_CREATE,
04271 AV_LOCK_OBTAIN,
04272 AV_LOCK_RELEASE,
04273 AV_LOCK_DESTROY,
04274 };
04275
04289 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
04290
04291 #endif