525 |
{ |
{ |
526 |
int k; |
int k; |
527 |
|
|
528 |
|
pMB->mode = MODE_DIRECT; /* just to initialize it */ |
529 |
|
|
530 |
if (!Data->chroma) { |
if (!Data->chroma) { |
531 |
int dx = 0, dy = 0, b_dx = 0, b_dy = 0; |
int dx = 0, dy = 0, b_dx = 0, b_dy = 0; |
532 |
int32_t sum; |
int32_t sum; |
558 |
stride); |
stride); |
559 |
|
|
560 |
if (sum >= MAX_CHROMA_SAD_FOR_SKIP * (int)Data->iQuant) return; /* no skip */ |
if (sum >= MAX_CHROMA_SAD_FOR_SKIP * (int)Data->iQuant) return; /* no skip */ |
561 |
|
} else { |
562 |
|
int sum = Data->chromaSAD; /* chroma-sad SAD caching keeps it there */ |
563 |
|
|
564 |
|
if (sum >= MAX_CHROMA_SAD_FOR_SKIP * (int)Data->iQuant) return; /* no skip */ |
565 |
} |
} |
566 |
|
|
567 |
/* skip */ |
/* skip */ |
972 |
for (i = 0; i < pParam->mb_width; i++) { |
for (i = 0; i < pParam->mb_width; i++) { |
973 |
MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width; |
MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width; |
974 |
const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width; |
const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width; |
|
int interpol_search = 0; |
|
|
int bf_search = 0; |
|
|
int bf_thresh = 0; |
|
975 |
pMB->mode = -1; |
pMB->mode = -1; |
976 |
|
|
977 |
initialize_searchData(&Data_d, &Data_f, &Data_b, &Data_i, |
initialize_searchData(&Data_d, &Data_f, &Data_b, &Data_i, |
1015 |
SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad, |
SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad, |
1016 |
&Data_i, Data_f.currentMV[0], Data_b.currentMV[0]); |
&Data_i, Data_f.currentMV[0], Data_b.currentMV[0]); |
1017 |
|
|
1018 |
if (((Data_i.iMinSAD[0] < 2*best_sad+2000) && (!(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE)) |
if (((Data_i.iMinSAD[0] < 2*best_sad+2000) && !(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE)) |
1019 |
|| Data_i.iMinSAD[0] <= best_sad)) |
|| Data_i.iMinSAD[0] <= best_sad) |
1020 |
|
|
1021 |
SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); |
SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); |
1022 |
|
|