Showing the changes to codec/decoder (4 of 12 files). Show all
Unified · Split
| @@ -99,18 +99,6 @@ · 98 unmodified lines | |||
| 99 | // } | 99 | // } |
| 100 | .endm | 100 | .endm |
| 101 | #endif | 101 | #endif |
| 102 | // r0 int8_t* non_zero_count, | ||
| 103 | WELS_ASM_FUNC_BEGIN SetNonZeroCount_neon | ||
| 104 | vld1.64 {d0-d2}, [r0] | ||
| 105 | vceq.s8 q0, q0, #0 | ||
| 106 | vceq.s8 d2, d2, #0 | ||
| 107 | vmvn q0, q0 | ||
| 108 | vmvn d2, d2 | ||
| 109 | vabs.s8 q0, q0 | ||
| 110 | vabs.s8 d2, d2 | ||
| 111 | vst1.64 {d0-d2}, [r0] | ||
| 112 | WELS_ASM_FUNC_END | ||
| 113 | |||
| 114 | 102 | ||
| 115 | // uint8_t *pred, const int32_t stride, int16_t *rs | 103 | // uint8_t *pred, const int32_t stride, int16_t *rs |
| 116 | WELS_ASM_FUNC_BEGIN IdctResAddPred_neon | 104 | WELS_ASM_FUNC_BEGIN IdctResAddPred_neon |
| @@ -100,20 +100,6 @@ · 99 unmodified lines | |||
| 100 | // } | 100 | // } |
| 101 | .endm | 101 | .endm |
| 102 | #endif | 102 | #endif |
| 103 | // x0 int8_t* non_zero_count, | ||
| 104 | WELS_ASM_AARCH64_FUNC_BEGIN SetNonZeroCount_AArch64_neon | ||
| 105 | mov x1, x0 | ||
| 106 | ld1 {v0.16b}, [x1], #16 | ||
| 107 | ld1 {v1.8b}, [x1] | ||
| 108 | cmeq v0.16b, v0.16b, #0 | ||
| 109 | cmeq v1.8b, v1.8b, #0 | ||
| 110 | mvn v0.16b, v0.16b | ||
| 111 | mvn v1.8b, v1.8b | ||
| 112 | abs v0.16b, v0.16b | ||
| 113 | abs v1.8b, v1.8b | ||
| 114 | st1 {v0.16b}, [x0], #16 | ||
| 115 | st1 {v1.8b}, [x0] | ||
| 116 | WELS_ASM_AARCH64_FUNC_END | ||
| 117 | 103 | ||
| 118 | // uint8_t *pred, const int32_t stride, int16_t *rs | 104 | // uint8_t *pred, const int32_t stride, int16_t *rs |
| 119 | WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon | 105 | WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon |
| @@ -73,13 +73,11 @@ void WelsBlockZero8x8_sse2(int16_t * block, int32_t stride); · 72 unmodified lines | |||
| 73 | #endif | 73 | #endif |
| 74 | 74 | ||
| 75 | #if defined(HAVE_NEON) | 75 | #if defined(HAVE_NEON) |
| 76 | void SetNonZeroCount_neon (int8_t* pNonZeroCount); | ||
| 77 | void WelsBlockZero16x16_neon(int16_t * block, int32_t stride); | 76 | void WelsBlockZero16x16_neon(int16_t * block, int32_t stride); |
| 78 | void WelsBlockZero8x8_neon(int16_t * block, int32_t stride); | 77 | void WelsBlockZero8x8_neon(int16_t * block, int32_t stride); |
| 79 | #endif | 78 | #endif |
| 80 | 79 | ||
| 81 | #if defined(HAVE_NEON_AARCH64) | 80 | #if defined(HAVE_NEON_AARCH64) |
| 82 | void SetNonZeroCount_AArch64_neon (int8_t* pNonZeroCount); | ||
| 83 | void WelsBlockZero16x16_AArch64_neon(int16_t * block, int32_t stride); | 81 | void WelsBlockZero16x16_AArch64_neon(int16_t * block, int32_t stride); |
| 84 | void WelsBlockZero8x8_AArch64_neon(int16_t * block, int32_t stride); | 82 | void WelsBlockZero8x8_AArch64_neon(int16_t * block, int32_t stride); |
| 85 | #endif | 83 | #endif |
| @@ -87,8 +85,6 @@ void WelsBlockZero8x8_AArch64_neon(int16_t * block, int32_t stride); · 1 unmodified line | |||
| 87 | } | 85 | } |
| 88 | #endif//__cplusplus | 86 | #endif//__cplusplus |
| 89 | 87 | ||
| 90 | void SetNonZeroCount_c (int8_t* pNonZeroCount); | ||
| 91 | |||
| 92 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu); | 88 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu); |
| 93 | void WelsBlockZero16x16_c(int16_t * block, int32_t stride); | 89 | void WelsBlockZero16x16_c(int16_t * block, int32_t stride); |
| 94 | void WelsBlockZero8x8_c(int16_t * block, int32_t stride); | 90 | void WelsBlockZero8x8_c(int16_t * block, int32_t stride); |
| @@ -1690,25 +1690,13 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 1689 unmodified lines | |||
| 1690 | } | 1690 | } |
| 1691 | 1691 | ||
| 1692 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { | 1692 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { |
| 1693 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_c; | 1693 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c; |
| 1694 | |||
| 1695 | #ifdef HAVE_NEON | ||
| 1696 | if (iCpu & WELS_CPU_NEON) { | ||
| 1697 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon; | ||
| 1698 | } | ||
| 1699 | #endif | ||
| 1700 | |||
| 1701 | #ifdef HAVE_NEON_AARCH64 | ||
| 1702 | if (iCpu & WELS_CPU_NEON) { | ||
| 1703 | pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_AArch64_neon; | ||
| 1704 | } | ||
| 1705 | #endif | ||
| 1706 | |||
| 1707 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c; | 1694 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c; |
| 1708 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c; | 1695 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c; |
| 1709 | //TO DO add neon and X86 | 1696 | |
| 1710 | #ifdef HAVE_NEON | 1697 | #ifdef HAVE_NEON |
| 1711 | if (iCpu & WELS_CPU_NEON) { | 1698 | if (iCpu & WELS_CPU_NEON) { |
| 1699 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_neon; | ||
| 1712 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_neon; | 1700 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_neon; |
| 1713 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_neon; | 1701 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_neon; |
| 1714 | } | 1702 | } |
| @@ -1716,6 +1704,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1716 | 1704 | ||
| 1717 | #ifdef HAVE_NEON_AARCH64 | 1705 | #ifdef HAVE_NEON_AARCH64 |
| 1718 | if (iCpu & WELS_CPU_NEON) { | 1706 | if (iCpu & WELS_CPU_NEON) { |
| 1707 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_AArch64_neon; | ||
| 1719 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_AArch64_neon; | 1708 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_AArch64_neon; |
| 1720 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_AArch64_neon; | 1709 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_AArch64_neon; |
| 1721 | } | 1710 | } |
| @@ -1723,6 +1712,7 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1723 | 1712 | ||
| 1724 | #if defined(X86_ASM) | 1713 | #if defined(X86_ASM) |
| 1725 | if (iCpu & WELS_CPU_SSE2) { | 1714 | if (iCpu & WELS_CPU_SSE2) { |
| 1715 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_sse2; | ||
| 1726 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_sse2; | 1716 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_sse2; |
| 1727 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_sse2; | 1717 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_sse2; |
| 1728 | } | 1718 | } |
| @@ -1730,14 +1720,6 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { · 1 unmodified line | |||
| 1730 | 1720 | ||
| 1731 | } | 1721 | } |
| 1732 | 1722 | ||
| 1733 | void SetNonZeroCount_c (int8_t* pNonZeroCount) { | ||
| 1734 | int32_t i; | ||
| 1735 | |||
| 1736 | for (i = 0; i < 24; i++) { | ||
| 1737 | pNonZeroCount[i] = !!pNonZeroCount[i]; | ||
| 1738 | } | ||
| 1739 | } | ||
| 1740 | |||
| 1741 | void WelsBlockInit (int16_t* pBlock, int iW, int iH, int iStride, uint8_t uiVal) { | 1723 | void WelsBlockInit (int16_t* pBlock, int iW, int iH, int iStride, uint8_t uiVal) { |
| 1742 | int32_t i; | 1724 | int32_t i; |
| 1743 | int16_t* pDst = pBlock; | 1725 | int16_t* pDst = pBlock; |