Showing the changes to codec/encoder/core/src/mc.cpp (1 of 8 files). Show all
Unified · Split
| @@ -89,8 +89,10 @@ VerFilterFunc fpVerFilter = NULL; · 88 unmodified lines | |||
| 89 | HorFilterFunc fpHorFilter = NULL; | 89 | HorFilterFunc fpHorFilter = NULL; |
| 90 | HorFilterFuncInput16Bits fpHorFilterInput16Bits = NULL; | 90 | HorFilterFuncInput16Bits fpHorFilterInput16Bits = NULL; |
| 91 | 91 | ||
| 92 | typedef void (*WelsMcFunc0) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight); | 92 | typedef void (*WelsMcFunc0) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 93 | typedef void (*WelsMcFunc1) (uint8_t* pDst, int32_t iDstStride, const uint8_t* psrcA, int32_t iSrcAStride, const uint8_t* pSrcB, | 93 | int32_t iHeight); |
| 94 | typedef void (*WelsMcFunc1) (uint8_t* pDst, int32_t iDstStride, const uint8_t* psrcA, int32_t iSrcAStride, | ||
| 95 | const uint8_t* pSrcB, | ||
| 94 | int32_t iSrcBStride, int32_t iHeight); | 96 | int32_t iSrcBStride, int32_t iHeight); |
| 95 | WelsMcFunc0 McCopyWidthEq16 = NULL; | 97 | WelsMcFunc0 McCopyWidthEq16 = NULL; |
| 96 | WelsMcFunc0 McCopyWidthEq8 = NULL; | 98 | WelsMcFunc0 McCopyWidthEq8 = NULL; |
| @@ -323,7 +325,8 @@ static inline void McHorVer33WidthEq16 (const uint8_t* pSrc, int32_t iSrcStride, · 226 unmodified lines | |||
| 323 | pfPixelAvgWidthEq16 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | 325 | pfPixelAvgWidthEq16 (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); |
| 324 | } | 326 | } |
| 325 | 327 | ||
| 326 | static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | 328 | static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 329 | int32_t iWidth, | ||
| 327 | int32_t iHeight) { | 330 | int32_t iHeight) { |
| 328 | int32_t i, j; | 331 | int32_t i, j; |
| 329 | for (i = 0; i < iHeight; i++) { | 332 | for (i = 0; i < iHeight; i++) { |
| @@ -335,7 +338,8 @@ static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 5 unmodified lines | |||
| 335 | } | 338 | } |
| 336 | } | 339 | } |
| 337 | //vertical filter to gain half sample, that is (0, 2) location in quarter sample | 340 | //vertical filter to gain half sample, that is (0, 2) location in quarter sample |
| 338 | static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | 341 | static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 342 | int32_t iWidth, | ||
| 339 | int32_t iHeight) { | 343 | int32_t iHeight) { |
| 340 | int32_t i, j; | 344 | int32_t i, j; |
| 341 | for (i = 0; i < iHeight; i++) { | 345 | for (i = 0; i < iHeight; i++) { |
| @@ -347,7 +351,8 @@ static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 5 unmodified lines | |||
| 347 | } | 351 | } |
| 348 | } | 352 | } |
| 349 | //horizontal and vertical filter to gain half sample, that is (2, 2) location in quarter sample | 353 | //horizontal and vertical filter to gain half sample, that is (2, 2) location in quarter sample |
| 350 | static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | 354 | static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 355 | int32_t iWidth, | ||
| 351 | int32_t iHeight) { | 356 | int32_t iHeight) { |
| 352 | int16_t pTmp[17 + 5] = {0}; //w+1 | 357 | int16_t pTmp[17 + 5] = {0}; //w+1 |
| 353 | int32_t i, j, k; | 358 | int32_t i, j, k; |
| @@ -481,94 +486,190 @@ void McChroma_ssse3 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int · 127 unmodified lines | |||
| 481 | 486 | ||
| 482 | #endif //X86_ASM | 487 | #endif //X86_ASM |
| 483 | 488 | ||
| 484 | //***************************************************************************// | 489 | //***************************************************************************// |
| 485 | // NEON implementation // | 490 | // NEON implementation // |
| 486 | //***************************************************************************// | 491 | //***************************************************************************// |
| 487 | #if defined(HAVE_NEON) | 492 | #if defined(HAVE_NEON) |
| 488 | void McHorVer20Width9Or17_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | 493 | void McHorVer20Width9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 489 | int32_t iWidth, int32_t iHeight) { | 494 | int32_t iWidth, int32_t iHeight) { |
| 490 | if (iWidth == 17) | 495 | if (iWidth == 17) |
| 491 | McHorVer20Width17_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 496 | McHorVer20Width17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 492 | else //if (iWidth == 9) | 497 | else //if (iWidth == 9) |
| 493 | McHorVer20Width9_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 498 | McHorVer20Width9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 494 | } | 499 | } |
| 495 | void McHorVer02Height9Or17_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | 500 | void McHorVer02Height9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 496 | int32_t iWidth, int32_t iHeight){ | 501 | int32_t iWidth, int32_t iHeight) { |
| 497 | if (iWidth == 16) | 502 | if (iWidth == 16) |
| 498 | McHorVer02Height17_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 503 | McHorVer02Height17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 499 | else //if (iWidth == 8) | 504 | else //if (iWidth == 8) |
| 500 | McHorVer02Height9_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 505 | McHorVer02Height9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 501 | } | 506 | } |
| 502 | void McHorVer22Width9Or17Height9Or17_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | 507 | void McHorVer22Width9Or17Height9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 503 | int32_t iWidth, int32_t iHeight){ | 508 | int32_t iWidth, int32_t iHeight) { |
| 504 | if (iWidth == 17) | 509 | if (iWidth == 17) |
| 505 | McHorVer22Width17_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 510 | McHorVer22Width17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 506 | else //if (iWidth == 9) | 511 | else //if (iWidth == 9) |
| 507 | McHorVer22Width9_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 512 | McHorVer22Width9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 508 | } | 513 | } |
| 509 | void EncMcHorVer11_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 514 | void EncMcHorVer11_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 510 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 515 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 511 | McHorVer20WidthEq16_neon(pSrc, iSrcStride, pTmp, 16, iHeight); | 516 | McHorVer20WidthEq16_neon (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 512 | McHorVer02WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 517 | McHorVer02WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 513 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 518 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 514 | } | 519 | } |
| 515 | void EncMcHorVer12_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 520 | void EncMcHorVer12_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 516 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 521 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 517 | McHorVer02WidthEq16_neon(pSrc, iSrcStride, pTmp, 16, iHeight); | 522 | McHorVer02WidthEq16_neon (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 518 | McHorVer22WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 523 | McHorVer22WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 519 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 524 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 520 | } | 525 | } |
| 521 | void EncMcHorVer13_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 526 | void EncMcHorVer13_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 522 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 527 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 523 | McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 528 | McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 524 | McHorVer02WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 529 | McHorVer02WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 525 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 530 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 526 | } | 531 | } |
| 527 | void EncMcHorVer21_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 532 | void EncMcHorVer21_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 528 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 533 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 529 | McHorVer20WidthEq16_neon(pSrc, iSrcStride, pTmp, 16, iHeight); | 534 | McHorVer20WidthEq16_neon (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 530 | McHorVer22WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 535 | McHorVer22WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 531 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 536 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 532 | } | 537 | } |
| 533 | void EncMcHorVer23_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 538 | void EncMcHorVer23_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 534 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 539 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 535 | McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 540 | McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 536 | McHorVer22WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 541 | McHorVer22WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 537 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 542 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 538 | } | 543 | } |
| 539 | void EncMcHorVer31_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 544 | void EncMcHorVer31_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 540 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 545 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 541 | McHorVer20WidthEq16_neon(pSrc, iSrcStride, pTmp, 16, iHeight); | 546 | McHorVer20WidthEq16_neon (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 542 | McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, &pTmp[256], 16, iHeight); | 547 | McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, &pTmp[256], 16, iHeight); |
| 543 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 548 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 544 | } | 549 | } |
| 545 | void EncMcHorVer32_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 550 | void EncMcHorVer32_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 546 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 551 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 547 | McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pTmp, 16, iHeight); | 552 | McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pTmp, 16, iHeight); |
| 548 | McHorVer22WidthEq16_neon(pSrc, iSrcStride, &pTmp[256], 16, iHeight); | 553 | McHorVer22WidthEq16_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); |
| 549 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 554 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 550 | } | 555 | } |
| 551 | void EncMcHorVer33_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { | 556 | void EncMcHorVer33_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) { |
| 552 | ENFORCE_STACK_ALIGN_1D(uint8_t, pTmp, 512, 16) | 557 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) |
| 553 | McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 558 | McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 554 | McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, &pTmp[256], 16, iHeight); | 559 | McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, &pTmp[256], 16, iHeight); |
| 555 | PixelAvgWidthEq16_neon(pDst, iDstStride, pTmp, &pTmp[256], iHeight); | 560 | PixelAvgWidthEq16_neon (pDst, iDstStride, pTmp, &pTmp[256], iHeight); |
| 556 | } | 561 | } |
| 557 | void EncMcChroma_neon(const uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, | 562 | void EncMcChroma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 558 | SMVUnitXY sMv, int32_t iWidth, int32_t iHeight) { | 563 | SMVUnitXY sMv, int32_t iWidth, int32_t iHeight) { |
| 559 | const int32_t kiD8x = sMv.iMvX&0x07; | 564 | const int32_t kiD8x = sMv.iMvX & 0x07; |
| 560 | const int32_t kiD8y = sMv.iMvY&0x07; | 565 | const int32_t kiD8y = sMv.iMvY & 0x07; |
| 561 | if (0 == kiD8x && 0 == kiD8y) { | 566 | if (0 == kiD8x && 0 == kiD8y) { |
| 562 | if(8 == iWidth) | 567 | if (8 == iWidth) |
| 563 | McCopyWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 568 | McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 564 | else // iWidth == 4 | 569 | else // iWidth == 4 |
| 565 | McCopyWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | 570 | McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 571 | } else { | ||
| 572 | if (8 == iWidth) | ||
| 573 | McChromaWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | ||
| 574 | else //if(4 == iWidth) | ||
| 575 | McChromaWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | ||
| 566 | } | 576 | } |
| 567 | else { | 577 | } |
| 568 | if(8 == iWidth) | 578 | #endif |
| 569 | McChromaWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight); | 579 | |
| 580 | #if defined(HAVE_NEON_AARCH64) | ||
| 581 | void McHorVer20Width9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 582 | int32_t iWidth, int32_t iHeight) { | ||
| 583 | if (iWidth == 17) | ||
| 584 | McHorVer20Width17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 585 | else //if (iWidth == 9) | ||
| 586 | McHorVer20Width9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 587 | } | ||
| 588 | void McHorVer02Height9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 589 | int32_t iWidth, int32_t iHeight) { | ||
| 590 | if (iWidth == 16) | ||
| 591 | McHorVer02Height17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 592 | else //if (iWidth == 8) | ||
| 593 | McHorVer02Height9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 594 | } | ||
| 595 | void McHorVer22Width9Or17Height9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, | ||
| 596 | int32_t iDstStride, | ||
| 597 | int32_t iWidth, int32_t iHeight) { | ||
| 598 | if (iWidth == 17) | ||
| 599 | McHorVer22Width17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 600 | else //if (iWidth == 9) | ||
| 601 | McHorVer22Width9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 602 | } | ||
| 603 | void EncMcHorVer11_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 604 | int32_t iHeight) { | ||
| 605 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 606 | McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pTmp, 16, iHeight); | ||
| 607 | McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 608 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 609 | } | ||
| 610 | void EncMcHorVer12_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 611 | int32_t iHeight) { | ||
| 612 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 613 | McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pTmp, 16, iHeight); | ||
| 614 | McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 615 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 616 | } | ||
| 617 | void EncMcHorVer13_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 618 | int32_t iHeight) { | ||
| 619 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 620 | McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); | ||
| 621 | McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 622 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 623 | } | ||
| 624 | void EncMcHorVer21_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 625 | int32_t iHeight) { | ||
| 626 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 627 | McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pTmp, 16, iHeight); | ||
| 628 | McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 629 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 630 | } | ||
| 631 | void EncMcHorVer23_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 632 | int32_t iHeight) { | ||
| 633 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 634 | McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); | ||
| 635 | McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 636 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 637 | } | ||
| 638 | void EncMcHorVer31_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 639 | int32_t iHeight) { | ||
| 640 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 641 | McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pTmp, 16, iHeight); | ||
| 642 | McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 643 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 644 | } | ||
| 645 | void EncMcHorVer32_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 646 | int32_t iHeight) { | ||
| 647 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 648 | McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pTmp, 16, iHeight); | ||
| 649 | McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 650 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 651 | } | ||
| 652 | void EncMcHorVer33_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 653 | int32_t iHeight) { | ||
| 654 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 512, 16) | ||
| 655 | McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); | ||
| 656 | McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, &pTmp[256], 16, iHeight); | ||
| 657 | PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pTmp, 16, &pTmp[256], 16, iHeight); | ||
| 658 | } | ||
| 659 | void EncMcChroma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 660 | SMVUnitXY sMv, int32_t iWidth, int32_t iHeight) { | ||
| 661 | const int32_t kiD8x = sMv.iMvX & 0x07; | ||
| 662 | const int32_t kiD8y = sMv.iMvY & 0x07; | ||
| 663 | if (0 == kiD8x && 0 == kiD8y) { | ||
| 664 | if (8 == iWidth) | ||
| 665 | McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 666 | else // iWidth == 4 | ||
| 667 | McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | ||
| 668 | } else { | ||
| 669 | if (8 == iWidth) | ||
| 670 | McChromaWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | ||
| 570 | else //if(4 == iWidth) | 671 | else //if(4 == iWidth) |
| 571 | McChromaWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight); | 672 | McChromaWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); |
| 572 | } | 673 | } |
| 573 | } | 674 | } |
| 574 | #endif | 675 | #endif |
| @@ -599,7 +700,14 @@ void WelsInitMcFuncs (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag) { · 24 unmodified lines | |||
| 599 | McHorVer03WidthEq16_neon, EncMcHorVer13_neon, EncMcHorVer23_neon, EncMcHorVer33_neon | 700 | McHorVer03WidthEq16_neon, EncMcHorVer13_neon, EncMcHorVer23_neon, EncMcHorVer33_neon |
| 600 | }; | 701 | }; |
| 601 | #endif | 702 | #endif |
| 602 | 703 | #if defined(HAVE_NEON_AARCH64) | |
| 704 | static PWelsLumaQuarpelMcFunc pWelsMcFuncWidthEq16_AArch64_neon[16] = { //[x][y] | ||
| 705 | McCopyWidthEq16_AArch64_neon, McHorVer10WidthEq16_AArch64_neon, McHorVer20WidthEq16_AArch64_neon, McHorVer30WidthEq16_AArch64_neon, | ||
| 706 | McHorVer01WidthEq16_AArch64_neon, EncMcHorVer11_AArch64_neon, EncMcHorVer21_AArch64_neon, EncMcHorVer31_AArch64_neon, | ||
| 707 | McHorVer02WidthEq16_AArch64_neon, EncMcHorVer12_AArch64_neon, McHorVer22WidthEq16_AArch64_neon, EncMcHorVer32_AArch64_neon, | ||
| 708 | McHorVer03WidthEq16_AArch64_neon, EncMcHorVer13_AArch64_neon, EncMcHorVer23_AArch64_neon, EncMcHorVer33_AArch64_neon | ||
| 709 | }; | ||
| 710 | #endif | ||
| 603 | pFuncList->sMcFuncs.pfLumaHalfpelHor = McHorVer20_c; | 711 | pFuncList->sMcFuncs.pfLumaHalfpelHor = McHorVer20_c; |
| 604 | pFuncList->sMcFuncs.pfLumaHalfpelVer = McHorVer02_c; | 712 | pFuncList->sMcFuncs.pfLumaHalfpelVer = McHorVer02_c; |
| 605 | pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22_c; | 713 | pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22_c; |
| @@ -651,5 +759,16 @@ void WelsInitMcFuncs (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag) { · 45 unmodified lines | |||
| 651 | pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_neon;//iWidth+1/heigh+1 | 759 | pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_neon;//iWidth+1/heigh+1 |
| 652 | } | 760 | } |
| 653 | #endif | 761 | #endif |
| 762 | #if defined(HAVE_NEON_AARCH64) | ||
| 763 | if (uiCpuFlag & WELS_CPU_NEON) { | ||
| 764 | pFuncList->sMcFuncs.pfLumaQuarpelMc = pWelsMcFuncWidthEq16_AArch64_neon; | ||
| 765 | pFuncList->sMcFuncs.pfChromaMc = EncMcChroma_AArch64_neon; | ||
| 766 | pFuncList->sMcFuncs.pfSampleAveraging[0] = PixStrideAvgWidthEq8_AArch64_neon; | ||
| 767 | pFuncList->sMcFuncs.pfSampleAveraging[1] = PixStrideAvgWidthEq16_AArch64_neon; | ||
| 768 | pFuncList->sMcFuncs.pfLumaHalfpelHor = McHorVer20Width9Or17_AArch64_neon;//iWidth+1:8/16 | ||
| 769 | pFuncList->sMcFuncs.pfLumaHalfpelVer = McHorVer02Height9Or17_AArch64_neon;//heigh+1:8/16 | ||
| 770 | pFuncList->sMcFuncs.pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_AArch64_neon;//iWidth+1/heigh+1 | ||
| 771 | } | ||
| 772 | #endif | ||
| 654 | } | 773 | } |
| 655 | } | 774 | } |