• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/avcodec.h

Go to the documentation of this file.
00001 /*
00002  * copyright (c) 2001 Fabrice Bellard
00003  *
00004  * This file is part of FFmpeg.
00005  *
00006  * FFmpeg is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * FFmpeg is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with FFmpeg; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 72
00034 #define LIBAVCODEC_VERSION_MICRO  2
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     /* video codecs */
00066     CODEC_ID_MPEG1VIDEO,
00067     CODEC_ID_MPEG2VIDEO, 
00068     CODEC_ID_MPEG2VIDEO_XVMC,
00069     CODEC_ID_H261,
00070     CODEC_ID_H263,
00071     CODEC_ID_RV10,
00072     CODEC_ID_RV20,
00073     CODEC_ID_MJPEG,
00074     CODEC_ID_MJPEGB,
00075     CODEC_ID_LJPEG,
00076     CODEC_ID_SP5X,
00077     CODEC_ID_JPEGLS,
00078     CODEC_ID_MPEG4,
00079     CODEC_ID_RAWVIDEO,
00080     CODEC_ID_MSMPEG4V1,
00081     CODEC_ID_MSMPEG4V2,
00082     CODEC_ID_MSMPEG4V3,
00083     CODEC_ID_WMV1,
00084     CODEC_ID_WMV2,
00085     CODEC_ID_H263P,
00086     CODEC_ID_H263I,
00087     CODEC_ID_FLV1,
00088     CODEC_ID_SVQ1,
00089     CODEC_ID_SVQ3,
00090     CODEC_ID_DVVIDEO,
00091     CODEC_ID_HUFFYUV,
00092     CODEC_ID_CYUV,
00093     CODEC_ID_H264,
00094     CODEC_ID_INDEO3,
00095     CODEC_ID_VP3,
00096     CODEC_ID_THEORA,
00097     CODEC_ID_ASV1,
00098     CODEC_ID_ASV2,
00099     CODEC_ID_FFV1,
00100     CODEC_ID_4XM,
00101     CODEC_ID_VCR1,
00102     CODEC_ID_CLJR,
00103     CODEC_ID_MDEC,
00104     CODEC_ID_ROQ,
00105     CODEC_ID_INTERPLAY_VIDEO,
00106     CODEC_ID_XAN_WC3,
00107     CODEC_ID_XAN_WC4,
00108     CODEC_ID_RPZA,
00109     CODEC_ID_CINEPAK,
00110     CODEC_ID_WS_VQA,
00111     CODEC_ID_MSRLE,
00112     CODEC_ID_MSVIDEO1,
00113     CODEC_ID_IDCIN,
00114     CODEC_ID_8BPS,
00115     CODEC_ID_SMC,
00116     CODEC_ID_FLIC,
00117     CODEC_ID_TRUEMOTION1,
00118     CODEC_ID_VMDVIDEO,
00119     CODEC_ID_MSZH,
00120     CODEC_ID_ZLIB,
00121     CODEC_ID_QTRLE,
00122     CODEC_ID_SNOW,
00123     CODEC_ID_TSCC,
00124     CODEC_ID_ULTI,
00125     CODEC_ID_QDRAW,
00126     CODEC_ID_VIXL,
00127     CODEC_ID_QPEG,
00128 #if LIBAVCODEC_VERSION_MAJOR < 53
00129     CODEC_ID_XVID,
00130 #endif
00131     CODEC_ID_PNG,
00132     CODEC_ID_PPM,
00133     CODEC_ID_PBM,
00134     CODEC_ID_PGM,
00135     CODEC_ID_PGMYUV,
00136     CODEC_ID_PAM,
00137     CODEC_ID_FFVHUFF,
00138     CODEC_ID_RV30,
00139     CODEC_ID_RV40,
00140     CODEC_ID_VC1,
00141     CODEC_ID_WMV3,
00142     CODEC_ID_LOCO,
00143     CODEC_ID_WNV1,
00144     CODEC_ID_AASC,
00145     CODEC_ID_INDEO2,
00146     CODEC_ID_FRAPS,
00147     CODEC_ID_TRUEMOTION2,
00148     CODEC_ID_BMP,
00149     CODEC_ID_CSCD,
00150     CODEC_ID_MMVIDEO,
00151     CODEC_ID_ZMBV,
00152     CODEC_ID_AVS,
00153     CODEC_ID_SMACKVIDEO,
00154     CODEC_ID_NUV,
00155     CODEC_ID_KMVC,
00156     CODEC_ID_FLASHSV,
00157     CODEC_ID_CAVS,
00158     CODEC_ID_JPEG2000,
00159     CODEC_ID_VMNC,
00160     CODEC_ID_VP5,
00161     CODEC_ID_VP6,
00162     CODEC_ID_VP6F,
00163     CODEC_ID_TARGA,
00164     CODEC_ID_DSICINVIDEO,
00165     CODEC_ID_TIERTEXSEQVIDEO,
00166     CODEC_ID_TIFF,
00167     CODEC_ID_GIF,
00168     CODEC_ID_FFH264,
00169     CODEC_ID_DXA,
00170     CODEC_ID_DNXHD,
00171     CODEC_ID_THP,
00172     CODEC_ID_SGI,
00173     CODEC_ID_C93,
00174     CODEC_ID_BETHSOFTVID,
00175     CODEC_ID_PTX,
00176     CODEC_ID_TXD,
00177     CODEC_ID_VP6A,
00178     CODEC_ID_AMV,
00179     CODEC_ID_VB,
00180     CODEC_ID_PCX,
00181     CODEC_ID_SUNRAST,
00182     CODEC_ID_INDEO4,
00183     CODEC_ID_INDEO5,
00184     CODEC_ID_MIMIC,
00185     CODEC_ID_RL2,
00186     CODEC_ID_8SVX_EXP,
00187     CODEC_ID_8SVX_FIB,
00188     CODEC_ID_ESCAPE124,
00189     CODEC_ID_DIRAC,
00190     CODEC_ID_BFI,
00191     CODEC_ID_CMV,
00192     CODEC_ID_MOTIONPIXELS,
00193     CODEC_ID_TGV,
00194     CODEC_ID_TGQ,
00195     CODEC_ID_TQI,
00196     CODEC_ID_AURA,
00197     CODEC_ID_AURA2,
00198     CODEC_ID_V210X,
00199     CODEC_ID_TMV,
00200     CODEC_ID_V210,
00201     CODEC_ID_DPX,
00202     CODEC_ID_MAD,
00203     CODEC_ID_FRWU,
00204     CODEC_ID_FLASHSV2,
00205     CODEC_ID_CDGRAPHICS,
00206     CODEC_ID_R210,
00207     CODEC_ID_ANM,
00208     CODEC_ID_BINKVIDEO,
00209     CODEC_ID_IFF_ILBM,
00210     CODEC_ID_IFF_BYTERUN1,
00211     CODEC_ID_KGV1,
00212     CODEC_ID_YOP,
00213     CODEC_ID_VP8,
00214 
00215     /* various PCM "codecs" */
00216     CODEC_ID_PCM_S16LE= 0x10000,
00217     CODEC_ID_PCM_S16BE,
00218     CODEC_ID_PCM_U16LE,
00219     CODEC_ID_PCM_U16BE,
00220     CODEC_ID_PCM_S8,
00221     CODEC_ID_PCM_U8,
00222     CODEC_ID_PCM_MULAW,
00223     CODEC_ID_PCM_ALAW,
00224     CODEC_ID_PCM_S32LE,
00225     CODEC_ID_PCM_S32BE,
00226     CODEC_ID_PCM_U32LE,
00227     CODEC_ID_PCM_U32BE,
00228     CODEC_ID_PCM_S24LE,
00229     CODEC_ID_PCM_S24BE,
00230     CODEC_ID_PCM_U24LE,
00231     CODEC_ID_PCM_U24BE,
00232     CODEC_ID_PCM_S24DAUD,
00233     CODEC_ID_PCM_ZORK,
00234     CODEC_ID_PCM_S16LE_PLANAR,
00235     CODEC_ID_PCM_DVD,
00236     CODEC_ID_PCM_F32BE,
00237     CODEC_ID_PCM_F32LE,
00238     CODEC_ID_PCM_F64BE,
00239     CODEC_ID_PCM_F64LE,
00240     CODEC_ID_PCM_BLURAY,
00241 
00242     /* various ADPCM codecs */
00243     CODEC_ID_ADPCM_IMA_QT= 0x11000,
00244     CODEC_ID_ADPCM_IMA_WAV,
00245     CODEC_ID_ADPCM_IMA_DK3,
00246     CODEC_ID_ADPCM_IMA_DK4,
00247     CODEC_ID_ADPCM_IMA_WS,
00248     CODEC_ID_ADPCM_IMA_SMJPEG,
00249     CODEC_ID_ADPCM_MS,
00250     CODEC_ID_ADPCM_4XM,
00251     CODEC_ID_ADPCM_XA,
00252     CODEC_ID_ADPCM_ADX,
00253     CODEC_ID_ADPCM_EA,
00254     CODEC_ID_ADPCM_G726,
00255     CODEC_ID_ADPCM_CT,
00256     CODEC_ID_ADPCM_SWF,
00257     CODEC_ID_ADPCM_YAMAHA,
00258     CODEC_ID_ADPCM_SBPRO_4,
00259     CODEC_ID_ADPCM_SBPRO_3,
00260     CODEC_ID_ADPCM_SBPRO_2,
00261     CODEC_ID_ADPCM_THP,
00262     CODEC_ID_ADPCM_IMA_AMV,
00263     CODEC_ID_ADPCM_EA_R1,
00264     CODEC_ID_ADPCM_EA_R3,
00265     CODEC_ID_ADPCM_EA_R2,
00266     CODEC_ID_ADPCM_IMA_EA_SEAD,
00267     CODEC_ID_ADPCM_IMA_EA_EACS,
00268     CODEC_ID_ADPCM_EA_XAS,
00269     CODEC_ID_ADPCM_EA_MAXIS_XA,
00270     CODEC_ID_ADPCM_IMA_ISS,
00271 
00272     /* AMR */
00273     CODEC_ID_AMR_NB= 0x12000,
00274     CODEC_ID_AMR_WB,
00275 
00276     /* RealAudio codecs*/
00277     CODEC_ID_RA_144= 0x13000,
00278     CODEC_ID_RA_288,
00279 
00280     /* various DPCM codecs */
00281     CODEC_ID_ROQ_DPCM= 0x14000,
00282     CODEC_ID_INTERPLAY_DPCM,
00283     CODEC_ID_XAN_DPCM,
00284     CODEC_ID_SOL_DPCM,
00285 
00286     /* audio codecs */
00287     CODEC_ID_MP2= 0x15000,
00288     CODEC_ID_MP3, 
00289     CODEC_ID_AAC,
00290     CODEC_ID_AC3,
00291     CODEC_ID_DTS,
00292     CODEC_ID_VORBIS,
00293     CODEC_ID_DVAUDIO,
00294     CODEC_ID_WMAV1,
00295     CODEC_ID_WMAV2,
00296     CODEC_ID_MACE3,
00297     CODEC_ID_MACE6,
00298     CODEC_ID_VMDAUDIO,
00299     CODEC_ID_SONIC,
00300     CODEC_ID_SONIC_LS,
00301     CODEC_ID_FLAC,
00302     CODEC_ID_MP3ADU,
00303     CODEC_ID_MP3ON4,
00304     CODEC_ID_SHORTEN,
00305     CODEC_ID_ALAC,
00306     CODEC_ID_WESTWOOD_SND1,
00307     CODEC_ID_GSM, 
00308     CODEC_ID_QDM2,
00309     CODEC_ID_COOK,
00310     CODEC_ID_TRUESPEECH,
00311     CODEC_ID_TTA,
00312     CODEC_ID_SMACKAUDIO,
00313     CODEC_ID_QCELP,
00314     CODEC_ID_WAVPACK,
00315     CODEC_ID_DSICINAUDIO,
00316     CODEC_ID_IMC,
00317     CODEC_ID_MUSEPACK7,
00318     CODEC_ID_MLP,
00319     CODEC_ID_GSM_MS, /* as found in WAV */
00320     CODEC_ID_ATRAC3,
00321     CODEC_ID_VOXWARE,
00322     CODEC_ID_APE,
00323     CODEC_ID_NELLYMOSER,
00324     CODEC_ID_MUSEPACK8,
00325     CODEC_ID_SPEEX,
00326     CODEC_ID_WMAVOICE,
00327     CODEC_ID_WMAPRO,
00328     CODEC_ID_WMALOSSLESS,
00329     CODEC_ID_ATRAC3P,
00330     CODEC_ID_EAC3,
00331     CODEC_ID_SIPR,
00332     CODEC_ID_MP1,
00333     CODEC_ID_TWINVQ,
00334     CODEC_ID_TRUEHD,
00335     CODEC_ID_MP4ALS,
00336     CODEC_ID_ATRAC1,
00337     CODEC_ID_BINKAUDIO_RDFT,
00338     CODEC_ID_BINKAUDIO_DCT,
00339 
00340     /* subtitle codecs */
00341     CODEC_ID_DVD_SUBTITLE= 0x17000,
00342     CODEC_ID_DVB_SUBTITLE,
00343     CODEC_ID_TEXT,  
00344     CODEC_ID_XSUB,
00345     CODEC_ID_SSA,
00346     CODEC_ID_MOV_TEXT,
00347     CODEC_ID_HDMV_PGS_SUBTITLE,
00348     CODEC_ID_DVB_TELETEXT,
00349 
00350     /* other specific kind of codecs (generally used for attachments) */
00351     CODEC_ID_TTF= 0x18000,
00352 
00353     CODEC_ID_PROBE= 0x19000, 
00354 
00355     CODEC_ID_MPEG2TS= 0x20000, 
00357 };
00358 
00359 #if LIBAVCODEC_VERSION_MAJOR < 53
00360 #define CodecType AVMediaType
00361 
00362 #define CODEC_TYPE_UNKNOWN    AVMEDIA_TYPE_UNKNOWN
00363 #define CODEC_TYPE_VIDEO      AVMEDIA_TYPE_VIDEO
00364 #define CODEC_TYPE_AUDIO      AVMEDIA_TYPE_AUDIO
00365 #define CODEC_TYPE_DATA       AVMEDIA_TYPE_DATA
00366 #define CODEC_TYPE_SUBTITLE   AVMEDIA_TYPE_SUBTITLE
00367 #define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
00368 #define CODEC_TYPE_NB         AVMEDIA_TYPE_NB
00369 #endif
00370 
00374 enum SampleFormat {
00375     SAMPLE_FMT_NONE = -1,
00376     SAMPLE_FMT_U8,              
00377     SAMPLE_FMT_S16,             
00378     SAMPLE_FMT_S32,             
00379     SAMPLE_FMT_FLT,             
00380     SAMPLE_FMT_DBL,             
00381     SAMPLE_FMT_NB               
00382 };
00383 
00384 /* Audio channel masks */
00385 #define CH_FRONT_LEFT             0x00000001
00386 #define CH_FRONT_RIGHT            0x00000002
00387 #define CH_FRONT_CENTER           0x00000004
00388 #define CH_LOW_FREQUENCY          0x00000008
00389 #define CH_BACK_LEFT              0x00000010
00390 #define CH_BACK_RIGHT             0x00000020
00391 #define CH_FRONT_LEFT_OF_CENTER   0x00000040
00392 #define CH_FRONT_RIGHT_OF_CENTER  0x00000080
00393 #define CH_BACK_CENTER            0x00000100
00394 #define CH_SIDE_LEFT              0x00000200
00395 #define CH_SIDE_RIGHT             0x00000400
00396 #define CH_TOP_CENTER             0x00000800
00397 #define CH_TOP_FRONT_LEFT         0x00001000
00398 #define CH_TOP_FRONT_CENTER       0x00002000
00399 #define CH_TOP_FRONT_RIGHT        0x00004000
00400 #define CH_TOP_BACK_LEFT          0x00008000
00401 #define CH_TOP_BACK_CENTER        0x00010000
00402 #define CH_TOP_BACK_RIGHT         0x00020000
00403 #define CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
00404 #define CH_STEREO_RIGHT           0x40000000  ///< See CH_STEREO_LEFT.
00405 
00409 #define CH_LAYOUT_NATIVE          0x8000000000000000LL
00410 
00411 /* Audio channel convenience macros */
00412 #define CH_LAYOUT_MONO              (CH_FRONT_CENTER)
00413 #define CH_LAYOUT_STEREO            (CH_FRONT_LEFT|CH_FRONT_RIGHT)
00414 #define CH_LAYOUT_2_1               (CH_LAYOUT_STEREO|CH_BACK_CENTER)
00415 #define CH_LAYOUT_SURROUND          (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
00416 #define CH_LAYOUT_4POINT0           (CH_LAYOUT_SURROUND|CH_BACK_CENTER)
00417 #define CH_LAYOUT_2_2               (CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT)
00418 #define CH_LAYOUT_QUAD              (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
00419 #define CH_LAYOUT_5POINT0           (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
00420 #define CH_LAYOUT_5POINT1           (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
00421 #define CH_LAYOUT_5POINT0_BACK      (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT)
00422 #define CH_LAYOUT_5POINT1_BACK      (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY)
00423 #define CH_LAYOUT_7POINT0           (CH_LAYOUT_5POINT0|CH_BACK_LEFT|CH_BACK_RIGHT)
00424 #define CH_LAYOUT_7POINT1           (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
00425 #define CH_LAYOUT_7POINT1_WIDE      (CH_LAYOUT_5POINT1_BACK|\
00426                                           CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
00427 #define CH_LAYOUT_STEREO_DOWNMIX    (CH_STEREO_LEFT|CH_STEREO_RIGHT)
00428 
00429 /* in bytes */
00430 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
00431 
00439 #define FF_INPUT_BUFFER_PADDING_SIZE 8
00440 
00445 #define FF_MIN_BUFFER_SIZE 16384
00446 
00447 
00451 enum Motion_Est_ID {
00452     ME_ZERO = 1,    
00453     ME_FULL,
00454     ME_LOG,
00455     ME_PHODS,
00456     ME_EPZS,        
00457     ME_X1,          
00458     ME_HEX,         
00459     ME_UMH,         
00460     ME_ITER,        
00461     ME_TESA,        
00462 };
00463 
00464 enum AVDiscard{
00465     /* We leave some space between them for extensions (drop some
00466      * keyframes for intra-only or drop just some bidir frames). */
00467     AVDISCARD_NONE   =-16, 
00468     AVDISCARD_DEFAULT=  0, 
00469     AVDISCARD_NONREF =  8, 
00470     AVDISCARD_BIDIR  = 16, 
00471     AVDISCARD_NONKEY = 32, 
00472     AVDISCARD_ALL    = 48, 
00473 };
00474 
00475 enum AVColorPrimaries{
00476     AVCOL_PRI_BT709      =1, 
00477     AVCOL_PRI_UNSPECIFIED=2,
00478     AVCOL_PRI_BT470M     =4,
00479     AVCOL_PRI_BT470BG    =5, 
00480     AVCOL_PRI_SMPTE170M  =6, 
00481     AVCOL_PRI_SMPTE240M  =7, 
00482     AVCOL_PRI_FILM       =8,
00483     AVCOL_PRI_NB           , 
00484 };
00485 
00486 enum AVColorTransferCharacteristic{
00487     AVCOL_TRC_BT709      =1, 
00488     AVCOL_TRC_UNSPECIFIED=2,
00489     AVCOL_TRC_GAMMA22    =4, 
00490     AVCOL_TRC_GAMMA28    =5, 
00491     AVCOL_TRC_NB           , 
00492 };
00493 
00494 enum AVColorSpace{
00495     AVCOL_SPC_RGB        =0,
00496     AVCOL_SPC_BT709      =1, 
00497     AVCOL_SPC_UNSPECIFIED=2,
00498     AVCOL_SPC_FCC        =4,
00499     AVCOL_SPC_BT470BG    =5, 
00500     AVCOL_SPC_SMPTE170M  =6, 
00501     AVCOL_SPC_SMPTE240M  =7,
00502     AVCOL_SPC_NB           , 
00503 };
00504 
00505 enum AVColorRange{
00506     AVCOL_RANGE_UNSPECIFIED=0,
00507     AVCOL_RANGE_MPEG       =1, 
00508     AVCOL_RANGE_JPEG       =2, 
00509     AVCOL_RANGE_NB           , 
00510 };
00511 
00517 enum AVChromaLocation{
00518     AVCHROMA_LOC_UNSPECIFIED=0,
00519     AVCHROMA_LOC_LEFT       =1, 
00520     AVCHROMA_LOC_CENTER     =2, 
00521     AVCHROMA_LOC_TOPLEFT    =3, 
00522     AVCHROMA_LOC_TOP        =4,
00523     AVCHROMA_LOC_BOTTOMLEFT =5,
00524     AVCHROMA_LOC_BOTTOM     =6,
00525     AVCHROMA_LOC_NB           , 
00526 };
00527 
00528 typedef struct RcOverride{
00529     int start_frame;
00530     int end_frame;
00531     int qscale; // If this is 0 then quality_factor will be used instead.
00532     float quality_factor;
00533 } RcOverride;
00534 
00535 #define FF_MAX_B_FRAMES 16
00536 
00537 /* encoding support
00538    These flags can be passed in AVCodecContext.flags before initialization.
00539    Note: Not everything is supported yet.
00540 */
00541 
00542 #define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
00543 #define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
00544 #define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
00545 #define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
00546 #define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
00547 #define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
00548 
00553 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
00554 #define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
00555 #define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
00556 #define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
00557 #define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
00558 #define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
00559 #define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
00560 #define CODEC_FLAG_TRUNCATED       0x00010000 
00562 #define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
00563 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
00564 #define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
00565 #define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
00566 #define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
00567 #define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
00568 /* Fx : Flag for h263+ extra options */
00569 #define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
00570 #define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
00571 #define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
00572 #define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
00573 #define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
00574 #define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
00575 #define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
00576 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
00577 #define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
00578 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
00579 #define CODEC_FLAG_CLOSED_GOP     0x80000000
00580 #define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
00581 #define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
00582 #define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
00583 #define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
00584 #define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be used as references.
00585 #define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction for B-frames
00586 #define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
00587 #define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 transform
00588 #define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
00589 #define CODEC_FLAG2_AUD           0x00000200 ///< H.264 access unit delimiters
00590 #define CODEC_FLAG2_BRDO          0x00000400 ///< B-frame rate-distortion optimization
00591 #define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
00592 #define CODEC_FLAG2_MEMC_ONLY     0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
00593 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
00594 #define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
00595 #define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
00596 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
00597 #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
00598 #define CODEC_FLAG2_MBTREE        0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
00599 #define CODEC_FLAG2_PSY           0x00080000 ///< Use psycho visual optimizations.
00600 #define CODEC_FLAG2_SSIM          0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
00601 
00602 /* Unsupported options :
00603  *              Syntax Arithmetic coding (SAC)
00604  *              Reference Picture Selection
00605  *              Independent Segment Decoding */
00606 /* /Fx */
00607 /* codec capabilities */
00608 
00609 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
00610 
00615 #define CODEC_CAP_DR1             0x0002
00616 /* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
00617 #define CODEC_CAP_PARSE_ONLY      0x0004
00618 #define CODEC_CAP_TRUNCATED       0x0008
00619 /* Codec can export data for HW decoding (XvMC). */
00620 #define CODEC_CAP_HWACCEL         0x0010
00621 
00625 #define CODEC_CAP_DELAY           0x0020
00626 
00630 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
00631 
00634 #define CODEC_CAP_HWACCEL_VDPAU    0x0080
00635 
00646 #define CODEC_CAP_SUBFRAMES        0x0100
00647 
00651 #define CODEC_CAP_EXPERIMENTAL     0x0200
00652 
00653 //The following defines may change, don't expect compatibility if you use them.
00654 #define MB_TYPE_INTRA4x4   0x0001
00655 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
00656 #define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
00657 #define MB_TYPE_16x16      0x0008
00658 #define MB_TYPE_16x8       0x0010
00659 #define MB_TYPE_8x16       0x0020
00660 #define MB_TYPE_8x8        0x0040
00661 #define MB_TYPE_INTERLACED 0x0080
00662 #define MB_TYPE_DIRECT2    0x0100 //FIXME
00663 #define MB_TYPE_ACPRED     0x0200
00664 #define MB_TYPE_GMC        0x0400
00665 #define MB_TYPE_SKIP       0x0800
00666 #define MB_TYPE_P0L0       0x1000
00667 #define MB_TYPE_P1L0       0x2000
00668 #define MB_TYPE_P0L1       0x4000
00669 #define MB_TYPE_P1L1       0x8000
00670 #define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
00671 #define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
00672 #define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
00673 #define MB_TYPE_QUANT      0x00010000
00674 #define MB_TYPE_CBP        0x00020000
00675 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
00676 
00682 typedef struct AVPanScan{
00688     int id;
00689 
00695     int width;
00696     int height;
00697 
00703     int16_t position[3][2];
00704 }AVPanScan;
00705 
00706 #define FF_COMMON_FRAME \
00707 \
00713     uint8_t *data[4];\
00714     int linesize[4];\
00715 \
00721     uint8_t *base[4];\
00722 \
00727     int key_frame;\
00728 \
00729 \
00734     int pict_type;\
00735 \
00736 \
00742     int64_t pts;\
00743 \
00744 \
00749     int coded_picture_number;\
00750 \
00755     int display_picture_number;\
00756 \
00757 \
00762     int quality; \
00763 \
00764 \
00770     int age;\
00771 \
00772 \
00780     int reference;\
00781 \
00782 \
00787     int8_t *qscale_table;\
00788 \
00793     int qstride;\
00794 \
00795 \
00801     uint8_t *mbskip_table;\
00802 \
00803 \
00815     int16_t (*motion_val[2])[2];\
00816 \
00817 \
00823     uint32_t *mb_type;\
00824 \
00825 \
00831     uint8_t motion_subsample_log2;\
00832 \
00833 \
00838     void *opaque;\
00839 \
00840 \
00845     uint64_t error[4];\
00846 \
00847 \
00853     int type;\
00854     \
00855 \
00861     int repeat_pict;\
00862     \
00863 \
00866     int qscale_type;\
00867     \
00868 \
00873     int interlaced_frame;\
00874     \
00875 \
00880     int top_field_first;\
00881     \
00882 \
00887     AVPanScan *pan_scan;\
00888     \
00889 \
00894     int palette_has_changed;\
00895     \
00896 \
00901     int buffer_hints;\
00902 \
00903 \
00908     short *dct_coeff;\
00909 \
00910 \
00916     int8_t *ref_index[2];\
00917 \
00918 \
00924     int64_t reordered_opaque;\
00925 \
00926 \
00931     void *hwaccel_picture_private;\
00932 
00933 
00934 #define FF_QSCALE_TYPE_MPEG1 0
00935 #define FF_QSCALE_TYPE_MPEG2 1
00936 #define FF_QSCALE_TYPE_H264  2
00937 #define FF_QSCALE_TYPE_VP56  3
00938 
00939 #define FF_BUFFER_TYPE_INTERNAL 1
00940 #define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
00941 #define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
00942 #define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
00943 
00944 
00945 #define FF_I_TYPE  1 ///< Intra
00946 #define FF_P_TYPE  2 ///< Predicted
00947 #define FF_B_TYPE  3 ///< Bi-dir predicted
00948 #define FF_S_TYPE  4 ///< S(GMC)-VOP MPEG4
00949 #define FF_SI_TYPE 5 ///< Switching Intra
00950 #define FF_SP_TYPE 6 ///< Switching Predicted
00951 #define FF_BI_TYPE 7
00952 
00953 #define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
00954 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00955 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00956 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00957 
00958 typedef struct AVPacket {
00968     int64_t pts;
00974     int64_t dts;
00975     uint8_t *data;
00976     int   size;
00977     int   stream_index;
00978     int   flags;
00983     int   duration;
00984     void  (*destruct)(struct AVPacket *);
00985     void  *priv;
00986     int64_t pos;                            
00987 
01003     int64_t convergence_duration;
01004 } AVPacket;
01005 #define AV_PKT_FLAG_KEY   0x0001
01006 #if LIBAVCODEC_VERSION_MAJOR < 53
01007 #define PKT_FLAG_KEY AV_PKT_FLAG_KEY
01008 #endif
01009 
01019 typedef struct AVFrame {
01020     FF_COMMON_FRAME
01021 } AVFrame;
01022 
01030 typedef struct AVCodecContext {
01035     const AVClass *av_class;
01041     int bit_rate;
01042 
01049     int bit_rate_tolerance;
01050 
01056     int flags;
01057 
01066     int sub_id;
01067 
01075     int me_method;
01076 
01088     uint8_t *extradata;
01089     int extradata_size;
01090 
01099     AVRational time_base;
01100 
01101     /* video only */
01109     int width, height;
01110 
01111 #define FF_ASPECT_EXTENDED 15
01112 
01118     int gop_size;
01119 
01125     enum PixelFormat pix_fmt;
01126 
01133     int rate_emu;
01134 
01154     void (*draw_horiz_band)(struct AVCodecContext *s,
01155                             const AVFrame *src, int offset[4],
01156                             int y, int type, int height);
01157 
01158     /* audio only */
01159     int sample_rate; 
01160     int channels;    
01161 
01167     enum SampleFormat sample_fmt;  
01168 
01169     /* The following data should not be initialized. */
01173     int frame_size;
01174     int frame_number;   
01175 #if LIBAVCODEC_VERSION_MAJOR < 53
01176     int real_pict_num;  
01177 #endif
01178 
01185     int delay;
01186 
01187     /* - encoding parameters */
01188     float qcompress;  
01189     float qblur;      
01190 
01196     int qmin;
01197 
01203     int qmax;
01204 
01210     int max_qdiff;
01211 
01218     int max_b_frames;
01219 
01227     float b_quant_factor;
01228 
01230     int rc_strategy;
01231 #define FF_RC_STRATEGY_XVID 1
01232 
01233     int b_frame_strategy;
01234 
01241     int hurry_up;
01242 
01243     struct AVCodec *codec;
01244 
01245     void *priv_data;
01246 
01247     int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
01248                             /* do its best to deliver a chunk with size     */
01249                             /* below rtp_payload_size, the chunk will start */
01250                             /* with a start code on some codecs like H.263. */
01251                             /* This doesn't take account of any particular  */
01252                             /* headers inside the transmitted RTP payload.  */
01253 
01254 
01255     /* The RTP callback: This function is called    */
01256     /* every time the encoder has a packet to send. */
01257     /* It depends on the encoder if the data starts */
01258     /* with a Start Code (it should). H.263 does.   */
01259     /* mb_nb contains the number of macroblocks     */
01260     /* encoded in the RTP payload.                  */
01261     void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01262 
01263     /* statistics, used for 2-pass encoding */
01264     int mv_bits;
01265     int header_bits;
01266     int i_tex_bits;
01267     int p_tex_bits;
01268     int i_count;
01269     int p_count;
01270     int skip_count;
01271     int misc_bits;
01272 
01278     int frame_bits;
01279 
01285     void *opaque;
01286 
01287     char codec_name[32];
01288     enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
01289     enum CodecID codec_id; /* see CODEC_ID_xxx */
01290 
01304     unsigned int codec_tag;
01305 
01311     int workaround_bugs;
01312 #define FF_BUG_AUTODETECT       1  ///< autodetection
01313 #define FF_BUG_OLD_MSMPEG4      2
01314 #define FF_BUG_XVID_ILACE       4
01315 #define FF_BUG_UMP4             8
01316 #define FF_BUG_NO_PADDING       16
01317 #define FF_BUG_AMV              32
01318 #define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
01319 #define FF_BUG_QPEL_CHROMA      64
01320 #define FF_BUG_STD_QPEL         128
01321 #define FF_BUG_QPEL_CHROMA2     256
01322 #define FF_BUG_DIRECT_BLOCKSIZE 512
01323 #define FF_BUG_EDGE             1024
01324 #define FF_BUG_HPEL_CHROMA      2048
01325 #define FF_BUG_DC_CLIP          4096
01326 #define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
01327 #define FF_BUG_TRUNCATED       16384
01328 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
01329 
01335     int luma_elim_threshold;
01336 
01342     int chroma_elim_threshold;
01343 
01356     int strict_std_compliance;
01357 #define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to a older more strict version of the spec or reference software.
01358 #define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
01359 #define FF_COMPLIANCE_NORMAL        0
01360 #define FF_COMPLIANCE_INOFFICIAL   -1 ///< Allow inofficial extensions.
01361 #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
01362 
01368     float b_quant_offset;
01369 
01376     int error_recognition;
01377 #define FF_ER_CAREFUL         1
01378 #define FF_ER_COMPLIANT       2
01379 #define FF_ER_AGGRESSIVE      3
01380 #define FF_ER_VERY_AGGRESSIVE 4
01381 
01393     int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01394 
01402     void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01403 
01410     int has_b_frames;
01411 
01416     int block_align;
01417 
01418     int parse_only; /* - decoding only: If true, only parsing is done
01419                        (function avcodec_parse_frame()). The frame
01420                        data is returned. Only MPEG codecs support this now. */
01421 
01427     int mpeg_quant;
01428 
01434     char *stats_out;
01435 
01442     char *stats_in;
01443 
01450     float rc_qsquish;
01451 
01452     float rc_qmod_amp;
01453     int rc_qmod_freq;
01454 
01460     RcOverride *rc_override;
01461     int rc_override_count;
01462 
01468     const char *rc_eq;
01469 
01475     int rc_max_rate;
01476 
01482     int rc_min_rate;
01483 
01489     int rc_buffer_size;
01490     float rc_buffer_aggressivity;
01491 
01499     float i_quant_factor;
01500 
01506     float i_quant_offset;
01507 
01513     float rc_initial_cplx;
01514 
01520     int dct_algo;
01521 #define FF_DCT_AUTO    0
01522 #define FF_DCT_FASTINT 1
01523 #define FF_DCT_INT     2
01524 #define FF_DCT_MMX     3
01525 #define FF_DCT_MLIB    4
01526 #define FF_DCT_ALTIVEC 5
01527 #define FF_DCT_FAAN    6
01528 
01534     float lumi_masking;
01535 
01541     float temporal_cplx_masking;
01542 
01548     float spatial_cplx_masking;
01549 
01555     float p_masking;
01556 
01562     float dark_masking;
01563 
01569     int idct_algo;
01570 #define FF_IDCT_AUTO          0
01571 #define FF_IDCT_INT           1
01572 #define FF_IDCT_SIMPLE        2
01573 #define FF_IDCT_SIMPLEMMX     3
01574 #define FF_IDCT_LIBMPEG2MMX   4
01575 #define FF_IDCT_PS2           5
01576 #define FF_IDCT_MLIB          6
01577 #define FF_IDCT_ARM           7
01578 #define FF_IDCT_ALTIVEC       8
01579 #define FF_IDCT_SH4           9
01580 #define FF_IDCT_SIMPLEARM     10
01581 #define FF_IDCT_H264          11
01582 #define FF_IDCT_VP3           12
01583 #define FF_IDCT_IPP           13
01584 #define FF_IDCT_XVIDMMX       14
01585 #define FF_IDCT_CAVS          15
01586 #define FF_IDCT_SIMPLEARMV5TE 16
01587 #define FF_IDCT_SIMPLEARMV6   17
01588 #define FF_IDCT_SIMPLEVIS     18
01589 #define FF_IDCT_WMV2          19
01590 #define FF_IDCT_FAAN          20
01591 #define FF_IDCT_EA            21
01592 #define FF_IDCT_SIMPLENEON    22
01593 #define FF_IDCT_SIMPLEALPHA   23
01594 #define FF_IDCT_BINK          24
01595 
01601     int slice_count;
01607     int *slice_offset;
01608 
01614     int error_concealment;
01615 #define FF_EC_GUESS_MVS   1
01616 #define FF_EC_DEBLOCK     2
01617 
01626     unsigned dsp_mask;
01627 #define FF_MM_FORCE    0x80000000 /* Force usage of selected flags (OR) */
01628     /* lower 16 bits - CPU features */
01629 #define FF_MM_MMX      0x0001 ///< standard MMX
01630 #define FF_MM_3DNOW    0x0004 ///< AMD 3DNOW
01631 #if LIBAVCODEC_VERSION_MAJOR < 53
01632 #define FF_MM_MMXEXT   0x0002 ///< SSE integer functions or AMD MMX ext
01633 #endif
01634 #define FF_MM_MMX2     0x0002 ///< SSE integer functions or AMD MMX ext
01635 #define FF_MM_SSE      0x0008 ///< SSE functions
01636 #define FF_MM_SSE2     0x0010 ///< PIV SSE2 functions
01637 #define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt
01638 #define FF_MM_SSE3     0x0040 ///< Prescott SSE3 functions
01639 #define FF_MM_SSSE3    0x0080 ///< Conroe SSSE3 functions
01640 #define FF_MM_SSE4     0x0100 ///< Penryn SSE4.1 functions
01641 #define FF_MM_SSE42    0x0200 ///< Nehalem SSE4.2 functions
01642 #define FF_MM_IWMMXT   0x0100 ///< XScale IWMMXT
01643 #define FF_MM_ALTIVEC  0x0001 ///< standard AltiVec
01644 
01650      int bits_per_coded_sample;
01651 
01657      int prediction_method;
01658 #define FF_PRED_LEFT   0
01659 #define FF_PRED_PLANE  1
01660 #define FF_PRED_MEDIAN 2
01661 
01669     AVRational sample_aspect_ratio;
01670 
01676     AVFrame *coded_frame;
01677 
01683     int debug;
01684 #define FF_DEBUG_PICT_INFO   1
01685 #define FF_DEBUG_RC          2
01686 #define FF_DEBUG_BITSTREAM   4
01687 #define FF_DEBUG_MB_TYPE     8
01688 #define FF_DEBUG_QP          16
01689 #define FF_DEBUG_MV          32
01690 #define FF_DEBUG_DCT_COEFF   0x00000040
01691 #define FF_DEBUG_SKIP        0x00000080
01692 #define FF_DEBUG_STARTCODE   0x00000100
01693 #define FF_DEBUG_PTS         0x00000200
01694 #define FF_DEBUG_ER          0x00000400
01695 #define FF_DEBUG_MMCO        0x00000800
01696 #define FF_DEBUG_BUGS        0x00001000
01697 #define FF_DEBUG_VIS_QP      0x00002000
01698 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01699 #define FF_DEBUG_BUFFERS     0x00008000
01700 
01706     int debug_mv;
01707 #define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
01708 #define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
01709 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01710 
01716     uint64_t error[4];
01717 
01723     int mb_qmin;
01724 
01730     int mb_qmax;
01731 
01737     int me_cmp;
01743     int me_sub_cmp;
01749     int mb_cmp;
01755     int ildct_cmp;
01756 #define FF_CMP_SAD    0
01757 #define FF_CMP_SSE    1
01758 #define FF_CMP_SATD   2
01759 #define FF_CMP_DCT    3
01760 #define FF_CMP_PSNR   4
01761 #define FF_CMP_BIT    5
01762 #define FF_CMP_RD     6
01763 #define FF_CMP_ZERO   7
01764 #define FF_CMP_VSAD   8
01765 #define FF_CMP_VSSE   9
01766 #define FF_CMP_NSSE   10
01767 #define FF_CMP_W53    11
01768 #define FF_CMP_W97    12
01769 #define FF_CMP_DCTMAX 13
01770 #define FF_CMP_DCT264 14
01771 #define FF_CMP_CHROMA 256
01772 
01778     int dia_size;
01779 
01785     int last_predictor_count;
01786 
01792     int pre_me;
01793 
01799     int me_pre_cmp;
01800 
01806     int pre_dia_size;
01807 
01813     int me_subpel_quality;
01814 
01824     enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01825 
01834     int dtg_active_format;
01835 #define FF_DTG_AFD_SAME         8
01836 #define FF_DTG_AFD_4_3          9
01837 #define FF_DTG_AFD_16_9         10
01838 #define FF_DTG_AFD_14_9         11
01839 #define FF_DTG_AFD_4_3_SP_14_9  13
01840 #define FF_DTG_AFD_16_9_SP_14_9 14
01841 #define FF_DTG_AFD_SP_4_3       15
01842 
01850     int me_range;
01851 
01857     int intra_quant_bias;
01858 #define FF_DEFAULT_QUANT_BIAS 999999
01859 
01865     int inter_quant_bias;
01866 
01873     int color_table_id;
01874 
01879     int internal_buffer_count;
01880 
01885     void *internal_buffer;
01886 
01887 #define FF_LAMBDA_SHIFT 7
01888 #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01889 #define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
01890 #define FF_LAMBDA_MAX (256*128-1)
01891 
01892 #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01893 
01899     int global_quality;
01900 
01901 #define FF_CODER_TYPE_VLC       0
01902 #define FF_CODER_TYPE_AC        1
01903 #define FF_CODER_TYPE_RAW       2
01904 #define FF_CODER_TYPE_RLE       3
01905 #define FF_CODER_TYPE_DEFLATE   4
01906 
01911     int coder_type;
01912 
01918     int context_model;
01919 #if 0
01920 
01925     uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01926 #endif
01927 
01933     int slice_flags;
01934 #define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
01935 #define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
01936 #define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
01937 
01943     int xvmc_acceleration;
01944 
01950     int mb_decision;
01951 #define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
01952 #define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
01953 #define FF_MB_DECISION_RD     2        ///< rate distortion
01954 
01960     uint16_t *intra_matrix;
01961 
01967     uint16_t *inter_matrix;
01968 
01975     unsigned int stream_codec_tag;
01976 
01983     int scenechange_threshold;
01984 
01990     int lmin;
01991 
01997     int lmax;
01998 
02004     struct AVPaletteControl *palctrl;
02005 
02011     int noise_reduction;
02012 
02025     int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
02026 
02032     int rc_initial_buffer_occupancy;
02033 
02039     int inter_threshold;
02040 
02046     int flags2;
02047 
02053     int error_rate;
02054 
02060     int antialias_algo;
02061 #define FF_AA_AUTO    0
02062 #define FF_AA_FASTINT 1 //not implemented yet
02063 #define FF_AA_INT     2
02064 #define FF_AA_FLOAT   3
02065 
02070     int quantizer_noise_shaping;
02071 
02078     int thread_count;
02079 
02089     int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
02090 
02097     void *thread_opaque;
02098 
02106      int me_threshold;
02107 
02113      int mb_threshold;
02114 
02120      int intra_dc_precision;
02121 
02127      int nsse_weight;
02128 
02134      int skip_top;
02135 
02141      int skip_bottom;
02142 
02148      int profile;
02149 #define FF_PROFILE_UNKNOWN -99
02150 
02151 #define FF_PROFILE_AAC_MAIN 0
02152 #define FF_PROFILE_AAC_LOW  1
02153 #define FF_PROFILE_AAC_SSR  2
02154 #define FF_PROFILE_AAC_LTP  3
02155 
02156 #define FF_PROFILE_H264_BASELINE    66
02157 #define FF_PROFILE_H264_MAIN        77
02158 #define FF_PROFILE_H264_EXTENDED    88
02159 #define FF_PROFILE_H264_HIGH        100
02160 #define FF_PROFILE_H264_HIGH_10     110
02161 #define FF_PROFILE_H264_HIGH_422    122
02162 #define FF_PROFILE_H264_HIGH_444    244
02163 #define FF_PROFILE_H264_CAVLC_444   44
02164 
02170      int level;
02171 #define FF_LEVEL_UNKNOWN -99
02172 
02178      int lowres;
02179 
02186     int coded_width, coded_height;
02187 
02193     int frame_skip_threshold;
02194 
02200     int frame_skip_factor;
02201 
02207     int frame_skip_exp;
02208 
02214     int frame_skip_cmp;
02215 
02222     float border_masking;
02223 
02229     int mb_lmin;
02230 
02236     int mb_lmax;
02237 
02243     int me_penalty_compensation;
02244 
02250     enum AVDiscard skip_loop_filter;
02251 
02257     enum AVDiscard skip_idct;
02258 
02264     enum AVDiscard skip_frame;
02265 
02271     int bidir_refine;
02272 
02278     int brd_scale;
02279 
02285     float crf;
02286 
02292     int cqp;
02293 
02299     int keyint_min;
02300 
02306     int refs;
02307 
02313     int chromaoffset;
02314 
02320     int bframebias;
02321 
02327     int trellis;
02328 
02334     float complexityblur;
02335 
02342     int deblockalpha;
02343 
02350     int deblockbeta;
02351 
02357     int partitions;
02358 #define X264_PART_I4X4 0x001  /* Analyze i4x4 */
02359 #define X264_PART_I8X8 0x002  /* Analyze i8x8 (requires 8x8 transform) */
02360 #define X264_PART_P8X8 0x010  /* Analyze p16x8, p8x16 and p8x8 */
02361 #define X264_PART_P4X4 0x020  /* Analyze p8x4, p4x8, p4x4 */
02362 #define X264_PART_B8X8 0x100  /* Analyze b16x8, b8x16 and b8x8 */
02363 
02369     int directpred;
02370 
02376     int cutoff;
02377 
02383     int scenechange_factor;
02384 
02391     int mv0_threshold;
02392 
02398     int b_sensitivity;
02399 
02404     int compression_level;
02405 #define FF_COMPRESSION_DEFAULT -1
02406 
02412     int use_lpc;
02413 
02419     int lpc_coeff_precision;
02420 
02425     int min_prediction_order;
02426 
02431     int max_prediction_order;
02432 
02438     int prediction_order_method;
02439 
02444     int min_partition_order;
02445 
02450     int max_partition_order;
02451 
02457     int64_t timecode_frame_start;
02458 
02459 #if LIBAVCODEC_VERSION_MAJOR < 53
02460 
02466     int request_channels;
02467 #endif
02468 
02475     float drc_scale;
02476 
02483     int64_t reordered_opaque;
02484 
02491     int bits_per_raw_sample;
02492 
02498     int64_t channel_layout;
02499 
02505     int64_t request_channel_layout;
02506 
02512     float rc_max_available_vbv_use;
02513 
02519     float rc_min_vbv_overflow_use;
02520 
02526     struct AVHWAccel *hwaccel;
02527 
02535     int ticks_per_frame;
02536 
02547     void *hwaccel_context;
02548 
02554     enum AVColorPrimaries color_primaries;
02555 
02561     enum AVColorTransferCharacteristic color_trc;
02562 
02568     enum AVColorSpace colorspace;
02569 
02575     enum AVColorRange color_range;
02576 
02582     enum AVChromaLocation chroma_sample_location;
02583 
02602     int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
02603 
02612     int weighted_p_pred;
02613 
02622     int aq_mode;
02623 
02630     float aq_strength;
02631 
02638     float psy_rd;
02639 
02646     float psy_trellis;
02647 
02654     int rc_lookahead;
02655 } AVCodecContext;
02656 
02660 typedef struct AVCodec {
02667     const char *name;
02668     enum AVMediaType type;
02669     enum CodecID id;
02670     int priv_data_size;
02671     int (*init)(AVCodecContext *);
02672     int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02673     int (*close)(AVCodecContext *);
02674     int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
02679     int capabilities;
02680     struct AVCodec *next;
02685     void (*flush)(AVCodecContext *);
02686     const AVRational *supported_framerates; 
02687     const enum PixelFormat *pix_fmts;       
02688 
02692     const char *long_name;
02693     const int *supported_samplerates;       
02694     const enum SampleFormat *sample_fmts;   
02695     const int64_t *channel_layouts;         
02696 } AVCodec;
02697 
02701 typedef struct AVHWAccel {
02707     const char *name;
02708 
02714     enum AVMediaType type;
02715 
02721     enum CodecID id;
02722 
02728     enum PixelFormat pix_fmt;
02729 
02734     int capabilities;
02735 
02736     struct AVHWAccel *next;
02737 
02752     int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02753 
02765     int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
02766 
02776     int (*end_frame)(AVCodecContext *avctx);
02777 
02785     int priv_data_size;
02786 } AVHWAccel;
02787 
02792 typedef struct AVPicture {
02793     uint8_t *data[4];
02794     int linesize[4];       
02795 } AVPicture;
02796 
02797 #if LIBAVCODEC_VERSION_MAJOR < 53
02798 
02806 #define AVPALETTE_SIZE 1024
02807 #define AVPALETTE_COUNT 256
02808 typedef struct AVPaletteControl {
02809 
02810     /* Demuxer sets this to 1 to indicate the palette has changed;
02811      * decoder resets to 0. */
02812     int palette_changed;
02813 
02814     /* 4-byte ARGB palette entries, stored in native byte order; note that
02815      * the individual palette components should be on a 8-bit scale; if
02816      * the palette data comes from an IBM VGA native format, the component
02817      * data is probably 6 bits in size and needs to be scaled. */
02818     unsigned int palette[AVPALETTE_COUNT];
02819 
02820 } AVPaletteControl attribute_deprecated;
02821 #endif
02822 
02823 enum AVSubtitleType {
02824     SUBTITLE_NONE,
02825 
02826     SUBTITLE_BITMAP,                
02827 
02832     SUBTITLE_TEXT,
02833 
02838     SUBTITLE_ASS,
02839 };
02840 
02841 typedef struct AVSubtitleRect {
02842     int x;         
02843     int y;         
02844     int w;         
02845     int h;         
02846     int nb_colors; 
02847 
02852     AVPicture pict;
02853     enum AVSubtitleType type;
02854 
02855     char *text;                     
02856 
02862     char *ass;
02863 } AVSubtitleRect;
02864 
02865 typedef struct AVSubtitle {
02866     uint16_t format; /* 0 = graphics */
02867     uint32_t start_display_time; /* relative to packet pts, in ms */
02868     uint32_t end_display_time; /* relative to packet pts, in ms */
02869     unsigned num_rects;
02870     AVSubtitleRect **rects;
02871     int64_t pts;    
02872 } AVSubtitle;
02873 
02874 /* packet functions */
02875 
02879 attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
02880 
02884 void av_destruct_packet(AVPacket *pkt);
02885 
02891 void av_init_packet(AVPacket *pkt);
02892 
02901 int av_new_packet(AVPacket *pkt, int size);
02902 
02909 void av_shrink_packet(AVPacket *pkt, int size);
02910 
02915 int av_dup_packet(AVPacket *pkt);
02916 
02922 void av_free_packet(AVPacket *pkt);
02923 
02924 /* resample.c */
02925 
02926 struct ReSampleContext;
02927 struct AVResampleContext;
02928 
02929 typedef struct ReSampleContext ReSampleContext;
02930 
02931 #if LIBAVCODEC_VERSION_MAJOR < 53
02932 
02935 attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02936                                                           int output_rate, int input_rate);
02937 #endif
02938 
02954 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
02955                                         int output_rate, int input_rate,
02956                                         enum SampleFormat sample_fmt_out,
02957                                         enum SampleFormat sample_fmt_in,
02958                                         int filter_length, int log2_phase_count,
02959                                         int linear, double cutoff);
02960 
02961 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02962 void audio_resample_close(ReSampleContext *s);
02963 
02964 
02974 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02975 
02985 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02986 
02987 
03000 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
03001 void av_resample_close(struct AVResampleContext *c);
03002 
03012 int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
03013 
03019 void avpicture_free(AVPicture *picture);
03020 
03038 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
03039                    enum PixelFormat pix_fmt, int width, int height);
03040 int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
03041                      unsigned char *dest, int dest_size);
03042 
03055 int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
03056 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
03057 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
03058 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
03059 
03060 #if LIBAVCODEC_VERSION_MAJOR < 53
03061 
03074 attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
03075 #endif
03076 
03082 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
03083 
03084 #define FF_LOSS_RESOLUTION  0x0001 
03085 #define FF_LOSS_DEPTH       0x0002 
03086 #define FF_LOSS_COLORSPACE  0x0004 
03087 #define FF_LOSS_ALPHA       0x0008 
03088 #define FF_LOSS_COLORQUANT  0x0010 
03089 #define FF_LOSS_CHROMA      0x0020 
03108 int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
03109                              int has_alpha);
03110 
03133 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
03134                               int has_alpha, int *loss_ptr);
03135 
03136 
03147 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
03148 
03149 #define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
03150 #define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */
03151 
03156 int img_get_alpha_info(const AVPicture *src,
03157                        enum PixelFormat pix_fmt, int width, int height);
03158 
03159 /* deinterlace a picture */
03160 /* deinterlace - if not supported return -1 */
03161 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
03162                           enum PixelFormat pix_fmt, int width, int height);
03163 
03164 /* external high level API */
03165 
03171 AVCodec *av_codec_next(AVCodec *c);
03172 
03176 unsigned avcodec_version(void);
03177 
03181 const char *avcodec_configuration(void);
03182 
03186 const char *avcodec_license(void);
03187 
03194 void avcodec_init(void);
03195 
03196 #if LIBAVCODEC_VERSION_MAJOR < 53
03197 
03200 attribute_deprecated void register_avcodec(AVCodec *codec);
03201 #endif
03202 
03208 void avcodec_register(AVCodec *codec);
03209 
03216 AVCodec *avcodec_find_encoder(enum CodecID id);
03217 
03224 AVCodec *avcodec_find_encoder_by_name(const char *name);
03225 
03232 AVCodec *avcodec_find_decoder(enum CodecID id);
03233 
03240 AVCodec *avcodec_find_decoder_by_name(const char *name);
03241 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
03242 
03248 void avcodec_get_context_defaults(AVCodecContext *s);
03249 
03252 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
03253 
03261 AVCodecContext *avcodec_alloc_context(void);
03262 
03265 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
03266 
03278 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
03279 
03285 void avcodec_get_frame_defaults(AVFrame *pic);
03286 
03294 AVFrame *avcodec_alloc_frame(void);
03295 
03296 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03297 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03298 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03299 
03307 unsigned avcodec_get_edge_width(void);
03317 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03327 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
03328                                int linesize_align[4]);
03329 
03338 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
03339 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
03340 
03341 int avcodec_thread_init(AVCodecContext *s, int thread_count);
03342 void avcodec_thread_free(AVCodecContext *s);
03343 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
03344 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
03345 //FIXME func typedef
03346 
03374 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
03375 
03376 #if LIBAVCODEC_VERSION_MAJOR < 53
03377 
03390 attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
03391                          int *frame_size_ptr,
03392                          const uint8_t *buf, int buf_size);
03393 #endif
03394 
03434 int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
03435                          int *frame_size_ptr,
03436                          AVPacket *avpkt);
03437 
03438 #if LIBAVCODEC_VERSION_MAJOR < 53
03439 
03452 attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
03453                          int *got_picture_ptr,
03454                          const uint8_t *buf, int buf_size);
03455 #endif
03456 
03492 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
03493                          int *got_picture_ptr,
03494                          AVPacket *avpkt);
03495 
03496 #if LIBAVCODEC_VERSION_MAJOR < 53
03497 /* Decode a subtitle message. Return -1 if error, otherwise return the
03498  * number of bytes used. If no subtitle could be decompressed,
03499  * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
03500 attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
03501                             int *got_sub_ptr,
03502                             const uint8_t *buf, int buf_size);
03503 #endif
03504 
03516 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
03517                             int *got_sub_ptr,
03518                             AVPacket *avpkt);
03519 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
03520                         int *data_size_ptr,
03521                         uint8_t *buf, int buf_size);
03522 
03542 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03543                          const short *samples);
03544 
03557 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03558                          const AVFrame *pict);
03559 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03560                             const AVSubtitle *sub);
03561 
03562 int avcodec_close(AVCodecContext *avctx);
03563 
03574 void avcodec_register_all(void);
03575 
03579 void avcodec_flush_buffers(AVCodecContext *avctx);
03580 
03581 void avcodec_default_free_buffers(AVCodecContext *s);
03582 
03583 /* misc useful functions */
03584 
03591 char av_get_pict_type_char(int pict_type);
03592 
03599 int av_get_bits_per_sample(enum CodecID codec_id);
03600 
03607 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
03608 
03609 /* frame parsing */
03610 typedef struct AVCodecParserContext {
03611     void *priv_data;
03612     struct AVCodecParser *parser;
03613     int64_t frame_offset; /* offset of the current frame */
03614     int64_t cur_offset; /* current offset
03615                            (incremented by each av_parser_parse()) */
03616     int64_t next_frame_offset; /* offset of the next frame */
03617     /* video info */
03618     int pict_type; /* XXX: Put it back in AVCodecContext. */
03628     int repeat_pict; /* XXX: Put it back in AVCodecContext. */
03629     int64_t pts;     /* pts of the current frame */
03630     int64_t dts;     /* dts of the current frame */
03631 
03632     /* private data */
03633     int64_t last_pts;
03634     int64_t last_dts;
03635     int fetch_timestamp;
03636 
03637 #define AV_PARSER_PTS_NB 4
03638     int cur_frame_start_index;
03639     int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03640     int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03641     int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03642 
03643     int flags;
03644 #define PARSER_FLAG_COMPLETE_FRAMES           0x0001
03645 
03646     int64_t offset;      
03647     int64_t cur_frame_end[AV_PARSER_PTS_NB];
03648 
03655     int key_frame;
03656 
03672     int64_t convergence_duration;
03673 
03674     // Timestamp generation support:
03684     int dts_sync_point;
03685 
03699     int dts_ref_dts_delta;
03700 
03713     int pts_dts_delta;
03714 
03720     int64_t cur_frame_pos[AV_PARSER_PTS_NB];
03721 
03725     int64_t pos;
03726 
03730     int64_t last_pos;
03731 } AVCodecParserContext;
03732 
03733 typedef struct AVCodecParser {
03734     int codec_ids[5]; /* several codec IDs are permitted */
03735     int priv_data_size;
03736     int (*parser_init)(AVCodecParserContext *s);
03737     int (*parser_parse)(AVCodecParserContext *s,
03738                         AVCodecContext *avctx,
03739                         const uint8_t **poutbuf, int *poutbuf_size,
03740                         const uint8_t *buf, int buf_size);
03741     void (*parser_close)(AVCodecParserContext *s);
03742     int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
03743     struct AVCodecParser *next;
03744 } AVCodecParser;
03745 
03746 AVCodecParser *av_parser_next(AVCodecParser *c);
03747 
03748 void av_register_codec_parser(AVCodecParser *parser);
03749 AVCodecParserContext *av_parser_init(int codec_id);
03750 
03751 #if LIBAVCODEC_VERSION_MAJOR < 53
03752 attribute_deprecated
03753 int av_parser_parse(AVCodecParserContext *s,
03754                     AVCodecContext *avctx,
03755                     uint8_t **poutbuf, int *poutbuf_size,
03756                     const uint8_t *buf, int buf_size,
03757                     int64_t pts, int64_t dts);
03758 #endif
03759 
03788 int av_parser_parse2(AVCodecParserContext *s,
03789                      AVCodecContext *avctx,
03790                      uint8_t **poutbuf, int *poutbuf_size,
03791                      const uint8_t *buf, int buf_size,
03792                      int64_t pts, int64_t dts,
03793                      int64_t pos);
03794 
03795 int av_parser_change(AVCodecParserContext *s,
03796                      AVCodecContext *avctx,
03797                      uint8_t **poutbuf, int *poutbuf_size,
03798                      const uint8_t *buf, int buf_size, int keyframe);
03799 void av_parser_close(AVCodecParserContext *s);
03800 
03801 
03802 typedef struct AVBitStreamFilterContext {
03803     void *priv_data;
03804     struct AVBitStreamFilter *filter;
03805     AVCodecParserContext *parser;
03806     struct AVBitStreamFilterContext *next;
03807 } AVBitStreamFilterContext;
03808 
03809 
03810 typedef struct AVBitStreamFilter {
03811     const char *name;
03812     int priv_data_size;
03813     int (*filter)(AVBitStreamFilterContext *bsfc,
03814                   AVCodecContext *avctx, const char *args,
03815                   uint8_t **poutbuf, int *poutbuf_size,
03816                   const uint8_t *buf, int buf_size, int keyframe);
03817     void (*close)(AVBitStreamFilterContext *bsfc);
03818     struct AVBitStreamFilter *next;
03819 } AVBitStreamFilter;
03820 
03821 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
03822 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
03823 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
03824                                AVCodecContext *avctx, const char *args,
03825                                uint8_t **poutbuf, int *poutbuf_size,
03826                                const uint8_t *buf, int buf_size, int keyframe);
03827 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
03828 
03829 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
03830 
03831 /* memory */
03832 
03839 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
03840 
03853 void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
03854 
03858 void av_picture_copy(AVPicture *dst, const AVPicture *src,
03859                      enum PixelFormat pix_fmt, int width, int height);
03860 
03864 int av_picture_crop(AVPicture *dst, const AVPicture *src,
03865                     enum PixelFormat pix_fmt, int top_band, int left_band);
03866 
03870 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
03871             int padtop, int padbottom, int padleft, int padright, int *color);
03872 
03880 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
03881 
03893 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
03894 
03904 int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
03905 
03918 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
03919 
03928 void av_log_ask_for_sample(void *avc, const char *msg);
03929 
03933 void av_register_hwaccel(AVHWAccel *hwaccel);
03934 
03940 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
03941 
03942 
03946 enum AVLockOp {
03947   AV_LOCK_CREATE,  
03948   AV_LOCK_OBTAIN,  
03949   AV_LOCK_RELEASE, 
03950   AV_LOCK_DESTROY, 
03951 };
03952 
03966 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
03967 
03968 #endif /* AVCODEC_AVCODEC_H */

Generated on Fri Sep 16 2011 17:17:34 for FFmpeg by  doxygen 1.7.1