ref: 89f2c8bf7cd5c7396b4b2f1dab315c36243c4941
parent: 95ed8303421497b4d65c9dca0b6fabe870128667
author: Martin Storsjö <[email protected]>
date: Fri Jan 24 10:42:28 EST 2014
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.
--- a/codec/common/macros.h
+++ b/codec/common/macros.h
@@ -276,14 +276,6 @@
#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)));
}
--- a/codec/encoder/core/src/md.cpp
+++ b/codec/encoder/core/src/md.cpp
@@ -873,7 +873,7 @@
*pSadPred = iSadC;
break;
default:
- *pSadPred = WELS_MEDIAN (kiSadA, kiSadB, iSadC);
+ *pSadPred = WelsMedian (kiSadA, kiSadB, iSadC);
break;
}
}
@@ -920,7 +920,7 @@
*iSadPredSkip = iSadC;
break;
default:
- *iSadPredSkip = WELS_MEDIAN (kiSadA, kiSadB, iSadC);
+ *iSadPredSkip = WelsMedian (kiSadA, kiSadB, iSadC);
break;
}
}
--- a/codec/encoder/core/src/mv_pred.cpp
+++ b/codec/encoder/core/src/mv_pred.cpp
@@ -83,8 +83,8 @@
*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;
}
}