History

Move the MC routines to the common library

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).

Martin Storsjö committed 11 years ago

Commit 9a066361 parent 1a7d0ab18 files · +176 −1082Browse files

Showing the changes to test/encoder/EncUT_MotionCompensation.cpp (1 of 18 files). Show all

Unified · Split

test/encoder/EncUT_MotionCompensation.cpp+4−5
@@ -1,10 +1,9 @@
1#include <gtest/gtest.h>1#include <gtest/gtest.h>
2#include "codec_def.h"2#include "codec_def.h"
3#include "macros.h"
3#include "mc.h"4#include "mc.h"
4#include "cpu.h"5#include "cpu.h"
5using namespace WelsEnc;6using namespace WelsCommon;
6
7#define InitMcFunc WelsInitMcFuncs
8 7
9#include "mc_test_common.h"8#include "mc_test_common.h"
10 9
@@ -27,7 +26,7 @@ TEST (EncMcAvg, PixelAvg) { · 16 unmodified lines
27 int32_t width = 8 << w;26 int32_t width = 8 << w;
28 int32_t height = 16;27 int32_t height = 16;
29 uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL);28 uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL);
30 WelsInitMcFuncs (&sMcFunc, uiCpuFlag);29 InitMcFunc (&sMcFunc, uiCpuFlag);
31 uint8_t uSrc1[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE];30 uint8_t uSrc1[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE];
32 uint8_t uSrc2[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE];31 uint8_t uSrc2[MC_BUFF_HEIGHT][MC_BUFF_SRC_STRIDE];
33 ENFORCE_STACK_ALIGN_2D (uint8_t, uDstAnchor, MC_BUFF_HEIGHT, MC_BUFF_DST_STRIDE, 16);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 uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL);77 uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL);
79 WelsInitMcFuncs (&sMcFunc, uiCpuFlag);78 InitMcFunc (&sMcFunc, uiCpuFlag);
80 79
81 MCHalfPelFilterAnchor (uAnchors[1], uAnchors[2], uAnchors[3], uAnchors[0], MC_BUFF_SRC_STRIDE, width, height, pBuf + 4);80 MCHalfPelFilterAnchor (uAnchors[1], uAnchors[2], uAnchors[3], uAnchors[0], MC_BUFF_SRC_STRIDE, width, height, pBuf + 4);
82 sMcFunc.pfLumaHalfpelHor (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width + 1, height);81 sMcFunc.pfLumaHalfpelHor (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width + 1, height);

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