Use the decoder versions of the functions (which are capable of handling widths 4/8/16 for luma, not only 16 as in the encoder). By using the more generic versions, there may be a small performance loss since the functions need to check the width in every call. Actual measurements show that the actual change is very small (and the shared routines turn out to actually be faster than the existing ones in ARM NEON setups).
Showing the changes to test/encoder/EncUT_MotionCompensation.cpp (1 of 18 files). Show all
Unified · Split
| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | #include <gtest/gtest.h> |
| 2 | 2 | #include "codec_def.h" |
| 3 | +#include "macros.h" | |
| 3 | 4 | #include "mc.h" |
| 4 | 5 | #include "cpu.h" |
| 5 | −using namespace WelsEnc; | |
| 6 | − | |
| 7 | −#define InitMcFunc WelsInitMcFuncs | |
| 6 | +using namespace WelsCommon; | |
| 8 | 7 | |
| 9 | 8 | #include "mc_test_common.h" |
| 10 | 9 | |
| @@ -27,7 +26,7 @@ TEST (EncMcAvg, PixelAvg) { · 16 unmodified lines | ||
| 27 | 26 | int32_t width = 8 << w; |
| 28 | 27 | int32_t height = 16; |
| 29 | 28 | uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL); |
| 30 | − WelsInitMcFuncs (&sMcFunc, uiCpuFlag); | |
| 29 | + InitMcFunc (&sMcFunc, uiCpuFlag); | |
| 31 | 30 | uint8_t uSrc1[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE]; |
| 32 | 31 | uint8_t uSrc2[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE]; |
| 33 | 32 | ENFORCE_STACK_ALIGN_2D (uint8_t, uDstAnchor, MC_BUFF_HEIGHT, MC_BUFF_DST_STRIDE, 16); |
| @@ -76,7 +75,7 @@ TEST (EncMcHalfpel, LumaHalfpel) { · 42 unmodified lines | ||
| 76 | 75 | } |
| 77 | 76 | |
| 78 | 77 | uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL); |
| 79 | − WelsInitMcFuncs (&sMcFunc, uiCpuFlag); | |
| 78 | + InitMcFunc (&sMcFunc, uiCpuFlag); | |
| 80 | 79 | |
| 81 | 80 | MCHalfPelFilterAnchor (uAnchors[1], uAnchors[2], uAnchors[3], uAnchors[0], MC_BUFF_SRC_STRIDE, width, height, pBuf + 4); |
| 82 | 81 | sMcFunc.pfLumaHalfpelHor (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width + 1, height); |