This isn't necessary any longer, when all the assembly routines take care of restoring registers as necessary.
Showing the changes to codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp (1 of 9 files). Show all
Unified · Split
| @@ -49,11 +49,9 @@ CAdaptiveQuantization::CAdaptiveQuantization (int32_t iCpuFlag) { · 48 unmodified lines | |||
| 49 | m_pfVar = NULL; | 49 | m_pfVar = NULL; |
| 50 | WelsMemset (&m_sAdaptiveQuantParam, 0, sizeof (m_sAdaptiveQuantParam)); | 50 | WelsMemset (&m_sAdaptiveQuantParam, 0, sizeof (m_sAdaptiveQuantParam)); |
| 51 | WelsInitVarFunc (m_pfVar, m_CPUFlag); | 51 | WelsInitVarFunc (m_pfVar, m_CPUFlag); |
| 52 | XMMREG_PROTECT_INIT(AdaptiveQuantization); | ||
| 53 | } | 52 | } |
| 54 | 53 | ||
| 55 | CAdaptiveQuantization::~CAdaptiveQuantization() { | 54 | CAdaptiveQuantization::~CAdaptiveQuantization() { |
| 56 | XMMREG_PROTECT_UNINIT(AdaptiveQuantization); | ||
| 57 | } | 55 | } |
| 58 | 56 | ||
| 59 | EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) { | 57 | EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) { |
| @@ -102,7 +100,6 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 42 unmodified lines | |||
| 102 | pRefFrameTmp = pRefFrameY; | 100 | pRefFrameTmp = pRefFrameY; |
| 103 | pCurFrameTmp = pCurFrameY; | 101 | pCurFrameTmp = pCurFrameY; |
| 104 | for (i = 0; i < iMbWidth; i++) { | 102 | for (i = 0; i < iMbWidth; i++) { |
| 105 | XMMREG_PROTECT_STORE(AdaptiveQuantization); | ||
| 106 | iSumDiff = pVaaCalcResults->pSad8x8[iMbIndex][0]; | 103 | iSumDiff = pVaaCalcResults->pSad8x8[iMbIndex][0]; |
| 107 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][1]; | 104 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][1]; |
| 108 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][2]; | 105 | iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][2]; |
| @@ -111,7 +108,6 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 2 unmodified lines | |||
| 111 | iSQDiff = pVaaCalcResults->pSsd16x16[iMbIndex]; | 108 | iSQDiff = pVaaCalcResults->pSsd16x16[iMbIndex]; |
| 112 | uiSum = pVaaCalcResults->pSum16x16[iMbIndex]; | 109 | uiSum = pVaaCalcResults->pSum16x16[iMbIndex]; |
| 113 | iSQSum = pVaaCalcResults->pSumOfSquare16x16[iMbIndex]; | 110 | iSQSum = pVaaCalcResults->pSumOfSquare16x16[iMbIndex]; |
| 114 | XMMREG_PROTECT_LOAD(AdaptiveQuantization); | ||
| 115 | 111 | ||
| 116 | iSumDiff = iSumDiff >> 8; | 112 | iSumDiff = iSumDiff >> 8; |
| 117 | pMotionTexture->uiMotionIndex = (iSQDiff >> 8) - (iSumDiff * iSumDiff); | 113 | pMotionTexture->uiMotionIndex = (iSQDiff >> 8) - (iSumDiff * iSumDiff); |
| @@ -134,9 +130,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 16 unmodified lines | |||
| 134 | pRefFrameTmp = pRefFrameY; | 130 | pRefFrameTmp = pRefFrameY; |
| 135 | pCurFrameTmp = pCurFrameY; | 131 | pCurFrameTmp = pCurFrameY; |
| 136 | for (i = 0; i < iMbWidth; i++) { | 132 | for (i = 0; i < iMbWidth; i++) { |
| 137 | XMMREG_PROTECT_STORE(AdaptiveQuantization); | ||
| 138 | m_pfVar (pRefFrameTmp, iRefStride, pCurFrameTmp, iCurStride, pMotionTexture); | 133 | m_pfVar (pRefFrameTmp, iRefStride, pCurFrameTmp, iCurStride, pMotionTexture); |
| 139 | XMMREG_PROTECT_LOAD(AdaptiveQuantization); | ||
| 140 | dAverageMotionIndex += pMotionTexture->uiMotionIndex; | 134 | dAverageMotionIndex += pMotionTexture->uiMotionIndex; |
| 141 | dAverageTextureIndex += pMotionTexture->uiTextureIndex; | 135 | dAverageTextureIndex += pMotionTexture->uiTextureIndex; |
| 142 | pMotionTexture++; | 136 | pMotionTexture++; |