47 |
|
|
48 |
#define BITS_MULT 16 |
#define BITS_MULT 16 |
49 |
|
|
50 |
#define INITIAL_SKIP_THRESH 5 |
#define INITIAL_SKIP_THRESH 6 |
51 |
#define FINAL_SKIP_THRESH 50 |
#define FINAL_SKIP_THRESH 50 |
52 |
#define MAX_SAD00_FOR_SKIP 20 |
#define MAX_SAD00_FOR_SKIP 20 |
53 |
#define MAX_CHROMA_SAD_FOR_SKIP 22 |
#define MAX_CHROMA_SAD_FOR_SKIP 22 |
60 |
#define CHECK_CANDIDATE(X,Y,D) { \ |
#define CHECK_CANDIDATE(X,Y,D) { \ |
61 |
CheckCandidate((X),(Y), data, (D) ); } |
CheckCandidate((X),(Y), data, (D) ); } |
62 |
|
|
|
#define RRV_MV_SCALEDOWN(a) ( (a)>=0 ? (a+1)/2 : (a-1)/2 ) |
|
|
|
|
63 |
/* fast ((A)/2)*2 */ |
/* fast ((A)/2)*2 */ |
64 |
#define EVEN(A) (((A)<0?(A)+1:(A)) & ~1) |
#define EVEN(A) (((A)<0?(A)+1:(A)) & ~1) |
65 |
|
|
94 |
int qpel; /* if we're coding in qpel mode */ |
int qpel; /* if we're coding in qpel mode */ |
95 |
int qpel_precision; /* if X and Y are in qpel precision (refinement probably) */ |
int qpel_precision; /* if X and Y are in qpel precision (refinement probably) */ |
96 |
int chroma; /* should we include chroma SAD? */ |
int chroma; /* should we include chroma SAD? */ |
|
int rrv; /* are we using reduced resolution? */ |
|
97 |
|
|
98 |
/* fields for interpolate and direct modes */ |
/* fields for interpolate and direct modes */ |
99 |
const uint8_t * b_RefP[6]; /* backward reference pictures - N, V, H, HV, cU, cV */ |
const uint8_t * b_RefP[6]; /* backward reference pictures - N, V, H, HV, cU, cV */ |
100 |
VECTOR bpredMV; /* backward prediction - used interpolate mode only */ |
VECTOR bpredMV; /* backward prediction - used in Interpolate-mode search only */ |
101 |
uint32_t bFcode; /* backward fcode - used as above */ |
uint32_t bFcode; /* backward fcode - used in Interpolate-mode search only */ |
102 |
|
int b_chromaX, b_chromaY; |
103 |
|
|
104 |
/* fields for direct mode */ |
/* fields for direct mode */ |
105 |
VECTOR directmvF[4]; /* scaled reference vectors */ |
VECTOR directmvF[4]; /* scaled reference vectors */ |
106 |
VECTOR directmvB[4]; /* as above */ |
VECTOR directmvB[4]; |
107 |
const VECTOR * referencemv; /* pointer to not-scaled reference vectors */ |
const VECTOR * referencemv; /* pointer to not-scaled reference vectors */ |
108 |
|
|
109 |
/* BITS/R-D stuff */ |
/* BITS/R-D stuff */ |
113 |
unsigned int cbp[2]; /* CBP of the best vector found so far + cbp for inter4v search */ |
unsigned int cbp[2]; /* CBP of the best vector found so far + cbp for inter4v search */ |
114 |
const uint16_t * scan_table; /* current scan table */ |
const uint16_t * scan_table; /* current scan table */ |
115 |
const uint16_t * mpeg_quant_matrices; /* current MPEG quantization matrices */ |
const uint16_t * mpeg_quant_matrices; /* current MPEG quantization matrices */ |
116 |
|
int lambda[6]; /* R-D lambdas for all 6 blocks */ |
117 |
|
|
118 |
} SearchData; |
} SearchData; |
119 |
|
|
137 |
int |
int |
138 |
xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference, |
xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference, |
139 |
const int x, const int y, |
const int x, const int y, |
140 |
const uint32_t stride, const uint32_t iQuant, int rrv); |
const uint32_t stride, const uint32_t iQuant); |
141 |
|
|
142 |
#define iDiamondSize 2 |
#define iDiamondSize 2 |
143 |
typedef void |
typedef void |
147 |
MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch; |
MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch; |
148 |
|
|
149 |
void |
void |
150 |
xvid_me_SubpelRefine(SearchData * const data, CheckFunc * const CheckCandidate, int dir); |
xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir); |
151 |
|
|
152 |
void |
void |
153 |
FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction); |
FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction); |
180 |
const IMAGE * const vGMC, |
const IMAGE * const vGMC, |
181 |
const int coding_type); |
const int coding_type); |
182 |
|
|
183 |
|
void |
184 |
|
ModeDecision_BVOP_RD(SearchData * const Data_d, |
185 |
|
SearchData * const Data_b, |
186 |
|
SearchData * const Data_f, |
187 |
|
SearchData * const Data_i, |
188 |
|
MACROBLOCK * const pMB, |
189 |
|
const MACROBLOCK * const b_mb, |
190 |
|
VECTOR * f_predMV, |
191 |
|
VECTOR * b_predMV, |
192 |
|
const uint32_t MotionFlags, |
193 |
|
const MBParam * const pParam, |
194 |
|
int x, int y); |
195 |
|
|
196 |
|
|
197 |
#endif /* _ESTIMATION_H_ */ |
#endif /* _ESTIMATION_H_ */ |