Remove a duplicate median function

The decoder used WelsMedian while the encoder used WELS_MEDIAN.
The former has two different implementations, WELS_MEDIAN was
identical to the disabled version of WelsMedian.

Settle on using the same implementation for both decoder and
encoder - whichever version of the implementations is faster
should be used for both.
This commit is contained in:
Martin Storsjö 2014-01-24 15:42:28 +02:00
parent 95ed830342
commit 89f2c8bf7c
3 changed files with 4 additions and 12 deletions

View File

@ -276,14 +276,6 @@ return x;
#define BUTTERFLY4x8(dw) (((uint64_t)(dw)<<32) | (dw))
#endif//BUTTERFLY4x8
static inline int32_t WELS_MEDIAN (int32_t x, int32_t y, int32_t z) {
int32_t t = (x - y) & ((x - y) >> 31);
x -= t;
y += t;
y -= (y - z) & ((y - z) >> 31);
y += (x - y) & ((x - y) >> 31);
return y;
}
static inline BOOL_T WELS_POWER2_IF (uint32_t v) {
return (v && ! (v & (v - 1)));
}

View File

@ -873,7 +873,7 @@ void PredictSad (int8_t* pRefIndexCache, int32_t* pSadCostCache, int32_t uiRef,
*pSadPred = iSadC;
break;
default:
*pSadPred = WELS_MEDIAN (kiSadA, kiSadB, iSadC);
*pSadPred = WelsMedian (kiSadA, kiSadB, iSadC);
break;
}
}
@ -920,7 +920,7 @@ void PredictSadSkip (int8_t* pRefIndexCache, bool_t* pMbSkipCache, int32_t* pSad
*iSadPredSkip = iSadC;
break;
default:
*iSadPredSkip = WELS_MEDIAN (kiSadA, kiSadB, iSadC);
*iSadPredSkip = WelsMedian (kiSadA, kiSadB, iSadC);
break;
}
}

View File

@ -83,8 +83,8 @@ void PredMv (const SMVComponentUnit* kpMvComp, int8_t iPartIdx, int8_t iPartW, i
*sMvp = sMvC;
break;
default:
sMvp->iMvX = WELS_MEDIAN (sMvA.iMvX, sMvB.iMvX, sMvC.iMvX);
sMvp->iMvY = WELS_MEDIAN (sMvA.iMvY, sMvB.iMvY, sMvC.iMvY);
sMvp->iMvX = WelsMedian (sMvA.iMvX, sMvB.iMvX, sMvC.iMvX);
sMvp->iMvY = WelsMedian (sMvA.iMvY, sMvB.iMvY, sMvC.iMvY);
break;
}
}