reformat cpp files for unit tests
This commit is contained in:
@@ -70,7 +70,8 @@ void BaseEncoderTest::TearDown() {
|
|||||||
|
|
||||||
void BaseEncoderTest::EncodeStream (InputStream* in, EUsageType usageType, int width, int height,
|
void BaseEncoderTest::EncodeStream (InputStream* in, EUsageType usageType, int width, int height,
|
||||||
float frameRate, SliceModeEnum slices, bool denoise, int layers, bool losslessLink, bool enableLtr, Callback* cbk) {
|
float frameRate, SliceModeEnum slices, bool denoise, int layers, bool losslessLink, bool enableLtr, Callback* cbk) {
|
||||||
int rv = InitWithParam (encoder_, usageType, width, height, frameRate, slices, denoise, layers, losslessLink, enableLtr);
|
int rv = InitWithParam (encoder_, usageType, width, height, frameRate, slices, denoise, layers, losslessLink,
|
||||||
|
enableLtr);
|
||||||
ASSERT_TRUE (rv == cmResultSuccess);
|
ASSERT_TRUE (rv == cmResultSuccess);
|
||||||
|
|
||||||
// I420: 1(Y) + 1/4(U) + 1/4(V)
|
// I420: 1(Y) + 1/4(U) + 1/4(V)
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ TEST_P (DecodeEncodeTest, CompareOutput) {
|
|||||||
#else
|
#else
|
||||||
ASSERT_TRUE (Open (p.fileName));
|
ASSERT_TRUE (Open (p.fileName));
|
||||||
#endif
|
#endif
|
||||||
EncodeStream (this, CAMERA_VIDEO_REAL_TIME, p.width, p.height, p.frameRate, SM_SINGLE_SLICE, false, 1, false, false, this);
|
EncodeStream (this, CAMERA_VIDEO_REAL_TIME, p.width, p.height, p.frameRate, SM_SINGLE_SLICE, false, 1, false, false,
|
||||||
|
this);
|
||||||
unsigned char digest[SHA_DIGEST_LENGTH];
|
unsigned char digest[SHA_DIGEST_LENGTH];
|
||||||
SHA1Result (&ctx_, digest);
|
SHA1Result (&ctx_, digest);
|
||||||
if (!HasFatalFailure()) {
|
if (!HasFatalFailure()) {
|
||||||
|
|||||||
@@ -61,9 +61,11 @@ TEST_P (EncoderOutputTest, CompareOutput) {
|
|||||||
EncodeFileParam p = GetParam();
|
EncodeFileParam p = GetParam();
|
||||||
#if defined(ANDROID_NDK)
|
#if defined(ANDROID_NDK)
|
||||||
std::string filename = std::string ("/sdcard/") + p.fileName;
|
std::string filename = std::string ("/sdcard/") + p.fileName;
|
||||||
EncodeFile (filename.c_str(), p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless, p.enableLtr, this);
|
EncodeFile (filename.c_str(), p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless,
|
||||||
|
p.enableLtr, this);
|
||||||
#else
|
#else
|
||||||
EncodeFile (p.fileName, p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless, p.enableLtr, this);
|
EncodeFile (p.fileName, p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless,
|
||||||
|
p.enableLtr, this);
|
||||||
#endif
|
#endif
|
||||||
//will remove this after screen content algorithms are ready,
|
//will remove this after screen content algorithms are ready,
|
||||||
//because the bitstream output will vary when the different algorithms are added.
|
//because the bitstream output will vary when the different algorithms are added.
|
||||||
|
|||||||
@@ -85,11 +85,11 @@ void EncoderInterfaceTest::PrepareOneSrcFrame() {
|
|||||||
pSrcPic->iPicHeight = pParamExt->iPicHeight;
|
pSrcPic->iPicHeight = pParamExt->iPicHeight;
|
||||||
|
|
||||||
pYUV[0] = rand() % 256;
|
pYUV[0] = rand() % 256;
|
||||||
for (int i = 1; i < m_iPicResSize; i++){
|
for (int i = 1; i < m_iPicResSize; i++) {
|
||||||
if((i%256) == 0)
|
if ((i % 256) == 0)
|
||||||
pYUV[i] = rand() % 256;
|
pYUV[i] = rand() % 256;
|
||||||
else
|
else
|
||||||
pYUV[i] = WELS_CLIP3(pYUV[i-1]+(rand()%3)-1,0,255);
|
pYUV[i] = WELS_CLIP3 (pYUV[i - 1] + (rand() % 3) - 1, 0, 255);
|
||||||
}
|
}
|
||||||
pSrcPic->iStride[0] = m_iWidth;
|
pSrcPic->iStride[0] = m_iWidth;
|
||||||
pSrcPic->iStride[1] = pSrcPic->iStride[2] = pSrcPic->iStride[0] >> 1;
|
pSrcPic->iStride[1] = pSrcPic->iStride[2] = pSrcPic->iStride[0] >> 1;
|
||||||
@@ -153,7 +153,7 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) {
|
|||||||
iValue = rand() % 256;
|
iValue = rand() % 256;
|
||||||
iResult = pPtrEnc->SetOption (eOptionId, &iValue);
|
iResult = pPtrEnc->SetOption (eOptionId, &iValue);
|
||||||
|
|
||||||
if (iValue ==0)
|
if (iValue == 0)
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
||||||
else
|
else
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
@@ -186,9 +186,9 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) {
|
|||||||
fValue = static_cast<int> (rand() % 60 - 5);
|
fValue = static_cast<int> (rand() % 60 - 5);
|
||||||
iResult = pPtrEnc->SetOption (eOptionId, &fValue);
|
iResult = pPtrEnc->SetOption (eOptionId, &fValue);
|
||||||
|
|
||||||
if (fValue <=0)
|
if (fValue <= 0)
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
||||||
else{
|
else {
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
|
|
||||||
iResult = pPtrEnc->GetOption (eOptionId, &fReturn);
|
iResult = pPtrEnc->GetOption (eOptionId, &fReturn);
|
||||||
@@ -201,15 +201,15 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) {
|
|||||||
pSrcPic->uiTimeStamp += 30;
|
pSrcPic->uiTimeStamp += 30;
|
||||||
|
|
||||||
eOptionId = ENCODER_OPTION_BITRATE;
|
eOptionId = ENCODER_OPTION_BITRATE;
|
||||||
SBitrateInfo sInfo,sReturn;
|
SBitrateInfo sInfo, sReturn;
|
||||||
sInfo.iBitrate = rand() % 100000 - 100;
|
sInfo.iBitrate = rand() % 100000 - 100;
|
||||||
sInfo.iLayer = static_cast<LAYER_NUM>(pParamExt->iSpatialLayerNum);
|
sInfo.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum);
|
||||||
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
|
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
|
||||||
if (sInfo.iBitrate <=0)
|
if (sInfo.iBitrate <= 0)
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
||||||
else{
|
else {
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
sReturn.iLayer = static_cast<LAYER_NUM>(pParamExt->iSpatialLayerNum);
|
sReturn.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum);
|
||||||
iResult = pPtrEnc->GetOption (eOptionId, &sReturn);
|
iResult = pPtrEnc->GetOption (eOptionId, &sReturn);
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate);
|
EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate);
|
||||||
@@ -221,13 +221,13 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) {
|
|||||||
|
|
||||||
eOptionId = ENCODER_OPTION_MAX_BITRATE;
|
eOptionId = ENCODER_OPTION_MAX_BITRATE;
|
||||||
sInfo.iBitrate = rand() % 100000 - 100;
|
sInfo.iBitrate = rand() % 100000 - 100;
|
||||||
sInfo.iLayer = static_cast<LAYER_NUM>(pParamExt->iSpatialLayerNum);
|
sInfo.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum);
|
||||||
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
|
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
|
||||||
if (sInfo.iBitrate <=0)
|
if (sInfo.iBitrate <= 0)
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
|
||||||
else{
|
else {
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
sReturn.iLayer = static_cast<LAYER_NUM>(pParamExt->iSpatialLayerNum);
|
sReturn.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum);
|
||||||
iResult = pPtrEnc->GetOption (eOptionId, &sReturn);
|
iResult = pPtrEnc->GetOption (eOptionId, &sReturn);
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate);
|
EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate);
|
||||||
@@ -261,8 +261,8 @@ TEST_F (EncoderInterfaceTest, TemporalLayerSettingTest) {
|
|||||||
pParamExt->iTemporalLayerNum = 1;
|
pParamExt->iTemporalLayerNum = 1;
|
||||||
pParamExt->iSpatialLayerNum = 1;
|
pParamExt->iSpatialLayerNum = 1;
|
||||||
|
|
||||||
for(int i = 0; i < 2; i++){
|
for (int i = 0; i < 2; i++) {
|
||||||
pParamExt->iUsageType = (( i == 0 ) ? SCREEN_CONTENT_REAL_TIME : CAMERA_VIDEO_REAL_TIME);
|
pParamExt->iUsageType = ((i == 0) ? SCREEN_CONTENT_REAL_TIME : CAMERA_VIDEO_REAL_TIME);
|
||||||
int iResult = pPtrEnc->InitializeExt (pParamExt);
|
int iResult = pPtrEnc->InitializeExt (pParamExt);
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
|
|
||||||
@@ -328,9 +328,9 @@ TEST_F (EncoderInterfaceTest, TemporalLayerSettingTest) {
|
|||||||
ENCODER_OPTION eOptionId = ENCODER_OPTION_SVC_ENCODE_PARAM_EXT;
|
ENCODER_OPTION eOptionId = ENCODER_OPTION_SVC_ENCODE_PARAM_EXT;
|
||||||
memcpy (pOption, pParamExt, sizeof (SEncParamExt));
|
memcpy (pOption, pParamExt, sizeof (SEncParamExt));
|
||||||
|
|
||||||
for(int i = 0; i < kiFrameNumber; i ++){
|
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||||
if ((i%7) == 0){
|
if ((i % 7) == 0) {
|
||||||
if (pOption->iTemporalLayerNum<4){
|
if (pOption->iTemporalLayerNum < 4) {
|
||||||
pOption->iTemporalLayerNum++;
|
pOption->iTemporalLayerNum++;
|
||||||
} else {
|
} else {
|
||||||
pOption->iTemporalLayerNum--;
|
pOption->iTemporalLayerNum--;
|
||||||
@@ -371,7 +371,7 @@ TEST_F (EncoderInterfaceTest, MemoryCheckTest) {
|
|||||||
pYUV = new unsigned char [m_iPicResSize];
|
pYUV = new unsigned char [m_iPicResSize];
|
||||||
PrepareOneSrcFrame();
|
PrepareOneSrcFrame();
|
||||||
|
|
||||||
for(int i = 0; i < kiFrameNumber; i ++){
|
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||||
int iStartX = rand() % (m_iPicResSize >> 1);
|
int iStartX = rand() % (m_iPicResSize >> 1);
|
||||||
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
||||||
for (int j = iStartX; j < iEndX; j++)
|
for (int j = iStartX; j < iEndX; j++)
|
||||||
@@ -400,7 +400,7 @@ TEST_F (EncoderInterfaceTest, MemoryCheckTest) {
|
|||||||
iResult = pPtrEnc->SetOption (eOptionId, pOption);
|
iResult = pPtrEnc->SetOption (eOptionId, pOption);
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
|
|
||||||
for(int i = 0; i < kiFrameNumber; i ++){
|
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||||
int iStartX = rand() % (m_iPicResSize >> 1);
|
int iStartX = rand() % (m_iPicResSize >> 1);
|
||||||
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
||||||
for (int j = iStartX; j < iEndX; j++)
|
for (int j = iStartX; j < iEndX; j++)
|
||||||
@@ -415,7 +415,7 @@ TEST_F (EncoderInterfaceTest, MemoryCheckTest) {
|
|||||||
iResult = pPtrEnc->SetOption (eOptionId, pOption);
|
iResult = pPtrEnc->SetOption (eOptionId, pOption);
|
||||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||||
|
|
||||||
for(int i = 0; i < kiFrameNumber; i ++){
|
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||||
int iStartX = rand() % (m_iPicResSize >> 1);
|
int iStartX = rand() % (m_iPicResSize >> 1);
|
||||||
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
||||||
for (int j = iStartX; j < iEndX; j++)
|
for (int j = iStartX; j < iEndX; j++)
|
||||||
@@ -434,8 +434,8 @@ void GetValidEncParamBase (SEncParamBase* pEncParamBase) {
|
|||||||
pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;
|
pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;
|
||||||
pEncParamBase->iPicWidth = 2 + ((rand() % ((MAX_WIDTH >> 1) - 1)) << 1);
|
pEncParamBase->iPicWidth = 2 + ((rand() % ((MAX_WIDTH >> 1) - 1)) << 1);
|
||||||
pEncParamBase->iPicHeight = 2 + ((rand() % ((MAX_HEIGHT >> 1) - 1)) << 1);
|
pEncParamBase->iPicHeight = 2 + ((rand() % ((MAX_HEIGHT >> 1) - 1)) << 1);
|
||||||
pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth);
|
pEncParamBase->iPicWidth = VALID_SIZE (pEncParamBase->iPicWidth);
|
||||||
pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight);
|
pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);
|
||||||
pEncParamBase->iTargetBitrate = rand() + 1; //!=0
|
pEncParamBase->iTargetBitrate = rand() + 1; //!=0
|
||||||
pEncParamBase->iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2
|
pEncParamBase->iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2
|
||||||
pEncParamBase->fMaxFrameRate = rand() + 0.5f; //!=0
|
pEncParamBase->fMaxFrameRate = rand() + 0.5f; //!=0
|
||||||
|
|||||||
@@ -80,18 +80,18 @@ void SumOf16x16BlockOfFrame_ref (uint8_t* pRefPicture, const int32_t kiWidth, co
|
|||||||
|
|
||||||
|
|
||||||
void InitializeHashforFeature_ref (uint32_t* pTimesOfFeatureValue, uint16_t* pBuf, const int32_t kiListSize,
|
void InitializeHashforFeature_ref (uint32_t* pTimesOfFeatureValue, uint16_t* pBuf, const int32_t kiListSize,
|
||||||
uint16_t** pLocationOfFeature, uint16_t** pFeatureValuePointerList) {
|
uint16_t** pLocationOfFeature, uint16_t** pFeatureValuePointerList) {
|
||||||
//assign location pointer
|
//assign location pointer
|
||||||
uint16_t* pBufPos = pBuf;
|
uint16_t* pBufPos = pBuf;
|
||||||
for (int32_t i = 0 ; i < kiListSize; ++i) {
|
for (int32_t i = 0 ; i < kiListSize; ++i) {
|
||||||
pLocationOfFeature[i] =
|
pLocationOfFeature[i] =
|
||||||
pFeatureValuePointerList[i] = pBufPos;
|
pFeatureValuePointerList[i] = pBufPos;
|
||||||
pBufPos += (pTimesOfFeatureValue[i] << 1);
|
pBufPos += (pTimesOfFeatureValue[i] << 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void FillQpelLocationByFeatureValue_ref (uint16_t* pFeatureOfBlock, const int32_t kiWidth, const int32_t kiHeight,
|
void FillQpelLocationByFeatureValue_ref (uint16_t* pFeatureOfBlock, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
uint16_t** pFeatureValuePointerList) {
|
uint16_t** pFeatureValuePointerList) {
|
||||||
//assign each pixel's position
|
//assign each pixel's position
|
||||||
uint16_t* pSrcPointer = pFeatureOfBlock;
|
uint16_t* pSrcPointer = pFeatureOfBlock;
|
||||||
int32_t iQpelY = 0;
|
int32_t iQpelY = 0;
|
||||||
for (int32_t y = 0; y < kiHeight; y++) {
|
for (int32_t y = 0; y < kiHeight; y++) {
|
||||||
@@ -246,9 +246,11 @@ GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashf
|
|||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_c, 640, 320)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_c, 640, 320)
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_sse2, 10, 10)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_sse2, 10, 10)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_sse2, 16, 16)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_sse2, 16,
|
||||||
|
16)
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_sse2, 640, 320)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_sse2, 640, 320)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_sse2, 640, 320)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_sse2, 640,
|
||||||
|
320)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_c, 1, 1)
|
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_c, 1, 1)
|
||||||
@@ -282,9 +284,11 @@ GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_neon, 1,
|
|||||||
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_neon, 640, 320)
|
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_neon, 640, 320)
|
||||||
GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_neon, 640, 320)
|
GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_neon, 640, 320)
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_neon, 10, 10)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_neon, 10, 10)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_neon, 16, 16)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_neon, 16,
|
||||||
|
16)
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_neon, 640, 320)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_neon, 640, 320)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_neon, 640, 320)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_neon, 640,
|
||||||
|
320)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
#ifdef HAVE_NEON_AARCH64
|
||||||
@@ -295,7 +299,9 @@ GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_AArch64_
|
|||||||
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_AArch64_neon, 640, 320)
|
GENERATE_SumOfFrame (SumOf8x8BlockOfFrame_ref, SumOf8x8BlockOfFrame_AArch64_neon, 640, 320)
|
||||||
GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_AArch64_neon, 640, 320)
|
GENERATE_SumOfFrame (SumOf16x16BlockOfFrame_ref, SumOf16x16BlockOfFrame_AArch64_neon, 640, 320)
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_AArch64_neon, 10, 10)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_AArch64_neon, 10, 10)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_AArch64_neon, 16, 16)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref,
|
||||||
|
FillQpelLocationByFeatureValue_AArch64_neon, 16, 16)
|
||||||
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_AArch64_neon, 640, 320)
|
GENERATE_InitializeHashforFeature (InitializeHashforFeature_ref, InitializeHashforFeature_AArch64_neon, 640, 320)
|
||||||
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref, FillQpelLocationByFeatureValue_AArch64_neon, 640, 320)
|
GENERATE_FillQpelLocationByFeatureValue (FillQpelLocationByFeatureValue_ref,
|
||||||
|
FillQpelLocationByFeatureValue_AArch64_neon, 640, 320)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -103,26 +103,26 @@ TEST (IntraSadSatdFuncTest, func) { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Sad_ssse3, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_SSSE3)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Sad_ssse3, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_SSSE3)
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Satd_sse41, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_SSE41)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Satd_sse41, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_SSE41)
|
||||||
GENERATE_Intra8x8_UT(WelsIntraChroma8x8Combined3Satd_sse41, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_SSE41)
|
GENERATE_Intra8x8_UT (WelsIntraChroma8x8Combined3Satd_sse41, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_SSE41)
|
||||||
GENERATE_Intra4x4_UT(WelsSampleSatdThree4x4_sse2, 1, WELS_CPU_SSE2)
|
GENERATE_Intra4x4_UT (WelsSampleSatdThree4x4_sse2, 1, WELS_CPU_SSE2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON
|
#ifdef HAVE_NEON
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Sad_neon, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Sad_neon, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Satd_neon, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Satd_neon, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra8x8_UT(WelsIntra8x8Combined3Satd_neon, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra8x8_UT (WelsIntra8x8Combined3Satd_neon, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra8x8_UT(WelsIntra8x8Combined3Sad_neon, WelsSampleSadIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra8x8_UT (WelsIntra8x8Combined3Sad_neon, WelsSampleSadIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra4x4_UT(WelsIntra4x4Combined3Satd_neon, 1, WELS_CPU_NEON)
|
GENERATE_Intra4x4_UT (WelsIntra4x4Combined3Satd_neon, 1, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
#ifdef HAVE_NEON_AARCH64
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Sad_AArch64_neon, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Sad_AArch64_neon, WelsSampleSadIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra16x16_UT(WelsIntra16x16Combined3Satd_AArch64_neon, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra16x16_UT (WelsIntra16x16Combined3Satd_AArch64_neon, WelsSampleSatdIntra16x16Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra8x8_UT(WelsIntra8x8Combined3Satd_AArch64_neon, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra8x8_UT (WelsIntra8x8Combined3Satd_AArch64_neon, WelsSampleSatdIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra8x8_UT(WelsIntra8x8Combined3Sad_AArch64_neon, WelsSampleSadIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
GENERATE_Intra8x8_UT (WelsIntra8x8Combined3Sad_AArch64_neon, WelsSampleSadIntra8x8Combined3_c, 1, WELS_CPU_NEON)
|
||||||
GENERATE_Intra4x4_UT(WelsIntra4x4Combined3Satd_AArch64_neon, 1, WELS_CPU_NEON)
|
GENERATE_Intra4x4_UT (WelsIntra4x4Combined3Satd_AArch64_neon, 1, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ASSERT_MEMORY_FAIL2X(A, B) \
|
#define ASSERT_MEMORY_FAIL2X(A, B) \
|
||||||
@@ -537,51 +537,51 @@ TEST_F (SadSatdAssemblyFuncTest, func) { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSad4x4_mmx, WelsSampleSad4x4_c, WELS_CPU_MMXEXT)
|
GENERATE_Sad4x4_UT (WelsSampleSad4x4_mmx, WelsSampleSad4x4_c, WELS_CPU_MMXEXT)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSad8x8_sse21, WelsSampleSad8x8_c, WELS_CPU_SSE2)
|
GENERATE_Sad8x8_UT (WelsSampleSad8x8_sse21, WelsSampleSad8x8_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSad8x16_sse2, WelsSampleSad8x16_c, WELS_CPU_SSE2)
|
GENERATE_Sad8x16_UT (WelsSampleSad8x16_sse2, WelsSampleSad8x16_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSad16x8_sse2, WelsSampleSad16x8_c, WELS_CPU_SSE2)
|
GENERATE_Sad16x8_UT (WelsSampleSad16x8_sse2, WelsSampleSad16x8_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSad16x16_sse2, WelsSampleSad16x16_c, WELS_CPU_SSE2)
|
GENERATE_Sad16x16_UT (WelsSampleSad16x16_sse2, WelsSampleSad16x16_c, WELS_CPU_SSE2)
|
||||||
|
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSatd4x4_sse2, WelsSampleSatd4x4_c, WELS_CPU_SSE2)
|
GENERATE_Sad4x4_UT (WelsSampleSatd4x4_sse2, WelsSampleSatd4x4_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSatd8x8_sse2, WelsSampleSatd8x8_c, WELS_CPU_SSE2)
|
GENERATE_Sad8x8_UT (WelsSampleSatd8x8_sse2, WelsSampleSatd8x8_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSatd8x16_sse2, WelsSampleSatd8x16_c, WELS_CPU_SSE2)
|
GENERATE_Sad8x16_UT (WelsSampleSatd8x16_sse2, WelsSampleSatd8x16_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSatd16x8_sse2, WelsSampleSatd16x8_c, WELS_CPU_SSE2)
|
GENERATE_Sad16x8_UT (WelsSampleSatd16x8_sse2, WelsSampleSatd16x8_c, WELS_CPU_SSE2)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSatd16x16_sse2, WelsSampleSatd16x16_c, WELS_CPU_SSE2)
|
GENERATE_Sad16x16_UT (WelsSampleSatd16x16_sse2, WelsSampleSatd16x16_c, WELS_CPU_SSE2)
|
||||||
|
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSatd4x4_sse41, WelsSampleSatd4x4_c, WELS_CPU_SSE41)
|
GENERATE_Sad4x4_UT (WelsSampleSatd4x4_sse41, WelsSampleSatd4x4_c, WELS_CPU_SSE41)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSatd8x8_sse41, WelsSampleSatd8x8_c, WELS_CPU_SSE41)
|
GENERATE_Sad8x8_UT (WelsSampleSatd8x8_sse41, WelsSampleSatd8x8_c, WELS_CPU_SSE41)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSatd8x16_sse41, WelsSampleSatd8x16_c, WELS_CPU_SSE41)
|
GENERATE_Sad8x16_UT (WelsSampleSatd8x16_sse41, WelsSampleSatd8x16_c, WELS_CPU_SSE41)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSatd16x8_sse41, WelsSampleSatd16x8_c, WELS_CPU_SSE41)
|
GENERATE_Sad16x8_UT (WelsSampleSatd16x8_sse41, WelsSampleSatd16x8_c, WELS_CPU_SSE41)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSatd16x16_sse41, WelsSampleSatd16x16_c, WELS_CPU_SSE41)
|
GENERATE_Sad16x16_UT (WelsSampleSatd16x16_sse41, WelsSampleSatd16x16_c, WELS_CPU_SSE41)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON
|
#ifdef HAVE_NEON
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSad4x4_neon, WelsSampleSad4x4_c, WELS_CPU_NEON)
|
GENERATE_Sad4x4_UT (WelsSampleSad4x4_neon, WelsSampleSad4x4_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSad8x8_neon, WelsSampleSad8x8_c, WELS_CPU_NEON)
|
GENERATE_Sad8x8_UT (WelsSampleSad8x8_neon, WelsSampleSad8x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSad8x16_neon, WelsSampleSad8x16_c, WELS_CPU_NEON)
|
GENERATE_Sad8x16_UT (WelsSampleSad8x16_neon, WelsSampleSad8x16_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSad16x8_neon, WelsSampleSad16x8_c, WELS_CPU_NEON)
|
GENERATE_Sad16x8_UT (WelsSampleSad16x8_neon, WelsSampleSad16x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSad16x16_neon, WelsSampleSad16x16_c, WELS_CPU_NEON)
|
GENERATE_Sad16x16_UT (WelsSampleSad16x16_neon, WelsSampleSad16x16_c, WELS_CPU_NEON)
|
||||||
|
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSatd4x4_neon, WelsSampleSatd4x4_c, WELS_CPU_NEON)
|
GENERATE_Sad4x4_UT (WelsSampleSatd4x4_neon, WelsSampleSatd4x4_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSatd8x8_neon, WelsSampleSatd8x8_c, WELS_CPU_NEON)
|
GENERATE_Sad8x8_UT (WelsSampleSatd8x8_neon, WelsSampleSatd8x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSatd8x16_neon, WelsSampleSatd8x16_c, WELS_CPU_NEON)
|
GENERATE_Sad8x16_UT (WelsSampleSatd8x16_neon, WelsSampleSatd8x16_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSatd16x8_neon, WelsSampleSatd16x8_c, WELS_CPU_NEON)
|
GENERATE_Sad16x8_UT (WelsSampleSatd16x8_neon, WelsSampleSatd16x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSatd16x16_neon, WelsSampleSatd16x16_c, WELS_CPU_NEON)
|
GENERATE_Sad16x16_UT (WelsSampleSatd16x16_neon, WelsSampleSatd16x16_c, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
#ifdef HAVE_NEON_AARCH64
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSad4x4_AArch64_neon, WelsSampleSad4x4_c, WELS_CPU_NEON)
|
GENERATE_Sad4x4_UT (WelsSampleSad4x4_AArch64_neon, WelsSampleSad4x4_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSad8x8_AArch64_neon, WelsSampleSad8x8_c, WELS_CPU_NEON)
|
GENERATE_Sad8x8_UT (WelsSampleSad8x8_AArch64_neon, WelsSampleSad8x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSad8x16_AArch64_neon, WelsSampleSad8x16_c, WELS_CPU_NEON)
|
GENERATE_Sad8x16_UT (WelsSampleSad8x16_AArch64_neon, WelsSampleSad8x16_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSad16x8_AArch64_neon, WelsSampleSad16x8_c, WELS_CPU_NEON)
|
GENERATE_Sad16x8_UT (WelsSampleSad16x8_AArch64_neon, WelsSampleSad16x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSad16x16_AArch64_neon, WelsSampleSad16x16_c, WELS_CPU_NEON)
|
GENERATE_Sad16x16_UT (WelsSampleSad16x16_AArch64_neon, WelsSampleSad16x16_c, WELS_CPU_NEON)
|
||||||
|
|
||||||
GENERATE_Sad4x4_UT(WelsSampleSatd4x4_AArch64_neon, WelsSampleSatd4x4_c, WELS_CPU_NEON)
|
GENERATE_Sad4x4_UT (WelsSampleSatd4x4_AArch64_neon, WelsSampleSatd4x4_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x8_UT(WelsSampleSatd8x8_AArch64_neon, WelsSampleSatd8x8_c, WELS_CPU_NEON)
|
GENERATE_Sad8x8_UT (WelsSampleSatd8x8_AArch64_neon, WelsSampleSatd8x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad8x16_UT(WelsSampleSatd8x16_AArch64_neon, WelsSampleSatd8x16_c, WELS_CPU_NEON)
|
GENERATE_Sad8x16_UT (WelsSampleSatd8x16_AArch64_neon, WelsSampleSatd8x16_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x8_UT(WelsSampleSatd16x8_AArch64_neon, WelsSampleSatd16x8_c, WELS_CPU_NEON)
|
GENERATE_Sad16x8_UT (WelsSampleSatd16x8_AArch64_neon, WelsSampleSatd16x8_c, WELS_CPU_NEON)
|
||||||
GENERATE_Sad16x16_UT(WelsSampleSatd16x16_AArch64_neon, WelsSampleSatd16x16_c, WELS_CPU_NEON)
|
GENERATE_Sad16x16_UT (WelsSampleSatd16x16_AArch64_neon, WelsSampleSatd16x16_c, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GENERATE_SadFour_UT(func, CPUFLAGS, width, height) \
|
#define GENERATE_SadFour_UT(func, CPUFLAGS, width, height) \
|
||||||
@@ -610,25 +610,25 @@ TEST_F (SadSatdAssemblyFuncTest, func) { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour4x4_sse2, WELS_CPU_SSE2, 4, 4)
|
GENERATE_SadFour_UT (WelsSampleSadFour4x4_sse2, WELS_CPU_SSE2, 4, 4)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x8_sse2, WELS_CPU_SSE2, 8, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x8_sse2, WELS_CPU_SSE2, 8, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x16_sse2, WELS_CPU_SSE2, 8, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x16_sse2, WELS_CPU_SSE2, 8, 16)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x8_sse2, WELS_CPU_SSE2, 16, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x8_sse2, WELS_CPU_SSE2, 16, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x16_sse2, WELS_CPU_SSE2, 16, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x16_sse2, WELS_CPU_SSE2, 16, 16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON
|
#ifdef HAVE_NEON
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour4x4_neon, WELS_CPU_NEON, 4, 4)
|
GENERATE_SadFour_UT (WelsSampleSadFour4x4_neon, WELS_CPU_NEON, 4, 4)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x8_neon, WELS_CPU_NEON, 8, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x8_neon, WELS_CPU_NEON, 8, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x16_neon, WELS_CPU_NEON, 8, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x16_neon, WELS_CPU_NEON, 8, 16)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x8_neon, WELS_CPU_NEON, 16, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x8_neon, WELS_CPU_NEON, 16, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x16_neon, WELS_CPU_NEON, 16, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x16_neon, WELS_CPU_NEON, 16, 16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
#ifdef HAVE_NEON_AARCH64
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour4x4_AArch64_neon, WELS_CPU_NEON, 4, 4)
|
GENERATE_SadFour_UT (WelsSampleSadFour4x4_AArch64_neon, WELS_CPU_NEON, 4, 4)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x8_AArch64_neon, WELS_CPU_NEON, 8, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x8_AArch64_neon, WELS_CPU_NEON, 8, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour8x16_AArch64_neon, WELS_CPU_NEON, 8, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour8x16_AArch64_neon, WELS_CPU_NEON, 8, 16)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x8_AArch64_neon, WELS_CPU_NEON, 16, 8)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x8_AArch64_neon, WELS_CPU_NEON, 16, 8)
|
||||||
GENERATE_SadFour_UT(WelsSampleSadFour16x16_AArch64_neon, WELS_CPU_NEON, 16, 16)
|
GENERATE_SadFour_UT (WelsSampleSadFour16x16_AArch64_neon, WELS_CPU_NEON, 16, 16)
|
||||||
#endif
|
#endif
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
using namespace WelsVP;
|
using namespace WelsVP;
|
||||||
|
|
||||||
void DyadicBilinearDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride,
|
void DyadicBilinearDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride,
|
uint8_t* pSrc, const int32_t kiSrcStride,
|
||||||
const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||||
uint8_t* pDstLine = pDst;
|
uint8_t* pDstLine = pDst;
|
||||||
uint8_t* pSrcLine = pSrc;
|
uint8_t* pSrcLine = pSrc;
|
||||||
const int32_t kiSrcStridex2 = kiSrcStride << 1;
|
const int32_t kiSrcStridex2 = kiSrcStride << 1;
|
||||||
@@ -30,8 +30,9 @@ void DyadicBilinearDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralBilinearFastDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight,
|
void GeneralBilinearFastDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
const int32_t kiDstHeight,
|
||||||
|
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||||
const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
|
const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
|
||||||
const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
|
const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
|
||||||
int32_t fScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
|
int32_t fScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
|
||||||
@@ -98,7 +99,8 @@ void GeneralBilinearFastDownsampler_ref (uint8_t* pDst, const int32_t kiDstStrid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralBilinearAccurateDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight,
|
void GeneralBilinearAccurateDownsampler_ref (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth,
|
||||||
|
const int32_t kiDstHeight,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||||
const int32_t kiScaleBit = 15;
|
const int32_t kiScaleBit = 15;
|
||||||
const int32_t kiScale = (1 << kiScaleBit);
|
const int32_t kiScale = (1 << kiScaleBit);
|
||||||
@@ -243,7 +245,8 @@ TEST (DownSampleTest, func) { \
|
|||||||
|
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_c, 0, 0)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_c, 0, 0)
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsampler_c, GeneralBilinearFastDownsampler_ref, 0, 0)
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsampler_c, GeneralBilinearFastDownsampler_ref, 0, 0)
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsampler_c, GeneralBilinearAccurateDownsampler_ref, 0, 0)
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsampler_c, GeneralBilinearAccurateDownsampler_ref, 0,
|
||||||
|
0)
|
||||||
|
|
||||||
#if defined(X86_ASM)
|
#if defined(X86_ASM)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_sse, 1, WELS_CPU_SSE)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_sse, 1, WELS_CPU_SSE)
|
||||||
@@ -256,20 +259,24 @@ GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx16_ssse3,
|
|||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_sse4, 1, WELS_CPU_SSE41)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_sse4, 1, WELS_CPU_SSE41)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx16_sse4, 1, WELS_CPU_SSE41)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx16_sse4, 1, WELS_CPU_SSE41)
|
||||||
|
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsamplerWrap_sse2, GeneralBilinearFastDownsampler_ref, 1, WELS_CPU_SSE2)
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsamplerWrap_sse2, GeneralBilinearFastDownsampler_ref, 1,
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_sse2, GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_SSE2)
|
WELS_CPU_SSE2)
|
||||||
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_sse2,
|
||||||
|
GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_SSE2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_neon, 1, WELS_CPU_NEON)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_neon, 1, WELS_CPU_NEON)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_neon, 1, WELS_CPU_NEON)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_neon, 1, WELS_CPU_NEON)
|
||||||
|
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_neon, GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_NEON)
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_neon,
|
||||||
|
GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON_AARCH64)
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_AArch64_neon, 1, WELS_CPU_NEON)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsamplerWidthx32_AArch64_neon, 1, WELS_CPU_NEON)
|
||||||
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_AArch64_neon, 1, WELS_CPU_NEON)
|
GENERATE_DyadicBilinearDownsampler_UT (DyadicBilinearDownsampler_AArch64_neon, 1, WELS_CPU_NEON)
|
||||||
|
|
||||||
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_AArch64_neon, GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_NEON)
|
GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_AArch64_neon,
|
||||||
|
GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_NEON)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user