38 |
#define INTRA_THRESH2 90 |
#define INTRA_THRESH2 90 |
39 |
|
|
40 |
static void |
static void |
41 |
CheckCandidate32I(const int x, const int y, const SearchData * const data, const unsigned int Direction) |
CheckCandidate32I(const int x, const int y, SearchData * const data, const unsigned int Direction) |
42 |
{ |
{ |
43 |
/* maximum speed */ |
/* maximum speed */ |
44 |
int32_t sad; |
int32_t sad; |
52 |
if (sad < *(data->iMinSAD)) { |
if (sad < *(data->iMinSAD)) { |
53 |
*(data->iMinSAD) = sad; |
*(data->iMinSAD) = sad; |
54 |
data->currentMV[0].x = x; data->currentMV[0].y = y; |
data->currentMV[0].x = x; data->currentMV[0].y = y; |
55 |
*data->dir = Direction; |
data->dir = Direction; |
56 |
} |
} |
57 |
if (data->temp[0] < data->iMinSAD[1]) { |
if (data->temp[0] < data->iMinSAD[1]) { |
58 |
data->iMinSAD[1] = data->temp[0]; data->currentMV[1].x = x; data->currentMV[1].y = y; } |
data->iMinSAD[1] = data->temp[0]; data->currentMV[1].x = x; data->currentMV[1].y = y; } |
115 |
CheckCandidate32I(pmv[2].x, pmv[2].y, Data, 2); |
CheckCandidate32I(pmv[2].x, pmv[2].y, Data, 2); |
116 |
|
|
117 |
if (*Data->iMinSAD > 500) { /* diamond only if needed */ |
if (*Data->iMinSAD > 500) { /* diamond only if needed */ |
118 |
unsigned int mask = make_mask(pmv, 3, *Data->dir); |
unsigned int mask = make_mask(pmv, 3, Data->dir); |
119 |
xvid_me_DiamondSearch(Data->currentMV->x, Data->currentMV->y, Data, mask, CheckCandidate32I); |
xvid_me_DiamondSearch(Data->currentMV->x, Data->currentMV->y, Data, mask, CheckCandidate32I); |
120 |
} else simplicity++; |
} else simplicity++; |
121 |
|
|
151 |
int blocks = 10; |
int blocks = 10; |
152 |
int complexity = 0; |
int complexity = 0; |
153 |
|
|
|
int32_t iMinSAD[5], temp[5]; |
|
|
uint32_t dir; |
|
|
VECTOR currentMV[5]; |
|
154 |
SearchData Data; |
SearchData Data; |
155 |
Data.iEdgedWidth = pParam->edged_width; |
Data.iEdgedWidth = pParam->edged_width; |
|
Data.currentMV = currentMV; |
|
|
Data.iMinSAD = iMinSAD; |
|
156 |
Data.iFcode = Current->fcode; |
Data.iFcode = Current->fcode; |
|
Data.temp = temp; |
|
|
Data.dir = &dir; |
|
157 |
Data.qpel = (pParam->vol_flags & XVID_VOL_QUARTERPEL)? 1: 0; |
Data.qpel = (pParam->vol_flags & XVID_VOL_QUARTERPEL)? 1: 0; |
158 |
Data.qpel_precision = 0; |
Data.qpel_precision = 0; |
159 |
|
|