141 |
static const VECTOR zeroMV = { 0, 0 }; |
static const VECTOR zeroMV = { 0, 0 }; |
142 |
VECTOR predMV; |
VECTOR predMV; |
143 |
|
|
144 |
int32_t x, y; |
uint32_t x, y; |
145 |
int32_t iIntra = 0; |
uint32_t iIntra = 0; |
146 |
VECTOR pmv; |
VECTOR pmv; |
147 |
|
|
148 |
if (sadInit) |
if (sadInit) |
693 |
const uint8_t * const cur, |
const uint8_t * const cur, |
694 |
const int x, |
const int x, |
695 |
const int y, |
const int y, |
696 |
int start_x, |
const int start_xi, |
697 |
int start_y, |
const int start_yi, |
698 |
int iMinSAD, |
int iMinSAD, |
699 |
VECTOR * const currMV, |
VECTOR * const currMV, |
700 |
const int center_x, |
const int center_x, |
711 |
{ |
{ |
712 |
|
|
713 |
int32_t iSAD; |
int32_t iSAD; |
714 |
|
int start_x = start_xi, start_y = start_yi; |
715 |
|
|
716 |
/* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */ |
/* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */ |
717 |
|
|
902 |
} |
} |
903 |
|
|
904 |
int32_t |
int32_t |
905 |
Diamond16_InterpolMainSearch( |
Diamond16_InterpolMainSearch(const uint8_t * const f_pRef, |
|
const uint8_t * const f_pRef, |
|
906 |
const uint8_t * const f_pRefH, |
const uint8_t * const f_pRefH, |
907 |
const uint8_t * const f_pRefV, |
const uint8_t * const f_pRefV, |
908 |
const uint8_t * const f_pRefHV, |
const uint8_t * const f_pRefHV, |
1098 |
const uint8_t * const cur, |
const uint8_t * const cur, |
1099 |
const int x, |
const int x, |
1100 |
const int y, |
const int y, |
1101 |
int start_x, |
const int start_xi, |
1102 |
int start_y, |
const int start_yi, |
1103 |
int iMinSAD, |
int iMinSAD, |
1104 |
VECTOR * const currMV, |
VECTOR * const currMV, |
1105 |
const int center_x, |
const int center_x, |
1116 |
{ |
{ |
1117 |
|
|
1118 |
int32_t iSAD; |
int32_t iSAD; |
1119 |
|
int start_x = start_xi, start_y = start_yi; |
1120 |
|
|
1121 |
/* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */ |
/* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */ |
1122 |
|
|
1453 |
if ((iMinSAD < 256) || |
if ((iMinSAD < 256) || |
1454 |
((MVequal(*currMV, prevMB->mvs[0])) && |
((MVequal(*currMV, prevMB->mvs[0])) && |
1455 |
((int32_t) iMinSAD < prevMB->sad16))) { |
((int32_t) iMinSAD < prevMB->sad16))) { |
1456 |
if (iMinSAD < 2 * iQuant) // high chances for SKIP-mode |
if (iMinSAD < (int)(2 * iQuant)) // high chances for SKIP-mode |
1457 |
{ |
{ |
1458 |
if (!MVzero(*currMV)) { |
if (!MVzero(*currMV)) { |
1459 |
iMinSAD += MV16_00_BIAS; |
iMinSAD += MV16_00_BIAS; |
1658 |
const uint8_t * const cur, |
const uint8_t * const cur, |
1659 |
const int x, |
const int x, |
1660 |
const int y, |
const int y, |
1661 |
int32_t start_x, |
const int32_t start_x, |
1662 |
int32_t start_y, |
const int32_t start_y, |
1663 |
int32_t iMinSAD, |
int32_t iMinSAD, |
1664 |
VECTOR * const currMV, |
VECTOR * const currMV, |
1665 |
const int center_x, |
const int center_x, |
1728 |
const uint8_t * const cur, |
const uint8_t * const cur, |
1729 |
const int x, |
const int x, |
1730 |
const int y, |
const int y, |
1731 |
int32_t start_x, |
const int32_t start_x, |
1732 |
int32_t start_y, |
const int32_t start_y, |
1733 |
int32_t iMinSAD, |
int32_t iMinSAD, |
1734 |
VECTOR * const currMV, |
VECTOR * const currMV, |
1735 |
const int center_x, |
const int center_x, |
2832 |
|
|
2833 |
MainSearch16FuncPtr MainSearchPtr; |
MainSearch16FuncPtr MainSearchPtr; |
2834 |
|
|
2835 |
const MACROBLOCK *const prevMB = prevMBs + x + y * iWcount; |
MACROBLOCK *const prevMB = (MACROBLOCK *const)prevMBs + x + y * iWcount; |
2836 |
MACROBLOCK *const pMB = pMBs + x + y * iWcount; |
MACROBLOCK *const pMB = (MACROBLOCK *const)(pMBs + x + y * iWcount); |
2837 |
|
|
2838 |
int32_t threshA, threshB; |
int32_t threshA, threshB; |
2839 |
int32_t bPredEq; |
int32_t bPredEq; |
2903 |
if ((iMinSAD < 256) || |
if ((iMinSAD < 256) || |
2904 |
((MVequal(*currMV, prevMB->i_mvs[0])) && |
((MVequal(*currMV, prevMB->i_mvs[0])) && |
2905 |
((int32_t) iMinSAD < prevMB->i_sad16))) { |
((int32_t) iMinSAD < prevMB->i_sad16))) { |
2906 |
if (iMinSAD < 2 * iQuant) // high chances for SKIP-mode |
if (iMinSAD < (int)(2 * iQuant)) // high chances for SKIP-mode |
2907 |
{ |
{ |
2908 |
if (!MVzero(*currMV)) { |
if (!MVzero(*currMV)) { |
2909 |
iMinSAD += MV16_00_BIAS; |
iMinSAD += MV16_00_BIAS; |
3072 |
|
|
3073 |
pmv[0] = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0); // get _REAL_ prediction (halfpel possible) |
pmv[0] = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0); // get _REAL_ prediction (halfpel possible) |
3074 |
|
|
|
PMVfastInt16_Terminate_without_Refine: |
|
3075 |
currPMV->x = currMV->x - center_x; |
currPMV->x = currMV->x - center_x; |
3076 |
currPMV->y = currMV->y - center_y; |
currPMV->y = currMV->y - center_y; |
3077 |
return iMinSAD; |
return iMinSAD; |