History

Add arm64 code for downsample.

zhiliang wang committed 12 years ago

Commit 5cb66bd1 parent f6385466 files · +292 −2Browse files

Showing the changes to codec/processing/src/downsample (3 of 6 files). Show all

Unified · Split

3 files
  1. codec/processing/src/downsample/downsample.cpp +11 −0
  2. codec/processing/src/downsample/downsample.h +15 −0
  3. codec/processing/src/downsample/downsamplefuncs.cpp +11 −0
codec/processing/src/downsample/downsample.cpp+11−0
@@ -85,6 +85,17 @@ void CDownsampling::InitDownsampleFuncs (SDownsampleFuncs& sDownsampleFunc, int · 84 unmodified lines
85 sDownsampleFunc.pfGeneralRatioLuma = GeneralBilinearAccurateDownsamplerWrap_neon;85 sDownsampleFunc.pfGeneralRatioLuma = GeneralBilinearAccurateDownsamplerWrap_neon;
86 }86 }
87#endif87#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
90EResult CDownsampling::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pDstPixMap) {101EResult CDownsampling::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pDstPixMap) {
codec/processing/src/downsample/downsample.h+15−0
@@ -120,6 +120,21 @@ void GeneralBilinearAccurateDownsampler_neon (uint8_t* pDst, const int32_t kiDst · 119 unmodified lines
120WELSVP_EXTERN_C_END120WELSVP_EXTERN_C_END
121#endif121#endif
122 122
123#ifdef HAVE_NEON_AARCH64
124WELSVP_EXTERN_C_BEGIN
125// iSrcWidth no limitation
126HalveDownsampleFunc DyadicBilinearDownsampler_AArch64_neon;
127// iSrcWidth = x32 pixels
128HalveDownsampleFunc DyadicBilinearDownsamplerWidthx32_AArch64_neon;
129
130GeneralDownsampleFunc GeneralBilinearAccurateDownsamplerWrap_AArch64_neon;
131
132void 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
135WELSVP_EXTERN_C_END
136#endif
137
123 138
124class CDownsampling : public IStrategy {139class CDownsampling : public IStrategy {
125 public:140 public:
codec/processing/src/downsample/downsamplefuncs.cpp+11−0
@@ -241,4 +241,15 @@ void GeneralBilinearAccurateDownsamplerWrap_neon (uint8_t* pDst, const int32_t k · 240 unmodified lines
241 uiScaley);241 uiScaley);
242}242}
243#endif243#endif
244
245#ifdef HAVE_NEON_AARCH64
246void 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
244WELSVP_NAMESPACE_END255WELSVP_NAMESPACE_END

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t