ref: 130c682c29d6a5767770322f2d958357eb19380e
parent: 586d0ba3dca36b97bebaa11bfeb9fc1be7a78df0
author: Martin Storsjö <martin@martin.st>
date: Sun Jun 29 12:34:40 EDT 2014
Avoid intermediate function pointers for some function pointers that are never overridden These are only used in the leaf C versions of functions anyway.
--- a/codec/encoder/core/src/mc.cpp
+++ b/codec/encoder/core/src/mc.cpp
@@ -81,14 +81,6 @@
{4, 4, 28, 28}, {3, 5, 21, 35}, {2, 6, 14, 42}, {1, 7, 7, 49}
}
};
-typedef int32_t (*VerFilterFunc) (const uint8_t* pSrc, const int32_t kiSrcStride);
-typedef int32_t (*HorFilterFunc) (const uint8_t* pSrc);
-typedef int32_t (*HorFilterFuncInput16Bits) (int16_t* pSrc);
-
-VerFilterFunc fpVerFilter = NULL;
-HorFilterFunc fpHorFilter = NULL;
-HorFilterFuncInput16Bits fpHorFilterInput16Bits = NULL;
-
typedef void (*WelsMcFunc0) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int32_t iHeight);
typedef void (*WelsMcFunc1) (uint8_t* pDst, int32_t iDstStride, const uint8_t* psrcA, int32_t iSrcAStride,
@@ -194,7 +186,7 @@
int32_t i, j;
for (i = 0; i < iHeight; i++) {
for (j = 0; j < 16; j++) {
- pDst[j] = WelsClip1 ((fpHorFilter (pSrc + j) + 16) >> 5);
+ pDst[j] = WelsClip1 ((HorFilter_c (pSrc + j) + 16) >> 5);
}
pDst += iDstStride;
pSrc += iSrcStride;
@@ -206,7 +198,7 @@
int32_t i, j;
for (i = 0; i < iHeight; i++) {
for (j = 0; j < 16; j++) {
- pDst[j] = WelsClip1 ((fpVerFilter (pSrc + j, iSrcStride) + 16) >> 5);
+ pDst[j] = WelsClip1 ((VerFilter_c (pSrc + j, iSrcStride) + 16) >> 5);
}
pDst += iDstStride;
pSrc += iSrcStride;
@@ -220,10 +212,10 @@
for (i = 0; i < iHeight; i++) {
for (j = 0; j < 16 + 5; j++) {
- pTmp[j] = fpVerFilter (pSrc - 2 + j, iSrcStride);
+ pTmp[j] = VerFilter_c (pSrc - 2 + j, iSrcStride);
}
for (k = 0; k < 16; k++) {
- pDst[k] = WelsClip1 ((fpHorFilterInput16Bits (&pTmp[2 + k]) + 512) >> 10);
+ pDst[k] = WelsClip1 ((HorFilterInput16bit1_c (&pTmp[2 + k]) + 512) >> 10);
}
pSrc += iSrcStride;
pDst += iDstStride;
@@ -331,7 +323,7 @@
int32_t i, j;
for (i = 0; i < iHeight; i++) {
for (j = 0; j < iWidth; j++) {
- pDst[j] = WelsClip1 ((fpHorFilter (pSrc + j) + 16) >> 5);
+ pDst[j] = WelsClip1 ((HorFilter_c (pSrc + j) + 16) >> 5);
}
pDst += iDstStride;
pSrc += iSrcStride;
@@ -344,7 +336,7 @@
int32_t i, j;
for (i = 0; i < iHeight; i++) {
for (j = 0; j < iWidth; j++) {
- pDst[j] = WelsClip1 ((fpVerFilter (pSrc + j, iSrcStride) + 16) >> 5);
+ pDst[j] = WelsClip1 ((VerFilter_c (pSrc + j, iSrcStride) + 16) >> 5);
}
pDst += iDstStride;
pSrc += iSrcStride;
@@ -359,10 +351,10 @@
for (i = 0; i < iHeight; i++) {
for (j = 0; j < iWidth + 5; j++) {
- pTmp[j] = fpVerFilter (pSrc - 2 + j, iSrcStride);
+ pTmp[j] = VerFilter_c (pSrc - 2 + j, iSrcStride);
}
for (k = 0; k < iWidth; k++) {
- pDst[k] = WelsClip1 ((fpHorFilterInput16Bits (&pTmp[2 + k]) + 512) >> 10);
+ pDst[k] = WelsClip1 ((HorFilterInput16bit1_c (&pTmp[2 + k]) + 512) >> 10);
}
pSrc += iSrcStride;
pDst += iDstStride;
@@ -713,9 +705,6 @@
pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22_c;
memcpy (pFuncList->sMcFuncs.pfSampleAveraging, pfPixAvgFunc, sizeof (pfPixAvgFunc));
pFuncList->sMcFuncs.pfChromaMc = McChroma_c;
- fpVerFilter = VerFilter_c;
- fpHorFilter = HorFilter_c;
- fpHorFilterInput16Bits = HorFilterInput16bit1_c;
McCopyWidthEq4 = McCopyWidthEq4_c;
McCopyWidthEq8 = McCopyWidthEq8_c;
McCopyWidthEq16 = McCopyWidthEq16_c;