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 #define AV_STRINGIFY(s) AV_TOSTRING(s)
00034 #define AV_TOSTRING(s) #s
00035
00036 #define LIBAVCODEC_VERSION_INT ((51<<16)+(48<<8)+0)
00037 #define LIBAVCODEC_VERSION 51.48.0
00038 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
00039
00040 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
00041
00042 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
00043 #define AV_TIME_BASE 1000000
00044 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
00045
00058 enum CodecID {
00059 CODEC_ID_NONE,
00060 CODEC_ID_MPEG1VIDEO,
00061 CODEC_ID_MPEG2VIDEO,
00062 CODEC_ID_MPEG2VIDEO_XVMC,
00063 CODEC_ID_MPEG2VIDEO_XVMC_VLD,
00064 CODEC_ID_MPEG2VIDEO_DVDV,
00065 CODEC_ID_H261,
00066 CODEC_ID_H263,
00067 CODEC_ID_RV10,
00068 CODEC_ID_RV20,
00069 CODEC_ID_MJPEG,
00070 CODEC_ID_MJPEGB,
00071 CODEC_ID_LJPEG,
00072 CODEC_ID_SP5X,
00073 CODEC_ID_JPEGLS,
00074 CODEC_ID_MPEG4,
00075 CODEC_ID_RAWVIDEO,
00076 CODEC_ID_MSMPEG4V1,
00077 CODEC_ID_MSMPEG4V2,
00078 CODEC_ID_MSMPEG4V3,
00079 CODEC_ID_WMV1,
00080 CODEC_ID_WMV2,
00081 CODEC_ID_H263P,
00082 CODEC_ID_H263I,
00083 CODEC_ID_FLV1,
00084 CODEC_ID_SVQ1,
00085 CODEC_ID_SVQ3,
00086 CODEC_ID_DVVIDEO,
00087 CODEC_ID_HUFFYUV,
00088 CODEC_ID_CYUV,
00089 CODEC_ID_H264,
00090 CODEC_ID_INDEO3,
00091 CODEC_ID_VP3,
00092 CODEC_ID_THEORA,
00093 CODEC_ID_ASV1,
00094 CODEC_ID_ASV2,
00095 CODEC_ID_FFV1,
00096 CODEC_ID_4XM,
00097 CODEC_ID_VCR1,
00098 CODEC_ID_CLJR,
00099 CODEC_ID_MDEC,
00100 CODEC_ID_ROQ,
00101 CODEC_ID_INTERPLAY_VIDEO,
00102 CODEC_ID_XAN_WC3,
00103 CODEC_ID_XAN_WC4,
00104 CODEC_ID_RPZA,
00105 CODEC_ID_CINEPAK,
00106 CODEC_ID_WS_VQA,
00107 CODEC_ID_MSRLE,
00108 CODEC_ID_MSVIDEO1,
00109 CODEC_ID_IDCIN,
00110 CODEC_ID_8BPS,
00111 CODEC_ID_SMC,
00112 CODEC_ID_FLIC,
00113 CODEC_ID_TRUEMOTION1,
00114 CODEC_ID_VMDVIDEO,
00115 CODEC_ID_MSZH,
00116 CODEC_ID_ZLIB,
00117 CODEC_ID_QTRLE,
00118 CODEC_ID_SNOW,
00119 CODEC_ID_TSCC,
00120 CODEC_ID_ULTI,
00121 CODEC_ID_QDRAW,
00122 CODEC_ID_VIXL,
00123 CODEC_ID_QPEG,
00124 CODEC_ID_XVID,
00125 CODEC_ID_PNG,
00126 CODEC_ID_PPM,
00127 CODEC_ID_PBM,
00128 CODEC_ID_PGM,
00129 CODEC_ID_PGMYUV,
00130 CODEC_ID_PAM,
00131 CODEC_ID_FFVHUFF,
00132 CODEC_ID_RV30,
00133 CODEC_ID_RV40,
00134 CODEC_ID_VC1,
00135 CODEC_ID_WMV3,
00136 CODEC_ID_LOCO,
00137 CODEC_ID_WNV1,
00138 CODEC_ID_AASC,
00139 CODEC_ID_INDEO2,
00140 CODEC_ID_FRAPS,
00141 CODEC_ID_TRUEMOTION2,
00142 CODEC_ID_BMP,
00143 CODEC_ID_CSCD,
00144 CODEC_ID_MMVIDEO,
00145 CODEC_ID_ZMBV,
00146 CODEC_ID_AVS,
00147 CODEC_ID_SMACKVIDEO,
00148 CODEC_ID_NUV,
00149 CODEC_ID_KMVC,
00150 CODEC_ID_FLASHSV,
00151 CODEC_ID_CAVS,
00152 CODEC_ID_JPEG2000,
00153 CODEC_ID_VMNC,
00154 CODEC_ID_VP5,
00155 CODEC_ID_VP6,
00156 CODEC_ID_VP6F,
00157 CODEC_ID_TARGA,
00158 CODEC_ID_DSICINVIDEO,
00159 CODEC_ID_TIERTEXSEQVIDEO,
00160 CODEC_ID_TIFF,
00161 CODEC_ID_GIF,
00162 CODEC_ID_FFH264,
00163 CODEC_ID_DXA,
00164 CODEC_ID_DNXHD,
00165 CODEC_ID_THP,
00166 CODEC_ID_SGI,
00167 CODEC_ID_C93,
00168 CODEC_ID_BETHSOFTVID,
00169 CODEC_ID_PTX,
00170 CODEC_ID_TXD,
00171 CODEC_ID_VP6A,
00172 CODEC_ID_AMV,
00173 CODEC_ID_VB,
00174
00175
00176 CODEC_ID_PCM_S16LE= 0x10000,
00177 CODEC_ID_PCM_S16BE,
00178 CODEC_ID_PCM_U16LE,
00179 CODEC_ID_PCM_U16BE,
00180 CODEC_ID_PCM_S8,
00181 CODEC_ID_PCM_U8,
00182 CODEC_ID_PCM_MULAW,
00183 CODEC_ID_PCM_ALAW,
00184 CODEC_ID_PCM_S32LE,
00185 CODEC_ID_PCM_S32BE,
00186 CODEC_ID_PCM_U32LE,
00187 CODEC_ID_PCM_U32BE,
00188 CODEC_ID_PCM_S24LE,
00189 CODEC_ID_PCM_S24BE,
00190 CODEC_ID_PCM_U24LE,
00191 CODEC_ID_PCM_U24BE,
00192 CODEC_ID_PCM_S24DAUD,
00193 CODEC_ID_PCM_ZORK,
00194
00195
00196 CODEC_ID_ADPCM_IMA_QT= 0x11000,
00197 CODEC_ID_ADPCM_IMA_WAV,
00198 CODEC_ID_ADPCM_IMA_DK3,
00199 CODEC_ID_ADPCM_IMA_DK4,
00200 CODEC_ID_ADPCM_IMA_WS,
00201 CODEC_ID_ADPCM_IMA_SMJPEG,
00202 CODEC_ID_ADPCM_MS,
00203 CODEC_ID_ADPCM_4XM,
00204 CODEC_ID_ADPCM_XA,
00205 CODEC_ID_ADPCM_ADX,
00206 CODEC_ID_ADPCM_EA,
00207 CODEC_ID_ADPCM_G726,
00208 CODEC_ID_ADPCM_CT,
00209 CODEC_ID_ADPCM_SWF,
00210 CODEC_ID_ADPCM_YAMAHA,
00211 CODEC_ID_ADPCM_SBPRO_4,
00212 CODEC_ID_ADPCM_SBPRO_3,
00213 CODEC_ID_ADPCM_SBPRO_2,
00214 CODEC_ID_ADPCM_THP,
00215 CODEC_ID_ADPCM_IMA_AMV,
00216 CODEC_ID_ADPCM_EA_R1,
00217 CODEC_ID_ADPCM_EA_R3,
00218 CODEC_ID_ADPCM_EA_R2,
00219 CODEC_ID_ADPCM_IMA_EA_SEAD,
00220 CODEC_ID_ADPCM_IMA_EA_EACS,
00221 CODEC_ID_ADPCM_EA_XAS,
00222
00223
00224 CODEC_ID_AMR_NB= 0x12000,
00225 CODEC_ID_AMR_WB,
00226
00227
00228 CODEC_ID_RA_144= 0x13000,
00229 CODEC_ID_RA_288,
00230
00231
00232 CODEC_ID_ROQ_DPCM= 0x14000,
00233 CODEC_ID_INTERPLAY_DPCM,
00234 CODEC_ID_XAN_DPCM,
00235 CODEC_ID_SOL_DPCM,
00236
00237 CODEC_ID_MP2= 0x15000,
00238 CODEC_ID_MP3,
00239 CODEC_ID_AAC,
00240 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00241 CODEC_ID_MPEG4AAC,
00242 #endif
00243 CODEC_ID_AC3,
00244 CODEC_ID_DTS,
00245 CODEC_ID_VORBIS,
00246 CODEC_ID_DVAUDIO,
00247 CODEC_ID_WMAV1,
00248 CODEC_ID_WMAV2,
00249 CODEC_ID_MACE3,
00250 CODEC_ID_MACE6,
00251 CODEC_ID_VMDAUDIO,
00252 CODEC_ID_SONIC,
00253 CODEC_ID_SONIC_LS,
00254 CODEC_ID_FLAC,
00255 CODEC_ID_MP3ADU,
00256 CODEC_ID_MP3ON4,
00257 CODEC_ID_SHORTEN,
00258 CODEC_ID_ALAC,
00259 CODEC_ID_WESTWOOD_SND1,
00260 CODEC_ID_GSM,
00261 CODEC_ID_QDM2,
00262 CODEC_ID_COOK,
00263 CODEC_ID_TRUESPEECH,
00264 CODEC_ID_TTA,
00265 CODEC_ID_SMACKAUDIO,
00266 CODEC_ID_QCELP,
00267 CODEC_ID_WAVPACK,
00268 CODEC_ID_DSICINAUDIO,
00269 CODEC_ID_IMC,
00270 CODEC_ID_MUSEPACK7,
00271 CODEC_ID_MLP,
00272 CODEC_ID_GSM_MS,
00273 CODEC_ID_ATRAC3,
00274 CODEC_ID_VOXWARE,
00275 CODEC_ID_APE,
00276 CODEC_ID_NELLYMOSER,
00277 CODEC_ID_MUSEPACK8,
00278
00279
00280 CODEC_ID_DVD_SUBTITLE= 0x17000,
00281 CODEC_ID_DVB_SUBTITLE,
00282 CODEC_ID_TEXT,
00283 CODEC_ID_XSUB,
00284
00285
00286 CODEC_ID_MPEG2VBI,
00287 CODEC_ID_DVB_VBI,
00288
00289
00290 CODEC_ID_DSMCC_B,
00291
00292 CODEC_ID_MPEG2TS= 0x20000,
00293
00294 };
00295
00296 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00297
00298 #define CODEC_ID_MP3LAME CODEC_ID_MP3
00299 #define CODEC_ID_MPEG4AAC CODEC_ID_AAC
00300 #endif
00301
00302 enum CodecType {
00303 CODEC_TYPE_UNKNOWN = -1,
00304 CODEC_TYPE_VIDEO,
00305 CODEC_TYPE_AUDIO,
00306 CODEC_TYPE_DATA,
00307 CODEC_TYPE_SUBTITLE,
00308 CODEC_TYPE_NB
00309 };
00310
00311
00312
00313 enum SampleFormat {
00314 SAMPLE_FMT_NONE = -1,
00315 SAMPLE_FMT_U8,
00316 SAMPLE_FMT_S16,
00317 SAMPLE_FMT_S24,
00318 SAMPLE_FMT_S32,
00319 SAMPLE_FMT_FLT,
00320 };
00321
00322
00323 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00324
00332 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00333
00338 #define FF_MIN_BUFFER_SIZE 16384
00339
00340
00341 enum Motion_Est_ID {
00342 ME_ZERO = 1,
00343 ME_FULL,
00344 ME_LOG,
00345 ME_PHODS,
00346 ME_EPZS,
00347 ME_X1,
00348 ME_HEX,
00349 ME_UMH,
00350 ME_ITER,
00351 };
00352
00353 enum AVDiscard{
00354
00355
00356 AVDISCARD_NONE =-16,
00357 AVDISCARD_DEFAULT= 0,
00358 AVDISCARD_NONREF = 8,
00359 AVDISCARD_BIDIR = 16,
00360 AVDISCARD_NONKEY = 32,
00361 AVDISCARD_ALL = 48,
00362 };
00363
00364 typedef struct RcOverride{
00365 int start_frame;
00366 int end_frame;
00367 int qscale;
00368 float quality_factor;
00369 } RcOverride;
00370
00371 #define FF_MAX_B_FRAMES 16
00372
00373
00374
00375
00376
00377
00378 #define CODEC_FLAG_QSCALE 0x0002
00379 #define CODEC_FLAG_4MV 0x0004
00380 #define CODEC_FLAG_QPEL 0x0010
00381 #define CODEC_FLAG_GMC 0x0020
00382 #define CODEC_FLAG_MV0 0x0040
00383 #define CODEC_FLAG_PART 0x0080
00384
00385
00386
00387 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00388 #define CODEC_FLAG_PASS1 0x0200
00389 #define CODEC_FLAG_PASS2 0x0400
00390 #define CODEC_FLAG_EXTERN_HUFF 0x1000
00391 #define CODEC_FLAG_GRAY 0x2000
00392 #define CODEC_FLAG_EMU_EDGE 0x4000
00393 #define CODEC_FLAG_PSNR 0x8000
00394 #define CODEC_FLAG_TRUNCATED 0x00010000
00396 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
00397 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
00398 #define CODEC_FLAG_LOW_DELAY 0x00080000
00399 #define CODEC_FLAG_ALT_SCAN 0x00100000
00400 #define CODEC_FLAG_TRELLIS_QUANT 0x00200000
00401 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
00402 #define CODEC_FLAG_BITEXACT 0x00800000
00403
00404 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00405 #define CODEC_FLAG_H263P_AIC 0x01000000
00406 #endif
00407 #define CODEC_FLAG_AC_PRED 0x01000000
00408 #define CODEC_FLAG_H263P_UMV 0x02000000
00409 #define CODEC_FLAG_CBP_RD 0x04000000
00410 #define CODEC_FLAG_QP_RD 0x08000000
00411 #define CODEC_FLAG_H263P_AIV 0x00000008
00412 #define CODEC_FLAG_OBMC 0x00000001
00413 #define CODEC_FLAG_LOOP_FILTER 0x00000800
00414 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00415 #define CODEC_FLAG_INTERLACED_ME 0x20000000
00416 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000
00417 #define CODEC_FLAG_CLOSED_GOP ((int)0x80000000)
00418 #define CODEC_FLAG2_FAST 0x00000001
00419 #define CODEC_FLAG2_STRICT_GOP 0x00000002
00420 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
00421 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
00422 #define CODEC_FLAG2_BPYRAMID 0x00000010
00423 #define CODEC_FLAG2_WPRED 0x00000020
00424 #define CODEC_FLAG2_MIXED_REFS 0x00000040
00425 #define CODEC_FLAG2_8X8DCT 0x00000080
00426 #define CODEC_FLAG2_FASTPSKIP 0x00000100
00427 #define CODEC_FLAG2_AUD 0x00000200
00428 #define CODEC_FLAG2_BRDO 0x00000400
00429 #define CODEC_FLAG2_INTRA_VLC 0x00000800
00430 #define CODEC_FLAG2_MEMC_ONLY 0x00001000
00431 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
00432 #define CODEC_FLAG2_SKIP_RD 0x00004000
00433 #define CODEC_FLAG2_CHUNKS 0x00008000
00434 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000
00435
00436
00437
00438
00439
00440
00441
00442
00443 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
00444
00448 #define CODEC_CAP_DR1 0x0002
00449
00450 #define CODEC_CAP_PARSE_ONLY 0x0004
00451 #define CODEC_CAP_TRUNCATED 0x0008
00452
00453 #define CODEC_CAP_HWACCEL 0x0010
00454
00458 #define CODEC_CAP_DELAY 0x0020
00459
00463 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00464
00465
00466 #define MB_TYPE_INTRA4x4 0x0001
00467 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00468 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
00469 #define MB_TYPE_16x16 0x0008
00470 #define MB_TYPE_16x8 0x0010
00471 #define MB_TYPE_8x16 0x0020
00472 #define MB_TYPE_8x8 0x0040
00473 #define MB_TYPE_INTERLACED 0x0080
00474 #define MB_TYPE_DIRECT2 0x0100 //FIXME
00475 #define MB_TYPE_ACPRED 0x0200
00476 #define MB_TYPE_GMC 0x0400
00477 #define MB_TYPE_SKIP 0x0800
00478 #define MB_TYPE_P0L0 0x1000
00479 #define MB_TYPE_P1L0 0x2000
00480 #define MB_TYPE_P0L1 0x4000
00481 #define MB_TYPE_P1L1 0x8000
00482 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00483 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00484 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
00485 #define MB_TYPE_QUANT 0x00010000
00486 #define MB_TYPE_CBP 0x00020000
00487
00488
00494 typedef struct AVPanScan{
00500 int id;
00501
00507 int width;
00508 int height;
00509
00515 int16_t position[3][2];
00516 }AVPanScan;
00517
00518 #define FF_COMMON_FRAME \
00519 \
00525 uint8_t *data[4];\
00526 int linesize[4];\
00527 \
00533 uint8_t *base[4];\
00534 \
00539 int key_frame;\
00540 \
00541 \
00546 int pict_type;\
00547 \
00548 \
00554 int64_t pts;\
00555 \
00556 \
00561 int coded_picture_number;\
00562 \
00567 int display_picture_number;\
00568 \
00569 \
00574 int quality; \
00575 \
00576 \
00582 int age;\
00583 \
00584 \
00589 int reference;\
00590 \
00591 \
00596 int8_t *qscale_table;\
00597 \
00602 int qstride;\
00603 \
00604 \
00610 uint8_t *mbskip_table;\
00611 \
00612 \
00624 int16_t (*motion_val[2])[2];\
00625 \
00626 \
00632 uint32_t *mb_type;\
00633 \
00634 \
00640 uint8_t motion_subsample_log2;\
00641 \
00642 \
00647 void *opaque;\
00648 \
00649 \
00654 uint64_t error[4];\
00655 \
00656 \
00662 int type;\
00663 \
00664 \
00670 int repeat_pict;\
00671 \
00672 \
00675 int qscale_type;\
00676 \
00677 \
00682 int interlaced_frame;\
00683 \
00684 \
00689 int top_field_first;\
00690 \
00691 \
00696 AVPanScan *pan_scan;\
00697 \
00698 \
00703 int palette_has_changed;\
00704 \
00705 \
00710 int buffer_hints;\
00711 \
00712 \
00717 short *dct_coeff;\
00718 \
00719 \
00724 int8_t *ref_index[2];\
00725 \
00726 \
00729 uint8_t atsc_cc_buf[1024];\
00730 int atsc_cc_len;\
00731 \
00732 \
00736 uint8_t dvb_cc_buf[128];\
00737 int dvb_cc_len;\
00738 \
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
00765 typedef struct AVFrame {
00766 FF_COMMON_FRAME
00767 } AVFrame;
00768
00769 #define DEFAULT_FRAME_RATE_BASE 1001000
00770
00774 typedef struct AVCodecContext {
00779 AVClass *av_class;
00785 int bit_rate;
00786
00793 int bit_rate_tolerance;
00794
00800 int flags;
00801
00810 int sub_id;
00811
00819 int me_method;
00820
00832 uint8_t *extradata;
00833 int extradata_size;
00834
00843 AVRational time_base;
00844
00845
00853 int width, height;
00854
00855 #define FF_ASPECT_EXTENDED 15
00856
00862 int gop_size;
00863
00869 enum PixelFormat pix_fmt;
00870
00877 int rate_emu;
00878
00891 void (*draw_horiz_band)(struct AVCodecContext *s,
00892 const AVFrame *src, int offset[4],
00893 int y, int type, int height);
00894
00895
00896 int sample_rate;
00897 int channels;
00898
00904 enum SampleFormat sample_fmt;
00905
00906
00910 int frame_size;
00911 int frame_number;
00912 int real_pict_num;
00913
00920 int delay;
00921
00929 int avcodec_dual_language;
00930
00931
00932 float qcompress;
00933 float qblur;
00934
00940 int qmin;
00941
00947 int qmax;
00948
00954 int max_qdiff;
00955
00962 int max_b_frames;
00963
00969 float b_quant_factor;
00970
00972 int rc_strategy;
00973 #define FF_RC_STRATEGY_XVID 1
00974
00975 int b_frame_strategy;
00976
00983 int hurry_up;
00984
00985 struct AVCodec *codec;
00986
00987 void *priv_data;
00988
00989 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00990
00991 int rtp_mode;
00992 #endif
00993
00994 int rtp_payload_size;
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01009
01010
01011 int mv_bits;
01012 int header_bits;
01013 int i_tex_bits;
01014 int p_tex_bits;
01015 int i_count;
01016 int p_count;
01017 int skip_count;
01018 int misc_bits;
01019
01025 int frame_bits;
01026
01032 void *opaque;
01033
01034 char codec_name[32];
01035 enum CodecType codec_type;
01036 enum CodecID codec_id;
01037
01051 unsigned int codec_tag;
01052
01058 int workaround_bugs;
01059 #define FF_BUG_AUTODETECT 1
01060 #define FF_BUG_OLD_MSMPEG4 2
01061 #define FF_BUG_XVID_ILACE 4
01062 #define FF_BUG_UMP4 8
01063 #define FF_BUG_NO_PADDING 16
01064 #define FF_BUG_AMV 32
01065 #define FF_BUG_AC_VLC 0
01066 #define FF_BUG_QPEL_CHROMA 64
01067 #define FF_BUG_STD_QPEL 128
01068 #define FF_BUG_QPEL_CHROMA2 256
01069 #define FF_BUG_DIRECT_BLOCKSIZE 512
01070 #define FF_BUG_EDGE 1024
01071 #define FF_BUG_HPEL_CHROMA 2048
01072 #define FF_BUG_DC_CLIP 4096
01073 #define FF_BUG_MS 8192
01074 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
01075
01081 int luma_elim_threshold;
01082
01088 int chroma_elim_threshold;
01089
01095 int strict_std_compliance;
01096 #define FF_COMPLIANCE_VERY_STRICT 2
01097 #define FF_COMPLIANCE_STRICT 1
01098 #define FF_COMPLIANCE_NORMAL 0
01099 #define FF_COMPLIANCE_INOFFICIAL -1
01100 #define FF_COMPLIANCE_EXPERIMENTAL -2
01101
01102
01109 float b_quant_offset;
01110
01117 int error_resilience;
01118 #define FF_ER_CAREFUL 1
01119 #define FF_ER_COMPLIANT 2
01120 #define FF_ER_AGGRESSIVE 3
01121 #define FF_ER_VERY_AGGRESSIVE 4
01122
01131 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01132
01140 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01141
01147 int has_b_frames;
01148
01153 int block_align;
01154
01155 int parse_only;
01156
01157
01158
01164 int mpeg_quant;
01165
01171 char *stats_out;
01172
01179 char *stats_in;
01180
01187 float rc_qsquish;
01188
01189 float rc_qmod_amp;
01190 int rc_qmod_freq;
01191
01197 RcOverride *rc_override;
01198 int rc_override_count;
01199
01205 char *rc_eq;
01206
01212 int rc_max_rate;
01213
01219 int rc_min_rate;
01220
01226 int rc_buffer_size;
01227 float rc_buffer_aggressivity;
01228
01236 float i_quant_factor;
01237
01243 float i_quant_offset;
01244
01250 float rc_initial_cplx;
01251
01257 int dct_algo;
01258 #define FF_DCT_AUTO 0
01259 #define FF_DCT_FASTINT 1
01260 #define FF_DCT_INT 2
01261 #define FF_DCT_MMX 3
01262 #define FF_DCT_MLIB 4
01263 #define FF_DCT_ALTIVEC 5
01264 #define FF_DCT_FAAN 6
01265
01271 float lumi_masking;
01272
01278 float temporal_cplx_masking;
01279
01285 float spatial_cplx_masking;
01286
01292 float p_masking;
01293
01299 float dark_masking;
01300
01301
01302
01303 int unused;
01304
01310 int idct_algo;
01311 #define FF_IDCT_AUTO 0
01312 #define FF_IDCT_INT 1
01313 #define FF_IDCT_SIMPLE 2
01314 #define FF_IDCT_SIMPLEMMX 3
01315 #define FF_IDCT_LIBMPEG2MMX 4
01316 #define FF_IDCT_PS2 5
01317 #define FF_IDCT_MLIB 6
01318 #define FF_IDCT_ARM 7
01319 #define FF_IDCT_ALTIVEC 8
01320 #define FF_IDCT_SH4 9
01321 #define FF_IDCT_SIMPLEARM 10
01322 #define FF_IDCT_H264 11
01323 #define FF_IDCT_VP3 12
01324 #define FF_IDCT_IPP 13
01325 #define FF_IDCT_XVIDMMX 14
01326 #define FF_IDCT_CAVS 15
01327 #define FF_IDCT_SIMPLEARMV5TE 16
01328 #define FF_IDCT_SIMPLEARMV6 17
01329 #define FF_IDCT_SIMPLEVIS 18
01330 #define FF_IDCT_WMV2 19
01331
01337 int slice_count;
01343 int *slice_offset;
01344
01350 int error_concealment;
01351 #define FF_EC_GUESS_MVS 1
01352 #define FF_EC_DEBLOCK 2
01353
01362 unsigned dsp_mask;
01363 #define FF_MM_FORCE 0x80000000
01364
01365 #define FF_MM_MMX 0x0001
01366 #define FF_MM_3DNOW 0x0004
01367 #define FF_MM_MMXEXT 0x0002
01368 #define FF_MM_SSE 0x0008
01369 #define FF_MM_SSE2 0x0010
01370 #define FF_MM_3DNOWEXT 0x0020
01371 #define FF_MM_SSE3 0x0040
01372 #define FF_MM_SSSE3 0x0080
01373 #define FF_MM_IWMMXT 0x0100
01374
01380 int bits_per_sample;
01381
01387 int prediction_method;
01388 #define FF_PRED_LEFT 0
01389 #define FF_PRED_PLANE 1
01390 #define FF_PRED_MEDIAN 2
01391
01398 AVRational sample_aspect_ratio;
01399
01405 AVFrame *coded_frame;
01406
01412 int debug;
01413 #define FF_DEBUG_PICT_INFO 1
01414 #define FF_DEBUG_RC 2
01415 #define FF_DEBUG_BITSTREAM 4
01416 #define FF_DEBUG_MB_TYPE 8
01417 #define FF_DEBUG_QP 16
01418 #define FF_DEBUG_MV 32
01419 #define FF_DEBUG_DCT_COEFF 0x00000040
01420 #define FF_DEBUG_SKIP 0x00000080
01421 #define FF_DEBUG_STARTCODE 0x00000100
01422 #define FF_DEBUG_PTS 0x00000200
01423 #define FF_DEBUG_ER 0x00000400
01424 #define FF_DEBUG_MMCO 0x00000800
01425 #define FF_DEBUG_BUGS 0x00001000
01426 #define FF_DEBUG_VIS_QP 0x00002000
01427 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01428
01434 int debug_mv;
01435 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
01436 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
01437 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01438
01444 uint64_t error[4];
01445
01451 int mb_qmin;
01452
01458 int mb_qmax;
01459
01465 int me_cmp;
01471 int me_sub_cmp;
01477 int mb_cmp;
01483 int ildct_cmp;
01484 #define FF_CMP_SAD 0
01485 #define FF_CMP_SSE 1
01486 #define FF_CMP_SATD 2
01487 #define FF_CMP_DCT 3
01488 #define FF_CMP_PSNR 4
01489 #define FF_CMP_BIT 5
01490 #define FF_CMP_RD 6
01491 #define FF_CMP_ZERO 7
01492 #define FF_CMP_VSAD 8
01493 #define FF_CMP_VSSE 9
01494 #define FF_CMP_NSSE 10
01495 #define FF_CMP_W53 11
01496 #define FF_CMP_W97 12
01497 #define FF_CMP_DCTMAX 13
01498 #define FF_CMP_DCT264 14
01499 #define FF_CMP_CHROMA 256
01500
01506 int dia_size;
01507
01513 int last_predictor_count;
01514
01520 int pre_me;
01521
01527 int me_pre_cmp;
01528
01534 int pre_dia_size;
01535
01541 int me_subpel_quality;
01542
01552 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01553
01562 int dtg_active_format;
01563 #define FF_DTG_AFD_SAME 8
01564 #define FF_DTG_AFD_4_3 9
01565 #define FF_DTG_AFD_16_9 10
01566 #define FF_DTG_AFD_14_9 11
01567 #define FF_DTG_AFD_4_3_SP_14_9 13
01568 #define FF_DTG_AFD_16_9_SP_14_9 14
01569 #define FF_DTG_AFD_SP_4_3 15
01570
01578 int me_range;
01579
01585 int intra_quant_bias;
01586 #define FF_DEFAULT_QUANT_BIAS 999999
01587
01593 int inter_quant_bias;
01594
01601 int color_table_id;
01602
01607 int internal_buffer_count;
01608
01613 void *internal_buffer;
01614
01615 #define FF_LAMBDA_SHIFT 7
01616 #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01617 #define FF_QP2LAMBDA 118
01618 #define FF_LAMBDA_MAX (256*128-1)
01619
01620 #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01621
01627 int global_quality;
01628
01629 #define FF_CODER_TYPE_VLC 0
01630 #define FF_CODER_TYPE_AC 1
01631 #define FF_CODER_TYPE_RAW 2
01632 #define FF_CODER_TYPE_RLE 3
01633 #define FF_CODER_TYPE_DEFLATE 4
01634
01639 int coder_type;
01640
01646 int context_model;
01647 #if 0
01648
01653 uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01654 #endif
01655
01661 int slice_flags;
01662 #define SLICE_FLAG_CODED_ORDER 0x0001
01663 #define SLICE_FLAG_ALLOW_FIELD 0x0002
01664 #define SLICE_FLAG_ALLOW_PLANE 0x0004
01665
01666
01671 int xvmc_acceleration;
01672
01678 int mb_decision;
01679 #define FF_MB_DECISION_SIMPLE 0
01680 #define FF_MB_DECISION_BITS 1
01681 #define FF_MB_DECISION_RD 2
01682
01683
01688 uint16_t *intra_matrix;
01689
01695 uint16_t *inter_matrix;
01696
01703 unsigned int stream_codec_tag;
01704
01711 int scenechange_threshold;
01712
01718 int lmin;
01719
01725 int lmax;
01726
01732 struct AVPaletteControl *palctrl;
01733
01739 int noise_reduction;
01740
01750 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
01751
01757 int rc_initial_buffer_occupancy;
01758
01764 int inter_threshold;
01765
01771 int flags2;
01772
01778 int error_rate;
01779
01785 int antialias_algo;
01786 #define FF_AA_AUTO 0
01787 #define FF_AA_FASTINT 1 //not implemented yet
01788 #define FF_AA_INT 2
01789 #define FF_AA_FLOAT 3
01790
01795 int quantizer_noise_shaping;
01796
01803 int thread_count;
01804
01814 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
01815
01822 void *thread_opaque;
01823
01831 int me_threshold;
01832
01838 int mb_threshold;
01839
01845 int intra_dc_precision;
01846
01852 int nsse_weight;
01853
01859 int skip_top;
01860
01866 int skip_bottom;
01867
01873 int profile;
01874 #define FF_PROFILE_UNKNOWN -99
01875 #define FF_PROFILE_AAC_MAIN 0
01876 #define FF_PROFILE_AAC_LOW 1
01877 #define FF_PROFILE_AAC_SSR 2
01878 #define FF_PROFILE_AAC_LTP 3
01879
01885 int level;
01886 #define FF_LEVEL_UNKNOWN -99
01887
01893 int lowres;
01894
01901 int coded_width, coded_height;
01902
01908 int frame_skip_threshold;
01909
01915 int frame_skip_factor;
01916
01922 int frame_skip_exp;
01923
01929 int frame_skip_cmp;
01930
01937 float border_masking;
01938
01944 int mb_lmin;
01945
01951 int mb_lmax;
01952
01958 int me_penalty_compensation;
01959
01965 enum AVDiscard skip_loop_filter;
01966
01972 enum AVDiscard skip_idct;
01973
01979 enum AVDiscard skip_frame;
01980
01986 int bidir_refine;
01987
01993 int brd_scale;
01994
02000 float crf;
02001
02007 int cqp;
02008
02014 int keyint_min;
02015
02021 int refs;
02022
02028 int chromaoffset;
02029
02035 int bframebias;
02036
02042 int trellis;
02043
02049 float complexityblur;
02050
02057 int deblockalpha;
02058
02065 int deblockbeta;
02066
02072 int partitions;
02073 #define X264_PART_I4X4 0x001
02074 #define X264_PART_I8X8 0x002
02075 #define X264_PART_P8X8 0x010
02076 #define X264_PART_P4X4 0x020
02077 #define X264_PART_B8X8 0x100
02078
02084 int directpred;
02085
02091 int cutoff;
02092
02098 int scenechange_factor;
02099
02106 int mv0_threshold;
02107
02113 int b_sensitivity;
02114
02119 int compression_level;
02120 #define FF_COMPRESSION_DEFAULT -1
02121
02127 int use_lpc;
02128
02134 int lpc_coeff_precision;
02135
02140 int min_prediction_order;
02141
02146 int max_prediction_order;
02147
02153 int prediction_order_method;
02154
02159 int min_partition_order;
02160
02165 int max_partition_order;
02166
02172 int64_t timecode_frame_start;
02173
02179 int request_channels;
02185 int xvmc_vld_hwslice;
02186
02192 void (*decode_cc_dvd)(struct AVCodecContext *c, const uint8_t *buf, int buf_size);
02193
02201 void *dvdv;
02202 } AVCodecContext;
02203
02207 typedef struct AVCodec {
02214 const char *name;
02215 enum CodecType type;
02216 enum CodecID id;
02217 int priv_data_size;
02218 int (*init)(AVCodecContext *);
02219 int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02220 int (*close)(AVCodecContext *);
02221 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
02222 uint8_t *buf, int buf_size);
02223 int capabilities;
02224 struct AVCodec *next;
02225 void (*flush)(AVCodecContext *);
02226 const AVRational *supported_framerates;
02227 const enum PixelFormat *pix_fmts;
02228 } AVCodec;
02229
02234 typedef struct AVPicture {
02235 uint8_t *data[4];
02236 int linesize[4];
02237 } AVPicture;
02238
02247 #define AVPALETTE_SIZE 1024
02248 #define AVPALETTE_COUNT 256
02249 typedef struct AVPaletteControl {
02250
02251
02252
02253 int palette_changed;
02254
02255
02256
02257
02258
02259 unsigned int palette[AVPALETTE_COUNT];
02260
02261 } AVPaletteControl attribute_deprecated;
02262
02263 typedef struct AVSubtitleRect {
02264 uint16_t x;
02265 uint16_t y;
02266 uint16_t w;
02267 uint16_t h;
02268 uint16_t nb_colors;
02269 int linesize;
02270 uint32_t *rgba_palette;
02271 uint8_t *bitmap;
02272 } AVSubtitleRect;
02273
02274 typedef struct AVSubtitle {
02275 uint16_t format;
02276 uint32_t start_display_time;
02277 uint32_t end_display_time;
02278 uint32_t num_rects;
02279 AVSubtitleRect *rects;
02280 } AVSubtitle;
02281
02282
02283
02284
02285 struct ReSampleContext;
02286 struct AVResampleContext;
02287
02288 typedef struct ReSampleContext ReSampleContext;
02289
02290 ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02291 int output_rate, int input_rate);
02292 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02293 void audio_resample_close(ReSampleContext *s);
02294
02295 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02296 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02297 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
02298 void av_resample_close(struct AVResampleContext *c);
02299
02300 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02301
02302
02306 typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;
02307
02311 attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
02312 int input_width, int input_height);
02313
02317 attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
02318 int iwidth, int iheight,
02319 int topBand, int bottomBand,
02320 int leftBand, int rightBand,
02321 int padtop, int padbottom,
02322 int padleft, int padright);
02323
02327 attribute_deprecated void img_resample(struct ImgReSampleContext *s,
02328 AVPicture *output, const AVPicture *input);
02329
02333 attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);
02334
02335 #endif
02336
02346 int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
02347
02353 void avpicture_free(AVPicture *picture);
02354
02371 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
02372 int pix_fmt, int width, int height);
02373 int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
02374 unsigned char *dest, int dest_size);
02375
02385 int avpicture_get_size(int pix_fmt, int width, int height);
02386 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
02387 const char *avcodec_get_pix_fmt_name(int pix_fmt);
02388 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
02389 enum PixelFormat avcodec_get_pix_fmt(const char* name);
02390 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
02391
02392 #define FF_LOSS_RESOLUTION 0x0001
02393 #define FF_LOSS_DEPTH 0x0002
02394 #define FF_LOSS_COLORSPACE 0x0004
02395 #define FF_LOSS_ALPHA 0x0008
02396 #define FF_LOSS_COLORQUANT 0x0010
02397 #define FF_LOSS_CHROMA 0x0020
02416 int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
02417 int has_alpha);
02418
02441 int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
02442 int has_alpha, int *loss_ptr);
02443
02444
02455 void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
02456
02457 #define FF_ALPHA_TRANSP 0x0001
02458 #define FF_ALPHA_SEMI_TRANSP 0x0002
02459
02464 int img_get_alpha_info(const AVPicture *src,
02465 int pix_fmt, int width, int height);
02466
02467 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02468
02472 attribute_deprecated int img_convert(AVPicture *dst, int dst_pix_fmt,
02473 const AVPicture *src, int pix_fmt,
02474 int width, int height);
02475 #endif
02476
02477
02478
02479 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
02480 int pix_fmt, int width, int height);
02481
02482
02483
02484 extern AVCodec *first_avcodec;
02485
02486
02487 unsigned avcodec_version(void);
02488
02489 unsigned avcodec_build(void);
02490
02497 void avcodec_init(void);
02498
02499 void register_avcodec(AVCodec *format);
02500
02507 AVCodec *avcodec_find_encoder(enum CodecID id);
02508
02515 AVCodec *avcodec_find_encoder_by_name(const char *name);
02516
02523 AVCodec *avcodec_find_decoder(enum CodecID id);
02524
02531 AVCodec *avcodec_find_decoder_by_name(const char *name);
02532 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
02533
02539 void avcodec_get_context_defaults(AVCodecContext *s);
02540
02543 void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
02544
02552 AVCodecContext *avcodec_alloc_context(void);
02553
02556 AVCodecContext *avcodec_alloc_context2(enum CodecType);
02557
02563 void avcodec_get_frame_defaults(AVFrame *pic);
02564
02572 AVFrame *avcodec_alloc_frame(void);
02573
02574 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
02575 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
02576 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
02577 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
02578
02587 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
02588 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
02589
02590 int avcodec_thread_init(AVCodecContext *s, int thread_count);
02591 void avcodec_thread_free(AVCodecContext *s);
02592 int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
02593 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
02594
02595
02623 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
02624
02628 attribute_deprecated int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
02629 int *frame_size_ptr,
02630 uint8_t *buf, int buf_size);
02631
02668 int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
02669 int *frame_size_ptr,
02670 uint8_t *buf, int buf_size);
02671
02703 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
02704 int *got_picture_ptr,
02705 uint8_t *buf, int buf_size);
02706
02707
02708
02709
02710 int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
02711 int *got_sub_ptr,
02712 const uint8_t *buf, int buf_size);
02713 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
02714 int *data_size_ptr,
02715 uint8_t *buf, int buf_size);
02716
02733 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02734 const short *samples);
02735
02751 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02752 const AVFrame *pict);
02753 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
02754 const AVSubtitle *sub);
02755
02756 int avcodec_close(AVCodecContext *avctx);
02757
02758 void avcodec_register_all(void);
02759
02763 void avcodec_flush_buffers(AVCodecContext *avctx);
02764
02765 void avcodec_default_free_buffers(AVCodecContext *s);
02766
02767
02768
02775 char av_get_pict_type_char(int pict_type);
02776
02783 int av_get_bits_per_sample(enum CodecID codec_id);
02784
02791 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
02792
02793
02794 typedef struct AVCodecParserContext {
02795 void *priv_data;
02796 struct AVCodecParser *parser;
02797 int64_t frame_offset;
02798 int64_t cur_offset;
02799
02800 int64_t last_frame_offset;
02801
02802 int pict_type;
02803 int repeat_pict;
02804 int64_t pts;
02805 int64_t dts;
02806
02807
02808 int64_t last_pts;
02809 int64_t last_dts;
02810 int fetch_timestamp;
02811
02812 #define AV_PARSER_PTS_NB 4
02813 int cur_frame_start_index;
02814 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
02815 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
02816 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
02817
02818 int flags;
02819 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
02820
02821 int64_t offset;
02822 int64_t last_offset;
02823 } AVCodecParserContext;
02824
02825 typedef struct AVCodecParser {
02826 int codec_ids[5];
02827 int priv_data_size;
02828 int (*parser_init)(AVCodecParserContext *s);
02829 int (*parser_parse)(AVCodecParserContext *s,
02830 AVCodecContext *avctx,
02831 const uint8_t **poutbuf, int *poutbuf_size,
02832 const uint8_t *buf, int buf_size);
02833 void (*parser_close)(AVCodecParserContext *s);
02834 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
02835 struct AVCodecParser *next;
02836 } AVCodecParser;
02837
02838 extern AVCodecParser *av_first_parser;
02839
02840 void av_register_codec_parser(AVCodecParser *parser);
02841 AVCodecParserContext *av_parser_init(int codec_id);
02842 int av_parser_parse(AVCodecParserContext *s,
02843 AVCodecContext *avctx,
02844 uint8_t **poutbuf, int *poutbuf_size,
02845 const uint8_t *buf, int buf_size,
02846 int64_t pts, int64_t dts);
02847 int av_parser_change(AVCodecParserContext *s,
02848 AVCodecContext *avctx,
02849 uint8_t **poutbuf, int *poutbuf_size,
02850 const uint8_t *buf, int buf_size, int keyframe);
02851 void av_parser_close(AVCodecParserContext *s);
02852
02853
02854 typedef struct AVBitStreamFilterContext {
02855 void *priv_data;
02856 struct AVBitStreamFilter *filter;
02857 AVCodecParserContext *parser;
02858 struct AVBitStreamFilterContext *next;
02859 } AVBitStreamFilterContext;
02860
02861
02862 typedef struct AVBitStreamFilter {
02863 const char *name;
02864 int priv_data_size;
02865 int (*filter)(AVBitStreamFilterContext *bsfc,
02866 AVCodecContext *avctx, const char *args,
02867 uint8_t **poutbuf, int *poutbuf_size,
02868 const uint8_t *buf, int buf_size, int keyframe);
02869 void (*close)(AVBitStreamFilterContext *bsfc);
02870 struct AVBitStreamFilter *next;
02871 } AVBitStreamFilter;
02872
02873 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
02874 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
02875 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
02876 AVCodecContext *avctx, const char *args,
02877 uint8_t **poutbuf, int *poutbuf_size,
02878 const uint8_t *buf, int buf_size, int keyframe);
02879 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
02880
02881
02882
02883
02890 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
02891
02892
02893
02902 attribute_deprecated void av_free_static(void);
02903
02914 attribute_deprecated void *av_mallocz_static(unsigned int size);
02915
02919 void av_picture_copy(AVPicture *dst, const AVPicture *src,
02920 int pix_fmt, int width, int height);
02921
02925 int av_picture_crop(AVPicture *dst, const AVPicture *src,
02926 int pix_fmt, int top_band, int left_band);
02927
02931 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
02932 int padtop, int padbottom, int padleft, int padright, int *color);
02933
02934 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02935
02938 attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
02939 int pix_fmt, int width, int height);
02940
02944 attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
02945 int pix_fmt, int top_band, int left_band);
02946
02950 attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
02951 int padtop, int padbottom, int padleft, int padright, int *color);
02952 #endif
02953
02954 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
02955
02956 void avcodec_default_decode_cc_dvd(AVCodecContext *c, const uint8_t *buf, int buf_size);
02957 void avcodec_default_decode_cc_atsc(AVCodecContext *c, const uint8_t *buf, int buf_size);
02958 const char *codec_id_string(enum CodecID codec_id);
02959 const char *codec_type_string(enum CodecType codec_type);
02960
02972 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
02973
02983 int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
02984
02985
02986 #if EINVAL > 0
02987 #define AVERROR(e) (-(e))
02988 #define AVUNERROR(e) (-(e))
02989 #else
02990
02991 #define AVERROR(e) (e)
02992 #define AVUNERROR(e) (e)
02993 #endif
02994 #define AVERROR_UNKNOWN AVERROR(EINVAL)
02995 #define AVERROR_IO AVERROR(EIO)
02996 #define AVERROR_NUMEXPECTED AVERROR(EDOM)
02997 #define AVERROR_INVALIDDATA AVERROR(EINVAL)
02998 #define AVERROR_NOMEM AVERROR(ENOMEM)
02999 #define AVERROR_NOFMT AVERROR(EILSEQ)
03000 #define AVERROR_NOTSUPP AVERROR(ENOSYS)
03001 #define AVERROR_NOENT AVERROR(ENOENT)
03002 #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E')
03004 #endif