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/avutil.h"
00031
00032 #define LIBAVCODEC_VERSION_MAJOR 52
00033 #define LIBAVCODEC_VERSION_MINOR 66
00034 #define LIBAVCODEC_VERSION_MICRO 0
00035
00036 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
00037 LIBAVCODEC_VERSION_MINOR, \
00038 LIBAVCODEC_VERSION_MICRO)
00039 #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
00040 LIBAVCODEC_VERSION_MINOR, \
00041 LIBAVCODEC_VERSION_MICRO)
00042 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
00043
00044 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
00045
00046 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
00047 #define AV_TIME_BASE 1000000
00048 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
00049
00062 enum CodecID {
00063 CODEC_ID_NONE,
00064
00065
00066 CODEC_ID_MPEG1VIDEO,
00067 CODEC_ID_MPEG2VIDEO,
00068 CODEC_ID_MPEG2VIDEO_XVMC,
00069 CODEC_ID_H261,
00070 CODEC_ID_H263,
00071 CODEC_ID_RV10,
00072 CODEC_ID_RV20,
00073 CODEC_ID_MJPEG,
00074 CODEC_ID_MJPEGB,
00075 CODEC_ID_LJPEG,
00076 CODEC_ID_SP5X,
00077 CODEC_ID_JPEGLS,
00078 CODEC_ID_MPEG4,
00079 CODEC_ID_RAWVIDEO,
00080 CODEC_ID_MSMPEG4V1,
00081 CODEC_ID_MSMPEG4V2,
00082 CODEC_ID_MSMPEG4V3,
00083 CODEC_ID_WMV1,
00084 CODEC_ID_WMV2,
00085 CODEC_ID_H263P,
00086 CODEC_ID_H263I,
00087 CODEC_ID_FLV1,
00088 CODEC_ID_SVQ1,
00089 CODEC_ID_SVQ3,
00090 CODEC_ID_DVVIDEO,
00091 CODEC_ID_HUFFYUV,
00092 CODEC_ID_CYUV,
00093 CODEC_ID_H264,
00094 CODEC_ID_INDEO3,
00095 CODEC_ID_VP3,
00096 CODEC_ID_THEORA,
00097 CODEC_ID_ASV1,
00098 CODEC_ID_ASV2,
00099 CODEC_ID_FFV1,
00100 CODEC_ID_4XM,
00101 CODEC_ID_VCR1,
00102 CODEC_ID_CLJR,
00103 CODEC_ID_MDEC,
00104 CODEC_ID_ROQ,
00105 CODEC_ID_INTERPLAY_VIDEO,
00106 CODEC_ID_XAN_WC3,
00107 CODEC_ID_XAN_WC4,
00108 CODEC_ID_RPZA,
00109 CODEC_ID_CINEPAK,
00110 CODEC_ID_WS_VQA,
00111 CODEC_ID_MSRLE,
00112 CODEC_ID_MSVIDEO1,
00113 CODEC_ID_IDCIN,
00114 CODEC_ID_8BPS,
00115 CODEC_ID_SMC,
00116 CODEC_ID_FLIC,
00117 CODEC_ID_TRUEMOTION1,
00118 CODEC_ID_VMDVIDEO,
00119 CODEC_ID_MSZH,
00120 CODEC_ID_ZLIB,
00121 CODEC_ID_QTRLE,
00122 CODEC_ID_SNOW,
00123 CODEC_ID_TSCC,
00124 CODEC_ID_ULTI,
00125 CODEC_ID_QDRAW,
00126 CODEC_ID_VIXL,
00127 CODEC_ID_QPEG,
00128 #if LIBAVCODEC_VERSION_MAJOR < 53
00129 CODEC_ID_XVID,
00130 #endif
00131 CODEC_ID_PNG,
00132 CODEC_ID_PPM,
00133 CODEC_ID_PBM,
00134 CODEC_ID_PGM,
00135 CODEC_ID_PGMYUV,
00136 CODEC_ID_PAM,
00137 CODEC_ID_FFVHUFF,
00138 CODEC_ID_RV30,
00139 CODEC_ID_RV40,
00140 CODEC_ID_VC1,
00141 CODEC_ID_WMV3,
00142 CODEC_ID_LOCO,
00143 CODEC_ID_WNV1,
00144 CODEC_ID_AASC,
00145 CODEC_ID_INDEO2,
00146 CODEC_ID_FRAPS,
00147 CODEC_ID_TRUEMOTION2,
00148 CODEC_ID_BMP,
00149 CODEC_ID_CSCD,
00150 CODEC_ID_MMVIDEO,
00151 CODEC_ID_ZMBV,
00152 CODEC_ID_AVS,
00153 CODEC_ID_SMACKVIDEO,
00154 CODEC_ID_NUV,
00155 CODEC_ID_KMVC,
00156 CODEC_ID_FLASHSV,
00157 CODEC_ID_CAVS,
00158 CODEC_ID_JPEG2000,
00159 CODEC_ID_VMNC,
00160 CODEC_ID_VP5,
00161 CODEC_ID_VP6,
00162 CODEC_ID_VP6F,
00163 CODEC_ID_TARGA,
00164 CODEC_ID_DSICINVIDEO,
00165 CODEC_ID_TIERTEXSEQVIDEO,
00166 CODEC_ID_TIFF,
00167 CODEC_ID_GIF,
00168 CODEC_ID_FFH264,
00169 CODEC_ID_DXA,
00170 CODEC_ID_DNXHD,
00171 CODEC_ID_THP,
00172 CODEC_ID_SGI,
00173 CODEC_ID_C93,
00174 CODEC_ID_BETHSOFTVID,
00175 CODEC_ID_PTX,
00176 CODEC_ID_TXD,
00177 CODEC_ID_VP6A,
00178 CODEC_ID_AMV,
00179 CODEC_ID_VB,
00180 CODEC_ID_PCX,
00181 CODEC_ID_SUNRAST,
00182 CODEC_ID_INDEO4,
00183 CODEC_ID_INDEO5,
00184 CODEC_ID_MIMIC,
00185 CODEC_ID_RL2,
00186 CODEC_ID_8SVX_EXP,
00187 CODEC_ID_8SVX_FIB,
00188 CODEC_ID_ESCAPE124,
00189 CODEC_ID_DIRAC,
00190 CODEC_ID_BFI,
00191 CODEC_ID_CMV,
00192 CODEC_ID_MOTIONPIXELS,
00193 CODEC_ID_TGV,
00194 CODEC_ID_TGQ,
00195 CODEC_ID_TQI,
00196 CODEC_ID_AURA,
00197 CODEC_ID_AURA2,
00198 CODEC_ID_V210X,
00199 CODEC_ID_TMV,
00200 CODEC_ID_V210,
00201 CODEC_ID_DPX,
00202 CODEC_ID_MAD,
00203 CODEC_ID_FRWU,
00204 CODEC_ID_FLASHSV2,
00205 CODEC_ID_CDGRAPHICS,
00206 CODEC_ID_R210,
00207 CODEC_ID_ANM,
00208 CODEC_ID_BINKVIDEO,
00209 CODEC_ID_IFF_ILBM,
00210 CODEC_ID_IFF_BYTERUN1,
00211 CODEC_ID_KGV1,
00212 CODEC_ID_YOP,
00213
00214
00215 CODEC_ID_PCM_S16LE= 0x10000,
00216 CODEC_ID_PCM_S16BE,
00217 CODEC_ID_PCM_U16LE,
00218 CODEC_ID_PCM_U16BE,
00219 CODEC_ID_PCM_S8,
00220 CODEC_ID_PCM_U8,
00221 CODEC_ID_PCM_MULAW,
00222 CODEC_ID_PCM_ALAW,
00223 CODEC_ID_PCM_S32LE,
00224 CODEC_ID_PCM_S32BE,
00225 CODEC_ID_PCM_U32LE,
00226 CODEC_ID_PCM_U32BE,
00227 CODEC_ID_PCM_S24LE,
00228 CODEC_ID_PCM_S24BE,
00229 CODEC_ID_PCM_U24LE,
00230 CODEC_ID_PCM_U24BE,
00231 CODEC_ID_PCM_S24DAUD,
00232 CODEC_ID_PCM_ZORK,
00233 CODEC_ID_PCM_S16LE_PLANAR,
00234 CODEC_ID_PCM_DVD,
00235 CODEC_ID_PCM_F32BE,
00236 CODEC_ID_PCM_F32LE,
00237 CODEC_ID_PCM_F64BE,
00238 CODEC_ID_PCM_F64LE,
00239 CODEC_ID_PCM_BLURAY,
00240
00241
00242 CODEC_ID_ADPCM_IMA_QT= 0x11000,
00243 CODEC_ID_ADPCM_IMA_WAV,
00244 CODEC_ID_ADPCM_IMA_DK3,
00245 CODEC_ID_ADPCM_IMA_DK4,
00246 CODEC_ID_ADPCM_IMA_WS,
00247 CODEC_ID_ADPCM_IMA_SMJPEG,
00248 CODEC_ID_ADPCM_MS,
00249 CODEC_ID_ADPCM_4XM,
00250 CODEC_ID_ADPCM_XA,
00251 CODEC_ID_ADPCM_ADX,
00252 CODEC_ID_ADPCM_EA,
00253 CODEC_ID_ADPCM_G726,
00254 CODEC_ID_ADPCM_CT,
00255 CODEC_ID_ADPCM_SWF,
00256 CODEC_ID_ADPCM_YAMAHA,
00257 CODEC_ID_ADPCM_SBPRO_4,
00258 CODEC_ID_ADPCM_SBPRO_3,
00259 CODEC_ID_ADPCM_SBPRO_2,
00260 CODEC_ID_ADPCM_THP,
00261 CODEC_ID_ADPCM_IMA_AMV,
00262 CODEC_ID_ADPCM_EA_R1,
00263 CODEC_ID_ADPCM_EA_R3,
00264 CODEC_ID_ADPCM_EA_R2,
00265 CODEC_ID_ADPCM_IMA_EA_SEAD,
00266 CODEC_ID_ADPCM_IMA_EA_EACS,
00267 CODEC_ID_ADPCM_EA_XAS,
00268 CODEC_ID_ADPCM_EA_MAXIS_XA,
00269 CODEC_ID_ADPCM_IMA_ISS,
00270
00271
00272 CODEC_ID_AMR_NB= 0x12000,
00273 CODEC_ID_AMR_WB,
00274
00275
00276 CODEC_ID_RA_144= 0x13000,
00277 CODEC_ID_RA_288,
00278
00279
00280 CODEC_ID_ROQ_DPCM= 0x14000,
00281 CODEC_ID_INTERPLAY_DPCM,
00282 CODEC_ID_XAN_DPCM,
00283 CODEC_ID_SOL_DPCM,
00284
00285
00286 CODEC_ID_MP2= 0x15000,
00287 CODEC_ID_MP3,
00288 CODEC_ID_AAC,
00289 CODEC_ID_AC3,
00290 CODEC_ID_DTS,
00291 CODEC_ID_VORBIS,
00292 CODEC_ID_DVAUDIO,
00293 CODEC_ID_WMAV1,
00294 CODEC_ID_WMAV2,
00295 CODEC_ID_MACE3,
00296 CODEC_ID_MACE6,
00297 CODEC_ID_VMDAUDIO,
00298 CODEC_ID_SONIC,
00299 CODEC_ID_SONIC_LS,
00300 CODEC_ID_FLAC,
00301 CODEC_ID_MP3ADU,
00302 CODEC_ID_MP3ON4,
00303 CODEC_ID_SHORTEN,
00304 CODEC_ID_ALAC,
00305 CODEC_ID_WESTWOOD_SND1,
00306 CODEC_ID_GSM,
00307 CODEC_ID_QDM2,
00308 CODEC_ID_COOK,
00309 CODEC_ID_TRUESPEECH,
00310 CODEC_ID_TTA,
00311 CODEC_ID_SMACKAUDIO,
00312 CODEC_ID_QCELP,
00313 CODEC_ID_WAVPACK,
00314 CODEC_ID_DSICINAUDIO,
00315 CODEC_ID_IMC,
00316 CODEC_ID_MUSEPACK7,
00317 CODEC_ID_MLP,
00318 CODEC_ID_GSM_MS,
00319 CODEC_ID_ATRAC3,
00320 CODEC_ID_VOXWARE,
00321 CODEC_ID_APE,
00322 CODEC_ID_NELLYMOSER,
00323 CODEC_ID_MUSEPACK8,
00324 CODEC_ID_SPEEX,
00325 CODEC_ID_WMAVOICE,
00326 CODEC_ID_WMAPRO,
00327 CODEC_ID_WMALOSSLESS,
00328 CODEC_ID_ATRAC3P,
00329 CODEC_ID_EAC3,
00330 CODEC_ID_SIPR,
00331 CODEC_ID_MP1,
00332 CODEC_ID_TWINVQ,
00333 CODEC_ID_TRUEHD,
00334 CODEC_ID_MP4ALS,
00335 CODEC_ID_ATRAC1,
00336 CODEC_ID_BINKAUDIO_RDFT,
00337 CODEC_ID_BINKAUDIO_DCT,
00338
00339
00340 CODEC_ID_DVD_SUBTITLE= 0x17000,
00341 CODEC_ID_DVB_SUBTITLE,
00342 CODEC_ID_TEXT,
00343 CODEC_ID_XSUB,
00344 CODEC_ID_SSA,
00345 CODEC_ID_MOV_TEXT,
00346 CODEC_ID_HDMV_PGS_SUBTITLE,
00347 CODEC_ID_DVB_TELETEXT,
00348
00349
00350 CODEC_ID_TTF= 0x18000,
00351
00352 CODEC_ID_PROBE= 0x19000,
00353
00354 CODEC_ID_MPEG2TS= 0x20000,
00356 };
00357
00358 #if LIBAVCODEC_VERSION_MAJOR < 53
00359 #define CodecType AVMediaType
00360
00361 #define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN
00362 #define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
00363 #define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
00364 #define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA
00365 #define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE
00366 #define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
00367 #define CODEC_TYPE_NB AVMEDIA_TYPE_NB
00368 #endif
00369
00373 enum SampleFormat {
00374 SAMPLE_FMT_NONE = -1,
00375 SAMPLE_FMT_U8,
00376 SAMPLE_FMT_S16,
00377 SAMPLE_FMT_S32,
00378 SAMPLE_FMT_FLT,
00379 SAMPLE_FMT_DBL,
00380 SAMPLE_FMT_NB
00381 };
00382
00383
00384 #define CH_FRONT_LEFT 0x00000001
00385 #define CH_FRONT_RIGHT 0x00000002
00386 #define CH_FRONT_CENTER 0x00000004
00387 #define CH_LOW_FREQUENCY 0x00000008
00388 #define CH_BACK_LEFT 0x00000010
00389 #define CH_BACK_RIGHT 0x00000020
00390 #define CH_FRONT_LEFT_OF_CENTER 0x00000040
00391 #define CH_FRONT_RIGHT_OF_CENTER 0x00000080
00392 #define CH_BACK_CENTER 0x00000100
00393 #define CH_SIDE_LEFT 0x00000200
00394 #define CH_SIDE_RIGHT 0x00000400
00395 #define CH_TOP_CENTER 0x00000800
00396 #define CH_TOP_FRONT_LEFT 0x00001000
00397 #define CH_TOP_FRONT_CENTER 0x00002000
00398 #define CH_TOP_FRONT_RIGHT 0x00004000
00399 #define CH_TOP_BACK_LEFT 0x00008000
00400 #define CH_TOP_BACK_CENTER 0x00010000
00401 #define CH_TOP_BACK_RIGHT 0x00020000
00402 #define CH_STEREO_LEFT 0x20000000
00403 #define CH_STEREO_RIGHT 0x40000000
00404
00405
00408 #define CH_LAYOUT_NATIVE 0x8000000000000000LL
00409
00410
00411 #define CH_LAYOUT_MONO (CH_FRONT_CENTER)
00412 #define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
00413 #define CH_LAYOUT_2_1 (CH_LAYOUT_STEREO|CH_BACK_CENTER)
00414 #define CH_LAYOUT_SURROUND (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
00415 #define CH_LAYOUT_4POINT0 (CH_LAYOUT_SURROUND|CH_BACK_CENTER)
00416 #define CH_LAYOUT_2_2 (CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT)
00417 #define CH_LAYOUT_QUAD (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
00418 #define CH_LAYOUT_5POINT0 (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
00419 #define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
00420 #define CH_LAYOUT_5POINT0_BACK (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT)
00421 #define CH_LAYOUT_5POINT1_BACK (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY)
00422 #define CH_LAYOUT_7POINT0 (CH_LAYOUT_5POINT0|CH_BACK_LEFT|CH_BACK_RIGHT)
00423 #define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
00424 #define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\
00425 CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
00426 #define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT)
00427
00428
00429 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00430
00438 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00439
00444 #define FF_MIN_BUFFER_SIZE 16384
00445
00446
00450 enum Motion_Est_ID {
00451 ME_ZERO = 1,
00452 ME_FULL,
00453 ME_LOG,
00454 ME_PHODS,
00455 ME_EPZS,
00456 ME_X1,
00457 ME_HEX,
00458 ME_UMH,
00459 ME_ITER,
00460 ME_TESA,
00461 };
00462
00463 enum AVDiscard{
00464
00465
00466 AVDISCARD_NONE =-16,
00467 AVDISCARD_DEFAULT= 0,
00468 AVDISCARD_NONREF = 8,
00469 AVDISCARD_BIDIR = 16,
00470 AVDISCARD_NONKEY = 32,
00471 AVDISCARD_ALL = 48,
00472 };
00473
00474 enum AVColorPrimaries{
00475 AVCOL_PRI_BT709 =1,
00476 AVCOL_PRI_UNSPECIFIED=2,
00477 AVCOL_PRI_BT470M =4,
00478 AVCOL_PRI_BT470BG =5,
00479 AVCOL_PRI_SMPTE170M =6,
00480 AVCOL_PRI_SMPTE240M =7,
00481 AVCOL_PRI_FILM =8,
00482 AVCOL_PRI_NB ,
00483 };
00484
00485 enum AVColorTransferCharacteristic{
00486 AVCOL_TRC_BT709 =1,
00487 AVCOL_TRC_UNSPECIFIED=2,
00488 AVCOL_TRC_GAMMA22 =4,
00489 AVCOL_TRC_GAMMA28 =5,
00490 AVCOL_TRC_NB ,
00491 };
00492
00493 enum AVColorSpace{
00494 AVCOL_SPC_RGB =0,
00495 AVCOL_SPC_BT709 =1,
00496 AVCOL_SPC_UNSPECIFIED=2,
00497 AVCOL_SPC_FCC =4,
00498 AVCOL_SPC_BT470BG =5,
00499 AVCOL_SPC_SMPTE170M =6,
00500 AVCOL_SPC_SMPTE240M =7,
00501 AVCOL_SPC_NB ,
00502 };
00503
00504 enum AVColorRange{
00505 AVCOL_RANGE_UNSPECIFIED=0,
00506 AVCOL_RANGE_MPEG =1,
00507 AVCOL_RANGE_JPEG =2,
00508 AVCOL_RANGE_NB ,
00509 };
00510
00516 enum AVChromaLocation{
00517 AVCHROMA_LOC_UNSPECIFIED=0,
00518 AVCHROMA_LOC_LEFT =1,
00519 AVCHROMA_LOC_CENTER =2,
00520 AVCHROMA_LOC_TOPLEFT =3,
00521 AVCHROMA_LOC_TOP =4,
00522 AVCHROMA_LOC_BOTTOMLEFT =5,
00523 AVCHROMA_LOC_BOTTOM =6,
00524 AVCHROMA_LOC_NB ,
00525 };
00526
00527 typedef struct RcOverride{
00528 int start_frame;
00529 int end_frame;
00530 int qscale;
00531 float quality_factor;
00532 } RcOverride;
00533
00534 #define FF_MAX_B_FRAMES 16
00535
00536
00537
00538
00539
00540
00541 #define CODEC_FLAG_QSCALE 0x0002
00542 #define CODEC_FLAG_4MV 0x0004
00543 #define CODEC_FLAG_QPEL 0x0010
00544 #define CODEC_FLAG_GMC 0x0020
00545 #define CODEC_FLAG_MV0 0x0040
00546 #define CODEC_FLAG_PART 0x0080
00547
00552 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00553 #define CODEC_FLAG_PASS1 0x0200
00554 #define CODEC_FLAG_PASS2 0x0400
00555 #define CODEC_FLAG_EXTERN_HUFF 0x1000
00556 #define CODEC_FLAG_GRAY 0x2000
00557 #define CODEC_FLAG_EMU_EDGE 0x4000
00558 #define CODEC_FLAG_PSNR 0x8000
00559 #define CODEC_FLAG_TRUNCATED 0x00010000
00561 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00562 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00563 #define CODEC_FLAG_LOW_DELAY 0x00080000
00564 #define CODEC_FLAG_ALT_SCAN 0x00100000
00565 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00566 #define CODEC_FLAG_BITEXACT 0x00800000
00567
00568 #define CODEC_FLAG_AC_PRED 0x01000000
00569 #define CODEC_FLAG_H263P_UMV 0x02000000
00570 #define CODEC_FLAG_CBP_RD 0x04000000
00571 #define CODEC_FLAG_QP_RD 0x08000000
00572 #define CODEC_FLAG_H263P_AIV 0x00000008
00573 #define CODEC_FLAG_OBMC 0x00000001
00574 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00575 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00576 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00577 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000
00578 #define CODEC_FLAG_CLOSED_GOP 0x80000000
00579 #define CODEC_FLAG2_FAST 0x00000001
00580 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00581 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00582 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00583 #define CODEC_FLAG2_BPYRAMID 0x00000010
00584 #define CODEC_FLAG2_WPRED 0x00000020
00585 #define CODEC_FLAG2_MIXED_REFS 0x00000040
00586 #define CODEC_FLAG2_8X8DCT 0x00000080
00587 #define CODEC_FLAG2_FASTPSKIP 0x00000100
00588 #define CODEC_FLAG2_AUD 0x00000200
00589 #define CODEC_FLAG2_BRDO 0x00000400
00590 #define CODEC_FLAG2_INTRA_VLC 0x00000800
00591 #define CODEC_FLAG2_MEMC_ONLY 0x00001000
00592 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00593 #define CODEC_FLAG2_SKIP_RD 0x00004000
00594 #define CODEC_FLAG2_CHUNKS 0x00008000
00595 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000
00596 #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000
00597 #define CODEC_FLAG2_MBTREE 0x00040000
00598 #define CODEC_FLAG2_PSY 0x00080000
00599 #define CODEC_FLAG2_SSIM 0x00100000
00600
00601
00602
00603
00604
00605
00606
00607
00608 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00609
00614 #define CODEC_CAP_DR1 0x0002
00615
00616 #define CODEC_CAP_PARSE_ONLY 0x0004
00617 #define CODEC_CAP_TRUNCATED 0x0008
00618
00619 #define CODEC_CAP_HWACCEL 0x0010
00620
00624 #define CODEC_CAP_DELAY 0x0020
00625
00629 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00630
00633 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
00634
00645 #define CODEC_CAP_SUBFRAMES 0x0100
00646
00647
00648 #define MB_TYPE_INTRA4x4 0x0001
00649 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00650 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00651 #define MB_TYPE_16x16 0x0008
00652 #define MB_TYPE_16x8 0x0010
00653 #define MB_TYPE_8x16 0x0020
00654 #define MB_TYPE_8x8 0x0040
00655 #define MB_TYPE_INTERLACED 0x0080
00656 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00657 #define MB_TYPE_ACPRED 0x0200
00658 #define MB_TYPE_GMC 0x0400
00659 #define MB_TYPE_SKIP 0x0800
00660 #define MB_TYPE_P0L0 0x1000
00661 #define MB_TYPE_P1L0 0x2000
00662 #define MB_TYPE_P0L1 0x4000
00663 #define MB_TYPE_P1L1 0x8000
00664 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00665 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00666 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00667 #define MB_TYPE_QUANT 0x00010000
00668 #define MB_TYPE_CBP 0x00020000
00669
00670
00676 typedef struct AVPanScan{
00682 int id;
00683
00689 int width;
00690 int height;
00691
00697 int16_t position[3][2];
00698 }AVPanScan;
00699
00700 #define FF_COMMON_FRAME \
00701 \
00707 uint8_t *data[4];\
00708 int linesize[4];\
00709 \
00715 uint8_t *base[4];\
00716 \
00721 int key_frame;\
00722 \
00723 \
00728 int pict_type;\
00729 \
00730 \
00736 int64_t pts;\
00737 \
00738 \
00743 int coded_picture_number;\
00744 \
00749 int display_picture_number;\
00750 \
00751 \
00756 int quality; \
00757 \
00758 \
00764 int age;\
00765 \
00766 \
00774 int reference;\
00775 \
00776 \
00781 int8_t *qscale_table;\
00782 \
00787 int qstride;\
00788 \
00789 \
00795 uint8_t *mbskip_table;\
00796 \
00797 \
00809 int16_t (*motion_val[2])[2];\
00810 \
00811 \
00817 uint32_t *mb_type;\
00818 \
00819 \
00825 uint8_t motion_subsample_log2;\
00826 \
00827 \
00832 void *opaque;\
00833 \
00834 \
00839 uint64_t error[4];\
00840 \
00841 \
00847 int type;\
00848 \
00849 \
00855 int repeat_pict;\
00856 \
00857 \
00860 int qscale_type;\
00861 \
00862 \
00867 int interlaced_frame;\
00868 \
00869 \
00874 int top_field_first;\
00875 \
00876 \
00881 AVPanScan *pan_scan;\
00882 \
00883 \
00888 int palette_has_changed;\
00889 \
00890 \
00895 int buffer_hints;\
00896 \
00897 \
00902 short *dct_coeff;\
00903 \
00904 \
00910 int8_t *ref_index[2];\
00911 \
00912 \
00918 int64_t reordered_opaque;\
00919 \
00920 \
00925 void *hwaccel_picture_private;\
00926
00927
00928 #define FF_QSCALE_TYPE_MPEG1 0
00929 #define FF_QSCALE_TYPE_MPEG2 1
00930 #define FF_QSCALE_TYPE_H264 2
00931 #define FF_QSCALE_TYPE_VP56 3
00932
00933 #define FF_BUFFER_TYPE_INTERNAL 1
00934 #define FF_BUFFER_TYPE_USER 2
00935 #define FF_BUFFER_TYPE_SHARED 4
00936 #define FF_BUFFER_TYPE_COPY 8
00937
00938
00939 #define FF_I_TYPE 1
00940 #define FF_P_TYPE 2
00941 #define FF_B_TYPE 3
00942 #define FF_S_TYPE 4
00943 #define FF_SI_TYPE 5
00944 #define FF_SP_TYPE 6
00945 #define FF_BI_TYPE 7
00946
00947 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
00948 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00949 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00950 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00951
00952 typedef struct AVPacket {
00962 int64_t pts;
00968 int64_t dts;
00969 uint8_t *data;
00970 int size;
00971 int stream_index;
00972 int flags;
00977 int duration;
00978 void (*destruct)(struct AVPacket *);
00979 void *priv;
00980 int64_t pos;
00981
00997 int64_t convergence_duration;
00998 } AVPacket;
00999 #define AV_PKT_FLAG_KEY 0x0001
01000 #if LIBAVCODEC_VERSION_MAJOR < 53
01001 #define PKT_FLAG_KEY AV_PKT_FLAG_KEY
01002 #endif
01003
01013 typedef struct AVFrame {
01014 FF_COMMON_FRAME
01015 } AVFrame;
01016
01024 typedef struct AVCodecContext {
01029 const AVClass *av_class;
01035 int bit_rate;
01036
01043 int bit_rate_tolerance;
01044
01050 int flags;
01051
01060 int sub_id;
01061
01069 int me_method;
01070
01082 uint8_t *extradata;
01083 int extradata_size;
01084
01093 AVRational time_base;
01094
01095
01103 int width, height;
01104
01105 #define FF_ASPECT_EXTENDED 15
01106
01112 int gop_size;
01113
01119 enum PixelFormat pix_fmt;
01120
01127 int rate_emu;
01128
01148 void (*draw_horiz_band)(struct AVCodecContext *s,
01149 const AVFrame *src, int offset[4],
01150 int y, int type, int height);
01151
01152
01153 int sample_rate;
01154 int channels;
01155
01161 enum SampleFormat sample_fmt;
01162
01163
01167 int frame_size;
01168 int frame_number;
01169 #if LIBAVCODEC_VERSION_MAJOR < 53
01170 int real_pict_num;
01171 #endif
01172
01179 int delay;
01180
01181
01182 float qcompress;
01183 float qblur;
01184
01190 int qmin;
01191
01197 int qmax;
01198
01204 int max_qdiff;
01205
01212 int max_b_frames;
01213
01221 float b_quant_factor;
01222
01224 int rc_strategy;
01225 #define FF_RC_STRATEGY_XVID 1
01226
01227 int b_frame_strategy;
01228
01235 int hurry_up;
01236
01237 struct AVCodec *codec;
01238
01239 void *priv_data;
01240
01241 int rtp_payload_size;
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01256
01257
01258 int mv_bits;
01259 int header_bits;
01260 int i_tex_bits;
01261 int p_tex_bits;
01262 int i_count;
01263 int p_count;
01264 int skip_count;
01265 int misc_bits;
01266
01272 int frame_bits;
01273
01279 void *opaque;
01280
01281 char codec_name[32];
01282 enum AVMediaType codec_type;
01283 enum CodecID codec_id;
01284
01298 unsigned int codec_tag;
01299
01305 int workaround_bugs;
01306 #define FF_BUG_AUTODETECT 1
01307 #define FF_BUG_OLD_MSMPEG4 2
01308 #define FF_BUG_XVID_ILACE 4
01309 #define FF_BUG_UMP4 8
01310 #define FF_BUG_NO_PADDING 16
01311 #define FF_BUG_AMV 32
01312 #define FF_BUG_AC_VLC 0
01313 #define FF_BUG_QPEL_CHROMA 64
01314 #define FF_BUG_STD_QPEL 128
01315 #define FF_BUG_QPEL_CHROMA2 256
01316 #define FF_BUG_DIRECT_BLOCKSIZE 512
01317 #define FF_BUG_EDGE 1024
01318 #define FF_BUG_HPEL_CHROMA 2048
01319 #define FF_BUG_DC_CLIP 4096
01320 #define FF_BUG_MS 8192
01321 #define FF_BUG_TRUNCATED 16384
01322
01323
01329 int luma_elim_threshold;
01330
01336 int chroma_elim_threshold;
01337
01350 int strict_std_compliance;
01351 #define FF_COMPLIANCE_VERY_STRICT 2
01352 #define FF_COMPLIANCE_STRICT 1
01353 #define FF_COMPLIANCE_NORMAL 0
01354 #define FF_COMPLIANCE_INOFFICIAL -1
01355 #define FF_COMPLIANCE_EXPERIMENTAL -2
01356
01357
01362 float b_quant_offset;
01363
01370 int error_recognition;
01371 #define FF_ER_CAREFUL 1
01372 #define FF_ER_COMPLIANT 2
01373 #define FF_ER_AGGRESSIVE 3
01374 #define FF_ER_VERY_AGGRESSIVE 4
01375
01387 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01388
01396 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01397
01404 int has_b_frames;
01405
01410 int block_align;
01411
01412 int parse_only;
01413
01414
01415
01421 int mpeg_quant;
01422
01428 char *stats_out;
01429
01436 char *stats_in;
01437
01444 float rc_qsquish;
01445
01446 float rc_qmod_amp;
01447 int rc_qmod_freq;
01448
01454 RcOverride *rc_override;
01455 int rc_override_count;
01456
01462 const char *rc_eq;
01463
01469 int rc_max_rate;
01470
01476 int rc_min_rate;
01477
01483 int rc_buffer_size;
01484 float rc_buffer_aggressivity;
01485
01493 float i_quant_factor;
01494
01500 float i_quant_offset;
01501
01507 float rc_initial_cplx;
01508
01514 int dct_algo;
01515 #define FF_DCT_AUTO 0
01516 #define FF_DCT_FASTINT 1
01517 #define FF_DCT_INT 2
01518 #define FF_DCT_MMX 3
01519 #define FF_DCT_MLIB 4
01520 #define FF_DCT_ALTIVEC 5
01521 #define FF_DCT_FAAN 6
01522
01528 float lumi_masking;
01529
01535 float temporal_cplx_masking;
01536
01542 float spatial_cplx_masking;
01543
01549 float p_masking;
01550
01556 float dark_masking;
01557
01563 int idct_algo;
01564 #define FF_IDCT_AUTO 0
01565 #define FF_IDCT_INT 1
01566 #define FF_IDCT_SIMPLE 2
01567 #define FF_IDCT_SIMPLEMMX 3
01568 #define FF_IDCT_LIBMPEG2MMX 4
01569 #define FF_IDCT_PS2 5
01570 #define FF_IDCT_MLIB 6
01571 #define FF_IDCT_ARM 7
01572 #define FF_IDCT_ALTIVEC 8
01573 #define FF_IDCT_SH4 9
01574 #define FF_IDCT_SIMPLEARM 10
01575 #define FF_IDCT_H264 11
01576 #define FF_IDCT_VP3 12
01577 #define FF_IDCT_IPP 13
01578 #define FF_IDCT_XVIDMMX 14
01579 #define FF_IDCT_CAVS 15
01580 #define FF_IDCT_SIMPLEARMV5TE 16
01581 #define FF_IDCT_SIMPLEARMV6 17
01582 #define FF_IDCT_SIMPLEVIS 18
01583 #define FF_IDCT_WMV2 19
01584 #define FF_IDCT_FAAN 20
01585 #define FF_IDCT_EA 21
01586 #define FF_IDCT_SIMPLENEON 22
01587 #define FF_IDCT_SIMPLEALPHA 23
01588 #define FF_IDCT_BINK 24
01589
01595 int slice_count;
01601 int *slice_offset;
01602
01608 int error_concealment;
01609 #define FF_EC_GUESS_MVS 1
01610 #define FF_EC_DEBLOCK 2
01611
01620 unsigned dsp_mask;
01621 #define FF_MM_FORCE 0x80000000
01622
01623 #define FF_MM_MMX 0x0001
01624 #define FF_MM_3DNOW 0x0004
01625 #if LIBAVCODEC_VERSION_MAJOR < 53
01626 #define FF_MM_MMXEXT 0x0002
01627 #endif
01628 #define FF_MM_MMX2 0x0002
01629 #define FF_MM_SSE 0x0008
01630 #define FF_MM_SSE2 0x0010
01631 #define FF_MM_3DNOWEXT 0x0020
01632 #define FF_MM_SSE3 0x0040
01633 #define FF_MM_SSSE3 0x0080
01634 #define FF_MM_SSE4 0x0100
01635 #define FF_MM_SSE42 0x0200
01636 #define FF_MM_IWMMXT 0x0100
01637 #define FF_MM_ALTIVEC 0x0001
01638
01639
01644 int bits_per_coded_sample;
01645
01651 int prediction_method;
01652 #define FF_PRED_LEFT 0
01653 #define FF_PRED_PLANE 1
01654 #define FF_PRED_MEDIAN 2
01655
01663 AVRational sample_aspect_ratio;
01664
01670 AVFrame *coded_frame;
01671
01677 int debug;
01678 #define FF_DEBUG_PICT_INFO 1
01679 #define FF_DEBUG_RC 2
01680 #define FF_DEBUG_BITSTREAM 4
01681 #define FF_DEBUG_MB_TYPE 8
01682 #define FF_DEBUG_QP 16
01683 #define FF_DEBUG_MV 32
01684 #define FF_DEBUG_DCT_COEFF 0x00000040
01685 #define FF_DEBUG_SKIP 0x00000080
01686 #define FF_DEBUG_STARTCODE 0x00000100
01687 #define FF_DEBUG_PTS 0x00000200
01688 #define FF_DEBUG_ER 0x00000400
01689 #define FF_DEBUG_MMCO 0x00000800
01690 #define FF_DEBUG_BUGS 0x00001000
01691 #define FF_DEBUG_VIS_QP 0x00002000
01692 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01693 #define FF_DEBUG_BUFFERS 0x00008000
01694
01700 int debug_mv;
01701 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
01702 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
01703 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01704
01710 uint64_t error[4];
01711
01717 int mb_qmin;
01718
01724 int mb_qmax;
01725
01731 int me_cmp;
01737 int me_sub_cmp;
01743 int mb_cmp;
01749 int ildct_cmp;
01750 #define FF_CMP_SAD 0
01751 #define FF_CMP_SSE 1
01752 #define FF_CMP_SATD 2
01753 #define FF_CMP_DCT 3
01754 #define FF_CMP_PSNR 4
01755 #define FF_CMP_BIT 5
01756 #define FF_CMP_RD 6
01757 #define FF_CMP_ZERO 7
01758 #define FF_CMP_VSAD 8
01759 #define FF_CMP_VSSE 9
01760 #define FF_CMP_NSSE 10
01761 #define FF_CMP_W53 11
01762 #define FF_CMP_W97 12
01763 #define FF_CMP_DCTMAX 13
01764 #define FF_CMP_DCT264 14
01765 #define FF_CMP_CHROMA 256
01766
01772 int dia_size;
01773
01779 int last_predictor_count;
01780
01786 int pre_me;
01787
01793 int me_pre_cmp;
01794
01800 int pre_dia_size;
01801
01807 int me_subpel_quality;
01808
01818 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01819
01828 int dtg_active_format;
01829 #define FF_DTG_AFD_SAME 8
01830 #define FF_DTG_AFD_4_3 9
01831 #define FF_DTG_AFD_16_9 10
01832 #define FF_DTG_AFD_14_9 11
01833 #define FF_DTG_AFD_4_3_SP_14_9 13
01834 #define FF_DTG_AFD_16_9_SP_14_9 14
01835 #define FF_DTG_AFD_SP_4_3 15
01836
01844 int me_range;
01845
01851 int intra_quant_bias;
01852 #define FF_DEFAULT_QUANT_BIAS 999999
01853
01859 int inter_quant_bias;
01860
01867 int color_table_id;
01868
01873 int internal_buffer_count;
01874
01879 void *internal_buffer;
01880
01881 #define FF_LAMBDA_SHIFT 7
01882 #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01883 #define FF_QP2LAMBDA 118
01884 #define FF_LAMBDA_MAX (256*128-1)
01885
01886 #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01887
01893 int global_quality;
01894
01895 #define FF_CODER_TYPE_VLC 0
01896 #define FF_CODER_TYPE_AC 1
01897 #define FF_CODER_TYPE_RAW 2
01898 #define FF_CODER_TYPE_RLE 3
01899 #define FF_CODER_TYPE_DEFLATE 4
01900
01905 int coder_type;
01906
01912 int context_model;
01913 #if 0
01914
01919 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01920 #endif
01921
01927 int slice_flags;
01928 #define SLICE_FLAG_CODED_ORDER 0x0001
01929 #define SLICE_FLAG_ALLOW_FIELD 0x0002
01930 #define SLICE_FLAG_ALLOW_PLANE 0x0004
01931
01932
01937 int xvmc_acceleration;
01938
01944 int mb_decision;
01945 #define FF_MB_DECISION_SIMPLE 0
01946 #define FF_MB_DECISION_BITS 1
01947 #define FF_MB_DECISION_RD 2
01948
01949
01954 uint16_t *intra_matrix;
01955
01961 uint16_t *inter_matrix;
01962
01969 unsigned int stream_codec_tag;
01970
01977 int scenechange_threshold;
01978
01984 int lmin;
01985
01991 int lmax;
01992
01998 struct AVPaletteControl *palctrl;
01999
02005 int noise_reduction;
02006
02019 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
02020
02026 int rc_initial_buffer_occupancy;
02027
02033 int inter_threshold;
02034
02040 int flags2;
02041
02047 int error_rate;
02048
02054 int antialias_algo;
02055 #define FF_AA_AUTO 0
02056 #define FF_AA_FASTINT 1 //not implemented yet
02057 #define FF_AA_INT 2
02058 #define FF_AA_FLOAT 3
02059
02064 int quantizer_noise_shaping;
02065
02072 int thread_count;
02073
02083 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
02084
02091 void *thread_opaque;
02092
02100 int me_threshold;
02101
02107 int mb_threshold;
02108
02114 int intra_dc_precision;
02115
02121 int nsse_weight;
02122
02128 int skip_top;
02129
02135 int skip_bottom;
02136
02142 int profile;
02143 #define FF_PROFILE_UNKNOWN -99
02144
02145 #define FF_PROFILE_AAC_MAIN 0
02146 #define FF_PROFILE_AAC_LOW 1
02147 #define FF_PROFILE_AAC_SSR 2
02148 #define FF_PROFILE_AAC_LTP 3
02149
02150 #define FF_PROFILE_H264_BASELINE 66
02151 #define FF_PROFILE_H264_MAIN 77
02152 #define FF_PROFILE_H264_EXTENDED 88
02153 #define FF_PROFILE_H264_HIGH 100
02154 #define FF_PROFILE_H264_HIGH_10 110
02155 #define FF_PROFILE_H264_HIGH_422 122
02156 #define FF_PROFILE_H264_HIGH_444 244
02157 #define FF_PROFILE_H264_CAVLC_444 44
02158
02164 int level;
02165 #define FF_LEVEL_UNKNOWN -99
02166
02172 int lowres;
02173
02180 int coded_width, coded_height;
02181
02187 int frame_skip_threshold;
02188
02194 int frame_skip_factor;
02195
02201 int frame_skip_exp;
02202
02208 int frame_skip_cmp;
02209
02216 float border_masking;
02217
02223 int mb_lmin;
02224
02230 int mb_lmax;
02231
02237 int me_penalty_compensation;
02238
02244 enum AVDiscard skip_loop_filter;
02245
02251 enum AVDiscard skip_idct;
02252
02258 enum AVDiscard skip_frame;
02259
02265 int bidir_refine;
02266
02272 int brd_scale;
02273
02279 float crf;
02280
02286 int cqp;
02287
02293 int keyint_min;
02294
02300 int refs;
02301
02307 int chromaoffset;
02308
02314 int bframebias;
02315
02321 int trellis;
02322
02328 float complexityblur;
02329
02336 int deblockalpha;
02337
02344 int deblockbeta;
02345
02351 int partitions;
02352 #define X264_PART_I4X4 0x001
02353 #define X264_PART_I8X8 0x002
02354 #define X264_PART_P8X8 0x010
02355 #define X264_PART_P4X4 0x020
02356 #define X264_PART_B8X8 0x100
02357
02363 int directpred;
02364
02370 int cutoff;
02371
02377 int scenechange_factor;
02378
02385 int mv0_threshold;
02386
02392 int b_sensitivity;
02393
02398 int compression_level;
02399 #define FF_COMPRESSION_DEFAULT -1
02400
02406 int use_lpc;
02407
02413 int lpc_coeff_precision;
02414
02419 int min_prediction_order;
02420
02425 int max_prediction_order;
02426
02432 int prediction_order_method;
02433
02438 int min_partition_order;
02439
02444 int max_partition_order;
02445
02451 int64_t timecode_frame_start;
02452
02453 #if LIBAVCODEC_VERSION_MAJOR < 53
02454
02460 int request_channels;
02461 #endif
02462
02469 float drc_scale;
02470
02477 int64_t reordered_opaque;
02478
02485 int bits_per_raw_sample;
02486
02492 int64_t channel_layout;
02493
02499 int64_t request_channel_layout;
02500
02506 float rc_max_available_vbv_use;
02507
02513 float rc_min_vbv_overflow_use;
02514
02520 struct AVHWAccel *hwaccel;
02521
02529 int ticks_per_frame;
02530
02541 void *hwaccel_context;
02542
02548 enum AVColorPrimaries color_primaries;
02549
02555 enum AVColorTransferCharacteristic color_trc;
02556
02562 enum AVColorSpace colorspace;
02563
02569 enum AVColorRange color_range;
02570
02576 enum AVChromaLocation chroma_sample_location;
02577
02596 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
02597
02606 int weighted_p_pred;
02607
02616 int aq_mode;
02617
02624 float aq_strength;
02625
02632 float psy_rd;
02633
02640 float psy_trellis;
02641
02648 int rc_lookahead;
02649 } AVCodecContext;
02650
02654 typedef struct AVCodec {
02661 const char *name;
02662 enum AVMediaType type;
02663 enum CodecID id;
02664 int priv_data_size;
02665 int (*init)(AVCodecContext *);
02666 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02667 int (*close)(AVCodecContext *);
02668 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
02673 int capabilities;
02674 struct AVCodec *next;
02679 void (*flush)(AVCodecContext *);
02680 const AVRational *supported_framerates;
02681 const enum PixelFormat *pix_fmts;
02682
02686 const char *long_name;
02687 const int *supported_samplerates;
02688 const enum SampleFormat *sample_fmts;
02689 const int64_t *channel_layouts;
02690 } AVCodec;
02691
02695 typedef struct AVHWAccel {
02701 const char *name;
02702
02708 enum AVMediaType type;
02709
02715 enum CodecID id;
02716
02722 enum PixelFormat pix_fmt;
02723
02728 int capabilities;
02729
02730 struct AVHWAccel *next;
02731
02746 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02747
02759 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02760
02770 int (*end_frame)(AVCodecContext *avctx);
02771
02779 int priv_data_size;
02780 } AVHWAccel;
02781
02786 typedef struct AVPicture {
02787 uint8_t *data[4];
02788 int linesize[4];
02789 } AVPicture;
02790
02791 #if LIBAVCODEC_VERSION_MAJOR < 53
02792
02800 #define AVPALETTE_SIZE 1024
02801 #define AVPALETTE_COUNT 256
02802 typedef struct AVPaletteControl {
02803
02804
02805
02806 int palette_changed;
02807
02808
02809
02810
02811
02812 unsigned int palette[AVPALETTE_COUNT];
02813
02814 } AVPaletteControl attribute_deprecated;
02815 #endif
02816
02817 enum AVSubtitleType {
02818 SUBTITLE_NONE,
02819
02820 SUBTITLE_BITMAP,
02821
02826 SUBTITLE_TEXT,
02827
02832 SUBTITLE_ASS,
02833 };
02834
02835 typedef struct AVSubtitleRect {
02836 int x;
02837 int y;
02838 int w;
02839 int h;
02840 int nb_colors;
02841
02846 AVPicture pict;
02847 enum AVSubtitleType type;
02848
02849 char *text;
02850
02856 char *ass;
02857 } AVSubtitleRect;
02858
02859 typedef struct AVSubtitle {
02860 uint16_t format;
02861 uint32_t start_display_time;
02862 uint32_t end_display_time;
02863 unsigned num_rects;
02864 AVSubtitleRect **rects;
02865 int64_t pts;
02866 } AVSubtitle;
02867
02868
02869
02873 attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
02874
02878 void av_destruct_packet(AVPacket *pkt);
02879
02885 void av_init_packet(AVPacket *pkt);
02886
02895 int av_new_packet(AVPacket *pkt, int size);
02896
02903 void av_shrink_packet(AVPacket *pkt, int size);
02904
02909 int av_dup_packet(AVPacket *pkt);
02910
02916 void av_free_packet(AVPacket *pkt);
02917
02918
02919
02920 struct ReSampleContext;
02921 struct AVResampleContext;
02922
02923 typedef struct ReSampleContext ReSampleContext;
02924
02925 #if LIBAVCODEC_VERSION_MAJOR < 53
02926
02929 attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02930 int output_rate, int input_rate);
02931 #endif
02932
02948 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
02949 int output_rate, int input_rate,
02950 enum SampleFormat sample_fmt_out,
02951 enum SampleFormat sample_fmt_in,
02952 int filter_length, int log2_phase_count,
02953 int linear, double cutoff);
02954
02955 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02956 void audio_resample_close(ReSampleContext *s);
02957
02958
02968 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02969
02979 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02980
02981
02994 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
02995 void av_resample_close(struct AVResampleContext *c);
02996
03006 int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
03007
03013 void avpicture_free(AVPicture *picture);
03014
03032 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
03033 enum PixelFormat pix_fmt, int width, int height);
03034 int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
03035 unsigned char *dest, int dest_size);
03036
03049 int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
03050 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
03051 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
03052 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
03053
03054 #if LIBAVCODEC_VERSION_MAJOR < 53
03055
03068 attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
03069 #endif
03070
03076 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
03077
03078 #define FF_LOSS_RESOLUTION 0x0001
03079 #define FF_LOSS_DEPTH 0x0002
03080 #define FF_LOSS_COLORSPACE 0x0004
03081 #define FF_LOSS_ALPHA 0x0008
03082 #define FF_LOSS_COLORQUANT 0x0010
03083 #define FF_LOSS_CHROMA 0x0020
03102 int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
03103 int has_alpha);
03104
03127 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
03128 int has_alpha, int *loss_ptr);
03129
03130
03141 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
03142
03143 #define FF_ALPHA_TRANSP 0x0001
03144 #define FF_ALPHA_SEMI_TRANSP 0x0002
03145
03150 int img_get_alpha_info(const AVPicture *src,
03151 enum PixelFormat pix_fmt, int width, int height);
03152
03153
03154
03155 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
03156 enum PixelFormat pix_fmt, int width, int height);
03157
03158
03159
03165 AVCodec *av_codec_next(AVCodec *c);
03166
03170 unsigned avcodec_version(void);
03171
03175 const char *avcodec_configuration(void);
03176
03180 const char *avcodec_license(void);
03181
03188 void avcodec_init(void);
03189
03190 #if LIBAVCODEC_VERSION_MAJOR < 53
03191
03194 attribute_deprecated void register_avcodec(AVCodec *codec);
03195 #endif
03196
03202 void avcodec_register(AVCodec *codec);
03203
03210 AVCodec *avcodec_find_encoder(enum CodecID id);
03211
03218 AVCodec *avcodec_find_encoder_by_name(const char *name);
03219
03226 AVCodec *avcodec_find_decoder(enum CodecID id);
03227
03234 AVCodec *avcodec_find_decoder_by_name(const char *name);
03235 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
03236
03242 void avcodec_get_context_defaults(AVCodecContext *s);
03243
03246 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
03247
03255 AVCodecContext *avcodec_alloc_context(void);
03256
03259 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
03260
03272 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
03273
03279 void avcodec_get_frame_defaults(AVFrame *pic);
03280
03288 AVFrame *avcodec_alloc_frame(void);
03289
03290 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03291 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03292 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03293
03301 unsigned avcodec_get_edge_width(void);
03307 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03313 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
03314 int linesize_align[4]);
03315
03324 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
03325 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
03326
03327 int avcodec_thread_init(AVCodecContext *s, int thread_count);
03328 void avcodec_thread_free(AVCodecContext *s);
03329 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
03330 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
03331
03332
03360 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
03361
03362 #if LIBAVCODEC_VERSION_MAJOR < 53
03363
03376 attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
03377 int *frame_size_ptr,
03378 const uint8_t *buf, int buf_size);
03379 #endif
03380
03420 int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
03421 int *frame_size_ptr,
03422 AVPacket *avpkt);
03423
03424 #if LIBAVCODEC_VERSION_MAJOR < 53
03425
03438 attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
03439 int *got_picture_ptr,
03440 const uint8_t *buf, int buf_size);
03441 #endif
03442
03476 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
03477 int *got_picture_ptr,
03478 AVPacket *avpkt);
03479
03480 #if LIBAVCODEC_VERSION_MAJOR < 53
03481
03482
03483
03484 attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
03485 int *got_sub_ptr,
03486 const uint8_t *buf, int buf_size);
03487 #endif
03488
03500 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
03501 int *got_sub_ptr,
03502 AVPacket *avpkt);
03503 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
03504 int *data_size_ptr,
03505 uint8_t *buf, int buf_size);
03506
03526 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03527 const short *samples);
03528
03541 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03542 const AVFrame *pict);
03543 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03544 const AVSubtitle *sub);
03545
03546 int avcodec_close(AVCodecContext *avctx);
03547
03558 void avcodec_register_all(void);
03559
03563 void avcodec_flush_buffers(AVCodecContext *avctx);
03564
03565 void avcodec_default_free_buffers(AVCodecContext *s);
03566
03567
03568
03575 char av_get_pict_type_char(int pict_type);
03576
03583 int av_get_bits_per_sample(enum CodecID codec_id);
03584
03591 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
03592
03593
03594 typedef struct AVCodecParserContext {
03595 void *priv_data;
03596 struct AVCodecParser *parser;
03597 int64_t frame_offset;
03598 int64_t cur_offset;
03599
03600 int64_t next_frame_offset;
03601
03602 int pict_type;
03612 int repeat_pict;
03613 int64_t pts;
03614 int64_t dts;
03615
03616
03617 int64_t last_pts;
03618 int64_t last_dts;
03619 int fetch_timestamp;
03620
03621 #define AV_PARSER_PTS_NB 4
03622 int cur_frame_start_index;
03623 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03624 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03625 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03626
03627 int flags;
03628 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
03629
03630 int64_t offset;
03631 int64_t cur_frame_end[AV_PARSER_PTS_NB];
03632
03639 int key_frame;
03640
03656 int64_t convergence_duration;
03657
03658
03668 int dts_sync_point;
03669
03683 int dts_ref_dts_delta;
03684
03697 int pts_dts_delta;
03698
03704 int64_t cur_frame_pos[AV_PARSER_PTS_NB];
03705
03709 int64_t pos;
03710
03714 int64_t last_pos;
03715 } AVCodecParserContext;
03716
03717 typedef struct AVCodecParser {
03718 int codec_ids[5];
03719 int priv_data_size;
03720 int (*parser_init)(AVCodecParserContext *s);
03721 int (*parser_parse)(AVCodecParserContext *s,
03722 AVCodecContext *avctx,
03723 const uint8_t **poutbuf, int *poutbuf_size,
03724 const uint8_t *buf, int buf_size);
03725 void (*parser_close)(AVCodecParserContext *s);
03726 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
03727 struct AVCodecParser *next;
03728 } AVCodecParser;
03729
03730 AVCodecParser *av_parser_next(AVCodecParser *c);
03731
03732 void av_register_codec_parser(AVCodecParser *parser);
03733 AVCodecParserContext *av_parser_init(int codec_id);
03734
03735 #if LIBAVCODEC_VERSION_MAJOR < 53
03736 attribute_deprecated
03737 int av_parser_parse(AVCodecParserContext *s,
03738 AVCodecContext *avctx,
03739 uint8_t **poutbuf, int *poutbuf_size,
03740 const uint8_t *buf, int buf_size,
03741 int64_t pts, int64_t dts);
03742 #endif
03743
03772 int av_parser_parse2(AVCodecParserContext *s,
03773 AVCodecContext *avctx,
03774 uint8_t **poutbuf, int *poutbuf_size,
03775 const uint8_t *buf, int buf_size,
03776 int64_t pts, int64_t dts,
03777 int64_t pos);
03778
03779 int av_parser_change(AVCodecParserContext *s,
03780 AVCodecContext *avctx,
03781 uint8_t **poutbuf, int *poutbuf_size,
03782 const uint8_t *buf, int buf_size, int keyframe);
03783 void av_parser_close(AVCodecParserContext *s);
03784
03785
03786 typedef struct AVBitStreamFilterContext {
03787 void *priv_data;
03788 struct AVBitStreamFilter *filter;
03789 AVCodecParserContext *parser;
03790 struct AVBitStreamFilterContext *next;
03791 } AVBitStreamFilterContext;
03792
03793
03794 typedef struct AVBitStreamFilter {
03795 const char *name;
03796 int priv_data_size;
03797 int (*filter)(AVBitStreamFilterContext *bsfc,
03798 AVCodecContext *avctx, const char *args,
03799 uint8_t **poutbuf, int *poutbuf_size,
03800 const uint8_t *buf, int buf_size, int keyframe);
03801 void (*close)(AVBitStreamFilterContext *bsfc);
03802 struct AVBitStreamFilter *next;
03803 } AVBitStreamFilter;
03804
03805 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
03806 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
03807 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
03808 AVCodecContext *avctx, const char *args,
03809 uint8_t **poutbuf, int *poutbuf_size,
03810 const uint8_t *buf, int buf_size, int keyframe);
03811 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
03812
03813 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
03814
03815
03816
03823 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
03824
03837 void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
03838
03842 void av_picture_copy(AVPicture *dst, const AVPicture *src,
03843 enum PixelFormat pix_fmt, int width, int height);
03844
03848 int av_picture_crop(AVPicture *dst, const AVPicture *src,
03849 enum PixelFormat pix_fmt, int top_band, int left_band);
03850
03854 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
03855 int padtop, int padbottom, int padleft, int padright, int *color);
03856
03864 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
03865
03877 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
03878
03888 int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
03889
03902 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
03903
03912 void av_log_ask_for_sample(void *avc, const char *msg);
03913
03917 void av_register_hwaccel(AVHWAccel *hwaccel);
03918
03924 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
03925
03926
03930 enum AVLockOp {
03931 AV_LOCK_CREATE,
03932 AV_LOCK_OBTAIN,
03933 AV_LOCK_RELEASE,
03934 AV_LOCK_DESTROY,
03935 };
03936
03950 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
03951
03952 #endif