Merge pull request #574 from ruil2/vp_update

move some common functions to common.cpp and add some functions in c...
This commit is contained in:
huili2 2014-03-25 00:58:06 -07:00
commit fa1dc73cdd
11 changed files with 274 additions and 141 deletions

View File

@ -1055,6 +1055,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\common\src\sad_common.cpp"
>
</File>
<File
RelativePath="..\..\..\encoder\core\src\sample.cpp"
>
@ -1572,6 +1576,10 @@
RelativePath="..\..\..\encoder\core\inc\ref_list_mgr_svc.h"
>
</File>
<File
RelativePath="..\..\..\common\inc\sad_common.h"
>
</File>
<File
RelativePath="..\..\..\encoder\core\inc\sample.h"
>

View File

@ -0,0 +1,96 @@
/*!
* \copy
* Copyright (c) 2013, Cisco Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef WELS_SAD_COMMON_H_
#define WELS_SAD_COMMON_H_
#include "typedefs.h"
//===================SAD=====================//
int32_t WelsSampleSad16x16_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
//int32_t WelsSampleSad8x4( uint8_t *, int32_t, uint8_t *, int32_t );
//int32_t WelsSampleSad4x8( uint8_t *, int32_t, uint8_t *, int32_t );
int32_t WelsSampleSad4x4_c (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour16x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour8x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour8x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour4x4_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
#if defined(__cplusplus)
extern "C" {
#endif//__cplusplus
#if defined (X86_ASM)
int32_t WelsSampleSad4x4_mmx (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_sse21 (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour4x4_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
#endif//X86_ASM
#if defined (HAVE_NEON)
int32_t WelsSampleSad4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
#endif
#if defined(__cplusplus)
}
#endif//__cplusplus
#endif //SAMPLE_H_

View File

@ -0,0 +1,107 @@
/*!
* \copy
* Copyright (c) 2009-2013, Cisco Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*
* \file sample.c
*
* \brief compute SAD and SATD
*
* \date 2009.06.02 Created
*
*************************************************************************************
*/
#include "sad_common.h"
#include "macros.h"
int32_t WelsSampleSad4x4_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
int32_t i = 0;
uint8_t* pSrc1 = pSample1;
uint8_t* pSrc2 = pSample2;
for (i = 0; i < 4; i++) {
iSadSum += WELS_ABS ((pSrc1[0] - pSrc2[0]));
iSadSum += WELS_ABS ((pSrc1[1] - pSrc2[1]));
iSadSum += WELS_ABS ((pSrc1[2] - pSrc2[2]));
iSadSum += WELS_ABS ((pSrc1[3] - pSrc2[3]));
pSrc1 += iStride1;
pSrc2 += iStride2;
}
return iSadSum;
}
int32_t WelsSampleSad8x8_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
int32_t i = 0;
uint8_t* pSrc1 = pSample1;
uint8_t* pSrc2 = pSample2;
for (i = 0; i < 8; i++) {
iSadSum += WELS_ABS ((pSrc1[0] - pSrc2[0]));
iSadSum += WELS_ABS ((pSrc1[1] - pSrc2[1]));
iSadSum += WELS_ABS ((pSrc1[2] - pSrc2[2]));
iSadSum += WELS_ABS ((pSrc1[3] - pSrc2[3]));
iSadSum += WELS_ABS ((pSrc1[4] - pSrc2[4]));
iSadSum += WELS_ABS ((pSrc1[5] - pSrc2[5]));
iSadSum += WELS_ABS ((pSrc1[6] - pSrc2[6]));
iSadSum += WELS_ABS ((pSrc1[7] - pSrc2[7]));
pSrc1 += iStride1;
pSrc2 += iStride2;
}
return iSadSum;
}
int32_t WelsSampleSad16x8_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + 8, iStride1, pSample2 + 8, iStride2);
return iSadSum;
}
int32_t WelsSampleSad8x16_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3), iStride1, pSample2 + (iStride2 << 3), iStride2);
return iSadSum;
}
int32_t WelsSampleSad16x16_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + 8, iStride1, pSample2 + 8, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3), iStride1, pSample2 + (iStride2 << 3), iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3) + 8, iStride1, pSample2 + (iStride2 << 3) + 8, iStride2);
return iSadSum;
}

View File

@ -4,6 +4,7 @@ COMMON_CPP_SRCS=\
$(COMMON_SRCDIR)/src/crt_util_safe_x.cpp\
$(COMMON_SRCDIR)/src/deblocking_common.cpp\
$(COMMON_SRCDIR)/src/logging.cpp\
$(COMMON_SRCDIR)/src/sad_common.cpp\
$(COMMON_SRCDIR)/src/WelsThreadLib.cpp\
COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.$(OBJ))

View File

@ -47,15 +47,6 @@ enum {
// BLOCK_4x8 = 6,
};
//===================SAD=====================//
int32_t WelsSampleSad16x16_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
//int32_t WelsSampleSad8x4( uint8_t *, int32_t, uint8_t *, int32_t );
//int32_t WelsSampleSad4x8( uint8_t *, int32_t, uint8_t *, int32_t );
int32_t WelsSampleSad4x4_c (uint8_t*, int32_t, uint8_t*, int32_t);
//======================SATD======================//
int32_t WelsSampleSatd16x16_c (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSatd16x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
@ -65,11 +56,6 @@ int32_t WelsSampleSatd8x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
//int32_t WelsSampleSatd4x8( uint8_t *, int32_t, uint8_t *, int32_t );
int32_t WelsSampleSatd4x4_c (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour16x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour8x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour8x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
void WelsSampleSadFour4x4_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad);
#if defined(__cplusplus)
extern "C" {
@ -77,17 +63,6 @@ extern "C" {
#if defined (X86_ASM)
int32_t WelsSampleSad4x4_mmx (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_sse21 (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour4x4_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
int32_t WelsSampleSatd8x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSatd16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t);
@ -112,17 +87,6 @@ int32_t WelsIntraChroma8x8Combined3Satd_sse41 (uint8_t*, int32_t, uint8_t*, int3
#if defined (HAVE_NEON)
int32_t WelsSampleSad4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSad8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);
void WelsSampleSadFour16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
void WelsSampleSadFour4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*);
int32_t WelsSampleSatd8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);
int32_t WelsSampleSatd16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t);

View File

@ -39,75 +39,12 @@
*/
#include "sample.h"
#include "sad_common.h"
#include "mc.h"
#include "cpu_core.h"
namespace WelsSVCEnc {
int32_t WelsSampleSad4x4_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
int32_t i = 0;
uint8_t* pSrc1 = pSample1;
uint8_t* pSrc2 = pSample2;
for (i = 0; i < 4; i++) {
iSadSum += WELS_ABS ((pSrc1[0] - pSrc2[0]));
iSadSum += WELS_ABS ((pSrc1[1] - pSrc2[1]));
iSadSum += WELS_ABS ((pSrc1[2] - pSrc2[2]));
iSadSum += WELS_ABS ((pSrc1[3] - pSrc2[3]));
pSrc1 += iStride1;
pSrc2 += iStride2;
}
return iSadSum;
}
int32_t WelsSampleSad8x8_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
int32_t i = 0;
uint8_t* pSrc1 = pSample1;
uint8_t* pSrc2 = pSample2;
for (i = 0; i < 8; i++) {
iSadSum += WELS_ABS ((pSrc1[0] - pSrc2[0]));
iSadSum += WELS_ABS ((pSrc1[1] - pSrc2[1]));
iSadSum += WELS_ABS ((pSrc1[2] - pSrc2[2]));
iSadSum += WELS_ABS ((pSrc1[3] - pSrc2[3]));
iSadSum += WELS_ABS ((pSrc1[4] - pSrc2[4]));
iSadSum += WELS_ABS ((pSrc1[5] - pSrc2[5]));
iSadSum += WELS_ABS ((pSrc1[6] - pSrc2[6]));
iSadSum += WELS_ABS ((pSrc1[7] - pSrc2[7]));
pSrc1 += iStride1;
pSrc2 += iStride2;
}
return iSadSum;
}
int32_t WelsSampleSad16x8_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + 8, iStride1, pSample2 + 8, iStride2);
return iSadSum;
}
int32_t WelsSampleSad8x16_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3), iStride1, pSample2 + (iStride2 << 3), iStride2);
return iSadSum;
}
int32_t WelsSampleSad16x16_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSadSum = 0;
iSadSum += WelsSampleSad8x8_c (pSample1, iStride1, pSample2, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + 8, iStride1, pSample2 + 8, iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3), iStride1, pSample2 + (iStride2 << 3), iStride2);
iSadSum += WelsSampleSad8x8_c (pSample1 + (iStride1 << 3) + 8, iStride1, pSample2 + (iStride2 << 3) + 8, iStride2);
return iSadSum;
}
int32_t WelsSampleSatd4x4_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSatdSum = 0;
int32_t pSampleMix[4][4] = {{ 0 }};

View File

@ -379,6 +379,10 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\common\common.cpp"
>
</File>
<File
RelativePath="..\..\..\common\src\cpu.cpp"
>
@ -388,7 +392,7 @@
>
</File>
<File
RelativePath="..\..\..\common\src\WelsThreadLib.cpp"
RelativePath="..\..\..\common\src\sad_common.cpp"
>
</File>
<File
@ -399,6 +403,10 @@
RelativePath="..\..\src\common\WelsFrameWorkEx.cpp"
>
</File>
<File
RelativePath="..\..\..\common\src\WelsThreadLib.cpp"
>
</File>
</Filter>
<Filter
Name="Interface"
@ -445,6 +453,10 @@
<Filter
Name="Header Files"
>
<File
RelativePath="..\..\src\common\common.h"
>
</File>
<File
RelativePath="..\..\..\common\inc\cpu.h"
>
@ -454,7 +466,7 @@
>
</File>
<File
RelativePath="..\..\..\common\inc\WelsThreadLib.h"
RelativePath="..\..\..\common\inc\sad_common.h"
>
</File>
<File
@ -469,6 +481,10 @@
RelativePath="..\..\src\common\WelsFrameWork.h"
>
</File>
<File
RelativePath="..\..\..\common\inc\WelsThreadLib.h"
>
</File>
</Filter>
<Filter
Name="ASM"
@ -685,14 +701,6 @@
RelativePath="..\..\src\scenechangedetection\SceneChangeDetection.h"
>
</File>
<File
RelativePath="..\..\src\scenechangedetection\SceneChangeDetectionCommon.cpp"
>
</File>
<File
RelativePath="..\..\src\scenechangedetection\SceneChangeDetectionCommon.h"
>
</File>
</Filter>
<Filter
Name="Denoise"

View File

@ -30,30 +30,44 @@
*
*/
#include "SceneChangeDetectionCommon.h"
#include "common.h"
#include "ls_defines.h"
WELSVP_NAMESPACE_BEGIN
void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
uint8_t i = 15;
const int8_t* kpSrc = (int8_t*)&pRef[-kiStride];
const uint64_t kuiT1 = LD64 (kpSrc);
const uint64_t kuiT2 = LD64 (kpSrc + 8);
uint8_t* pDst = pPred;
int32_t WelsSampleSad8x8_c (uint8_t* pSrcY, int32_t iSrcStrideY, uint8_t* pRefY, int32_t iRefStrideY) {
int32_t iSadSum = 0;
uint8_t* pSrcA = pSrcY;
uint8_t* pSrcB = pRefY;
for (int32_t i = 0; i < 8; i++) {
iSadSum += WELS_ABS ((pSrcA[0] - pSrcB[0]));
iSadSum += WELS_ABS ((pSrcA[1] - pSrcB[1]));
iSadSum += WELS_ABS ((pSrcA[2] - pSrcB[2]));
iSadSum += WELS_ABS ((pSrcA[3] - pSrcB[3]));
iSadSum += WELS_ABS ((pSrcA[4] - pSrcB[4]));
iSadSum += WELS_ABS ((pSrcA[5] - pSrcB[5]));
iSadSum += WELS_ABS ((pSrcA[6] - pSrcB[6]));
iSadSum += WELS_ABS ((pSrcA[7] - pSrcB[7]));
do {
ST64 (pDst , kuiT1);
ST64 (pDst + 8, kuiT2);
pDst += 16;
} while (i-- > 0);
}
pSrcA += iSrcStrideY;
pSrcB += iRefStrideY;
}
void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
int32_t iStridex15 = (kiStride << 4) - kiStride;
int32_t iPredStride = 16;
int32_t iPredStridex15 = 240; //(iPredStride<<4)-iPredStride;
uint8_t i = 15;
return iSadSum;
do {
const uint8_t kuiSrc8 = pRef[iStridex15 - 1];
#ifdef _MSC_VER
const uint64_t kuiV64 = (uint64_t) (0x0101010101010101U * kuiSrc8);
#else
const uint64_t kuiV64 = (uint64_t) (0x0101010101010101LL * kuiSrc8);
#endif
ST64 (&pPred[iPredStridex15], kuiV64);
ST64 (&pPred[iPredStridex15 + 8], kuiV64);
iStridex15 -= kiStride;
iPredStridex15 -= iPredStride;
} while (i-- > 0);
}
WELSVP_NAMESPACE_END

View File

@ -45,6 +45,7 @@
#include "memory.h"
#include "WelsFrameWork.h"
#include "IWelsVP.h"
#include "sad_common.h"
WELSVP_NAMESPACE_BEGIN
@ -52,19 +53,16 @@ typedef int32_t (SadFunc) (uint8_t* pSrcY, int32_t iSrcStrideY, uint8_t* pRefY,
typedef SadFunc* SadFuncPtr;
SadFunc WelsSampleSad8x8_c;
typedef int32_t (Sad16x16Func) ( uint8_t * pSrcY, int32_t iSrcStrideY, uint8_t *pRefY, int32_t iRefStrideY );
typedef Sad16x16Func *PSad16x16Func;
#ifdef X86_ASM
WELSVP_EXTERN_C_BEGIN
SadFunc WelsSampleSad8x8_sse21;
WELSVP_EXTERN_C_END
#endif
typedef void (GetIntraPred)(uint8_t *pPred, uint8_t *pRef, const int32_t kiStride);
typedef GetIntraPred *GetIntraPredPtr;
GetIntraPred WelsI16x16LumaPredV_c;
GetIntraPred WelsI16x16LumaPredH_c;
#ifdef HAVE_NEON
WELSVP_EXTERN_C_BEGIN
SadFunc WelsProcessingSampleSad8x8_neon;
WELSVP_EXTERN_C_END
#endif
WELSVP_NAMESPACE_END

View File

@ -47,7 +47,7 @@
#include "cpu.h"
#include "WelsFrameWork.h"
#include "IWelsVP.h"
#include "SceneChangeDetectionCommon.h"
#include "common.h"
#define HIGH_MOTION_BLOCK_THRESHOLD 320
#define SCENE_CHANGE_MOTION_RATIO_LARGE 0.85f

View File

@ -2,6 +2,7 @@ PROCESSING_SRCDIR=codec/processing
PROCESSING_CPP_SRCS=\
$(PROCESSING_SRCDIR)/src/adaptivequantization/AdaptiveQuantization.cpp\
$(PROCESSING_SRCDIR)/src/backgrounddetection/BackgroundDetection.cpp\
$(PROCESSING_SRCDIR)/src/common/common.cpp\
$(PROCESSING_SRCDIR)/src/common/memory.cpp\
$(PROCESSING_SRCDIR)/src/common/WelsFrameWork.cpp\
$(PROCESSING_SRCDIR)/src/common/WelsFrameWorkEx.cpp\
@ -13,7 +14,6 @@ PROCESSING_CPP_SRCS=\
$(PROCESSING_SRCDIR)/src/imagerotate/imagerotate.cpp\
$(PROCESSING_SRCDIR)/src/imagerotate/imagerotatefuncs.cpp\
$(PROCESSING_SRCDIR)/src/scenechangedetection/SceneChangeDetection.cpp\
$(PROCESSING_SRCDIR)/src/scenechangedetection/SceneChangeDetectionCommon.cpp\
$(PROCESSING_SRCDIR)/src/vaacalc/vaacalcfuncs.cpp\
$(PROCESSING_SRCDIR)/src/vaacalc/vaacalculation.cpp\