36 |
* support for EXTENDED API |
* support for EXTENDED API |
37 |
* - 22.08.2001 fixed bug in iDQtab |
* - 22.08.2001 fixed bug in iDQtab |
38 |
* |
* |
39 |
* $Id: encoder.h,v 1.27.2.3 2003-03-15 14:32:56 suxen_drol Exp $ |
* $Id: encoder.h,v 1.27.2.8 2003-05-18 12:33:26 edgomez Exp $ |
40 |
* |
* |
41 |
****************************************************************************/ |
****************************************************************************/ |
42 |
|
|
46 |
#include "xvid.h" |
#include "xvid.h" |
47 |
#include "portab.h" |
#include "portab.h" |
48 |
#include "global.h" |
#include "global.h" |
|
#include "utils/ratecontrol.h" |
|
49 |
|
|
50 |
/***************************************************************************** |
/***************************************************************************** |
51 |
* Constants |
* Constants |
52 |
****************************************************************************/ |
****************************************************************************/ |
53 |
|
|
|
/* Quatization type */ |
|
|
#define H263_QUANT 0 |
|
|
#define MPEG4_QUANT 1 |
|
|
|
|
|
/* Indicates no quantizer changes in INTRA_Q/INTER_Q modes */ |
|
|
#define NO_CHANGE 64 |
|
|
|
|
54 |
/***************************************************************************** |
/***************************************************************************** |
55 |
* Types |
* Types |
56 |
****************************************************************************/ |
****************************************************************************/ |
78 |
uint32_t fincr; |
uint32_t fincr; |
79 |
uint32_t fbase; |
uint32_t fbase; |
80 |
|
|
81 |
|
int profile; |
82 |
|
|
83 |
xvid_global_t global_flags; |
xvid_global_t global_flags; |
84 |
int bquant_ratio; |
int bquant_ratio; |
85 |
int bquant_offset; |
int bquant_offset; |
86 |
int frame_drop_ratio; |
int frame_drop_ratio; |
87 |
|
|
88 |
|
int min_quant[3]; |
89 |
|
int max_quant[3]; |
90 |
|
|
91 |
#ifdef _SMP |
#ifdef _SMP |
92 |
int num_threads; |
int num_threads; |
93 |
#endif |
#endif |
138 |
typedef struct |
typedef struct |
139 |
{ |
{ |
140 |
int frame_num; |
int frame_num; |
141 |
|
int fincr; |
142 |
xvid_vol_t vol_flags; |
xvid_vol_t vol_flags; |
143 |
xvid_vop_t vop_flags; |
xvid_vop_t vop_flags; |
144 |
xvid_motion_t motion_flags; |
xvid_motion_t motion_flags; |
174 |
int iFrameNum; |
int iFrameNum; |
175 |
int bitrate; |
int bitrate; |
176 |
|
|
177 |
|
// zones |
178 |
|
unsigned int num_zones; |
179 |
|
xvid_enc_zone_t * zones; |
180 |
|
|
181 |
// plugins |
// plugins |
182 |
int num_plugins; /* note: we store plugin flags in MBPARAM */ |
unsigned int num_plugins; /* note: we store plugin flags in MBPARAM */ |
183 |
xvid_enc_plugin_t * plugins; |
xvid_enc_plugin_t * plugins; |
184 |
|
|
185 |
// dquant |
// dquant |
223 |
|
|
224 |
int m_framenum; /* debug frame num counter; unlike iFrameNum, does not reset at ivop */ |
int m_framenum; /* debug frame num counter; unlike iFrameNum, does not reset at ivop */ |
225 |
|
|
|
RateControl rate_control; |
|
|
|
|
226 |
float fMvPrevSigma; |
float fMvPrevSigma; |
227 |
} |
} |
228 |
Encoder; |
Encoder; |
266 |
|
|
267 |
void init_encoder(uint32_t cpu_flags); |
void init_encoder(uint32_t cpu_flags); |
268 |
|
|
269 |
int enc_create(xvid_enc_create_t * create, xvid_enc_rc_t * rc); |
int enc_create(xvid_enc_create_t * create); |
270 |
int enc_destroy(Encoder * pEnc); |
int enc_destroy(Encoder * pEnc); |
271 |
int enc_encode(Encoder * pEnc, |
int enc_encode(Encoder * pEnc, |
272 |
xvid_enc_frame_t * pFrame, |
xvid_enc_frame_t * pFrame, |