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.16 2002-07-21 03:41:44 suxen_drol Exp $ |
* $Id: encoder.h,v 1.18.2.8 2002-12-10 11:13:50 suxen_drol 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 "image/image.h" |
|
49 |
#include "utils/ratecontrol.h" |
#include "utils/ratecontrol.h" |
50 |
|
|
51 |
/***************************************************************************** |
/***************************************************************************** |
69 |
{ |
{ |
70 |
I_VOP = 0, |
I_VOP = 0, |
71 |
P_VOP = 1, |
P_VOP = 1, |
72 |
B_VOP = 2 |
B_VOP = 2, |
73 |
|
S_VOP = 3 |
74 |
} |
} |
75 |
VOP_TYPE; |
VOP_TYPE; |
76 |
|
|
92 |
uint32_t fincr; |
uint32_t fincr; |
93 |
uint32_t fbase; |
uint32_t fbase; |
94 |
|
|
95 |
|
/* constants */ |
96 |
|
int global; |
97 |
|
int bquant_ratio; |
98 |
|
int bquant_offset; |
99 |
|
int frame_drop_ratio; |
100 |
|
|
101 |
#ifdef _SMP |
#ifdef _SMP |
102 |
int num_threads; |
int num_threads; |
103 |
#endif |
#endif |
104 |
|
|
105 |
#ifdef BFRAMES |
int iMaxKeyInterval; |
106 |
int max_bframes; |
int max_bframes; |
|
#endif |
|
107 |
|
|
108 |
/* rounding type; alternate 0-1 after each interframe */ |
/* rounding type; alternate 0-1 after each interframe */ |
109 |
/* 1 <= fixed_code <= 4 |
/* 1 <= fixed_code <= 4 |
114 |
uint32_t m_quant_type; |
uint32_t m_quant_type; |
115 |
uint32_t m_rounding_type; |
uint32_t m_rounding_type; |
116 |
uint32_t m_fcode; |
uint32_t m_fcode; |
117 |
|
uint32_t m_quarterpel; |
118 |
|
int m_reduced_resolution; /* reduced_resolution_enable */ |
119 |
|
|
120 |
HINTINFO *hint; |
HINTINFO *hint; |
121 |
|
|
122 |
#ifdef BFRAMES |
int64_t m_stamp; |
|
uint32_t m_seconds; |
|
|
uint32_t m_ticks; |
|
|
#endif |
|
|
|
|
123 |
} |
} |
124 |
MBParam; |
MBParam; |
125 |
|
|
126 |
|
|
127 |
typedef struct |
typedef struct |
128 |
{ |
{ |
129 |
|
int iTextBits; |
130 |
|
int iMvSum; |
131 |
|
int iMvCount; |
132 |
|
int kblks; |
133 |
|
int mblks; |
134 |
|
int ublks; |
135 |
|
} |
136 |
|
Statistics; |
137 |
|
|
138 |
|
|
139 |
|
typedef struct |
140 |
|
{ |
141 |
uint32_t quant; |
uint32_t quant; |
142 |
uint32_t motion_flags; |
uint32_t motion_flags; |
143 |
uint32_t global_flags; |
uint32_t global_flags; |
144 |
|
|
145 |
VOP_TYPE coding_type; |
VOP_TYPE coding_type; |
146 |
uint32_t rounding_type; |
uint32_t rounding_type; |
147 |
|
uint32_t quarterpel; |
148 |
uint32_t fcode; |
uint32_t fcode; |
149 |
uint32_t bcode; |
uint32_t bcode; |
150 |
|
|
|
#ifdef BFRAMES |
|
151 |
uint32_t seconds; |
uint32_t seconds; |
152 |
uint32_t ticks; |
uint32_t ticks; |
153 |
#endif |
int64_t stamp; |
154 |
|
|
155 |
IMAGE image; |
IMAGE image; |
156 |
|
|
157 |
MACROBLOCK *mbs; |
MACROBLOCK *mbs; |
158 |
|
VECTOR GMC_MV; |
159 |
|
|
160 |
|
Statistics sStat; |
161 |
} |
} |
162 |
FRAMEINFO; |
FRAMEINFO; |
163 |
|
|
|
typedef struct |
|
|
{ |
|
|
int iTextBits; |
|
|
float fMvPrevSigma; |
|
|
int iMvSum; |
|
|
int iMvCount; |
|
|
int kblks; |
|
|
int mblks; |
|
|
int ublks; |
|
|
} |
|
|
Statistics; |
|
|
|
|
164 |
|
|
165 |
|
|
166 |
typedef struct |
typedef struct |
168 |
MBParam mbParam; |
MBParam mbParam; |
169 |
|
|
170 |
int iFrameNum; |
int iFrameNum; |
|
int iMaxKeyInterval; |
|
171 |
int bitrate; |
int bitrate; |
172 |
|
|
173 |
// images |
// images |
184 |
IMAGE vInterHV; |
IMAGE vInterHV; |
185 |
IMAGE vInterHVf; |
IMAGE vInterHVf; |
186 |
|
|
|
#ifdef BFRAMES |
|
|
/* constants */ |
|
|
int global; |
|
|
int bquant_ratio; |
|
|
int frame_drop_ratio; |
|
|
|
|
187 |
/* image queue */ |
/* image queue */ |
188 |
int queue_head; |
int queue_head; |
189 |
int queue_tail; |
int queue_tail; |
201 |
IMAGE f_refhv; |
IMAGE f_refhv; |
202 |
int bframenum_dx50bvop; |
int bframenum_dx50bvop; |
203 |
|
|
|
int last_pframe; |
|
|
int time_pp; |
|
204 |
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 */ |
|
#endif |
|
205 |
|
|
|
Statistics sStat; |
|
206 |
RateControl rate_control; |
RateControl rate_control; |
207 |
|
|
208 |
|
float fMvPrevSigma; |
209 |
} |
} |
210 |
Encoder; |
Encoder; |
211 |
|
|