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
00038 #include "libavcodec/version.h"
00083 enum CodecID {
00084 CODEC_ID_NONE,
00085
00086
00087 CODEC_ID_MPEG1VIDEO,
00088 CODEC_ID_MPEG2VIDEO,
00089 CODEC_ID_MPEG2VIDEO_XVMC,
00090 CODEC_ID_H261,
00091 CODEC_ID_H263,
00092 CODEC_ID_RV10,
00093 CODEC_ID_RV20,
00094 CODEC_ID_MJPEG,
00095 CODEC_ID_MJPEGB,
00096 CODEC_ID_LJPEG,
00097 CODEC_ID_SP5X,
00098 CODEC_ID_JPEGLS,
00099 CODEC_ID_MPEG4,
00100 CODEC_ID_RAWVIDEO,
00101 CODEC_ID_MSMPEG4V1,
00102 CODEC_ID_MSMPEG4V2,
00103 CODEC_ID_MSMPEG4V3,
00104 CODEC_ID_WMV1,
00105 CODEC_ID_WMV2,
00106 CODEC_ID_H263P,
00107 CODEC_ID_H263I,
00108 CODEC_ID_FLV1,
00109 CODEC_ID_SVQ1,
00110 CODEC_ID_SVQ3,
00111 CODEC_ID_DVVIDEO,
00112 CODEC_ID_HUFFYUV,
00113 CODEC_ID_CYUV,
00114 CODEC_ID_H264,
00115 CODEC_ID_INDEO3,
00116 CODEC_ID_VP3,
00117 CODEC_ID_THEORA,
00118 CODEC_ID_ASV1,
00119 CODEC_ID_ASV2,
00120 CODEC_ID_FFV1,
00121 CODEC_ID_4XM,
00122 CODEC_ID_VCR1,
00123 CODEC_ID_CLJR,
00124 CODEC_ID_MDEC,
00125 CODEC_ID_ROQ,
00126 CODEC_ID_INTERPLAY_VIDEO,
00127 CODEC_ID_XAN_WC3,
00128 CODEC_ID_XAN_WC4,
00129 CODEC_ID_RPZA,
00130 CODEC_ID_CINEPAK,
00131 CODEC_ID_WS_VQA,
00132 CODEC_ID_MSRLE,
00133 CODEC_ID_MSVIDEO1,
00134 CODEC_ID_IDCIN,
00135 CODEC_ID_8BPS,
00136 CODEC_ID_SMC,
00137 CODEC_ID_FLIC,
00138 CODEC_ID_TRUEMOTION1,
00139 CODEC_ID_VMDVIDEO,
00140 CODEC_ID_MSZH,
00141 CODEC_ID_ZLIB,
00142 CODEC_ID_QTRLE,
00143 CODEC_ID_SNOW,
00144 CODEC_ID_TSCC,
00145 CODEC_ID_ULTI,
00146 CODEC_ID_QDRAW,
00147 CODEC_ID_VIXL,
00148 CODEC_ID_QPEG,
00149 CODEC_ID_PNG,
00150 CODEC_ID_PPM,
00151 CODEC_ID_PBM,
00152 CODEC_ID_PGM,
00153 CODEC_ID_PGMYUV,
00154 CODEC_ID_PAM,
00155 CODEC_ID_FFVHUFF,
00156 CODEC_ID_RV30,
00157 CODEC_ID_RV40,
00158 CODEC_ID_VC1,
00159 CODEC_ID_WMV3,
00160 CODEC_ID_LOCO,
00161 CODEC_ID_WNV1,
00162 CODEC_ID_AASC,
00163 CODEC_ID_INDEO2,
00164 CODEC_ID_FRAPS,
00165 CODEC_ID_TRUEMOTION2,
00166 CODEC_ID_BMP,
00167 CODEC_ID_CSCD,
00168 CODEC_ID_MMVIDEO,
00169 CODEC_ID_ZMBV,
00170 CODEC_ID_AVS,
00171 CODEC_ID_SMACKVIDEO,
00172 CODEC_ID_NUV,
00173 CODEC_ID_KMVC,
00174 CODEC_ID_FLASHSV,
00175 CODEC_ID_CAVS,
00176 CODEC_ID_JPEG2000,
00177 CODEC_ID_VMNC,
00178 CODEC_ID_VP5,
00179 CODEC_ID_VP6,
00180 CODEC_ID_VP6F,
00181 CODEC_ID_TARGA,
00182 CODEC_ID_DSICINVIDEO,
00183 CODEC_ID_TIERTEXSEQVIDEO,
00184 CODEC_ID_TIFF,
00185 CODEC_ID_GIF,
00186 #if LIBAVCODEC_VERSION_MAJOR == 53
00187 CODEC_ID_FFH264,
00188 #endif
00189 CODEC_ID_DXA,
00190 CODEC_ID_DNXHD,
00191 CODEC_ID_THP,
00192 CODEC_ID_SGI,
00193 CODEC_ID_C93,
00194 CODEC_ID_BETHSOFTVID,
00195 CODEC_ID_PTX,
00196 CODEC_ID_TXD,
00197 CODEC_ID_VP6A,
00198 CODEC_ID_AMV,
00199 CODEC_ID_VB,
00200 CODEC_ID_PCX,
00201 CODEC_ID_SUNRAST,
00202 CODEC_ID_INDEO4,
00203 CODEC_ID_INDEO5,
00204 CODEC_ID_MIMIC,
00205 CODEC_ID_RL2,
00206 #if LIBAVCODEC_VERSION_MAJOR == 53
00207 CODEC_ID_8SVX_EXP,
00208 CODEC_ID_8SVX_FIB,
00209 #endif
00210 CODEC_ID_ESCAPE124,
00211 CODEC_ID_DIRAC,
00212 CODEC_ID_BFI,
00213 CODEC_ID_CMV,
00214 CODEC_ID_MOTIONPIXELS,
00215 CODEC_ID_TGV,
00216 CODEC_ID_TGQ,
00217 CODEC_ID_TQI,
00218 CODEC_ID_AURA,
00219 CODEC_ID_AURA2,
00220 CODEC_ID_V210X,
00221 CODEC_ID_TMV,
00222 CODEC_ID_V210,
00223 CODEC_ID_DPX,
00224 CODEC_ID_MAD,
00225 CODEC_ID_FRWU,
00226 CODEC_ID_FLASHSV2,
00227 CODEC_ID_CDGRAPHICS,
00228 CODEC_ID_R210,
00229 CODEC_ID_ANM,
00230 CODEC_ID_BINKVIDEO,
00231 CODEC_ID_IFF_ILBM,
00232 CODEC_ID_IFF_BYTERUN1,
00233 CODEC_ID_KGV1,
00234 CODEC_ID_YOP,
00235 CODEC_ID_VP8,
00236 CODEC_ID_PICTOR,
00237 CODEC_ID_ANSI,
00238 CODEC_ID_A64_MULTI,
00239 CODEC_ID_A64_MULTI5,
00240 CODEC_ID_R10K,
00241 CODEC_ID_MXPEG,
00242 CODEC_ID_LAGARITH,
00243 CODEC_ID_PRORES,
00244 CODEC_ID_JV,
00245 CODEC_ID_DFA,
00246 CODEC_ID_WMV3IMAGE,
00247 CODEC_ID_VC1IMAGE,
00248 #if LIBAVCODEC_VERSION_MAJOR == 53
00249 CODEC_ID_G723_1,
00250 CODEC_ID_G729,
00251 #endif
00252 CODEC_ID_UTVIDEO,
00253 CODEC_ID_BMV_VIDEO,
00254 CODEC_ID_VBLE,
00255 CODEC_ID_DXTORY,
00256 CODEC_ID_V410,
00257
00258
00259 CODEC_ID_FIRST_AUDIO = 0x10000,
00260 CODEC_ID_PCM_S16LE = 0x10000,
00261 CODEC_ID_PCM_S16BE,
00262 CODEC_ID_PCM_U16LE,
00263 CODEC_ID_PCM_U16BE,
00264 CODEC_ID_PCM_S8,
00265 CODEC_ID_PCM_U8,
00266 CODEC_ID_PCM_MULAW,
00267 CODEC_ID_PCM_ALAW,
00268 CODEC_ID_PCM_S32LE,
00269 CODEC_ID_PCM_S32BE,
00270 CODEC_ID_PCM_U32LE,
00271 CODEC_ID_PCM_U32BE,
00272 CODEC_ID_PCM_S24LE,
00273 CODEC_ID_PCM_S24BE,
00274 CODEC_ID_PCM_U24LE,
00275 CODEC_ID_PCM_U24BE,
00276 CODEC_ID_PCM_S24DAUD,
00277 CODEC_ID_PCM_ZORK,
00278 CODEC_ID_PCM_S16LE_PLANAR,
00279 CODEC_ID_PCM_DVD,
00280 CODEC_ID_PCM_F32BE,
00281 CODEC_ID_PCM_F32LE,
00282 CODEC_ID_PCM_F64BE,
00283 CODEC_ID_PCM_F64LE,
00284 CODEC_ID_PCM_BLURAY,
00285 CODEC_ID_PCM_LXF,
00286 CODEC_ID_S302M,
00287 CODEC_ID_PCM_S8_PLANAR,
00288
00289
00290 CODEC_ID_ADPCM_IMA_QT = 0x11000,
00291 CODEC_ID_ADPCM_IMA_WAV,
00292 CODEC_ID_ADPCM_IMA_DK3,
00293 CODEC_ID_ADPCM_IMA_DK4,
00294 CODEC_ID_ADPCM_IMA_WS,
00295 CODEC_ID_ADPCM_IMA_SMJPEG,
00296 CODEC_ID_ADPCM_MS,
00297 CODEC_ID_ADPCM_4XM,
00298 CODEC_ID_ADPCM_XA,
00299 CODEC_ID_ADPCM_ADX,
00300 CODEC_ID_ADPCM_EA,
00301 CODEC_ID_ADPCM_G726,
00302 CODEC_ID_ADPCM_CT,
00303 CODEC_ID_ADPCM_SWF,
00304 CODEC_ID_ADPCM_YAMAHA,
00305 CODEC_ID_ADPCM_SBPRO_4,
00306 CODEC_ID_ADPCM_SBPRO_3,
00307 CODEC_ID_ADPCM_SBPRO_2,
00308 CODEC_ID_ADPCM_THP,
00309 CODEC_ID_ADPCM_IMA_AMV,
00310 CODEC_ID_ADPCM_EA_R1,
00311 CODEC_ID_ADPCM_EA_R3,
00312 CODEC_ID_ADPCM_EA_R2,
00313 CODEC_ID_ADPCM_IMA_EA_SEAD,
00314 CODEC_ID_ADPCM_IMA_EA_EACS,
00315 CODEC_ID_ADPCM_EA_XAS,
00316 CODEC_ID_ADPCM_EA_MAXIS_XA,
00317 CODEC_ID_ADPCM_IMA_ISS,
00318 CODEC_ID_ADPCM_G722,
00319
00320
00321 CODEC_ID_AMR_NB = 0x12000,
00322 CODEC_ID_AMR_WB,
00323
00324
00325 CODEC_ID_RA_144 = 0x13000,
00326 CODEC_ID_RA_288,
00327
00328
00329 CODEC_ID_ROQ_DPCM = 0x14000,
00330 CODEC_ID_INTERPLAY_DPCM,
00331 CODEC_ID_XAN_DPCM,
00332 CODEC_ID_SOL_DPCM,
00333
00334
00335 CODEC_ID_MP2 = 0x15000,
00336 CODEC_ID_MP3,
00337 CODEC_ID_AAC,
00338 CODEC_ID_AC3,
00339 CODEC_ID_DTS,
00340 CODEC_ID_VORBIS,
00341 CODEC_ID_DVAUDIO,
00342 CODEC_ID_WMAV1,
00343 CODEC_ID_WMAV2,
00344 CODEC_ID_MACE3,
00345 CODEC_ID_MACE6,
00346 CODEC_ID_VMDAUDIO,
00347 #if LIBAVCODEC_VERSION_MAJOR == 53
00348 CODEC_ID_SONIC,
00349 CODEC_ID_SONIC_LS,
00350 #endif
00351 CODEC_ID_FLAC,
00352 CODEC_ID_MP3ADU,
00353 CODEC_ID_MP3ON4,
00354 CODEC_ID_SHORTEN,
00355 CODEC_ID_ALAC,
00356 CODEC_ID_WESTWOOD_SND1,
00357 CODEC_ID_GSM,
00358 CODEC_ID_QDM2,
00359 CODEC_ID_COOK,
00360 CODEC_ID_TRUESPEECH,
00361 CODEC_ID_TTA,
00362 CODEC_ID_SMACKAUDIO,
00363 CODEC_ID_QCELP,
00364 CODEC_ID_WAVPACK,
00365 CODEC_ID_DSICINAUDIO,
00366 CODEC_ID_IMC,
00367 CODEC_ID_MUSEPACK7,
00368 CODEC_ID_MLP,
00369 CODEC_ID_GSM_MS,
00370 CODEC_ID_ATRAC3,
00371 CODEC_ID_VOXWARE,
00372 CODEC_ID_APE,
00373 CODEC_ID_NELLYMOSER,
00374 CODEC_ID_MUSEPACK8,
00375 CODEC_ID_SPEEX,
00376 CODEC_ID_WMAVOICE,
00377 CODEC_ID_WMAPRO,
00378 CODEC_ID_WMALOSSLESS,
00379 CODEC_ID_ATRAC3P,
00380 CODEC_ID_EAC3,
00381 CODEC_ID_SIPR,
00382 CODEC_ID_MP1,
00383 CODEC_ID_TWINVQ,
00384 CODEC_ID_TRUEHD,
00385 CODEC_ID_MP4ALS,
00386 CODEC_ID_ATRAC1,
00387 CODEC_ID_BINKAUDIO_RDFT,
00388 CODEC_ID_BINKAUDIO_DCT,
00389 CODEC_ID_AAC_LATM,
00390 CODEC_ID_QDMC,
00391 CODEC_ID_CELT,
00392 #if LIBAVCODEC_VERSION_MAJOR > 53
00393 CODEC_ID_G723_1,
00394 CODEC_ID_G729,
00395 CODEC_ID_8SVX_EXP,
00396 CODEC_ID_8SVX_FIB,
00397 #endif
00398 CODEC_ID_BMV_AUDIO,
00399
00400
00401 CODEC_ID_FIRST_SUBTITLE = 0x17000,
00402 CODEC_ID_DVD_SUBTITLE = 0x17000,
00403 CODEC_ID_DVB_SUBTITLE,
00404 CODEC_ID_TEXT,
00405 CODEC_ID_XSUB,
00406 CODEC_ID_SSA,
00407 CODEC_ID_MOV_TEXT,
00408 CODEC_ID_HDMV_PGS_SUBTITLE,
00409 CODEC_ID_DVB_TELETEXT,
00410 CODEC_ID_SRT,
00411
00412
00413 CODEC_ID_FIRST_UNKNOWN = 0x18000,
00414 CODEC_ID_TTF = 0x18000,
00415
00416 CODEC_ID_PROBE = 0x19000,
00417
00418 CODEC_ID_MPEG2TS = 0x20000,
00420 CODEC_ID_MPEG4SYSTEMS = 0x20001,
00422 CODEC_ID_FFMETADATA = 0x21000,
00423 };
00424
00425 #if FF_API_OLD_SAMPLE_FMT
00426 #define SampleFormat AVSampleFormat
00427
00428 #define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE
00429 #define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8
00430 #define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16
00431 #define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32
00432 #define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT
00433 #define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL
00434 #define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB
00435 #endif
00436
00437 #if FF_API_OLD_AUDIOCONVERT
00438 #include "libavutil/audioconvert.h"
00439
00440
00441 #define CH_FRONT_LEFT AV_CH_FRONT_LEFT
00442 #define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT
00443 #define CH_FRONT_CENTER AV_CH_FRONT_CENTER
00444 #define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY
00445 #define CH_BACK_LEFT AV_CH_BACK_LEFT
00446 #define CH_BACK_RIGHT AV_CH_BACK_RIGHT
00447 #define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER
00448 #define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER
00449 #define CH_BACK_CENTER AV_CH_BACK_CENTER
00450 #define CH_SIDE_LEFT AV_CH_SIDE_LEFT
00451 #define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT
00452 #define CH_TOP_CENTER AV_CH_TOP_CENTER
00453 #define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT
00454 #define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER
00455 #define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT
00456 #define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT
00457 #define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER
00458 #define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT
00459 #define CH_STEREO_LEFT AV_CH_STEREO_LEFT
00460 #define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT
00461
00465 #define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE
00466
00467
00468 #define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO
00469 #define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO
00470 #define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1
00471 #define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND
00472 #define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0
00473 #define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2
00474 #define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD
00475 #define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0
00476 #define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1
00477 #define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK
00478 #define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK
00479 #define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0
00480 #define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1
00481 #define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE
00482 #define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX
00483 #endif
00484
00485 #if FF_API_OLD_DECODE_AUDIO
00486
00487 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00488 #endif
00489
00497 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00498
00503 #define FF_MIN_BUFFER_SIZE 16384
00504
00505
00509 enum Motion_Est_ID {
00510 ME_ZERO = 1,
00511 ME_FULL,
00512 ME_LOG,
00513 ME_PHODS,
00514 ME_EPZS,
00515 ME_X1,
00516 ME_HEX,
00517 ME_UMH,
00518 ME_ITER,
00519 ME_TESA,
00520 };
00521
00522 enum AVDiscard{
00523
00524
00525 AVDISCARD_NONE =-16,
00526 AVDISCARD_DEFAULT= 0,
00527 AVDISCARD_NONREF = 8,
00528 AVDISCARD_BIDIR = 16,
00529 AVDISCARD_NONKEY = 32,
00530 AVDISCARD_ALL = 48,
00531 };
00532
00533 enum AVColorPrimaries{
00534 AVCOL_PRI_BT709 =1,
00535 AVCOL_PRI_UNSPECIFIED=2,
00536 AVCOL_PRI_BT470M =4,
00537 AVCOL_PRI_BT470BG =5,
00538 AVCOL_PRI_SMPTE170M =6,
00539 AVCOL_PRI_SMPTE240M =7,
00540 AVCOL_PRI_FILM =8,
00541 AVCOL_PRI_NB ,
00542 };
00543
00544 enum AVColorTransferCharacteristic{
00545 AVCOL_TRC_BT709 =1,
00546 AVCOL_TRC_UNSPECIFIED=2,
00547 AVCOL_TRC_GAMMA22 =4,
00548 AVCOL_TRC_GAMMA28 =5,
00549 AVCOL_TRC_NB ,
00550 };
00551
00552 enum AVColorSpace{
00553 AVCOL_SPC_RGB =0,
00554 AVCOL_SPC_BT709 =1,
00555 AVCOL_SPC_UNSPECIFIED=2,
00556 AVCOL_SPC_FCC =4,
00557 AVCOL_SPC_BT470BG =5,
00558 AVCOL_SPC_SMPTE170M =6,
00559 AVCOL_SPC_SMPTE240M =7,
00560 AVCOL_SPC_NB ,
00561 };
00562
00563 enum AVColorRange{
00564 AVCOL_RANGE_UNSPECIFIED=0,
00565 AVCOL_RANGE_MPEG =1,
00566 AVCOL_RANGE_JPEG =2,
00567 AVCOL_RANGE_NB ,
00568 };
00569
00575 enum AVChromaLocation{
00576 AVCHROMA_LOC_UNSPECIFIED=0,
00577 AVCHROMA_LOC_LEFT =1,
00578 AVCHROMA_LOC_CENTER =2,
00579 AVCHROMA_LOC_TOPLEFT =3,
00580 AVCHROMA_LOC_TOP =4,
00581 AVCHROMA_LOC_BOTTOMLEFT =5,
00582 AVCHROMA_LOC_BOTTOM =6,
00583 AVCHROMA_LOC_NB ,
00584 };
00585
00586 #if FF_API_FLAC_GLOBAL_OPTS
00587
00590 enum AVLPCType {
00591 AV_LPC_TYPE_DEFAULT = -1,
00592 AV_LPC_TYPE_NONE = 0,
00593 AV_LPC_TYPE_FIXED = 1,
00594 AV_LPC_TYPE_LEVINSON = 2,
00595 AV_LPC_TYPE_CHOLESKY = 3,
00596 AV_LPC_TYPE_NB ,
00597 };
00598 #endif
00599
00600 enum AVAudioServiceType {
00601 AV_AUDIO_SERVICE_TYPE_MAIN = 0,
00602 AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
00603 AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
00604 AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
00605 AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
00606 AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
00607 AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
00608 AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
00609 AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
00610 AV_AUDIO_SERVICE_TYPE_NB ,
00611 };
00612
00613 typedef struct RcOverride{
00614 int start_frame;
00615 int end_frame;
00616 int qscale;
00617 float quality_factor;
00618 } RcOverride;
00619
00620 #define FF_MAX_B_FRAMES 16
00621
00622
00623
00624
00625
00626
00627 #define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
00628 #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
00629 #define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
00630 #define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
00631 #define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
00632
00637 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00638 #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
00639 #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
00640 #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
00641 #define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
00642 #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
00643 #define CODEC_FLAG_TRUNCATED 0x00010000
00645 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
00646 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
00647 #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
00648 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
00649 #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
00650
00651 #define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
00652 #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
00653 #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
00654 #define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
00655 #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
00656 #define CODEC_FLAG_CLOSED_GOP 0x80000000
00657 #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
00658 #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
00659 #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
00660 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
00661 #define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
00662 #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
00663
00668 #if FF_API_MPEGVIDEO_GLOBAL_OPTS
00669 #define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
00670 #define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
00671 #define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
00672 #define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
00673 #define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
00674 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00675 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
00676 #define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
00677 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
00678 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
00679 #endif
00680 #if FF_API_MJPEG_GLOBAL_OPTS
00681 #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
00682 #endif
00683 #if FF_API_X264_GLOBAL_OPTS
00684 #define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references.
00685 #define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames
00686 #define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
00687 #define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform
00688 #define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
00689 #define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
00690 #define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization
00691 #define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
00692 #define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations.
00693 #define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
00694 #define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes.
00695 #endif
00696 #if FF_API_SNOW_GLOBAL_OPTS
00697 #define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
00698 #endif
00699 #if FF_API_LAME_GLOBAL_OPTS
00700 #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
00701 #endif
00702
00706
00707
00708
00709
00710
00711
00712
00713 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
00714
00719 #define CODEC_CAP_DR1 0x0002
00720 #if FF_API_PARSE_FRAME
00721
00722 #define CODEC_CAP_PARSE_ONLY 0x0004
00723 #endif
00724 #define CODEC_CAP_TRUNCATED 0x0008
00725
00726 #define CODEC_CAP_HWACCEL 0x0010
00727
00750 #define CODEC_CAP_DELAY 0x0020
00751
00755 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00756
00759 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
00760
00771 #define CODEC_CAP_SUBFRAMES 0x0100
00772
00776 #define CODEC_CAP_EXPERIMENTAL 0x0200
00777
00780 #define CODEC_CAP_CHANNEL_CONF 0x0400
00781
00784 #define CODEC_CAP_NEG_LINESIZES 0x0800
00785
00788 #define CODEC_CAP_FRAME_THREADS 0x1000
00789
00792 #define CODEC_CAP_SLICE_THREADS 0x2000
00793
00796 #define CODEC_CAP_PARAM_CHANGE 0x4000
00797
00800 #define CODEC_CAP_AUTO_THREADS 0x8000
00801
00804 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
00805
00806
00807 #define MB_TYPE_INTRA4x4 0x0001
00808 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00809 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00810 #define MB_TYPE_16x16 0x0008
00811 #define MB_TYPE_16x8 0x0010
00812 #define MB_TYPE_8x16 0x0020
00813 #define MB_TYPE_8x8 0x0040
00814 #define MB_TYPE_INTERLACED 0x0080
00815 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00816 #define MB_TYPE_ACPRED 0x0200
00817 #define MB_TYPE_GMC 0x0400
00818 #define MB_TYPE_SKIP 0x0800
00819 #define MB_TYPE_P0L0 0x1000
00820 #define MB_TYPE_P1L0 0x2000
00821 #define MB_TYPE_P0L1 0x4000
00822 #define MB_TYPE_P1L1 0x8000
00823 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00824 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00825 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00826 #define MB_TYPE_QUANT 0x00010000
00827 #define MB_TYPE_CBP 0x00020000
00828
00829
00835 typedef struct AVPanScan{
00841 int id;
00842
00848 int width;
00849 int height;
00850
00856 int16_t position[3][2];
00857 }AVPanScan;
00858
00859 #define FF_QSCALE_TYPE_MPEG1 0
00860 #define FF_QSCALE_TYPE_MPEG2 1
00861 #define FF_QSCALE_TYPE_H264 2
00862 #define FF_QSCALE_TYPE_VP56 3
00863
00864 #define FF_BUFFER_TYPE_INTERNAL 1
00865 #define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user)
00866 #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
00867 #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
00868
00869 #if FF_API_OLD_FF_PICT_TYPES
00870
00871 #define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra
00872 #define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted
00873 #define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted
00874 #define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4
00875 #define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra
00876 #define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted
00877 #define FF_BI_TYPE AV_PICTURE_TYPE_BI
00878 #endif
00879
00880 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
00881 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00882 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00883 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00884
00885 enum AVPacketSideDataType {
00886 AV_PKT_DATA_PALETTE,
00887 AV_PKT_DATA_NEW_EXTRADATA,
00888 AV_PKT_DATA_PARAM_CHANGE,
00889 };
00890
00891 typedef struct AVPacket {
00901 int64_t pts;
00907 int64_t dts;
00908 uint8_t *data;
00909 int size;
00910 int stream_index;
00914 int flags;
00919 struct {
00920 uint8_t *data;
00921 int size;
00922 enum AVPacketSideDataType type;
00923 } *side_data;
00924 int side_data_elems;
00925
00930 int duration;
00931 void (*destruct)(struct AVPacket *);
00932 void *priv;
00933 int64_t pos;
00934
00952 int64_t convergence_duration;
00953 } AVPacket;
00954 #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
00955 #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
00956
00971 enum AVSideDataParamChangeFlags {
00972 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001,
00973 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
00974 AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
00975 AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
00976 };
00977
00985 typedef struct AVFrame {
00986 #if FF_API_DATA_POINTERS
00987 #define AV_NUM_DATA_POINTERS 4
00988 #else
00989 #define AV_NUM_DATA_POINTERS 8
00990 #endif
00991
00997 uint8_t *data[AV_NUM_DATA_POINTERS];
00998
01008 int linesize[AV_NUM_DATA_POINTERS];
01009
01016 uint8_t *base[AV_NUM_DATA_POINTERS];
01022 int key_frame;
01023
01029 enum AVPictureType pict_type;
01030
01037 int64_t pts;
01038
01044 int coded_picture_number;
01050 int display_picture_number;
01051
01057 int quality;
01058
01059 #if FF_API_AVFRAME_AGE
01060
01063 attribute_deprecated int age;
01064 #endif
01065
01074 int reference;
01075
01081 int8_t *qscale_table;
01087 int qstride;
01088
01095 uint8_t *mbskip_table;
01096
01109 int16_t (*motion_val[2])[2];
01110
01117 uint32_t *mb_type;
01118
01125 uint8_t motion_subsample_log2;
01126
01132 void *opaque;
01133
01139 uint64_t error[AV_NUM_DATA_POINTERS];
01140
01147 int type;
01148
01155 int repeat_pict;
01156
01160 int qscale_type;
01161
01167 int interlaced_frame;
01168
01174 int top_field_first;
01175
01181 AVPanScan *pan_scan;
01182
01188 int palette_has_changed;
01189
01195 int buffer_hints;
01196
01202 short *dct_coeff;
01203
01210 int8_t *ref_index[2];
01211
01223 int64_t reordered_opaque;
01224
01230 void *hwaccel_picture_private;
01231
01237 int64_t pkt_pts;
01238
01244 int64_t pkt_dts;
01245
01251 struct AVCodecContext *owner;
01252
01258 void *thread_opaque;
01259
01265 int nb_samples;
01266
01285 uint8_t **extended_data;
01286
01292 AVRational sample_aspect_ratio;
01293
01299 int width, height;
01300
01308 int format;
01309 } AVFrame;
01310
01311 struct AVCodecInternal;
01312
01313 enum AVFieldOrder {
01314 AV_FIELD_UNKNOWN,
01315 AV_FIELD_PROGRESSIVE,
01316 AV_FIELD_TT,
01317 AV_FIELD_BB,
01318 AV_FIELD_TB,
01319 AV_FIELD_BT,
01320 };
01321
01329 typedef struct AVCodecContext {
01334 const AVClass *av_class;
01340 int bit_rate;
01341
01348 int bit_rate_tolerance;
01349
01355 int flags;
01356
01365 int sub_id;
01366
01374 int me_method;
01375
01387 uint8_t *extradata;
01388 int extradata_size;
01389
01398 AVRational time_base;
01399
01400
01408 int width, height;
01409
01410 #define FF_ASPECT_EXTENDED 15
01411
01417 int gop_size;
01418
01426 enum PixelFormat pix_fmt;
01427
01451 void (*draw_horiz_band)(struct AVCodecContext *s,
01452 const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
01453 int y, int type, int height);
01454
01455
01456 int sample_rate;
01457 int channels;
01458
01464 enum AVSampleFormat sample_fmt;
01465
01466
01470 int frame_size;
01471 int frame_number;
01472
01479 int delay;
01480
01481
01482 float qcompress;
01483 float qblur;
01484
01490 int qmin;
01491
01497 int qmax;
01498
01504 int max_qdiff;
01505
01512 int max_b_frames;
01513
01521 float b_quant_factor;
01522
01524 int rc_strategy;
01525 #define FF_RC_STRATEGY_XVID 1
01526
01527 int b_frame_strategy;
01528
01529 struct AVCodec *codec;
01530
01531 void *priv_data;
01532
01533 int rtp_payload_size;
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01548
01549
01550 int mv_bits;
01551 int header_bits;
01552 int i_tex_bits;
01553 int p_tex_bits;
01554 int i_count;
01555 int p_count;
01556 int skip_count;
01557 int misc_bits;
01558
01564 int frame_bits;
01565
01571 void *opaque;
01572
01573 char codec_name[32];
01574 enum AVMediaType codec_type;
01575 enum CodecID codec_id;
01576
01590 unsigned int codec_tag;
01591
01597 int workaround_bugs;
01598 #define FF_BUG_AUTODETECT 1 ///< autodetection
01599 #define FF_BUG_OLD_MSMPEG4 2
01600 #define FF_BUG_XVID_ILACE 4
01601 #define FF_BUG_UMP4 8
01602 #define FF_BUG_NO_PADDING 16
01603 #define FF_BUG_AMV 32
01604 #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default.
01605 #define FF_BUG_QPEL_CHROMA 64
01606 #define FF_BUG_STD_QPEL 128
01607 #define FF_BUG_QPEL_CHROMA2 256
01608 #define FF_BUG_DIRECT_BLOCKSIZE 512
01609 #define FF_BUG_EDGE 1024
01610 #define FF_BUG_HPEL_CHROMA 2048
01611 #define FF_BUG_DC_CLIP 4096
01612 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
01613 #define FF_BUG_TRUNCATED 16384
01614
01615
01621 int luma_elim_threshold;
01622
01628 int chroma_elim_threshold;
01629
01642 int strict_std_compliance;
01643 #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
01644 #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
01645 #define FF_COMPLIANCE_NORMAL 0
01646 #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
01647 #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
01648
01654 float b_quant_offset;
01655
01656 #if FF_API_ER
01657
01663 attribute_deprecated int error_recognition;
01664 #define FF_ER_CAREFUL 1
01665 #define FF_ER_COMPLIANT 2
01666 #define FF_ER_AGGRESSIVE 3
01667 #define FF_ER_VERY_AGGRESSIVE 4
01668 #define FF_ER_EXPLODE 5
01669 #endif
01670
01726 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01727
01737 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01738
01745 int has_b_frames;
01746
01751 int block_align;
01752
01753 #if FF_API_PARSE_FRAME
01754
01760 attribute_deprecated int parse_only;
01761 #endif
01762
01768 int mpeg_quant;
01769
01775 char *stats_out;
01776
01783 char *stats_in;
01784
01791 float rc_qsquish;
01792
01793 float rc_qmod_amp;
01794 int rc_qmod_freq;
01795
01801 RcOverride *rc_override;
01802 int rc_override_count;
01803
01809 const char *rc_eq;
01810
01816 int rc_max_rate;
01817
01823 int rc_min_rate;
01824
01830 int rc_buffer_size;
01831 float rc_buffer_aggressivity;
01832
01840 float i_quant_factor;
01841
01847 float i_quant_offset;
01848
01854 float rc_initial_cplx;
01855
01861 int dct_algo;
01862 #define FF_DCT_AUTO 0
01863 #define FF_DCT_FASTINT 1
01864 #define FF_DCT_INT 2
01865 #define FF_DCT_MMX 3
01866 #define FF_DCT_MLIB 4
01867 #define FF_DCT_ALTIVEC 5
01868 #define FF_DCT_FAAN 6
01869
01875 float lumi_masking;
01876
01882 float temporal_cplx_masking;
01883
01889 float spatial_cplx_masking;
01890
01896 float p_masking;
01897
01903 float dark_masking;
01904
01910 int idct_algo;
01911 #define FF_IDCT_AUTO 0
01912 #define FF_IDCT_INT 1
01913 #define FF_IDCT_SIMPLE 2
01914 #define FF_IDCT_SIMPLEMMX 3
01915 #define FF_IDCT_LIBMPEG2MMX 4
01916 #define FF_IDCT_PS2 5
01917 #define FF_IDCT_MLIB 6
01918 #define FF_IDCT_ARM 7
01919 #define FF_IDCT_ALTIVEC 8
01920 #define FF_IDCT_SH4 9
01921 #define FF_IDCT_SIMPLEARM 10
01922 #define FF_IDCT_H264 11
01923 #define FF_IDCT_VP3 12
01924 #define FF_IDCT_IPP 13
01925 #define FF_IDCT_XVIDMMX 14
01926 #define FF_IDCT_CAVS 15
01927 #define FF_IDCT_SIMPLEARMV5TE 16
01928 #define FF_IDCT_SIMPLEARMV6 17
01929 #define FF_IDCT_SIMPLEVIS 18
01930 #define FF_IDCT_WMV2 19
01931 #define FF_IDCT_FAAN 20
01932 #define FF_IDCT_EA 21
01933 #define FF_IDCT_SIMPLENEON 22
01934 #define FF_IDCT_SIMPLEALPHA 23
01935 #define FF_IDCT_BINK 24
01936
01942 int slice_count;
01948 int *slice_offset;
01949
01955 int error_concealment;
01956 #define FF_EC_GUESS_MVS 1
01957 #define FF_EC_DEBLOCK 2
01958
01967 unsigned dsp_mask;
01968
01974 int bits_per_coded_sample;
01975
01981 int prediction_method;
01982 #define FF_PRED_LEFT 0
01983 #define FF_PRED_PLANE 1
01984 #define FF_PRED_MEDIAN 2
01985
01993 AVRational sample_aspect_ratio;
01994
02000 AVFrame *coded_frame;
02001
02007 int debug;
02008 #define FF_DEBUG_PICT_INFO 1
02009 #define FF_DEBUG_RC 2
02010 #define FF_DEBUG_BITSTREAM 4
02011 #define FF_DEBUG_MB_TYPE 8
02012 #define FF_DEBUG_QP 16
02013 #define FF_DEBUG_MV 32
02014 #define FF_DEBUG_DCT_COEFF 0x00000040
02015 #define FF_DEBUG_SKIP 0x00000080
02016 #define FF_DEBUG_STARTCODE 0x00000100
02017 #define FF_DEBUG_PTS 0x00000200
02018 #define FF_DEBUG_ER 0x00000400
02019 #define FF_DEBUG_MMCO 0x00000800
02020 #define FF_DEBUG_BUGS 0x00001000
02021 #define FF_DEBUG_VIS_QP 0x00002000
02022 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
02023 #define FF_DEBUG_BUFFERS 0x00008000
02024 #define FF_DEBUG_THREADS 0x00010000
02025
02031 int debug_mv;
02032 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
02033 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
02034 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
02035
02041 uint64_t error[AV_NUM_DATA_POINTERS];
02042
02048 int me_cmp;
02054 int me_sub_cmp;
02060 int mb_cmp;
02066 int ildct_cmp;
02067 #define FF_CMP_SAD 0
02068 #define FF_CMP_SSE 1
02069 #define FF_CMP_SATD 2
02070 #define FF_CMP_DCT 3
02071 #define FF_CMP_PSNR 4
02072 #define FF_CMP_BIT 5
02073 #define FF_CMP_RD 6
02074 #define FF_CMP_ZERO 7
02075 #define FF_CMP_VSAD 8
02076 #define FF_CMP_VSSE 9
02077 #define FF_CMP_NSSE 10
02078 #define FF_CMP_W53 11
02079 #define FF_CMP_W97 12
02080 #define FF_CMP_DCTMAX 13
02081 #define FF_CMP_DCT264 14
02082 #define FF_CMP_CHROMA 256
02083
02089 int dia_size;
02090
02096 int last_predictor_count;
02097
02103 int pre_me;
02104
02110 int me_pre_cmp;
02111
02117 int pre_dia_size;
02118
02124 int me_subpel_quality;
02125
02135 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
02136
02145 int dtg_active_format;
02146 #define FF_DTG_AFD_SAME 8
02147 #define FF_DTG_AFD_4_3 9
02148 #define FF_DTG_AFD_16_9 10
02149 #define FF_DTG_AFD_14_9 11
02150 #define FF_DTG_AFD_4_3_SP_14_9 13
02151 #define FF_DTG_AFD_16_9_SP_14_9 14
02152 #define FF_DTG_AFD_SP_4_3 15
02153
02161 int me_range;
02162
02168 int intra_quant_bias;
02169 #define FF_DEFAULT_QUANT_BIAS 999999
02170
02176 int inter_quant_bias;
02177
02184 int color_table_id;
02185
02186 #if FF_API_INTERNAL_CONTEXT
02187
02192 attribute_deprecated int internal_buffer_count;
02193
02199 attribute_deprecated void *internal_buffer;
02200 #endif
02201
02208 int global_quality;
02209
02210 #define FF_CODER_TYPE_VLC 0
02211 #define FF_CODER_TYPE_AC 1
02212 #define FF_CODER_TYPE_RAW 2
02213 #define FF_CODER_TYPE_RLE 3
02214 #define FF_CODER_TYPE_DEFLATE 4
02215
02220 int coder_type;
02221
02227 int context_model;
02228 #if 0
02229
02234 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
02235 #endif
02236
02242 int slice_flags;
02243 #define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
02244 #define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
02245 #define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
02246
02252 int xvmc_acceleration;
02253
02259 int mb_decision;
02260 #define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
02261 #define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
02262 #define FF_MB_DECISION_RD 2 ///< rate distortion
02263
02269 uint16_t *intra_matrix;
02270
02276 uint16_t *inter_matrix;
02277
02284 unsigned int stream_codec_tag;
02285
02292 int scenechange_threshold;
02293
02299 int lmin;
02300
02306 int lmax;
02307
02308 #if FF_API_PALETTE_CONTROL
02309
02314 struct AVPaletteControl *palctrl;
02315 #endif
02316
02322 int noise_reduction;
02323
02336 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
02337
02343 int rc_initial_buffer_occupancy;
02344
02350 int inter_threshold;
02351
02357 int flags2;
02358
02364 int error_rate;
02365
02366 #if FF_API_ANTIALIAS_ALGO
02367
02372 attribute_deprecated int antialias_algo;
02373 #define FF_AA_AUTO 0
02374 #define FF_AA_FASTINT 1 //not implemented yet
02375 #define FF_AA_INT 2
02376 #define FF_AA_FLOAT 3
02377 #endif
02378
02384 int quantizer_noise_shaping;
02385
02392 int thread_count;
02393
02403 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
02404
02411 void *thread_opaque;
02412
02420 int me_threshold;
02421
02427 int mb_threshold;
02428
02434 int intra_dc_precision;
02435
02441 int nsse_weight;
02442
02448 int skip_top;
02449
02455 int skip_bottom;
02456
02462 int profile;
02463 #define FF_PROFILE_UNKNOWN -99
02464 #define FF_PROFILE_RESERVED -100
02465
02466 #define FF_PROFILE_AAC_MAIN 0
02467 #define FF_PROFILE_AAC_LOW 1
02468 #define FF_PROFILE_AAC_SSR 2
02469 #define FF_PROFILE_AAC_LTP 3
02470
02471 #define FF_PROFILE_DTS 20
02472 #define FF_PROFILE_DTS_ES 30
02473 #define FF_PROFILE_DTS_96_24 40
02474 #define FF_PROFILE_DTS_HD_HRA 50
02475 #define FF_PROFILE_DTS_HD_MA 60
02476
02477 #define FF_PROFILE_MPEG2_422 0
02478 #define FF_PROFILE_MPEG2_HIGH 1
02479 #define FF_PROFILE_MPEG2_SS 2
02480 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
02481 #define FF_PROFILE_MPEG2_MAIN 4
02482 #define FF_PROFILE_MPEG2_SIMPLE 5
02483
02484 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
02485 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
02486
02487 #define FF_PROFILE_H264_BASELINE 66
02488 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
02489 #define FF_PROFILE_H264_MAIN 77
02490 #define FF_PROFILE_H264_EXTENDED 88
02491 #define FF_PROFILE_H264_HIGH 100
02492 #define FF_PROFILE_H264_HIGH_10 110
02493 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
02494 #define FF_PROFILE_H264_HIGH_422 122
02495 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
02496 #define FF_PROFILE_H264_HIGH_444 144
02497 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
02498 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
02499 #define FF_PROFILE_H264_CAVLC_444 44
02500
02501 #define FF_PROFILE_VC1_SIMPLE 0
02502 #define FF_PROFILE_VC1_MAIN 1
02503 #define FF_PROFILE_VC1_COMPLEX 2
02504 #define FF_PROFILE_VC1_ADVANCED 3
02505
02506 #define FF_PROFILE_MPEG4_SIMPLE 0
02507 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
02508 #define FF_PROFILE_MPEG4_CORE 2
02509 #define FF_PROFILE_MPEG4_MAIN 3
02510 #define FF_PROFILE_MPEG4_N_BIT 4
02511 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
02512 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
02513 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
02514 #define FF_PROFILE_MPEG4_HYBRID 8
02515 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
02516 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
02517 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
02518 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
02519 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
02520 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
02521 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
02522
02528 int level;
02529 #define FF_LEVEL_UNKNOWN -99
02530
02536 int lowres;
02537
02543 int coded_width, coded_height;
02544
02550 int frame_skip_threshold;
02551
02557 int frame_skip_factor;
02558
02564 int frame_skip_exp;
02565
02571 int frame_skip_cmp;
02572
02579 float border_masking;
02580
02586 int mb_lmin;
02587
02593 int mb_lmax;
02594
02600 int me_penalty_compensation;
02601
02607 enum AVDiscard skip_loop_filter;
02608
02614 enum AVDiscard skip_idct;
02615
02621 enum AVDiscard skip_frame;
02622
02628 int bidir_refine;
02629
02635 int brd_scale;
02636
02637 #if FF_API_X264_GLOBAL_OPTS
02638
02644 attribute_deprecated float crf;
02645
02652 attribute_deprecated int cqp;
02653 #endif
02654
02660 int keyint_min;
02661
02667 int refs;
02668
02674 int chromaoffset;
02675
02676 #if FF_API_X264_GLOBAL_OPTS
02677
02682 attribute_deprecated int bframebias;
02683 #endif
02684
02690 int trellis;
02691
02692 #if FF_API_X264_GLOBAL_OPTS
02693
02698 attribute_deprecated float complexityblur;
02699
02706 attribute_deprecated int deblockalpha;
02707
02714 attribute_deprecated int deblockbeta;
02715
02721 attribute_deprecated int partitions;
02722 #define X264_PART_I4X4 0x001
02723 #define X264_PART_I8X8 0x002
02724 #define X264_PART_P8X8 0x010
02725 #define X264_PART_P4X4 0x020
02726 #define X264_PART_B8X8 0x100
02727
02733 attribute_deprecated int directpred;
02734 #endif
02735
02741 int cutoff;
02742
02748 int scenechange_factor;
02749
02756 int mv0_threshold;
02757
02763 int b_sensitivity;
02764
02769 int compression_level;
02770 #define FF_COMPRESSION_DEFAULT -1
02771
02776 int min_prediction_order;
02777
02782 int max_prediction_order;
02783
02784 #if FF_API_FLAC_GLOBAL_OPTS
02785
02796 attribute_deprecated int lpc_coeff_precision;
02797
02803 attribute_deprecated int prediction_order_method;
02804
02809 attribute_deprecated int min_partition_order;
02810
02815 attribute_deprecated int max_partition_order;
02819 #endif
02820
02826 int64_t timecode_frame_start;
02827
02828 #if FF_API_REQUEST_CHANNELS
02829
02835 int request_channels;
02836 #endif
02837
02838 #if FF_API_DRC_SCALE
02839
02846 attribute_deprecated float drc_scale;
02847 #endif
02848
02856 int64_t reordered_opaque;
02857
02863 int bits_per_raw_sample;
02864
02870 uint64_t channel_layout;
02871
02877 uint64_t request_channel_layout;
02878
02884 float rc_max_available_vbv_use;
02885
02891 float rc_min_vbv_overflow_use;
02892
02898 struct AVHWAccel *hwaccel;
02899
02907 int ticks_per_frame;
02908
02919 void *hwaccel_context;
02920
02926 enum AVColorPrimaries color_primaries;
02927
02933 enum AVColorTransferCharacteristic color_trc;
02934
02940 enum AVColorSpace colorspace;
02941
02947 enum AVColorRange color_range;
02948
02954 enum AVChromaLocation chroma_sample_location;
02955
02974 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
02975
02976 #if FF_API_X264_GLOBAL_OPTS
02977
02985 attribute_deprecated int weighted_p_pred;
02986
02995 attribute_deprecated int aq_mode;
02996
03003 attribute_deprecated float aq_strength;
03004
03011 attribute_deprecated float psy_rd;
03012
03019 attribute_deprecated float psy_trellis;
03020
03027 attribute_deprecated int rc_lookahead;
03028
03036 attribute_deprecated float crf_max;
03037 #endif
03038
03039 int log_level_offset;
03040
03041 #if FF_API_FLAC_GLOBAL_OPTS
03042
03047 attribute_deprecated enum AVLPCType lpc_type;
03048
03054 attribute_deprecated int lpc_passes;
03055 #endif
03056
03064 int slices;
03065
03074 uint8_t *subtitle_header;
03075 int subtitle_header_size;
03076
03084 AVPacket *pkt;
03085
03086 #if FF_API_INTERNAL_CONTEXT
03087
03096 attribute_deprecated int is_copy;
03097 #endif
03098
03107 int thread_type;
03108 #define FF_THREAD_FRAME 1 ///< Decode more than one frame at once
03109 #define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once
03110
03116 int active_thread_type;
03117
03126 int thread_safe_callbacks;
03127
03134 uint64_t vbv_delay;
03135
03141 enum AVAudioServiceType audio_service_type;
03142
03148 enum AVSampleFormat request_sample_fmt;
03149
03155 int err_recognition;
03156 #define AV_EF_CRCCHECK (1<<0)
03157 #define AV_EF_BITSTREAM (1<<1)
03158 #define AV_EF_BUFFER (1<<2)
03159 #define AV_EF_EXPLODE (1<<3)
03160
03167 struct AVCodecInternal *internal;
03168
03173 enum AVFieldOrder field_order;
03174 } AVCodecContext;
03175
03179 typedef struct AVProfile {
03180 int profile;
03181 const char *name;
03182 } AVProfile;
03183
03184 typedef struct AVCodecDefault AVCodecDefault;
03185
03189 typedef struct AVCodec {
03196 const char *name;
03197 enum AVMediaType type;
03198 enum CodecID id;
03199 int priv_data_size;
03200 int (*init)(AVCodecContext *);
03201 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
03202 int (*close)(AVCodecContext *);
03203 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
03208 int capabilities;
03209 struct AVCodec *next;
03214 void (*flush)(AVCodecContext *);
03215 const AVRational *supported_framerates;
03216 const enum PixelFormat *pix_fmts;
03217
03221 const char *long_name;
03222 const int *supported_samplerates;
03223 const enum AVSampleFormat *sample_fmts;
03224 const uint64_t *channel_layouts;
03225 uint8_t max_lowres;
03226 const AVClass *priv_class;
03227 const AVProfile *profiles;
03228
03238 int (*init_thread_copy)(AVCodecContext *);
03246 int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
03252 const AVCodecDefault *defaults;
03253
03257 void (*init_static_data)(struct AVCodec *codec);
03258
03269 int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
03270 int *got_packet_ptr);
03271 } AVCodec;
03272
03276 typedef struct AVHWAccel {
03282 const char *name;
03283
03289 enum AVMediaType type;
03290
03296 enum CodecID id;
03297
03303 enum PixelFormat pix_fmt;
03304
03309 int capabilities;
03310
03311 struct AVHWAccel *next;
03312
03327 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03328
03340 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
03341
03351 int (*end_frame)(AVCodecContext *avctx);
03352
03360 int priv_data_size;
03361 } AVHWAccel;
03362
03367 typedef struct AVPicture {
03368 uint8_t *data[AV_NUM_DATA_POINTERS];
03369 int linesize[AV_NUM_DATA_POINTERS];
03370 } AVPicture;
03371
03372 #define AVPALETTE_SIZE 1024
03373 #define AVPALETTE_COUNT 256
03374 #if FF_API_PALETTE_CONTROL
03375
03383 typedef struct AVPaletteControl {
03384
03385
03386
03387 int palette_changed;
03388
03389
03390
03391
03392
03393 unsigned int palette[AVPALETTE_COUNT];
03394
03395 } AVPaletteControl attribute_deprecated;
03396 #endif
03397
03398 enum AVSubtitleType {
03399 SUBTITLE_NONE,
03400
03401 SUBTITLE_BITMAP,
03402
03407 SUBTITLE_TEXT,
03408
03413 SUBTITLE_ASS,
03414 };
03415
03416 typedef struct AVSubtitleRect {
03417 int x;
03418 int y;
03419 int w;
03420 int h;
03421 int nb_colors;
03422
03427 AVPicture pict;
03428 enum AVSubtitleType type;
03429
03430 char *text;
03431
03437 char *ass;
03438 } AVSubtitleRect;
03439
03440 typedef struct AVSubtitle {
03441 uint16_t format;
03442 uint32_t start_display_time;
03443 uint32_t end_display_time;
03444 unsigned num_rects;
03445 AVSubtitleRect **rects;
03446 int64_t pts;
03447 } AVSubtitle;
03448
03449
03450
03454 attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
03455
03459 void av_destruct_packet(AVPacket *pkt);
03460
03466 void av_init_packet(AVPacket *pkt);
03467
03476 int av_new_packet(AVPacket *pkt, int size);
03477
03484 void av_shrink_packet(AVPacket *pkt, int size);
03485
03492 int av_grow_packet(AVPacket *pkt, int grow_by);
03493
03498 int av_dup_packet(AVPacket *pkt);
03499
03505 void av_free_packet(AVPacket *pkt);
03506
03515 uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03516 int size);
03517
03526 uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
03527 int *size);
03528
03529
03530
03531 struct ReSampleContext;
03532 struct AVResampleContext;
03533
03534 typedef struct ReSampleContext ReSampleContext;
03535
03552 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
03553 int output_rate, int input_rate,
03554 enum AVSampleFormat sample_fmt_out,
03555 enum AVSampleFormat sample_fmt_in,
03556 int filter_length, int log2_phase_count,
03557 int linear, double cutoff);
03558
03559 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
03560
03567 void audio_resample_close(ReSampleContext *s);
03568
03569
03579 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
03580
03590 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
03591
03592
03605 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
03606 void av_resample_close(struct AVResampleContext *c);
03607
03619 int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
03620
03628 void avpicture_free(AVPicture *picture);
03629
03650 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
03651 enum PixelFormat pix_fmt, int width, int height);
03652
03668 int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
03669 unsigned char *dest, int dest_size);
03670
03683 int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
03684 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
03685
03686 #if FF_API_GET_PIX_FMT_NAME
03687
03690 attribute_deprecated
03691 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
03692 #endif
03693
03694 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
03695
03701 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
03702
03710 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
03711
03712 #define FF_LOSS_RESOLUTION 0x0001
03713 #define FF_LOSS_DEPTH 0x0002
03714 #define FF_LOSS_COLORSPACE 0x0004
03715 #define FF_LOSS_ALPHA 0x0008
03716 #define FF_LOSS_COLORQUANT 0x0010
03717 #define FF_LOSS_CHROMA 0x0020
03736 int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
03737 int has_alpha);
03738
03761 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
03762 int has_alpha, int *loss_ptr);
03763
03764 #if FF_API_GET_ALPHA_INFO
03765 #define FF_ALPHA_TRANSP 0x0001
03766 #define FF_ALPHA_SEMI_TRANSP 0x0002
03767
03772 attribute_deprecated
03773 int img_get_alpha_info(const AVPicture *src,
03774 enum PixelFormat pix_fmt, int width, int height);
03775 #endif
03776
03777
03778
03779 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
03780 enum PixelFormat pix_fmt, int width, int height);
03781
03782
03783
03789 AVCodec *av_codec_next(AVCodec *c);
03790
03794 unsigned avcodec_version(void);
03795
03799 const char *avcodec_configuration(void);
03800
03804 const char *avcodec_license(void);
03805
03806 #if FF_API_AVCODEC_INIT
03807
03811 attribute_deprecated
03812 void avcodec_init(void);
03813 #endif
03814
03823 void avcodec_register(AVCodec *codec);
03824
03831 AVCodec *avcodec_find_encoder(enum CodecID id);
03832
03839 AVCodec *avcodec_find_encoder_by_name(const char *name);
03840
03847 AVCodec *avcodec_find_decoder(enum CodecID id);
03848
03855 AVCodec *avcodec_find_decoder_by_name(const char *name);
03856 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
03857
03865 const char *av_get_profile_name(const AVCodec *codec, int profile);
03866
03867 #if FF_API_ALLOC_CONTEXT
03868
03874 attribute_deprecated
03875 void avcodec_get_context_defaults(AVCodecContext *s);
03876
03879 attribute_deprecated
03880 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
03881 #endif
03882
03892 int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
03893
03894 #if FF_API_ALLOC_CONTEXT
03895
03904 attribute_deprecated
03905 AVCodecContext *avcodec_alloc_context(void);
03906
03909 attribute_deprecated
03910 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
03911 #endif
03912
03925 AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
03926
03938 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
03939
03945 void avcodec_get_frame_defaults(AVFrame *pic);
03946
03954 AVFrame *avcodec_alloc_frame(void);
03955
03956 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03957 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03958 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03959
03967 unsigned avcodec_get_edge_width(void);
03977 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03987 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
03988 int linesize_align[AV_NUM_DATA_POINTERS]);
03989
03990 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
03991
03992 #if FF_API_THREAD_INIT
03993
03996 attribute_deprecated
03997 int avcodec_thread_init(AVCodecContext *s, int thread_count);
03998 #endif
03999
04000 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
04001 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
04002
04003
04004 #if FF_API_AVCODEC_OPEN
04005
04034 attribute_deprecated
04035 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
04036 #endif
04037
04074 int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
04075
04076 #if FF_API_OLD_DECODE_AUDIO
04077
04131 attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
04132 int *frame_size_ptr,
04133 AVPacket *avpkt);
04134 #endif
04135
04169 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
04170 int *got_frame_ptr, AVPacket *avpkt);
04171
04213 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
04214 int *got_picture_ptr,
04215 AVPacket *avpkt);
04216
04233 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
04234 int *got_sub_ptr,
04235 AVPacket *avpkt);
04236
04242 void avsubtitle_free(AVSubtitle *sub);
04243
04244 #if FF_API_OLD_ENCODE_AUDIO
04245
04269 int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
04270 uint8_t *buf, int buf_size,
04271 const short *samples);
04272 #endif
04273
04312 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
04313 const AVFrame *frame, int *got_packet_ptr);
04314
04331 int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
04332 enum AVSampleFormat sample_fmt, const uint8_t *buf,
04333 int buf_size, int align);
04334
04347 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
04348 const AVFrame *pict);
04349 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
04350 const AVSubtitle *sub);
04351
04361 int avcodec_close(AVCodecContext *avctx);
04362
04373 void avcodec_register_all(void);
04374
04378 void avcodec_flush_buffers(AVCodecContext *avctx);
04379
04380 void avcodec_default_free_buffers(AVCodecContext *s);
04381
04382
04383
04384 #if FF_API_OLD_FF_PICT_TYPES
04385
04392 attribute_deprecated
04393 char av_get_pict_type_char(int pict_type);
04394 #endif
04395
04402 int av_get_bits_per_sample(enum CodecID codec_id);
04403
04404 #if FF_API_OLD_SAMPLE_FMT
04405
04408 attribute_deprecated
04409 int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt);
04410 #endif
04411
04412
04413 typedef struct AVCodecParserContext {
04414 void *priv_data;
04415 struct AVCodecParser *parser;
04416 int64_t frame_offset;
04417 int64_t cur_offset;
04418
04419 int64_t next_frame_offset;
04420
04421 int pict_type;
04431 int repeat_pict;
04432 int64_t pts;
04433 int64_t dts;
04434
04435
04436 int64_t last_pts;
04437 int64_t last_dts;
04438 int fetch_timestamp;
04439
04440 #define AV_PARSER_PTS_NB 4
04441 int cur_frame_start_index;
04442 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
04443 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
04444 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
04445
04446 int flags;
04447 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
04448 #define PARSER_FLAG_ONCE 0x0002
04449
04450 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
04451
04452 int64_t offset;
04453 int64_t cur_frame_end[AV_PARSER_PTS_NB];
04454
04461 int key_frame;
04462
04480 int64_t convergence_duration;
04481
04482
04492 int dts_sync_point;
04493
04507 int dts_ref_dts_delta;
04508
04521 int pts_dts_delta;
04522
04528 int64_t cur_frame_pos[AV_PARSER_PTS_NB];
04529
04533 int64_t pos;
04534
04538 int64_t last_pos;
04539 } AVCodecParserContext;
04540
04541 typedef struct AVCodecParser {
04542 int codec_ids[5];
04543 int priv_data_size;
04544 int (*parser_init)(AVCodecParserContext *s);
04545 int (*parser_parse)(AVCodecParserContext *s,
04546 AVCodecContext *avctx,
04547 const uint8_t **poutbuf, int *poutbuf_size,
04548 const uint8_t *buf, int buf_size);
04549 void (*parser_close)(AVCodecParserContext *s);
04550 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
04551 struct AVCodecParser *next;
04552 } AVCodecParser;
04553
04554 AVCodecParser *av_parser_next(AVCodecParser *c);
04555
04556 void av_register_codec_parser(AVCodecParser *parser);
04557 AVCodecParserContext *av_parser_init(int codec_id);
04558
04587 int av_parser_parse2(AVCodecParserContext *s,
04588 AVCodecContext *avctx,
04589 uint8_t **poutbuf, int *poutbuf_size,
04590 const uint8_t *buf, int buf_size,
04591 int64_t pts, int64_t dts,
04592 int64_t pos);
04593
04594 int av_parser_change(AVCodecParserContext *s,
04595 AVCodecContext *avctx,
04596 uint8_t **poutbuf, int *poutbuf_size,
04597 const uint8_t *buf, int buf_size, int keyframe);
04598 void av_parser_close(AVCodecParserContext *s);
04599
04600
04601 typedef struct AVBitStreamFilterContext {
04602 void *priv_data;
04603 struct AVBitStreamFilter *filter;
04604 AVCodecParserContext *parser;
04605 struct AVBitStreamFilterContext *next;
04606 } AVBitStreamFilterContext;
04607
04608
04609 typedef struct AVBitStreamFilter {
04610 const char *name;
04611 int priv_data_size;
04612 int (*filter)(AVBitStreamFilterContext *bsfc,
04613 AVCodecContext *avctx, const char *args,
04614 uint8_t **poutbuf, int *poutbuf_size,
04615 const uint8_t *buf, int buf_size, int keyframe);
04616 void (*close)(AVBitStreamFilterContext *bsfc);
04617 struct AVBitStreamFilter *next;
04618 } AVBitStreamFilter;
04619
04620 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
04621 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
04622 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
04623 AVCodecContext *avctx, const char *args,
04624 uint8_t **poutbuf, int *poutbuf_size,
04625 const uint8_t *buf, int buf_size, int keyframe);
04626 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
04627
04628 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
04629
04630
04631
04637 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
04638
04651 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
04652
04656 void av_picture_copy(AVPicture *dst, const AVPicture *src,
04657 enum PixelFormat pix_fmt, int width, int height);
04658
04662 int av_picture_crop(AVPicture *dst, const AVPicture *src,
04663 enum PixelFormat pix_fmt, int top_band, int left_band);
04664
04668 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
04669 int padtop, int padbottom, int padleft, int padright, int *color);
04670
04678 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
04679
04692 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
04693
04702 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
04703
04707 void av_register_hwaccel(AVHWAccel *hwaccel);
04708
04714 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
04715
04716
04720 enum AVLockOp {
04721 AV_LOCK_CREATE,
04722 AV_LOCK_OBTAIN,
04723 AV_LOCK_RELEASE,
04724 AV_LOCK_DESTROY,
04725 };
04726
04740 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
04741
04745 enum AVMediaType avcodec_get_type(enum CodecID codec_id);
04746
04753 const AVClass *avcodec_get_class(void);
04754
04759 int avcodec_is_open(AVCodecContext *s);
04760
04761 #endif