00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FFMPEG_AVCODEC_H
00022 #define FFMPEG_AVCODEC_H
00023
00030 #include "avutil.h"
00031 #include <sys/types.h>
00032
00033 #if !defined INT64_C
00034 #if defined __WORDSIZE && __WORDSIZE == 64
00035 #define INT64_C(c) c ## L
00036 #else
00037 #define INT64_C(c) c ## LL
00038 #endif
00039 #endif
00040
00041 #define AV_STRINGIFY(s) AV_TOSTRING(s)
00042 #define AV_TOSTRING(s) #s
00043
00044 #define LIBAVCODEC_VERSION_INT ((51<<16)+(50<<8)+0)
00045 #define LIBAVCODEC_VERSION 51.50.0
00046 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
00047
00048 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
00049
00050 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
00051 #define AV_TIME_BASE 1000000
00052 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
00053
00066 enum CodecID {
00067 CODEC_ID_NONE,
00068 CODEC_ID_MPEG1VIDEO,
00069 CODEC_ID_MPEG2VIDEO,
00070 CODEC_ID_MPEG2VIDEO_XVMC,
00071 CODEC_ID_H261,
00072 CODEC_ID_H263,
00073 CODEC_ID_RV10,
00074 CODEC_ID_RV20,
00075 CODEC_ID_MJPEG,
00076 CODEC_ID_MJPEGB,
00077 CODEC_ID_LJPEG,
00078 CODEC_ID_SP5X,
00079 CODEC_ID_JPEGLS,
00080 CODEC_ID_MPEG4,
00081 CODEC_ID_RAWVIDEO,
00082 CODEC_ID_MSMPEG4V1,
00083 CODEC_ID_MSMPEG4V2,
00084 CODEC_ID_MSMPEG4V3,
00085 CODEC_ID_WMV1,
00086 CODEC_ID_WMV2,
00087 CODEC_ID_H263P,
00088 CODEC_ID_H263I,
00089 CODEC_ID_FLV1,
00090 CODEC_ID_SVQ1,
00091 CODEC_ID_SVQ3,
00092 CODEC_ID_DVVIDEO,
00093 CODEC_ID_HUFFYUV,
00094 CODEC_ID_CYUV,
00095 CODEC_ID_H264,
00096 CODEC_ID_INDEO3,
00097 CODEC_ID_VP3,
00098 CODEC_ID_THEORA,
00099 CODEC_ID_ASV1,
00100 CODEC_ID_ASV2,
00101 CODEC_ID_FFV1,
00102 CODEC_ID_4XM,
00103 CODEC_ID_VCR1,
00104 CODEC_ID_CLJR,
00105 CODEC_ID_MDEC,
00106 CODEC_ID_ROQ,
00107 CODEC_ID_INTERPLAY_VIDEO,
00108 CODEC_ID_XAN_WC3,
00109 CODEC_ID_XAN_WC4,
00110 CODEC_ID_RPZA,
00111 CODEC_ID_CINEPAK,
00112 CODEC_ID_WS_VQA,
00113 CODEC_ID_MSRLE,
00114 CODEC_ID_MSVIDEO1,
00115 CODEC_ID_IDCIN,
00116 CODEC_ID_8BPS,
00117 CODEC_ID_SMC,
00118 CODEC_ID_FLIC,
00119 CODEC_ID_TRUEMOTION1,
00120 CODEC_ID_VMDVIDEO,
00121 CODEC_ID_MSZH,
00122 CODEC_ID_ZLIB,
00123 CODEC_ID_QTRLE,
00124 CODEC_ID_SNOW,
00125 CODEC_ID_TSCC,
00126 CODEC_ID_ULTI,
00127 CODEC_ID_QDRAW,
00128 CODEC_ID_VIXL,
00129 CODEC_ID_QPEG,
00130 CODEC_ID_XVID,
00131 CODEC_ID_PNG,
00132 CODEC_ID_PPM,
00133 CODEC_ID_PBM,
00134 CODEC_ID_PGM,
00135 CODEC_ID_PGMYUV,
00136 CODEC_ID_PAM,
00137 CODEC_ID_FFVHUFF,
00138 CODEC_ID_RV30,
00139 CODEC_ID_RV40,
00140 CODEC_ID_VC1,
00141 CODEC_ID_WMV3,
00142 CODEC_ID_LOCO,
00143 CODEC_ID_WNV1,
00144 CODEC_ID_AASC,
00145 CODEC_ID_INDEO2,
00146 CODEC_ID_FRAPS,
00147 CODEC_ID_TRUEMOTION2,
00148 CODEC_ID_BMP,
00149 CODEC_ID_CSCD,
00150 CODEC_ID_MMVIDEO,
00151 CODEC_ID_ZMBV,
00152 CODEC_ID_AVS,
00153 CODEC_ID_SMACKVIDEO,
00154 CODEC_ID_NUV,
00155 CODEC_ID_KMVC,
00156 CODEC_ID_FLASHSV,
00157 CODEC_ID_CAVS,
00158 CODEC_ID_JPEG2000,
00159 CODEC_ID_VMNC,
00160 CODEC_ID_VP5,
00161 CODEC_ID_VP6,
00162 CODEC_ID_VP6F,
00163 CODEC_ID_TARGA,
00164 CODEC_ID_DSICINVIDEO,
00165 CODEC_ID_TIERTEXSEQVIDEO,
00166 CODEC_ID_TIFF,
00167 CODEC_ID_GIF,
00168 CODEC_ID_FFH264,
00169 CODEC_ID_DXA,
00170 CODEC_ID_DNXHD,
00171 CODEC_ID_THP,
00172 CODEC_ID_SGI,
00173 CODEC_ID_C93,
00174 CODEC_ID_BETHSOFTVID,
00175 CODEC_ID_PTX,
00176 CODEC_ID_TXD,
00177 CODEC_ID_VP6A,
00178 CODEC_ID_AMV,
00179 CODEC_ID_VB,
00180 CODEC_ID_PCX,
00181 CODEC_ID_SUNRAST,
00182
00183
00184 CODEC_ID_PCM_S16LE= 0x10000,
00185 CODEC_ID_PCM_S16BE,
00186 CODEC_ID_PCM_U16LE,
00187 CODEC_ID_PCM_U16BE,
00188 CODEC_ID_PCM_S8,
00189 CODEC_ID_PCM_U8,
00190 CODEC_ID_PCM_MULAW,
00191 CODEC_ID_PCM_ALAW,
00192 CODEC_ID_PCM_S32LE,
00193 CODEC_ID_PCM_S32BE,
00194 CODEC_ID_PCM_U32LE,
00195 CODEC_ID_PCM_U32BE,
00196 CODEC_ID_PCM_S24LE,
00197 CODEC_ID_PCM_S24BE,
00198 CODEC_ID_PCM_U24LE,
00199 CODEC_ID_PCM_U24BE,
00200 CODEC_ID_PCM_S24DAUD,
00201 CODEC_ID_PCM_ZORK,
00202 CODEC_ID_PCM_S16LE_PLANAR,
00203
00204
00205 CODEC_ID_ADPCM_IMA_QT= 0x11000,
00206 CODEC_ID_ADPCM_IMA_WAV,
00207 CODEC_ID_ADPCM_IMA_DK3,
00208 CODEC_ID_ADPCM_IMA_DK4,
00209 CODEC_ID_ADPCM_IMA_WS,
00210 CODEC_ID_ADPCM_IMA_SMJPEG,
00211 CODEC_ID_ADPCM_MS,
00212 CODEC_ID_ADPCM_4XM,
00213 CODEC_ID_ADPCM_XA,
00214 CODEC_ID_ADPCM_ADX,
00215 CODEC_ID_ADPCM_EA,
00216 CODEC_ID_ADPCM_G726,
00217 CODEC_ID_ADPCM_CT,
00218 CODEC_ID_ADPCM_SWF,
00219 CODEC_ID_ADPCM_YAMAHA,
00220 CODEC_ID_ADPCM_SBPRO_4,
00221 CODEC_ID_ADPCM_SBPRO_3,
00222 CODEC_ID_ADPCM_SBPRO_2,
00223 CODEC_ID_ADPCM_THP,
00224 CODEC_ID_ADPCM_IMA_AMV,
00225 CODEC_ID_ADPCM_EA_R1,
00226 CODEC_ID_ADPCM_EA_R3,
00227 CODEC_ID_ADPCM_EA_R2,
00228 CODEC_ID_ADPCM_IMA_EA_SEAD,
00229 CODEC_ID_ADPCM_IMA_EA_EACS,
00230 CODEC_ID_ADPCM_EA_XAS,
00231
00232
00233 CODEC_ID_AMR_NB= 0x12000,
00234 CODEC_ID_AMR_WB,
00235
00236
00237 CODEC_ID_RA_144= 0x13000,
00238 CODEC_ID_RA_288,
00239
00240
00241 CODEC_ID_ROQ_DPCM= 0x14000,
00242 CODEC_ID_INTERPLAY_DPCM,
00243 CODEC_ID_XAN_DPCM,
00244 CODEC_ID_SOL_DPCM,
00245
00246 CODEC_ID_MP2= 0x15000,
00247 CODEC_ID_MP3,
00248 CODEC_ID_AAC,
00249 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00250 CODEC_ID_MPEG4AAC,
00251 #endif
00252 CODEC_ID_AC3,
00253 CODEC_ID_DTS,
00254 CODEC_ID_VORBIS,
00255 CODEC_ID_DVAUDIO,
00256 CODEC_ID_WMAV1,
00257 CODEC_ID_WMAV2,
00258 CODEC_ID_MACE3,
00259 CODEC_ID_MACE6,
00260 CODEC_ID_VMDAUDIO,
00261 CODEC_ID_SONIC,
00262 CODEC_ID_SONIC_LS,
00263 CODEC_ID_FLAC,
00264 CODEC_ID_MP3ADU,
00265 CODEC_ID_MP3ON4,
00266 CODEC_ID_SHORTEN,
00267 CODEC_ID_ALAC,
00268 CODEC_ID_WESTWOOD_SND1,
00269 CODEC_ID_GSM,
00270 CODEC_ID_QDM2,
00271 CODEC_ID_COOK,
00272 CODEC_ID_TRUESPEECH,
00273 CODEC_ID_TTA,
00274 CODEC_ID_SMACKAUDIO,
00275 CODEC_ID_QCELP,
00276 CODEC_ID_WAVPACK,
00277 CODEC_ID_DSICINAUDIO,
00278 CODEC_ID_IMC,
00279 CODEC_ID_MUSEPACK7,
00280 CODEC_ID_MLP,
00281 CODEC_ID_GSM_MS,
00282 CODEC_ID_ATRAC3,
00283 CODEC_ID_VOXWARE,
00284 CODEC_ID_APE,
00285 CODEC_ID_NELLYMOSER,
00286 CODEC_ID_MUSEPACK8,
00287
00288
00289 CODEC_ID_DVD_SUBTITLE= 0x17000,
00290 CODEC_ID_DVB_SUBTITLE,
00291 CODEC_ID_TEXT,
00292 CODEC_ID_XSUB,
00293 CODEC_ID_SSA,
00294 CODEC_ID_MOV_TEXT,
00295
00296
00297 CODEC_ID_TTF= 0x18000,
00298
00299 CODEC_ID_MPEG2TS= 0x20000,
00301 };
00302
00303 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00304
00305 #define CODEC_ID_MP3LAME CODEC_ID_MP3
00306 #define CODEC_ID_MPEG4AAC CODEC_ID_AAC
00307 #endif
00308
00309 enum CodecType {
00310 CODEC_TYPE_UNKNOWN = -1,
00311 CODEC_TYPE_VIDEO,
00312 CODEC_TYPE_AUDIO,
00313 CODEC_TYPE_DATA,
00314 CODEC_TYPE_SUBTITLE,
00315 CODEC_TYPE_ATTACHMENT,
00316 CODEC_TYPE_NB
00317 };
00318
00323 enum SampleFormat {
00324 SAMPLE_FMT_NONE = -1,
00325 SAMPLE_FMT_U8,
00326 SAMPLE_FMT_S16,
00327 SAMPLE_FMT_S24,
00328 SAMPLE_FMT_S32,
00329 SAMPLE_FMT_FLT,
00330 };
00331
00332
00333 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00334
00342 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00343
00348 #define FF_MIN_BUFFER_SIZE 16384
00349
00353 enum Motion_Est_ID {
00354 ME_ZERO = 1,
00355 ME_FULL,
00356 ME_LOG,
00357 ME_PHODS,
00358 ME_EPZS,
00359 ME_X1,
00360 ME_HEX,
00361 ME_UMH,
00362 ME_ITER,
00363 };
00364
00365 enum AVDiscard{
00366
00367
00368 AVDISCARD_NONE =-16,
00369 AVDISCARD_DEFAULT= 0,
00370 AVDISCARD_NONREF = 8,
00371 AVDISCARD_BIDIR = 16,
00372 AVDISCARD_NONKEY = 32,
00373 AVDISCARD_ALL = 48,
00374 };
00375
00376 typedef struct RcOverride{
00377 int start_frame;
00378 int end_frame;
00379 int qscale;
00380 float quality_factor;
00381 } RcOverride;
00382
00383 #define FF_MAX_B_FRAMES 16
00384
00385
00386
00387
00388
00389
00390 #define CODEC_FLAG_QSCALE 0x0002
00391 #define CODEC_FLAG_4MV 0x0004
00392 #define CODEC_FLAG_QPEL 0x0010
00393 #define CODEC_FLAG_GMC 0x0020
00394 #define CODEC_FLAG_MV0 0x0040
00395 #define CODEC_FLAG_PART 0x0080
00396
00401 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00402 #define CODEC_FLAG_PASS1 0x0200
00403 #define CODEC_FLAG_PASS2 0x0400
00404 #define CODEC_FLAG_EXTERN_HUFF 0x1000
00405 #define CODEC_FLAG_GRAY 0x2000
00406 #define CODEC_FLAG_EMU_EDGE 0x4000
00407 #define CODEC_FLAG_PSNR 0x8000
00408 #define CODEC_FLAG_TRUNCATED 0x00010000
00410 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00411 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00412 #define CODEC_FLAG_LOW_DELAY 0x00080000
00413 #define CODEC_FLAG_ALT_SCAN 0x00100000
00414 #define CODEC_FLAG_TRELLIS_QUANT 0x00200000
00415 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00416 #define CODEC_FLAG_BITEXACT 0x00800000
00417
00418 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00419 #define CODEC_FLAG_H263P_AIC 0x01000000
00420 #endif
00421 #define CODEC_FLAG_AC_PRED 0x01000000
00422 #define CODEC_FLAG_H263P_UMV 0x02000000
00423 #define CODEC_FLAG_CBP_RD 0x04000000
00424 #define CODEC_FLAG_QP_RD 0x08000000
00425 #define CODEC_FLAG_H263P_AIV 0x00000008
00426 #define CODEC_FLAG_OBMC 0x00000001
00427 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00428 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00429 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00430 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000
00431 #define CODEC_FLAG_CLOSED_GOP ((int)0x80000000)
00432 #define CODEC_FLAG2_FAST 0x00000001
00433 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00434 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00435 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00436 #define CODEC_FLAG2_BPYRAMID 0x00000010
00437 #define CODEC_FLAG2_WPRED 0x00000020
00438 #define CODEC_FLAG2_MIXED_REFS 0x00000040
00439 #define CODEC_FLAG2_8X8DCT 0x00000080
00440 #define CODEC_FLAG2_FASTPSKIP 0x00000100
00441 #define CODEC_FLAG2_AUD 0x00000200
00442 #define CODEC_FLAG2_BRDO 0x00000400
00443 #define CODEC_FLAG2_INTRA_VLC 0x00000800
00444 #define CODEC_FLAG2_MEMC_ONLY 0x00001000
00445 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00446 #define CODEC_FLAG2_SKIP_RD 0x00004000
00447 #define CODEC_FLAG2_CHUNKS 0x00008000
00448 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000
00449
00450
00451
00452
00453
00454
00455
00456
00457 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00458
00462 #define CODEC_CAP_DR1 0x0002
00463
00464 #define CODEC_CAP_PARSE_ONLY 0x0004
00465 #define CODEC_CAP_TRUNCATED 0x0008
00466
00467 #define CODEC_CAP_HWACCEL 0x0010
00468
00472 #define CODEC_CAP_DELAY 0x0020
00473
00477 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00478
00479
00480 #define MB_TYPE_INTRA4x4 0x0001
00481 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00482 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00483 #define MB_TYPE_16x16 0x0008
00484 #define MB_TYPE_16x8 0x0010
00485 #define MB_TYPE_8x16 0x0020
00486 #define MB_TYPE_8x8 0x0040
00487 #define MB_TYPE_INTERLACED 0x0080
00488 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00489 #define MB_TYPE_ACPRED 0x0200
00490 #define MB_TYPE_GMC 0x0400
00491 #define MB_TYPE_SKIP 0x0800
00492 #define MB_TYPE_P0L0 0x1000
00493 #define MB_TYPE_P1L0 0x2000
00494 #define MB_TYPE_P0L1 0x4000
00495 #define MB_TYPE_P1L1 0x8000
00496 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00497 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00498 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00499 #define MB_TYPE_QUANT 0x00010000
00500 #define MB_TYPE_CBP 0x00020000
00501
00502
00508 typedef struct AVPanScan{
00514 int id;
00515
00521 int width;
00522 int height;
00523
00529 int16_t position[3][2];
00530 }AVPanScan;
00531
00532 #define FF_COMMON_FRAME \
00533 \
00539 uint8_t *data[4];\
00540 int linesize[4];\
00541 \
00547 uint8_t *base[4];\
00548 \
00553 int key_frame;\
00554 \
00555 \
00560 int pict_type;\
00561 \
00562 \
00568 int64_t pts;\
00569 \
00570 \
00575 int coded_picture_number;\
00576 \
00581 int display_picture_number;\
00582 \
00583 \
00588 int quality; \
00589 \
00590 \
00596 int age;\
00597 \
00598 \
00603 int reference;\
00604 \
00605 \
00610 int8_t *qscale_table;\
00611 \
00616 int qstride;\
00617 \
00618 \
00624 uint8_t *mbskip_table;\
00625 \
00626 \
00638 int16_t (*motion_val[2])[2];\
00639 \
00640 \
00646 uint32_t *mb_type;\
00647 \
00648 \
00654 uint8_t motion_subsample_log2;\
00655 \
00656 \
00661 void *opaque;\
00662 \
00663 \
00668 uint64_t error[4];\
00669 \
00670 \
00676 int type;\
00677 \
00678 \
00684 int repeat_pict;\
00685 \
00686 \
00689 int qscale_type;\
00690 \
00691 \
00696 int interlaced_frame;\
00697 \
00698 \
00703 int top_field_first;\
00704 \
00705 \
00710 AVPanScan *pan_scan;\
00711 \
00712 \
00717 int palette_has_changed;\
00718 \
00719 \
00724 int buffer_hints;\
00725 \
00726 \
00731 short *dct_coeff;\
00732 \
00733 \
00738 int8_t *ref_index[2];
00739
00740 #define FF_QSCALE_TYPE_MPEG1 0
00741 #define FF_QSCALE_TYPE_MPEG2 1
00742 #define FF_QSCALE_TYPE_H264 2
00743
00744 #define FF_BUFFER_TYPE_INTERNAL 1
00745 #define FF_BUFFER_TYPE_USER 2
00746 #define FF_BUFFER_TYPE_SHARED 4
00747 #define FF_BUFFER_TYPE_COPY 8
00748
00749
00750 #define FF_I_TYPE 1 // Intra
00751 #define FF_P_TYPE 2 // Predicted
00752 #define FF_B_TYPE 3 // Bi-dir predicted
00753 #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4
00754 #define FF_SI_TYPE 5
00755 #define FF_SP_TYPE 6
00756
00757 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
00758 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00759 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00760 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00761
00771 typedef struct AVFrame {
00772 FF_COMMON_FRAME
00773 } AVFrame;
00774
00775 #define DEFAULT_FRAME_RATE_BASE 1001000
00776
00784 typedef struct AVCodecContext {
00789 AVClass *av_class;
00795 int bit_rate;
00796
00803 int bit_rate_tolerance;
00804
00810 int flags;
00811
00820 int sub_id;
00821
00829 int me_method;
00830
00842 uint8_t *extradata;
00843 int extradata_size;
00844
00853 AVRational time_base;
00854
00855
00863 int width, height;
00864
00865 #define FF_ASPECT_EXTENDED 15
00866
00872 int gop_size;
00873
00879 enum PixelFormat pix_fmt;
00880
00887 int rate_emu;
00888
00901 void (*draw_horiz_band)(struct AVCodecContext *s,
00902 const AVFrame *src, int offset[4],
00903 int y, int type, int height);
00904
00905
00906 int sample_rate;
00907 int channels;
00908
00914 enum SampleFormat sample_fmt;
00915
00916
00920 int frame_size;
00921 int frame_number;
00922 int real_pict_num;
00923
00930 int delay;
00931
00932
00933 float qcompress;
00934 float qblur;
00935
00941 int qmin;
00942
00948 int qmax;
00949
00955 int max_qdiff;
00956
00963 int max_b_frames;
00964
00970 float b_quant_factor;
00971
00973 int rc_strategy;
00974 #define FF_RC_STRATEGY_XVID 1
00975
00976 int b_frame_strategy;
00977
00984 int hurry_up;
00985
00986 struct AVCodec *codec;
00987
00988 void *priv_data;
00989
00990 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00991
00992 int rtp_mode;
00993 #endif
00994
00995 int rtp_payload_size;
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01010
01011
01012 int mv_bits;
01013 int header_bits;
01014 int i_tex_bits;
01015 int p_tex_bits;
01016 int i_count;
01017 int p_count;
01018 int skip_count;
01019 int misc_bits;
01020
01026 int frame_bits;
01027
01033 void *opaque;
01034
01035 char codec_name[32];
01036 enum CodecType codec_type;
01037 enum CodecID codec_id;
01038
01052 unsigned int codec_tag;
01053
01059 int workaround_bugs;
01060 #define FF_BUG_AUTODETECT 1
01061 #define FF_BUG_OLD_MSMPEG4 2
01062 #define FF_BUG_XVID_ILACE 4
01063 #define FF_BUG_UMP4 8
01064 #define FF_BUG_NO_PADDING 16
01065 #define FF_BUG_AMV 32
01066 #define FF_BUG_AC_VLC 0
01067 #define FF_BUG_QPEL_CHROMA 64
01068 #define FF_BUG_STD_QPEL 128
01069 #define FF_BUG_QPEL_CHROMA2 256
01070 #define FF_BUG_DIRECT_BLOCKSIZE 512
01071 #define FF_BUG_EDGE 1024
01072 #define FF_BUG_HPEL_CHROMA 2048
01073 #define FF_BUG_DC_CLIP 4096
01074 #define FF_BUG_MS 8192
01075 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
01076
01082 int luma_elim_threshold;
01083
01089 int chroma_elim_threshold;
01090
01096 int strict_std_compliance;
01097 #define FF_COMPLIANCE_VERY_STRICT 2
01098 #define FF_COMPLIANCE_STRICT 1
01099 #define FF_COMPLIANCE_NORMAL 0
01100 #define FF_COMPLIANCE_INOFFICIAL -1
01101 #define FF_COMPLIANCE_EXPERIMENTAL -2
01102
01103
01110 float b_quant_offset;
01111
01118 int error_resilience;
01119 #define FF_ER_CAREFUL 1
01120 #define FF_ER_COMPLIANT 2
01121 #define FF_ER_AGGRESSIVE 3
01122 #define FF_ER_VERY_AGGRESSIVE 4
01123
01132 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01133
01141 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01142
01148 int has_b_frames;
01149
01154 int block_align;
01155
01156 int parse_only;
01157
01158
01159
01165 int mpeg_quant;
01166
01172 char *stats_out;
01173
01180 char *stats_in;
01181
01188 float rc_qsquish;
01189
01190 float rc_qmod_amp;
01191 int rc_qmod_freq;
01192
01198 RcOverride *rc_override;
01199 int rc_override_count;
01200
01206 char *rc_eq;
01207
01213 int rc_max_rate;
01214
01220 int rc_min_rate;
01221
01227 int rc_buffer_size;
01228 float rc_buffer_aggressivity;
01229
01237 float i_quant_factor;
01238
01244 float i_quant_offset;
01245
01251 float rc_initial_cplx;
01252
01258 int dct_algo;
01259 #define FF_DCT_AUTO 0
01260 #define FF_DCT_FASTINT 1
01261 #define FF_DCT_INT 2
01262 #define FF_DCT_MMX 3
01263 #define FF_DCT_MLIB 4
01264 #define FF_DCT_ALTIVEC 5
01265 #define FF_DCT_FAAN 6
01266
01272 float lumi_masking;
01273
01279 float temporal_cplx_masking;
01280
01286 float spatial_cplx_masking;
01287
01293 float p_masking;
01294
01300 float dark_masking;
01301
01302
01303 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
01304
01305 int unused;
01306 #endif
01307
01313 int idct_algo;
01314 #define FF_IDCT_AUTO 0
01315 #define FF_IDCT_INT 1
01316 #define FF_IDCT_SIMPLE 2
01317 #define FF_IDCT_SIMPLEMMX 3
01318 #define FF_IDCT_LIBMPEG2MMX 4
01319 #define FF_IDCT_PS2 5
01320 #define FF_IDCT_MLIB 6
01321 #define FF_IDCT_ARM 7
01322 #define FF_IDCT_ALTIVEC 8
01323 #define FF_IDCT_SH4 9
01324 #define FF_IDCT_SIMPLEARM 10
01325 #define FF_IDCT_H264 11
01326 #define FF_IDCT_VP3 12
01327 #define FF_IDCT_IPP 13
01328 #define FF_IDCT_XVIDMMX 14
01329 #define FF_IDCT_CAVS 15
01330 #define FF_IDCT_SIMPLEARMV5TE 16
01331 #define FF_IDCT_SIMPLEARMV6 17
01332 #define FF_IDCT_SIMPLEVIS 18
01333 #define FF_IDCT_WMV2 19
01334
01340 int slice_count;
01346 int *slice_offset;
01347
01353 int error_concealment;
01354 #define FF_EC_GUESS_MVS 1
01355 #define FF_EC_DEBLOCK 2
01356
01365 unsigned dsp_mask;
01366 #define FF_MM_FORCE 0x80000000
01367
01368 #define FF_MM_MMX 0x0001
01369 #define FF_MM_3DNOW 0x0004
01370 #define FF_MM_MMXEXT 0x0002
01371 #define FF_MM_SSE 0x0008
01372 #define FF_MM_SSE2 0x0010
01373 #define FF_MM_3DNOWEXT 0x0020
01374 #define FF_MM_SSE3 0x0040
01375 #define FF_MM_SSSE3 0x0080
01376 #define FF_MM_IWMMXT 0x0100
01377
01378
01383 int bits_per_sample;
01384
01390 int prediction_method;
01391 #define FF_PRED_LEFT 0
01392 #define FF_PRED_PLANE 1
01393 #define FF_PRED_MEDIAN 2
01394
01401 AVRational sample_aspect_ratio;
01402
01408 AVFrame *coded_frame;
01409
01415 int debug;
01416 #define FF_DEBUG_PICT_INFO 1
01417 #define FF_DEBUG_RC 2
01418 #define FF_DEBUG_BITSTREAM 4
01419 #define FF_DEBUG_MB_TYPE 8
01420 #define FF_DEBUG_QP 16
01421 #define FF_DEBUG_MV 32
01422 #define FF_DEBUG_DCT_COEFF 0x00000040
01423 #define FF_DEBUG_SKIP 0x00000080
01424 #define FF_DEBUG_STARTCODE 0x00000100
01425 #define FF_DEBUG_PTS 0x00000200
01426 #define FF_DEBUG_ER 0x00000400
01427 #define FF_DEBUG_MMCO 0x00000800
01428 #define FF_DEBUG_BUGS 0x00001000
01429 #define FF_DEBUG_VIS_QP 0x00002000
01430 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01431
01437 int debug_mv;
01438 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
01439 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
01440 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01441
01447 uint64_t error[4];
01448
01454 int mb_qmin;
01455
01461 int mb_qmax;
01462
01468 int me_cmp;
01474 int me_sub_cmp;
01480 int mb_cmp;
01486 int ildct_cmp;
01487 #define FF_CMP_SAD 0
01488 #define FF_CMP_SSE 1
01489 #define FF_CMP_SATD 2
01490 #define FF_CMP_DCT 3
01491 #define FF_CMP_PSNR 4
01492 #define FF_CMP_BIT 5
01493 #define FF_CMP_RD 6
01494 #define FF_CMP_ZERO 7
01495 #define FF_CMP_VSAD 8
01496 #define FF_CMP_VSSE 9
01497 #define FF_CMP_NSSE 10
01498 #define FF_CMP_W53 11
01499 #define FF_CMP_W97 12
01500 #define FF_CMP_DCTMAX 13
01501 #define FF_CMP_DCT264 14
01502 #define FF_CMP_CHROMA 256
01503
01509 int dia_size;
01510
01516 int last_predictor_count;
01517
01523 int pre_me;
01524
01530 int me_pre_cmp;
01531
01537 int pre_dia_size;
01538
01544 int me_subpel_quality;
01545
01555 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01556
01565 int dtg_active_format;
01566 #define FF_DTG_AFD_SAME 8
01567 #define FF_DTG_AFD_4_3 9
01568 #define FF_DTG_AFD_16_9 10
01569 #define FF_DTG_AFD_14_9 11
01570 #define FF_DTG_AFD_4_3_SP_14_9 13
01571 #define FF_DTG_AFD_16_9_SP_14_9 14
01572 #define FF_DTG_AFD_SP_4_3 15
01573
01581 int me_range;
01582
01588 int intra_quant_bias;
01589 #define FF_DEFAULT_QUANT_BIAS 999999
01590
01596 int inter_quant_bias;
01597
01604 int color_table_id;
01605
01610 int internal_buffer_count;
01611
01616 void *internal_buffer;
01617
01618 #define FF_LAMBDA_SHIFT 7
01619 #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01620 #define FF_QP2LAMBDA 118
01621 #define FF_LAMBDA_MAX (256*128-1)
01622
01623 #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01624
01630 int global_quality;
01631
01632 #define FF_CODER_TYPE_VLC 0
01633 #define FF_CODER_TYPE_AC 1
01634 #define FF_CODER_TYPE_RAW 2
01635 #define FF_CODER_TYPE_RLE 3
01636 #define FF_CODER_TYPE_DEFLATE 4
01637
01642 int coder_type;
01643
01649 int context_model;
01650 #if 0
01651
01656 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01657 #endif
01658
01664 int slice_flags;
01665 #define SLICE_FLAG_CODED_ORDER 0x0001
01666 #define SLICE_FLAG_ALLOW_FIELD 0x0002
01667 #define SLICE_FLAG_ALLOW_PLANE 0x0004
01668
01669
01674 int xvmc_acceleration;
01675
01681 int mb_decision;
01682 #define FF_MB_DECISION_SIMPLE 0
01683 #define FF_MB_DECISION_BITS 1
01684 #define FF_MB_DECISION_RD 2
01685
01686
01691 uint16_t *intra_matrix;
01692
01698 uint16_t *inter_matrix;
01699
01706 unsigned int stream_codec_tag;
01707
01714 int scenechange_threshold;
01715
01721 int lmin;
01722
01728 int lmax;
01729
01735 struct AVPaletteControl *palctrl;
01736
01742 int noise_reduction;
01743
01753 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
01754
01760 int rc_initial_buffer_occupancy;
01761
01767 int inter_threshold;
01768
01774 int flags2;
01775
01781 int error_rate;
01782
01788 int antialias_algo;
01789 #define FF_AA_AUTO 0
01790 #define FF_AA_FASTINT 1 //not implemented yet
01791 #define FF_AA_INT 2
01792 #define FF_AA_FLOAT 3
01793
01798 int quantizer_noise_shaping;
01799
01806 int thread_count;
01807
01817 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
01818
01825 void *thread_opaque;
01826
01834 int me_threshold;
01835
01841 int mb_threshold;
01842
01848 int intra_dc_precision;
01849
01855 int nsse_weight;
01856
01862 int skip_top;
01863
01869 int skip_bottom;
01870
01876 int profile;
01877 #define FF_PROFILE_UNKNOWN -99
01878 #define FF_PROFILE_AAC_MAIN 0
01879 #define FF_PROFILE_AAC_LOW 1
01880 #define FF_PROFILE_AAC_SSR 2
01881 #define FF_PROFILE_AAC_LTP 3
01882
01888 int level;
01889 #define FF_LEVEL_UNKNOWN -99
01890
01896 int lowres;
01897
01904 int coded_width, coded_height;
01905
01911 int frame_skip_threshold;
01912
01918 int frame_skip_factor;
01919
01925 int frame_skip_exp;
01926
01932 int frame_skip_cmp;
01933
01940 float border_masking;
01941
01947 int mb_lmin;
01948
01954 int mb_lmax;
01955
01961 int me_penalty_compensation;
01962
01968 enum AVDiscard skip_loop_filter;
01969
01975 enum AVDiscard skip_idct;
01976
01982 enum AVDiscard skip_frame;
01983
01989 int bidir_refine;
01990
01996 int brd_scale;
01997
02003 float crf;
02004
02010 int cqp;
02011
02017 int keyint_min;
02018
02024 int refs;
02025
02031 int chromaoffset;
02032
02038 int bframebias;
02039
02045 int trellis;
02046
02052 float complexityblur;
02053
02060 int deblockalpha;
02061
02068 int deblockbeta;
02069
02075 int partitions;
02076 #define X264_PART_I4X4 0x001
02077 #define X264_PART_I8X8 0x002
02078 #define X264_PART_P8X8 0x010
02079 #define X264_PART_P4X4 0x020
02080 #define X264_PART_B8X8 0x100
02081
02087 int directpred;
02088
02094 int cutoff;
02095
02101 int scenechange_factor;
02102
02109 int mv0_threshold;
02110
02116 int b_sensitivity;
02117
02122 int compression_level;
02123 #define FF_COMPRESSION_DEFAULT -1
02124
02130 int use_lpc;
02131
02137 int lpc_coeff_precision;
02138
02143 int min_prediction_order;
02144
02149 int max_prediction_order;
02150
02156 int prediction_order_method;
02157
02162 int min_partition_order;
02163
02168 int max_partition_order;
02169
02175 int64_t timecode_frame_start;
02176
02182 int request_channels;
02183
02190 float drc_scale;
02191 } AVCodecContext;
02192
02196 typedef struct AVCodec {
02203 const char *name;
02204 enum CodecType type;
02205 enum CodecID id;
02206 int priv_data_size;
02207 int (*init)(AVCodecContext *);
02208 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02209 int (*close)(AVCodecContext *);
02210 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
02211 const uint8_t *buf, int buf_size);
02212 int capabilities;
02213 struct AVCodec *next;
02214 void (*flush)(AVCodecContext *);
02215 const AVRational *supported_framerates;
02216 const enum PixelFormat *pix_fmts;
02217 } AVCodec;
02218
02223 typedef struct AVPicture {
02224 uint8_t *data[4];
02225 int linesize[4];
02226 } AVPicture;
02227
02236 #define AVPALETTE_SIZE 1024
02237 #define AVPALETTE_COUNT 256
02238 typedef struct AVPaletteControl {
02239
02240
02241
02242 int palette_changed;
02243
02244
02245
02246
02247
02248 unsigned int palette[AVPALETTE_COUNT];
02249
02250 } AVPaletteControl attribute_deprecated;
02251
02252 typedef struct AVSubtitleRect {
02253 uint16_t x;
02254 uint16_t y;
02255 uint16_t w;
02256 uint16_t h;
02257 uint16_t nb_colors;
02258 int linesize;
02259 uint32_t *rgba_palette;
02260 uint8_t *bitmap;
02261 } AVSubtitleRect;
02262
02263 typedef struct AVSubtitle {
02264 uint16_t format;
02265 uint32_t start_display_time;
02266 uint32_t end_display_time;
02267 uint32_t num_rects;
02268 AVSubtitleRect *rects;
02269 } AVSubtitle;
02270
02271
02272
02273
02274 struct ReSampleContext;
02275 struct AVResampleContext;
02276
02277 typedef struct ReSampleContext ReSampleContext;
02278
02279 ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02280 int output_rate, int input_rate);
02281 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02282 void audio_resample_close(ReSampleContext *s);
02283
02284 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02285 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02286 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
02287 void av_resample_close(struct AVResampleContext *c);
02288
02289 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02290
02291
02295 typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;
02296
02300 attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
02301 int input_width, int input_height);
02302
02306 attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
02307 int iwidth, int iheight,
02308 int topBand, int bottomBand,
02309 int leftBand, int rightBand,
02310 int padtop, int padbottom,
02311 int padleft, int padright);
02312
02316 attribute_deprecated void img_resample(struct ImgReSampleContext *s,
02317 AVPicture *output, const AVPicture *input);
02318
02322 attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);
02323
02324 #endif
02325
02335 int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
02336
02342 void avpicture_free(AVPicture *picture);
02343
02360 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
02361 int pix_fmt, int width, int height);
02362 int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
02363 unsigned char *dest, int dest_size);
02364
02374 int avpicture_get_size(int pix_fmt, int width, int height);
02375 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
02376 const char *avcodec_get_pix_fmt_name(int pix_fmt);
02377 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
02378 enum PixelFormat avcodec_get_pix_fmt(const char* name);
02379 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
02380
02381 #define FF_LOSS_RESOLUTION 0x0001
02382 #define FF_LOSS_DEPTH 0x0002
02383 #define FF_LOSS_COLORSPACE 0x0004
02384 #define FF_LOSS_ALPHA 0x0008
02385 #define FF_LOSS_COLORQUANT 0x0010
02386 #define FF_LOSS_CHROMA 0x0020
02405 int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
02406 int has_alpha);
02407
02430 int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
02431 int has_alpha, int *loss_ptr);
02432
02433
02444 void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
02445
02446 #define FF_ALPHA_TRANSP 0x0001
02447 #define FF_ALPHA_SEMI_TRANSP 0x0002
02448
02453 int img_get_alpha_info(const AVPicture *src,
02454 int pix_fmt, int width, int height);
02455
02456 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02457
02461 attribute_deprecated int img_convert(AVPicture *dst, int dst_pix_fmt,
02462 const AVPicture *src, int pix_fmt,
02463 int width, int height);
02464 #endif
02465
02466
02467
02468 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
02469 int pix_fmt, int width, int height);
02470
02471
02472
02473 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02474 extern AVCodec *first_avcodec;
02475 #endif
02476 AVCodec *av_codec_next(AVCodec *c);
02477
02478
02479 unsigned avcodec_version(void);
02480
02481 unsigned avcodec_build(void);
02482
02489 void avcodec_init(void);
02490
02491 void register_avcodec(AVCodec *format);
02492
02499 AVCodec *avcodec_find_encoder(enum CodecID id);
02500
02507 AVCodec *avcodec_find_encoder_by_name(const char *name);
02508
02515 AVCodec *avcodec_find_decoder(enum CodecID id);
02516
02523 AVCodec *avcodec_find_decoder_by_name(const char *name);
02524 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
02525
02531 void avcodec_get_context_defaults(AVCodecContext *s);
02532
02535 void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
02536
02544 AVCodecContext *avcodec_alloc_context(void);
02545
02548 AVCodecContext *avcodec_alloc_context2(enum CodecType);
02549
02555 void avcodec_get_frame_defaults(AVFrame *pic);
02556
02564 AVFrame *avcodec_alloc_frame(void);
02565
02566 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
02567 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
02568 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
02569 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
02570
02579 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
02580 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
02581
02582 int avcodec_thread_init(AVCodecContext *s, int thread_count);
02583 void avcodec_thread_free(AVCodecContext *s);
02584 int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
02585 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
02586
02587
02615 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
02616
02620 attribute_deprecated int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
02621 int *frame_size_ptr,
02622 const uint8_t *buf, int buf_size);
02623
02660 int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
02661 int *frame_size_ptr,
02662 const uint8_t *buf, int buf_size);
02663
02695 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
02696 int *got_picture_ptr,
02697 const uint8_t *buf, int buf_size);
02698
02699
02700
02701
02702 int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
02703 int *got_sub_ptr,
02704 const uint8_t *buf, int buf_size);
02705 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
02706 int *data_size_ptr,
02707 uint8_t *buf, int buf_size);
02708
02727 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02728 const short *samples);
02729
02745 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02746 const AVFrame *pict);
02747 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02748 const AVSubtitle *sub);
02749
02750 int avcodec_close(AVCodecContext *avctx);
02751
02752 void avcodec_register_all(void);
02753
02757 void avcodec_flush_buffers(AVCodecContext *avctx);
02758
02759 void avcodec_default_free_buffers(AVCodecContext *s);
02760
02761
02762
02769 char av_get_pict_type_char(int pict_type);
02770
02777 int av_get_bits_per_sample(enum CodecID codec_id);
02778
02785 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
02786
02787
02788 typedef struct AVCodecParserContext {
02789 void *priv_data;
02790 struct AVCodecParser *parser;
02791 int64_t frame_offset;
02792 int64_t cur_offset;
02793
02794 int64_t last_frame_offset;
02795
02796 int pict_type;
02797 int repeat_pict;
02798 int64_t pts;
02799 int64_t dts;
02800
02801
02802 int64_t last_pts;
02803 int64_t last_dts;
02804 int fetch_timestamp;
02805
02806 #define AV_PARSER_PTS_NB 4
02807 int cur_frame_start_index;
02808 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
02809 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
02810 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
02811
02812 int flags;
02813 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
02814
02815 int64_t offset;
02816 int64_t last_offset;
02817 } AVCodecParserContext;
02818
02819 typedef struct AVCodecParser {
02820 int codec_ids[5];
02821 int priv_data_size;
02822 int (*parser_init)(AVCodecParserContext *s);
02823 int (*parser_parse)(AVCodecParserContext *s,
02824 AVCodecContext *avctx,
02825 const uint8_t **poutbuf, int *poutbuf_size,
02826 const uint8_t *buf, int buf_size);
02827 void (*parser_close)(AVCodecParserContext *s);
02828 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
02829 struct AVCodecParser *next;
02830 } AVCodecParser;
02831
02832 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02833 extern AVCodecParser *av_first_parser;
02834 #endif
02835 AVCodecParser *av_parser_next(AVCodecParser *c);
02836
02837 void av_register_codec_parser(AVCodecParser *parser);
02838 AVCodecParserContext *av_parser_init(int codec_id);
02839 int av_parser_parse(AVCodecParserContext *s,
02840 AVCodecContext *avctx,
02841 uint8_t **poutbuf, int *poutbuf_size,
02842 const uint8_t *buf, int buf_size,
02843 int64_t pts, int64_t dts);
02844 int av_parser_change(AVCodecParserContext *s,
02845 AVCodecContext *avctx,
02846 uint8_t **poutbuf, int *poutbuf_size,
02847 const uint8_t *buf, int buf_size, int keyframe);
02848 void av_parser_close(AVCodecParserContext *s);
02849
02850
02851 typedef struct AVBitStreamFilterContext {
02852 void *priv_data;
02853 struct AVBitStreamFilter *filter;
02854 AVCodecParserContext *parser;
02855 struct AVBitStreamFilterContext *next;
02856 } AVBitStreamFilterContext;
02857
02858
02859 typedef struct AVBitStreamFilter {
02860 const char *name;
02861 int priv_data_size;
02862 int (*filter)(AVBitStreamFilterContext *bsfc,
02863 AVCodecContext *avctx, const char *args,
02864 uint8_t **poutbuf, int *poutbuf_size,
02865 const uint8_t *buf, int buf_size, int keyframe);
02866 void (*close)(AVBitStreamFilterContext *bsfc);
02867 struct AVBitStreamFilter *next;
02868 } AVBitStreamFilter;
02869
02870 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
02871 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
02872 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
02873 AVCodecContext *avctx, const char *args,
02874 uint8_t **poutbuf, int *poutbuf_size,
02875 const uint8_t *buf, int buf_size, int keyframe);
02876 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
02877
02878 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
02879
02880
02881
02888 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
02889
02890
02891
02900 attribute_deprecated void av_free_static(void);
02901
02912 attribute_deprecated void *av_mallocz_static(unsigned int size);
02913
02917 void av_picture_copy(AVPicture *dst, const AVPicture *src,
02918 int pix_fmt, int width, int height);
02919
02923 int av_picture_crop(AVPicture *dst, const AVPicture *src,
02924 int pix_fmt, int top_band, int left_band);
02925
02929 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
02930 int padtop, int padbottom, int padleft, int padright, int *color);
02931
02932 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02933
02936 attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
02937 int pix_fmt, int width, int height);
02938
02942 attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
02943 int pix_fmt, int top_band, int left_band);
02944
02948 attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
02949 int padtop, int padbottom, int padleft, int padright, int *color);
02950 #endif
02951
02952 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
02953
02965 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
02966
02976 int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
02977
02978
02979 #if EINVAL > 0
02980 #define AVERROR(e) (-(e))
02981 #define AVUNERROR(e) (-(e))
02982 #else
02983
02984 #define AVERROR(e) (e)
02985 #define AVUNERROR(e) (e)
02986 #endif
02987 #define AVERROR_UNKNOWN AVERROR(EINVAL)
02988 #define AVERROR_IO AVERROR(EIO)
02989 #define AVERROR_NUMEXPECTED AVERROR(EDOM)
02990 #define AVERROR_INVALIDDATA AVERROR(EINVAL)
02991 #define AVERROR_NOMEM AVERROR(ENOMEM)
02992 #define AVERROR_NOFMT AVERROR(EILSEQ)
02993 #define AVERROR_NOTSUPP AVERROR(ENOSYS)
02994 #define AVERROR_NOENT AVERROR(ENOENT)
02995 #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E')
02997 #endif