[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.27.2.1, Sat Feb 22 08:49:44 2003 UTC revision 1.27.2.6, Sat Mar 15 14:32:56 2003 UTC
# Line 26  Line 26 
26  #ifndef _XVID_H_  #ifndef _XVID_H_
27  #define _XVID_H_  #define _XVID_H_
28    
29    
30  #ifdef __cplusplus  #ifdef __cplusplus
31  extern "C" {  extern "C" {
32  #endif  #endif
# Line 254  Line 255 
255  } xvid_dec_stats_t;  } xvid_dec_stats_t;
256    
257    
258    /*****************************************************************************
259      xvid plugin system -- internals
260    
261      xvidcore will call XVID_PLG_INFO and XVID_PLG_CREATE during XVID_ENC_CREATE
262      before encoding each frame xvidcore will call XVID_PLG_BEFORE
263      after encoding each frame xvidcore will call XVID_PLG_AFTER
264      xvidcore will call XVID_PLG_DESTROY during XVID_ENC_DESTROY
265     ****************************************************************************/
266    
267    #define XVID_PLG_CREATE     0
268    #define XVID_PLG_DESTROY    1
269    #define XVID_PLG_INFO       2
270    #define XVID_PLG_BEFORE     3
271    #define XVID_PLG_AFTER      4
272    
273    /* xvid_plg_info_t.flags */
274    #define XVID_REQORIGINAL    1  /* plugin requires a copy of the original (uncompressed) image */
275    
276    
277    typedef struct
278    {
279        int version;
280        int flags;              /* plugin flags */
281    } xvid_plg_info_t;
282    
283    
284    typedef struct
285    {
286        int version;
287    
288        int width, height;
289            int fincr, fbase;
290    
291        void * param;
292    } xvid_plg_create_t;
293    
294    
295    typedef struct
296    {
297        int version;
298    
299        int width;              /* [out] */
300        int height;             /* [out] */
301            int fincr;              /* [out] */
302        int fbase;              /* [out] */
303    
304        xvid_image_t reference; /* [out] -> [out] */
305        xvid_image_t current;   /* [out] -> [in,out] */
306        xvid_image_t original;      /* [out] after: points the original (uncompressed) copy of the current frame */
307        int frame_num;          /* [out] frame number */
308    
309        int type;               /* [in,out] */
310        int quant;              /* [in,out] */
311    
312        unsigned char * qscale;     /* [in,out]     pointer to quantizer table */
313            int qscale_stride;              /* [in,out]     quantizer scale stride */
314    
315        int vop_flags;          /* [in,out] */
316        int vol_flags;          /* [in,out] */
317        int motion_flags;       /* [in,out] */
318    
319        int length;                 /* [out] after: length of encoded frame */
320        int kblks, mblks, ublks;    /* [out] after: */
321    } xvid_plg_data_t;
322    
323    
324    /*****************************************************************************
325      xvid plugin system -- external
326    
327      the application passes xvid an array of "xvid_plugin_t" at XVID_ENC_CREATE. the array
328      indicates the plugin function pointer and plugin-specific data.
329      xvidcore handles the rest. example:
330    
331      xvid_enc_create_t create;
332      xvid_enc_plugin_t plugins[2];
333    
334      plugins[0].func = xvid_psnr_func;
335      plugins[0].param = NULL;
336      plugins[1].func = xvid_cbr_func;
337      plugins[1].param = &cbr_data;
338    
339      create.num_plugins = 2;
340      create.plugins = plugins;
341    
342     ****************************************************************************/
343    
344    typedef int (xvid_plugin_func)(void * handle, int opt, void * param1, void * param2);
345    
346    typedef struct
347    {
348        xvid_plugin_func * func;
349        void * param;
350    } xvid_enc_plugin_t;
351    
352    xvid_plugin_func xvid_plugin_psnr;  /* stdout psnr calculator */
353    xvid_plugin_func xvid_plugin_dump;  /* dump before and after yuvpgms */
354    
355    
356    
357  /*****************************************************************************  /*****************************************************************************
358   * xvid_encore()   * xvid_encore()
# Line 273  Line 372 
372  {  {
373      XVID_PACKED                 = 0x00000001,   /* packed bitstream */      XVID_PACKED                 = 0x00000001,   /* packed bitstream */
374      XVID_CLOSED_GOP             = 0x00000002,   /* closed_gop:  was DX50BVOP dx50 bvop compatibility */      XVID_CLOSED_GOP             = 0x00000002,   /* closed_gop:  was DX50BVOP dx50 bvop compatibility */
     XVID_EXTRASTATS_ENABLE  = 0x00000004  
375  /*define XVID_VOL_AT_IVOP       0x00000008       write vol at every ivop: WIN32/divx compatibility */  /*define XVID_VOL_AT_IVOP       0x00000008       write vol at every ivop: WIN32/divx compatibility */
376  /*define XVID_FORCE_VOL         0x00000008       XXX: when vol-based parameters are changed, insert an ivop NOT recommended */  /*define XVID_FORCE_VOL         0x00000008       XXX: when vol-based parameters are changed, insert an ivop NOT recommended */
377  } xvid_global_t;  } xvid_global_t;
# Line 293  Line 391 
391  /* vop-based flags */  /* vop-based flags */
392  typedef enum {  typedef enum {
393      XVID_DEBUG              = 0x00000001,      XVID_DEBUG              = 0x00000001,
394      XVID_EXTRASTATS         = 0x00000002,  
395      XVID_HALFPEL            = 0x00000004, /* use halfpel interpolation */      XVID_HALFPEL            = 0x00000004, /* use halfpel interpolation */
396      XVID_INTER4V            = 0x00000008,      XVID_INTER4V            = 0x00000008,
397      XVID_LUMIMASKING        = 0x00000010,      XVID_LUMIMASKING        = 0x00000010,
# Line 356  Line 454 
454          int width;                              /* [in]         frame dimensions; width, pixel units */          int width;                              /* [in]         frame dimensions; width, pixel units */
455          int height;                             /* [in]         frame dimensions; height, pixel units */          int height;                             /* [in]         frame dimensions; height, pixel units */
456    
457        int num_plugins;        /* [in:opt] number of plugins */
458        xvid_enc_plugin_t * plugins; /*        ^^ plugin array */
459    
460          int num_threads;                /* [in:opt]     number of threads */          int num_threads;                /* [in:opt]     number of threads */
461          int max_bframes;                /* [in:opt] max sequential bframes (0=disable bframes) */          int max_bframes;                /* [in:opt] max sequential bframes (0=disable bframes) */
462    
# Line 449  Line 550 
550  /* XVID_ENC_ENCODE param2 (optional)  /* XVID_ENC_ENCODE param2 (optional)
551          xvid_enc_stats_t describes individual frame details          xvid_enc_stats_t describes individual frame details
552    
         when bframes>0, you must pass _two_ of these to xvid_encore()  
         ie. xstats[2]; xvid_encore(..., xstats)  
553          coding_type==XVID_TYPE_NOTHING if the stats are not given          coding_type==XVID_TYPE_NOTHING if the stats are not given
554  */  */
555  typedef struct {  typedef struct {
# Line 475  Line 574 
574  }  }
575  #endif  #endif
576    
577    
578  #endif  #endif

Legend:
Removed from v.1.27.2.1  
changed lines
  Added in v.1.27.2.6

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