672 |
|
|
673 |
bits += t = BITS_MULT*d_mv_bits(x, y, data->predMV, data->iFcode, data->qpel^data->qpel_precision, 0); |
bits += t = BITS_MULT*d_mv_bits(x, y, data->predMV, data->iFcode, data->qpel^data->qpel_precision, 0); |
674 |
|
|
675 |
|
if (data->temp[0] + t < data->iMinSAD[1]) { |
676 |
|
data->iMinSAD[1] = data->temp[0] + t; current[1].x = x; current[1].y = y; } |
677 |
|
if (data->temp[1] < data->iMinSAD[2]) { |
678 |
|
data->iMinSAD[2] = data->temp[1]; current[2].x = x; current[2].y = y; } |
679 |
|
if (data->temp[2] < data->iMinSAD[3]) { |
680 |
|
data->iMinSAD[3] = data->temp[2]; current[3].x = x; current[3].y = y; } |
681 |
|
if (data->temp[3] < data->iMinSAD[4]) { |
682 |
|
data->iMinSAD[4] = data->temp[3]; current[4].x = x; current[4].y = y; } |
683 |
|
|
684 |
|
|
685 |
bits += BITS_MULT*xvid_cbpy_tab[15-(cbp>>2)].len; |
bits += BITS_MULT*xvid_cbpy_tab[15-(cbp>>2)].len; |
686 |
|
|
687 |
if (bits >= data->iMinSAD[0]) return; |
if (bits >= data->iMinSAD[0]) return; |
709 |
*dir = Direction; |
*dir = Direction; |
710 |
} |
} |
711 |
|
|
|
if (data->temp[0] + t < data->iMinSAD[1]) { |
|
|
data->iMinSAD[1] = data->temp[0] + t; current[1].x = x; current[1].y = y; } |
|
|
if (data->temp[1] < data->iMinSAD[2]) { |
|
|
data->iMinSAD[2] = data->temp[1]; current[2].x = x; current[2].y = y; } |
|
|
if (data->temp[2] < data->iMinSAD[3]) { |
|
|
data->iMinSAD[3] = data->temp[2]; current[3].x = x; current[3].y = y; } |
|
|
if (data->temp[3] < data->iMinSAD[4]) { |
|
|
data->iMinSAD[4] = data->temp[3]; current[4].x = x; current[4].y = y; } |
|
|
|
|
712 |
} |
} |
713 |
|
|
714 |
static void |
static void |
715 |
CheckCandidateBits8(const int x, const int y, const int Direction, int * const dir, const SearchData * const data) |
CheckCandidateBits8(const int x, const int y, const int Direction, int * const dir, const SearchData * const data) |
716 |
{ |
{ |
1294 |
Data->iMinSAD[3] = pMB->sad8[2]; |
Data->iMinSAD[3] = pMB->sad8[2]; |
1295 |
Data->iMinSAD[4] = pMB->sad8[3]; |
Data->iMinSAD[4] = pMB->sad8[3]; |
1296 |
|
|
1297 |
if ((!(GlobalFlags & XVID_MODEDECISION_BITS)) || (x | y)) { |
if ((!(GlobalFlags & XVID_MODEDECISION_BITS)) && (x | y)) { |
1298 |
threshA = Data->temp[0]; // that's where we keep this SAD atm |
threshA = Data->temp[0]; // that's where we keep this SAD atm |
1299 |
if (threshA < 512) threshA = 512; |
if (threshA < 512) threshA = 512; |
1300 |
else if (threshA > 1024) threshA = 1024; |
else if (threshA > 1024) threshA = 1024; |