Skip to content

Commit

Permalink
Merge pull request #7 from adamjw24/develop_fixSimpleAppSimd
Browse files Browse the repository at this point in the history
Fix SIMD activation in simple encoder
  • Loading branch information
adamjw24 authored Oct 8, 2020
2 parents 2ed056b + 466b2e3 commit bc966db
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions include/vvenc/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ vvc@hhi.fraunhofer.de

#if !defined( VVENC_VERSION )

#define VVENC_VERSION "0.1.0.0"
#define VVENC_VERSION "0.1.0.1"

#ifdef _WIN32
#define VVENC_VS_VERSION 0.1.0.0
#define VVENC_VS_VERSION_STR "0.1.0.0"
#define VVENC_VS_VERSION 0.1.0.1
#define VVENC_VS_VERSION_STR "0.1.0.1"
#endif

#endif
4 changes: 2 additions & 2 deletions source/Lib/CommonLib/TrQuant_EMT.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ struct TCoeffOps
{
TCoeffOps();

void initTCoeffOps();
void initTCoeffOpsX86();
template<X86_VEXT vext>
void _initTCoeffOps();
void _initTCoeffOpsX86();

void( *cpyResi8 ) ( const TCoeff* src, Pel* dst, ptrdiff_t stride, unsigned width, unsigned height );
void( *cpyResi4 ) ( const TCoeff* src, Pel* dst, ptrdiff_t stride, unsigned width, unsigned height );
Expand Down
10 changes: 5 additions & 5 deletions source/Lib/CommonLib/x86/InitX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,22 @@ void MCTF::initMCTF_X86()

#endif
#if ENABLE_SIMD_TRAFO
void TCoeffOps::initTCoeffOps()
void TCoeffOps::initTCoeffOpsX86()
{
auto vext = read_x86_extension_flags();
switch (vext){
case AVX512:
case AVX2:
_initTCoeffOps<AVX2 >();
_initTCoeffOpsX86<AVX2 >();
break;
case AVX:
_initTCoeffOps<AVX >();
_initTCoeffOpsX86<AVX >();
break;
case SSE42:
_initTCoeffOps<SSE42>();
_initTCoeffOpsX86<SSE42>();
break;
case SSE41:
_initTCoeffOps<SSE41>();
_initTCoeffOpsX86<SSE41>();
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions source/Lib/CommonLib/x86/TrafoX86.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ void cpyCoeff_SSE( const Pel* src, ptrdiff_t stride, TCoeff* dst, unsigned width
}

template<X86_VEXT vext>
void TCoeffOps::_initTCoeffOps()
void TCoeffOps::_initTCoeffOpsX86()
{
cpyResi4 = cpyResi_SSE <vext, 4>;
cpyResi8 = cpyResi_SSE <vext, 8>;
Expand All @@ -788,7 +788,7 @@ void TCoeffOps::_initTCoeffOps()
= fastFwd_SSE <vext, 8>;
}

template void TCoeffOps::_initTCoeffOps<SIMDX86>();
template void TCoeffOps::_initTCoeffOpsX86<SIMDX86>();

}

Expand Down
2 changes: 1 addition & 1 deletion source/Lib/DecoderLib/DecLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ DecLib::DecLib()
g_pelBufOP.initPelBufOpsX86();
#endif
#if ENABLE_SIMD_TRAFO
g_tCoeffOps.initTCoeffOps();
g_tCoeffOps.initTCoeffOpsX86();
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion source/Lib/vvenc/EncoderIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ std::string setSIMDExtension( const std::string& simdId )
g_pelBufOP.initPelBufOpsX86();
#endif
#if ENABLE_SIMD_TRAFO
g_tCoeffOps.initTCoeffOps();
g_tCoeffOps.initTCoeffOpsX86();
#endif
return ret;
}
Expand Down
4 changes: 4 additions & 0 deletions source/Lib/vvenc/vvenc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ int VVEnc::init( const VVEncParameter& rcVVEncParameter )
return iRet;
}

// Set SIMD extension in case if it hasn't been done before, otherwise it simply reuses the current state
std::string simdOpt;
vvenc::setSIMDExtension( simdOpt );

return VVENC_OK;
}

Expand Down

0 comments on commit bc966db

Please sign in to comment.