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 20
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 CODEC_ID_XVID,
00129 CODEC_ID_PNG,
00130 CODEC_ID_PPM,
00131 CODEC_ID_PBM,
00132 CODEC_ID_PGM,
00133 CODEC_ID_PGMYUV,
00134 CODEC_ID_PAM,
00135 CODEC_ID_FFVHUFF,
00136 CODEC_ID_RV30,
00137 CODEC_ID_RV40,
00138 CODEC_ID_VC1,
00139 CODEC_ID_WMV3,
00140 CODEC_ID_LOCO,
00141 CODEC_ID_WNV1,
00142 CODEC_ID_AASC,
00143 CODEC_ID_INDEO2,
00144 CODEC_ID_FRAPS,
00145 CODEC_ID_TRUEMOTION2,
00146 CODEC_ID_BMP,
00147 CODEC_ID_CSCD,
00148 CODEC_ID_MMVIDEO,
00149 CODEC_ID_ZMBV,
00150 CODEC_ID_AVS,
00151 CODEC_ID_SMACKVIDEO,
00152 CODEC_ID_NUV,
00153 CODEC_ID_KMVC,
00154 CODEC_ID_FLASHSV,
00155 CODEC_ID_CAVS,
00156 CODEC_ID_JPEG2000,
00157 CODEC_ID_VMNC,
00158 CODEC_ID_VP5,
00159 CODEC_ID_VP6,
00160 CODEC_ID_VP6F,
00161 CODEC_ID_TARGA,
00162 CODEC_ID_DSICINVIDEO,
00163 CODEC_ID_TIERTEXSEQVIDEO,
00164 CODEC_ID_TIFF,
00165 CODEC_ID_GIF,
00166 CODEC_ID_FFH264,
00167 CODEC_ID_DXA,
00168 CODEC_ID_DNXHD,
00169 CODEC_ID_THP,
00170 CODEC_ID_SGI,
00171 CODEC_ID_C93,
00172 CODEC_ID_BETHSOFTVID,
00173 CODEC_ID_PTX,
00174 CODEC_ID_TXD,
00175 CODEC_ID_VP6A,
00176 CODEC_ID_AMV,
00177 CODEC_ID_VB,
00178 CODEC_ID_PCX,
00179 CODEC_ID_SUNRAST,
00180 CODEC_ID_INDEO4,
00181 CODEC_ID_INDEO5,
00182 CODEC_ID_MIMIC,
00183 CODEC_ID_RL2,
00184 CODEC_ID_8SVX_EXP,
00185 CODEC_ID_8SVX_FIB,
00186 CODEC_ID_ESCAPE124,
00187 CODEC_ID_DIRAC,
00188 CODEC_ID_BFI,
00189 CODEC_ID_CMV,
00190 CODEC_ID_MOTIONPIXELS,
00191 CODEC_ID_TGV,
00192 CODEC_ID_TGQ,
00193 CODEC_ID_TQI,
00194
00195
00196 CODEC_ID_PCM_S16LE= 0x10000,
00197 CODEC_ID_PCM_S16BE,
00198 CODEC_ID_PCM_U16LE,
00199 CODEC_ID_PCM_U16BE,
00200 CODEC_ID_PCM_S8,
00201 CODEC_ID_PCM_U8,
00202 CODEC_ID_PCM_MULAW,
00203 CODEC_ID_PCM_ALAW,
00204 CODEC_ID_PCM_S32LE,
00205 CODEC_ID_PCM_S32BE,
00206 CODEC_ID_PCM_U32LE,
00207 CODEC_ID_PCM_U32BE,
00208 CODEC_ID_PCM_S24LE,
00209 CODEC_ID_PCM_S24BE,
00210 CODEC_ID_PCM_U24LE,
00211 CODEC_ID_PCM_U24BE,
00212 CODEC_ID_PCM_S24DAUD,
00213 CODEC_ID_PCM_ZORK,
00214 CODEC_ID_PCM_S16LE_PLANAR,
00215 CODEC_ID_PCM_DVD,
00216 CODEC_ID_PCM_F32BE,
00217 CODEC_ID_PCM_F32LE,
00218 CODEC_ID_PCM_F64BE,
00219 CODEC_ID_PCM_F64LE,
00220
00221
00222 CODEC_ID_ADPCM_IMA_QT= 0x11000,
00223 CODEC_ID_ADPCM_IMA_WAV,
00224 CODEC_ID_ADPCM_IMA_DK3,
00225 CODEC_ID_ADPCM_IMA_DK4,
00226 CODEC_ID_ADPCM_IMA_WS,
00227 CODEC_ID_ADPCM_IMA_SMJPEG,
00228 CODEC_ID_ADPCM_MS,
00229 CODEC_ID_ADPCM_4XM,
00230 CODEC_ID_ADPCM_XA,
00231 CODEC_ID_ADPCM_ADX,
00232 CODEC_ID_ADPCM_EA,
00233 CODEC_ID_ADPCM_G726,
00234 CODEC_ID_ADPCM_CT,
00235 CODEC_ID_ADPCM_SWF,
00236 CODEC_ID_ADPCM_YAMAHA,
00237 CODEC_ID_ADPCM_SBPRO_4,
00238 CODEC_ID_ADPCM_SBPRO_3,
00239 CODEC_ID_ADPCM_SBPRO_2,
00240 CODEC_ID_ADPCM_THP,
00241 CODEC_ID_ADPCM_IMA_AMV,
00242 CODEC_ID_ADPCM_EA_R1,
00243 CODEC_ID_ADPCM_EA_R3,
00244 CODEC_ID_ADPCM_EA_R2,
00245 CODEC_ID_ADPCM_IMA_EA_SEAD,
00246 CODEC_ID_ADPCM_IMA_EA_EACS,
00247 CODEC_ID_ADPCM_EA_XAS,
00248 CODEC_ID_ADPCM_EA_MAXIS_XA,
00249 CODEC_ID_ADPCM_IMA_ISS,
00250
00251
00252 CODEC_ID_AMR_NB= 0x12000,
00253 CODEC_ID_AMR_WB,
00254
00255
00256 CODEC_ID_RA_144= 0x13000,
00257 CODEC_ID_RA_288,
00258
00259
00260 CODEC_ID_ROQ_DPCM= 0x14000,
00261 CODEC_ID_INTERPLAY_DPCM,
00262 CODEC_ID_XAN_DPCM,
00263 CODEC_ID_SOL_DPCM,
00264
00265
00266 CODEC_ID_MP2= 0x15000,
00267 CODEC_ID_MP3,
00268 CODEC_ID_AAC,
00269 CODEC_ID_AC3,
00270 CODEC_ID_DTS,
00271 CODEC_ID_VORBIS,
00272 CODEC_ID_DVAUDIO,
00273 CODEC_ID_WMAV1,
00274 CODEC_ID_WMAV2,
00275 CODEC_ID_MACE3,
00276 CODEC_ID_MACE6,
00277 CODEC_ID_VMDAUDIO,
00278 CODEC_ID_SONIC,
00279 CODEC_ID_SONIC_LS,
00280 CODEC_ID_FLAC,
00281 CODEC_ID_MP3ADU,
00282 CODEC_ID_MP3ON4,
00283 CODEC_ID_SHORTEN,
00284 CODEC_ID_ALAC,
00285 CODEC_ID_WESTWOOD_SND1,
00286 CODEC_ID_GSM,
00287 CODEC_ID_QDM2,
00288 CODEC_ID_COOK,
00289 CODEC_ID_TRUESPEECH,
00290 CODEC_ID_TTA,
00291 CODEC_ID_SMACKAUDIO,
00292 CODEC_ID_QCELP,
00293 CODEC_ID_WAVPACK,
00294 CODEC_ID_DSICINAUDIO,
00295 CODEC_ID_IMC,
00296 CODEC_ID_MUSEPACK7,
00297 CODEC_ID_MLP,
00298 CODEC_ID_GSM_MS,
00299 CODEC_ID_ATRAC3,
00300 CODEC_ID_VOXWARE,
00301 CODEC_ID_APE,
00302 CODEC_ID_NELLYMOSER,
00303 CODEC_ID_MUSEPACK8,
00304 CODEC_ID_SPEEX,
00305 CODEC_ID_WMAVOICE,
00306 CODEC_ID_WMAPRO,
00307 CODEC_ID_WMALOSSLESS,
00308 CODEC_ID_ATRAC3P,
00309 CODEC_ID_EAC3,
00310 CODEC_ID_SIPR,
00311 CODEC_ID_MP1,
00312
00313
00314 CODEC_ID_DVD_SUBTITLE= 0x17000,
00315 CODEC_ID_DVB_SUBTITLE,
00316 CODEC_ID_TEXT,
00317 CODEC_ID_XSUB,
00318 CODEC_ID_SSA,
00319 CODEC_ID_MOV_TEXT,
00320
00321
00322 CODEC_ID_TTF= 0x18000,
00323
00324 CODEC_ID_PROBE= 0x19000,
00325
00326 CODEC_ID_MPEG2TS= 0x20000,
00328 };
00329
00330 enum CodecType {
00331 CODEC_TYPE_UNKNOWN = -1,
00332 CODEC_TYPE_VIDEO,
00333 CODEC_TYPE_AUDIO,
00334 CODEC_TYPE_DATA,
00335 CODEC_TYPE_SUBTITLE,
00336 CODEC_TYPE_ATTACHMENT,
00337 CODEC_TYPE_NB
00338 };
00339
00343 enum SampleFormat {
00344 SAMPLE_FMT_NONE = -1,
00345 SAMPLE_FMT_U8,
00346 SAMPLE_FMT_S16,
00347 SAMPLE_FMT_S32,
00348 SAMPLE_FMT_FLT,
00349 SAMPLE_FMT_DBL,
00350 SAMPLE_FMT_NB
00351 };
00352
00353
00354 #define CH_FRONT_LEFT 0x00000001
00355 #define CH_FRONT_RIGHT 0x00000002
00356 #define CH_FRONT_CENTER 0x00000004
00357 #define CH_LOW_FREQUENCY 0x00000008
00358 #define CH_BACK_LEFT 0x00000010
00359 #define CH_BACK_RIGHT 0x00000020
00360 #define CH_FRONT_LEFT_OF_CENTER 0x00000040
00361 #define CH_FRONT_RIGHT_OF_CENTER 0x00000080
00362 #define CH_BACK_CENTER 0x00000100
00363 #define CH_SIDE_LEFT 0x00000200
00364 #define CH_SIDE_RIGHT 0x00000400
00365 #define CH_TOP_CENTER 0x00000800
00366 #define CH_TOP_FRONT_LEFT 0x00001000
00367 #define CH_TOP_FRONT_CENTER 0x00002000
00368 #define CH_TOP_FRONT_RIGHT 0x00004000
00369 #define CH_TOP_BACK_LEFT 0x00008000
00370 #define CH_TOP_BACK_CENTER 0x00010000
00371 #define CH_TOP_BACK_RIGHT 0x00020000
00372 #define CH_STEREO_LEFT 0x20000000
00373 #define CH_STEREO_RIGHT 0x40000000
00374
00375
00376 #define CH_LAYOUT_MONO (CH_FRONT_CENTER)
00377 #define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
00378 #define CH_LAYOUT_SURROUND (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
00379 #define CH_LAYOUT_QUAD (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
00380 #define CH_LAYOUT_5POINT0 (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
00381 #define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
00382 #define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
00383 #define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_SURROUND|CH_LOW_FREQUENCY|\
00384 CH_BACK_LEFT|CH_BACK_RIGHT|\
00385 CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
00386 #define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT)
00387
00388
00389 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00390
00398 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00399
00404 #define FF_MIN_BUFFER_SIZE 16384
00405
00406
00410 enum Motion_Est_ID {
00411 ME_ZERO = 1,
00412 ME_FULL,
00413 ME_LOG,
00414 ME_PHODS,
00415 ME_EPZS,
00416 ME_X1,
00417 ME_HEX,
00418 ME_UMH,
00419 ME_ITER,
00420 ME_TESA,
00421 };
00422
00423 enum AVDiscard{
00424
00425
00426 AVDISCARD_NONE =-16,
00427 AVDISCARD_DEFAULT= 0,
00428 AVDISCARD_NONREF = 8,
00429 AVDISCARD_BIDIR = 16,
00430 AVDISCARD_NONKEY = 32,
00431 AVDISCARD_ALL = 48,
00432 };
00433
00434 typedef struct RcOverride{
00435 int start_frame;
00436 int end_frame;
00437 int qscale;
00438 float quality_factor;
00439 } RcOverride;
00440
00441 #define FF_MAX_B_FRAMES 16
00442
00443
00444
00445
00446
00447
00448 #define CODEC_FLAG_QSCALE 0x0002
00449 #define CODEC_FLAG_4MV 0x0004
00450 #define CODEC_FLAG_QPEL 0x0010
00451 #define CODEC_FLAG_GMC 0x0020
00452 #define CODEC_FLAG_MV0 0x0040
00453 #define CODEC_FLAG_PART 0x0080
00454
00459 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00460 #define CODEC_FLAG_PASS1 0x0200
00461 #define CODEC_FLAG_PASS2 0x0400
00462 #define CODEC_FLAG_EXTERN_HUFF 0x1000
00463 #define CODEC_FLAG_GRAY 0x2000
00464 #define CODEC_FLAG_EMU_EDGE 0x4000
00465 #define CODEC_FLAG_PSNR 0x8000
00466 #define CODEC_FLAG_TRUNCATED 0x00010000
00468 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00469 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00470 #define CODEC_FLAG_LOW_DELAY 0x00080000
00471 #define CODEC_FLAG_ALT_SCAN 0x00100000
00472 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00473 #define CODEC_FLAG_BITEXACT 0x00800000
00474
00475 #define CODEC_FLAG_AC_PRED 0x01000000
00476 #define CODEC_FLAG_H263P_UMV 0x02000000
00477 #define CODEC_FLAG_CBP_RD 0x04000000
00478 #define CODEC_FLAG_QP_RD 0x08000000
00479 #define CODEC_FLAG_H263P_AIV 0x00000008
00480 #define CODEC_FLAG_OBMC 0x00000001
00481 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00482 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00483 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00484 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000
00485 #define CODEC_FLAG_CLOSED_GOP 0x80000000
00486 #define CODEC_FLAG2_FAST 0x00000001
00487 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00488 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00489 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00490 #define CODEC_FLAG2_BPYRAMID 0x00000010
00491 #define CODEC_FLAG2_WPRED 0x00000020
00492 #define CODEC_FLAG2_MIXED_REFS 0x00000040
00493 #define CODEC_FLAG2_8X8DCT 0x00000080
00494 #define CODEC_FLAG2_FASTPSKIP 0x00000100
00495 #define CODEC_FLAG2_AUD 0x00000200
00496 #define CODEC_FLAG2_BRDO 0x00000400
00497 #define CODEC_FLAG2_INTRA_VLC 0x00000800
00498 #define CODEC_FLAG2_MEMC_ONLY 0x00001000
00499 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00500 #define CODEC_FLAG2_SKIP_RD 0x00004000
00501 #define CODEC_FLAG2_CHUNKS 0x00008000
00502 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000
00503 #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000
00504
00505
00506
00507
00508
00509
00510
00511
00512 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00513
00517 #define CODEC_CAP_DR1 0x0002
00518
00519 #define CODEC_CAP_PARSE_ONLY 0x0004
00520 #define CODEC_CAP_TRUNCATED 0x0008
00521
00522 #define CODEC_CAP_HWACCEL 0x0010
00523
00527 #define CODEC_CAP_DELAY 0x0020
00528
00532 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00533
00536 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
00537
00538
00539 #define MB_TYPE_INTRA4x4 0x0001
00540 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00541 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00542 #define MB_TYPE_16x16 0x0008
00543 #define MB_TYPE_16x8 0x0010
00544 #define MB_TYPE_8x16 0x0020
00545 #define MB_TYPE_8x8 0x0040
00546 #define MB_TYPE_INTERLACED 0x0080
00547 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00548 #define MB_TYPE_ACPRED 0x0200
00549 #define MB_TYPE_GMC 0x0400
00550 #define MB_TYPE_SKIP 0x0800
00551 #define MB_TYPE_P0L0 0x1000
00552 #define MB_TYPE_P1L0 0x2000
00553 #define MB_TYPE_P0L1 0x4000
00554 #define MB_TYPE_P1L1 0x8000
00555 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00556 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00557 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00558 #define MB_TYPE_QUANT 0x00010000
00559 #define MB_TYPE_CBP 0x00020000
00560
00561
00567 typedef struct AVPanScan{
00573 int id;
00574
00580 int width;
00581 int height;
00582
00588 int16_t position[3][2];
00589 }AVPanScan;
00590
00591 #define FF_COMMON_FRAME \
00592 \
00598 uint8_t *data[4];\
00599 int linesize[4];\
00600 \
00606 uint8_t *base[4];\
00607 \
00612 int key_frame;\
00613 \
00614 \
00619 int pict_type;\
00620 \
00621 \
00627 int64_t pts;\
00628 \
00629 \
00634 int coded_picture_number;\
00635 \
00640 int display_picture_number;\
00641 \
00642 \
00647 int quality; \
00648 \
00649 \
00655 int age;\
00656 \
00657 \
00665 int reference;\
00666 \
00667 \
00672 int8_t *qscale_table;\
00673 \
00678 int qstride;\
00679 \
00680 \
00686 uint8_t *mbskip_table;\
00687 \
00688 \
00700 int16_t (*motion_val[2])[2];\
00701 \
00702 \
00708 uint32_t *mb_type;\
00709 \
00710 \
00716 uint8_t motion_subsample_log2;\
00717 \
00718 \
00723 void *opaque;\
00724 \
00725 \
00730 uint64_t error[4];\
00731 \
00732 \
00738 int type;\
00739 \
00740 \
00746 int repeat_pict;\
00747 \
00748 \
00751 int qscale_type;\
00752 \
00753 \
00758 int interlaced_frame;\
00759 \
00760 \
00765 int top_field_first;\
00766 \
00767 \
00772 AVPanScan *pan_scan;\
00773 \
00774 \
00779 int palette_has_changed;\
00780 \
00781 \
00786 int buffer_hints;\
00787 \
00788 \
00793 short *dct_coeff;\
00794 \
00795 \
00800 int8_t *ref_index[2];\
00801 \
00802 \
00808 int64_t reordered_opaque;\
00809
00810
00811 #define FF_QSCALE_TYPE_MPEG1 0
00812 #define FF_QSCALE_TYPE_MPEG2 1
00813 #define FF_QSCALE_TYPE_H264 2
00814
00815 #define FF_BUFFER_TYPE_INTERNAL 1
00816 #define FF_BUFFER_TYPE_USER 2
00817 #define FF_BUFFER_TYPE_SHARED 4
00818 #define FF_BUFFER_TYPE_COPY 8
00819
00820
00821 #define FF_I_TYPE 1
00822 #define FF_P_TYPE 2
00823 #define FF_B_TYPE 3
00824 #define FF_S_TYPE 4
00825 #define FF_SI_TYPE 5
00826 #define FF_SP_TYPE 6
00827 #define FF_BI_TYPE 7
00828
00829 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
00830 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00831 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00832 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00833
00843 typedef struct AVFrame {
00844 FF_COMMON_FRAME
00845 } AVFrame;
00846
00854 typedef struct AVCodecContext {
00859 const AVClass *av_class;
00865 int bit_rate;
00866
00873 int bit_rate_tolerance;
00874
00880 int flags;
00881
00890 int sub_id;
00891
00899 int me_method;
00900
00912 uint8_t *extradata;
00913 int extradata_size;
00914
00923 AVRational time_base;
00924
00925
00933 int width, height;
00934
00935 #define FF_ASPECT_EXTENDED 15
00936
00942 int gop_size;
00943
00949 enum PixelFormat pix_fmt;
00950
00957 int rate_emu;
00958
00978 void (*draw_horiz_band)(struct AVCodecContext *s,
00979 const AVFrame *src, int offset[4],
00980 int y, int type, int height);
00981
00982
00983 int sample_rate;
00984 int channels;
00985
00991 enum SampleFormat sample_fmt;
00992
00993
00997 int frame_size;
00998 int frame_number;
00999 int real_pict_num;
01000
01007 int delay;
01008
01009
01010 float qcompress;
01011 float qblur;
01012
01018 int qmin;
01019
01025 int qmax;
01026
01032 int max_qdiff;
01033
01040 int max_b_frames;
01041
01049 float b_quant_factor;
01050
01052 int rc_strategy;
01053 #define FF_RC_STRATEGY_XVID 1
01054
01055 int b_frame_strategy;
01056
01063 int hurry_up;
01064
01065 struct AVCodec *codec;
01066
01067 void *priv_data;
01068
01069 int rtp_payload_size;
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01084
01085
01086 int mv_bits;
01087 int header_bits;
01088 int i_tex_bits;
01089 int p_tex_bits;
01090 int i_count;
01091 int p_count;
01092 int skip_count;
01093 int misc_bits;
01094
01100 int frame_bits;
01101
01107 void *opaque;
01108
01109 char codec_name[32];
01110 enum CodecType codec_type;
01111 enum CodecID codec_id;
01112
01126 unsigned int codec_tag;
01127
01133 int workaround_bugs;
01134 #define FF_BUG_AUTODETECT 1
01135 #define FF_BUG_OLD_MSMPEG4 2
01136 #define FF_BUG_XVID_ILACE 4
01137 #define FF_BUG_UMP4 8
01138 #define FF_BUG_NO_PADDING 16
01139 #define FF_BUG_AMV 32
01140 #define FF_BUG_AC_VLC 0
01141 #define FF_BUG_QPEL_CHROMA 64
01142 #define FF_BUG_STD_QPEL 128
01143 #define FF_BUG_QPEL_CHROMA2 256
01144 #define FF_BUG_DIRECT_BLOCKSIZE 512
01145 #define FF_BUG_EDGE 1024
01146 #define FF_BUG_HPEL_CHROMA 2048
01147 #define FF_BUG_DC_CLIP 4096
01148 #define FF_BUG_MS 8192
01149 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
01150
01156 int luma_elim_threshold;
01157
01163 int chroma_elim_threshold;
01164
01177 int strict_std_compliance;
01178 #define FF_COMPLIANCE_VERY_STRICT 2
01179 #define FF_COMPLIANCE_STRICT 1
01180 #define FF_COMPLIANCE_NORMAL 0
01181 #define FF_COMPLIANCE_INOFFICIAL -1
01182 #define FF_COMPLIANCE_EXPERIMENTAL -2
01183
01184
01189 float b_quant_offset;
01190
01197 int error_recognition;
01198 #define FF_ER_CAREFUL 1
01199 #define FF_ER_COMPLIANT 2
01200 #define FF_ER_AGGRESSIVE 3
01201 #define FF_ER_VERY_AGGRESSIVE 4
01202
01211 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01212
01220 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01221
01228 int has_b_frames;
01229
01234 int block_align;
01235
01236 int parse_only;
01237
01238
01239
01245 int mpeg_quant;
01246
01252 char *stats_out;
01253
01260 char *stats_in;
01261
01268 float rc_qsquish;
01269
01270 float rc_qmod_amp;
01271 int rc_qmod_freq;
01272
01278 RcOverride *rc_override;
01279 int rc_override_count;
01280
01286 const char *rc_eq;
01287
01293 int rc_max_rate;
01294
01300 int rc_min_rate;
01301
01307 int rc_buffer_size;
01308 float rc_buffer_aggressivity;
01309
01317 float i_quant_factor;
01318
01324 float i_quant_offset;
01325
01331 float rc_initial_cplx;
01332
01338 int dct_algo;
01339 #define FF_DCT_AUTO 0
01340 #define FF_DCT_FASTINT 1
01341 #define FF_DCT_INT 2
01342 #define FF_DCT_MMX 3
01343 #define FF_DCT_MLIB 4
01344 #define FF_DCT_ALTIVEC 5
01345 #define FF_DCT_FAAN 6
01346
01352 float lumi_masking;
01353
01359 float temporal_cplx_masking;
01360
01366 float spatial_cplx_masking;
01367
01373 float p_masking;
01374
01380 float dark_masking;
01381
01387 int idct_algo;
01388 #define FF_IDCT_AUTO 0
01389 #define FF_IDCT_INT 1
01390 #define FF_IDCT_SIMPLE 2
01391 #define FF_IDCT_SIMPLEMMX 3
01392 #define FF_IDCT_LIBMPEG2MMX 4
01393 #define FF_IDCT_PS2 5
01394 #define FF_IDCT_MLIB 6
01395 #define FF_IDCT_ARM 7
01396 #define FF_IDCT_ALTIVEC 8
01397 #define FF_IDCT_SH4 9
01398 #define FF_IDCT_SIMPLEARM 10
01399 #define FF_IDCT_H264 11
01400 #define FF_IDCT_VP3 12
01401 #define FF_IDCT_IPP 13
01402 #define FF_IDCT_XVIDMMX 14
01403 #define FF_IDCT_CAVS 15
01404 #define FF_IDCT_SIMPLEARMV5TE 16
01405 #define FF_IDCT_SIMPLEARMV6 17
01406 #define FF_IDCT_SIMPLEVIS 18
01407 #define FF_IDCT_WMV2 19
01408 #define FF_IDCT_FAAN 20
01409 #define FF_IDCT_EA 21
01410 #define FF_IDCT_SIMPLENEON 22
01411 #define FF_IDCT_SIMPLEALPHA 23
01412
01418 int slice_count;
01424 int *slice_offset;
01425
01431 int error_concealment;
01432 #define FF_EC_GUESS_MVS 1
01433 #define FF_EC_DEBLOCK 2
01434
01443 unsigned dsp_mask;
01444 #define FF_MM_FORCE 0x80000000
01445
01446 #define FF_MM_MMX 0x0001
01447 #define FF_MM_3DNOW 0x0004
01448 #define FF_MM_MMXEXT 0x0002
01449 #define FF_MM_SSE 0x0008
01450 #define FF_MM_SSE2 0x0010
01451 #define FF_MM_3DNOWEXT 0x0020
01452 #define FF_MM_SSE3 0x0040
01453 #define FF_MM_SSSE3 0x0080
01454 #define FF_MM_IWMMXT 0x0100
01455 #define FF_MM_ALTIVEC 0x0001
01456
01457
01462 int bits_per_coded_sample;
01463
01469 int prediction_method;
01470 #define FF_PRED_LEFT 0
01471 #define FF_PRED_PLANE 1
01472 #define FF_PRED_MEDIAN 2
01473
01481 AVRational sample_aspect_ratio;
01482
01488 AVFrame *coded_frame;
01489
01495 int debug;
01496 #define FF_DEBUG_PICT_INFO 1
01497 #define FF_DEBUG_RC 2
01498 #define FF_DEBUG_BITSTREAM 4
01499 #define FF_DEBUG_MB_TYPE 8
01500 #define FF_DEBUG_QP 16
01501 #define FF_DEBUG_MV 32
01502 #define FF_DEBUG_DCT_COEFF 0x00000040
01503 #define FF_DEBUG_SKIP 0x00000080
01504 #define FF_DEBUG_STARTCODE 0x00000100
01505 #define FF_DEBUG_PTS 0x00000200
01506 #define FF_DEBUG_ER 0x00000400
01507 #define FF_DEBUG_MMCO 0x00000800
01508 #define FF_DEBUG_BUGS 0x00001000
01509 #define FF_DEBUG_VIS_QP 0x00002000
01510 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01511 #define FF_DEBUG_BUFFERS 0x00008000
01512
01518 int debug_mv;
01519 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
01520 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
01521 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01522
01528 uint64_t error[4];
01529
01535 int mb_qmin;
01536
01542 int mb_qmax;
01543
01549 int me_cmp;
01555 int me_sub_cmp;
01561 int mb_cmp;
01567 int ildct_cmp;
01568 #define FF_CMP_SAD 0
01569 #define FF_CMP_SSE 1
01570 #define FF_CMP_SATD 2
01571 #define FF_CMP_DCT 3
01572 #define FF_CMP_PSNR 4
01573 #define FF_CMP_BIT 5
01574 #define FF_CMP_RD 6
01575 #define FF_CMP_ZERO 7
01576 #define FF_CMP_VSAD 8
01577 #define FF_CMP_VSSE 9
01578 #define FF_CMP_NSSE 10
01579 #define FF_CMP_W53 11
01580 #define FF_CMP_W97 12
01581 #define FF_CMP_DCTMAX 13
01582 #define FF_CMP_DCT264 14
01583 #define FF_CMP_CHROMA 256
01584
01590 int dia_size;
01591
01597 int last_predictor_count;
01598
01604 int pre_me;
01605
01611 int me_pre_cmp;
01612
01618 int pre_dia_size;
01619
01625 int me_subpel_quality;
01626
01636 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01637
01646 int dtg_active_format;
01647 #define FF_DTG_AFD_SAME 8
01648 #define FF_DTG_AFD_4_3 9
01649 #define FF_DTG_AFD_16_9 10
01650 #define FF_DTG_AFD_14_9 11
01651 #define FF_DTG_AFD_4_3_SP_14_9 13
01652 #define FF_DTG_AFD_16_9_SP_14_9 14
01653 #define FF_DTG_AFD_SP_4_3 15
01654
01662 int me_range;
01663
01669 int intra_quant_bias;
01670 #define FF_DEFAULT_QUANT_BIAS 999999
01671
01677 int inter_quant_bias;
01678
01685 int color_table_id;
01686
01691 int internal_buffer_count;
01692
01697 void *internal_buffer;
01698
01699 #define FF_LAMBDA_SHIFT 7
01700 #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01701 #define FF_QP2LAMBDA 118
01702 #define FF_LAMBDA_MAX (256*128-1)
01703
01704 #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01705
01711 int global_quality;
01712
01713 #define FF_CODER_TYPE_VLC 0
01714 #define FF_CODER_TYPE_AC 1
01715 #define FF_CODER_TYPE_RAW 2
01716 #define FF_CODER_TYPE_RLE 3
01717 #define FF_CODER_TYPE_DEFLATE 4
01718
01723 int coder_type;
01724
01730 int context_model;
01731 #if 0
01732
01737 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01738 #endif
01739
01745 int slice_flags;
01746 #define SLICE_FLAG_CODED_ORDER 0x0001
01747 #define SLICE_FLAG_ALLOW_FIELD 0x0002
01748 #define SLICE_FLAG_ALLOW_PLANE 0x0004
01749
01750
01755 int xvmc_acceleration;
01756
01762 int mb_decision;
01763 #define FF_MB_DECISION_SIMPLE 0
01764 #define FF_MB_DECISION_BITS 1
01765 #define FF_MB_DECISION_RD 2
01766
01767
01772 uint16_t *intra_matrix;
01773
01779 uint16_t *inter_matrix;
01780
01787 unsigned int stream_codec_tag;
01788
01795 int scenechange_threshold;
01796
01802 int lmin;
01803
01809 int lmax;
01810
01816 struct AVPaletteControl *palctrl;
01817
01823 int noise_reduction;
01824
01834 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
01835
01841 int rc_initial_buffer_occupancy;
01842
01848 int inter_threshold;
01849
01855 int flags2;
01856
01862 int error_rate;
01863
01869 int antialias_algo;
01870 #define FF_AA_AUTO 0
01871 #define FF_AA_FASTINT 1 //not implemented yet
01872 #define FF_AA_INT 2
01873 #define FF_AA_FLOAT 3
01874
01879 int quantizer_noise_shaping;
01880
01887 int thread_count;
01888
01898 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
01899
01906 void *thread_opaque;
01907
01915 int me_threshold;
01916
01922 int mb_threshold;
01923
01929 int intra_dc_precision;
01930
01936 int nsse_weight;
01937
01943 int skip_top;
01944
01950 int skip_bottom;
01951
01957 int profile;
01958 #define FF_PROFILE_UNKNOWN -99
01959 #define FF_PROFILE_AAC_MAIN 0
01960 #define FF_PROFILE_AAC_LOW 1
01961 #define FF_PROFILE_AAC_SSR 2
01962 #define FF_PROFILE_AAC_LTP 3
01963
01969 int level;
01970 #define FF_LEVEL_UNKNOWN -99
01971
01977 int lowres;
01978
01985 int coded_width, coded_height;
01986
01992 int frame_skip_threshold;
01993
01999 int frame_skip_factor;
02000
02006 int frame_skip_exp;
02007
02013 int frame_skip_cmp;
02014
02021 float border_masking;
02022
02028 int mb_lmin;
02029
02035 int mb_lmax;
02036
02042 int me_penalty_compensation;
02043
02049 enum AVDiscard skip_loop_filter;
02050
02056 enum AVDiscard skip_idct;
02057
02063 enum AVDiscard skip_frame;
02064
02070 int bidir_refine;
02071
02077 int brd_scale;
02078
02084 float crf;
02085
02091 int cqp;
02092
02098 int keyint_min;
02099
02105 int refs;
02106
02112 int chromaoffset;
02113
02119 int bframebias;
02120
02126 int trellis;
02127
02133 float complexityblur;
02134
02141 int deblockalpha;
02142
02149 int deblockbeta;
02150
02156 int partitions;
02157 #define X264_PART_I4X4 0x001
02158 #define X264_PART_I8X8 0x002
02159 #define X264_PART_P8X8 0x010
02160 #define X264_PART_P4X4 0x020
02161 #define X264_PART_B8X8 0x100
02162
02168 int directpred;
02169
02175 int cutoff;
02176
02182 int scenechange_factor;
02183
02190 int mv0_threshold;
02191
02197 int b_sensitivity;
02198
02203 int compression_level;
02204 #define FF_COMPRESSION_DEFAULT -1
02205
02211 int use_lpc;
02212
02218 int lpc_coeff_precision;
02219
02224 int min_prediction_order;
02225
02230 int max_prediction_order;
02231
02237 int prediction_order_method;
02238
02243 int min_partition_order;
02244
02249 int max_partition_order;
02250
02256 int64_t timecode_frame_start;
02257
02258 #if LIBAVCODEC_VERSION_MAJOR < 53
02259
02265 int request_channels;
02266 #endif
02267
02274 float drc_scale;
02275
02282 int64_t reordered_opaque;
02283
02290 int bits_per_raw_sample;
02291
02297 int64_t channel_layout;
02298
02304 int64_t request_channel_layout;
02305
02311 float rc_max_available_vbv_use;
02312
02318 float rc_min_vbv_overflow_use;
02319
02325 struct AVHWAccel *hwaccel;
02326
02334 int ticks_per_frame;
02335 } AVCodecContext;
02336
02340 typedef struct AVCodec {
02347 const char *name;
02348 enum CodecType type;
02349 enum CodecID id;
02350 int priv_data_size;
02351 int (*init)(AVCodecContext *);
02352 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02353 int (*close)(AVCodecContext *);
02354 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
02355 const uint8_t *buf, int buf_size);
02360 int capabilities;
02361 struct AVCodec *next;
02366 void (*flush)(AVCodecContext *);
02367 const AVRational *supported_framerates;
02368 const enum PixelFormat *pix_fmts;
02369
02373 const char *long_name;
02374 const int *supported_samplerates;
02375 const enum SampleFormat *sample_fmts;
02376 const int64_t *channel_layouts;
02377 } AVCodec;
02378
02382 typedef struct AVHWAccel {
02388 const char *name;
02389
02395 enum CodecType type;
02396
02402 enum CodecID id;
02403
02409 enum PixelFormat pix_fmt;
02410
02415 int capabilities;
02416
02417 struct AVHWAccel *next;
02418
02433 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02434
02446 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02447
02457 int (*end_frame)(AVCodecContext *avctx);
02458 } AVHWAccel;
02459
02464 typedef struct AVPicture {
02465 uint8_t *data[4];
02466 int linesize[4];
02467 } AVPicture;
02468
02477 #define AVPALETTE_SIZE 1024
02478 #define AVPALETTE_COUNT 256
02479 typedef struct AVPaletteControl {
02480
02481
02482
02483 int palette_changed;
02484
02485
02486
02487
02488
02489 unsigned int palette[AVPALETTE_COUNT];
02490
02491 } AVPaletteControl attribute_deprecated;
02492
02493 enum AVSubtitleType {
02494 SUBTITLE_NONE,
02495
02496 SUBTITLE_BITMAP,
02497
02502 SUBTITLE_TEXT,
02503
02508 SUBTITLE_ASS,
02509 };
02510
02511 typedef struct AVSubtitleRect {
02512 int x;
02513 int y;
02514 int w;
02515 int h;
02516 int nb_colors;
02517
02522 AVPicture pict;
02523 enum AVSubtitleType type;
02524
02525 char *text;
02526
02532 char *ass;
02533 } AVSubtitleRect;
02534
02535 typedef struct AVSubtitle {
02536 uint16_t format;
02537 uint32_t start_display_time;
02538 uint32_t end_display_time;
02539 unsigned num_rects;
02540 AVSubtitleRect **rects;
02541 } AVSubtitle;
02542
02543
02544
02545
02546 struct ReSampleContext;
02547 struct AVResampleContext;
02548
02549 typedef struct ReSampleContext ReSampleContext;
02550
02551 #if LIBAVCODEC_VERSION_MAJOR < 53
02552
02555 attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02556 int output_rate, int input_rate);
02557 #endif
02558
02574 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
02575 int output_rate, int input_rate,
02576 enum SampleFormat sample_fmt_out,
02577 enum SampleFormat sample_fmt_in,
02578 int filter_length, int log2_phase_count,
02579 int linear, double cutoff);
02580
02581 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02582 void audio_resample_close(ReSampleContext *s);
02583
02584
02594 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02595
02605 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02606
02607
02620 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
02621 void av_resample_close(struct AVResampleContext *c);
02622
02632 int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
02633
02639 void avpicture_free(AVPicture *picture);
02640
02657 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
02658 int pix_fmt, int width, int height);
02659 int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
02660 unsigned char *dest, int dest_size);
02661
02671 int avpicture_get_size(int pix_fmt, int width, int height);
02672 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
02673 const char *avcodec_get_pix_fmt_name(int pix_fmt);
02674 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
02675 enum PixelFormat avcodec_get_pix_fmt(const char* name);
02676 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
02677
02678 #define FF_LOSS_RESOLUTION 0x0001
02679 #define FF_LOSS_DEPTH 0x0002
02680 #define FF_LOSS_COLORSPACE 0x0004
02681 #define FF_LOSS_ALPHA 0x0008
02682 #define FF_LOSS_COLORQUANT 0x0010
02683 #define FF_LOSS_CHROMA 0x0020
02702 int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
02703 int has_alpha);
02704
02727 int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
02728 int has_alpha, int *loss_ptr);
02729
02730
02741 void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
02742
02743 #define FF_ALPHA_TRANSP 0x0001
02744 #define FF_ALPHA_SEMI_TRANSP 0x0002
02745
02750 int img_get_alpha_info(const AVPicture *src,
02751 int pix_fmt, int width, int height);
02752
02753
02754
02755 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
02756 int pix_fmt, int width, int height);
02757
02758
02759
02765 AVCodec *av_codec_next(AVCodec *c);
02766
02770 unsigned avcodec_version(void);
02771
02778 void avcodec_init(void);
02779
02780 #if LIBAVCODEC_VERSION_MAJOR < 53
02781
02784 attribute_deprecated void register_avcodec(AVCodec *codec);
02785 #endif
02786
02792 void avcodec_register(AVCodec *codec);
02793
02800 AVCodec *avcodec_find_encoder(enum CodecID id);
02801
02808 AVCodec *avcodec_find_encoder_by_name(const char *name);
02809
02816 AVCodec *avcodec_find_decoder(enum CodecID id);
02817
02824 AVCodec *avcodec_find_decoder_by_name(const char *name);
02825 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
02826
02832 void avcodec_get_context_defaults(AVCodecContext *s);
02833
02836 void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
02837
02845 AVCodecContext *avcodec_alloc_context(void);
02846
02849 AVCodecContext *avcodec_alloc_context2(enum CodecType);
02850
02856 void avcodec_get_frame_defaults(AVFrame *pic);
02857
02865 AVFrame *avcodec_alloc_frame(void);
02866
02867 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
02868 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
02869 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
02870 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
02871
02880 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
02881 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
02882
02883 int avcodec_thread_init(AVCodecContext *s, int thread_count);
02884 void avcodec_thread_free(AVCodecContext *s);
02885 int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
02886 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
02887
02888
02916 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
02917
02954 int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
02955 int *frame_size_ptr,
02956 const uint8_t *buf, int buf_size);
02957
02992 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
02993 int *got_picture_ptr,
02994 const uint8_t *buf, int buf_size);
02995
02996
02997
02998
02999 int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
03000 int *got_sub_ptr,
03001 const uint8_t *buf, int buf_size);
03002 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
03003 int *data_size_ptr,
03004 uint8_t *buf, int buf_size);
03005
03026 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03027 const short *samples);
03028
03044 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03045 const AVFrame *pict);
03046 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03047 const AVSubtitle *sub);
03048
03049 int avcodec_close(AVCodecContext *avctx);
03050
03061 void avcodec_register_all(void);
03062
03066 void avcodec_flush_buffers(AVCodecContext *avctx);
03067
03068 void avcodec_default_free_buffers(AVCodecContext *s);
03069
03070
03071
03078 char av_get_pict_type_char(int pict_type);
03079
03086 int av_get_bits_per_sample(enum CodecID codec_id);
03087
03094 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
03095
03096
03097 typedef struct AVCodecParserContext {
03098 void *priv_data;
03099 struct AVCodecParser *parser;
03100 int64_t frame_offset;
03101 int64_t cur_offset;
03102
03103 int64_t next_frame_offset;
03104
03105 int pict_type;
03115 int repeat_pict;
03116 int64_t pts;
03117 int64_t dts;
03118
03119
03120 int64_t last_pts;
03121 int64_t last_dts;
03122 int fetch_timestamp;
03123
03124 #define AV_PARSER_PTS_NB 4
03125 int cur_frame_start_index;
03126 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03127 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03128 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03129
03130 int flags;
03131 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
03132
03133 int64_t offset;
03134 int64_t cur_frame_end[AV_PARSER_PTS_NB];
03135
03142 int key_frame;
03143
03159 int64_t convergence_duration;
03160
03161
03171 int dts_sync_point;
03172
03186 int dts_ref_dts_delta;
03187
03200 int pts_dts_delta;
03201 } AVCodecParserContext;
03202
03203 typedef struct AVCodecParser {
03204 int codec_ids[5];
03205 int priv_data_size;
03206 int (*parser_init)(AVCodecParserContext *s);
03207 int (*parser_parse)(AVCodecParserContext *s,
03208 AVCodecContext *avctx,
03209 const uint8_t **poutbuf, int *poutbuf_size,
03210 const uint8_t *buf, int buf_size);
03211 void (*parser_close)(AVCodecParserContext *s);
03212 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
03213 struct AVCodecParser *next;
03214 } AVCodecParser;
03215
03216 AVCodecParser *av_parser_next(AVCodecParser *c);
03217
03218 void av_register_codec_parser(AVCodecParser *parser);
03219 AVCodecParserContext *av_parser_init(int codec_id);
03220 int av_parser_parse(AVCodecParserContext *s,
03221 AVCodecContext *avctx,
03222 uint8_t **poutbuf, int *poutbuf_size,
03223 const uint8_t *buf, int buf_size,
03224 int64_t pts, int64_t dts);
03225 int av_parser_change(AVCodecParserContext *s,
03226 AVCodecContext *avctx,
03227 uint8_t **poutbuf, int *poutbuf_size,
03228 const uint8_t *buf, int buf_size, int keyframe);
03229 void av_parser_close(AVCodecParserContext *s);
03230
03231
03232 typedef struct AVBitStreamFilterContext {
03233 void *priv_data;
03234 struct AVBitStreamFilter *filter;
03235 AVCodecParserContext *parser;
03236 struct AVBitStreamFilterContext *next;
03237 } AVBitStreamFilterContext;
03238
03239
03240 typedef struct AVBitStreamFilter {
03241 const char *name;
03242 int priv_data_size;
03243 int (*filter)(AVBitStreamFilterContext *bsfc,
03244 AVCodecContext *avctx, const char *args,
03245 uint8_t **poutbuf, int *poutbuf_size,
03246 const uint8_t *buf, int buf_size, int keyframe);
03247 void (*close)(AVBitStreamFilterContext *bsfc);
03248 struct AVBitStreamFilter *next;
03249 } AVBitStreamFilter;
03250
03251 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
03252 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
03253 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
03254 AVCodecContext *avctx, const char *args,
03255 uint8_t **poutbuf, int *poutbuf_size,
03256 const uint8_t *buf, int buf_size, int keyframe);
03257 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
03258
03259 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
03260
03261
03262
03269 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
03270
03274 void av_picture_copy(AVPicture *dst, const AVPicture *src,
03275 int pix_fmt, int width, int height);
03276
03280 int av_picture_crop(AVPicture *dst, const AVPicture *src,
03281 int pix_fmt, int top_band, int left_band);
03282
03286 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
03287 int padtop, int padbottom, int padleft, int padright, int *color);
03288
03289 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
03290
03302 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
03303
03313 int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
03314
03315
03316 #if EINVAL > 0
03317 #define AVERROR(e) (-(e))
03318 #define AVUNERROR(e) (-(e))
03319 #else
03320
03321 #define AVERROR(e) (e)
03322 #define AVUNERROR(e) (e)
03323 #endif
03324 #define AVERROR_UNKNOWN AVERROR(EINVAL)
03325 #define AVERROR_IO AVERROR(EIO)
03326 #define AVERROR_NUMEXPECTED AVERROR(EDOM)
03327 #define AVERROR_INVALIDDATA AVERROR(EINVAL)
03328 #define AVERROR_NOMEM AVERROR(ENOMEM)
03329 #define AVERROR_NOFMT AVERROR(EILSEQ)
03330 #define AVERROR_NOTSUPP AVERROR(ENOSYS)
03331 #define AVERROR_NOENT AVERROR(ENOENT)
03332 #define AVERROR_EOF AVERROR(EPIPE)
03333 #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E')
03338 void av_register_hwaccel(AVHWAccel *hwaccel);
03339
03345 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
03346
03347 #endif