History

[Decoder] Use encoder x86 IDCT routines

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.

Sindre Aamås committed 10 years ago

Commit 98042f11 parent 48a520912 files · +1217 −1047Browse files

Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 12 files). Show all

Unified · Split

codec/decoder/core/src/decode_slice.cpp+15−22
@@ -168,28 +168,21 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 167 unmodified lines
168168 }
169169 }
170170 } else {
171− for (i = 0; i < 16; i++) { //luma
172− iIndex = g_kuiMbCountScan4Idx[i];
173− if (pCurLayer->pNzc[iMbXy][iIndex]) {
174− iOffset = ((iIndex >> 2) << 2) * iStrideL + ((iIndex % 4) << 2);
175− pCtx->pIdctResAddPredFunc (pDstY + iOffset, iStrideL, pCurLayer->pScaledTCoeff[iMbXy] + (i << 4));
176− }
177− }
178− }
179−
180− for (i = 0; i < 4; i++) { //chroma
181− iIndex = g_kuiMbCountScan4Idx[i + 16]; //Cb
182− if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4))) {
183− iOffset = (((iIndex - 16) >> 2) << 2) * iStrideC + (((iIndex - 16) % 4) << 2);
184− pCtx->pIdctResAddPredFunc (pDstU + iOffset, iStrideC, pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4));
185− }
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− }
171+ // luma.
172+ const int8_t* pNzc = pCurLayer->pNzc[iMbXy];
173+ int16_t* pScaledTCoeff = pCurLayer->pScaledTCoeff[iMbXy];
174+ pCtx->pIdctFourResAddPredFunc (pDstY + 0 * iStrideL + 0, iStrideL, pScaledTCoeff + 0 * 64, pNzc + 0);
175+ pCtx->pIdctFourResAddPredFunc (pDstY + 0 * iStrideL + 8, iStrideL, pScaledTCoeff + 1 * 64, pNzc + 2);
176+ pCtx->pIdctFourResAddPredFunc (pDstY + 8 * iStrideL + 0, iStrideL, pScaledTCoeff + 2 * 64, pNzc + 8);
177+ pCtx->pIdctFourResAddPredFunc (pDstY + 8 * iStrideL + 8, iStrideL, pScaledTCoeff + 3 * 64, pNzc + 10);
178+ }
179+
180+ const int8_t* pNzc = pCurLayer->pNzc[iMbXy];
181+ int16_t* pScaledTCoeff = pCurLayer->pScaledTCoeff[iMbXy];
182+ // Cb.
183+ pCtx->pIdctFourResAddPredFunc (pDstU, iStrideC, pScaledTCoeff + 4 * 64, pNzc + 16);
184+ // Cr.
185+ pCtx->pIdctFourResAddPredFunc (pDstV, iStrideC, pScaledTCoeff + 5 * 64, pNzc + 18);
193186
194187 return ERR_NONE;
195188 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t