Add asm code for NoneZeroCount and refine related code

This commit is contained in:
zhiliang wang
2015-01-04 16:39:17 +08:00
parent 7d5e88ffda
commit 01b74ea7c1
12 changed files with 56 additions and 91 deletions

View File

@@ -1690,25 +1690,13 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin
}
void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_c;
#ifdef HAVE_NEON
if (iCpu & WELS_CPU_NEON) {
pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon;
}
#endif
#ifdef HAVE_NEON_AARCH64
if (iCpu & WELS_CPU_NEON) {
pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_AArch64_neon;
}
#endif
pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c;
pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c;
pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c;
//TO DO add neon and X86
pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c;
#ifdef HAVE_NEON
if (iCpu & WELS_CPU_NEON) {
pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_neon;
pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_neon;
pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_neon;
}
@@ -1716,6 +1704,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
#ifdef HAVE_NEON_AARCH64
if (iCpu & WELS_CPU_NEON) {
pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_AArch64_neon;
pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_AArch64_neon;
pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_AArch64_neon;
}
@@ -1723,6 +1712,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
#if defined(X86_ASM)
if (iCpu & WELS_CPU_SSE2) {
pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_sse2;
pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_sse2;
pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_sse2;
}
@@ -1730,14 +1720,6 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
}
void SetNonZeroCount_c (int8_t* pNonZeroCount) {
int32_t i;
for (i = 0; i < 24; i++) {
pNonZeroCount[i] = !!pNonZeroCount[i];
}
}
void WelsBlockInit (int16_t* pBlock, int iW, int iH, int iStride, uint8_t uiVal) {
int32_t i;
int16_t* pDst = pBlock;