Move asm routines to common. Delete obsolete decoder routines. Use wider routines where applicable. ~1.07x overall faster decode on a quick 720p30 4Mbps test on Haswell.
Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 12 files). Show all
Unified · Split
| @@ -168,28 +168,21 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 167 unmodified lines | |||
| 168 | } | 168 | } |
| 169 | } | 169 | } |
| 170 | } else { | 170 | } else { |
| 171 | for (i = 0; i < 16; i++) { //luma | 171 | // luma. |
| 172 | iIndex = g_kuiMbCountScan4Idx[i]; | 172 | const int8_t* pNzc = pCurLayer->pNzc[iMbXy]; |
| 173 | if (pCurLayer->pNzc[iMbXy][iIndex]) { | 173 | int16_t* pScaledTCoeff = pCurLayer->pScaledTCoeff[iMbXy]; |
| 174 | iOffset = ((iIndex >> 2) << 2) * iStrideL + ((iIndex % 4) << 2); | 174 | pCtx->pIdctFourResAddPredFunc (pDstY + 0 * iStrideL + 0, iStrideL, pScaledTCoeff + 0 * 64, pNzc + 0); |
| 175 | pCtx->pIdctResAddPredFunc (pDstY + iOffset, iStrideL, pCurLayer->pScaledTCoeff[iMbXy] + (i << 4)); | 175 | pCtx->pIdctFourResAddPredFunc (pDstY + 0 * iStrideL + 8, iStrideL, pScaledTCoeff + 1 * 64, pNzc + 2); |
| 176 | } | 176 | pCtx->pIdctFourResAddPredFunc (pDstY + 8 * iStrideL + 0, iStrideL, pScaledTCoeff + 2 * 64, pNzc + 8); |
| 177 | } | 177 | pCtx->pIdctFourResAddPredFunc (pDstY + 8 * iStrideL + 8, iStrideL, pScaledTCoeff + 3 * 64, pNzc + 10); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | for (i = 0; i < 4; i++) { //chroma | 180 | const int8_t* pNzc = pCurLayer->pNzc[iMbXy]; |
| 181 | iIndex = g_kuiMbCountScan4Idx[i + 16]; //Cb | 181 | int16_t* pScaledTCoeff = pCurLayer->pScaledTCoeff[iMbXy]; |
| 182 | if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4))) { | 182 | // Cb. |
| 183 | iOffset = (((iIndex - 16) >> 2) << 2) * iStrideC + (((iIndex - 16) % 4) << 2); | 183 | pCtx->pIdctFourResAddPredFunc (pDstU, iStrideC, pScaledTCoeff + 4 * 64, pNzc + 16); |
| 184 | pCtx->pIdctResAddPredFunc (pDstU + iOffset, iStrideC, pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4)); | 184 | // Cr. |
| 185 | } | 185 | pCtx->pIdctFourResAddPredFunc (pDstV, iStrideC, pScaledTCoeff + 5 * 64, pNzc + 18); |
| 186 | |||
| 187 | iIndex = g_kuiMbCountScan4Idx[i + 20]; //Cr | ||
| 188 | if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4))) { | ||
| 189 | iOffset = (((iIndex - 18) >> 2) << 2) * iStrideC + (((iIndex - 18) % 4) << 2); | ||
| 190 | pCtx->pIdctResAddPredFunc (pDstV + iOffset, iStrideC , pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4)); | ||
| 191 | } | ||
| 192 | } | ||
| 193 | 186 | ||
| 194 | return ERR_NONE; | 187 | return ERR_NONE; |
| 195 | } | 188 | } |