35 |
* Constants |
* Constants |
36 |
****************************************************************************/ |
****************************************************************************/ |
37 |
|
|
38 |
|
/* lambda base exponential. 1<<LAMBDA_EXP is the neutral lambda */ |
39 |
|
#define LAMBDA_EXP 6 |
40 |
|
|
41 |
/***************************************************************************** |
/***************************************************************************** |
42 |
* Types |
* Types |
43 |
****************************************************************************/ |
****************************************************************************/ |
62 |
int plugin_flags; |
int plugin_flags; |
63 |
|
|
64 |
/* frame rate increment & base */ |
/* frame rate increment & base */ |
65 |
uint32_t fincr; |
int32_t fincr; |
66 |
uint32_t fbase; |
uint32_t fbase; |
67 |
|
|
68 |
int profile; |
int profile; |
69 |
|
|
70 |
xvid_global_t global_flags; |
int global_flags; |
71 |
int bquant_ratio; |
int bquant_ratio; |
72 |
int bquant_offset; |
int bquant_offset; |
73 |
int frame_drop_ratio; |
int frame_drop_ratio; |
75 |
int min_quant[3]; |
int min_quant[3]; |
76 |
int max_quant[3]; |
int max_quant[3]; |
77 |
|
|
78 |
#ifdef _SMP |
int par; |
79 |
int num_threads; |
int par_width; |
80 |
#endif |
int par_height; |
|
|
|
81 |
|
|
82 |
int iMaxKeyInterval; |
int iMaxKeyInterval; |
83 |
int max_bframes; |
int max_bframes; |
91 |
/* vars that not "quite" frame independant */ |
/* vars that not "quite" frame independant */ |
92 |
uint32_t m_rounding_type; |
uint32_t m_rounding_type; |
93 |
uint32_t m_fcode; |
uint32_t m_fcode; |
94 |
xvid_vol_t vol_flags; |
int vol_flags; |
95 |
|
|
96 |
int64_t m_stamp; |
int64_t m_stamp; |
97 |
} |
|
98 |
MBParam; |
uint16_t *mpeg_quant_matrices; |
99 |
|
} MBParam; |
100 |
|
|
101 |
|
|
102 |
typedef struct |
typedef struct |
108 |
int mblks; |
int mblks; |
109 |
int ublks; |
int ublks; |
110 |
int gblks; |
int gblks; |
111 |
} |
int iMVBits; |
112 |
Statistics; |
} Statistics; |
113 |
|
|
114 |
|
|
115 |
/* encoding queue */ |
/* encoding queue */ |
126 |
{ |
{ |
127 |
int frame_num; |
int frame_num; |
128 |
int fincr; |
int fincr; |
129 |
xvid_vol_t vol_flags; |
int vol_flags; |
130 |
xvid_vop_t vop_flags; |
int vop_flags; |
131 |
xvid_motion_t motion_flags; |
int motion_flags; |
132 |
|
|
133 |
int coding_type; |
int coding_type; |
134 |
uint32_t quant; |
uint32_t quant; |
151 |
int length; /* the encoded size of this frame */ |
int length; /* the encoded size of this frame */ |
152 |
|
|
153 |
Statistics sStat; |
Statistics sStat; |
154 |
} |
int is_edged, is_interpolated; |
155 |
FRAMEINFO; |
} FRAMEINFO; |
156 |
|
|
157 |
|
|
158 |
|
#include "motion/motion_smp.h" |
159 |
|
|
160 |
typedef struct |
typedef struct |
161 |
{ |
{ |
169 |
xvid_enc_zone_t * zones; |
xvid_enc_zone_t * zones; |
170 |
|
|
171 |
/* plugins */ |
/* plugins */ |
172 |
unsigned int num_plugins; /* note: we store plugin flags in MBPARAM */ |
int num_plugins; /* note: we store plugin flags in MBPARAM */ |
173 |
xvid_enc_plugin_t * plugins; |
xvid_enc_plugin_t * plugins; |
174 |
|
|
175 |
/* dquant */ |
/* dquant */ |
176 |
|
|
177 |
int * temp_dquants; |
int * temp_dquants; |
178 |
|
|
179 |
|
/* lambda */ |
180 |
|
|
181 |
|
float * temp_lambda; |
182 |
|
|
183 |
/* images */ |
/* images */ |
184 |
|
|
185 |
FRAMEINFO *current; |
FRAMEINFO *current; |
215 |
int closed_bframenum; /* == -1 if there is no fixup intended */ |
int closed_bframenum; /* == -1 if there is no fixup intended */ |
216 |
QUEUEINFO closed_qframe; /* qFrame, only valid when >= 0 */ |
QUEUEINFO closed_qframe; /* qFrame, only valid when >= 0 */ |
217 |
|
|
218 |
|
/* multithreaded stuff */ |
219 |
|
int num_threads; /* number of additional threads */ |
220 |
|
SMPmotionData * motionData; /* data structures used to pass all thread-specific data */ |
221 |
|
|
222 |
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 */ |
223 |
|
|
224 |
float fMvPrevSigma; |
float fMvPrevSigma; |
225 |
} |
} Encoder; |
|
Encoder; |
|
226 |
|
|
227 |
/***************************************************************************** |
/***************************************************************************** |
228 |
* Inline functions |
* Inline functions |