History

Rename some decoder tables to match the name used in the encoder

Martin Storsjö committed 12 years ago

Commit eb7cdf21 parent 4aa22da6 files · +23 −23Browse files

Showing the changes to codec/decoder/core/src (4 of 6 files). Show all

Unified · Split

4 files
  1. codec/decoder/core/src/decode_slice.cpp +12 −12
  2. codec/decoder/core/src/decoder_data_tables.cpp +3 −3
  3. codec/decoder/core/src/parse_mb_syn_cavlc.cpp +2 −2
  4. codec/decoder/core/src/rec_mb.cpp +3 −3
codec/decoder/core/src/decode_slice.cpp+12−12
@@ -149,7 +149,7 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 148 unmodified lines
149149 WelsChromaDcIdct (pCurLayer->pScaledTCoeff[iMbXy] + 320); // 320 = 16*16 + 16*4
150150
151151 for (i = 0; i < 16; i++) { //luma
152− iIndex = g_kuiMbNonZeroCountIdx[i];
152+ iIndex = g_kuiMbCountScan4Idx[i];
153153 if (pCurLayer->pNzc[iMbXy][iIndex]) {
154154 iOffset = ((iIndex >> 2) << 2) * iStrideL + ((iIndex % 4) << 2);
155155 pCtx->pIdctResAddPredFunc (pDstY + iOffset, iStrideL, pCurLayer->pScaledTCoeff[iMbXy] + (i << 4));
@@ -157,13 +157,13 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 1 unmodified line
157157 }
158158
159159 for (i = 0; i < 4; i++) { //chroma
160− iIndex = g_kuiMbNonZeroCountIdx[i + 16]; //Cb
160+ iIndex = g_kuiMbCountScan4Idx[i + 16]; //Cb
161161 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4))) {
162162 iOffset = (((iIndex - 16) >> 2) << 2) * iStrideC + (((iIndex - 16) % 4) << 2);
163163 pCtx->pIdctResAddPredFunc (pDstU + iOffset, iStrideC, pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4));
164164 }
165165
166− iIndex = g_kuiMbNonZeroCountIdx[i + 20]; //Cr
166+ iIndex = g_kuiMbCountScan4Idx[i + 20]; //Cr
167167 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4))) {
168168 iOffset = (((iIndex - 18) >> 2) << 2) * iStrideC + (((iIndex - 18) % 4) << 2);
169169 pCtx->pIdctResAddPredFunc (pDstV + iOffset, iStrideC , pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4));
@@ -553,7 +553,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 383 unmodified lines
553553
554554 if (pCurLayer->pCbp[iMbXy] == 0 && IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) {
555555 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;
556− pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQp[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
556+ pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
557557 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
558558
559559 }
@@ -582,7 +582,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 22 unmodified lines
582582 return ERR_INFO_INVALID_QP;
583583 }
584584 pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
585− pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQp[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
585+ pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
586586 51)];
587587
588588
@@ -622,8 +622,8 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 33 unmodified lines
622622 iIndex++;
623623 }
624624 } else {
625− ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2)]], 0);
626− ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2) + 2]], 0);
625+ ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2)]], 0);
626+ ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2) + 2]], 0);
627627 }
628628 }
629629 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));
@@ -857,7 +857,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 227 unmodified lines
857857 ST32A4 (&pNzc[20], 0);
858858 if (pCurLayer->pCbp[iMbXy] == 0 && !IS_INTRA16x16 (pCurLayer->pMbType[iMbXy]) && !IS_I_BL (pCurLayer->pMbType[iMbXy])) {
859859 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;
860− pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQp[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
860+ pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
861861 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
862862 }
863863
@@ -885,7 +885,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 21 unmodified lines
885885 return ERR_INFO_INVALID_QP;
886886 }
887887 pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
888− pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQp[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
888+ pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + pSliceHeader->pPps->iChromaQpIndexOffset, 0,
889889 51)];
890890
891891 BsStartCavlc (pBs);
@@ -924,8 +924,8 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 32 unmodified lines
924924 iIndex++;
925925 }
926926 } else {
927− ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[iId8x8 << 2]], 0);
928− ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2) + 2]], 0);
927+ ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[iId8x8 << 2]], 0);
928+ ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2) + 2]], 0);
929929 }
930930 }
931931 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));
@@ -1019,7 +1019,7 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) { · 87 unmodified lines
10191019 if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag ||
10201020 (pNalCur->sNalHeaderExt.uiQualityId == 0 && pNalCur->sNalHeaderExt.uiDependencyId == 0)) {
10211021 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;
1022− pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQp[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
1022+ pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] +
10231023 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
10241024 }
10251025
codec/decoder/core/src/decoder_data_tables.cpp+3−3
@@ -41,7 +41,7 @@ namespace WelsDec { · 40 unmodified lines
4141 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4242
4343 //////non_zero_count[16+8] mapping scan index
44−const uint8_t g_kuiMbNonZeroCountIdx[24] = {
44+const uint8_t g_kuiMbCountScan4Idx[24] = {
4545 // 0 1 | 4 5 luma 8*8 block non_zero_count[16+8]
4646 0, 1, 4, 5, // 2 3 | 6 7 0 | 1 0 1 2 3
4747 2, 3, 6, 7, //--------------- --------- 4 5 6 7
@@ -52,7 +52,7 @@ const uint8_t g_kuiMbNonZeroCountIdx[24] = { · 4 unmodified lines
5252 };
5353 //cache element equal to 26
5454
55−const uint8_t g_kuiCacheNzcScanIdx[24] = {
55+const uint8_t g_kuiCache48CountScan4Idx[24] = {
5656 /* Luma */
5757 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,
5858 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8,
@@ -87,7 +87,7 @@ const uint8_t g_kuiScan4[16] = { //for mb cache in sMb (only current element, wi · 28 unmodified lines
8787
8888 // extern at wels_common_basis.h
8989
90−const uint8_t g_kuiChromaQp[52] = {
90+const uint8_t g_kuiChromaQpTable[52] = {
9191 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
9292 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
9393 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37,
codec/decoder/core/src/parse_mb_syn_cavlc.cpp+2−2
@@ -687,11 +687,11 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable, uint8_t* pNonZeroCountCach · 686 unmodified lines
687687 //////////////////////////////////////////////////////////////////////////
688688
689689 if (bChroma) {
690− iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex];
690+ iCurNonZeroCacheIdx = g_kuiCache48CountScan4Idx[iIndex];
691691 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];
692692 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];
693693 } else { //luma
694− iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex];
694+ iCurNonZeroCacheIdx = g_kuiCache48CountScan4Idx[iIndex];
695695 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];
696696 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];
697697 }
codec/decoder/core/src/rec_mb.cpp+3−3
@@ -93,7 +93,7 @@ int32_t RecI4x4Luma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 92 unmodified lines
9393
9494 pGetI4x4LumaPredFunc[uiMode] (pPredI4x4, iLumaStride);
9595
96− if (pDqLayer->pNzc[iMBXY][g_kuiMbNonZeroCountIdx[i]]) {
96+ if (pDqLayer->pNzc[iMBXY][g_kuiMbCountScan4Idx[i]]) {
9797 int16_t* pRSI4x4 = &pRS[i << 4];
9898 pIdctResAddPredFunc (pPredI4x4, iLumaStride, pRSI4x4);
9999 }
@@ -149,7 +149,7 @@ int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 49 unmodified lines
149149 int16_t* pRSI4x4 = pRS + (i << 4);
150150 uint8_t* pPredI4x4 = pPred + pBlockOffset[i];
151151
152− if (pDqLayer->pNzc[iMBXY][g_kuiMbNonZeroCountIdx[i]] || pRSI4x4[0]) {
152+ if (pDqLayer->pNzc[iMBXY][g_kuiMbCountScan4Idx[i]] || pRSI4x4[0]) {
153153 pIdctResAddPredFunc (pPredI4x4, iYStride, pRSI4x4);
154154 }
155155 }
@@ -454,7 +454,7 @@ int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLeve · 298 unmodified lines
454454 int16_t* pRSI4x4 = &pRS[j << 4];
455455 uint8_t* pPredI4x4 = pPred + pBlockOffset[j];
456456
457− if (pDqLayer->pNzc[iMBXY][g_kuiMbNonZeroCountIdx[16 + (i << 2) + j]] || pRSI4x4[0]) {
457+ if (pDqLayer->pNzc[iMBXY][g_kuiMbCountScan4Idx[16 + (i << 2) + j]] || pRSI4x4[0]) {
458458 pIdctResAddPredFunc (pPredI4x4, iChromaStride, pRSI4x4);
459459 }
460460 }

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