VisClient/net/sf/ffmpeg_java/AVCodecLibrary.java

Go to the documentation of this file.
00001 package net.sf.ffmpeg_java;
00002 
00003 
00004 
00005 import com.sun.jna.Native;
00006 import com.sun.jna.Pointer;
00007 import com.sun.jna.Structure;
00008 import com.sun.jna.ptr.IntByReference;
00009 import com.sun.jna.ptr.PointerByReference;
00010 
00016 public interface AVCodecLibrary extends FFMPEGLibrary 
00017 {
00018         
00019     public static final AVCodecLibrary INSTANCE = (AVCodecLibrary) Native.loadLibrary(
00020                 System.getProperty("avcodec.lib",
00021                         System.getProperty("os.name").startsWith("Windows") ? "avcodec-52" : "avcodec"), 
00022                 AVCodecLibrary.class);
00023     
00024 //------------------------------------------------------------------------------------------------------------------------
00025 // avcodec.h
00026 
00027  /*   public static final int LIBAVCODEC_VERSION_INT = ((52<<16)+(21<<8)+0);    // version this comes from
00028     public static final String LIBAVCODEC_VERSION  = "52.21.0";
00029     public static final int LLIBAVCODEC_BUILD = LIBAVCODEC_VERSION_INT;
00030 
00031     public static final String LIBAVCODEC_IDENT = "Lavc" + LIBAVCODEC_VERSION;
00032 */
00033     public static final long AV_NOPTS_VALUE = 0x8000000000000000L;
00034     public static final int AV_TIME_BASE = 1000000;
00035     public static final AVRational AV_TIME_BASE_Q = new AVRational(1, AV_TIME_BASE);
00036 
00037 
00038     //enum CodecID: 
00039         public static final int CODEC_ID_NONE                           = 0;
00040     public static final int CODEC_ID_MPEG1VIDEO                 = 1;
00041     public static final int CODEC_ID_MPEG2VIDEO                 = 2; /* preferred ID for MPEG-1/2 video decoding */
00042     public static final int CODEC_ID_MPEG2VIDEO_XVMC    = 3;
00043     public static final int CODEC_ID_H261                               = 4;
00044     public static final int CODEC_ID_H263                               = 5;
00045     public static final int CODEC_ID_RV10                               = 6;
00046     public static final int CODEC_ID_RV20                               = 7;
00047     public static final int CODEC_ID_MJPEG                              = 8;
00048     public static final int CODEC_ID_MJPEGB                             = 9;
00049     public static final int CODEC_ID_LJPEG                              = 10;
00050     public static final int CODEC_ID_SP5X                               = 11;
00051     public static final int CODEC_ID_JPEGLS                             = 12;
00052     public static final int CODEC_ID_MPEG4                              = 13;
00053     public static final int CODEC_ID_RAWVIDEO                   = 14;
00054     public static final int CODEC_ID_MSMPEG4V1                  = 15;
00055     public static final int CODEC_ID_MSMPEG4V2                  = 16;
00056     public static final int CODEC_ID_MSMPEG4V3                  = 17;
00057     public static final int CODEC_ID_WMV1                               = 18;
00058     public static final int CODEC_ID_WMV2                               = 19;
00059     public static final int CODEC_ID_H263P                              = 20;
00060     public static final int CODEC_ID_H263I                              = 21;
00061     public static final int CODEC_ID_FLV1                               = 22;
00062     public static final int CODEC_ID_SVQ1                               = 23;
00063     public static final int CODEC_ID_SVQ3                               = 24;
00064     public static final int CODEC_ID_DVVIDEO                    = 25;
00065     public static final int CODEC_ID_HUFFYUV                    = 26;
00066     public static final int CODEC_ID_CYUV                               = 27;
00067     public static final int CODEC_ID_H264                               = 28;
00068     public static final int CODEC_ID_INDEO3                             = 29;
00069     public static final int CODEC_ID_VP3                                = 30;
00070     public static final int CODEC_ID_THEORA                             = 31;
00071     public static final int CODEC_ID_ASV1                               = 32;
00072     public static final int CODEC_ID_ASV2                               = 33;
00073     public static final int CODEC_ID_FFV1                               = 34;
00074     public static final int CODEC_ID_4XM                                = 35;
00075     public static final int CODEC_ID_VCR1                               = 36;
00076     public static final int CODEC_ID_CLJR                               = 37;
00077     public static final int CODEC_ID_MDEC                               = 38;
00078     public static final int CODEC_ID_ROQ                                = 39;
00079     public static final int CODEC_ID_INTERPLAY_VIDEO    = 40;
00080     public static final int CODEC_ID_XAN_WC3                    = 41;
00081     public static final int CODEC_ID_XAN_WC4                    = 42;
00082     public static final int CODEC_ID_RPZA                               = 43;
00083     public static final int CODEC_ID_CINEPAK                    = 44;
00084     public static final int CODEC_ID_WS_VQA                             = 45;
00085     public static final int CODEC_ID_MSRLE                              = 46;
00086     public static final int CODEC_ID_MSVIDEO1                   = 47;
00087     public static final int CODEC_ID_IDCIN                              = 48;
00088     public static final int CODEC_ID_8BPS                               = 49;
00089     public static final int CODEC_ID_SMC                                = 50;
00090     public static final int CODEC_ID_FLIC                               = 51;
00091     public static final int CODEC_ID_TRUEMOTION1                = 52;
00092     public static final int CODEC_ID_VMDVIDEO                   = 53;
00093     public static final int CODEC_ID_MSZH                               = 54;
00094     public static final int CODEC_ID_ZLIB                               = 55;
00095     public static final int CODEC_ID_QTRLE                              = 56;
00096     public static final int CODEC_ID_SNOW                               = 57;
00097     public static final int CODEC_ID_TSCC                               = 58;
00098     public static final int CODEC_ID_ULTI                               = 59;
00099     public static final int CODEC_ID_QDRAW                              = 60;
00100     public static final int CODEC_ID_VIXL                               = 61;
00101     public static final int CODEC_ID_QPEG                               = 62;
00102     public static final int CODEC_ID_XVID                               = 63;
00103     public static final int CODEC_ID_PNG                                = 64;
00104     public static final int CODEC_ID_PPM                                = 65;
00105     public static final int CODEC_ID_PBM                                = 66;
00106     public static final int CODEC_ID_PGM                                = 67;
00107     public static final int CODEC_ID_PGMYUV                             = 68;
00108     public static final int CODEC_ID_PAM                                = 69;
00109     public static final int CODEC_ID_FFVHUFF                    = 70;
00110     public static final int CODEC_ID_RV30                               = 71;
00111     public static final int CODEC_ID_RV40                               = 72;
00112     public static final int CODEC_ID_VC1                                = 73;
00113     public static final int CODEC_ID_WMV3                               = 74;
00114     public static final int CODEC_ID_LOCO                               = 75;
00115     public static final int CODEC_ID_WNV1                               = 76;
00116     public static final int CODEC_ID_AASC                               = 77;
00117     public static final int CODEC_ID_INDEO2                             = 78;
00118     public static final int CODEC_ID_FRAPS                              = 79;
00119     public static final int CODEC_ID_TRUEMOTION2                = 80;
00120     public static final int CODEC_ID_BMP                                = 81;
00121     public static final int CODEC_ID_CSCD                               = 82;
00122     public static final int CODEC_ID_MMVIDEO                    = 83;
00123     public static final int CODEC_ID_ZMBV                               = 84;
00124     public static final int CODEC_ID_AVS                                = 85;
00125     public static final int CODEC_ID_SMACKVIDEO                 = 86;
00126     public static final int CODEC_ID_NUV                                = 87;
00127     public static final int CODEC_ID_KMVC                               = 88;
00128     public static final int CODEC_ID_FLASHSV                    = 89;
00129     public static final int CODEC_ID_CAVS                               = 90;
00130     public static final int CODEC_ID_JPEG2000                   = 91;
00131     public static final int CODEC_ID_VMNC                               = 92;
00132     public static final int CODEC_ID_VP5                                = 93;
00133     public static final int CODEC_ID_VP6                                = 94;
00134     public static final int CODEC_ID_VP6F                               = 95;
00135     public static final int CODEC_ID_TARGA                              = 96;
00136     public static final int CODEC_ID_DSICINVIDEO                = 97;
00137     public static final int CODEC_ID_TIERTEXSEQVIDEO    = 98;
00138     public static final int CODEC_ID_TIFF                               = 99;
00139     public static final int CODEC_ID_GIF                                = 100;
00140     public static final int CODEC_ID_FFH264                             = 101;
00141     public static final int CODEC_ID_DXA                                = 102;
00142     public static final int CODEC_ID_DNXHD                              = 103;
00143     public static final int CODEC_ID_THP                                = 104;
00144     public static final int CODEC_ID_SGI                                = 105;
00145     public static final int CODEC_ID_C93                                = 106;
00146     public static final int CODEC_ID_BETHSOFTVID                = 107;
00147     public static final int CODEC_ID_PTX                                = 108;
00148     public static final int CODEC_ID_TXD                                = 109;
00149 
00150     /* various PCM "codecs" */
00151     public static final int CODEC_ID_PCM_S16LE                  = 0x10000;
00152     public static final int CODEC_ID_PCM_S16BE                  = 0x10001;
00153     public static final int CODEC_ID_PCM_U16LE                  = 0x10002;
00154     public static final int CODEC_ID_PCM_U16BE                  = 0x10003;
00155     public static final int CODEC_ID_PCM_S8                     = 0x10004;
00156     public static final int CODEC_ID_PCM_U8                     = 0x10005;
00157     public static final int CODEC_ID_PCM_MULAW                  = 0x10006;
00158     public static final int CODEC_ID_PCM_ALAW                   = 0x10007;
00159     public static final int CODEC_ID_PCM_S32LE                  = 0x10008;
00160     public static final int CODEC_ID_PCM_S32BE                  = 0x10009;
00161     public static final int CODEC_ID_PCM_U32LE                  = 0x1000a;
00162     public static final int CODEC_ID_PCM_U32BE                  = 0x1000b;
00163     public static final int CODEC_ID_PCM_S24LE                  = 0x1000c;
00164     public static final int CODEC_ID_PCM_S24BE                  = 0x1000d;
00165     public static final int CODEC_ID_PCM_U24LE                  = 0x1000e;
00166     public static final int CODEC_ID_PCM_U24BE                  = 0x1000f;
00167     public static final int CODEC_ID_PCM_S24DAUD                = 0x10010;
00168     public static final int CODEC_ID_PCM_ZORK                   = 0x10011;
00169 
00170     /* various ADPCM codecs */
00171     public static final int CODEC_ID_ADPCM_IMA_QT               = 0x11000;
00172     public static final int CODEC_ID_ADPCM_IMA_WAV              = 0x11001;
00173     public static final int CODEC_ID_ADPCM_IMA_DK3              = 0x11002;
00174     public static final int CODEC_ID_ADPCM_IMA_DK4              = 0x11003;
00175     public static final int CODEC_ID_ADPCM_IMA_WS               = 0x11004;
00176     public static final int CODEC_ID_ADPCM_IMA_SMJPEG   = 0x11005;
00177     public static final int CODEC_ID_ADPCM_MS                   = 0x11006;
00178     public static final int CODEC_ID_ADPCM_4XM                  = 0x11007;
00179     public static final int CODEC_ID_ADPCM_XA                   = 0x11008;
00180     public static final int CODEC_ID_ADPCM_ADX                  = 0x11009;
00181     public static final int CODEC_ID_ADPCM_EA                   = 0x1100a;
00182     public static final int CODEC_ID_ADPCM_G726                 = 0x1100b;
00183     public static final int CODEC_ID_ADPCM_CT                   = 0x1100c;
00184     public static final int CODEC_ID_ADPCM_SWF                  = 0x1100d;
00185     public static final int CODEC_ID_ADPCM_YAMAHA               = 0x1100e;
00186     public static final int CODEC_ID_ADPCM_SBPRO_4              = 0x1100f;
00187     public static final int CODEC_ID_ADPCM_SBPRO_3              = 0x11010;
00188     public static final int CODEC_ID_ADPCM_SBPRO_2              = 0x11011;
00189     public static final int CODEC_ID_ADPCM_THP                  = 0x11012;
00190 
00191     /* AMR */
00192     public static final int CODEC_ID_AMR_NB                             = 0x12000;
00193     public static final int CODEC_ID_AMR_WB                     = 0x12001;
00194 
00195     /* RealAudio codecs*/
00196     public static final int CODEC_ID_RA_144                             = 0x13000;
00197     public static final int CODEC_ID_RA_288                     = 0x13001;
00198 
00199     /* various DPCM codecs */
00200     public static final int CODEC_ID_ROQ_DPCM                   = 0x14000;
00201     public static final int CODEC_ID_INTERPLAY_DPCM     = 0x14001;
00202     public static final int CODEC_ID_XAN_DPCM                   = 0x14002;
00203     public static final int CODEC_ID_SOL_DPCM                   = 0x14003;
00204 
00205     public static final int CODEC_ID_MP2                                = 0x15000;
00206     public static final int CODEC_ID_MP3                                = 0x15001; /* preferred ID for decoding MPEG audio layer 1, 2 or 3 */
00207     public static final int CODEC_ID_AAC                                = 0x15002;
00208 //#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00209 //    public static final int CODEC_ID_MPEG4AAC                 = 0x15003;      // re-defined below
00210 //#endif
00211     public static final int CODEC_ID_AC3                                = 0x15003;
00212     public static final int CODEC_ID_DTS                                = 0x15004;
00213     public static final int CODEC_ID_VORBIS                             = 0x15005;
00214     public static final int CODEC_ID_DVAUDIO                    = 0x15006;
00215     public static final int CODEC_ID_WMAV1                              = 0x15007;
00216     public static final int CODEC_ID_WMAV2                              = 0x15008;
00217     public static final int CODEC_ID_MACE3                              = 0x15009;
00218     public static final int CODEC_ID_MACE6                              = 0x1500a;
00219     public static final int CODEC_ID_VMDAUDIO                   = 0x1500b;
00220     public static final int CODEC_ID_SONIC                              = 0x1500c;
00221     public static final int CODEC_ID_SONIC_LS                   = 0x1500d;
00222     public static final int CODEC_ID_FLAC                               = 0x1500e;
00223     public static final int CODEC_ID_MP3ADU                             = 0x1500f;
00224     public static final int CODEC_ID_MP3ON4                             = 0x15010;
00225     public static final int CODEC_ID_SHORTEN                    = 0x15011;
00226     public static final int CODEC_ID_ALAC                               = 0x15012;
00227     public static final int CODEC_ID_WESTWOOD_SND1              = 0x15013;
00228     public static final int CODEC_ID_GSM                                = 0x15014; /* as in Berlin toast format */
00229     public static final int CODEC_ID_QDM2                               = 0x15015;
00230     public static final int CODEC_ID_COOK                               = 0x15016;
00231     public static final int CODEC_ID_TRUESPEECH                 = 0x15017;
00232     public static final int CODEC_ID_TTA                                = 0x15018;
00233     public static final int CODEC_ID_SMACKAUDIO                 = 0x15019;
00234     public static final int CODEC_ID_QCELP                              = 0x1501a;
00235     public static final int CODEC_ID_WAVPACK                    = 0x1501b;
00236     public static final int CODEC_ID_DSICINAUDIO                = 0x1501c;
00237     public static final int CODEC_ID_IMC                                = 0x1501d;
00238     public static final int CODEC_ID_MUSEPACK7                  = 0x1501e;
00239     public static final int CODEC_ID_MLP                                = 0x1501f;
00240     public static final int CODEC_ID_GSM_MS                             = 0x15020; /* as found in WAV */
00241     public static final int CODEC_ID_ATRAC3                             = 0x15021;
00242     public static final int CODEC_ID_VOXWARE                    = 0x15022;
00243 
00244     /* subtitle codecs */
00245     public static final int CODEC_ID_DVD_SUBTITLE               = 0x17000;
00246     public static final int CODEC_ID_DVB_SUBTITLE               = 0x17001;
00247     public static final int CODEC_ID_TEXT                               = 0x17002;  /* raw UTF-8 text */
00248     public static final int CODEC_ID_XSUB                               = 0x17003;
00249 
00250     public static final int CODEC_ID_MPEG2TS                    = 0x20000; /* _FAKE_ codec to indicate a raw MPEG-2 TS stream (only used by libavformat) */
00251 
00252 
00253     
00254     //#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00255     /* CODEC_ID_MP3LAME is obsolete */
00256     public static final int CODEC_ID_MP3LAME = CODEC_ID_MP3;
00257     public static final int CODEC_ID_MPEG4AAC = CODEC_ID_AAC;
00258     //#endif
00259     
00260     
00261         //      enum CodecType:
00262         public static final int CODEC_TYPE_UNKNOWN = -1;
00263         public static final int CODEC_TYPE_VIDEO = 0;
00264         public static final int CODEC_TYPE_AUDIO = 1;
00265         public static final int CODEC_TYPE_DATA = 2;
00266         public static final int CODEC_TYPE_SUBTITLE = 3;
00267         public static final int CODEC_TYPE_NB = 4;
00268 
00269         
00270         /* Currently unused, may be used if 24/32 bits samples are ever supported. */
00271         /* all in native-endian format */
00272         //enum SampleFormat:
00273         public static final int SAMPLE_FMT_NONE = -1;
00274         public static final int SAMPLE_FMT_U8 = 0;              
00275         public static final int SAMPLE_FMT_S16 = 1;             
00276         public static final int SAMPLE_FMT_S24 = 2;             
00277         public static final int SAMPLE_FMT_S32 = 3;             
00278         public static final int SAMPLE_FMT_FLT = 4;             
00279         public static final int SAMPLE_FMT_DBL = 5;
00280         public static final int SAMPLE_FMT_NB = 6;
00281 
00282         /* in bytes */
00283         public static final int AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio
00284 
00292         public static final int FF_INPUT_BUFFER_PADDING_SIZE = 8;
00293 
00298         public static final int  FF_MIN_BUFFER_SIZE = 16384;
00299 
00300         /* motion estimation type, EPZS by default */
00301         //enum Motion_Est_ID:
00302         public static final int SME_ZERO = 1;
00303         public static final int SME_FULL = 2;
00304         public static final int SME_LOG = 3;
00305         public static final int SME_PHODS = 4;
00306         public static final int SME_EPZS = 5;
00307         public static final int SME_X1 = 6;
00308         public static final int SME_HEX = 7;
00309         public static final int SME_UMH = 8;
00310         public static final int SME_ITER = 9;
00311 
00312 
00313         //enum AVDiscard:
00314             /* We leave some space between them for extensions (drop some
00315              * keyframes for intra-only or drop just some bidir frames). */
00316         public static final int AVDISCARD_NONE   =-16; 
00317         public static final int AVDISCARD_DEFAULT=  0; 
00318         public static final int AVDISCARD_NONREF =  8; 
00319         public static final int AVDISCARD_BIDIR  = 16; 
00320         public static final int AVDISCARD_NONKEY = 32; 
00321         public static final int AVDISCARD_ALL    = 48; 
00322 
00323 
00324 //      typedef struct RcOverride{
00325 //          int start_frame;
00326 //          int end_frame;
00327 //          int qscale; // If this is 0 then quality_factor will be used instead.
00328 //          float quality_factor;
00329 //      } RcOverride;
00330         
00331         public static class RcOverride extends Structure {
00332             public int start_frame;
00333             public int end_frame;
00334             public int qscale; // If this is 0 then quality_factor will be used instead.
00335             public float quality_factor;
00336         };
00337 
00338         public static final int  FF_MAX_B_FRAMES = 16;
00339 
00340         
00341         /* encoding support
00342            These flags can be passed in AVCodecContext.flags before initialization.
00343            Note: Not everything is supported yet.
00344         */
00345 
00346         public static final int CODEC_FLAG_QSCALE = 0x0002;  
00347         public static final int CODEC_FLAG_4MV    = 0x0004;  
00348         public static final int CODEC_FLAG_QPEL   = 0x0010;  
00349         public static final int CODEC_FLAG_GMC    = 0x0020;  
00350         public static final int CODEC_FLAG_MV0    = 0x0040;  
00351         public static final int CODEC_FLAG_PART   = 0x0080;  
00352         /* The parent program guarantees that the input for B-frames containing
00353          * streams is not written to for at least s->max_b_frames+1 frames, if
00354          * this is not set the input will be copied. */
00355         public static final int CODEC_FLAG_INPUT_PRESERVED = 0x0100;
00356         public static final int CODEC_FLAG_PASS1 = 0x0200;  
00357         public static final int CODEC_FLAG_PASS2 = 0x0400;  
00358         public static final int CODEC_FLAG_EXTERN_HUFF = 0x1000; 
00359         public static final int CODEC_FLAG_GRAY  = 0x2000;  
00360         public static final int CODEC_FLAG_EMU_EDGE = 0x4000;
00361         public static final int CODEC_FLAG_PSNR           = 0x8000; 
00362         public static final int CODEC_FLAG_TRUNCATED  = 0x00010000; 
00364         public static final int CODEC_FLAG_NORMALIZE_AQP  = 0x00020000; 
00365         public static final int CODEC_FLAG_INTERLACED_DCT = 0x00040000; 
00366         public static final int CODEC_FLAG_LOW_DELAY      = 0x00080000; 
00367         public static final int CODEC_FLAG_ALT_SCAN       = 0x00100000; 
00368         //public static final int CODEC_FLAG_TRELLIS_QUANT  = 0x00200000; ///< Use trellis quantization.
00369         public static final int CODEC_FLAG_GLOBAL_HEADER  = 0x00400000; 
00370         public static final int CODEC_FLAG_BITEXACT       = 0x00800000; 
00371         /* Fx : Flag for h263+ extra options */
00372         //#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
00373         //public static final int CODEC_FLAG_H263P_AIC      = 0x01000000; ///< H.263 advanced intra coding / MPEG-4 AC prediction (remove this)
00374         //#endif
00375         public static final int CODEC_FLAG_AC_PRED        = 0x01000000; 
00376         public static final int CODEC_FLAG_H263P_UMV      = 0x02000000; 
00377         public static final int CODEC_FLAG_CBP_RD         = 0x04000000; 
00378         public static final int CODEC_FLAG_QP_RD          = 0x08000000; 
00379         public static final int CODEC_FLAG_H263P_AIV      = 0x00000008; 
00380         public static final int CODEC_FLAG_OBMC           = 0x00000001; 
00381         public static final int CODEC_FLAG_LOOP_FILTER    = 0x00000800; 
00382         public static final int CODEC_FLAG_H263P_SLICE_STRUCT = 0x10000000;
00383         public static final int CODEC_FLAG_INTERLACED_ME  = 0x20000000; 
00384         public static final int CODEC_FLAG_SVCD_SCAN_OFFSET = 0x40000000; 
00385         public static final int CODEC_FLAG_CLOSED_GOP     = ((int)0x80000000);
00386         public static final int CODEC_FLAG2_FAST          = 0x00000001; 
00387         public static final int CODEC_FLAG2_STRICT_GOP    = 0x00000002; 
00388         public static final int CODEC_FLAG2_NO_OUTPUT     = 0x00000004; 
00389         public static final int CODEC_FLAG2_LOCAL_HEADER  = 0x00000008; 
00390         public static final int CODEC_FLAG2_BPYRAMID      = 0x00000010; 
00391         public static final int CODEC_FLAG2_WPRED         = 0x00000020; 
00392         public static final int CODEC_FLAG2_MIXED_REFS    = 0x00000040; 
00393         public static final int CODEC_FLAG2_8X8DCT        = 0x00000080; 
00394         public static final int CODEC_FLAG2_FASTPSKIP     = 0x00000100; 
00395         public static final int CODEC_FLAG2_AUD           = 0x00000200; 
00396         public static final int CODEC_FLAG2_BRDO          = 0x00000400; 
00397         public static final int CODEC_FLAG2_INTRA_VLC     = 0x00000800; 
00398         public static final int CODEC_FLAG2_MEMC_ONLY     = 0x00001000; 
00399         public static final int CODEC_FLAG2_DROP_FRAME_TIMECODE = 0x00002000; 
00400         public static final int CODEC_FLAG2_SKIP_RD       = 0x00004000; 
00401         public static final int CODEC_FLAG2_CHUNKS        = 0x00008000; 
00402         public static final int CODEC_FLAG2_NON_LINEAR_QUANT = 0x00010000; 
00403 
00404         /* Unsupported options :
00405          *              Syntax Arithmetic coding (SAC)
00406          *              Reference Picture Selection
00407          *              Independent Segment Decoding */
00408         /* /Fx */
00409         /* codec capabilities */
00410 
00411         public static final int CODEC_CAP_DRAW_HORIZ_BAND = 0x0001; 
00412 
00416         public static final int CODEC_CAP_DR1             = 0x0002;
00417         /* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
00418         public static final int CODEC_CAP_PARSE_ONLY      = 0x0004;
00419         public static final int CODEC_CAP_TRUNCATED       = 0x0008;
00420         /* Codec can export data for HW decoding (XvMC). */
00421         public static final int CODEC_CAP_HWACCEL         = 0x0010;
00426         public static final int CODEC_CAP_DELAY           = 0x0020;
00431         public static final int CODEC_CAP_SMALL_LAST_FRAME = 0x0040;
00432 
00433         //The following defines may change, don't expect compatibility if you use them.
00434         public static final int MB_TYPE_INTRA4x4   = 0x0001;
00435         public static final int MB_TYPE_INTRA16x16 = 0x0002; //FIXME H.264-specific
00436         public static final int MB_TYPE_INTRA_PCM  = 0x0004; //FIXME H.264-specific
00437         public static final int MB_TYPE_16x16      = 0x0008;
00438         public static final int MB_TYPE_16x8       = 0x0010;
00439         public static final int MB_TYPE_8x16       = 0x0020;
00440         public static final int MB_TYPE_8x8        = 0x0040;
00441         public static final int MB_TYPE_INTERLACED = 0x0080;
00442         public static final int MB_TYPE_DIRECT2     = 0x0100; //FIXME
00443         public static final int MB_TYPE_ACPRED     = 0x0200;
00444         public static final int MB_TYPE_GMC        = 0x0400;
00445         public static final int MB_TYPE_SKIP       = 0x0800;
00446         public static final int MB_TYPE_P0L0       = 0x1000;
00447         public static final int MB_TYPE_P1L0       = 0x2000;
00448         public static final int MB_TYPE_P0L1       = 0x4000;
00449         public static final int MB_TYPE_P1L1       = 0x8000;
00450         public static final int MB_TYPE_L0         = (MB_TYPE_P0L0 | MB_TYPE_P1L0);
00451         public static final int MB_TYPE_L1         = (MB_TYPE_P0L1 | MB_TYPE_P1L1);
00452         public static final int MB_TYPE_L0L1       = (MB_TYPE_L0   | MB_TYPE_L1);
00453         public static final int MB_TYPE_QUANT      = 0x00010000;
00454         public static final int MB_TYPE_CBP        = 0x00020000;
00455         //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
00456         
00457         
00458 //      /**
00459 //       * Pan Scan area.
00460 //       * This specifies the area which should be displayed.
00461 //       * Note there may be multiple such areas for one frame.
00462 //       */
00463 //      typedef struct AVPanScan{
00464 //          /**
00465 //           * id
00466 //           * - encoding: Set by user.
00467 //           * - decoding: Set by libavcodec.
00468 //           */
00469 //          int id;
00470 //
00471 //          /**
00472 //           * width and height in 1/16 pel
00473 //           * - encoding: Set by user.
00474 //           * - decoding: Set by libavcodec.
00475 //           */
00476 //          int width;
00477 //          int height;
00478 //
00479 //          /**
00480 //           * position of the top left corner in 1/16 pel for up to 3 fields/frames
00481 //           * - encoding: Set by user.
00482 //           * - decoding: Set by libavcodec.
00483 //           */
00484 //          int16_t position[3][2];
00485 //      }AVPanScan;
00486         
00492         public static class AVPanScan extends Structure
00493         {
00499             public int id;
00500 
00506             public int width;
00507             public int height;
00508 
00514             public short[] position = new short[3*2];   // JNA doesn't support multidimensional arrays (I don't think), so we'll just use a larger 1-dimensional array, which is equivalent memory-wise.
00515         };
00516         
00517         
00518 //      #define FF_COMMON_FRAME \
00519 //  /**\
00520 //   * pointer to the picture planes.\
00521 //   * This might be different from the first allocated byte\
00522 //   * - encoding: \
00523 //   * - decoding: \
00524 //   */\
00525 //  uint8_t *data[4];\
00526 //  int linesize[4];\
00527 //  /**\
00528 //   * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
00529 //   * This isn't used by libavcodec unless the default get/release_buffer() is used.\
00530 //   * - encoding: \
00531 //   * - decoding: \
00532 //   */\
00533 //  uint8_t *base[4];\
00534 //  /**\
00535 //   * 1 -> keyframe, 0-> not\
00536 //   * - encoding: Set by libavcodec.\
00537 //   * - decoding: Set by libavcodec.\
00538 //   */\
00539 //  int key_frame;\
00540 //\
00541 //  /**\
00542 //   * Picture type of the frame, see ?_TYPE below.\
00543 //   * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
00544 //   * - decoding: Set by libavcodec.\
00545 //   */\
00546 //  int pict_type;\
00547 //\
00548 //  /**\
00549 //   * presentation timestamp in time_base units (time when frame should be shown to user)\
00550 //   * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
00551 //   * - encoding: MUST be set by user.\
00552 //   * - decoding: Set by libavcodec.\
00553 //   */\
00554 //  int64_t pts;\
00555 //\
00556 //  /**\
00557 //   * picture number in bitstream order\
00558 //   * - encoding: set by\
00559 //   * - decoding: Set by libavcodec.\
00560 //   */\
00561 //  int coded_picture_number;\
00562 //  /**\
00563 //   * picture number in display order\
00564 //   * - encoding: set by\
00565 //   * - decoding: Set by libavcodec.\
00566 //   */\
00567 //  int display_picture_number;\
00568 //\
00569 //  /**\
00570 //   * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
00571 //   * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
00572 //   * - decoding: Set by libavcodec.\
00573 //   */\
00574 //  int quality; \
00575 //\
00576 //  /**\
00577 //   * buffer age (1->was last buffer and dint change, 2->..., ...).\
00578 //   * Set to INT_MAX if the buffer has not been used yet.\
00579 //   * - encoding: unused\
00580 //   * - decoding: MUST be set by get_buffer().\
00581 //   */\
00582 //  int age;\
00583 //\
00584 //  /**\
00585 //   * is this picture used as reference\
00586 //   * - encoding: unused\
00587 //   * - decoding: Set by libavcodec. (before get_buffer() call)).\
00588 //   */\
00589 //  int reference;\
00590 //\
00591 //  /**\
00592 //   * QP table\
00593 //   * - encoding: unused\
00594 //   * - decoding: Set by libavcodec.\
00595 //   */\
00596 //  int8_t *qscale_table;\
00597 //  /**\
00598 //   * QP store stride\
00599 //   * - encoding: unused\
00600 //   * - decoding: Set by libavcodec.\
00601 //   */\
00602 //  int qstride;\
00603 //\
00604 //  /**\
00605 //   * mbskip_table[mb]>=1 if MB didn't change\
00606 //   * stride= mb_width = (width+15)>>4\
00607 //   * - encoding: unused\
00608 //   * - decoding: Set by libavcodec.\
00609 //   */\
00610 //  uint8_t *mbskip_table;\
00611 //\
00612 //  /**\
00613 //   * motion vector table\
00614 //   * @code\
00615 //   * example:\
00616 //   * int mv_sample_log2= 4 - motion_subsample_log2;\
00617 //   * int mb_width= (width+15)>>4;\
00618 //   * int mv_stride= (mb_width << mv_sample_log2) + 1;\
00619 //   * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
00620 //   * @endcode\
00621 //   * - encoding: Set by user.\
00622 //   * - decoding: Set by libavcodec.\
00623 //   */\
00624 //  int16_t (*motion_val[2])[2];\
00625 //\
00626 //  /**\
00627 //   * macroblock type table\
00628 //   * mb_type_base + mb_width + 2\
00629 //   * - encoding: Set by user.\
00630 //   * - decoding: Set by libavcodec.\
00631 //   */\
00632 //  uint32_t *mb_type;\
00633 //\
00634 //  /**\
00635 //   * log2 of the size of the block which a single vector in motion_val represents: \
00636 //   * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
00637 //   * - encoding: unused\
00638 //   * - decoding: Set by libavcodec.\
00639 //   */\
00640 //  uint8_t motion_subsample_log2;\
00641 //\
00642 //  /**\
00643 //   * for some private data of the user\
00644 //   * - encoding: unused\
00645 //   * - decoding: Set by user.\
00646 //   */\
00647 //  void *opaque;\
00648 //\
00649 //  /**\
00650 //   * error\
00651 //   * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
00652 //   * - decoding: unused\
00653 //   */\
00654 //  uint64_t error[4];\
00655 //\
00656 //  /**\
00657 //   * type of the buffer (to keep track of who has to deallocate data[*])\
00658 //   * - encoding: Set by the one who allocates it.\
00659 //   * - decoding: Set by the one who allocates it.\
00660 //   * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
00661 //   */\
00662 //  int type;\
00663 //  \
00664 //  /**\
00665 //   * When decoding, this signals how much the picture must be delayed.\
00666 //   * extra_delay = repeat_pict / (2*fps)\
00667 //   * - encoding: unused\
00668 //   * - decoding: Set by libavcodec.\
00669 //   */\
00670 //  int repeat_pict;\
00671 //  \
00672 //  /**\
00673 //   * \
00674 //   */\
00675 //  int qscale_type;\
00676 //  \
00677 //  /**\
00678 //   * The content of the picture is interlaced.\
00679 //   * - encoding: Set by user.\
00680 //   * - decoding: Set by libavcodec. (default 0)\
00681 //   */\
00682 //  int interlaced_frame;\
00683 //  \
00684 //  /**\
00685 //   * If the content is interlaced, is top field displayed first.\
00686 //   * - encoding: Set by user.\
00687 //   * - decoding: Set by libavcodec.\
00688 //   */\
00689 //  int top_field_first;\
00690 //  \
00691 //  /**\
00692 //   * Pan scan.\
00693 //   * - encoding: Set by user.\
00694 //   * - decoding: Set by libavcodec.\
00695 //   */\
00696 //  AVPanScan *pan_scan;\
00697 //  \
00698 //  /**\
00699 //   * Tell user application that palette has changed from previous frame.\
00700 //   * - encoding: ??? (no palette-enabled encoder yet)\
00701 //   * - decoding: Set by libavcodec. (default 0).\
00702 //   */\
00703 //  int palette_has_changed;\
00704 //  \
00705 //  /**\
00706 //   * codec suggestion on buffer type if != 0\
00707 //   * - encoding: unused\
00708 //   * - decoding: Set by libavcodec. (before get_buffer() call)).\
00709 //   */\
00710 //  int buffer_hints;\
00711 //\
00712 //  /**\
00713 //   * DCT coefficients\
00714 //   * - encoding: unused\
00715 //   * - decoding: Set by libavcodec.\
00716 //   */\
00717 //  short *dct_coeff;\
00718 //\
00719 //  /**\
00720 //   * motion referece frame index\
00721 //   * - encoding: Set by user.\
00722 //   * - decoding: Set by libavcodec.\
00723 //   */\
00724 //  int8_t *ref_index[2];
00725 //
00726 //#define FF_QSCALE_TYPE_MPEG1 0
00727 //#define FF_QSCALE_TYPE_MPEG2 1
00728 //#define FF_QSCALE_TYPE_H264  2
00729 //
00730 //#define FF_BUFFER_TYPE_INTERNAL 1
00731 //#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
00732 //#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
00733 //#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
00734 //
00735 //
00736 //#define FF_I_TYPE 1 // Intra
00737 //#define FF_P_TYPE 2 // Predicted
00738 //#define FF_B_TYPE 3 // Bi-dir predicted
00739 //#define FF_S_TYPE 4 // S(GMC)-VOP MPEG4
00740 //#define FF_SI_TYPE 5
00741 //#define FF_SP_TYPE 6
00742 //
00743 //#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
00744 //#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
00745 //#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
00746 //#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
00747 
00748 //      /**
00749 //       * Audio Video Frame.
00750 //       */
00751 //      typedef struct AVFrame {
00752 //          FF_COMMON_FRAME
00753 //      } AVFrame;
00754         
00755         public static class AVFrame extends Structure
00756         {
00757                 //uint8_t *data[4];
00758             public Pointer data0;
00759             public Pointer data1;
00760             public Pointer data2;
00761             public Pointer data3;
00762             
00763             public int[] linesize = new int[4];
00764            
00765             //uint8_t *base[4];
00766             public Pointer base0;
00767             public Pointer base1;
00768             public Pointer base2;
00769             public Pointer base3;
00770             
00771             public int key_frame;
00772             public int pict_type;
00773             public long pts;
00774             public int coded_picture_number;
00775             public int display_picture_number;
00776             public int quality;
00777             public int age;
00778             public int reference;
00779             public Pointer qscale_table;
00780             public int qstride;
00781             public Pointer mbskip_table;
00782             //int16_t (*motion_val[2])[2];
00783             public Pointer motion_val0;
00784             public Pointer motion_val1;
00785             public Pointer mb_type;
00786             public byte motion_subsample_log2;
00787             public Pointer opaque;
00788             public long[] error = new long[4];
00789             public int type;
00790             public int repeat_pict;
00791             public int qscale_type;
00792             public int interlaced_frame;
00793             public int top_field_first;
00794             public Pointer pan_scan;
00795             public int palette_has_changed;
00796             public int buffer_hints;
00797             public Pointer dct_coeff;
00798                 //int8_t *ref_index[2];
00799             public Pointer ref_index0;
00800             public Pointer ref_index1;
00801             
00802                 public static final int FF_QSCALE_TYPE_MPEG1 =0;
00803                 public static final int FF_QSCALE_TYPE_MPEG2 =1;
00804                 public static final int FF_QSCALE_TYPE_H264  =2;
00805                 //
00806                 public static final int FF_BUFFER_TYPE_INTERNAL =1;
00807                 public static final int FF_BUFFER_TYPE_USER     =2; 
00808                 public static final int FF_BUFFER_TYPE_SHARED   =4; 
00809                 public static final int FF_BUFFER_TYPE_COPY     =8; 
00810                 //
00811                 //
00812                 public static final int FF_I_TYPE =1; // Intra
00813                 public static final int FF_P_TYPE =2; // Predicted
00814                 public static final int FF_B_TYPE =3; // Bi-dir predicted
00815                 public static final int FF_S_TYPE =4; // S(GMC)-VOP MPEG4
00816                 public static final int FF_SI_TYPE =5;
00817                 public static final int FF_SP_TYPE =6;
00818                 //
00819                 public static final int FF_BUFFER_HINTS_VALID    =0x01; // Buffer hints value is meaningful (if 0 ignore).
00820                 public static final int FF_BUFFER_HINTS_READABLE =0x02; // Codec will read from buffer.
00821                 public static final int FF_BUFFER_HINTS_PRESERVE =0x04; // User must not alter buffer content.
00822                 public static final int FF_BUFFER_HINTS_REUSABLE =0x08; // Codec will reuse the buffer (update).
00823             
00824                 public AVFrame()
00825                 {
00826                         super();
00827                 }
00828                 
00829                 public AVFrame(Pointer p)
00830                 {       super();
00831                         useMemory(p);
00832                         read();
00833                 }
00834         }
00835         
00836         public static final int DEFAULT_FRAME_RATE_BASE = 1001000;
00837         
00838 
00839         
00840 //      /**
00841 //       * main external API structure
00842 //       */
00843 //      typedef struct AVCodecContext {
00844 //          /**
00845 //           * information on struct for av_log
00846 //           * - set by avcodec_alloc_context
00847 //           */
00848 //          AVClass *av_class;
00849 //          /**
00850 //           * the average bitrate
00851 //           * - encoding: Set by user; unused for constant quantizer encoding.
00852 //           * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
00853 //           */
00854 //          int bit_rate;
00855 //
00856 //          /**
00857 //           * number of bits the bitstream is allowed to diverge from the reference.
00858 //           *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
00859 //           * - encoding: Set by user; unused for constant quantizer encoding.
00860 //           * - decoding: unused
00861 //           */
00862 //          int bit_rate_tolerance;
00863 //
00864 //          /**
00865 //           * CODEC_FLAG_*.
00866 //           * - encoding: Set by user.
00867 //           * - decoding: Set by user.
00868 //           */
00869 //          int flags;
00870 //
00871 //          /**
00872 //           * Some codecs need additional format info. It is stored here.
00873 //           * If any muxer uses this then ALL demuxers/parsers AND encoders for the
00874 //           * specific codec MUST set it correctly otherwise stream copy breaks.
00875 //           * In general use of this field by muxers is not recommanded.
00876 //           * - encoding: Set by libavcodec.
00877 //           * - decoding: Set by libavcodec. (FIXME: Is this OK?)
00878 //           */
00879 //          int sub_id;
00880 //
00881 //          /**
00882 //           * Motion estimation algorithm used for video coding.
00883 //           * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
00884 //           * 8 (umh), 9 (iter) [7, 8 are x264 specific, 9 is snow specific]
00885 //           * - encoding: MUST be set by user.
00886 //           * - decoding: unused
00887 //           */
00888 //          int me_method;
00889 //
00890 //          /**
00891 //           * some codecs need / can use extradata like Huffman tables.
00892 //           * mjpeg: Huffman tables
00893 //           * rv10: additional flags
00894 //           * mpeg4: global headers (they can be in the bitstream or here)
00895 //           * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
00896 //           * than extradata_size to avoid prolems if it is read with the bitstream reader.
00897 //           * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
00898 //           * - encoding: Set/allocated/freed by libavcodec.
00899 //           * - decoding: Set/allocated/freed by user.
00900 //           */
00901 //          uint8_t *extradata;
00902 //          int extradata_size;
00903 //
00904 //          /**
00905 //           * This is the fundamental unit of time (in seconds) in terms
00906 //           * of which frame timestamps are represented. For fixed-fps content,
00907 //           * timebase should be 1/framerate and timestamp increments should be
00908 //           * identically 1.
00909 //           * - encoding: MUST be set by user.
00910 //           * - decoding: Set by libavcodec.
00911 //           */
00912 //          AVRational time_base;
00913 //
00914 //          /* video only */
00915 //          /**
00916 //           * picture width / height.
00917 //           * - encoding: MUST be set by user.
00918 //           * - decoding: Set by libavcodec.
00919 //           * Note: For compatibility it is possible to set this instead of
00920 //           * coded_width/height before decoding.
00921 //           */
00922 //          int width, height;
00923 //
00924 //      #define FF_ASPECT_EXTENDED 15
00925 //
00926 //          /**
00927 //           * the number of pictures in a group of pictures, or 0 for intra_only
00928 //           * - encoding: Set by user.
00929 //           * - decoding: unused
00930 //           */
00931 //          int gop_size;
00932 //
00933 //          /**
00934 //           * Pixel format, see PIX_FMT_xxx.
00935 //           * - encoding: Set by user.
00936 //           * - decoding: Set by libavcodec.
00937 //           */
00938 //          enum PixelFormat pix_fmt;
00939 //
00940 //          /**
00941 //           * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
00942 //           * has to read frames at native frame rate.
00943 //           * - encoding: Set by user.
00944 //           * - decoding: unused
00945 //           */
00946 //          int rate_emu;
00947 //
00948 //          /**
00949 //           * If non NULL, 'draw_horiz_band' is called by the libavcodec
00950 //           * decoder to draw a horizontal band. It improves cache usage. Not
00951 //           * all codecs can do that. You must check the codec capabilities
00952 //           * beforehand.
00953 //           * - encoding: unused
00954 //           * - decoding: Set by user.
00955 //           * @param height the height of the slice
00956 //           * @param y the y position of the slice
00957 //           * @param type 1->top field, 2->bottom field, 3->frame
00958 //           * @param offset offset into the AVFrame.data from which the slice should be read
00959 //           */
00960 //          void (*draw_horiz_band)(struct AVCodecContext *s,
00961 //                                  const AVFrame *src, int offset[4],
00962 //                                  int y, int type, int height);
00963 //
00964 //          /* audio only */
00965 //          int sample_rate; ///< samples per second
00966 //          int channels;
00967 //
00968 //          /**
00969 //           * audio sample format
00970 //           * - encoding: Set by user.
00971 //           * - decoding: Set by libavcodec.
00972 //           */
00973 //          enum SampleFormat sample_fmt;  ///< sample format, currently unused
00974 //
00975 //          /* The following data should not be initialized. */
00976 //          /**
00977 //           * Samples per packet, initialized when calling 'init'.
00978 //           */
00979 //          int frame_size;
00980 //          int frame_number;   ///< audio or video frame number
00981 //          int real_pict_num;  ///< Returns the real picture number of previous encoded frame.
00982 //
00983 //          /**
00984 //           * Number of frames the decoded output will be delayed relative to
00985 //           * the encoded input.
00986 //           * - encoding: Set by libavcodec.
00987 //           * - decoding: unused
00988 //           */
00989 //          int delay;
00990 //
00991 //          /* - encoding parameters */
00992 //          float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
00993 //          float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
00994 //
00995 //          /**
00996 //           * minimum quantizer
00997 //           * - encoding: Set by user.
00998 //           * - decoding: unused
00999 //           */
01000 //          int qmin;
01001 //
01002 //          /**
01003 //           * maximum quantizer
01004 //           * - encoding: Set by user.
01005 //           * - decoding: unused
01006 //           */
01007 //          int qmax;
01008 //
01009 //          /**
01010 //           * maximum quantizer difference between frames
01011 //           * - encoding: Set by user.
01012 //           * - decoding: unused
01013 //           */
01014 //          int max_qdiff;
01015 //
01016 //          /**
01017 //           * maximum number of B-frames between non-B-frames
01018 //           * Note: The output will be delayed by max_b_frames+1 relative to the input.
01019 //           * - encoding: Set by user.
01020 //           * - decoding: unused
01021 //           */
01022 //          int max_b_frames;
01023 //
01024 //          /**
01025 //           * qscale factor between IP and B-frames
01026 //           * - encoding: Set by user.
01027 //           * - decoding: unused
01028 //           */
01029 //          float b_quant_factor;
01030 //
01031 //          /** obsolete FIXME remove */
01032 //          int rc_strategy;
01033 //      #define FF_RC_STRATEGY_XVID 1
01034 //
01035 //          int b_frame_strategy;
01036 //
01037 //          /**
01038 //           * hurry up amount
01039 //           * - encoding: unused
01040 //           * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
01041 //           * @deprecated Deprecated in favor of skip_idct and skip_frame.
01042 //           */
01043 //          int hurry_up;
01044 //
01045 //          struct AVCodec *codec;
01046 //
01047 //          void *priv_data;
01048 //
01049 //      #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
01050 //          /* unused, FIXME remove*/
01051 //          int rtp_mode;
01052 //      #endif
01053 //
01054 //          int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
01055 //                                  /* do its best to deliver a chunk with size     */
01056 //                                  /* below rtp_payload_size, the chunk will start */
01057 //                                  /* with a start code on some codecs like H.263. */
01058 //                                  /* This doesn't take account of any particular  */
01059 //                                  /* headers inside the transmitted RTP payload.  */
01060 //
01061 //
01062 //          /* The RTP callback: This function is called    */
01063 //          /* every time the encoder has a packet to send. */
01064 //          /* It depends on the encoder if the data starts */
01065 //          /* with a Start Code (it should). H.263 does.   */
01066 //          /* mb_nb contains the number of macroblocks     */
01067 //          /* encoded in the RTP payload.                  */
01068 //          void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
01069 //
01070 //          /* statistics, used for 2-pass encoding */
01071 //          int mv_bits;
01072 //          int header_bits;
01073 //          int i_tex_bits;
01074 //          int p_tex_bits;
01075 //          int i_count;
01076 //          int p_count;
01077 //          int skip_count;
01078 //          int misc_bits;
01079 //
01080 //          /**
01081 //           * number of bits used for the previously encoded frame
01082 //           * - encoding: Set by libavcodec.
01083 //           * - decoding: unused
01084 //           */
01085 //          int frame_bits;
01086 //
01087 //          /**
01088 //           * Private data of the user, can be used to carry app specific stuff.
01089 //           * - encoding: Set by user.
01090 //           * - decoding: Set by user.
01091 //           */
01092 //          void *opaque;
01093 //
01094 //          char codec_name[32];
01095 //          enum CodecType codec_type; /* see CODEC_TYPE_xxx */
01096 //          enum CodecID codec_id; /* see CODEC_ID_xxx */
01097 //
01098 //          /**
01099 //           * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
01100 //           * This is used to work around some encoder bugs.
01101 //           * A demuxer should set this to what is stored in the field used to identify the codec.
01102 //           * If there are multiple such fields in a container then the demuxer should choose the one
01103 //           * which maximizes the information about the used codec.
01104 //           * If the codec tag field in a container is larger then 32 bits then the demuxer should
01105 //           * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
01106 //           * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
01107 //           * first.
01108 //           * - encoding: Set by user, if not then the default based on codec_id will be used.
01109 //           * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
01110 //           */
01111 //          unsigned int codec_tag;
01112 //
01113 //          /**
01114 //           * Work around bugs in encoders which sometimes cannot be detected automatically.
01115 //           * - encoding: Set by user
01116 //           * - decoding: Set by user
01117 //           */
01118 //          int workaround_bugs;
01119 //      #define FF_BUG_AUTODETECT       1  ///< autodetection
01120 //      #define FF_BUG_OLD_MSMPEG4      2
01121 //      #define FF_BUG_XVID_ILACE       4
01122 //      #define FF_BUG_UMP4             8
01123 //      #define FF_BUG_NO_PADDING       16
01124 //      #define FF_BUG_AMV              32
01125 //      #define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
01126 //      #define FF_BUG_QPEL_CHROMA      64
01127 //      #define FF_BUG_STD_QPEL         128
01128 //      #define FF_BUG_QPEL_CHROMA2     256
01129 //      #define FF_BUG_DIRECT_BLOCKSIZE 512
01130 //      #define FF_BUG_EDGE             1024
01131 //      #define FF_BUG_HPEL_CHROMA      2048
01132 //      #define FF_BUG_DC_CLIP          4096
01133 //      #define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
01134 //      //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
01135 //
01136 //          /**
01137 //           * luma single coefficient elimination threshold
01138 //           * - encoding: Set by user.
01139 //           * - decoding: unused
01140 //           */
01141 //          int luma_elim_threshold;
01142 //
01143 //          /**
01144 //           * chroma single coeff elimination threshold
01145 //           * - encoding: Set by user.
01146 //           * - decoding: unused
01147 //           */
01148 //          int chroma_elim_threshold;
01149 //
01150 //          /**
01151 //           * strictly follow the standard (MPEG4, ...).
01152 //           * - encoding: Set by user.
01153 //           * - decoding: unused
01154 //           */
01155 //          int strict_std_compliance;
01156 //      #define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to a older more strict version of the spec or reference software.
01157 //      #define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
01158 //      #define FF_COMPLIANCE_NORMAL        0
01159 //      #define FF_COMPLIANCE_INOFFICIAL   -1 ///< Allow inofficial extensions.
01160 //      #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
01161 //
01162 //          /**
01163 //           * qscale offset between IP and B-frames
01164 //           * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
01165 //           * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
01166 //           * - encoding: Set by user.
01167 //           * - decoding: unused
01168 //           */
01169 //          float b_quant_offset;
01170 //
01171 //          /**
01172 //           * Error resilience; higher values will detect more errors but may
01173 //           * misdetect some more or less valid parts as errors.
01174 //           * - encoding: unused
01175 //           * - decoding: Set by user.
01176 //           */
01177 //          int error_resilience;
01178 //      #define FF_ER_CAREFUL         1
01179 //      #define FF_ER_COMPLIANT       2
01180 //      #define FF_ER_AGGRESSIVE      3
01181 //      #define FF_ER_VERY_AGGRESSIVE 4
01182 //
01183 //          /**
01184 //           * Called at the beginning of each frame to get a buffer for it.
01185 //           * If pic.reference is set then the frame will be read later by libavcodec.
01186 //           * avcodec_align_dimensions() should be used to find the required width and
01187 //           * height, as they normally need to be rounded up to the next multiple of 16.
01188 //           * - encoding: unused
01189 //           * - decoding: Set by libavcodec., user can override.
01190 //           */
01191 //          int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
01192 //
01193 //          /**
01194 //           * Called to release buffers which where allocated with get_buffer.
01195 //           * A released buffer can be reused in get_buffer().
01196 //           * pic.data[*] must be set to NULL.
01197 //           * - encoding: unused
01198 //           * - decoding: Set by libavcodec., user can override.
01199 //           */
01200 //          void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
01201 //
01202 //          /**
01203 //           * If 1 the stream has a 1 frame delay during decoding.
01204 //           * - encoding: Set by libavcodec.
01205 //           * - decoding: Set by libavcodec.
01206 //           */
01207 //          int has_b_frames;
01208 //
01209 //          /**
01210 //           * number of bytes per packet if constant and known or 0
01211 //           * Used by some WAV based audio codecs.
01212 //           */
01213 //          int block_align;
01214 //
01215 //          int parse_only; /* - decoding only: If true, only parsing is done
01216 //                             (function avcodec_parse_frame()). The frame
01217 //                             data is returned. Only MPEG codecs support this now. */
01218 //
01219 //          /**
01220 //           * 0-> h263 quant 1-> mpeg quant
01221 //           * - encoding: Set by user.
01222 //           * - decoding: unused
01223 //           */
01224 //          int mpeg_quant;
01225 //
01226 //          /**
01227 //           * pass1 encoding statistics output buffer
01228 //           * - encoding: Set by libavcodec.
01229 //           * - decoding: unused
01230 //           */
01231 //          char *stats_out;
01232 //
01233 //          /**
01234 //           * pass2 encoding statistics input buffer
01235 //           * Concatenated stuff from stats_out of pass1 should be placed here.
01236 //           * - encoding: Allocated/set/freed by user.
01237 //           * - decoding: unused
01238 //           */
01239 //          char *stats_in;
01240 //
01241 //          /**
01242 //           * ratecontrol qmin qmax limiting method
01243 //           * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
01244 //           * - encoding: Set by user.
01245 //           * - decoding: unused
01246 //           */
01247 //          float rc_qsquish;
01248 //
01249 //          float rc_qmod_amp;
01250 //          int rc_qmod_freq;
01251 //
01252 //          /**
01253 //           * ratecontrol override, see RcOverride
01254 //           * - encoding: Allocated/set/freed by user.
01255 //           * - decoding: unused
01256 //           */
01257 //          RcOverride *rc_override;
01258 //          int rc_override_count;
01259 //
01260 //          /**
01261 //           * rate control equation
01262 //           * - encoding: Set by user
01263 //           * - decoding: unused
01264 //           */
01265 //          char *rc_eq;
01266 //
01267 //          /**
01268 //           * maximum bitrate
01269 //           * - encoding: Set by user.
01270 //           * - decoding: unused
01271 //           */
01272 //          int rc_max_rate;
01273 //
01274 //          /**
01275 //           * minimum bitrate
01276 //           * - encoding: Set by user.
01277 //           * - decoding: unused
01278 //           */
01279 //          int rc_min_rate;
01280 //
01281 //          /**
01282 //           * decoder bitstream buffer size
01283 //           * - encoding: Set by user.
01284 //           * - decoding: unused
01285 //           */
01286 //          int rc_buffer_size;
01287 //          float rc_buffer_aggressivity;
01288 //
01289 //          /**
01290 //           * qscale factor between P and I-frames
01291 //           * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
01292 //           * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
01293 //           * - encoding: Set by user.
01294 //           * - decoding: unused
01295 //           */
01296 //          float i_quant_factor;
01297 //
01298 //          /**
01299 //           * qscale offset between P and I-frames
01300 //           * - encoding: Set by user.
01301 //           * - decoding: unused
01302 //           */
01303 //          float i_quant_offset;
01304 //
01305 //          /**
01306 //           * initial complexity for pass1 ratecontrol
01307 //           * - encoding: Set by user.
01308 //           * - decoding: unused
01309 //           */
01310 //          float rc_initial_cplx;
01311 //
01312 //          /**
01313 //           * DCT algorithm, see FF_DCT_* below
01314 //           * - encoding: Set by user.
01315 //           * - decoding: unused
01316 //           */
01317 //          int dct_algo;
01318 //      #define FF_DCT_AUTO    0
01319 //      #define FF_DCT_FASTINT 1
01320 //      #define FF_DCT_INT     2
01321 //      #define FF_DCT_MMX     3
01322 //      #define FF_DCT_MLIB    4
01323 //      #define FF_DCT_ALTIVEC 5
01324 //      #define FF_DCT_FAAN    6
01325 //
01326 //          /**
01327 //           * luminance masking (0-> disabled)
01328 //           * - encoding: Set by user.
01329 //           * - decoding: unused
01330 //           */
01331 //          float lumi_masking;
01332 //
01333 //          /**
01334 //           * temporary complexity masking (0-> disabled)
01335 //           * - encoding: Set by user.
01336 //           * - decoding: unused
01337 //           */
01338 //          float temporal_cplx_masking;
01339 //
01340 //          /**
01341 //           * spatial complexity masking (0-> disabled)
01342 //           * - encoding: Set by user.
01343 //           * - decoding: unused
01344 //           */
01345 //          float spatial_cplx_masking;
01346 //
01347 //          /**
01348 //           * p block masking (0-> disabled)
01349 //           * - encoding: Set by user.
01350 //           * - decoding: unused
01351 //           */
01352 //          float p_masking;
01353 //
01354 //          /**
01355 //           * darkness masking (0-> disabled)
01356 //           * - encoding: Set by user.
01357 //           * - decoding: unused
01358 //           */
01359 //          float dark_masking;
01360 //
01361 //
01362 //          /* for binary compatibility */
01363 //          int unused;
01364 //
01365 //          /**
01366 //           * IDCT algorithm, see FF_IDCT_* below.
01367 //           * - encoding: Set by user.
01368 //           * - decoding: Set by user.
01369 //           */
01370 //          int idct_algo;
01371 //      #define FF_IDCT_AUTO         0
01372 //      #define FF_IDCT_INT          1
01373 //      #define FF_IDCT_SIMPLE       2
01374 //      #define FF_IDCT_SIMPLEMMX    3
01375 //      #define FF_IDCT_LIBMPEG2MMX  4
01376 //      #define FF_IDCT_PS2          5
01377 //      #define FF_IDCT_MLIB         6
01378 //      #define FF_IDCT_ARM          7
01379 //      #define FF_IDCT_ALTIVEC      8
01380 //      #define FF_IDCT_SH4          9
01381 //      #define FF_IDCT_SIMPLEARM    10
01382 //      #define FF_IDCT_H264         11
01383 //      #define FF_IDCT_VP3          12
01384 //      #define FF_IDCT_IPP          13
01385 //      #define FF_IDCT_XVIDMMX      14
01386 //      #define FF_IDCT_CAVS         15
01387 //      #define FF_IDCT_SIMPLEARMV5TE 16
01388 //      #define FF_IDCT_SIMPLEARMV6  17
01389 //
01390 //          /**
01391 //           * slice count
01392 //           * - encoding: Set by libavcodec.
01393 //           * - decoding: Set by user (or 0).
01394 //           */
01395 //          int slice_count;
01396 //          /**
01397 //           * slice offsets in the frame in bytes
01398 //           * - encoding: Set/allocated by libavcodec.
01399 //           * - decoding: Set/allocated by user (or NULL).
01400 //           */
01401 //          int *slice_offset;
01402 //
01403 //          /**
01404 //           * error concealment flags
01405 //           * - encoding: unused
01406 //           * - decoding: Set by user.
01407 //           */
01408 //          int error_concealment;
01409 //      #define FF_EC_GUESS_MVS   1
01410 //      #define FF_EC_DEBLOCK     2
01411 //
01412 //          /**
01413 //           * dsp_mask could be add used to disable unwanted CPU features
01414 //           * CPU features (i.e. MMX, SSE. ...)
01415 //           *
01416 //           * With the FORCE flag you may instead enable given CPU features.
01417 //           * (Dangerous: Usable in case of misdetection, improper usage however will
01418 //           * result into program crash.)
01419 //           */
01420 //          unsigned dsp_mask;
01421 //      #define FF_MM_FORCE    0x80000000 /* Force usage of selected flags (OR) */
01422 //          /* lower 16 bits - CPU features */
01423 //      #define FF_MM_MMX      0x0001 /* standard MMX */
01424 //      #define FF_MM_3DNOW    0x0004 /* AMD 3DNOW */
01425 //      #define FF_MM_MMXEXT   0x0002 /* SSE integer functions or AMD MMX ext */
01426 //      #define FF_MM_SSE      0x0008 /* SSE functions */
01427 //      #define FF_MM_SSE2     0x0010 /* PIV SSE2 functions */
01428 //      #define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
01429 //      #define FF_MM_SSE3     0x0040 /* Prescott SSE3 functions */
01430 //      #define FF_MM_SSSE3    0x0080 /* Conroe SSSE3 functions */
01431 //      #define FF_MM_IWMMXT   0x0100 /* XScale IWMMXT */
01432 //
01433 //          /**
01434 //           * bits per sample/pixel from the demuxer (needed for huffyuv).
01435 //           * - encoding: Set by libavcodec.
01436 //           * - decoding: Set by user.
01437 //           */
01438 //           int bits_per_sample;
01439 //
01440 //          /**
01441 //           * prediction method (needed for huffyuv)
01442 //           * - encoding: Set by user.
01443 //           * - decoding: unused
01444 //           */
01445 //           int prediction_method;
01446 //      #define FF_PRED_LEFT   0
01447 //      #define FF_PRED_PLANE  1
01448 //      #define FF_PRED_MEDIAN 2
01449 //
01450 //          /**
01451 //           * sample aspect ratio (0 if unknown)
01452 //           * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
01453 //           * - encoding: Set by user.
01454 //           * - decoding: Set by libavcodec.
01455 //           */
01456 //          AVRational sample_aspect_ratio;
01457 //
01458 //          /**
01459 //           * the picture in the bitstream
01460 //           * - encoding: Set by libavcodec.
01461 //           * - decoding: Set by libavcodec.
01462 //           */
01463 //          AVFrame *coded_frame;
01464 //
01465 //          /**
01466 //           * debug
01467 //           * - encoding: Set by user.
01468 //           * - decoding: Set by user.
01469 //           */
01470 //          int debug;
01471 //      #define FF_DEBUG_PICT_INFO 1
01472 //      #define FF_DEBUG_RC        2
01473 //      #define FF_DEBUG_BITSTREAM 4
01474 //      #define FF_DEBUG_MB_TYPE   8
01475 //      #define FF_DEBUG_QP        16
01476 //      #define FF_DEBUG_MV        32
01477 //      #define FF_DEBUG_DCT_COEFF 0x00000040
01478 //      #define FF_DEBUG_SKIP      0x00000080
01479 //      #define FF_DEBUG_STARTCODE 0x00000100
01480 //      #define FF_DEBUG_PTS       0x00000200
01481 //      #define FF_DEBUG_ER        0x00000400
01482 //      #define FF_DEBUG_MMCO      0x00000800
01483 //      #define FF_DEBUG_BUGS      0x00001000
01484 //      #define FF_DEBUG_VIS_QP    0x00002000
01485 //      #define FF_DEBUG_VIS_MB_TYPE 0x00004000
01486 //
01487 //          /**
01488 //           * debug
01489 //           * - encoding: Set by user.
01490 //           * - decoding: Set by user.
01491 //           */
01492 //          int debug_mv;
01493 //      #define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
01494 //      #define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
01495 //      #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
01496 //
01497 //          /**
01498 //           * error
01499 //           * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
01500 //           * - decoding: unused
01501 //           */
01502 //          uint64_t error[4];
01503 //
01504 //          /**
01505 //           * minimum MB quantizer
01506 //           * - encoding: unused
01507 //           * - decoding: unused
01508 //           */
01509 //          int mb_qmin;
01510 //
01511 //          /**
01512 //           * maximum MB quantizer
01513 //           * - encoding: unused
01514 //           * - decoding: unused
01515 //           */
01516 //          int mb_qmax;
01517 //
01518 //          /**
01519 //           * motion estimation comparison function
01520 //           * - encoding: Set by user.
01521 //           * - decoding: unused
01522 //           */
01523 //          int me_cmp;
01524 //          /**
01525 //           * subpixel motion estimation comparison function
01526 //           * - encoding: Set by user.
01527 //           * - decoding: unused
01528 //           */
01529 //          int me_sub_cmp;
01530 //          /**
01531 //           * macroblock comparison function (not supported yet)
01532 //           * - encoding: Set by user.
01533 //           * - decoding: unused
01534 //           */
01535 //          int mb_cmp;
01536 //          /**
01537 //           * interlaced DCT comparison function
01538 //           * - encoding: Set by user.
01539 //           * - decoding: unused
01540 //           */
01541 //          int ildct_cmp;
01542 //      #define FF_CMP_SAD  0
01543 //      #define FF_CMP_SSE  1
01544 //      #define FF_CMP_SATD 2
01545 //      #define FF_CMP_DCT  3
01546 //      #define FF_CMP_PSNR 4
01547 //      #define FF_CMP_BIT  5
01548 //      #define FF_CMP_RD   6
01549 //      #define FF_CMP_ZERO 7
01550 //      #define FF_CMP_VSAD 8
01551 //      #define FF_CMP_VSSE 9
01552 //      #define FF_CMP_NSSE 10
01553 //      #define FF_CMP_W53  11
01554 //      #define FF_CMP_W97  12
01555 //      #define FF_CMP_DCTMAX 13
01556 //      #define FF_CMP_DCT264 14
01557 //      #define FF_CMP_CHROMA 256
01558 //
01559 //          /**
01560 //           * ME diamond size & shape
01561 //           * - encoding: Set by user.
01562 //           * - decoding: unused
01563 //           */
01564 //          int dia_size;
01565 //
01566 //          /**
01567 //           * amount of previous MV predictors (2a+1 x 2a+1 square)
01568 //           * - encoding: Set by user.
01569 //           * - decoding: unused
01570 //           */
01571 //          int last_predictor_count;
01572 //
01573 //          /**
01574 //           * prepass for motion estimation
01575 //           * - encoding: Set by user.
01576 //           * - decoding: unused
01577 //           */
01578 //          int pre_me;
01579 //
01580 //          /**
01581 //           * motion estimation prepass comparison function
01582 //           * - encoding: Set by user.
01583 //           * - decoding: unused
01584 //           */
01585 //          int me_pre_cmp;
01586 //
01587 //          /**
01588 //           * ME prepass diamond size & shape
01589 //           * - encoding: Set by user.
01590 //           * - decoding: unused
01591 //           */
01592 //          int pre_dia_size;
01593 //
01594 //          /**
01595 //           * subpel ME quality
01596 //           * - encoding: Set by user.
01597 //           * - decoding: unused
01598 //           */
01599 //          int me_subpel_quality;
01600 //
01601 //          /**
01602 //           * callback to negotiate the pixelFormat
01603 //           * @param fmt is the list of formats which are supported by the codec,
01604 //           * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
01605 //           * The first is always the native one.
01606 //           * @return the chosen format
01607 //           * - encoding: unused
01608 //           * - decoding: Set by user, if not set the native format will be chosen.
01609 //           */
01610 //          enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
01611 //
01612 //          /**
01613 //           * DTG active format information (additional aspect ratio
01614 //           * information only used in DVB MPEG-2 transport streams)
01615 //           * 0 if not set.
01616 //           *
01617 //           * - encoding: unused
01618 //           * - decoding: Set by decoder.
01619 //           */
01620 //          int dtg_active_format;
01621 //      #define FF_DTG_AFD_SAME         8
01622 //      #define FF_DTG_AFD_4_3          9
01623 //      #define FF_DTG_AFD_16_9         10
01624 //      #define FF_DTG_AFD_14_9         11
01625 //      #define FF_DTG_AFD_4_3_SP_14_9  13
01626 //      #define FF_DTG_AFD_16_9_SP_14_9 14
01627 //      #define FF_DTG_AFD_SP_4_3       15
01628 //
01629 //          /**
01630 //           * maximum motion estimation search range in subpel units
01631 //           * If 0 then no limit.
01632 //           *
01633 //           * - encoding: Set by user.
01634 //           * - decoding: unused
01635 //           */
01636 //          int me_range;
01637 //
01638 //          /**
01639 //           * intra quantizer bias
01640 //           * - encoding: Set by user.
01641 //           * - decoding: unused
01642 //           */
01643 //          int intra_quant_bias;
01644 //      #define FF_DEFAULT_QUANT_BIAS 999999
01645 //
01646 //          /**
01647 //           * inter quantizer bias
01648 //           * - encoding: Set by user.
01649 //           * - decoding: unused
01650 //           */
01651 //          int inter_quant_bias;
01652 //
01653 //          /**
01654 //           * color table ID
01655 //           * - encoding: unused
01656 //           * - decoding: Which clrtable should be used for 8bit RGB images.
01657 //           *             Tables have to be stored somewhere. FIXME
01658 //           */
01659 //          int color_table_id;
01660 //
01661 //          /**
01662 //           * internal_buffer count
01663 //           * Don't touch, used by libavcodec default_get_buffer().
01664 //           */
01665 //          int internal_buffer_count;
01666 //
01667 //          /**
01668 //           * internal_buffers
01669 //           * Don't touch, used by libavcodec default_get_buffer().
01670 //           */
01671 //          void *internal_buffer;
01672 //
01673 //      #define FF_LAMBDA_SHIFT 7
01674 //      #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
01675 //      #define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
01676 //      #define FF_LAMBDA_MAX (256*128-1)
01677 //
01678 //      #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
01679 //          /**
01680 //           * Global quality for codecs which cannot change it per frame.
01681 //           * This should be proportional to MPEG-1/2/4 qscale.
01682 //           * - encoding: Set by user.
01683 //           * - decoding: unused
01684 //           */
01685 //          int global_quality;
01686 //
01687 //      #define FF_CODER_TYPE_VLC       0
01688 //      #define FF_CODER_TYPE_AC        1
01689 //      #define FF_CODER_TYPE_RAW       2
01690 //      #define FF_CODER_TYPE_RLE       3
01691 //      #define FF_CODER_TYPE_DEFLATE   4
01692 //          /**
01693 //           * coder type
01694 //           * - encoding: Set by user.
01695 //           * - decoding: unused
01696 //           */
01697 //          int coder_type;
01698 //
01699 //          /**
01700 //           * context model
01701 //           * - encoding: Set by user.
01702 //           * - decoding: unused
01703 //           */
01704 //          int context_model;
01705 //      #if 0
01706 //          /**
01707 //           *
01708 //           * - encoding: unused
01709 //           * - decoding: Set by user.
01710 //           */
01711 //          uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
01712 //      #endif
01713 //
01714 //          /**
01715 //           * slice flags
01716 //           * - encoding: unused
01717 //           * - decoding: Set by user.
01718 //           */
01719 //          int slice_flags;
01720 //      #define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
01721 //      #define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
01722 //      #define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
01723 //
01724 //          /**
01725 //           * XVideo Motion Acceleration
01726 //           * - encoding: forbidden
01727 //           * - decoding: set by decoder
01728 //           */
01729 //          int xvmc_acceleration;
01730 //
01731 //          /**
01732 //           * macroblock decision mode
01733 //           * - encoding: Set by user.
01734 //           * - decoding: unused
01735 //           */
01736 //          int mb_decision;
01737 //      #define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
01738 //      #define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
01739 //      #define FF_MB_DECISION_RD     2        ///< rate distoration
01740 //
01741 //          /**
01742 //           * custom intra quantization matrix
01743 //           * - encoding: Set by user, can be NULL.
01744 //           * - decoding: Set by libavcodec.
01745 //           */
01746 //          uint16_t *intra_matrix;
01747 //
01748 //          /**
01749 //           * custom inter quantization matrix
01750 //           * - encoding: Set by user, can be NULL.
01751 //           * - decoding: Set by libavcodec.
01752 //           */
01753 //          uint16_t *inter_matrix;
01754 //
01755 //          /**
01756 //           * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
01757 //           * This is used to work around some encoder bugs.
01758 //           * - encoding: unused
01759 //           * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
01760 //           */
01761 //          unsigned int stream_codec_tag;
01762 //
01763 //          /**
01764 //           * scene change detection threshold
01765 //           * 0 is default, larger means fewer detected scene changes.
01766 //           * - encoding: Set by user.
01767 //           * - decoding: unused
01768 //           */
01769 //          int scenechange_threshold;
01770 //
01771 //          /**
01772 //           * minimum Lagrange multipler
01773 //           * - encoding: Set by user.
01774 //           * - decoding: unused
01775 //           */
01776 //          int lmin;
01777 //
01778 //          /**
01779 //           * maximum Lagrange multipler
01780 //           * - encoding: Set by user.
01781 //           * - decoding: unused
01782 //           */
01783 //          int lmax;
01784 //
01785 //          /**
01786 //           * palette control structure
01787 //           * - encoding: ??? (no palette-enabled encoder yet)
01788 //           * - decoding: Set by user.
01789 //           */
01790 //          struct AVPaletteControl *palctrl;
01791 //
01792 //          /**
01793 //           * noise reduction strength
01794 //           * - encoding: Set by user.
01795 //           * - decoding: unused
01796 //           */
01797 //          int noise_reduction;
01798 //
01799 //          /**
01800 //           * Called at the beginning of a frame to get cr buffer for it.
01801 //           * Buffer type (size, hints) must be the same. libavcodec won't check it.
01802 //           * libavcodec will pass previous buffer in pic, function should return
01803 //           * same buffer or new buffer with old frame "painted" into it.
01804 //           * If pic.data[0] == NULL must behave like get_buffer().
01805 //           * - encoding: unused
01806 //           * - decoding: Set by libavcodec., user can override
01807 //           */
01808 //          int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
01809 //
01810 //          /**
01811 //           * Number of bits which should be loaded into the rc buffer before decoding starts.
01812 //           * - encoding: Set by user.
01813 //           * - decoding: unused
01814 //           */
01815 //          int rc_initial_buffer_occupancy;
01816 //
01817 //          /**
01818 //           *
01819 //           * - encoding: Set by user.
01820 //           * - decoding: unused
01821 //           */
01822 //          int inter_threshold;
01823 //
01824 //          /**
01825 //           * CODEC_FLAG2_*
01826 //           * - encoding: Set by user.
01827 //           * - decoding: Set by user.
01828 //           */
01829 //          int flags2;
01830 //
01831 //          /**
01832 //           * Simulates errors in the bitstream to test error concealment.
01833 //           * - encoding: Set by user.
01834 //           * - decoding: unused
01835 //           */
01836 //          int error_rate;
01837 //
01838 //          /**
01839 //           * MP3 antialias algorithm, see FF_AA_* below.
01840 //           * - encoding: unused
01841 //           * - decoding: Set by user.
01842 //           */
01843 //          int antialias_algo;
01844 //      #define FF_AA_AUTO    0
01845 //      #define FF_AA_FASTINT 1 //not implemented yet
01846 //      #define FF_AA_INT     2
01847 //      #define FF_AA_FLOAT   3
01848 //          /**
01849 //           * quantizer noise shaping
01850 //           * - encoding: Set by user.
01851 //           * - decoding: unused
01852 //           */
01853 //          int quantizer_noise_shaping;
01854 //
01855 //          /**
01856 //           * thread count
01857 //           * is used to decide how many independent tasks should be passed to execute()
01858 //           * - encoding: Set by user.
01859 //           * - decoding: Set by user.
01860 //           */
01861 //          int thread_count;
01862 //
01863 //          /**
01864 //           * The codec may call this to execute several independent things.
01865 //           * It will return only after finishing all tasks.
01866 //           * The user may replace this with some multithreaded implementation,
01867 //           * the default implementation will execute the parts serially.
01868 //           * @param count the number of things to execute
01869 //           * - encoding: Set by libavcodec, user can override.
01870 //           * - decoding: Set by libavcodec, user can override.
01871 //           */
01872 //          int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
01873 //
01874 //          /**
01875 //           * thread opaque
01876 //           * Can be used by execute() to store some per AVCodecContext stuff.
01877 //           * - encoding: set by execute()
01878 //           * - decoding: set by execute()
01879 //           */
01880 //          void *thread_opaque;
01881 //
01882 //          /**
01883 //           * Motion estimation threshold below which no motion estimation is
01884 //           * performed, but instead the user specified motion vectors are used.
01885 //           *
01886 //           * - encoding: Set by user.
01887 //           * - decoding: unused
01888 //           */
01889 //           int me_threshold;
01890 //
01891 //          /**
01892 //           * Macroblock threshold below which the user specified macroblock types will be used.
01893 //           * - encoding: Set by user.
01894 //           * - decoding: unused
01895 //           */
01896 //           int mb_threshold;
01897 //
01898 //          /**
01899 //           * precision of the intra DC coefficient - 8
01900 //           * - encoding: Set by user.
01901 //           * - decoding: unused
01902 //           */
01903 //           int intra_dc_precision;
01904 //
01905 //          /**
01906 //           * noise vs. sse weight for the nsse comparsion function
01907 //           * - encoding: Set by user.
01908 //           * - decoding: unused
01909 //           */
01910 //           int nsse_weight;
01911 //
01912 //          /**
01913 //           * Number of macroblock rows at the top which are skipped.
01914 //           * - encoding: unused
01915 //           * - decoding: Set by user.
01916 //           */
01917 //           int skip_top;
01918 //
01919 //          /**
01920 //           * Number of macroblock rows at the bottom which are skipped.
01921 //           * - encoding: unused
01922 //           * - decoding: Set by user.
01923 //           */
01924 //           int skip_bottom;
01925 //
01926 //          /**
01927 //           * profile
01928 //           * - encoding: Set by user.
01929 //           * - decoding: Set by libavcodec.
01930 //           */
01931 //           int profile;
01932 //      #define FF_PROFILE_UNKNOWN -99
01933 //      #define FF_PROFILE_AAC_MAIN 0
01934 //      #define FF_PROFILE_AAC_LOW 1
01935 //      #define FF_PROFILE_AAC_SSR 2
01936 //      #define FF_PROFILE_AAC_LTP 3
01937 //
01938 //          /**
01939 //           * level
01940 //           * - encoding: Set by user.
01941 //           * - decoding: Set by libavcodec.
01942 //           */
01943 //           int level;
01944 //      #define FF_LEVEL_UNKNOWN -99
01945 //
01946 //          /**
01947 //           * low resolution decoding, 1-> 1/2 size, 2->1/4 size
01948 //           * - encoding: unused
01949 //           * - decoding: Set by user.
01950 //           */
01951 //           int lowres;
01952 //
01953 //          /**
01954 //           * Bitstream width / height, may be different from width/height if lowres
01955 //           * or other things are used.
01956 //           * - encoding: unused
01957 //           * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
01958 //           */
01959 //          int coded_width, coded_height;
01960 //
01961 //          /**
01962 //           * frame skip threshold
01963 //           * - encoding: Set by user.
01964 //           * - decoding: unused
01965 //           */
01966 //          int frame_skip_threshold;
01967 //
01968 //          /**
01969 //           * frame skip factor
01970 //           * - encoding: Set by user.
01971 //           * - decoding: unused
01972 //           */
01973 //          int frame_skip_factor;
01974 //
01975 //          /**
01976 //           * frame skip exponent
01977 //           * - encoding: Set by user.
01978 //           * - decoding: unused
01979 //           */
01980 //          int frame_skip_exp;
01981 //
01982 //          /**
01983 //           * frame skip comparison function
01984 //           * - encoding: Set by user.
01985 //           * - decoding: unused
01986 //           */
01987 //          int frame_skip_cmp;
01988 //
01989 //          /**
01990 //           * Border processing masking, raises the quantizer for mbs on the borders
01991 //           * of the picture.
01992 //           * - encoding: Set by user.
01993 //           * - decoding: unused
01994 //           */
01995 //          float border_masking;
01996 //
01997 //          /**
01998 //           * minimum MB lagrange multipler
01999 //           * - encoding: Set by user.
02000 //           * - decoding: unused
02001 //           */
02002 //          int mb_lmin;
02003 //
02004 //          /**
02005 //           * maximum MB lagrange multipler
02006 //           * - encoding: Set by user.
02007 //           * - decoding: unused
02008 //           */
02009 //          int mb_lmax;
02010 //
02011 //          /**
02012 //           *
02013 //           * - encoding: Set by user.
02014 //           * - decoding: unused
02015 //           */
02016 //          int me_penalty_compensation;
02017 //
02018 //          /**
02019 //           *
02020 //           * - encoding: unused
02021 //           * - decoding: Set by user.
02022 //           */
02023 //          enum AVDiscard skip_loop_filter;
02024 //
02025 //          /**
02026 //           *
02027 //           * - encoding: unused
02028 //           * - decoding: Set by user.
02029 //           */
02030 //          enum AVDiscard skip_idct;
02031 //
02032 //          /**
02033 //           *
02034 //           * - encoding: unused
02035 //           * - decoding: Set by user.
02036 //           */
02037 //          enum AVDiscard skip_frame;
02038 //
02039 //          /**
02040 //           *
02041 //           * - encoding: Set by user.
02042 //           * - decoding: unused
02043 //           */
02044 //          int bidir_refine;
02045 //
02046 //          /**
02047 //           *
02048 //           * - encoding: Set by user.
02049 //           * - decoding: unused
02050 //           */
02051 //          int brd_scale;
02052 //
02053 //          /**
02054 //           * constant rate factor - quality-based VBR - values ~correspond to qps
02055 //           * - encoding: Set by user.
02056 //           * - decoding: unused
02057 //           */
02058 //          float crf;
02059 //
02060 //          /**
02061 //           * constant quantization parameter rate control method
02062 //           * - encoding: Set by user.
02063 //           * - decoding: unused
02064 //           */
02065 //          int cqp;
02066 //
02067 //          /**
02068 //           * minimum GOP size
02069 //           * - encoding: Set by user.
02070 //           * - decoding: unused
02071 //           */
02072 //          int keyint_min;
02073 //
02074 //          /**
02075 //           * number of reference frames
02076 //           * - encoding: Set by user.
02077 //           * - decoding: unused
02078 //           */
02079 //          int refs;
02080 //
02081 //          /**
02082 //           * chroma qp offset from luma
02083 //           * - encoding: Set by user.
02084 //           * - decoding: unused
02085 //           */
02086 //          int chromaoffset;
02087 //
02088 //          /**
02089 //           * Influences how often B-frames are used.
02090 //           * - encoding: Set by user.
02091 //           * - decoding: unused
02092 //           */
02093 //          int bframebias;
02094 //
02095 //          /**
02096 //           * trellis RD quantization
02097 //           * - encoding: Set by user.
02098 //           * - decoding: unused
02099 //           */
02100 //          int trellis;
02101 //
02102 //          /**
02103 //           * Reduce fluctuations in qp (before curve compression).
02104 //           * - encoding: Set by user.
02105 //           * - decoding: unused
02106 //           */
02107 //          float complexityblur;
02108 //
02109 //          /**
02110 //           * in-loop deblocking filter alphac0 parameter
02111 //           * alpha is in the range -6...6
02112 //           * - encoding: Set by user.
02113 //           * - decoding: unused
02114 //           */
02115 //          int deblockalpha;
02116 //
02117 //          /**
02118 //           * in-loop deblocking filter beta parameter
02119 //           * beta is in the range -6...6
02120 //           * - encoding: Set by user.
02121 //           * - decoding: unused
02122 //           */
02123 //          int deblockbeta;
02124 //
02125 //          /**
02126 //           * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
02127 //           * - encoding: Set by user.
02128 //           * - decoding: unused
02129 //           */
02130 //          int partitions;
02131 //      #define X264_PART_I4X4 0x001  /* Analyse i4x4 */
02132 //      #define X264_PART_I8X8 0x002  /* Analyse i8x8 (requires 8x8 transform) */
02133 //      #define X264_PART_P8X8 0x010  /* Analyse p16x8, p8x16 and p8x8 */
02134 //      #define X264_PART_P4X4 0x020  /* Analyse p8x4, p4x8, p4x4 */
02135 //      #define X264_PART_B8X8 0x100  /* Analyse b16x8, b8x16 and b8x8 */
02136 //
02137 //          /**
02138 //           * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal)
02139 //           * - encoding: Set by user.
02140 //           * - decoding: unused
02141 //           */
02142 //          int directpred;
02143 //
02144 //          /**
02145 //           * Audio cutoff bandwidth (0 means "automatic"), currently used only by FAAC.
02146 //           * - encoding: Set by user.
02147 //           * - decoding: unused
02148 //           */
02149 //          int cutoff;
02150 //
02151 //          /**
02152 //           * Multiplied by qscale for each frame and added to scene_change_score.
02153 //           * - encoding: Set by user.
02154 //           * - decoding: unused
02155 //           */
02156 //          int scenechange_factor;
02157 //
02158 //          /**
02159 //           *
02160 //           * Note: Value depends upon the compare function used for fullpel ME.
02161 //           * - encoding: Set by user.
02162 //           * - decoding: unused
02163 //           */
02164 //          int mv0_threshold;
02165 //
02166 //          /**
02167 //           * Adjusts sensitivity of b_frame_strategy 1.
02168 //           * - encoding: Set by user.
02169 //           * - decoding: unused
02170 //           */
02171 //          int b_sensitivity;
02172 //
02173 //          /**
02174 //           * - encoding: Set by user.
02175 //           * - decoding: unused
02176 //           */
02177 //          int compression_level;
02178 //      #define FF_COMPRESSION_DEFAULT -1
02179 //
02180 //          /**
02181 //           * Sets whether to use LPC mode - used by FLAC encoder.
02182 //           * - encoding: Set by user.
02183 //           * - decoding: unused
02184 //           */
02185 //          int use_lpc;
02186 //
02187 //          /**
02188 //           * LPC coefficient precision - used by FLAC encoder
02189 //           * - encoding: Set by user.
02190 //           * - decoding: unused
02191 //           */
02192 //          int lpc_coeff_precision;
02193 //
02194 //          /**
02195 //           * - encoding: Set by user.
02196 //           * - decoding: unused
02197 //           */
02198 //          int min_prediction_order;
02199 //
02200 //          /**
02201 //           * - encoding: Set by user.
02202 //           * - decoding: unused
02203 //           */
02204 //          int max_prediction_order;
02205 //
02206 //          /**
02207 //           * search method for selecting prediction order
02208 //           * - encoding: Set by user.
02209 //           * - decoding: unused
02210 //           */
02211 //          int prediction_order_method;
02212 //
02213 //          /**
02214 //           * - encoding: Set by user.
02215 //           * - decoding: unused
02216 //           */
02217 //          int min_partition_order;
02218 //
02219 //          /**
02220 //           * - encoding: Set by user.
02221 //           * - decoding: unused
02222 //           */
02223 //          int max_partition_order;
02224 //
02225 //          /**
02226 //           * GOP timecode frame start number, in non drop frame format
02227 //           * - encoding: Set by user.
02228 //           * - decoding: unused
02229 //           */
02230 //          int64_t timecode_frame_start;
02231 //      } AVCodecContext;
02232         
02233         
02234         
02238         public static class AVCodecContext extends Structure 
02239         {
02240             public Pointer av_class;
02241             public int bit_rate;
02242             public int bit_rate_tolerance;
02243             public int flags;
02244             public int sub_id;
02245             public int me_method;
02246             public Pointer extradata;
02247             public int extradata_size;
02248             public AVRational time_base;
02249             public int width;
02250             public int height;
02251 
02252                 public static final int FF_ASPECT_EXTENDED =15;
02253 
02254             public int gop_size;
02255             public int pix_fmt;
02256             public int rate_emu;
02257             public Pointer draw_horiz_band;
02258 
02259             /* audio only */
02260             public int sample_rate; 
02261             public int channels;
02262             public int sample_fmt;  
02263             public int frame_size;
02264             public int frame_number;   
02265             public int real_pict_num;  
02266             public int delay;
02267             public float qcompress;  
02268             public float qblur;      
02269             public int qmin;
02270             public int qmax;
02271             public int max_qdiff;
02272             public int max_b_frames;
02273             public float b_quant_factor;
02274             public int rc_strategy;
02275                 public static final int FF_RC_STRATEGY_XVID =1;
02276 
02277             public int b_frame_strategy;
02278             public int hurry_up;
02279 
02280             public Pointer codec;
02281 
02282             public Pointer priv_data;
02283 
02284 //      #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02285 //          /* unused, FIXME remove*/
02286             //public int rtp_mode;
02287 //      #endif
02288 
02289                 public int rtp_payload_size;   
02290                 public Pointer rtp_callback;
02291 
02292             public int mv_bits;
02293             public int header_bits;
02294             public int i_tex_bits;
02295             public int p_tex_bits;
02296             public int i_count;
02297             public int p_count;
02298             public int skip_count;
02299             public int misc_bits;
02300             public int frame_bits;
02301             public Pointer opaque;
02302 
02303             public byte[] codec_name = new byte[32];
02304             public int codec_type; /* see CODEC_TYPE_xxx */
02305             public int codec_id; /* see CODEC_ID_xxx */
02306 
02307             public int codec_tag;
02308             public int workaround_bugs;
02309                         public static final int FF_BUG_AUTODETECT       =1;  
02310                         public static final int FF_BUG_OLD_MSMPEG4      =2;
02311                         public static final int FF_BUG_XVID_ILACE       =4;
02312                         public static final int FF_BUG_UMP4             =8;
02313                         public static final int FF_BUG_NO_PADDING       =16;
02314                         public static final int FF_BUG_AMV              =32;
02315                         public static final int FF_BUG_AC_VLC           =0;  
02316                         public static final int FF_BUG_QPEL_CHROMA      =64;
02317                         public static final int FF_BUG_STD_QPEL         =128;
02318                         public static final int FF_BUG_QPEL_CHROMA2     =256;
02319                         public static final int FF_BUG_DIRECT_BLOCKSIZE =512;
02320                         public static final int FF_BUG_EDGE             =1024;
02321                         public static final int FF_BUG_HPEL_CHROMA      =2048;
02322                         public static final int FF_BUG_DC_CLIP          =4096;
02323                         public static final int FF_BUG_MS               =8192; 
02324             public int luma_elim_threshold;
02325             public int chroma_elim_threshold;
02326             public int strict_std_compliance;
02327                         public static final int FF_COMPLIANCE_VERY_STRICT   =2; 
02328                         public static final int FF_COMPLIANCE_STRICT        =1; 
02329                         public static final int FF_COMPLIANCE_NORMAL        =0;
02330                         public static final int FF_COMPLIANCE_INOFFICIAL   =-1; 
02331                         public static final int FF_COMPLIANCE_EXPERIMENTAL =-2; 
02332             public float b_quant_offset;
02333             public int error_resilience;
02334                         public static final int FF_ER_CAREFUL         =1;
02335                         public static final int FF_ER_COMPLIANT       =2;
02336                         public static final int FF_ER_AGGRESSIVE      =3;
02337                         public static final int FF_ER_VERY_AGGRESSIVE =4;
02338             public Pointer get_buffer;
02339 
02340             public Pointer release_buffer;
02341             public int has_b_frames;
02342             public int block_align;
02343             public int parse_only;
02344             public int mpeg_quant;
02345             public Pointer stats_out;
02346             public Pointer stats_in;
02347             public float rc_qsquish;
02348             public float rc_qmod_amp;
02349             public int rc_qmod_freq;
02350             public Pointer rc_override;
02351             public int rc_override_count;
02352             public Pointer rc_eq;
02353             public int rc_max_rate;
02354             public int rc_min_rate;
02355             public int rc_buffer_size;
02356             public float rc_buffer_aggressivity;
02357             public float i_quant_factor;
02358             public float i_quant_offset;
02359             public float rc_initial_cplx;
02360             public int dct_algo;
02361                         public static final int FF_DCT_AUTO    =0;
02362                         public static final int FF_DCT_FASTINT =1;
02363                         public static final int FF_DCT_INT     =2;
02364                         public static final int FF_DCT_MMX     =3;
02365                         public static final int FF_DCT_MLIB    =4;
02366                         public static final int FF_DCT_ALTIVEC =5;
02367                         public static final int FF_DCT_FAAN    =6;
02368             public float lumi_masking;
02369             public float temporal_cplx_masking;
02370             public float spatial_cplx_masking;
02371             public float p_masking;
02372             public float dark_masking;
02373             //public int unused;
02374             public int idct_algo;
02375                         public static final int FF_IDCT_AUTO         =0;
02376                         public static final int FF_IDCT_INT          =1;
02377                         public static final int FF_IDCT_SIMPLE       =2;
02378                         public static final int FF_IDCT_SIMPLEMMX    =3;
02379                         public static final int FF_IDCT_LIBMPEG2MMX  =4;
02380                         public static final int FF_IDCT_PS2          =5;
02381                         public static final int FF_IDCT_MLIB         =6;
02382                         public static final int FF_IDCT_ARM          =7;
02383                         public static final int FF_IDCT_ALTIVEC      =8;
02384                         public static final int FF_IDCT_SH4          =9;
02385                         public static final int FF_IDCT_SIMPLEARM    =10;
02386                         public static final int FF_IDCT_H264         =11;
02387                         public static final int FF_IDCT_VP3          =12;
02388                         public static final int FF_IDCT_IPP          =13;
02389                         public static final int FF_IDCT_XVIDMMX      =14;
02390                         public static final int FF_IDCT_CAVS         =15;
02391                         public static final int FF_IDCT_SIMPLEARMV5TE =16;
02392                         public static final int FF_IDCT_SIMPLEARMV6  =17;
02393             public int slice_count;
02394             public Pointer slice_offset;
02395             public int error_concealment;
02396                         public static final int FF_EC_GUESS_MVS   =1;
02397                         public static final int FF_EC_DEBLOCK     =2;
02398 
02407             public int dsp_mask;
02408                         public static final int FF_MM_FORCE    =0x80000000; /* Force usage of selected flags (OR) */
02409                         //          /* lower 16 bits - CPU features */
02410                         public static final int FF_MM_MMX      =0x0001; /* standard MMX */
02411                         public static final int FF_MM_3DNOW    =0x0004; /* AMD 3DNOW */
02412                         public static final int FF_MM_MMXEXT   =0x0002; /* SSE integer functions or AMD MMX ext */
02413                         public static final int FF_MM_SSE      =0x0008; /* SSE functions */
02414                         public static final int FF_MM_SSE2     =0x0010; /* PIV SSE2 functions */
02415                         public static final int FF_MM_3DNOWEXT =0x0020; /* AMD 3DNowExt */
02416                         public static final int FF_MM_SSE3     =0x0040; /* Prescott SSE3 functions */
02417                         public static final int FF_MM_SSSE3    =0x0080; /* Conroe SSSE3 functions */
02418                         public static final int FF_MM_IWMMXT   =0x0100; /* XScale IWMMXT */
02419 
02420             public int bits_per_coded_sample;
02421             public int prediction_method;
02422                         public static final int FF_PRED_LEFT   =0;
02423                         public static final int FF_PRED_PLANE  =1;
02424                         public static final int FF_PRED_MEDIAN =2;
02425             public AVRational sample_aspect_ratio;
02426             public Pointer coded_frame;
02427             public int debug;
02428                         public static final int FF_DEBUG_PICT_INFO =1;
02429                         public static final int FF_DEBUG_RC        =2;
02430                         public static final int FF_DEBUG_BITSTREAM =4;
02431                         public static final int FF_DEBUG_MB_TYPE   =8;
02432                         public static final int FF_DEBUG_QP        =16;
02433                         public static final int FF_DEBUG_MV        =32;
02434                         public static final int FF_DEBUG_DCT_COEFF =0x00000040;
02435                         public static final int FF_DEBUG_SKIP      =0x00000080;
02436                         public static final int FF_DEBUG_STARTCODE =0x00000100;
02437                         public static final int FF_DEBUG_PTS       =0x00000200;
02438                         public static final int FF_DEBUG_ER        =0x00000400;
02439                         public static final int FF_DEBUG_MMCO      =0x00000800;
02440                         public static final int FF_DEBUG_BUGS      =0x00001000;
02441                         public static final int FF_DEBUG_VIS_QP    =0x00002000;
02442                         public static final int FF_DEBUG_VIS_MB_TYPE =0x00004000;
02443             public int debug_mv;
02444                         public static final int FF_DEBUG_VIS_MV_P_FOR  =0x00000001; //visualize forward predicted MVs of P frames
02445                         public static final int FF_DEBUG_VIS_MV_B_FOR  =0x00000002; //visualize forward predicted MVs of B frames
02446                         public static final int FF_DEBUG_VIS_MV_B_BACK =0x00000004; //visualize backward predicted MVs of B frames
02447             public long[] error = new long[4];
02448             public int mb_qmin;
02449             public int mb_qmax;
02450             public int me_cmp;
02451             public int me_sub_cmp;
02452             public int mb_cmp;
02453             public int ildct_cmp;
02454                         public static final int FF_CMP_SAD  =0;
02455                         public static final int FF_CMP_SSE  =1;
02456                         public static final int FF_CMP_SATD =2;
02457                         public static final int FF_CMP_DCT  =3;
02458                         public static final int FF_CMP_PSNR =4;
02459                         public static final int FF_CMP_BIT  =5;
02460                         public static final int FF_CMP_RD   =6;
02461                         public static final int FF_CMP_ZERO =7;
02462                         public static final int FF_CMP_VSAD =8;
02463                         public static final int FF_CMP_VSSE =9;
02464                         public static final int FF_CMP_NSSE =10;
02465                         public static final int FF_CMP_W53  =11;
02466                         public static final int FF_CMP_W97  =12;
02467                         public static final int FF_CMP_DCTMAX =13;
02468                         public static final int FF_CMP_DCT264 =14;
02469                         public static final int FF_CMP_CHROMA =256;
02470             public int dia_size;
02471             public int last_predictor_count;
02472             public int pre_me;
02473             public int me_pre_cmp;
02474             public int pre_dia_size;
02475             public int me_subpel_quality;
02476             public Pointer get_format;
02477             public int dtg_active_format;
02478                         public static final int FF_DTG_AFD_SAME         =8;
02479                         public static final int FF_DTG_AFD_4_3          =9;
02480                         public static final int FF_DTG_AFD_16_9         =10;
02481                         public static final int FF_DTG_AFD_14_9         =11;
02482                         public static final int FF_DTG_AFD_4_3_SP_14_9  =13;
02483                         public static final int FF_DTG_AFD_16_9_SP_14_9 =14;
02484                         public static final int FF_DTG_AFD_SP_4_3       =15;
02485             public int me_range;
02486             public int intra_quant_bias;
02487                         public static final int FF_DEFAULT_QUANT_BIAS =999999;
02488             public int inter_quant_bias;
02489             public int color_table_id;
02490             public int internal_buffer_count;
02491             public Pointer internal_buffer;
02492 
02493                         public static final int FF_LAMBDA_SHIFT =7;
02494                         public static final int FF_LAMBDA_SCALE =(1<<FF_LAMBDA_SHIFT);
02495                         public static final int FF_QP2LAMBDA =118; 
02496                         public static final int FF_LAMBDA_MAX =(256*128-1);
02497                         //
02498                         public static final int FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove
02499             public int global_quality;
02500 
02501                         public static final int FF_CODER_TYPE_VLC       =0;
02502                         public static final int FF_CODER_TYPE_AC        =1;
02503                         public static final int FF_CODER_TYPE_RAW       =2;
02504                         public static final int FF_CODER_TYPE_RLE       =3;
02505                         public static final int FF_CODER_TYPE_DEFLATE   =4;
02506                 public int coder_type;
02507                 public int context_model;
02508                 public int slice_flags;
02509                         public static final int SLICE_FLAG_CODED_ORDER    =0x0001; 
02510                         public static final int SLICE_FLAG_ALLOW_FIELD    =0x0002;
02511                         public static final int SLICE_FLAG_ALLOW_PLANE    =0x0004; 
02512                 public int xvmc_acceleration;
02513                 public int mb_decision;
02514                         public static final int FF_MB_DECISION_SIMPLE =0;        
02515                         public static final int FF_MB_DECISION_BITS   =1;        
02516                         public static final int FF_MB_DECISION_RD     =2;        
02517                 public Pointer intra_matrix;
02518                 public Pointer inter_matrix;
02519             public int stream_codec_tag;
02520             public int scenechange_threshold;
02521             public int lmin;
02522             public int lmax;
02523             public Pointer palctrl;
02524                 public int noise_reduction;
02525                 public Pointer reget_buffer;
02526                 public int rc_initial_buffer_occupancy;
02527                 public int inter_threshold;
02528                 public int flags2;
02529                 public int error_rate;
02530                 public int antialias_algo;
02531                         public static final int FF_AA_AUTO    =0;
02532                         public static final int FF_AA_FASTINT =1; //not implemented yet
02533                         public static final int FF_AA_INT     =2;
02534                         public static final int FF_AA_FLOAT   =3;
02535                 public int quantizer_noise_shaping;
02536                 public int thread_count;
02537                 public Pointer execute;
02538                 public Pointer thread_opaque;
02539                 public int me_threshold;
02540                 public int mb_threshold;
02541                 public int intra_dc_precision;
02542                 public int nsse_weight;
02543                 public int skip_top;
02544                 public int skip_bottom;
02545                 public int profile;
02546                         public static final int FF_PROFILE_UNKNOWN =-99;
02547                         public static final int FF_PROFILE_AAC_MAIN =0;
02548                         public static final int FF_PROFILE_AAC_LOW =1;
02549                         public static final int FF_PROFILE_AAC_SSR =2;
02550                         public static final int FF_PROFILE_AAC_LTP =3;
02551                 public int level;
02552                                 public static final int FF_LEVEL_UNKNOWN =-99;
02553                 public int lowres;
02554                 public int coded_width;
02555                 public int coded_height;
02556                 public int frame_skip_threshold;
02557                 public int frame_skip_factor;
02558                 public int frame_skip_exp;
02559                 public int frame_skip_cmp;
02560                 public float border_masking;
02561                 public int mb_lmin;
02562                 public int mb_lmax;
02563                 public int me_penalty_compensation;
02564                 public int skip_loop_filter;
02565                 public int skip_idct;
02566                 public int skip_frame;
02567             public int bidir_refine;
02568             public int brd_scale;
02569 
02570             public float crf;
02571             public int cqp;
02572             public int keyint_min;
02573             public int refs;
02574             public int chromaoffset;
02575             public int bframebias;
02576             public int trellis;
02577             public float complexityblur;
02578             public int deblockalpha;
02579             public int deblockbeta;
02580             public int partitions;
02581                         public static final int X264_PART_I4X4 =0x001;  /* Analyse i4x4 */
02582                         public static final int X264_PART_I8X8 =0x002;  /* Analyse i8x8 (requires 8x8 transform) */
02583                         public static final int X264_PART_P8X8 =0x010;  /* Analyse p16x8, p8x16 and p8x8 */
02584                         public static final int X264_PART_P4X4 =0x020;  /* Analyse p8x4, p4x8, p4x4 */
02585                         public static final int X264_PART_B8X8 =0x100;  /* Analyse b16x8, b8x16 and b8x8 */
02586             public int directpred;
02587             public int cutoff;
02588             public int scenechange_factor;
02589             public int mv0_threshold;
02590             public int b_sensitivity;
02591             public int compression_level;
02592                 public static final int FF_COMPRESSION_DEFAULT =-1;
02593             public  int use_lpc;
02594             public int lpc_coeff_precision;
02595             public int min_prediction_order;
02596             public int max_prediction_order;
02597             public int prediction_order_method;
02598             public int min_partition_order;
02599             public int max_partition_order;
02600             public long timecode_frame_start;
02601             
02602                 public AVCodecContext()
02603                 {
02604                         super();
02605                 }
02606                 
02607                 public AVCodecContext(Pointer p)
02608                 {       super();
02609                         useMemory(p);
02610                         read();
02611                 }
02612         }
02613         
02614 //      /**
02615 //       * AVCodec.
02616 //       */
02617 //      typedef struct AVCodec {
02618 //          /**
02619 //           * Name of the codec implementation.
02620 //           * The name is globally unique among encoders and among decoders (but an
02621 //           * encoder and a decoder can share the same name).
02622 //           * This is the primary way to find a codec from the user perspective.
02623 //           */
02624 //          const char *name;
02625 //          enum CodecType type;
02626 //          enum CodecID id;
02627 //          int priv_data_size;
02628 //          int (*init)(AVCodecContext *);
02629 //          int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
02630 //          int (*close)(AVCodecContext *);
02631 //          int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
02632 //                        uint8_t *buf, int buf_size);
02633 //          int capabilities;
02634 //          struct AVCodec *next;
02635 //          void (*flush)(AVCodecContext *);
02636 //          const AVRational *supported_framerates; ///array of supported framerates, or NULL if any, array is terminated by {0,0}
02637 //          const enum PixelFormat *pix_fmts;       ///array of supported pixel formats, or NULL if unknown, array is terminanted by -1
02638 //      } AVCodec;
02639         
02640         public static class AVCodec extends Structure 
02641         {
02642             public String name;
02643             public int type;
02644             public int id;
02645             public int  priv_data_size;
02646             public Pointer init;
02647             public Pointer encode;
02648             public Pointer close;
02649             public Pointer decode;
02650             public int capabilities;
02651             public Pointer next;
02652             public Pointer flush;
02653             public Pointer supported_framerates; 
02654             public Pointer pix_fmts;       
02655             
02656                 public AVCodec()
02657                 {
02658                         super();
02659                 }
02660                 
02661                 public AVCodec(Pointer p)
02662                 {       super();
02663                         useMemory(p);
02664                         read();
02665                 }
02666         }
02667         
02668 //      /**
02669 //       * four components are given, that's all.
02670 //       * the last component is alpha
02671 //       */
02672 //      typedef struct AVPicture {
02673 //          uint8_t *data[4];
02674 //          int linesize[4];       ///< number of bytes per line
02675 //      } AVPicture;
02676         
02677         
02682         public static class AVPicture extends Structure
02683         {
02684             public Pointer data0;
02685             public Pointer data1;
02686             public Pointer data2;
02687             public Pointer data3;
02688             
02689             public int[] linesize = new int[4];       
02690             
02691         }
02692         
02693         
02694 //      /**
02695 //       * AVPaletteControl
02696 //       * This structure defines a method for communicating palette changes
02697 //       * between and demuxer and a decoder.
02698 //       *
02699 //       * @deprecated Use AVPacket to send palette changes instead.
02700 //       * This is totally broken.
02701 //       */
02702 //      #define AVPALETTE_SIZE 1024
02703 //      #define AVPALETTE_COUNT 256
02704 //      typedef struct AVPaletteControl {
02705 //
02706 //          /* Demuxer sets this to 1 to indicate the palette has changed;
02707 //           * decoder resets to 0. */
02708 //          int palette_changed;
02709 //
02710 //          /* 4-byte ARGB palette entries, stored in native byte order; note that
02711 //           * the individual palette components should be on a 8-bit scale; if
02712 //           * the palette data comes from an IBM VGA native format, the component
02713 //           * data is probably 6 bits in size and needs to be scaled. */
02714 //          unsigned int palette[AVPALETTE_COUNT];
02715 //
02716 //      } AVPaletteControl attribute_deprecated;
02717 
02718         
02719         public static final int AVPALETTE_SIZE = 1024;
02720         public static final int AVPALETTE_COUNT = 256;
02721         public static class AVPaletteControl extends Structure
02722         {
02723 
02724             public int palette_changed;
02725             public int[] palette = new int[AVPALETTE_COUNT];
02726 
02727         } 
02728 
02729 //      typedef struct AVSubtitleRect {
02730 //          uint16_t x;
02731 //          uint16_t y;
02732 //          uint16_t w;
02733 //          uint16_t h;
02734 //          uint16_t nb_colors;
02735 //          int linesize;
02736 //          uint32_t *rgba_palette;
02737 //          uint8_t *bitmap;
02738 //      } AVSubtitleRect;
02739 //
02740 //      typedef struct AVSubtitle {
02741 //          uint16_t format; /* 0 = graphics */
02742 //          uint32_t start_display_time; /* relative to packet pts, in ms */
02743 //          uint32_t end_display_time; /* relative to packet pts, in ms */
02744 //          uint32_t num_rects;
02745 //          AVSubtitleRect *rects;
02746 //      } AVSubtitle;
02747         
02748         
02749         public static class AVSubtitleRect extends Structure
02750         {
02751             public short x;
02752             public short y;
02753             public short w;
02754             public short h;
02755             public short nb_colors;
02756             public int linesize;
02757             public Pointer rgba_palette;
02758             public Pointer bitmap;
02759         } 
02760 
02761         public static class AVSubtitle extends Structure
02762         {
02763                 public short format; /* 0 = graphics */
02764                 public short start_display_time; /* relative to packet pts, in ms */
02765                 public short end_display_time; /* relative to packet pts, in ms */
02766                 public short num_rects;
02767             public Pointer rects;
02768         } 
02769         
02770         
02771 //      /* resample.c */
02772 //
02773 //      struct ReSampleContext;
02774 //      struct AVResampleContext;
02775 //
02776 //      typedef struct ReSampleContext ReSampleContext;
02777 //
02778 //      ReSampleContext *audio_resample_init(int output_channels, int input_channels,
02779 //                                           int output_rate, int input_rate);
02780 //      int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
02781 //      void audio_resample_close(ReSampleContext *s);
02782 //
02783 //      struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02784 //      int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
02785 //      void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
02786 //      void av_resample_close(struct AVResampleContext *c);
02787 
02788         /* resample.c */
02789 
02790         // TODO: map ReSampleContext into JNA.
02791         public Pointer /*ReSampleContext*/ audio_resample_init(int output_channels, int input_channels,
02792                                              int output_rate, int input_rate);
02793         public int audio_resample(Pointer /*ReSampleContext*/ s, Pointer output, Pointer input, int nb_samples);
02794         public void audio_resample_close(Pointer /*ReSampleContext*/ s);
02795 
02796         public Pointer /*ReSampleContext*/ av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
02797         int av_resample(Pointer /*ReSampleContext*/ c, Pointer dst, Pointer src, Pointer consumed, int src_size, int dst_size, int update_ctx);
02798         void av_resample_compensate(Pointer /*ReSampleContext*/ c, int sample_delta, int compensation_distance);
02799         void av_resample_close(Pointer /*ReSampleContext*/ c);
02800 
02801         
02802 //      #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02803 //      /* YUV420 format is assumed ! */
02804 //
02805 //      /**
02806 //       * @deprecated Use the software scaler (swscale) instead.
02807 //       */
02808 //      typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;
02809 //
02810 //      /**
02811 //       * @deprecated Use the software scaler (swscale) instead.
02812 //       */
02813 //      attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
02814 //                                            int input_width, int input_height);
02815 //
02816 //      /**
02817 //       * @deprecated Use the software scaler (swscale) instead.
02818 //       */
02819 //      attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
02820 //                                            int iwidth, int iheight,
02821 //                                            int topBand, int bottomBand,
02822 //                                            int leftBand, int rightBand,
02823 //                                            int padtop, int padbottom,
02824 //                                            int padleft, int padright);
02825 //
02826 //      /**
02827 //       * @deprecated Use the software scaler (swscale) instead.
02828 //       */
02829 //      attribute_deprecated void img_resample(struct ImgReSampleContext *s,
02830 //                        AVPicture *output, const AVPicture *input);
02831 //
02832 //      /**
02833 //       * @deprecated Use the software scaler (swscale) instead.
02834 //       */
02835 //      attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);
02836 //
02837 //      #endif
02838         
02839 //      // TODO: did not map ImgReSampleContext for JNA, as its structure is complex, and these functions are deprecated.
02840 //      //#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
02841 //      /** YUV420 format is assumed ! 
02842 //       * @deprecated */
02843 //      public Pointer/*ImgReSampleContext*/ img_resample_init(int output_width, int output_height,
02844 //                                            int input_width, int input_height);
02845 //
02846 //      /**
02847 //       * @deprecated Use the software scaler (swscale) instead.
02848 //       */
02849 //      public Pointer/*ImgReSampleContext*/ img_resample_full_init(int owidth, int oheight,
02850 //                                            int iwidth, int iheight,
02851 //                                            int topBand, int bottomBand,
02852 //                                            int leftBand, int rightBand,
02853 //                                            int padtop, int padbottom,
02854 //                                            int padleft, int padright);
02855 //
02856 //      /**
02857 //       * @deprecated Use the software scaler (swscale) instead.
02858 //       */
02859 //      public void img_resample(Pointer/*ImgReSampleContext*/ s,
02860 //                      AVPicture output, AVPicture input);
02861 //
02862 //      /**
02863 //       * @deprecated Use the software scaler (swscale) instead.
02864 //       */
02865 //      public void img_resample_close(Pointer/*ImgReSampleContext*/ s);
02866 //
02867 //      //#endif
02868 //      
02869         
02870 
02871 //      /**
02872 //       * Allocate memory for a picture.  Call avpicture_free to free it.
02873 //       *
02874 //       * @param picture the picture to be filled in
02875 //       * @param pix_fmt the format of the picture
02876 //       * @param width the width of the picture
02877 //       * @param height the height of the picture
02878 //       * @return zero if successful, a negative value if not
02879 //       */
02880 //      int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
02881 //
02882 //      /**
02883 //       * Free a picture previously allocated by avpicture_alloc().
02884 //       *
02885 //       * @param picture the AVPicture to be freed
02886 //       */
02887 //      void avpicture_free(AVPicture *picture);
02888 //
02889 //      /**
02890 //       * Fill in the AVPicture fields.
02891 //       * The fields of the given AVPicture are filled in by using the 'ptr' address
02892 //       * which points to the image data buffer. Depending on the specified picture
02893 //       * format, one or multiple image data pointers and line sizes will be set.
02894 //       * If a planar format is specified, several pointers will be set pointing to
02895 //       * the different picture planes and the line sizes of the different planes
02896 //       * will be stored in the lines_sizes array.
02897 //       *
02898 //       * @param picture AVPicture whose fields are to be filled in
02899 //       * @param ptr Buffer which will contain or contains the actual image data
02900 //       * @param pix_fmt The format in which the picture data is stored.
02901 //       * @param width the width of the image in pixels
02902 //       * @param height the height of the image in pixels
02903 //       * @return size of the image data in bytes
02904 //       */
02905 //      int avpicture_fill(AVPicture *picture, uint8_t *ptr,
02906 //                         int pix_fmt, int width, int height);
02907 //      int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
02908 //                           unsigned char *dest, int dest_size);
02909 //
02910 //      /**
02911 //       * Calculate the size in bytes that a picture of the given width and height
02912 //       * would occupy if stored in the given picture format.
02913 //       *
02914 //       * @param pix_fmt the given picture format
02915 //       * @param width the width of the image
02916 //       * @param height the height of the image
02917 //       * @return Image data size in bytes
02918 //       */
02919 //      int avpicture_get_size(int pix_fmt, int width, int height);
02920 
02921 
02922         public int avpicture_alloc(AVPicture picture, int pix_fmt, int width, int height);
02923         public void avpicture_free(AVPicture picture);
02924         public int avpicture_fill(AVPicture picture, Pointer ptr, int pix_fmt, int width, int height);
02925         // JNA: This is the same exact function, for convenience, since AVFrame is basically AVPicture plus fields on the end.
02926         public int avpicture_fill(AVFrame picture, Pointer ptr, int pix_fmt, int width, int height);
02927         public int avpicture_layout(AVPicture src, int pix_fmt, int width, int height, Pointer dest, int dest_size);
02928         public int avpicture_get_size(int pix_fmt, int width, int height);
02929 
02930         
02931 //      void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
02932 //      const char *avcodec_get_pix_fmt_name(int pix_fmt);
02933 //      void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
02934 //      enum PixelFormat avcodec_get_pix_fmt(const char* name);
02935 //      unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
02936 
02937         
02938         public void avcodec_get_chroma_sub_sample(int pix_fmt, IntByReference h_shift, IntByReference v_shift);
02939         public String avcodec_get_pix_fmt_name(int pix_fmt);
02940         public void avcodec_set_dimensions(AVCodecContext s, int width, int height);
02941         public int avcodec_get_pix_fmt(String name);
02942         public int avcodec_pix_fmt_to_codec_tag(int p);
02943 
02944 //      #define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
02945 //      #define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
02946 //      #define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
02947 //      #define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
02948 //      #define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
02949 //      #define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
02950 //
02951 //      /**
02952 //       * Computes what kind of losses will occur when converting from one specific
02953 //       * pixel format to another.
02954 //       * When converting from one pixel format to another, information loss may occur.
02955 //       * For example, when converting from RGB24 to GRAY, the color information will
02956 //       * be lost. Similarly, other losses occur when converting from some formats to
02957 //       * other formats. These losses can involve loss of chroma, but also loss of
02958 //       * resolution, loss of color depth, loss due to the color space conversion, loss
02959 //       * of the alpha bits or loss due to color quantization.
02960 //       * avcodec_get_fix_fmt_loss() informs you about the various types of losses
02961 //       * which will occur when converting from one pixel format to another.
02962 //       *
02963 //       * @param[in] dst_pix_fmt destination pixel format
02964 //       * @param[in] src_pix_fmt source pixel format
02965 //       * @param[in] has_alpha Whether the source pixel format alpha channel is used.
02966 //       * @return Combination of flags informing you what kind of losses will occur.
02967 //       */
02968 //      int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
02969 //                                   int has_alpha);
02970         
02971         
02972         public static final int FF_LOSS_RESOLUTION  =0x0001; 
02973         public static final int FF_LOSS_DEPTH       =0x0002; 
02974         public static final int FF_LOSS_COLORSPACE  =0x0004; 
02975         public static final int FF_LOSS_ALPHA       =0x0008; 
02976         public static final int FF_LOSS_COLORQUANT  =0x0010; 
02977         public static final int FF_LOSS_CHROMA      =0x0020; 
02979         public int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt, int has_alpha);
02980 
02981 //      int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
02982 //            int has_alpha, int *loss_ptr);
02983         public int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
02984             int has_alpha, IntByReference loss_ptr);
02985         
02986 // void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
02987         public void avcodec_pix_fmt_string (Pointer buf, int buf_size, int pix_fmt);
02988         
02989 //      #define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
02990 //      #define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */
02991 //
02992 //      /**
02993 //       * Tell if an image really has transparent alpha values.
02994 //       * @return ored mask of FF_ALPHA_xxx constants
02995 //       */
02996 //      int img_get_alpha_info(const AVPicture *src,
02997 //                             int pix_fmt, int width, int height);
02998         
02999         public static final int FF_ALPHA_TRANSP       =0x0001; /* image has some totally transparent pixels */
03000         public static final int FF_ALPHA_SEMI_TRANSP  =0x0002; /* image has some transparent pixels */
03001 
03002         public int img_get_alpha_info(AVPicture src, int pix_fmt, int width, int height);
03003         
03004 //      #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
03005 //      /**
03006 //       * convert among pixel formats
03007 //       * @deprecated Use the software scaler (swscale) instead.
03008 //       */
03009 //      attribute_deprecated int img_convert(AVPicture *dst, int dst_pix_fmt,
03010 //                      const AVPicture *src, int pix_fmt,
03011 //                      int width, int height);
03012 //      #endif
03013         
03014         
03015         public int img_convert(AVPicture dst, int dst_pix_fmt,
03016                                         AVPicture src, int pix_fmt,
03017                         int width, int height);
03018         // JNA: This is the same exact function, for convenience, since AVFrame is basically AVPicture plus fields on the end.
03019         public int img_convert(AVFrame dst, int dst_pix_fmt,
03020                         AVFrame src, int pix_fmt,
03021             int width, int height);
03022         
03023 //      /* deinterlace a picture */
03024 //      /* deinterlace - if not supported return -1 */
03025 //      int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
03026 //                                int pix_fmt, int width, int height);
03027         
03028         int avpicture_deinterlace(AVPicture dst, AVPicture src,
03029                                   int pix_fmt, int width, int height);
03030         
03031         
03032 //      /* external high level API */
03033 //
03034 //      extern AVCodec *first_avcodec;
03035 //
03036 //      /* returns LIBAVCODEC_VERSION_INT constant */
03037 //      unsigned avcodec_version(void);
03038 //      /* returns LIBAVCODEC_BUILD constant */
03039 //      unsigned avcodec_build(void);
03040 //
03041 //      /**
03042 //       * Initializes libavcodec.
03043 //       *
03044 //       * @warning This function \e must be called before any other libavcodec
03045 //       * function.
03046 //       */
03047 //      void avcodec_init(void);
03048 //
03049 //      void register_avcodec(AVCodec *format);
03050 
03051         
03052         //extern AVCodec *first_avcodec;        // no way to make this accessible with JNA?  Probably not really important anyway.
03053         public int avcodec_version();
03054         //public int avcodec_build();
03055         public void avcodec_init();
03056         public void register_avcodec(AVCodec format);
03057 
03058 //      /**
03059 //       * Finds an encoder with a matching codec ID.
03060 //       *
03061 //       * @param id CodecID of the requested encoder
03062 //       * @return An encoder if one was found, NULL otherwise.
03063 //       */
03064 //      AVCodec *avcodec_find_encoder(enum CodecID id);
03065 //
03066 //      /**
03067 //       * Finds an encoder with the specified name.
03068 //       *
03069 //       * @param name name of the requested encoder
03070 //       * @return An encoder if one was found, NULL otherwise.
03071 //       */
03072 //      AVCodec *avcodec_find_encoder_by_name(const char *name);
03073 //
03074 //      /**
03075 //       * Finds a decoder with a matching codec ID.
03076 //       *
03077 //       * @param id CodecID of the requested decoder
03078 //       * @return A decoder if one was found, NULL otherwise.
03079 //       */
03080 //      AVCodec *avcodec_find_decoder(enum CodecID id);
03081 //
03082 //      /**
03083 //       * Finds an decoder with the specified name.
03084 //       *
03085 //       * @param name name of the requested decoder
03086 //       * @return A decoder if one was found, NULL otherwise.
03087 //       */
03088 //      AVCodec *avcodec_find_decoder_by_name(const char *name);
03089 //      void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
03090 
03091         public AVCodec avcodec_find_encoder(int id);
03092         public AVCodec avcodec_find_encoder_by_name(String name);
03093         public AVCodec avcodec_find_decoder(int id);
03094         public AVCodec avcodec_find_decoder_by_name(String name);
03095         public void avcodec_string(Pointer buf, int buf_size, AVCodecContext enc, int encode);
03096 
03097         
03098 //      /**
03099 //       * Sets the fields of the given AVCodecContext to default values.
03100 //       *
03101 //       * @param s The AVCodecContext of which the fields should be set to default values.
03102 //       */
03103 //      void avcodec_get_context_defaults(AVCodecContext *s);
03104 //
03105 //      /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
03106 //       *  we WILL change its arguments and name a few times! */
03107 //      void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
03108 //
03109 //      /**
03110 //       * Allocates an AVCodecContext and sets its fields to default values.  The
03111 //       * resulting struct can be deallocated by simply calling av_free().
03112 //       *
03113 //       * @return An AVCodecContext filled with default values or NULL on failure.
03114 //       * @see avcodec_get_context_defaults
03115 //       */
03116 //      AVCodecContext *avcodec_alloc_context(void);
03117 //
03118 //      /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
03119 //       *  we WILL change its arguments and name a few times! */
03120 //      AVCodecContext *avcodec_alloc_context2(enum CodecType);
03121 //
03122 //      /**
03123 //       * Sets the fields of the given AVFrame to default values.
03124 //       *
03125 //       * @param pic The AVFrame of which the fields should be set to default values.
03126 //       */
03127 //      void avcodec_get_frame_defaults(AVFrame *pic);
03128 //
03129 //      /**
03130 //       * Allocates an AVFrame and sets its fields to default values.  The resulting
03131 //       * struct can be deallocated by simply calling av_free().
03132 //       *
03133 //       * @return An AVFrame filled with default values or NULL on failure.
03134 //       * @see avcodec_get_frame_defaults
03135 //       */
03136 //      AVFrame *avcodec_alloc_frame(void);
03137         
03138         public void avcodec_get_context_defaults(AVCodecContext s);
03139         public void avcodec_get_context_defaults2(AVCodecContext s, int e);
03140         public AVCodecContext avcodec_alloc_context();
03141         public AVCodecContext avcodec_alloc_context2(int e);
03142         void avcodec_get_frame_defaults(AVFrame pic);
03143         public AVFrame avcodec_alloc_frame();
03144 
03145 //      int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
03146 //      void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
03147 //      int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
03148 //      void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
03149         public int avcodec_default_get_buffer(AVCodecContext s, AVFrame pic);
03150         public void avcodec_default_release_buffer(AVCodecContext s, AVFrame pic);
03151         public int avcodec_default_reget_buffer(AVCodecContext s, AVFrame pic);
03152         public void avcodec_align_dimensions(AVCodecContext s, IntByReference width, IntByReference height);
03153 
03154 //      int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
03155 //      enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
03156         public int avcodec_check_dimensions(Pointer av_log_ctx, int w, int h);
03157         public int avcodec_default_get_format(AVCodecContext s, IntByReference fmt);
03158 
03159         
03160 //      int avcodec_thread_init(AVCodecContext *s, int thread_count);
03161 //      void avcodec_thread_free(AVCodecContext *s);
03162 //      int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
03163 //      int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
03164         public int avcodec_thread_init(AVCodecContext s, int thread_count);
03165         public void avcodec_thread_free(AVCodecContext s);
03166         public int avcodec_thread_execute(AVCodecContext s, Pointer func, PointerByReference arg, IntByReference ret, int count);
03167         public int avcodec_default_execute(AVCodecContext c, Pointer func, PointerByReference arg, IntByReference ret, int count);
03168 
03169         //int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
03170         public int avcodec_open(AVCodecContext avctx, AVCodec codec);
03171         
03172 //      int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
03173 //            int *frame_size_ptr,
03174 //            uint8_t *buf, int buf_size);
03211         public int avcodec_decode_audio2(AVCodecContext avctx, Pointer samples,
03212             IntByReference frame_size_ptr,
03213             Pointer buf, int buf_size);
03214 //      
03215 //      int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
03216 //            int *got_picture_ptr,
03217 //            uint8_t *buf, int buf_size);
03218         public int avcodec_decode_video(AVCodecContext avctx, AVFrame picture,
03219                         IntByReference got_picture_ptr,
03220             Pointer buf, int buf_size);
03221         
03222         
03223 //      int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
03224 //            int *got_sub_ptr,
03225 //            const uint8_t *buf, int buf_size);
03226 //      int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
03227 //        int *data_size_ptr,
03228 //        uint8_t *buf, int buf_size);
03229         public int avcodec_decode_subtitle(AVCodecContext avctx, AVSubtitle sub,
03230                         IntByReference got_sub_ptr,
03231             Pointer buf, int buf_size);
03232         public int avcodec_parse_frame(AVCodecContext avctx, PointerByReference pdata,
03233                 IntByReference data_size_ptr,
03234                 Pointer buf, int buf_size);
03235 //      int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03236 //            const short *samples);
03237         public int avcodec_encode_audio(AVCodecContext avctx, Pointer buf, int buf_size,
03238             Pointer samples);
03239         
03240         
03241         
03242 //      int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03243 //            const AVFrame *pict);
03244 //      int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
03245 //                     const AVSubtitle *sub);
03246 //      
03247 //      int avcodec_close(AVCodecContext *avctx);
03248 //      
03249 //      void avcodec_register_all(void);
03250         public int avcodec_encode_video(AVCodecContext avctx, Pointer buf, int buf_size,
03251                         AVFrame pict);
03252         public int avcodec_encode_subtitle(AVCodecContext avctx, Pointer buf, int buf_size,
03253                         AVSubtitle sub);
03254         
03255         public int avcodec_close(AVCodecContext avctx);
03256         
03257         public void avcodec_register_all();
03258         
03259         
03260 //      void avcodec_flush_buffers(AVCodecContext *avctx);
03261 //
03262 //      void avcodec_default_free_buffers(AVCodecContext *s);
03263         public void avcodec_flush_buffers(AVCodecContext avctx);
03264 
03265         public void avcodec_default_free_buffers(AVCodecContext s);
03266         
03267         //char av_get_pict_type_char(int pict_type);
03268         public byte av_get_pict_type_char(int pict_type);
03269         
03270         //int av_get_bits_per_sample(enum CodecID codec_id);
03271         public int av_get_bits_per_sample(int codec_id);
03272         
03273         
03274 //      /* frame parsing */
03275 //      typedef struct AVCodecParserContext {
03276 //          void *priv_data;
03277 //          struct AVCodecParser *parser;
03278 //          int64_t frame_offset; /* offset of the current frame */
03279 //          int64_t cur_offset; /* current offset
03280 //                                 (incremented by each av_parser_parse()) */
03281 //          int64_t last_frame_offset; /* offset of the last frame */
03282 //          /* video info */
03283 //          int pict_type; /* XXX: Put it back in AVCodecContext. */
03284 //          int repeat_pict; /* XXX: Put it back in AVCodecContext. */
03285 //          int64_t pts;     /* pts of the current frame */
03286 //          int64_t dts;     /* dts of the current frame */
03287 //
03288 //          /* private data */
03289 //          int64_t last_pts;
03290 //          int64_t last_dts;
03291 //          int fetch_timestamp;
03292 //
03293 //      #define AV_PARSER_PTS_NB 4
03294 //          int cur_frame_start_index;
03295 //          int64_t cur_frame_offset[AV_PARSER_PTS_NB];
03296 //          int64_t cur_frame_pts[AV_PARSER_PTS_NB];
03297 //          int64_t cur_frame_dts[AV_PARSER_PTS_NB];
03298 //
03299 //          int flags;
03300 //      #define PARSER_FLAG_COMPLETE_FRAMES           0x0001
03301 //
03302 //          int64_t offset;      ///< byte offset from starting packet start
03303 //          int64_t last_offset;
03304 //      } AVCodecParserContext;
03305         
03306         /* frame parsing */
03307         public static class AVCodecParserContext extends Structure 
03308         {
03309             public Pointer priv_data;
03310             public Pointer parser;
03311             public long frame_offset; /* offset of the current frame */
03312             public long cur_offset; /* current offset
03313                                    (incremented by each av_parser_parse()) */
03314             public long last_frame_offset; /* offset of the last frame */
03315             /* video info */
03316             public int pict_type; /* XXX: Put it back in AVCodecContext. */
03317             public int repeat_pict; /* XXX: Put it back in AVCodecContext. */
03318             public long pts;     /* pts of the current frame */
03319             public long dts;     /* dts of the current frame */
03320 
03321             /* private data */
03322             public long last_pts;
03323             public long last_dts;
03324             public int fetch_timestamp;
03325 
03326                 public static final int AV_PARSER_PTS_NB =4;
03327             public int cur_frame_start_index;
03328                 public long[] cur_frame_offset = new long[AV_PARSER_PTS_NB];
03329                 public long[] cur_frame_pts = new long[AV_PARSER_PTS_NB];
03330                 public long[] cur_frame_dts = new long[AV_PARSER_PTS_NB];
03331 
03332                 public int flags;
03333                 public static final int PARSER_FLAG_COMPLETE_FRAMES           =0x0001;
03334 
03335         public long offset;      
03336         public long last_offset;
03337         } 
03338         
03339         
03340 //      typedef struct AVCodecParser {
03341 //          int codec_ids[5]; /* several codec IDs are permitted */
03342 //          int priv_data_size;
03343 //          int (*parser_init)(AVCodecParserContext *s);
03344 //          int (*parser_parse)(AVCodecParserContext *s,
03345 //                              AVCodecContext *avctx,
03346 //                              const uint8_t **poutbuf, int *poutbuf_size,
03347 //                              const uint8_t *buf, int buf_size);
03348 //          void (*parser_close)(AVCodecParserContext *s);
03349 //          int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
03350 //          struct AVCodecParser *next;
03351 //      } AVCodecParser;
03352         
03353         public static class AVCodecParser extends Structure 
03354         {
03355             public int[] codec_ids = new int[5]; /* several codec IDs are permitted */
03356             public int priv_data_size;
03357             public Pointer parser_init;
03358             public Pointer parser_parse;
03359             public Pointer parser_close;
03360             public Pointer split;
03361             public Pointer next;
03362         }
03363         
03364         //extern AVCodecParser *av_first_parser;
03365         // TODO: no way to access global variables with JNA
03366         
03367 //      void av_register_codec_parser(AVCodecParser *parser);
03368 //      AVCodecParserContext *av_parser_init(int codec_id);
03369 //      int av_parser_parse(AVCodecParserContext *s,
03370 //                          AVCodecContext *avctx,
03371 //                          uint8_t **poutbuf, int *poutbuf_size,
03372 //                          const uint8_t *buf, int buf_size,
03373 //                          int64_t pts, int64_t dts);
03374 //      int av_parser_change(AVCodecParserContext *s,
03375 //                           AVCodecContext *avctx,
03376 //                           uint8_t **poutbuf, int *poutbuf_size,
03377 //                           const uint8_t *buf, int buf_size, int keyframe);
03378 //      void av_parser_close(AVCodecParserContext *s);
03379         
03380         public void av_register_codec_parser(AVCodecParser parser);
03381         public AVCodecParser av_parser_init(int codec_id);
03382         public int av_parser_parse(AVCodecParserContext s,
03383                                                 AVCodecContext avctx,
03384                             PointerByReference poutbuf, IntByReference poutbuf_size,
03385                             Pointer buf, int buf_size,
03386                             long pts, long dts);
03387         public int av_parser_change(AVCodecParserContext  s,
03388                                                  AVCodecContext avctx,
03389                              PointerByReference poutbuf, IntByReference poutbuf_size,
03390                              Pointer buf, int buf_size, int keyframe);
03391         public void av_parser_close(AVCodecParserContext s);
03392         
03393 //      extern AVCodecParser aac_parser;
03394 //      extern AVCodecParser ac3_parser;
03395 //      extern AVCodecParser cavsvideo_parser;
03396 //      extern AVCodecParser dca_parser;
03397 //      extern AVCodecParser dvbsub_parser;
03398 //      extern AVCodecParser dvdsub_parser;
03399 //      extern AVCodecParser h261_parser;
03400 //      extern AVCodecParser h263_parser;
03401 //      extern AVCodecParser h264_parser;
03402 //      extern AVCodecParser mjpeg_parser;
03403 //      extern AVCodecParser mpeg4video_parser;
03404 //      extern AVCodecParser mpegaudio_parser;
03405 //      extern AVCodecParser mpegvideo_parser;
03406 //      extern AVCodecParser pnm_parser;
03407 //      extern AVCodecParser vc1_parser;
03408         
03409         // TODO: no way to access global variables with JNA
03410         
03411 //      typedef struct AVBitStreamFilterContext {
03412 //          void *priv_data;
03413 //          struct AVBitStreamFilter *filter;
03414 //          AVCodecParserContext *parser;
03415 //          struct AVBitStreamFilterContext *next;
03416 //      } AVBitStreamFilterContext;
03417         
03418         public static class AVBitStreamFilterContext extends Structure
03419         {
03420             public AVBitStreamFilterContext(Pointer p) {
03421                 super();
03422                         useMemory(p);
03423                         read();
03424                 }               
03425 
03426             public Pointer priv_data;
03427             public Pointer filter;
03428             public Pointer parser;
03429             public Pointer next;
03430         }
03431         
03432         
03433 //      typedef struct AVBitStreamFilter {
03434 //          const char *name;
03435 //          int priv_data_size;
03436 //          int (*filter)(AVBitStreamFilterContext *bsfc,
03437 //                        AVCodecContext *avctx, const char *args,
03438 //                        uint8_t **poutbuf, int *poutbuf_size,
03439 //                        const uint8_t *buf, int buf_size, int keyframe);
03440 //          struct AVBitStreamFilter *next;
03441 //      } AVBitStreamFilter;
03442         
03443         
03444         public static class AVBitStreamFilter extends Structure
03445         {
03446                 public Pointer name;
03447             public int priv_data_size;
03448             public Pointer filter;
03449             public Pointer next;
03450         };
03451         
03452         //extern AVBitStreamFilter *av_first_bitstream_filter;
03453         // TODO: no way to access global variables with JNA
03454         
03455         
03456 //      void av_register_bitstream_filter(AVBitStreamFilter *bsf);
03457 //      AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
03458 //      int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
03459 //                                     AVCodecContext *avctx, const char *args,
03460 //                                     uint8_t **poutbuf, int *poutbuf_size,
03461 //                                     const uint8_t *buf, int buf_size, int keyframe);
03462 //      void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
03463         public void av_register_bitstream_filter(AVBitStreamFilter bsf);
03464         public AVBitStreamFilterContext av_bitstream_filter_init(String name);
03465         public int av_bitstream_filter_filter(AVBitStreamFilterContext bsfc,
03466                                                                    AVCodecContext avctx, String args,
03467                                        PointerByReference poutbuf, IntByReference poutbuf_size,
03468                                        Pointer buf, int buf_size, int keyframe);
03469         public void av_bitstream_filter_close(AVBitStreamFilterContext bsf);
03470         
03471         
03472 //      extern AVBitStreamFilter dump_extradata_bsf;
03473 //      extern AVBitStreamFilter remove_extradata_bsf;
03474 //      extern AVBitStreamFilter noise_bsf;
03475 //      extern AVBitStreamFilter mp3_header_compress_bsf;
03476 //      extern AVBitStreamFilter mp3_header_decompress_bsf;
03477 //      extern AVBitStreamFilter mjpega_dump_header_bsf;
03478 //      extern AVBitStreamFilter imx_dump_header_bsf;
03479         // TODO: no way to access global variables with JNA
03480         
03481         
03482         
03483         /* memory */
03484         //void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
03485         public Pointer av_fast_realloc(Pointer ptr, IntByReference size, int min_size);
03486         
03487         
03488         //attribute_deprecated void av_free_static(void);
03490         public void av_free_static();
03491         
03492         //attribute_deprecated void *av_mallocz_static(unsigned int size);
03494         public Pointer av_mallocz_static(int size);
03495         
03496 //      void av_picture_copy(AVPicture *dst, const AVPicture *src,
03497 //            int pix_fmt, int width, int height);
03498         public void av_picture_copy(AVPicture dst, AVPicture src,
03499             int pix_fmt, int width, int height);
03500         
03501 //      int av_picture_crop(AVPicture *dst, const AVPicture *src,
03502 //            int pix_fmt, int top_band, int left_band);
03503         public int av_picture_crop(AVPicture dst, AVPicture src,
03504             int pix_fmt, int top_band, int left_band);
03505 
03506 //      int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
03507 //            int padtop, int padbottom, int padleft, int padright, int *color);
03508         public int av_picture_pad(AVPicture dst, AVPicture src, int height, int width, int pix_fmt,
03509             int padtop, int padbottom, int padleft, int padright, IntByReference color);
03510 
03511         
03512         
03513 //      #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
03514 //      /**
03515 //       * @deprecated Use the software scaler (swscale) instead.
03516 //       */
03517 //      attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
03518 //                    int pix_fmt, int width, int height);
03519 //
03520 //      /**
03521 //       * @deprecated Use the software scaler (swscale) instead.
03522 //       */
03523 //      attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
03524 //                   int pix_fmt, int top_band, int left_band);
03525 //
03526 //      /**
03527 //       * @deprecated Use the software scaler (swscale) instead.
03528 //       */
03529 //      attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
03530 //                  int padtop, int padbottom, int padleft, int padright, int *color);
03531 //      #endif
03532         
03533         //#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
03537 //      public void img_copy(AVPicture dst, AVPicture src,
03538         //              int pix_fmt, int width, int height);
03539 
03543 //      public int img_crop(AVPicture dst, AVPicture src,
03544         //             int pix_fmt, int top_band, int left_band);
03545 
03549 //      public int img_pad(AVPicture dst, AVPicture src, int height, int width, int pix_fmt,
03550         //            int padtop, int padbottom, int padleft, int padright, IntByReference color);
03551         //#endif
03552         
03553         //extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
03554         public int av_xiphlacing(Pointer s, int v);
03555         
03556         //int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
03557         public int av_parse_video_frame_size(IntByReference width_ptr, IntByReference height_ptr, String str);
03558         
03559         //int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
03560         public int av_parse_video_frame_rate(AVRational frame_rate, String str);
03561         
03562 
03563 //      /* error handling */
03564 //      #if EINVAL > 0
03565 //      #define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
03566 //      #define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
03567 //      #else
03568 //      /* Some platforms have E* and errno already negated. */
03569 //      #define AVERROR(e) (e)
03570 //      #define AVUNERROR(e) (e)
03571 //      #endif
03572 //      #define AVERROR_UNKNOWN     AVERROR(EINVAL)  /**< unknown error */
03573 //      #define AVERROR_IO          AVERROR(EIO)     /**< I/O error */
03574 //      #define AVERROR_NUMEXPECTED AVERROR(EDOM)    /**< Number syntax expected in filename. */
03575 //      #define AVERROR_INVALIDDATA AVERROR(EINVAL)  /**< invalid data found */
03576 //      #define AVERROR_NOMEM       AVERROR(ENOMEM)  /**< not enough memory */
03577 //      #define AVERROR_NOFMT       AVERROR(EILSEQ)  /**< unknown format */
03578 //      #define AVERROR_NOTSUPP     AVERROR(ENOSYS)  /**< Operation not supported. */
03579 //      #define AVERROR_NOENT       AVERROR(ENOENT)  /**< No such file or directory. */
03580         
03581         // TODO: not sure how best to define these.
03582 
03583 // end avcodec.h
03584 //------------------------------------------------------------------------------------------------------------------------
03585 
03586 
03587 //------------------------------------------------------------------------------------------------------------------------
03588 // libavcodec/opt.h
03589 
03590 
03591         //enum AVOptionType:
03592     public static final int FF_OPT_TYPE_FLAGS = 0;
03593     public static final int FF_OPT_TYPE_INT = 1;
03594     public static final int FF_OPT_TYPE_INT64 = 2;
03595     public static final int FF_OPT_TYPE_DOUBLE = 3;
03596     public static final int FF_OPT_TYPE_FLOAT = 4;
03597     public static final int FF_OPT_TYPE_STRING = 5;
03598     public static final int FF_OPT_TYPE_RATIONAL = 6;
03599     public static final int FF_OPT_TYPE_CONST=128;
03600 
03601 
03602         //  typedef struct AVOption {
03603         //  const char *name;
03604         //
03605         //  /**
03606         //   * short English text help.
03607         //   * @todo what about other languages
03608         //   */
03609         //  const char *help;
03610         //  int offset;             ///< offset to context structure where the parsed value should be stored
03611         //  enum AVOptionType type;
03612         //
03613         //  double default_val;
03614         //  double min;
03615         //  double max;
03616         //
03617         //  int flags;
03618         //#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
03619         //#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
03620         //#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
03621         //#define AV_OPT_FLAG_AUDIO_PARAM     8
03622         //#define AV_OPT_FLAG_VIDEO_PARAM     16
03623         //#define AV_OPT_FLAG_SUBTITLE_PARAM  32
03625         //  const char *unit;
03626         //} AVOption;
03627         
03628         public static class AVOption extends Structure
03629         {
03630                 public String name;
03631                 public String help;
03632                 public int offset; 
03633                 public int type;
03634                 public double default_val;
03635                 public double min;
03636                 public double max;
03637                 public int flags;
03638                 
03639                         public static final int AV_OPT_FLAG_ENCODING_PARAM  =1;   
03640                         public static final int AV_OPT_FLAG_DECODING_PARAM  =2;   
03641                         public static final int AV_OPT_FLAG_METADATA        =4;   
03642                         public static final int AV_OPT_FLAG_AUDIO_PARAM     =8;
03643                         public static final int AV_OPT_FLAG_VIDEO_PARAM     =16;
03644                         public static final int AV_OPT_FLAG_SUBTITLE_PARAM  =32;
03645                 
03646                 public String unit;
03647         }       
03648 
03649 //      const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
03650 //      const AVOption *av_set_string(void *obj, const char *name, const char *val);
03651 //      const AVOption *av_set_double(void *obj, const char *name, double n);
03652 //      const AVOption *av_set_q(void *obj, const char *name, AVRational n);
03653 //      const AVOption *av_set_int(void *obj, const char *name, int64_t n);
03654 //      double av_get_double(void *obj, const char *name, const AVOption **o_out);
03655 //      AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
03656 //      int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
03657 //      const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
03658 //      const AVOption *av_next_option(void *obj, const AVOption *last);
03659 //      int av_opt_show(void *obj, void *av_log_obj);
03660 //      void av_opt_set_defaults(void *s);
03661 //      void av_opt_set_defaults2(void *s, int mask, int flags);
03662         public AVOption av_find_opt(Pointer obj, String name, String unit, int mask, int flags);
03663         public AVOption av_set_string(Pointer obj, String name, Pointer str);
03664         public AVOption av_set_double(Pointer obj, String name, double n);
03665         public AVOption av_set_q(Pointer obj, String name, AVRational n);       // TODO: this appears to be by value, will JNA map correctly?
03666         public AVOption av_set_int(Pointer obj, String name, long n);
03667         public double av_get_double(Pointer obj, String name, PointerByReference o_out);
03668         public AVRational av_get_q(Pointer obj, String name, PointerByReference o_out);
03669         public long av_get_int(Pointer obj, String name, PointerByReference o_out);
03670         public String av_get_string(Pointer obj, String name, PointerByReference o_out, Pointer buf, int buf_len);
03671         public AVOption av_next_option(Pointer obj, AVOption last);
03672         public int av_opt_show(Pointer obj, Pointer av_log_obj);
03673         public void av_opt_set_defaults(Pointer s);
03674         public void av_opt_set_defaults2(Pointer s, int mask, int flags);
03675 
03676 // end libavcodec/opt.h
03677 //------------------------------------------------------------------------------------------------------------------------
03678 
03679 }

Generated on Tue Apr 7 17:57:19 2009 for visclient by  doxygen 1.5.1