History

Add Motion Compehension ARM64 Neon Code

dongzhang committed 12 years ago

Commit ad9e2da1 parent b47606a8 files · +5475 −480Browse files

Showing the changes to codec/decoder/core/src/mc.cpp (1 of 8 files). Show all

Unified · Split

codec/decoder/core/src/mc.cpp+568−355
@@ -85,13 +85,13 @@ static const uint8_t g_kuiABCD[8][8][4] = { //g_kA[dy][dx], g_kB[dy][dx], g_kC[d · 84 unmodified lines
8585 };
8686
8787 typedef void (*PWelsMcWidthHeightFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
88− int32_t iWidth, int32_t iHeight);
88+ int32_t iWidth, int32_t iHeight);
8989
9090 //***************************************************************************//
9191 // C code implementation //
9292 //***************************************************************************//
9393 static inline void McCopyWidthEq2_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
94− int32_t iHeight) {
94+ int32_t iHeight) {
9595 int32_t i;
9696 for (i = 0; i < iHeight; i++) { // iWidth == 2 only for chroma
9797 ST16A2 (pDst, LD16 (pSrc));
@@ -101,7 +101,7 @@ static inline void McCopyWidthEq2_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines
101101 }
102102
103103 static inline void McCopyWidthEq4_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
104− int32_t iHeight) {
104+ int32_t iHeight) {
105105 int32_t i;
106106 for (i = 0; i < iHeight; i++) {
107107 ST32A4 (pDst, LD32 (pSrc));
@@ -111,7 +111,7 @@ static inline void McCopyWidthEq4_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines
111111 }
112112
113113 static inline void McCopyWidthEq8_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
114− int32_t iHeight) {
114+ int32_t iHeight) {
115115 int32_t i;
116116 for (i = 0; i < iHeight; i++) {
117117 ST64A8 (pDst, LD64 (pSrc));
@@ -121,7 +121,7 @@ static inline void McCopyWidthEq8_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines
121121 }
122122
123123 static inline void McCopyWidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
124− int32_t iHeight) {
124+ int32_t iHeight) {
125125 int32_t i;
126126 for (i = 0; i < iHeight; i++) {
127127 ST64A8 (pDst , LD64 (pSrc));
@@ -138,7 +138,7 @@ static inline int32_t HorFilterInput16bit_c (int16_t* pSrc) { · 10 unmodified lines
138138 int32_t iPix14 = pSrc[-1] + pSrc[2];
139139 int32_t iPix23 = pSrc[ 0] + pSrc[1];
140140
141− return (iPix05 - (iPix14 * 5)+ (iPix23 * 20));
141+ return (iPix05 - (iPix14 * 5) + (iPix23 * 20));
142142 }
143143 // h: iOffset=1 / v: iOffset=iSrcStride
144144 static inline int32_t FilterInput8bitWithStride_c (const uint8_t* pSrc, const int32_t kiOffset) {
@@ -153,7 +153,7 @@ static inline int32_t FilterInput8bitWithStride_c (const uint8_t* pSrc, const in · 8 unmodified lines
153153 }
154154
155155 static inline void PixelAvg_c (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride,
156− const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) {
156+ const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) {
157157 int32_t i, j;
158158 for (i = 0; i < iHeight; i++) {
159159 for (j = 0; j < iWidth; j++) {
@@ -165,7 +165,7 @@ static inline void PixelAvg_c (uint8_t* pDst, int32_t iDstStride, const uint8_t* · 5 unmodified lines
165165 }
166166 }
167167 static inline void McCopy_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
168− int32_t iHeight) {
168+ int32_t iHeight) {
169169 if (iWidth == 16)
170170 McCopyWidthEq16_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
171171 else if (iWidth == 8)
@@ -176,8 +176,9 @@ static inline void McCopy_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* p · 4 unmodified lines
176176 McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
177177 }
178178
179−static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
180− int32_t iHeight) {
179+static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
180+ int32_t iWidth,
181+ int32_t iHeight) {
181182 int32_t i, j;
182183 for (i = 0; i < iHeight; i++) {
183184 for (j = 0; j < iWidth; j++) {
@@ -188,8 +189,9 @@ static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 4 unmodified lines
188189 }
189190 }
190191
191−static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
192− int32_t iHeight) {
192+static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
193+ int32_t iWidth,
194+ int32_t iHeight) {
193195 int32_t i, j;
194196 for (i = 0; i < iHeight; i++) {
195197 for (j = 0; j < iWidth; j++) {
@@ -200,8 +202,9 @@ static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 4 unmodified lines
200202 }
201203 }
202204
203−static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
204− int32_t iHeight) {
205+static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
206+ int32_t iWidth,
207+ int32_t iHeight) {
205208 int16_t iTmp[16 + 5]; //16
206209 int32_t i, j, k;
207210
@@ -218,88 +221,100 @@ static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 10 unmodified lines
218221 }
219222
220223 /////////////////////luma MC//////////////////////////
221−static inline void McHorVer01_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
222− int32_t iHeight) {
224+static inline void McHorVer01_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
225+ int32_t iWidth,
226+ int32_t iHeight) {
223227 uint8_t uiTmp[256];
224228 McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight);
225229 PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight);
226230 }
227−static inline void McHorVer03_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
228− int32_t iHeight) {
231+static inline void McHorVer03_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
232+ int32_t iWidth,
233+ int32_t iHeight) {
229234 uint8_t uiTmp[256];
230235 McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight);
231236 PixelAvg_c (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, uiTmp, 16, iWidth, iHeight);
232237 }
233−static inline void McHorVer10_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
234− int32_t iHeight) {
238+static inline void McHorVer10_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
239+ int32_t iWidth,
240+ int32_t iHeight) {
235241 uint8_t uiTmp[256];
236242 McHorVer20_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight);
237243 PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight);
238244 }
239−static inline void McHorVer11_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
240− int32_t iHeight) {
245+static inline void McHorVer11_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
246+ int32_t iWidth,
247+ int32_t iHeight) {
241248 uint8_t uiHorTmp[256];
242249 uint8_t uiVerTmp[256];
243250 McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
244251 McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight);
245252 PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight);
246253 }
247−static inline void McHorVer12_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
248− int32_t iHeight) {
254+static inline void McHorVer12_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
255+ int32_t iWidth,
256+ int32_t iHeight) {
249257 uint8_t uiVerTmp[256];
250258 uint8_t uiCtrTmp[256];
251259 McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight);
252260 McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight);
253261 PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight);
254262 }
255−static inline void McHorVer13_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
256− int32_t iHeight) {
263+static inline void McHorVer13_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
264+ int32_t iWidth,
265+ int32_t iHeight) {
257266 uint8_t uiHorTmp[256];
258267 uint8_t uiVerTmp[256];
259268 McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
260269 McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight);
261270 PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight);
262271 }
263−static inline void McHorVer21_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
264− int32_t iHeight) {
272+static inline void McHorVer21_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
273+ int32_t iWidth,
274+ int32_t iHeight) {
265275 uint8_t uiHorTmp[256];
266276 uint8_t uiCtrTmp[256];
267277 McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
268278 McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight);
269279 PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight);
270280 }
271−static inline void McHorVer23_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
272− int32_t iHeight) {
281+static inline void McHorVer23_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
282+ int32_t iWidth,
283+ int32_t iHeight) {
273284 uint8_t uiHorTmp[256];
274285 uint8_t uiCtrTmp[256];
275286 McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
276287 McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight);
277288 PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight);
278289 }
279−static inline void McHorVer30_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
280− int32_t iHeight) {
290+static inline void McHorVer30_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
291+ int32_t iWidth,
292+ int32_t iHeight) {
281293 uint8_t uiHorTmp[256];
282294 McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
283295 PixelAvg_c (pDst, iDstStride, pSrc + 1, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
284296 }
285−static inline void McHorVer31_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
286− int32_t iHeight) {
297+static inline void McHorVer31_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
298+ int32_t iWidth,
299+ int32_t iHeight) {
287300 uint8_t uiHorTmp[256];
288301 uint8_t uiVerTmp[256];
289302 McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
290303 McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight);
291304 PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight);
292305 }
293−static inline void McHorVer32_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
294− int32_t iHeight) {
306+static inline void McHorVer32_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
307+ int32_t iWidth,
308+ int32_t iHeight) {
295309 uint8_t uiVerTmp[256];
296310 uint8_t uiCtrTmp[256];
297311 McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight);
298312 McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight);
299313 PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight);
300314 }
301−static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
302− int32_t iHeight) {
315+static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
316+ int32_t iWidth,
317+ int32_t iHeight) {
303318 uint8_t uiHorTmp[256];
304319 uint8_t uiVerTmp[256];
305320 McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight);
@@ -308,7 +323,7 @@ static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 2 unmodified lines
308323 }
309324
310325 void McLuma_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
311− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
326+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
312327 //pSrc has been added the offset of mv
313328 {
314329 static const PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y]
@@ -326,7 +341,7 @@ static inline void McChromaWithFragMv_c (const uint8_t* pSrc, int32_t iSrcStride · 11 unmodified lines
326341 int32_t i, j;
327342 int32_t iA, iB, iC, iD;
328343 const uint8_t* pSrcNext = pSrc + iSrcStride;
329− const uint8_t *pABCD = g_kuiABCD[iMvY & 0x07][iMvX & 0x07];
344+ const uint8_t* pABCD = g_kuiABCD[iMvY & 0x07][iMvX & 0x07];
330345 iA = pABCD[0];
331346 iB = pABCD[1];
332347 iC = pABCD[2];
@@ -342,7 +357,7 @@ static inline void McChromaWithFragMv_c (const uint8_t* pSrc, int32_t iSrcStride · 9 unmodified lines
342357 }
343358
344359 void McChroma_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
345− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
360+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
346361 //pSrc has been added the offset of mv
347362 {
348363 const int32_t kiD8x = iMvX & 0x07;
@@ -376,8 +391,9 @@ static inline void McHorVer22WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt · 27 unmodified lines
376391 McHorVer22WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight);
377392 }
378393
379−static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth,
380− int32_t iHeight) {
394+static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
395+ int32_t iWidth,
396+ int32_t iHeight) {
381397 if (iWidth == 16)
382398 McCopyWidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
383399 else if (iWidth == 8)
@@ -389,7 +405,7 @@ static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t · 5 unmodified lines
389405 }
390406
391407 static inline void McHorVer20_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
392− int32_t iWidth, int32_t iHeight) {
408+ int32_t iWidth, int32_t iHeight) {
393409 if (iWidth == 16)
394410 McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
395411 else if (iWidth == 8)
@@ -399,7 +415,7 @@ static inline void McHorVer20_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines
399415 }
400416
401417 static inline void McHorVer02_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
402− int32_t iWidth, int32_t iHeight) {
418+ int32_t iWidth, int32_t iHeight) {
403419 if (iWidth == 16)
404420 McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
405421 else if (iWidth == 8)
@@ -409,7 +425,7 @@ static inline void McHorVer02_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines
409425 }
410426
411427 static inline void McHorVer22_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
412− int32_t iWidth, int32_t iHeight) {
428+ int32_t iWidth, int32_t iHeight) {
413429 if (iWidth == 16)
414430 McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
415431 else if (iWidth == 8)
@@ -419,7 +435,7 @@ static inline void McHorVer22_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines
419435 }
420436
421437 static inline void McHorVer01_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
422− int32_t iWidth, int32_t iHeight) {
438+ int32_t iWidth, int32_t iHeight) {
423439 ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16);
424440 if (iWidth == 16) {
425441 McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@@ -433,7 +449,7 @@ static inline void McHorVer01_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines
433449 }
434450 }
435451 static inline void McHorVer03_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
436− int32_t iWidth, int32_t iHeight) {
452+ int32_t iWidth, int32_t iHeight) {
437453 ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16);
438454 if (iWidth == 16) {
439455 McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@@ -447,7 +463,7 @@ static inline void McHorVer03_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines
447463 }
448464 }
449465 static inline void McHorVer10_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
450− int32_t iWidth, int32_t iHeight) {
466+ int32_t iWidth, int32_t iHeight) {
451467 ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16);
452468 if (iWidth == 16) {
453469 McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight);
@@ -461,7 +477,7 @@ static inline void McHorVer10_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines
461477 }
462478 }
463479 static inline void McHorVer11_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
464− int32_t iWidth, int32_t iHeight) {
480+ int32_t iWidth, int32_t iHeight) {
465481 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
466482 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
467483 if (iWidth == 16) {
@@ -479,7 +495,7 @@ static inline void McHorVer11_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
479495 }
480496 }
481497 static inline void McHorVer12_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
482− int32_t iWidth, int32_t iHeight) {
498+ int32_t iWidth, int32_t iHeight) {
483499 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
484500 ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
485501 if (iWidth == 16) {
@@ -497,7 +513,7 @@ static inline void McHorVer12_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
497513 }
498514 }
499515 static inline void McHorVer13_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
500− int32_t iWidth, int32_t iHeight) {
516+ int32_t iWidth, int32_t iHeight) {
501517 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
502518 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
503519 if (iWidth == 16) {
@@ -515,7 +531,7 @@ static inline void McHorVer13_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
515531 }
516532 }
517533 static inline void McHorVer21_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
518− int32_t iWidth, int32_t iHeight) {
534+ int32_t iWidth, int32_t iHeight) {
519535 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
520536 ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
521537 if (iWidth == 16) {
@@ -533,7 +549,7 @@ static inline void McHorVer21_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
533549 }
534550 }
535551 static inline void McHorVer23_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
536− int32_t iWidth, int32_t iHeight) {
552+ int32_t iWidth, int32_t iHeight) {
537553 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
538554 ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
539555 if (iWidth == 16) {
@@ -551,7 +567,7 @@ static inline void McHorVer23_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
551567 }
552568 }
553569 static inline void McHorVer30_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
554− int32_t iWidth, int32_t iHeight) {
570+ int32_t iWidth, int32_t iHeight) {
555571 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
556572 if (iWidth == 16) {
557573 McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight);
@@ -565,7 +581,7 @@ static inline void McHorVer30_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines
565581 }
566582 }
567583 static inline void McHorVer31_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
568− int32_t iWidth, int32_t iHeight) {
584+ int32_t iWidth, int32_t iHeight) {
569585 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
570586 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
571587 if (iWidth == 16) {
@@ -583,7 +599,7 @@ static inline void McHorVer31_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
583599 }
584600 }
585601 static inline void McHorVer32_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
586− int32_t iWidth, int32_t iHeight) {
602+ int32_t iWidth, int32_t iHeight) {
587603 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
588604 ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
589605 if (iWidth == 16) {
@@ -601,7 +617,7 @@ static inline void McHorVer32_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines
601617 }
602618 }
603619 static inline void McHorVer33_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
604− int32_t iWidth, int32_t iHeight) {
620+ int32_t iWidth, int32_t iHeight) {
605621 ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
606622 ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
607623 if (iWidth == 16) {
@@ -620,7 +636,7 @@ static inline void McHorVer33_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 12 unmodified lines
620636 }
621637
622638 void McLuma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
623− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
639+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
624640 //pSrc has been added the offset of mv
625641 {
626642 static const PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y]
@@ -634,9 +650,9 @@ void McLuma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_ · 7 unmodified lines
634650 }
635651
636652 void McChroma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
637− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
653+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
638654 static const PMcChromaWidthExtFunc kpMcChromaWidthFuncs[2] = {
639− McChromaWidthEq4_mmx,
655+ McChromaWidthEq4_mmx,
640656 McChromaWidthEq8_sse2
641657 };
642658 const int32_t kiD8x = iMvX & 0x07;
@@ -656,331 +672,528 @@ void McChroma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int3 · 13 unmodified lines
656672 // NEON implementation //
657673 //***************************************************************************//
658674 #if defined(HAVE_NEON)
659−void McCopy_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
660− int32_t iWidth, int32_t iHeight)
661−{
675+void McCopy_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
676+ int32_t iWidth, int32_t iHeight) {
662677 if (16 == iWidth)
663− McCopyWidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
664− else if(8 == iWidth)
665− McCopyWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
666− else
667− McCopyWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
668− }
669−void McHorVer20_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
670− int32_t iWidth, int32_t iHeight)
671−{
678+ McCopyWidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
679+ else if (8 == iWidth)
680+ McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
681+ else
682+ McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
683+}
684+void McHorVer20_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
685+ int32_t iWidth, int32_t iHeight) {
672686 if (iWidth == 16)
673− McHorVer20WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
674− else if (iWidth == 8)
675− McHorVer20WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
676− else if (iWidth == 4)
677− McHorVer20WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
678−}
679−void McHorVer02_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
680− int32_t iWidth, int32_t iHeight)
681−{
682− if (iWidth == 16)
683− McHorVer02WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
684− else if (iWidth == 8)
685− McHorVer02WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
686− else if (iWidth == 4)
687− McHorVer02WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
688−}
689−void McHorVer22_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
690− int32_t iWidth, int32_t iHeight)
691−{
692− if (iWidth == 16)
693− McHorVer22WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
694− else if (iWidth == 8)
695− McHorVer22WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
696− else if (iWidth == 4)
697− McHorVer22WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
687+ McHorVer20WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
688+ else if (iWidth == 8)
689+ McHorVer20WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
690+ else if (iWidth == 4)
691+ McHorVer20WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
692+}
693+void McHorVer02_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
694+ int32_t iWidth, int32_t iHeight) {
695+ if (iWidth == 16)
696+ McHorVer02WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
697+ else if (iWidth == 8)
698+ McHorVer02WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
699+ else if (iWidth == 4)
700+ McHorVer02WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
701+}
702+void McHorVer22_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
703+ int32_t iWidth, int32_t iHeight) {
704+ if (iWidth == 16)
705+ McHorVer22WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
706+ else if (iWidth == 8)
707+ McHorVer22WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
708+ else if (iWidth == 4)
709+ McHorVer22WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
698710 }
699711
700−void McHorVer01_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
701− int32_t iWidth, int32_t iHeight)
702−{
712+void McHorVer01_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
713+ int32_t iWidth, int32_t iHeight) {
703714 if (iWidth == 16)
704− McHorVer01WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
715+ McHorVer01WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
705716 else if (iWidth == 8)
706− McHorVer01WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
717+ McHorVer01WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
707718 else if (iWidth == 4)
708− McHorVer01WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
719+ McHorVer01WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
709720 }
710−void McHorVer03_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
711− int32_t iWidth, int32_t iHeight)
712−{
721+void McHorVer03_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
722+ int32_t iWidth, int32_t iHeight) {
713723 if (iWidth == 16)
714− McHorVer03WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
715− else if (iWidth == 8)
716− McHorVer03WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
717− else if (iWidth == 4)
718− McHorVer03WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
719−}
720−void McHorVer10_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
721− int32_t iWidth, int32_t iHeight)
722−{
724+ McHorVer03WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
725+ else if (iWidth == 8)
726+ McHorVer03WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
727+ else if (iWidth == 4)
728+ McHorVer03WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
729+}
730+void McHorVer10_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
731+ int32_t iWidth, int32_t iHeight) {
723732 if (iWidth == 16)
724− McHorVer10WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
725− else if (iWidth == 8)
726− McHorVer10WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
727− else if (iWidth == 4)
728− McHorVer10WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
729−}
730−void McHorVer11_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
731− int32_t iWidth, int32_t iHeight)
732−{
733− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
734− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
733+ McHorVer10WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
734+ else if (iWidth == 8)
735+ McHorVer10WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
736+ else if (iWidth == 4)
737+ McHorVer10WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
738+}
739+void McHorVer11_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
740+ int32_t iWidth, int32_t iHeight) {
741+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
742+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
743+ if (iWidth == 16) {
744+ McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
745+ McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
746+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
747+ } else if (iWidth == 8) {
748+ McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
749+ McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
750+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
751+ } else if (iWidth == 4) {
752+ McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
753+ McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
754+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
755+ }
756+}
757+void McHorVer12_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
758+ int32_t iWidth, int32_t iHeight) {
759+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
760+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
761+ if (iWidth == 16) {
762+ McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
763+ McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
764+ PixelAvgWidthEq16_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
765+ } else if (iWidth == 8) {
766+ McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
767+ McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
768+ PixelAvgWidthEq8_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
769+ } else if (iWidth == 4) {
770+ McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
771+ McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
772+ PixelAvgWidthEq4_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
773+ }
774+}
775+void McHorVer13_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
776+ int32_t iWidth, int32_t iHeight) {
777+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
778+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
779+ if (iWidth == 16) {
780+ McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
781+ McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
782+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
783+ } else if (iWidth == 8) {
784+ McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
785+ McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
786+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
787+ } else if (iWidth == 4) {
788+ McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
789+ McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
790+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
791+ }
792+}
793+void McHorVer21_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
794+ int32_t iWidth, int32_t iHeight) {
795+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
796+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
797+ if (iWidth == 16) {
798+ McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
799+ McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
800+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
801+ } else if (iWidth == 8) {
802+ McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
803+ McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
804+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
805+ } else if (iWidth == 4) {
806+ McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
807+ McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
808+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
809+ }
810+}
811+void McHorVer23_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
812+ int32_t iWidth, int32_t iHeight) {
813+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
814+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
815+ if (iWidth == 16) {
816+ McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
817+ McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
818+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
819+ } else if (iWidth == 8) {
820+ McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
821+ McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
822+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
823+ } else if (iWidth == 4) {
824+ McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
825+ McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
826+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
827+ }
828+}
829+void McHorVer30_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
830+ int32_t iWidth, int32_t iHeight) {
735831 if (iWidth == 16)
736− {
737− McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
738− McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
739− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
740− }
741− else if (iWidth == 8)
742− {
743− McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
744− McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
745− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
746− }
747− else if (iWidth == 4)
748− {
749− McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
750− McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
751− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
752− }
753−}
754−void McHorVer12_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
755− int32_t iWidth, int32_t iHeight)
756−{
757− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
758− ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 );
832+ McHorVer30WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
833+ else if (iWidth == 8)
834+ McHorVer30WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
835+ else if (iWidth == 4)
836+ McHorVer30WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
837+}
838+void McHorVer31_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
839+ int32_t iWidth, int32_t iHeight) {
840+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
841+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
842+ if (iWidth == 16) {
843+ McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
844+ McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
845+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
846+ } else if (iWidth == 8) {
847+ McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
848+ McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
849+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
850+ } else if (iWidth == 4) {
851+ McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
852+ McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
853+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
854+ }
855+}
856+void McHorVer32_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
857+ int32_t iWidth, int32_t iHeight) {
858+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
859+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
860+ if (iWidth == 16) {
861+ McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
862+ McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
863+ PixelAvgWidthEq16_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
864+ } else if (iWidth == 8) {
865+ McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
866+ McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
867+ PixelAvgWidthEq8_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
868+ } else if (iWidth == 4) {
869+ McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
870+ McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
871+ PixelAvgWidthEq4_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
872+ }
873+}
874+void McHorVer33_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
875+ int32_t iWidth, int32_t iHeight) {
876+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
877+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
878+ if (iWidth == 16) {
879+ McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
880+ McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
881+ PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
882+ } else if (iWidth == 8) {
883+ McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
884+ McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
885+ PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
886+ } else if (iWidth == 4) {
887+ McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
888+ McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
889+ PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
890+ }
891+}
892+
893+void McLuma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
894+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
895+ static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y]
896+ {McCopy_neon, McHorVer01_neon, McHorVer02_neon, McHorVer03_neon},
897+ {McHorVer10_neon, McHorVer11_neon, McHorVer12_neon, McHorVer13_neon},
898+ {McHorVer20_neon, McHorVer21_neon, McHorVer22_neon, McHorVer23_neon},
899+ {McHorVer30_neon, McHorVer31_neon, McHorVer32_neon, McHorVer33_neon},
900+ };
901+ // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
902+ pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
903+}
904+void McChroma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
905+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
906+ if (0 == iMvX && 0 == iMvY) {
907+ if (8 == iWidth)
908+ McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
909+ else if (iWidth == 4)
910+ McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
911+ else //here iWidth == 2
912+ McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
913+ } else {
914+ const int32_t kiD8x = iMvX & 0x07;
915+ const int32_t kiD8y = iMvY & 0x07;
916+ if (8 == iWidth)
917+ McChromaWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight);
918+ else if (4 == iWidth)
919+ McChromaWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight);
920+ else //here iWidth == 2
921+ McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
922+ }
923+}
924+#endif
925+#if defined(HAVE_NEON_AARCH64)
926+void McCopy_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
927+ int32_t iWidth, int32_t iHeight) {
928+ if (16 == iWidth)
929+ McCopyWidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
930+ else if (8 == iWidth)
931+ McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
932+ else
933+ McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
934+}
935+void McHorVer20_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
936+ int32_t iWidth, int32_t iHeight) {
759937 if (iWidth == 16)
760− {
761− McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
762− McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
763− PixelAvgWidthEq16_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
764− }
765− else if (iWidth == 8)
766− {
767− McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
768− McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
769− PixelAvgWidthEq8_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
770− }
771− else if (iWidth == 4)
772− {
773− McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
774− McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
775− PixelAvgWidthEq4_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
776− }
777−}
778−void McHorVer13_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
779− int32_t iWidth, int32_t iHeight)
780−{
781− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
782− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
938+ McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
939+ else if (iWidth == 8)
940+ McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
941+ else if (iWidth == 4)
942+ McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
943+}
944+void McHorVer02_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
945+ int32_t iWidth, int32_t iHeight) {
783946 if (iWidth == 16)
784− {
785− McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
786− McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
787− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
788− }
789− else if (iWidth == 8)
790− {
791− McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
792− McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
793− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
794− }
795− else if (iWidth == 4)
796− {
797− McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
798− McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight);
799− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
800− }
801−}
802−void McHorVer21_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
803− int32_t iWidth, int32_t iHeight)
804−{
805− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
806− ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 );
947+ McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
948+ else if (iWidth == 8)
949+ McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
950+ else if (iWidth == 4)
951+ McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
952+}
953+void McHorVer22_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
954+ int32_t iWidth, int32_t iHeight) {
807955 if (iWidth == 16)
808− {
809− McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
810− McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
811− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
812− }
813− else if (iWidth == 8)
814− {
815− McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
816− McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
817− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
818− }
819− else if (iWidth == 4)
820− {
821− McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
822− McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
823− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
824− }
825−}
826−void McHorVer23_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
827− int32_t iWidth, int32_t iHeight)
828−{
829− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
830− ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 );
956+ McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
957+ else if (iWidth == 8)
958+ McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
959+ else if (iWidth == 4)
960+ McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
961+}
962+
963+void McHorVer01_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
964+ int32_t iWidth, int32_t iHeight) {
831965 if (iWidth == 16)
832− {
833− McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
834− McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
835− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
836− }
966+ McHorVer01WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
837967 else if (iWidth == 8)
838− {
839− McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
840− McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
841− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
842− }
843− else if (iWidth == 4)
844− {
845− McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
846− McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
847− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight);
848− }
849−}
850−void McHorVer30_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
851− int32_t iWidth, int32_t iHeight)
852−{
968+ McHorVer01WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
969+ else if (iWidth == 4)
970+ McHorVer01WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
971+}
972+void McHorVer03_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
973+ int32_t iWidth, int32_t iHeight) {
853974 if (iWidth == 16)
854− McHorVer30WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
855− else if (iWidth == 8)
856− McHorVer30WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
857− else if (iWidth == 4)
858− McHorVer30WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
859−}
860−void McHorVer31_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
861− int32_t iWidth, int32_t iHeight)
862−{
863− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
864− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
865− if (iWidth == 16) {
866− McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
867− McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
868− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
869− }
870− else if (iWidth == 8){
871− McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
872− McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
873− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
874− }
875− else if (iWidth == 4)
876− {
877− McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight);
878− McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
879− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
880− }
881−}
882−void McHorVer32_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
883− int32_t iWidth, int32_t iHeight)
884−{
885− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
886− ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 );
975+ McHorVer03WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
976+ else if (iWidth == 8)
977+ McHorVer03WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
978+ else if (iWidth == 4)
979+ McHorVer03WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
980+}
981+void McHorVer10_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
982+ int32_t iWidth, int32_t iHeight) {
887983 if (iWidth == 16)
888− {
889− McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
890− McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
891− PixelAvgWidthEq16_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
892− }
893− else if (iWidth == 8)
894− {
895− McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
896− McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
897− PixelAvgWidthEq8_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
898− }
899− else if (iWidth == 4)
900− {
901− McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
902− McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight);
903− PixelAvgWidthEq4_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight);
904− }
905−}
906−void McHorVer33_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
907− int32_t iWidth, int32_t iHeight)
908−{
909− ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 );
910− ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 );
984+ McHorVer10WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
985+ else if (iWidth == 8)
986+ McHorVer10WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
987+ else if (iWidth == 4)
988+ McHorVer10WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
989+}
990+void McHorVer11_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
991+ int32_t iWidth, int32_t iHeight) {
992+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
993+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
994+ if (iWidth == 16) {
995+ McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
996+ McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
997+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
998+ } else if (iWidth == 8) {
999+ McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1000+ McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1001+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1002+ } else if (iWidth == 4) {
1003+ McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1004+ McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1005+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1006+ }
1007+}
1008+void McHorVer12_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1009+ int32_t iWidth, int32_t iHeight) {
1010+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
1011+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
1012+ if (iWidth == 16) {
1013+ McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1014+ McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1015+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1016+ } else if (iWidth == 8) {
1017+ McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1018+ McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1019+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1020+ } else if (iWidth == 4) {
1021+ McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1022+ McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1023+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1024+ }
1025+}
1026+void McHorVer13_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1027+ int32_t iWidth, int32_t iHeight) {
1028+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
1029+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
1030+ if (iWidth == 16) {
1031+ McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1032+ McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1033+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1034+ } else if (iWidth == 8) {
1035+ McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1036+ McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1037+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1038+ } else if (iWidth == 4) {
1039+ McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1040+ McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight);
1041+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1042+ }
1043+}
1044+void McHorVer21_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1045+ int32_t iWidth, int32_t iHeight) {
1046+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
1047+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
1048+ if (iWidth == 16) {
1049+ McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1050+ McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1051+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1052+ } else if (iWidth == 8) {
1053+ McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1054+ McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1055+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1056+ } else if (iWidth == 4) {
1057+ McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1058+ McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1059+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1060+ }
1061+}
1062+void McHorVer23_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1063+ int32_t iWidth, int32_t iHeight) {
1064+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
1065+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
1066+ if (iWidth == 16) {
1067+ McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1068+ McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1069+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1070+ } else if (iWidth == 8) {
1071+ McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1072+ McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1073+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1074+ } else if (iWidth == 4) {
1075+ McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1076+ McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1077+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight);
1078+ }
1079+}
1080+void McHorVer30_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1081+ int32_t iWidth, int32_t iHeight) {
9111082 if (iWidth == 16)
912− {
913− McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
914− McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
915− PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
916− }
917− else if (iWidth == 8)
918− {
919− McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
920− McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
921− PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
922− }
923− else if (iWidth == 4)
924− {
925− McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
926− McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight);
927− PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight);
928− }
929−}
930−
931−void McLuma_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
932− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
933−{
934− static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = //[x][y]
935− {
936− {McCopy_neon, McHorVer01_neon, McHorVer02_neon, McHorVer03_neon},
937− {McHorVer10_neon, McHorVer11_neon, McHorVer12_neon, McHorVer13_neon},
938− {McHorVer20_neon, McHorVer21_neon, McHorVer22_neon, McHorVer23_neon},
939− {McHorVer30_neon, McHorVer31_neon, McHorVer32_neon, McHorVer33_neon},
940− };
1083+ McHorVer30WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1084+ else if (iWidth == 8)
1085+ McHorVer30WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1086+ else if (iWidth == 4)
1087+ McHorVer30WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1088+}
1089+void McHorVer31_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1090+ int32_t iWidth, int32_t iHeight) {
1091+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
1092+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
1093+ if (iWidth == 16) {
1094+ McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1095+ McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1096+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1097+ } else if (iWidth == 8) {
1098+ McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1099+ McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1100+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1101+ } else if (iWidth == 4) {
1102+ McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight);
1103+ McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1104+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1105+ }
1106+}
1107+void McHorVer32_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1108+ int32_t iWidth, int32_t iHeight) {
1109+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
1110+ ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16);
1111+ if (iWidth == 16) {
1112+ McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1113+ McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1114+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1115+ } else if (iWidth == 8) {
1116+ McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1117+ McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1118+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1119+ } else if (iWidth == 4) {
1120+ McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1121+ McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight);
1122+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight);
1123+ }
1124+}
1125+void McHorVer33_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1126+ int32_t iWidth, int32_t iHeight) {
1127+ ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16);
1128+ ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16);
1129+ if (iWidth == 16) {
1130+ McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1131+ McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1132+ PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1133+ } else if (iWidth == 8) {
1134+ McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1135+ McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1136+ PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1137+ } else if (iWidth == 4) {
1138+ McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight);
1139+ McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight);
1140+ PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight);
1141+ }
1142+}
1143+
1144+void McLuma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1145+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
1146+ static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y]
1147+ {McCopy_AArch64_neon, McHorVer01_AArch64_neon, McHorVer02_AArch64_neon, McHorVer03_AArch64_neon},
1148+ {McHorVer10_AArch64_neon, McHorVer11_AArch64_neon, McHorVer12_AArch64_neon, McHorVer13_AArch64_neon},
1149+ {McHorVer20_AArch64_neon, McHorVer21_AArch64_neon, McHorVer22_AArch64_neon, McHorVer23_AArch64_neon},
1150+ {McHorVer30_AArch64_neon, McHorVer31_AArch64_neon, McHorVer32_AArch64_neon, McHorVer33_AArch64_neon},
1151+ };
9411152 // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
942− pWelsMcFunc[iMvX&0x03][iMvY&0x03](pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
1153+ pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
9431154 }
944−void McChroma_neon(const uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride,
945− int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight)
946−{
947− if (0 == iMvX && 0 == iMvY)
948− {
949− if(8 == iWidth)
950− McCopyWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
951− else if(iWidth == 4)
952− McCopyWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight);
953− else //here iWidth == 2
954− McCopyWidthEq2_c(pSrc,iSrcStride,pDst,iDstStride,iHeight);
955− }
956− else
957− {
958− const int32_t kiD8x = iMvX & 0x07;
959− const int32_t kiD8y = iMvY & 0x07;
960− if(8 == iWidth)
961− McChromaWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight);
962− else if(4 == iWidth)
963− McChromaWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight);
964− else //here iWidth == 2
965− McChromaWithFragMv_c(pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
966− }
1155+void McChroma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
1156+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
1157+ if (0 == iMvX && 0 == iMvY) {
1158+ if (8 == iWidth)
1159+ McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1160+ else if (iWidth == 4)
1161+ McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1162+ else //here iWidth == 2
1163+ McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
1164+ } else {
1165+ const int32_t kiD8x = iMvX & 0x07;
1166+ const int32_t kiD8y = iMvY & 0x07;
1167+ if (8 == iWidth)
1168+ McChromaWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight);
1169+ else if (4 == iWidth)
1170+ McChromaWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight);
1171+ else //here iWidth == 2
1172+ McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
1173+ }
9671174 }
9681175 #endif
1176+
9691177 void InitMcFunc (SMcFunc* pMcFunc, int32_t iCpu) {
9701178 pMcFunc->pMcLumaFunc = McLuma_c;
9711179 pMcFunc->pMcChromaFunc = McChroma_c;
9721180
9731181 #ifdef HAVE_NEON
974− if ( iCpu & WELS_CPU_NEON ) {
975− pMcFunc->pMcLumaFunc = McLuma_neon;
976− pMcFunc->pMcChromaFunc = McChroma_neon;
977− }
1182+ if (iCpu & WELS_CPU_NEON) {
1183+ pMcFunc->pMcLumaFunc = McLuma_neon;
1184+ pMcFunc->pMcChromaFunc = McChroma_neon;
1185+ }
1186+#endif
1187+#ifdef HAVE_NEON_AARCH64
1188+ if (iCpu & WELS_CPU_NEON) {
1189+ pMcFunc->pMcLumaFunc = McLuma_AArch64_neon;
1190+ pMcFunc->pMcChromaFunc = McChroma_AArch64_neon;
1191+ }
9781192 #endif
979−
9801193 #if defined (X86_ASM)
9811194 if (iCpu & WELS_CPU_SSE2) {
982− pMcFunc->pMcLumaFunc = McLuma_sse2;
983− pMcFunc->pMcChromaFunc = McChroma_sse2;
1195+ pMcFunc->pMcLumaFunc = McLuma_sse2;
1196+ pMcFunc->pMcChromaFunc = McChroma_sse2;
9841197 }
9851198 #endif //(X86_ASM)
9861199 }

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