Showing the changes to codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp (1 of 15 files). Show all
Unified · Split
| @@ -50,9 +50,11 @@ CAdaptiveQuantization::CAdaptiveQuantization (int32_t iCpuFlag) { · 49 unmodified lines | ||
| 50 | 50 | m_pfVar = NULL; |
| 51 | 51 | WelsMemset (&m_sAdaptiveQuantParam, 0, sizeof (m_sAdaptiveQuantParam)); |
| 52 | 52 | WelsInitVarFunc (m_pfVar, m_CPUFlag); |
| 53 | + XMMREG_PROTECT_INIT(AdaptiveQuantization); | |
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 | CAdaptiveQuantization::~CAdaptiveQuantization() { |
| 57 | + XMMREG_PROTECT_UNINIT(AdaptiveQuantization); | |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) { |
| @@ -101,6 +103,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 42 unmodified lines | ||
| 101 | 103 | pRefFrameTmp = pRefFrameY; |
| 102 | 104 | pCurFrameTmp = pCurFrameY; |
| 103 | 105 | for (i = 0; i < iMbWidth; i++) { |
| 106 | + XMMREG_PROTECT_STORE(AdaptiveQuantization); | |
| 104 | 107 | iSumDiff = pVaaCalcResults->pSad8x8[iMbIndex][0]; |
| 105 | 108 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][1]; |
| 106 | 109 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][2]; |
| @@ -109,6 +112,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 2 unmodified lines | ||
| 109 | 112 | iSQDiff = pVaaCalcResults->pSsd16x16[iMbIndex]; |
| 110 | 113 | uiSum = pVaaCalcResults->pSum16x16[iMbIndex]; |
| 111 | 114 | iSQSum = pVaaCalcResults->pSumOfSquare16x16[iMbIndex]; |
| 115 | + XMMREG_PROTECT_LOAD(AdaptiveQuantization); | |
| 112 | 116 | |
| 113 | 117 | iSumDiff = iSumDiff >> 8; |
| 114 | 118 | pMotionTexture->uiMotionIndex = (iSQDiff >> 8) - (iSumDiff * iSumDiff); |
| @@ -131,7 +135,9 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 16 unmodified lines | ||
| 131 | 135 | pRefFrameTmp = pRefFrameY; |
| 132 | 136 | pCurFrameTmp = pCurFrameY; |
| 133 | 137 | for (i = 0; i < iMbWidth; i++) { |
| 138 | + XMMREG_PROTECT_STORE(AdaptiveQuantization); | |
| 134 | 139 | m_pfVar (pRefFrameTmp, iRefStride, pCurFrameTmp, iCurStride, pMotionTexture); |
| 140 | + XMMREG_PROTECT_LOAD(AdaptiveQuantization); | |
| 135 | 141 | dAverageMotionIndex += pMotionTexture->uiMotionIndex; |
| 136 | 142 | dAverageTextureIndex += pMotionTexture->uiTextureIndex; |
| 137 | 143 | pMotionTexture++; |
| @@ -223,7 +229,7 @@ void CAdaptiveQuantization::WelsInitVarFunc (PVarFunc& pfVar, int32_t iCpuFlag) · 85 unmodified lines | ||
| 223 | 229 | |
| 224 | 230 | #ifdef X86_ASM |
| 225 | 231 | if (iCpuFlag & WELS_CPU_SSE2) { |
| 226 | − // pfVar = SampleVariance16x16_sse2; | |
| 232 | + pfVar = SampleVariance16x16_sse2; | |
| 227 | 233 | } |
| 228 | 234 | #endif |
| 229 | 235 | } |