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

Diff of /xvidcore/src/divx4.h

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

revision 1.1, Fri Mar 8 02:44:30 2002 UTC revision 1.4, Tue Nov 26 23:44:09 2002 UTC
# Line 2  Line 2 
2  #define _DIVX4_H_  #define _DIVX4_H_
3    
4  #ifdef __cplusplus  #ifdef __cplusplus
5  extern "C" {  extern "C"
6    {
7  #endif  #endif
8    
9  #if ((! defined(ARCH_IS_BIG_ENDIAN)) && (! defined (WIN32)) && (! defined (LINUX)) )  #if ((! defined(ARCH_IS_BIG_ENDIAN)) && (! defined (WIN32)) && (! defined (LINUX)) && (! defined (BEOS)))
10  #define ARCH_IS_BIG_ENDIAN  #define ARCH_IS_BIG_ENDIAN
11  #endif  #endif
12    
# Line 61  Line 62 
62          void *v;          void *v;
63          int stride_y;          int stride_y;
64          int stride_uv;          int stride_uv;
65  } DEC_PICTURE;          }
66            DEC_PICTURE;
67    
68  typedef struct  typedef struct
69  {  {
# Line 73  Line 75 
75          unsigned long mp4_tables_size;          unsigned long mp4_tables_size;
76          unsigned long mp4_stream_size;          unsigned long mp4_stream_size;
77          unsigned long mp4_reference_size;          unsigned long mp4_reference_size;
78  } DEC_MEM_REQS;          }
79            DEC_MEM_REQS;
80    
81  typedef struct  typedef struct
82  {  {
# Line 85  Line 88 
88          void * mp4_tables;          void * mp4_tables;
89          void * mp4_stream;          void * mp4_stream;
90          void * mp4_reference;          void * mp4_reference;
91  } DEC_BUFFERS;          }
92            DEC_BUFFERS;
93    
94  typedef struct  typedef struct
95  {  {
# Line 94  Line 98 
98          int output_format;          int output_format;
99          int time_incr;          int time_incr;
100          DEC_BUFFERS buffers;          DEC_BUFFERS buffers;
101  } DEC_PARAM;          }
102            DEC_PARAM;
103    
104  typedef struct  typedef struct
105  {  {
# Line 103  Line 108 
108          long length; /* length of bitstream */          long length; /* length of bitstream */
109          int render_flag;          int render_flag;
110          unsigned int stride;          unsigned int stride;
111  } DEC_FRAME;          }
112            DEC_FRAME;
113    
114  typedef struct  typedef struct
115  {  {
116          int intra;          int intra;
117          int *quant_store;          int *quant_store;
118          int quant_stride;          int quant_stride;
119  } DEC_FRAME_INFO;          }
120            DEC_FRAME_INFO;
121    
122  /* configure postprocessing */  /* configure postprocessing */
123  typedef struct  typedef struct
124  {  {
125          int postproc_level; /* ranging from 0 to 100 */          int postproc_level; /* ranging from 0 to 100 */
126  } DEC_SET;          }
127            DEC_SET;
128    
129  int decore( unsigned long handle, unsigned long dec_opt, void* param1, void* param2);          int decore(unsigned long handle,
130                               unsigned long dec_opt,
131                               void *param1,
132                               void *param2);
133    
134    
135    
# Line 137  Line 148 
148  **/  **/
149  typedef struct _ENC_PARAM_  typedef struct _ENC_PARAM_
150  {  {
151          int x_dim;              // the x dimension of the frames to be encoded                  int x_dim;                              /* the x dimension of the frames to be encoded */
152          int y_dim;              // the y dimension of the frames to be encoded                  int y_dim;                              /* the y dimension of the frames to be encoded */
153          float framerate;        // the frame rate of the sequence to be encoded, in frames/second                  float framerate;                /* the frame rate of the sequence to be encoded, in frames/second */
154          int bitrate;            // the bitrate of the target encoded stream, in bits/second                  int bitrate;                    /* the bitrate of the target encoded stream, in bits/second */
155          int rc_period;          // the intended rate control averaging period                  int rc_period;                  /* the intended rate control averaging period */
156          int rc_reaction_period; // the reaction period for rate control                  int rc_reaction_period; /* the reaction period for rate control */
157          int rc_reaction_ratio;  // the ratio for down/up rate control                  int rc_reaction_ratio;  /* the ratio for down/up rate control */
158          int max_quantizer;      // the upper limit of the quantizer                  int max_quantizer;              /* the upper limit of the quantizer */
159          int min_quantizer;      // the lower limit of the quantizer                  int min_quantizer;              /* the lower limit of the quantizer */
160          int max_key_interval;   // the maximum interval between key frames                  int max_key_interval;   /* the maximum interval between key frames */
161          int use_bidirect;       // use bidirectional coding                  int use_bidirect;               /* use bidirectional coding */
162          int deinterlace;        // fast deinterlace                  int deinterlace;                /* fast deinterlace */
163          int quality;            // the quality of compression ( 1 - fastest, 5 - best )                  int quality;                    /* the quality of compression ( 1 - fastest, 5 - best ) */
164          int obmc;                       // flag to enable overlapped block motion compensation mode                  int obmc;                               /* flag to enable overlapped block motion compensation mode */
165          void *handle;           // will be filled by encore                  void *handle;                   /* will be filled by encore */
166  }  }
167  ENC_PARAM;  ENC_PARAM;
168    
169    
170  // encore2  /* encore2 */
171    
172    
173  /**  /**
# Line 172  Line 183 
183  **/  **/
184  typedef struct _ENC_FRAME_  typedef struct _ENC_FRAME_
185  {  {
186      void *image;        // the image frame to be encoded                  void *image;                    /* the image frame to be encoded */
187      void *bitstream;    // the buffer for encoded bitstream                  void *bitstream;                /* the buffer for encoded bitstream */
188      int length;         // the length of the encoded bitstream                  int length;                             /* the length of the encoded bitstream */
189      int colorspace;     // the format of image frame                  int colorspace;                 /* the format of image frame */
190      int quant;          // quantizer for this frame; only used in VBR modes                  int quant;                              /* quantizer for this frame; only used in VBR modes */
191      int intra;          // force this frame to be intra/inter; only used in VBR 2-pass                  int intra;                              /* force this frame to be intra/inter; only used in VBR 2-pass */
192      void *mvs;          // optional pointer to array of motion vectors                  void *mvs;                              /* optional pointer to array of motion vectors */
193  }  }
194  ENC_FRAME;  ENC_FRAME;
195    
# Line 189  Line 200 
200  **/  **/
201      typedef struct _ENC_RESULT_      typedef struct _ENC_RESULT_
202      {      {
203          int is_key_frame;       // the current frame is encoded as a key frame                  int is_key_frame;               /* the current frame is encoded as a key frame */
204          int quantizer;          // the quantizer used for this frame                  int quantizer;                  /* the quantizer used for this frame */
205          int texture_bits;       // amount of bits spent on coding DCT coeffs                  int texture_bits;               /* amount of bits spent on coding DCT coeffs */
206          int motion_bits;        // amount of bits spend on coding motion                  int motion_bits;                /* amount of bits spend on coding motion */
207          int total_bits;         // sum of two previous fields                  int total_bits;                 /* sum of two previous fields */
208      }      }
209      ENC_RESULT;      ENC_RESULT;
210    
211  // the prototype of the encore() - main encode engine entrance  /* the prototype of the encore() - main encode engine entrance */
212  int encore(void *handle,        // handle               - the handle of the calling entity, must be unique          int encore(void *handle,        /* handle               - the handle of the calling entity, must be unique */
213                 int enc_opt,     // enc_opt              - the option for encoding, see below  
214                 void *param1,    // param1               - the parameter 1 (its actually meaning depends on enc_opt                             int enc_opt,         /* enc_opt              - the option for encoding, see below */
215                 void *param2);   // param2               - the parameter 2 (its actually meaning depends on enc_opt  
216                               void *param1,        /* param1               - the parameter 1 (its actually meaning depends on enc_opt */
217  // encore options (the enc_opt parameter of encore())  
218  #define ENC_OPT_INIT    0       // initialize the encoder, return a handle                             void *param2);       /* param2               - the parameter 2 (its actually meaning depends on enc_opt */
219  #define ENC_OPT_RELEASE 1       // release all the resource associated with the handle  
220  #define ENC_OPT_ENCODE  2       // encode a single frame  /* encore options (the enc_opt parameter of encore()) */
221  #define ENC_OPT_ENCODE_VBR 3    // encode a single frame, not using internal rate control algorithm  #define ENC_OPT_INIT    0               /* initialize the encoder, return a handle */
222    #define ENC_OPT_RELEASE 1               /* release all the resource associated with the handle */
223    #define ENC_OPT_ENCODE  2               /* encode a single frame */
224    #define ENC_OPT_ENCODE_VBR 3    /* encode a single frame, not using internal rate control algorithm */
225  #define ENC_OPT_VERSION 4  #define ENC_OPT_VERSION 4
226    
227  #define ENCORE_VERSION          20010807  #define ENCORE_VERSION          20010807
228    
229    
230    
231  // return code of encore()  /* return code of encore() */
232  #define ENC_FAIL                -1  #define ENC_FAIL                -1
233  #define ENC_OK                  0  #define ENC_OK                  0
234  #define ENC_MEMORY              1  #define ENC_MEMORY              1
# Line 244  Line 258 
258  }  }
259  #endif  #endif
260    
261  #endif // _DIVX4_H_  #endif                                                  /* _DIVX4_H_ */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

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