[cvs] / xvidcore / src / xvid.h Repository:
ViewVC logotype

Diff of /xvidcore/src/xvid.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17.2.28, Wed Feb 12 12:03:30 2003 UTC revision 1.28.2.1, Sat May 3 23:23:49 2003 UTC
# Line 3  Line 3 
3  *  XVID MPEG-4 VIDEO CODEC  *  XVID MPEG-4 VIDEO CODEC
4  *  - XviD Main header file -  *  - XviD Main header file -
5  *  *
6     *  This file is part of XviD, a free MPEG-4 video encoder/decoder
7     *
8  *  This program is free software ; you can redistribute it and/or modify  *  This program is free software ; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation ; either version 2 of the License, or  *  the Free Software Foundation ; either version 2 of the License, or
# Line 17  Line 19 
19  *  along with this program ; if not, write to the Free Software  *  along with this program ; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  *  *
 *****************************************************************************/  
 /*****************************************************************************  
 *  
 *  History  
 *  
 *  - 2002/06/13 Added legal header, ANSI C comment style (only for this header  
 *               as it can be included in a ANSI C project).  
 *  
 *               ToDo ? : when BFRAMES is defined, the API_VERSION should not  
 *                        be the same (3.0 ?)  
 *  
22  *  $Id$  *  $Id$
23  *  *
24  *****************************************************************************/   ****************************************************************************/
   
25    
26  #ifndef _XVID_H_  #ifndef _XVID_H_
27  #define _XVID_H_  #define _XVID_H_
# Line 78  Line 68 
68  #define XVID_CSP_RGB555 10  #define XVID_CSP_RGB555 10
69  #define XVID_CSP_RGB565 11  #define XVID_CSP_RGB565 11
70  #define XVID_CSP_USER   12  #define XVID_CSP_USER   12
71  #define XVID_CSP_EXTERN      1004  // per slice rendering  #define XVID_CSP_EXTERN 1004 /* per slice rendering */
72  #define XVID_CSP_YVYU   1002  #define XVID_CSP_YVYU   1002
73  #define XVID_CSP_RGB32  1000    /* [b|g|r|a] */  #define XVID_CSP_RGB32  1000    /* [b|g|r|a] */
74  #define XVID_CSP_ABGR   1006    /* [a|b|g|r] */  #define XVID_CSP_ABGR   1006    /* [a|b|g|r] */
# Line 88  Line 78 
78    
79  #define XVID_CSP_NULL   9999  #define XVID_CSP_NULL   9999
80    
81  #define XVID_CSP_VFLIP  0x80000000      // flip mask  #define XVID_CSP_VFLIP  0x80000000 /* flip mask */
82    
83    
84  /*****************************************************************************  /*****************************************************************************
# Line 96  Line 86 
86   ****************************************************************************/   ****************************************************************************/
87    
88  /* CPU flags for XVID_INIT_PARAM.cpu_flags */  /* CPU flags for XVID_INIT_PARAM.cpu_flags */
89  #define XVID_CPU_FORCE          0x80000000  #define XVID_CPU_FORCE     0x80000000  /* force passed cpu flags */
90  #define XVID_CPU_CHKONLY        0x40000000              /* check cpu only; dont init globals */  #define XVID_CPU_CHKONLY        0x40000000              /* check cpu only; dont init globals */
   
91  #define XVID_CPU_ASM            0x00000080              /* native assembly */  #define XVID_CPU_ASM            0x00000080              /* native assembly */
92  /* ARCH_X86 */  
93    /* ARCH_IS_IA32 */
94  #define XVID_CPU_MMX            0x00000001              /* mmx: pentiumMMX,k6 */  #define XVID_CPU_MMX            0x00000001              /* mmx: pentiumMMX,k6 */
95  #define XVID_CPU_MMXEXT         0x00000002              /* mmxx-ext: pentium2,athlon */  #define XVID_CPU_MMXEXT   0x00000002   /* mmx-ext  : pentium2, athlon */
96  #define XVID_CPU_SSE            0x00000004              /* sse: pentium3,athlonXP */  #define XVID_CPU_SSE            0x00000004              /* sse: pentium3,athlonXP */
97  #define XVID_CPU_SSE2           0x00000008              /* sse2: pentium4,athlon64 */  #define XVID_CPU_SSE2           0x00000008              /* sse2: pentium4,athlon64 */
98  #define XVID_CPU_3DNOW          0x00000010              /* 3dnow: k6-2 */  #define XVID_CPU_3DNOW          0x00000010              /* 3dnow: k6-2 */
99  #define XVID_CPU_3DNOWEXT       0x00000020              /* 3dnow-ext: athlon */  #define XVID_CPU_3DNOWEXT       0x00000020              /* 3dnow-ext: athlon */
100  #define XVID_CPU_TSC            0x00000040              /* timestamp counter */  #define XVID_CPU_TSC            0x00000040              /* timestamp counter */
101  /* ARCH_IA64 */  
102    /* ARCH_IS_IA64 */
103  #define XVID_CPU_IA64           XVID_CPU_ASM    /* defined for backward compatibility */  #define XVID_CPU_IA64           XVID_CPU_ASM    /* defined for backward compatibility */
104  /* ARCH_PPC */  
105    /* ARCH_IS_PPC */
106  #define XVID_CPU_ALTIVEC        0x00000001              /* altivec */  #define XVID_CPU_ALTIVEC        0x00000001              /* altivec */
107    
108    
# Line 137  Line 129 
129                  int cpu_flags;                  int cpu_flags;
130                  int api_version;                  int api_version;
131                  int core_build;                  int core_build;
132          }          } XVID_INIT_PARAM;
         XVID_INIT_PARAM;  
133    
134          typedef struct          typedef struct
135          {          {
# Line 164  Line 155 
155   ****************************************************************************/   ****************************************************************************/
156    
157  /* Flags for XVID_DEC_FRAME.general */  /* Flags for XVID_DEC_FRAME.general */
158  #define XVID_DEC_LOWDELAY               0x00000001      /* decode lowdelay mode (ie. video-for-windows) */  #define XVID_DEC_LOWDELAY      0x00000001 /* decode lowdelay mode (ie. VFW) */
159  #define XVID_DEC_DEBLOCKY               0x00000002      /* luma deblocking */  #define XVID_DEC_DEBLOCKY               0x00000002      /* luma deblocking */
160  #define XVID_DEC_DEBLOCKUV              0x00000008      /* chroma deblocking */  #define XVID_DEC_DEBLOCKUV              0x00000008      /* chroma deblocking */
161  #define XVID_DEC_DISCONTINUITY  0x00000004      /* indicates break in stream; instructs  #define XVID_DEC_DERING            0x00000012 /* deringing */
162                                                                                          decoder to ignore any previous reference frames */  #define XVID_DEC_DISCONTINUITY 0x00000004 /* indicates break in stream
163                                                 instructs decoder to ignore any
164                                                 previous reference frames */
165  #define XVID_QUICK_DECODE               0x00000010  #define XVID_QUICK_DECODE               0x00000010
166    
167  /*****************************************************************************  /*****************************************************************************
# Line 180  Line 173 
173                  int width;                  int width;
174                  int height;                  int height;
175                  void *handle;                  void *handle;
176          }          } XVID_DEC_PARAM;
         XVID_DEC_PARAM;  
177    
178    
179  #define XVID_DEC_VOP    0  #define XVID_DEC_VOP    0
# Line 220  Line 212 
212                  void *image;                  void *image;
213                  int stride;                  int stride;
214                  int colorspace;                  int colorspace;
215          }          } XVID_DEC_FRAME;
         XVID_DEC_FRAME;  
216    
217    
218          // This struct is used for per slice rendering          /* This struct is used for per slice rendering */
219          typedef struct          typedef struct
220          {          {
221                  void *y,*u,*v;                  void *y,*u,*v;
# Line 264  Line 255 
255  #define XVID_VALID_FLAGS                0x80000000  #define XVID_VALID_FLAGS                0x80000000
256    
257  #define XVID_CUSTOM_QMATRIX             0x00000004      /* use custom quant matrix */  #define XVID_CUSTOM_QMATRIX             0x00000004      /* use custom quant matrix */
258    #define XVID_CARTOON_MODE               0x00000008 /* use cartoon mode */
259  #define XVID_H263QUANT                  0x00000010  #define XVID_H263QUANT                  0x00000010
260  #define XVID_MPEGQUANT                  0x00000020  #define XVID_MPEGQUANT                  0x00000020
261  #define XVID_HALFPEL                    0x00000040      /* use halfpel interpolation */  #define XVID_HALFPEL                    0x00000040      /* use halfpel interpolation */
# Line 286  Line 278 
278  #define XVID_ME_PMVFAST                 0x00080000  #define XVID_ME_PMVFAST                 0x00080000
279  #define XVID_ME_EPZS                    0x00100000  #define XVID_ME_EPZS                    0x00100000
280    
281  #define XVID_GREYSCALE                  0x01000000      /* enable greyscale only mode (even for */  #define XVID_CHROMAOPT          0x00200000 /* enable chroma optimization pre-filter */
282                                                                                          /* color input material chroma is ignored) */  
283    #define XVID_GREYSCALE          0x01000000 /* enable greyscale only mode (even for
284                                                  color input material chroma is ignored) */
285    
286  #define XVID_GMC                                0x10000000  #define XVID_GMC                                0x10000000
287  #define XVID_GMC_TRANSLATIONAL  0x20000000  #define XVID_GMC_TRANSLATIONAL  0x20000000
# Line 297  Line 291 
291    
292  #define XVID_EXTRASTATS                 0x00000200  /* generate extra statistics */  #define XVID_EXTRASTATS                 0x00000200  /* generate extra statistics */
293    
294  #define XVID_MODEDECISION_DCT   0x00400000      /* enable DCT-ME and use it for mode decision */  #define XVID_MODEDECISION_BITS  0x00400000 /* enable DCT-ME and use it for mode decision */
295    
296    
297  /* Flags for XVID_ENC_FRAME.motion */  /* Flags for XVID_ENC_FRAME.motion */
   
298  #define PMV_ADVANCEDDIAMOND16   0x00008000      /* use advdiamonds instead of diamonds as search pattern */  #define PMV_ADVANCEDDIAMOND16   0x00008000      /* use advdiamonds instead of diamonds as search pattern */
299  #define PMV_USESQUARES16                0x00800000      /* use squares instead of diamonds as search pattern */  #define PMV_USESQUARES16                0x00800000      /* use squares instead of diamonds as search pattern */
300    
# Line 320  Line 313 
313  #define PMV_CHROMA16                    0x00100000      /* also use chroma for P_VOP/S_VOP ME */  #define PMV_CHROMA16                    0x00100000      /* also use chroma for P_VOP/S_VOP ME */
314  #define PMV_CHROMA8                             0x10000000      /* also use chroma for B_VOP ME */  #define PMV_CHROMA8                             0x10000000      /* also use chroma for B_VOP ME */
315    
316  /* Motion search using DCT. use XVID_MODEDECISION_DCT to enable */  /* Motion search using DCT. use XVID_MODEDECISION_BITS to enable */
317  #define HALFPELREFINE16_DCT             0x00000100      /* perform DCT-based halfpel refinement */  #define HALFPELREFINE16_BITS    0x00000100 /* perform DCT-based halfpel refinement */
318  #define HALFPELREFINE8_DCT              0x00000200      /* perform DCT-based halfpel refinement for 8x8 mode */  #define HALFPELREFINE8_BITS     0x00000200 /* perform DCT-based halfpel refinement for 8x8 mode */
319  #define QUARTERPELREFINE16_DCT  0x00000400      /* perform DCT-based qpel refinement */  #define QUARTERPELREFINE16_BITS 0x00000400 /* perform DCT-based qpel refinement */
320  #define QUARTERPELREFINE8_DCT   0x00000800      /* perform DCT-based qpel refinement for 8x8 mode */  #define QUARTERPELREFINE8_BITS  0x00000800 /* perform DCT-based qpel refinement for 8x8 mode */
321    
322  #define EXTSEARCH_DCT                   0x00001000      /* perform DCT-based search using square pattern */  #define EXTSEARCH_BITS          0x00001000 /* perform DCT-based search using square pattern
323                                                                                          /* enable PMV_EXTSEARCH8 to do this in 8x8 search as well */                                                enable PMV_EXTSEARCH8 to do this in 8x8 search as well */
324  #define CHECKPREDICTION_DCT             0x00002000      /* always check vector equal to prediction */  #define CHECKPREDICTION_BITS    0x00002000 /* always check vector equal to prediction */
325    
326    
327  /* note: old and deprecated - or never implemented */  /* note: old and deprecated - or never implemented */
# Line 358  Line 351 
351          typedef struct          typedef struct
352          {          {
353                  int width, height;                  int width, height;
354                  int fincr, fbase;               /* frame increment, fbase. each frame = "fincr/fbase" seconds */                  int fincr, fbase;             /* [in] frame increment, fbase. each frame = "fincr/fbase" seconds */
355                  int rc_bitrate;                 /* the bitrate of the target encoded stream, in bits/second */                  int rc_bitrate;               /* [in] the bitrate of the target encoded stream, in bits/second */
356                  int rc_reaction_delay_factor;   /* how fast the rate control reacts - lower values are faster */                  int rc_reaction_delay_factor; /* [in] how fast the rate control reacts - lower values are faster */
357                  int rc_averaging_period;        /* as above */                  int rc_averaging_period;      /* [in] as above */
358                  int rc_buffer;                  /* as above */                  int rc_buffer;                /* [in] as above */
359                  int max_quantizer;              /* the upper limit of the quantizer */                  int max_quantizer;            /* [in] the upper limit of the quantizer */
360                  int min_quantizer;              /* the lower limit of the quantizer */                  int min_quantizer;            /* [in] the lower limit of the quantizer */
361                  int max_key_interval;   /* the maximum interval between key frames */                  int max_key_interval;         /* [in] the maximum interval between key frames */
362  #ifdef _SMP  #ifdef _SMP
363                  int num_threads;                /* number of threads */                  int num_threads;              /* [in] number of threads */
364  #endif  #endif
365                  int global;                             /* global/debug options */                  int global;                   /* [in] global/debug options */
366                  int max_bframes;                /* max sequential bframes (0=disable bframes) */                  int max_bframes;              /* [in] max sequential bframes (0=disable bframes) */
367                  int bquant_ratio;               /* bframe quantizer multipier (percentage).                  int bquant_ratio;             /* [in] bframe quantizer multipier (percentage).
368                                                                   * used only when bquant < 1                                                used only when bquant < 1
369                                                                   * eg. 200 = x2 multiplier                                                eg. 200 = x2 multiplier
370                                                                   * quant = ((past_quant + future_quant) * bquant_ratio)/200                                                    quant = ((past_quant + future_quant) * bquant_ratio)/200
371                                                                   */                                                                   */
372                  int bquant_offset;              /* bquant += bquant_offset */                  int bquant_offset;            /* [in] bquant += bquant_offset */
373                  int frame_drop_ratio;   /* frame dropping: 0=drop none... 100=drop all */                  int frame_drop_ratio;         /* [in] frame dropping: 0=drop none... 100=drop all */
374                  void *handle;                   /* [out] encoder instance handle */                  void *handle;                   /* [out] encoder instance handle */
375          }          } XVID_ENC_PARAM;
         XVID_ENC_PARAM;  
376    
377          typedef struct          typedef struct
378          {          {
379                  int x;                  int x;
380                  int y;                  int y;
381          }          } VECTOR;
         VECTOR;  
382    
383          typedef struct          typedef struct
384          {          {
385                  int mode;                               /* macroblock mode */                  int mode;                               /* macroblock mode */
386                  VECTOR mvs[4];                  VECTOR mvs[4];
387          }          } MVBLOCKHINT;
         MVBLOCKHINT;  
388    
389          typedef struct          typedef struct
390          {          {
391                  int intra;                              /* frame intra choice */                  int intra;                              /* frame intra choice */
392                  int fcode;                              /* frame fcode */                  int fcode;                              /* frame fcode */
393                  MVBLOCKHINT *block;             /* caller-allocated array of block hints (mb_width * mb_height) */                  MVBLOCKHINT *block;             /* caller-allocated array of block hints (mb_width * mb_height) */
394          }          } MVFRAMEHINT;
         MVFRAMEHINT;  
395    
396          typedef struct          typedef struct
397          {          {
# Line 411  Line 400 
400                  MVFRAMEHINT mvhint;                  MVFRAMEHINT mvhint;
401                  void *hintstream;               /* compressed hint buffer */                  void *hintstream;               /* compressed hint buffer */
402                  int hintlength;                 /* length of buffer (bytes) */                  int hintlength;                 /* length of buffer (bytes) */
403          }          } HINTINFO;
         HINTINFO;  
404    
405          typedef struct          typedef struct
406          {          {
# Line 422  Line 410 
410                  int length;                             /* [out] bitstream length (bytes) */                  int length;                             /* [out] bitstream length (bytes) */
411    
412                  void *image;                    /* [in] image ptr */                  void *image;                    /* [in] image ptr */
413                  int stride;                  int stride;                        /* [in] horizontal stride in bytes */
414                  int colorspace;                 /* [in] source colorspace */                  int colorspace;                 /* [in] source colorspace */
415    
416                  unsigned char *quant_intra_matrix;      // [in] custom intra qmatrix */                  unsigned char *quant_intra_matrix; /* [in] custom intra qmatrix */
417                  unsigned char *quant_inter_matrix;      // [in] custom inter qmatrix */                  unsigned char *quant_inter_matrix; /* [in] custom inter qmatrix */
418                  int quant;                              /* [in] frame quantizer (vbr) */                  int quant;                              /* [in] frame quantizer (vbr) */
419                  int intra;                              /* [in] force intra frame (vbr only)                  int intra;                              /* [in] force intra frame (vbr only)
420                                                                   * [out] intra state                                                [out] frame type (ugly atm)
421                                                                   */                                                                   */
422                  HINTINFO hint;                  /* [in/out] mv hint information */                  HINTINFO hint;                  /* [in/out] mv hint information */
423    
424                  int bquant;                             /* [in] bframe quantizer */                  int bquant;                             /* [in] bframe quantizer */
425                    int bframe_threshold;                      /* [in] sensitivity of B-frame decision */
426    
427          }          } XVID_ENC_FRAME;
         XVID_ENC_FRAME;  
428    
429    
430          typedef struct          typedef struct
431          {          {
432                  int quant;                              /* [out] frame quantizer */                  int quant;                              /* [out] frame quantizer */
433                  int hlength;                    /* [out] header length (bytes) */                  int hlength;                    /* [out] header length (bytes) */
434                  int kblks, mblks, ublks;        /* [out] */                  int kblks;   /* [out] number of intra blocks */
435                    int mblks;   /* [out] number of inter blocks */
436                    int ublks;       /* [out] number of "not coded" blocks */
437                  long sse_y;                             /* [out] SSE of Y */                  long sse_y;                             /* [out] SSE of Y */
438                  long sse_u;                             /* [out] SSE of Cb */                  long sse_u;                             /* [out] SSE of Cb */
439                  long sse_v;                             /* [out] SSE of Cr */                  long sse_v;                             /* [out] SSE of Cr */
440          }                  int iblks;
441          XVID_ENC_STATS;                  int qblks;
442            } XVID_ENC_STATS;
443    
444    
445  /*****************************************************************************  /*****************************************************************************

Legend:
Removed from v.1.17.2.28  
changed lines
  Added in v.1.28.2.1

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4