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
149 WelsChromaDcIdct (pCurLayer->pScaledTCoeff[iMbXy] + 320); // 320 = 16*16 + 16*4149 WelsChromaDcIdct (pCurLayer->pScaledTCoeff[iMbXy] + 320); // 320 = 16*16 + 16*4
150 150
151 for (i = 0; i < 16; i++) { //luma151 for (i = 0; i < 16; i++) { //luma
152 iIndex = g_kuiMbNonZeroCountIdx[i];152 iIndex = g_kuiMbCountScan4Idx[i];
153 if (pCurLayer->pNzc[iMbXy][iIndex]) {153 if (pCurLayer->pNzc[iMbXy][iIndex]) {
154 iOffset = ((iIndex >> 2) << 2) * iStrideL + ((iIndex % 4) << 2);154 iOffset = ((iIndex >> 2) << 2) * iStrideL + ((iIndex % 4) << 2);
155 pCtx->pIdctResAddPredFunc (pDstY + iOffset, iStrideL, pCurLayer->pScaledTCoeff[iMbXy] + (i << 4));155 pCtx->pIdctResAddPredFunc (pDstY + iOffset, iStrideL, pCurLayer->pScaledTCoeff[iMbXy] + (i << 4));
@@ -157,13 +157,13 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 1 unmodified line
157 }157 }
158 158
159 for (i = 0; i < 4; i++) { //chroma159 for (i = 0; i < 4; i++) { //chroma
160 iIndex = g_kuiMbNonZeroCountIdx[i + 16]; //Cb160 iIndex = g_kuiMbCountScan4Idx[i + 16]; //Cb
161 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4))) {161 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4))) {
162 iOffset = (((iIndex - 16) >> 2) << 2) * iStrideC + (((iIndex - 16) % 4) << 2);162 iOffset = (((iIndex - 16) >> 2) << 2) * iStrideC + (((iIndex - 16) % 4) << 2);
163 pCtx->pIdctResAddPredFunc (pDstU + iOffset, iStrideC, pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4));163 pCtx->pIdctResAddPredFunc (pDstU + iOffset, iStrideC, pCurLayer->pScaledTCoeff[iMbXy] + ((i + 16) << 4));
164 }164 }
165 165
166 iIndex = g_kuiMbNonZeroCountIdx[i + 20]; //Cr166 iIndex = g_kuiMbCountScan4Idx[i + 20]; //Cr
167 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4))) {167 if (pCurLayer->pNzc[iMbXy][iIndex] || * (pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4))) {
168 iOffset = (((iIndex - 18) >> 2) << 2) * iStrideC + (((iIndex - 18) % 4) << 2);168 iOffset = (((iIndex - 18) >> 2) << 2) * iStrideC + (((iIndex - 18) % 4) << 2);
169 pCtx->pIdctResAddPredFunc (pDstV + iOffset, iStrideC , pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4));169 pCtx->pIdctResAddPredFunc (pDstV + iOffset, iStrideC , pCurLayer->pScaledTCoeff[iMbXy] + ((i + 20) << 4));
@@ -553,7 +553,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 383 unmodified lines
553 553
554 if (pCurLayer->pCbp[iMbXy] == 0 && IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) {554 if (pCurLayer->pCbp[iMbXy] == 0 && IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) {
555 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;555 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] +
557 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];557 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
558 558
559 }559 }
@@ -582,7 +582,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 22 unmodified lines
582 return ERR_INFO_INVALID_QP;582 return ERR_INFO_INVALID_QP;
583 }583 }
584 pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];584 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,
586 51)];586 51)];
587 587
588 588
@@ -622,8 +622,8 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 33 unmodified lines
622 iIndex++;622 iIndex++;
623 }623 }
624 } else {624 } else {
625 ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2)]], 0);625 ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2)]], 0);
626 ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2) + 2]], 0);626 ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2) + 2]], 0);
627 }627 }
628 }628 }
629 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));629 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));
@@ -857,7 +857,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 227 unmodified lines
857 ST32A4 (&pNzc[20], 0);857 ST32A4 (&pNzc[20], 0);
858 if (pCurLayer->pCbp[iMbXy] == 0 && !IS_INTRA16x16 (pCurLayer->pMbType[iMbXy]) && !IS_I_BL (pCurLayer->pMbType[iMbXy])) {858 if (pCurLayer->pCbp[iMbXy] == 0 && !IS_INTRA16x16 (pCurLayer->pMbType[iMbXy]) && !IS_I_BL (pCurLayer->pMbType[iMbXy])) {
859 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;859 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] +
861 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];861 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
862 }862 }
863 863
@@ -885,7 +885,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 21 unmodified lines
885 return ERR_INFO_INVALID_QP;885 return ERR_INFO_INVALID_QP;
886 }886 }
887 pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];887 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,
889 51)];889 51)];
890 890
891 BsStartCavlc (pBs);891 BsStartCavlc (pBs);
@@ -924,8 +924,8 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 32 unmodified lines
924 iIndex++;924 iIndex++;
925 }925 }
926 } else {926 } else {
927 ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[iId8x8 << 2]], 0);927 ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[iId8x8 << 2]], 0);
928 ST16 (&pNonZeroCount[g_kuiCacheNzcScanIdx[ (iId8x8 << 2) + 2]], 0);928 ST16 (&pNonZeroCount[g_kuiCache48CountScan4Idx[ (iId8x8 << 2) + 2]], 0);
929 }929 }
930 }930 }
931 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));931 ST32A4 (&pNzc[0], LD32 (&pNonZeroCount[1 + 8 * 1]));
@@ -1019,7 +1019,7 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) { · 87 unmodified lines
1019 if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag ||1019 if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag ||
1020 (pNalCur->sNalHeaderExt.uiQualityId == 0 && pNalCur->sNalHeaderExt.uiDependencyId == 0)) {1020 (pNalCur->sNalHeaderExt.uiQualityId == 0 && pNalCur->sNalHeaderExt.uiDependencyId == 0)) {
1021 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp;1021 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] +
1023 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];1023 pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)];
1024 }1024 }
1025 1025
codec/decoder/core/src/decoder_data_tables.cpp+3−3
@@ -41,7 +41,7 @@ namespace WelsDec { · 40 unmodified lines
41///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////41///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
42 42
43//////non_zero_count[16+8] mapping scan index43//////non_zero_count[16+8] mapping scan index
44const uint8_t g_kuiMbNonZeroCountIdx[24] = {44const uint8_t g_kuiMbCountScan4Idx[24] = {
45 // 0 1 | 4 5 luma 8*8 block non_zero_count[16+8]45 // 0 1 | 4 5 luma 8*8 block non_zero_count[16+8]
46 0, 1, 4, 5, // 2 3 | 6 7 0 | 1 0 1 2 346 0, 1, 4, 5, // 2 3 | 6 7 0 | 1 0 1 2 3
47 2, 3, 6, 7, //--------------- --------- 4 5 6 747 2, 3, 6, 7, //--------------- --------- 4 5 6 7
@@ -52,7 +52,7 @@ const uint8_t g_kuiMbNonZeroCountIdx[24] = { · 4 unmodified lines
52};52};
53//cache element equal to 2653//cache element equal to 26
54 54
55const uint8_t g_kuiCacheNzcScanIdx[24] = {55const uint8_t g_kuiCache48CountScan4Idx[24] = {
56 /* Luma */56 /* Luma */
57 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,57 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8,
58 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8,58 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
87 87
88// extern at wels_common_basis.h88// extern at wels_common_basis.h
89 89
90const uint8_t g_kuiChromaQp[52] = {90const uint8_t g_kuiChromaQpTable[52] = {
91 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,91 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
92 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,92 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
93 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, 37,93 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
687 //////////////////////////////////////////////////////////////////////////687 //////////////////////////////////////////////////////////////////////////
688 688
689 if (bChroma) {689 if (bChroma) {
690 iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex];690 iCurNonZeroCacheIdx = g_kuiCache48CountScan4Idx[iIndex];
691 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];691 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];
692 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];692 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];
693 } else { //luma693 } else { //luma
694 iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex];694 iCurNonZeroCacheIdx = g_kuiCache48CountScan4Idx[iIndex];
695 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];695 nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1];
696 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];696 nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8];
697 }697 }
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
93 93
94 pGetI4x4LumaPredFunc[uiMode] (pPredI4x4, iLumaStride);94 pGetI4x4LumaPredFunc[uiMode] (pPredI4x4, iLumaStride);
95 95
96 if (pDqLayer->pNzc[iMBXY][g_kuiMbNonZeroCountIdx[i]]) {96 if (pDqLayer->pNzc[iMBXY][g_kuiMbCountScan4Idx[i]]) {
97 int16_t* pRSI4x4 = &pRS[i << 4];97 int16_t* pRSI4x4 = &pRS[i << 4];
98 pIdctResAddPredFunc (pPredI4x4, iLumaStride, pRSI4x4);98 pIdctResAddPredFunc (pPredI4x4, iLumaStride, pRSI4x4);
99 }99 }
@@ -149,7 +149,7 @@ int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLe · 49 unmodified lines
149 int16_t* pRSI4x4 = pRS + (i << 4);149 int16_t* pRSI4x4 = pRS + (i << 4);
150 uint8_t* pPredI4x4 = pPred + pBlockOffset[i];150 uint8_t* pPredI4x4 = pPred + pBlockOffset[i];
151 151
152 if (pDqLayer->pNzc[iMBXY][g_kuiMbNonZeroCountIdx[i]] || pRSI4x4[0]) {152 if (pDqLayer->pNzc[iMBXY][g_kuiMbCountScan4Idx[i]] || pRSI4x4[0]) {
153 pIdctResAddPredFunc (pPredI4x4, iYStride, pRSI4x4);153 pIdctResAddPredFunc (pPredI4x4, iYStride, pRSI4x4);
154 }154 }
155 }155 }
@@ -454,7 +454,7 @@ int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLeve · 298 unmodified lines
454 int16_t* pRSI4x4 = &pRS[j << 4];454 int16_t* pRSI4x4 = &pRS[j << 4];
455 uint8_t* pPredI4x4 = pPred + pBlockOffset[j];455 uint8_t* pPredI4x4 = pPred + pBlockOffset[j];
456 456
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]) {
458 pIdctResAddPredFunc (pPredI4x4, iChromaStride, pRSI4x4);458 pIdctResAddPredFunc (pPredI4x4, iChromaStride, pRSI4x4);
459 }459 }
460 }460 }

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