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 #include "libavutil/log.h"
00035 #include "libavutil/pixfmt.h"
00036 #include "libavutil/rational.h"
00037 #include "libavutil/audioconvert.h"
00038
00039 #include "libavcodec/version.h"
00093 enum CodecID {
00094 CODEC_ID_NONE,
00095
00096
00097 CODEC_ID_MPEG1VIDEO,
00098 CODEC_ID_MPEG2VIDEO,
00099 CODEC_ID_MPEG2VIDEO_XVMC,
00100 CODEC_ID_H261,
00101 CODEC_ID_H263,
00102 CODEC_ID_RV10,
00103 CODEC_ID_RV20,
00104 CODEC_ID_MJPEG,
00105 CODEC_ID_MJPEGB,
00106 CODEC_ID_LJPEG,
00107 CODEC_ID_SP5X,
00108 CODEC_ID_JPEGLS,
00109 CODEC_ID_MPEG4,
00110 CODEC_ID_RAWVIDEO,
00111 CODEC_ID_MSMPEG4V1,
00112 CODEC_ID_MSMPEG4V2,
00113 CODEC_ID_MSMPEG4V3,
00114 CODEC_ID_WMV1,
00115 CODEC_ID_WMV2,
00116 CODEC_ID_H263P,
00117 CODEC_ID_H263I,
00118 CODEC_ID_FLV1,
00119 CODEC_ID_SVQ1,
00120 CODEC_ID_SVQ3,
00121 CODEC_ID_DVVIDEO,
00122 CODEC_ID_HUFFYUV,
00123 CODEC_ID_CYUV,
00124 CODEC_ID_H264,
00125 CODEC_ID_INDEO3,
00126 CODEC_ID_VP3,
00127 CODEC_ID_THEORA,
00128 CODEC_ID_ASV1,
00129 CODEC_ID_ASV2,
00130 CODEC_ID_FFV1,
00131 CODEC_ID_4XM,
00132 CODEC_ID_VCR1,
00133 CODEC_ID_CLJR,
00134 CODEC_ID_MDEC,
00135 CODEC_ID_ROQ,
00136 CODEC_ID_INTERPLAY_VIDEO,
00137 CODEC_ID_XAN_WC3,
00138 CODEC_ID_XAN_WC4,
00139 CODEC_ID_RPZA,
00140 CODEC_ID_CINEPAK,
00141 CODEC_ID_WS_VQA,
00142 CODEC_ID_MSRLE,
00143 CODEC_ID_MSVIDEO1,
00144 CODEC_ID_IDCIN,
00145 CODEC_ID_8BPS,
00146 CODEC_ID_SMC,
00147 CODEC_ID_FLIC,
00148 CODEC_ID_TRUEMOTION1,
00149 CODEC_ID_VMDVIDEO,
00150 CODEC_ID_MSZH,
00151 CODEC_ID_ZLIB,
00152 CODEC_ID_QTRLE,
00153 CODEC_ID_SNOW,
00154 CODEC_ID_TSCC,
00155 CODEC_ID_ULTI,
00156 CODEC_ID_QDRAW,
00157 CODEC_ID_VIXL,
00158 CODEC_ID_QPEG,
00159 CODEC_ID_PNG,
00160 CODEC_ID_PPM,
00161 CODEC_ID_PBM,
00162 CODEC_ID_PGM,
00163 CODEC_ID_PGMYUV,
00164 CODEC_ID_PAM,
00165 CODEC_ID_FFVHUFF,
00166 CODEC_ID_RV30,
00167 CODEC_ID_RV40,
00168 CODEC_ID_VC1,
00169 CODEC_ID_WMV3,
00170 CODEC_ID_LOCO,
00171 CODEC_ID_WNV1,
00172 CODEC_ID_AASC,
00173 CODEC_ID_INDEO2,
00174 CODEC_ID_FRAPS,
00175 CODEC_ID_TRUEMOTION2,
00176 CODEC_ID_BMP,
00177 CODEC_ID_CSCD,
00178 CODEC_ID_MMVIDEO,
00179 CODEC_ID_ZMBV,
00180 CODEC_ID_AVS,
00181 CODEC_ID_SMACKVIDEO,
00182 CODEC_ID_NUV,
00183 CODEC_ID_KMVC,
00184 CODEC_ID_FLASHSV,
00185 CODEC_ID_CAVS,
00186 CODEC_ID_JPEG2000,
00187 CODEC_ID_VMNC,
00188 CODEC_ID_VP5,
00189 CODEC_ID_VP6,
00190 CODEC_ID_VP6F,
00191 CODEC_ID_TARGA,
00192 CODEC_ID_DSICINVIDEO,
00193 CODEC_ID_TIERTEXSEQVIDEO,
00194 CODEC_ID_TIFF,
00195 CODEC_ID_GIF,
00196 CODEC_ID_DXA,
00197 CODEC_ID_DNXHD,
00198 CODEC_ID_THP,
00199 CODEC_ID_SGI,
00200 CODEC_ID_C93,
00201 CODEC_ID_BETHSOFTVID,
00202 CODEC_ID_PTX,
00203 CODEC_ID_TXD,
00204 CODEC_ID_VP6A,
00205 CODEC_ID_AMV,
00206 CODEC_ID_VB,
00207 CODEC_ID_PCX,
00208 CODEC_ID_SUNRAST,
00209 CODEC_ID_INDEO4,
00210 CODEC_ID_INDEO5,
00211 CODEC_ID_MIMIC,
00212 CODEC_ID_RL2,
00213 CODEC_ID_ESCAPE124,
00214 CODEC_ID_DIRAC,
00215 CODEC_ID_BFI,
00216 CODEC_ID_CMV,
00217 CODEC_ID_MOTIONPIXELS,
00218 CODEC_ID_TGV,
00219 CODEC_ID_TGQ,
00220 CODEC_ID_TQI,
00221 CODEC_ID_AURA,
00222 CODEC_ID_AURA2,
00223 CODEC_ID_V210X,
00224 CODEC_ID_TMV,
00225 CODEC_ID_V210,
00226 CODEC_ID_DPX,
00227 CODEC_ID_MAD,
00228 CODEC_ID_FRWU,
00229 CODEC_ID_FLASHSV2,
00230 CODEC_ID_CDGRAPHICS,
00231 CODEC_ID_R210,
00232 CODEC_ID_ANM,
00233 CODEC_ID_BINKVIDEO,
00234 CODEC_ID_IFF_ILBM,
00235 CODEC_ID_IFF_BYTERUN1,
00236 CODEC_ID_KGV1,
00237 CODEC_ID_YOP,
00238 CODEC_ID_VP8,
00239 CODEC_ID_PICTOR,
00240 CODEC_ID_ANSI,
00241 CODEC_ID_A64_MULTI,
00242 CODEC_ID_A64_MULTI5,
00243 CODEC_ID_R10K,
00244 CODEC_ID_MXPEG,
00245 CODEC_ID_LAGARITH,
00246 CODEC_ID_PRORES,
00247 CODEC_ID_JV,
00248 CODEC_ID_DFA,
00249 CODEC_ID_WMV3IMAGE,
00250 CODEC_ID_VC1IMAGE,
00251 CODEC_ID_UTVIDEO,
00252 CODEC_ID_BMV_VIDEO,
00253 CODEC_ID_VBLE,
00254 CODEC_ID_DXTORY,
00255 CODEC_ID_V410,
00256 CODEC_ID_XWD,
00257 CODEC_ID_CDXL,
00258 CODEC_ID_XBM,
00259 CODEC_ID_ZEROCODEC,
00260 CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
00261 CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
00262 CODEC_ID_EXR = MKBETAG('0','E','X','R'),
00263 CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
00264
00265 CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
00266 CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
00267 CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
00268 CODEC_ID_V308 = MKBETAG('V','3','0','8'),
00269 CODEC_ID_V408 = MKBETAG('V','4','0','8'),
00270 CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
00271
00272
00273 CODEC_ID_FIRST_AUDIO = 0x10000,
00274 CODEC_ID_PCM_S16LE = 0x10000,
00275 CODEC_ID_PCM_S16BE,
00276 CODEC_ID_PCM_U16LE,
00277 CODEC_ID_PCM_U16BE,
00278 CODEC_ID_PCM_S8,
00279 CODEC_ID_PCM_U8,
00280 CODEC_ID_PCM_MULAW,
00281 CODEC_ID_PCM_ALAW,
00282 CODEC_ID_PCM_S32LE,
00283 CODEC_ID_PCM_S32BE,
00284 CODEC_ID_PCM_U32LE,
00285 CODEC_ID_PCM_U32BE,
00286 CODEC_ID_PCM_S24LE,
00287 CODEC_ID_PCM_S24BE,
00288 CODEC_ID_PCM_U24LE,
00289 CODEC_ID_PCM_U24BE,
00290 CODEC_ID_PCM_S24DAUD,
00291 CODEC_ID_PCM_ZORK,
00292 CODEC_ID_PCM_S16LE_PLANAR,
00293 CODEC_ID_PCM_DVD,
00294 CODEC_ID_PCM_F32BE,
00295 CODEC_ID_PCM_F32LE,
00296 CODEC_ID_PCM_F64BE,
00297 CODEC_ID_PCM_F64LE,
00298 CODEC_ID_PCM_BLURAY,
00299 CODEC_ID_PCM_LXF,
00300 CODEC_ID_S302M,
00301 CODEC_ID_PCM_S8_PLANAR,
00302
00303
00304 CODEC_ID_ADPCM_IMA_QT = 0x11000,
00305 CODEC_ID_ADPCM_IMA_WAV,
00306 CODEC_ID_ADPCM_IMA_DK3,
00307 CODEC_ID_ADPCM_IMA_DK4,
00308 CODEC_ID_ADPCM_IMA_WS,
00309 CODEC_ID_ADPCM_IMA_SMJPEG,
00310 CODEC_ID_ADPCM_MS,
00311 CODEC_ID_ADPCM_4XM,
00312 CODEC_ID_ADPCM_XA,
00313 CODEC_ID_ADPCM_ADX,
00314 CODEC_ID_ADPCM_EA,
00315 CODEC_ID_ADPCM_G726,
00316 CODEC_ID_ADPCM_CT,
00317 CODEC_ID_ADPCM_SWF,
00318 CODEC_ID_ADPCM_YAMAHA,
00319 CODEC_ID_ADPCM_SBPRO_4,
00320 CODEC_ID_ADPCM_SBPRO_3,
00321 CODEC_ID_ADPCM_SBPRO_2,
00322 CODEC_ID_ADPCM_THP,
00323 CODEC_ID_ADPCM_IMA_AMV,
00324 CODEC_ID_ADPCM_EA_R1,
00325 CODEC_ID_ADPCM_EA_R3,
00326 CODEC_ID_ADPCM_EA_R2,
00327 CODEC_ID_ADPCM_IMA_EA_SEAD,
00328 CODEC_ID_ADPCM_IMA_EA_EACS,
00329 CODEC_ID_ADPCM_EA_XAS,
00330 CODEC_ID_ADPCM_EA_MAXIS_XA,
00331 CODEC_ID_ADPCM_IMA_ISS,
00332 CODEC_ID_ADPCM_G722,
00333 CODEC_ID_ADPCM_IMA_APC,
00334
00335
00336 CODEC_ID_AMR_NB = 0x12000,
00337 CODEC_ID_AMR_WB,
00338
00339
00340 CODEC_ID_RA_144 = 0x13000,
00341 CODEC_ID_RA_288,
00342
00343
00344 CODEC_ID_ROQ_DPCM = 0x14000,
00345 CODEC_ID_INTERPLAY_DPCM,
00346 CODEC_ID_XAN_DPCM,
00347 CODEC_ID_SOL_DPCM,
00348
00349
00350 CODEC_ID_MP2 = 0x15000,
00351 CODEC_ID_MP3,
00352 CODEC_ID_AAC,
00353 CODEC_ID_AC3,
00354 CODEC_ID_DTS,
00355 CODEC_ID_VORBIS,
00356 CODEC_ID_DVAUDIO,
00357 CODEC_ID_WMAV1,
00358 CODEC_ID_WMAV2,
00359 CODEC_ID_MACE3,
00360 CODEC_ID_MACE6,
00361 CODEC_ID_VMDAUDIO,
00362 CODEC_ID_FLAC,
00363 CODEC_ID_MP3ADU,
00364 CODEC_ID_MP3ON4,
00365 CODEC_ID_SHORTEN,
00366 CODEC_ID_ALAC,
00367 CODEC_ID_WESTWOOD_SND1,
00368 CODEC_ID_GSM,
00369 CODEC_ID_QDM2,
00370 CODEC_ID_COOK,
00371 CODEC_ID_TRUESPEECH,
00372 CODEC_ID_TTA,
00373 CODEC_ID_SMACKAUDIO,
00374 CODEC_ID_QCELP,
00375 CODEC_ID_WAVPACK,
00376 CODEC_ID_DSICINAUDIO,
00377 CODEC_ID_IMC,
00378 CODEC_ID_MUSEPACK7,
00379 CODEC_ID_MLP,
00380 CODEC_ID_GSM_MS,
00381 CODEC_ID_ATRAC3,
00382 CODEC_ID_VOXWARE,
00383 CODEC_ID_APE,
00384 CODEC_ID_NELLYMOSER,
00385 CODEC_ID_MUSEPACK8,
00386 CODEC_ID_SPEEX,
00387 CODEC_ID_WMAVOICE,
00388 CODEC_ID_WMAPRO,
00389 CODEC_ID_WMALOSSLESS,
00390 CODEC_ID_ATRAC3P,
00391 CODEC_ID_EAC3,
00392 CODEC_ID_SIPR,
00393 CODEC_ID_MP1,
00394 CODEC_ID_TWINVQ,
00395 CODEC_ID_TRUEHD,
00396 CODEC_ID_MP4ALS,
00397 CODEC_ID_ATRAC1,
00398 CODEC_ID_BINKAUDIO_RDFT,
00399 CODEC_ID_BINKAUDIO_DCT,
00400 CODEC_ID_AAC_LATM,
00401 CODEC_ID_QDMC,
00402 CODEC_ID_CELT,
00403 CODEC_ID_G723_1,
00404 CODEC_ID_G729,
00405 CODEC_ID_8SVX_EXP,
00406 CODEC_ID_8SVX_FIB,
00407 CODEC_ID_BMV_AUDIO,
00408 CODEC_ID_RALF,
00409 CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
00410 CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
00411 CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
00412 CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
00413
00414
00415 CODEC_ID_FIRST_SUBTITLE = 0x17000,
00416 CODEC_ID_DVD_SUBTITLE = 0x17000,
00417 CODEC_ID_DVB_SUBTITLE,
00418 CODEC_ID_TEXT,
00419 CODEC_ID_XSUB,
00420 CODEC_ID_SSA,
00421 CODEC_ID_MOV_TEXT,
00422 CODEC_ID_HDMV_PGS_SUBTITLE,
00423 CODEC_ID_DVB_TELETEXT,
00424 CODEC_ID_SRT,
00425 CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
00426 CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
00427 CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
00428
00429
00430 CODEC_ID_FIRST_UNKNOWN = 0x18000,
00431 CODEC_ID_TTF = 0x18000,
00432 CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
00433 CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
00434 CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
00435
00436 CODEC_ID_PROBE = 0x19000,
00437
00438 CODEC_ID_MPEG2TS = 0x20000,
00440 CODEC_ID_MPEG4SYSTEMS = 0x20001,
00442 CODEC_ID_FFMETADATA = 0x21000,
00443 };
00444
00445 #if FF_API_OLD_DECODE_AUDIO
00446
00447 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00448 #endif
00449
00458 #define FF_INPUT_BUFFER_PADDING_SIZE 16
00459
00465 #define FF_MIN_BUFFER_SIZE 16384
00466
00467
00472 enum Motion_Est_ID {
00473 ME_ZERO = 1,
00474 ME_FULL,
00475 ME_LOG,
00476 ME_PHODS,
00477 ME_EPZS,
00478 ME_X1,
00479 ME_HEX,
00480 ME_UMH,
00481 ME_ITER,
00482 ME_TESA,
00483 };
00484
00488 enum AVDiscard{
00489
00490
00491 AVDISCARD_NONE =-16,
00492 AVDISCARD_DEFAULT = 0,
00493 AVDISCARD_NONREF = 8,
00494 AVDISCARD_BIDIR = 16,
00495 AVDISCARD_NONKEY = 32,
00496 AVDISCARD_ALL = 48,
00497 };
00498
00499 enum AVColorPrimaries{
00500 AVCOL_PRI_BT709 = 1,
00501 AVCOL_PRI_UNSPECIFIED = 2,
00502 AVCOL_PRI_BT470M = 4,
00503 AVCOL_PRI_BT470BG = 5,
00504 AVCOL_PRI_SMPTE170M = 6,
00505 AVCOL_PRI_SMPTE240M = 7,
00506 AVCOL_PRI_FILM = 8,
00507 AVCOL_PRI_NB ,
00508 };
00509
00510 enum AVColorTransferCharacteristic{
00511 AVCOL_TRC_BT709 = 1,
00512 AVCOL_TRC_UNSPECIFIED = 2,
00513 AVCOL_TRC_GAMMA22 = 4,
00514 AVCOL_TRC_GAMMA28 = 5,
00515 AVCOL_TRC_SMPTE240M = 7,
00516 AVCOL_TRC_NB ,
00517 };
00518
00519 enum AVColorSpace{
00520 AVCOL_SPC_RGB = 0,
00521 AVCOL_SPC_BT709 = 1,
00522 AVCOL_SPC_UNSPECIFIED = 2,
00523 AVCOL_SPC_FCC = 4,
00524 AVCOL_SPC_BT470BG = 5,
00525 AVCOL_SPC_SMPTE170M = 6,
00526 AVCOL_SPC_SMPTE240M = 7,
00527 AVCOL_SPC_YCOCG = 8,
00528 AVCOL_SPC_NB ,
00529 };
00530 #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
00531
00532 enum AVColorRange{
00533 AVCOL_RANGE_UNSPECIFIED = 0,
00534 AVCOL_RANGE_MPEG = 1,
00535 AVCOL_RANGE_JPEG = 2,
00536 AVCOL_RANGE_NB ,
00537 };
00538
00544 enum AVChromaLocation{
00545 AVCHROMA_LOC_UNSPECIFIED = 0,
00546 AVCHROMA_LOC_LEFT = 1,
00547 AVCHROMA_LOC_CENTER = 2,
00548 AVCHROMA_LOC_TOPLEFT = 3,
00549 AVCHROMA_LOC_TOP = 4,
00550 AVCHROMA_LOC_BOTTOMLEFT = 5,
00551 AVCHROMA_LOC_BOTTOM = 6,
00552 AVCHROMA_LOC_NB ,
00553 };
00554
00555 enum AVAudioServiceType {
00556 AV_AUDIO_SERVICE_TYPE_MAIN = 0,
00557 AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
00558 AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
00559 AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
00560 AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
00561 AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
00562 AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
00563 AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
00564 AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
00565 AV_AUDIO_SERVICE_TYPE_NB ,
00566 };
00567
00571 typedef struct RcOverride{
00572 int start_frame;
00573 int end_frame;
00574 int qscale;
00575 float quality_factor;
00576 } RcOverride;
00577
00578 #define FF_MAX_B_FRAMES 16
00579
00580
00581
00582
00583
00584
00585 #define CODEC_FLAG_QSCALE 0x0002
00586 #define CODEC_FLAG_4MV 0x0004
00587 #define CODEC_FLAG_QPEL 0x0010
00588 #define CODEC_FLAG_GMC 0x0020
00589 #define CODEC_FLAG_MV0 0x0040
00590
00595 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00596 #define CODEC_FLAG_PASS1 0x0200
00597 #define CODEC_FLAG_PASS2 0x0400
00598 #define CODEC_FLAG_GRAY 0x2000
00599 #define CODEC_FLAG_EMU_EDGE 0x4000
00600 #define CODEC_FLAG_PSNR 0x8000
00601 #define CODEC_FLAG_TRUNCATED 0x00010000
00603 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00604 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00605 #define CODEC_FLAG_LOW_DELAY 0x00080000
00606 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00607 #define CODEC_FLAG_BITEXACT 0x00800000
00608
00609 #define CODEC_FLAG_AC_PRED 0x01000000
00610 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00611 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00612 #define CODEC_FLAG_CLOSED_GOP 0x80000000
00613 #define CODEC_FLAG2_FAST 0x00000001
00614 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00615 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00616 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00617 #if FF_API_MPV_GLOBAL_OPTS
00618 #define CODEC_FLAG_CBP_RD 0x04000000
00619 #define CODEC_FLAG_QP_RD 0x08000000
00620 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00621 #define CODEC_FLAG2_SKIP_RD 0x00004000
00622 #endif
00623 #define CODEC_FLAG2_CHUNKS 0x00008000
00624 #define CODEC_FLAG2_SHOW_ALL 0x00400000
00625
00626
00627
00628
00629
00630
00631
00632
00633 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00634
00639 #define CODEC_CAP_DR1 0x0002
00640 #define CODEC_CAP_TRUNCATED 0x0008
00641
00642 #define CODEC_CAP_HWACCEL 0x0010
00643
00666 #define CODEC_CAP_DELAY 0x0020
00667
00671 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00672
00675 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
00676
00687 #define CODEC_CAP_SUBFRAMES 0x0100
00688
00692 #define CODEC_CAP_EXPERIMENTAL 0x0200
00693
00696 #define CODEC_CAP_CHANNEL_CONF 0x0400
00697
00701 #define CODEC_CAP_NEG_LINESIZES 0x0800
00702
00706 #define CODEC_CAP_FRAME_THREADS 0x1000
00707
00710 #define CODEC_CAP_SLICE_THREADS 0x2000
00711
00714 #define CODEC_CAP_PARAM_CHANGE 0x4000
00715
00718 #define CODEC_CAP_AUTO_THREADS 0x8000
00719
00722 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
00723
00726 #define CODEC_CAP_LOSSLESS 0x80000000
00727
00728
00729 #define MB_TYPE_INTRA4x4 0x0001
00730 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00731 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00732 #define MB_TYPE_16x16 0x0008
00733 #define MB_TYPE_16x8 0x0010
00734 #define MB_TYPE_8x16 0x0020
00735 #define MB_TYPE_8x8 0x0040
00736 #define MB_TYPE_INTERLACED 0x0080
00737 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00738 #define MB_TYPE_ACPRED 0x0200
00739 #define MB_TYPE_GMC 0x0400
00740 #define MB_TYPE_SKIP 0x0800
00741 #define MB_TYPE_P0L0 0x1000
00742 #define MB_TYPE_P1L0 0x2000
00743 #define MB_TYPE_P0L1 0x4000
00744 #define MB_TYPE_P1L1 0x8000
00745 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00746 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00747 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00748 #define MB_TYPE_QUANT 0x00010000
00749 #define MB_TYPE_CBP 0x00020000
00750
00751
00757 typedef struct AVPanScan{
00763 int id;
00764
00770 int width;
00771 int height;
00772
00778 int16_t position[3][2];
00779 }AVPanScan;
00780
00781 #define FF_QSCALE_TYPE_MPEG1 0
00782 #define FF_QSCALE_TYPE_MPEG2 1
00783 #define FF_QSCALE_TYPE_H264 2
00784 #define FF_QSCALE_TYPE_VP56 3
00785
00786 #define FF_BUFFER_TYPE_INTERNAL 1
00787 #define FF_BUFFER_TYPE_USER 2
00788 #define FF_BUFFER_TYPE_SHARED 4
00789 #define FF_BUFFER_TYPE_COPY 8
00790
00791 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
00792 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00793 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00794 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00795
00802 enum AVPacketSideDataType {
00803 AV_PKT_DATA_PALETTE,
00804 AV_PKT_DATA_NEW_EXTRADATA,
00805
00821 AV_PKT_DATA_PARAM_CHANGE,
00822
00842 AV_PKT_DATA_H263_MB_INFO,
00843 };
00844
00845 typedef struct AVPacket {
00855 int64_t pts;
00861 int64_t dts;
00862 uint8_t *data;
00863 int size;
00864 int stream_index;
00868 int flags;
00873 struct {
00874 uint8_t *data;
00875 int size;
00876 enum AVPacketSideDataType type;
00877 } *side_data;
00878 int side_data_elems;
00879
00884 int duration;
00885 void (*destruct)(struct AVPacket *);
00886 void *priv;
00887 int64_t pos;
00888
00906 int64_t convergence_duration;
00907 } AVPacket;
00908 #define AV_PKT_FLAG_KEY 0x0001
00909 #define AV_PKT_FLAG_CORRUPT 0x0002
00910
00911 enum AVSideDataParamChangeFlags {
00912 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001,
00913 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
00914 AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
00915 AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
00916 };
00931 typedef struct AVFrame {
00932 #define AV_NUM_DATA_POINTERS 8
00933
00939 uint8_t *data[AV_NUM_DATA_POINTERS];
00940
00950 int linesize[AV_NUM_DATA_POINTERS];
00951
00970 uint8_t **extended_data;
00971
00977 int width, height;
00978
00984 int nb_samples;
00985
00993 int format;
00994
01000 int key_frame;
01001
01007 enum AVPictureType pict_type;
01008
01015 uint8_t *base[AV_NUM_DATA_POINTERS];
01016
01022 AVRational sample_aspect_ratio;
01023
01030 int64_t pts;
01031
01037 int64_t pkt_pts;
01038
01044 int64_t pkt_dts;
01045
01051 int coded_picture_number;
01057 int display_picture_number;
01058
01064 int quality;
01065
01074 int reference;
01075
01081 int8_t *qscale_table;
01087 int qstride;
01088
01092 int qscale_type;
01093
01100 uint8_t *mbskip_table;
01101
01114 int16_t (*motion_val[2])[2];
01115
01122 uint32_t *mb_type;
01123
01129 short *dct_coeff;
01130
01137 int8_t *ref_index[2];
01138
01144 void *opaque;
01145
01151 uint64_t error[AV_NUM_DATA_POINTERS];
01152
01159 int type;
01160
01167 int repeat_pict;
01168
01174 int interlaced_frame;
01175
01181 int top_field_first;
01182
01188 int palette_has_changed;
01189
01195 int buffer_hints;
01196
01202 AVPanScan *pan_scan;
01203
01215 int64_t reordered_opaque;
01216
01222 void *hwaccel_picture_private;
01223
01229 struct AVCodecContext *owner;
01230
01236 void *thread_opaque;
01237
01244 uint8_t motion_subsample_log2;
01245
01252 int sample_rate;
01253
01260 uint64_t channel_layout;
01261
01269 int64_t best_effort_timestamp;
01270
01278 int64_t pkt_pos;
01279
01280 } AVFrame;
01281
01287 int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
01288 int64_t av_frame_get_pkt_pos (const AVFrame *frame);
01289 int64_t av_frame_get_channel_layout (const AVFrame *frame);
01290 int av_frame_get_sample_rate (const AVFrame *frame);
01291 void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
01292 void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
01293 void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
01294 void av_frame_set_sample_rate (AVFrame *frame, int val);
01295
01296 struct AVCodecInternal;
01297
01298 enum AVFieldOrder {
01299 AV_FIELD_UNKNOWN,
01300 AV_FIELD_PROGRESSIVE,
01301 AV_FIELD_TT,
01302 AV_FIELD_BB,
01303 AV_FIELD_TB,
01304 AV_FIELD_BT,
01305 };
01306
01316 typedef struct AVCodecContext {
01321 const AVClass *av_class;
01322 int log_level_offset;
01323
01324 enum AVMediaType codec_type;
01325 struct AVCodec *codec;
01326 char codec_name[32];
01327 enum CodecID codec_id;
01328
01342 unsigned int codec_tag;
01343
01350 unsigned int stream_codec_tag;
01351
01352 #if FF_API_SUB_ID
01353
01356 attribute_deprecated int sub_id;
01357 #endif
01358
01359 void *priv_data;
01360
01367 struct AVCodecInternal *internal;
01368
01374 void *opaque;
01375
01381 int bit_rate;
01382
01389 int bit_rate_tolerance;
01390
01397 int global_quality;
01398
01403 int compression_level;
01404 #define FF_COMPRESSION_DEFAULT -1
01405
01411 int flags;
01412
01418 int flags2;
01419
01431 uint8_t *extradata;
01432 int extradata_size;
01433
01442 AVRational time_base;
01443
01451 int ticks_per_frame;
01452
01474 int delay;
01475
01476
01477
01485 int width, height;
01486
01492 int coded_width, coded_height;
01493
01494 #define FF_ASPECT_EXTENDED 15
01495
01501 int gop_size;
01502
01510 enum PixelFormat pix_fmt;
01511
01519 int me_method;
01520
01544 void (*draw_horiz_band)(struct AVCodecContext *s,
01545 const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
01546 int y, int type, int height);
01547
01557 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01558
01565 int max_b_frames;
01566
01574 float b_quant_factor;
01575
01577 int rc_strategy;
01578 #define FF_RC_STRATEGY_XVID 1
01579
01580 int b_frame_strategy;
01581
01582 #if FF_API_MPV_GLOBAL_OPTS
01583
01588 attribute_deprecated int luma_elim_threshold;
01589
01595 attribute_deprecated int chroma_elim_threshold;
01596 #endif
01597
01603 float b_quant_offset;
01604
01611 int has_b_frames;
01612
01618 int mpeg_quant;
01619
01627 float i_quant_factor;
01628
01634 float i_quant_offset;
01635
01641 float lumi_masking;
01642
01648 float temporal_cplx_masking;
01649
01655 float spatial_cplx_masking;
01656
01662 float p_masking;
01663
01669 float dark_masking;
01670
01676 int slice_count;
01682 int prediction_method;
01683 #define FF_PRED_LEFT 0
01684 #define FF_PRED_PLANE 1
01685 #define FF_PRED_MEDIAN 2
01686
01692 int *slice_offset;
01693
01701 AVRational sample_aspect_ratio;
01702
01708 int me_cmp;
01714 int me_sub_cmp;
01720 int mb_cmp;
01726 int ildct_cmp;
01727 #define FF_CMP_SAD 0
01728 #define FF_CMP_SSE 1
01729 #define FF_CMP_SATD 2
01730 #define FF_CMP_DCT 3
01731 #define FF_CMP_PSNR 4
01732 #define FF_CMP_BIT 5
01733 #define FF_CMP_RD 6
01734 #define FF_CMP_ZERO 7
01735 #define FF_CMP_VSAD 8
01736 #define FF_CMP_VSSE 9
01737 #define FF_CMP_NSSE 10
01738 #define FF_CMP_W53 11
01739 #define FF_CMP_W97 12
01740 #define FF_CMP_DCTMAX 13
01741 #define FF_CMP_DCT264 14
01742 #define FF_CMP_CHROMA 256
01743
01749 int dia_size;
01750
01756 int last_predictor_count;
01757
01763 int pre_me;
01764
01770 int me_pre_cmp;
01771
01777 int pre_dia_size;
01778
01784 int me_subpel_quality;
01785
01794 int dtg_active_format;
01795 #define FF_DTG_AFD_SAME 8
01796 #define FF_DTG_AFD_4_3 9
01797 #define FF_DTG_AFD_16_9 10
01798 #define FF_DTG_AFD_14_9 11
01799 #define FF_DTG_AFD_4_3_SP_14_9 13
01800 #define FF_DTG_AFD_16_9_SP_14_9 14
01801 #define FF_DTG_AFD_SP_4_3 15
01802
01810 int me_range;
01811
01817 int intra_quant_bias;
01818 #define FF_DEFAULT_QUANT_BIAS 999999
01819
01825 int inter_quant_bias;
01826
01827 #if FF_API_COLOR_TABLE_ID
01828
01834 attribute_deprecated int color_table_id;
01835 #endif
01836
01842 int slice_flags;
01843 #define SLICE_FLAG_CODED_ORDER 0x0001
01844 #define SLICE_FLAG_ALLOW_FIELD 0x0002
01845 #define SLICE_FLAG_ALLOW_PLANE 0x0004
01846
01847
01852 int xvmc_acceleration;
01853
01859 int mb_decision;
01860 #define FF_MB_DECISION_SIMPLE 0
01861 #define FF_MB_DECISION_BITS 1
01862 #define FF_MB_DECISION_RD 2
01863
01864
01869 uint16_t *intra_matrix;
01870
01876 uint16_t *inter_matrix;
01877
01884 int scenechange_threshold;
01885
01891 int noise_reduction;
01892
01893 #if FF_API_INTER_THRESHOLD
01894
01897 attribute_deprecated int inter_threshold;
01898 #endif
01899
01900 #if FF_API_MPV_GLOBAL_OPTS
01901
01904 attribute_deprecated int quantizer_noise_shaping;
01905 #endif
01906
01914 int me_threshold;
01915
01921 int mb_threshold;
01922
01928 int intra_dc_precision;
01929
01935 int skip_top;
01936
01942 int skip_bottom;
01943
01950 float border_masking;
01951
01957 int mb_lmin;
01958
01964 int mb_lmax;
01965
01971 int me_penalty_compensation;
01972
01978 int bidir_refine;
01979
01985 int brd_scale;
01986
01992 int keyint_min;
01993
01999 int refs;
02000
02006 int chromaoffset;
02007
02013 int scenechange_factor;
02014
02021 int mv0_threshold;
02022
02028 int b_sensitivity;
02029
02035 enum AVColorPrimaries color_primaries;
02036
02042 enum AVColorTransferCharacteristic color_trc;
02043
02049 enum AVColorSpace colorspace;
02050
02056 enum AVColorRange color_range;
02057
02063 enum AVChromaLocation chroma_sample_location;
02064
02072 int slices;
02073
02078 enum AVFieldOrder field_order;
02079
02080
02081 int sample_rate;
02082 int channels;
02083
02089 enum AVSampleFormat sample_fmt;
02090
02091
02095 int frame_size;
02096
02106 int frame_number;
02107
02112 int block_align;
02113
02119 int cutoff;
02120
02121 #if FF_API_REQUEST_CHANNELS
02122
02128 int request_channels;
02129 #endif
02130
02136 uint64_t channel_layout;
02137
02143 uint64_t request_channel_layout;
02144
02150 enum AVAudioServiceType audio_service_type;
02151
02158 enum AVSampleFormat request_sample_fmt;
02159
02215 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
02216
02226 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
02227
02240 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
02241
02242
02243
02244 float qcompress;
02245 float qblur;
02246
02252 int qmin;
02253
02259 int qmax;
02260
02266 int max_qdiff;
02267
02274 float rc_qsquish;
02275
02276 float rc_qmod_amp;
02277 int rc_qmod_freq;
02278
02284 int rc_buffer_size;
02285
02291 int rc_override_count;
02292 RcOverride *rc_override;
02293
02299 const char *rc_eq;
02300
02306 int rc_max_rate;
02307
02313 int rc_min_rate;
02314
02315 float rc_buffer_aggressivity;
02316
02322 float rc_initial_cplx;
02323
02329 float rc_max_available_vbv_use;
02330
02336 float rc_min_vbv_overflow_use;
02337
02343 int rc_initial_buffer_occupancy;
02344
02345 #define FF_CODER_TYPE_VLC 0
02346 #define FF_CODER_TYPE_AC 1
02347 #define FF_CODER_TYPE_RAW 2
02348 #define FF_CODER_TYPE_RLE 3
02349 #define FF_CODER_TYPE_DEFLATE 4
02350
02355 int coder_type;
02356
02362 int context_model;
02363
02369 int lmin;
02370
02376 int lmax;
02377
02383 int frame_skip_threshold;
02384
02390 int frame_skip_factor;
02391
02397 int frame_skip_exp;
02398
02404 int frame_skip_cmp;
02405
02411 int trellis;
02412
02417 int min_prediction_order;
02418
02423 int max_prediction_order;
02424
02430 int64_t timecode_frame_start;
02431
02432
02433
02434
02435
02436
02437
02438 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
02439
02440 int rtp_payload_size;
02441
02442
02443
02444
02445
02446
02447
02448 int mv_bits;
02449 int header_bits;
02450 int i_tex_bits;
02451 int p_tex_bits;
02452 int i_count;
02453 int p_count;
02454 int skip_count;
02455 int misc_bits;
02456
02462 int frame_bits;
02463
02469 char *stats_out;
02470
02477 char *stats_in;
02478
02484 int workaround_bugs;
02485 #define FF_BUG_AUTODETECT 1
02486 #define FF_BUG_OLD_MSMPEG4 2
02487 #define FF_BUG_XVID_ILACE 4
02488 #define FF_BUG_UMP4 8
02489 #define FF_BUG_NO_PADDING 16
02490 #define FF_BUG_AMV 32
02491 #define FF_BUG_AC_VLC 0
02492 #define FF_BUG_QPEL_CHROMA 64
02493 #define FF_BUG_STD_QPEL 128
02494 #define FF_BUG_QPEL_CHROMA2 256
02495 #define FF_BUG_DIRECT_BLOCKSIZE 512
02496 #define FF_BUG_EDGE 1024
02497 #define FF_BUG_HPEL_CHROMA 2048
02498 #define FF_BUG_DC_CLIP 4096
02499 #define FF_BUG_MS 8192
02500 #define FF_BUG_TRUNCATED 16384
02501
02514 int strict_std_compliance;
02515 #define FF_COMPLIANCE_VERY_STRICT 2
02516 #define FF_COMPLIANCE_STRICT 1
02517 #define FF_COMPLIANCE_NORMAL 0
02518 #define FF_COMPLIANCE_UNOFFICIAL -1
02519 #define FF_COMPLIANCE_EXPERIMENTAL -2
02520
02521
02526 int error_concealment;
02527 #define FF_EC_GUESS_MVS 1
02528 #define FF_EC_DEBLOCK 2
02529
02535 int debug;
02536 #define FF_DEBUG_PICT_INFO 1
02537 #define FF_DEBUG_RC 2
02538 #define FF_DEBUG_BITSTREAM 4
02539 #define FF_DEBUG_MB_TYPE 8
02540 #define FF_DEBUG_QP 16
02541 #define FF_DEBUG_MV 32
02542 #define FF_DEBUG_DCT_COEFF 0x00000040
02543 #define FF_DEBUG_SKIP 0x00000080
02544 #define FF_DEBUG_STARTCODE 0x00000100
02545 #define FF_DEBUG_PTS 0x00000200
02546 #define FF_DEBUG_ER 0x00000400
02547 #define FF_DEBUG_MMCO 0x00000800
02548 #define FF_DEBUG_BUGS 0x00001000
02549 #define FF_DEBUG_VIS_QP 0x00002000
02550 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
02551 #define FF_DEBUG_BUFFERS 0x00008000
02552 #define FF_DEBUG_THREADS 0x00010000
02553
02559 int debug_mv;
02560 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
02561 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
02562 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
02563
02569 int err_recognition;
02570 #define AV_EF_CRCCHECK (1<<0)
02571 #define AV_EF_BITSTREAM (1<<1)
02572 #define AV_EF_BUFFER (1<<2)
02573 #define AV_EF_EXPLODE (1<<3)
02574
02575 #define AV_EF_CAREFUL (1<<16)
02576 #define AV_EF_COMPLIANT (1<<17)
02577 #define AV_EF_AGGRESSIVE (1<<18)
02578
02579
02587 int64_t reordered_opaque;
02588
02594 struct AVHWAccel *hwaccel;
02595
02606 void *hwaccel_context;
02607
02613 uint64_t error[AV_NUM_DATA_POINTERS];
02614
02620 int dct_algo;
02621 #define FF_DCT_AUTO 0
02622 #define FF_DCT_FASTINT 1
02623 #define FF_DCT_INT 2
02624 #define FF_DCT_MMX 3
02625 #define FF_DCT_ALTIVEC 5
02626 #define FF_DCT_FAAN 6
02627
02633 int idct_algo;
02634 #define FF_IDCT_AUTO 0
02635 #define FF_IDCT_INT 1
02636 #define FF_IDCT_SIMPLE 2
02637 #define FF_IDCT_SIMPLEMMX 3
02638 #define FF_IDCT_LIBMPEG2MMX 4
02639 #define FF_IDCT_MMI 5
02640 #define FF_IDCT_ARM 7
02641 #define FF_IDCT_ALTIVEC 8
02642 #define FF_IDCT_SH4 9
02643 #define FF_IDCT_SIMPLEARM 10
02644 #define FF_IDCT_H264 11
02645 #define FF_IDCT_VP3 12
02646 #define FF_IDCT_IPP 13
02647 #define FF_IDCT_XVIDMMX 14
02648 #define FF_IDCT_CAVS 15
02649 #define FF_IDCT_SIMPLEARMV5TE 16
02650 #define FF_IDCT_SIMPLEARMV6 17
02651 #define FF_IDCT_SIMPLEVIS 18
02652 #define FF_IDCT_WMV2 19
02653 #define FF_IDCT_FAAN 20
02654 #define FF_IDCT_EA 21
02655 #define FF_IDCT_SIMPLENEON 22
02656 #define FF_IDCT_SIMPLEALPHA 23
02657 #define FF_IDCT_BINK 24
02658
02659 #if FF_API_DSP_MASK
02660
02664 attribute_deprecated unsigned dsp_mask;
02665 #endif
02666
02672 int bits_per_coded_sample;
02673
02679 int bits_per_raw_sample;
02680
02686 int lowres;
02687
02693 AVFrame *coded_frame;
02694
02701 int thread_count;
02702
02711 int thread_type;
02712 #define FF_THREAD_FRAME 1
02713 #define FF_THREAD_SLICE 2
02714
02715
02720 int active_thread_type;
02721
02730 int thread_safe_callbacks;
02731
02741 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
02742
02761 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
02762
02769 void *thread_opaque;
02770
02776 int nsse_weight;
02777
02783 int profile;
02784 #define FF_PROFILE_UNKNOWN -99
02785 #define FF_PROFILE_RESERVED -100
02786
02787 #define FF_PROFILE_AAC_MAIN 0
02788 #define FF_PROFILE_AAC_LOW 1
02789 #define FF_PROFILE_AAC_SSR 2
02790 #define FF_PROFILE_AAC_LTP 3
02791
02792 #define FF_PROFILE_DTS 20
02793 #define FF_PROFILE_DTS_ES 30
02794 #define FF_PROFILE_DTS_96_24 40
02795 #define FF_PROFILE_DTS_HD_HRA 50
02796 #define FF_PROFILE_DTS_HD_MA 60
02797
02798 #define FF_PROFILE_MPEG2_422 0
02799 #define FF_PROFILE_MPEG2_HIGH 1
02800 #define FF_PROFILE_MPEG2_SS 2
02801 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
02802 #define FF_PROFILE_MPEG2_MAIN 4
02803 #define FF_PROFILE_MPEG2_SIMPLE 5
02804
02805 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
02806 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
02807
02808 #define FF_PROFILE_H264_BASELINE 66
02809 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
02810 #define FF_PROFILE_H264_MAIN 77
02811 #define FF_PROFILE_H264_EXTENDED 88
02812 #define FF_PROFILE_H264_HIGH 100
02813 #define FF_PROFILE_H264_HIGH_10 110
02814 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
02815 #define FF_PROFILE_H264_HIGH_422 122
02816 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
02817 #define FF_PROFILE_H264_HIGH_444 144
02818 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
02819 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
02820 #define FF_PROFILE_H264_CAVLC_444 44
02821
02822 #define FF_PROFILE_VC1_SIMPLE 0
02823 #define FF_PROFILE_VC1_MAIN 1
02824 #define FF_PROFILE_VC1_COMPLEX 2
02825 #define FF_PROFILE_VC1_ADVANCED 3
02826
02827 #define FF_PROFILE_MPEG4_SIMPLE 0
02828 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
02829 #define FF_PROFILE_MPEG4_CORE 2
02830 #define FF_PROFILE_MPEG4_MAIN 3
02831 #define FF_PROFILE_MPEG4_N_BIT 4
02832 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
02833 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
02834 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
02835 #define FF_PROFILE_MPEG4_HYBRID 8
02836 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
02837 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
02838 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
02839 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
02840 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
02841 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
02842 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
02843
02849 int level;
02850 #define FF_LEVEL_UNKNOWN -99
02851
02857 enum AVDiscard skip_loop_filter;
02858
02864 enum AVDiscard skip_idct;
02865
02871 enum AVDiscard skip_frame;
02872
02881 uint8_t *subtitle_header;
02882 int subtitle_header_size;
02883
02889 int error_rate;
02890
02898 AVPacket *pkt;
02899
02906 uint64_t vbv_delay;
02907
02913 int64_t pts_correction_num_faulty_pts;
02914 int64_t pts_correction_num_faulty_dts;
02915 int64_t pts_correction_last_pts;
02916 int64_t pts_correction_last_dts;
02917 } AVCodecContext;
02918
02922 typedef struct AVProfile {
02923 int profile;
02924 const char *name;
02925 } AVProfile;
02926
02927 typedef struct AVCodecDefault AVCodecDefault;
02928
02932 typedef struct AVCodec {
02939 const char *name;
02944 const char *long_name;
02945 enum AVMediaType type;
02946 enum CodecID id;
02951 int capabilities;
02952 const AVRational *supported_framerates;
02953 const enum PixelFormat *pix_fmts;
02954 const int *supported_samplerates;
02955 const enum AVSampleFormat *sample_fmts;
02956 const uint64_t *channel_layouts;
02957 uint8_t max_lowres;
02958 const AVClass *priv_class;
02959 const AVProfile *profiles;
02960
02961
02962
02963
02964
02965
02966
02967
02968 int priv_data_size;
02969 struct AVCodec *next;
02979 int (*init_thread_copy)(AVCodecContext *);
02987 int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
02993 const AVCodecDefault *defaults;
02994
02998 void (*init_static_data)(struct AVCodec *codec);
02999
03000 int (*init)(AVCodecContext *);
03001 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
03012 int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
03013 int *got_packet_ptr);
03014 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
03015 int (*close)(AVCodecContext *);
03020 void (*flush)(AVCodecContext *);
03021 } AVCodec;
03022
03026 typedef struct AVHWAccel {
03032 const char *name;
03033
03039 enum AVMediaType type;
03040
03046 enum CodecID id;
03047
03053 enum PixelFormat pix_fmt;
03054
03059 int capabilities;
03060
03061 struct AVHWAccel *next;
03062
03077 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03078
03090 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03091
03101 int (*end_frame)(AVCodecContext *avctx);
03102
03110 int priv_data_size;
03111 } AVHWAccel;
03112
03124 typedef struct AVPicture {
03125 uint8_t *data[AV_NUM_DATA_POINTERS];
03126 int linesize[AV_NUM_DATA_POINTERS];
03127 } AVPicture;
03128
03133 enum AVSubtitleType {
03134 SUBTITLE_NONE,
03135
03136 SUBTITLE_BITMAP,
03137
03142 SUBTITLE_TEXT,
03143
03148 SUBTITLE_ASS,
03149 };
03150
03151 typedef struct AVSubtitleRect {
03152 int x;
03153 int y;
03154 int w;
03155 int h;
03156 int nb_colors;
03157
03162 AVPicture pict;
03163 enum AVSubtitleType type;
03164
03165 char *text;
03166
03172 char *ass;
03173
03178 int forced;
03179 } AVSubtitleRect;
03180
03181 typedef struct AVSubtitle {
03182 uint16_t format;
03183 uint32_t start_display_time;
03184 uint32_t end_display_time;
03185 unsigned num_rects;
03186 AVSubtitleRect **rects;
03187 int64_t pts;
03188 } AVSubtitle;
03189
03195 AVCodec *av_codec_next(AVCodec *c);
03196
03200 unsigned avcodec_version(void);
03201
03205 const char *avcodec_configuration(void);
03206
03210 const char *avcodec_license(void);
03211
03220 void avcodec_register(AVCodec *codec);
03221
03232 void avcodec_register_all(void);
03233
03234
03235 #if FF_API_ALLOC_CONTEXT
03236
03245 attribute_deprecated
03246 AVCodecContext *avcodec_alloc_context(void);
03247
03250 attribute_deprecated
03251 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
03252
03259 attribute_deprecated
03260 void avcodec_get_context_defaults(AVCodecContext *s);
03261
03264 attribute_deprecated
03265 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
03266 #endif
03267
03283 AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
03284
03294 int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
03295
03302 const AVClass *avcodec_get_class(void);
03303
03310 const AVClass *avcodec_get_frame_class(void);
03311
03318 const AVClass *avcodec_get_subtitle_rect_class(void);
03319
03331 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
03332
03340 AVFrame *avcodec_alloc_frame(void);
03341
03347 void avcodec_get_frame_defaults(AVFrame *pic);
03348
03349 #if FF_API_AVCODEC_OPEN
03350
03379 attribute_deprecated
03380 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
03381 #endif
03382
03419 int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
03420
03430 int avcodec_close(AVCodecContext *avctx);
03431
03437 void avsubtitle_free(AVSubtitle *sub);
03438
03451 attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
03452
03456 void av_destruct_packet(AVPacket *pkt);
03457
03463 void av_init_packet(AVPacket *pkt);
03464
03473 int av_new_packet(AVPacket *pkt, int size);
03474
03481 void av_shrink_packet(AVPacket *pkt, int size);
03482
03489 int av_grow_packet(AVPacket *pkt, int grow_by);
03490
03495 int av_dup_packet(AVPacket *pkt);
03496
03502 void av_free_packet(AVPacket *pkt);
03503
03512 uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03513 int size);
03514
03523 int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03524 int size);
03525
03534 uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03535 int *size);
03536
03537 int av_packet_merge_side_data(AVPacket *pkt);
03538
03539 int av_packet_split_side_data(AVPacket *pkt);
03540
03541
03557 AVCodec *avcodec_find_decoder(enum CodecID id);
03558
03565 AVCodec *avcodec_find_decoder_by_name(const char *name);
03566
03567 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03568 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03569 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03570
03578 unsigned avcodec_get_edge_width(void);
03579
03589 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03590
03600 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
03601 int linesize_align[AV_NUM_DATA_POINTERS]);
03602
03603 #if FF_API_OLD_DECODE_AUDIO
03604
03658 attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
03659 int *frame_size_ptr,
03660 AVPacket *avpkt);
03661 #endif
03662
03696 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
03697 int *got_frame_ptr, const AVPacket *avpkt);
03698
03740 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
03741 int *got_picture_ptr,
03742 const AVPacket *avpkt);
03743
03760 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
03761 int *got_sub_ptr,
03762 AVPacket *avpkt);
03763
03769 typedef struct AVCodecParserContext {
03770 void *priv_data;
03771 struct AVCodecParser *parser;
03772 int64_t frame_offset;
03773 int64_t cur_offset;
03774
03775 int64_t next_frame_offset;
03776
03777 int pict_type;
03787 int repeat_pict;
03788 int64_t pts;
03789 int64_t dts;
03790
03791
03792 int64_t last_pts;
03793 int64_t last_dts;
03794 int fetch_timestamp;
03795
03796 #define AV_PARSER_PTS_NB 4
03797 int cur_frame_start_index;
03798 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03799 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03800 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03801
03802 int flags;
03803 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
03804 #define PARSER_FLAG_ONCE 0x0002
03806 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
03807 #define PARSER_FLAG_USE_CODEC_TS 0x1000
03808
03809 int64_t offset;
03810 int64_t cur_frame_end[AV_PARSER_PTS_NB];
03811
03818 int key_frame;
03819
03837 int64_t convergence_duration;
03838
03839
03849 int dts_sync_point;
03850
03864 int dts_ref_dts_delta;
03865
03878 int pts_dts_delta;
03879
03885 int64_t cur_frame_pos[AV_PARSER_PTS_NB];
03886
03890 int64_t pos;
03891
03895 int64_t last_pos;
03896
03902 int duration;
03903 } AVCodecParserContext;
03904
03905 typedef struct AVCodecParser {
03906 int codec_ids[5];
03907 int priv_data_size;
03908 int (*parser_init)(AVCodecParserContext *s);
03909 int (*parser_parse)(AVCodecParserContext *s,
03910 AVCodecContext *avctx,
03911 const uint8_t **poutbuf, int *poutbuf_size,
03912 const uint8_t *buf, int buf_size);
03913 void (*parser_close)(AVCodecParserContext *s);
03914 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
03915 struct AVCodecParser *next;
03916 } AVCodecParser;
03917
03918 AVCodecParser *av_parser_next(AVCodecParser *c);
03919
03920 void av_register_codec_parser(AVCodecParser *parser);
03921 AVCodecParserContext *av_parser_init(int codec_id);
03922
03951 int av_parser_parse2(AVCodecParserContext *s,
03952 AVCodecContext *avctx,
03953 uint8_t **poutbuf, int *poutbuf_size,
03954 const uint8_t *buf, int buf_size,
03955 int64_t pts, int64_t dts,
03956 int64_t pos);
03957
03958 int av_parser_change(AVCodecParserContext *s,
03959 AVCodecContext *avctx,
03960 uint8_t **poutbuf, int *poutbuf_size,
03961 const uint8_t *buf, int buf_size, int keyframe);
03962 void av_parser_close(AVCodecParserContext *s);
03963
03980 AVCodec *avcodec_find_encoder(enum CodecID id);
03981
03988 AVCodec *avcodec_find_encoder_by_name(const char *name);
03989
03990 #if FF_API_OLD_ENCODE_AUDIO
03991
04015 int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
04016 uint8_t *buf, int buf_size,
04017 const short *samples);
04018 #endif
04019
04058 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
04059 const AVFrame *frame, int *got_packet_ptr);
04060
04061 #if FF_API_OLD_ENCODE_VIDEO
04062
04076 attribute_deprecated
04077 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
04078 const AVFrame *pict);
04079 #endif
04080
04115 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
04116 const AVFrame *frame, int *got_packet_ptr);
04117
04118 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
04119 const AVSubtitle *sub);
04120
04121
04132 struct ReSampleContext;
04133 struct AVResampleContext;
04134
04135 typedef struct ReSampleContext ReSampleContext;
04136
04153 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
04154 int output_rate, int input_rate,
04155 enum AVSampleFormat sample_fmt_out,
04156 enum AVSampleFormat sample_fmt_in,
04157 int filter_length, int log2_phase_count,
04158 int linear, double cutoff);
04159
04160 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
04161
04168 void audio_resample_close(ReSampleContext *s);
04169
04170
04180 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
04181
04191 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
04192
04193
04206 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
04207 void av_resample_close(struct AVResampleContext *c);
04208
04229 int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
04230
04238 void avpicture_free(AVPicture *picture);
04239
04260 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
04261 enum PixelFormat pix_fmt, int width, int height);
04262
04278 int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
04279 unsigned char *dest, int dest_size);
04280
04293 int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
04294
04298 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
04299 enum PixelFormat pix_fmt, int width, int height);
04303 void av_picture_copy(AVPicture *dst, const AVPicture *src,
04304 enum PixelFormat pix_fmt, int width, int height);
04305
04309 int av_picture_crop(AVPicture *dst, const AVPicture *src,
04310 enum PixelFormat pix_fmt, int top_band, int left_band);
04311
04315 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
04316 int padtop, int padbottom, int padleft, int padright, int *color);
04317
04338 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
04339
04345 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
04346
04347 #define FF_LOSS_RESOLUTION 0x0001
04348 #define FF_LOSS_DEPTH 0x0002
04349 #define FF_LOSS_COLORSPACE 0x0004
04350 #define FF_LOSS_ALPHA 0x0008
04351 #define FF_LOSS_COLORQUANT 0x0010
04352 #define FF_LOSS_CHROMA 0x0020
04372 int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
04373 int has_alpha);
04374
04399 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
04400 int has_alpha, int *loss_ptr);
04401
04432 enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
04433 enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
04434
04435 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
04436
04441 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
04442
04450 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
04451
04452 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
04453
04461 const char *av_get_profile_name(const AVCodec *codec, int profile);
04462
04463 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
04464 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
04465
04466
04483 int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
04484 enum AVSampleFormat sample_fmt, const uint8_t *buf,
04485 int buf_size, int align);
04486
04490 void avcodec_flush_buffers(AVCodecContext *avctx);
04491
04492 void avcodec_default_free_buffers(AVCodecContext *s);
04493
04500 int av_get_bits_per_sample(enum CodecID codec_id);
04501
04508 enum CodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
04509
04518 int av_get_exact_bits_per_sample(enum CodecID codec_id);
04519
04528 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
04529
04530
04531 typedef struct AVBitStreamFilterContext {
04532 void *priv_data;
04533 struct AVBitStreamFilter *filter;
04534 AVCodecParserContext *parser;
04535 struct AVBitStreamFilterContext *next;
04536 } AVBitStreamFilterContext;
04537
04538
04539 typedef struct AVBitStreamFilter {
04540 const char *name;
04541 int priv_data_size;
04542 int (*filter)(AVBitStreamFilterContext *bsfc,
04543 AVCodecContext *avctx, const char *args,
04544 uint8_t **poutbuf, int *poutbuf_size,
04545 const uint8_t *buf, int buf_size, int keyframe);
04546 void (*close)(AVBitStreamFilterContext *bsfc);
04547 struct AVBitStreamFilter *next;
04548 } AVBitStreamFilter;
04549
04550 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
04551 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
04552 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
04553 AVCodecContext *avctx, const char *args,
04554 uint8_t **poutbuf, int *poutbuf_size,
04555 const uint8_t *buf, int buf_size, int keyframe);
04556 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
04557
04558 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
04559
04560
04561
04567 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
04568
04581 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
04582
04590 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
04591
04599 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
04600
04613 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
04614
04623 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
04624
04628 void av_register_hwaccel(AVHWAccel *hwaccel);
04629
04635 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
04636
04637
04641 enum AVLockOp {
04642 AV_LOCK_CREATE,
04643 AV_LOCK_OBTAIN,
04644 AV_LOCK_RELEASE,
04645 AV_LOCK_DESTROY,
04646 };
04647
04661 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
04662
04666 enum AVMediaType avcodec_get_type(enum CodecID codec_id);
04667
04672 const char *avcodec_get_name(enum CodecID id);
04673
04678 int avcodec_is_open(AVCodecContext *s);
04679
04683 int av_codec_is_encoder(AVCodec *codec);
04684
04688 int av_codec_is_decoder(AVCodec *codec);
04689
04694 #endif