Add asm code for NoneZeroCount and refine related code
Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 12 files). Show all
Unified · Split
| @@ -1695,25 +1695,13 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 1694 unmodified lines | |||
| 1695 | } | 1695 | } |
| 1696 | 1696 | ||
| 1697 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { | 1697 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { |
| 1698 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_c; | 1698 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c; |
| 1699 | |||
| 1700 | #ifdef HAVE_NEON | ||
| 1701 | if (iCpu & WELS_CPU_NEON) { | ||
| 1702 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon; | ||
| 1703 | } | ||
| 1704 | #endif | ||
| 1705 | |||
| 1706 | #ifdef HAVE_NEON_AARCH64 | ||
| 1707 | if (iCpu & WELS_CPU_NEON) { | ||
| 1708 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_AArch64_neon; | ||
| 1709 | } | ||
| 1710 | #endif | ||
| 1711 | |||
| 1712 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c; | 1699 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c; |
| 1713 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c; | 1700 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c; |
| 1714 | //TO DO add neon and X86 | 1701 | |
| 1715 | #ifdef HAVE_NEON | 1702 | #ifdef HAVE_NEON |
| 1716 | if (iCpu & WELS_CPU_NEON) { | 1703 | if (iCpu & WELS_CPU_NEON) { |
| 1704 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_neon; | ||
| 1717 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_neon; | 1705 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_neon; |
| 1718 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_neon; | 1706 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_neon; |
| 1719 | } | 1707 | } |
| @@ -1721,6 +1709,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1721 | 1709 | ||
| 1722 | #ifdef HAVE_NEON_AARCH64 | 1710 | #ifdef HAVE_NEON_AARCH64 |
| 1723 | if (iCpu & WELS_CPU_NEON) { | 1711 | if (iCpu & WELS_CPU_NEON) { |
| 1712 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_AArch64_neon; | ||
| 1724 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_AArch64_neon; | 1713 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_AArch64_neon; |
| 1725 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_AArch64_neon; | 1714 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_AArch64_neon; |
| 1726 | } | 1715 | } |
| @@ -1728,6 +1717,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1728 | 1717 | ||
| 1729 | #if defined(X86_ASM) | 1718 | #if defined(X86_ASM) |
| 1730 | if (iCpu & WELS_CPU_SSE2) { | 1719 | if (iCpu & WELS_CPU_SSE2) { |
| 1720 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_sse2; | ||
| 1731 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_sse2; | 1721 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_sse2; |
| 1732 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_sse2; | 1722 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_sse2; |
| 1733 | } | 1723 | } |
| @@ -1735,14 +1725,6 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1735 | 1725 | ||
| 1736 | } | 1726 | } |
| 1737 | 1727 | ||
| 1738 | void SetNonZeroCount_c (int8_t* pNonZeroCount) { | ||
| 1739 | int32_t i; | ||
| 1740 | |||
| 1741 | for (i = 0; i < 24; i++) { | ||
| 1742 | pNonZeroCount[i] = !!pNonZeroCount[i]; | ||
| 1743 | } | ||
| 1744 | } | ||
| 1745 | |||
| 1746 | void WelsBlockInit (int16_t* pBlock, int iW, int iH, int iStride, uint8_t uiVal) { | 1728 | void WelsBlockInit (int16_t* pBlock, int iW, int iH, int iStride, uint8_t uiVal) { |
| 1747 | int32_t i; | 1729 | int32_t i; |
| 1748 | int16_t* pDst = pBlock; | 1730 | int16_t* pDst = pBlock; |