Showing the changes to codec/processing/src/downsample (3 of 6 files). Show all
Unified · Split
| @@ -85,6 +85,17 @@ void CDownsampling::InitDownsampleFuncs (SDownsampleFuncs& sDownsampleFunc, int · 84 unmodified lines | ||
| 85 | 85 | sDownsampleFunc.pfGeneralRatioLuma = GeneralBilinearAccurateDownsamplerWrap_neon; |
| 86 | 86 | } |
| 87 | 87 | #endif |
| 88 | + | |
| 89 | +#if defined(HAVE_NEON_AARCH64) | |
| 90 | + if (iCpuFlag & WELS_CPU_NEON) { | |
| 91 | + sDownsampleFunc.pfHalfAverage[0] = DyadicBilinearDownsamplerWidthx32_AArch64_neon; | |
| 92 | + sDownsampleFunc.pfHalfAverage[1] = DyadicBilinearDownsampler_AArch64_neon; | |
| 93 | + sDownsampleFunc.pfHalfAverage[2] = DyadicBilinearDownsampler_AArch64_neon; | |
| 94 | + sDownsampleFunc.pfHalfAverage[3] = DyadicBilinearDownsampler_AArch64_neon; | |
| 95 | + sDownsampleFunc.pfGeneralRatioChroma = GeneralBilinearAccurateDownsamplerWrap_AArch64_neon; | |
| 96 | + sDownsampleFunc.pfGeneralRatioLuma = GeneralBilinearAccurateDownsamplerWrap_AArch64_neon; | |
| 97 | + } | |
| 98 | +#endif | |
| 88 | 99 | } |
| 89 | 100 | |
| 90 | 101 | EResult CDownsampling::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pDstPixMap) { |
| @@ -120,6 +120,21 @@ void GeneralBilinearAccurateDownsampler_neon (uint8_t* pDst, const int32_t kiDst · 119 unmodified lines | ||
| 120 | 120 | WELSVP_EXTERN_C_END |
| 121 | 121 | #endif |
| 122 | 122 | |
| 123 | +#ifdef HAVE_NEON_AARCH64 | |
| 124 | +WELSVP_EXTERN_C_BEGIN | |
| 125 | +// iSrcWidth no limitation | |
| 126 | +HalveDownsampleFunc DyadicBilinearDownsampler_AArch64_neon; | |
| 127 | +// iSrcWidth = x32 pixels | |
| 128 | +HalveDownsampleFunc DyadicBilinearDownsamplerWidthx32_AArch64_neon; | |
| 129 | + | |
| 130 | +GeneralDownsampleFunc GeneralBilinearAccurateDownsamplerWrap_AArch64_neon; | |
| 131 | + | |
| 132 | +void GeneralBilinearAccurateDownsampler_AArch64_neon (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight, | |
| 133 | + uint8_t* pSrc, const int32_t kiSrcStride, const uint32_t kuiScaleX, const uint32_t kuiScaleY); | |
| 134 | + | |
| 135 | +WELSVP_EXTERN_C_END | |
| 136 | +#endif | |
| 137 | + | |
| 123 | 138 | |
| 124 | 139 | class CDownsampling : public IStrategy { |
| 125 | 140 | public: |
| @@ -241,4 +241,15 @@ void GeneralBilinearAccurateDownsamplerWrap_neon (uint8_t* pDst, const int32_t k · 240 unmodified lines | ||
| 241 | 241 | uiScaley); |
| 242 | 242 | } |
| 243 | 243 | #endif |
| 244 | + | |
| 245 | +#ifdef HAVE_NEON_AARCH64 | |
| 246 | +void GeneralBilinearAccurateDownsamplerWrap_AArch64_neon (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight, | |
| 247 | + uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) { | |
| 248 | + const int32_t kiScaleBit = 15; | |
| 249 | + const uint32_t kuiScale = (1 << kiScaleBit); | |
| 250 | + uint32_t uiScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScale); | |
| 251 | + uint32_t uiScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kuiScale); | |
| 252 | + GeneralBilinearAccurateDownsampler_AArch64_neon (pDst, kiDstStride, kiDstWidth, kiDstHeight, pSrc, kiSrcStride, uiScalex, uiScaley); | |
| 253 | +} | |
| 254 | +#endif | |
| 244 | 255 | WELSVP_NAMESPACE_END |