History

astyle and speed up decoding by removing unnessary memset

dong zhang committed 11 years ago

Commit 89f78e91 parent 2c696381 file · +24 −25Browse files

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

Unified · Split

codec/decoder/core/src/decode_slice.cpp+24−25
@@ -101,7 +101,7 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { · 100 unmodified lines
101101 ++iCountNumMb;
102102 if (!pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex]) { //already con-ed, overwrite
103103 pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex] = true;
104− pCtx->pDec->iMbEcedPropNum += (pCurLayer->pMbRefConcealedFlag[iNextMbXyIndex]? 1 : 0);
104+ pCtx->pDec->iMbEcedPropNum += (pCurLayer->pMbRefConcealedFlag[iNextMbXyIndex] ? 1 : 0);
105105 ++pCtx->iTotalNumMbRec;
106106 }
107107
@@ -529,7 +529,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 421 unmodified lines
529529 //get uiCbp for I4x4
530530 WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, &sNeighAvail, uiCbp));
531531 pCurLayer->pCbp[iMbXy] = uiCbp;
532− pSlice->iLastDeltaQp = uiCbp == 0 ? 0: pSlice->iLastDeltaQp;
532+ pSlice->iLastDeltaQp = uiCbp == 0 ? 0 : pSlice->iLastDeltaQp;
533533 uiCbpChroma = uiCbp >> 4;
534534 uiCbpLuma = uiCbp & 15;
535535 } else { //I16x16;
@@ -542,7 +542,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 6 unmodified lines
542542 WELS_READ_VERIFY (ParseIntra16x16Mode (pCtx, &sNeighAvail, pBsAux, pCurLayer));
543543 }
544544
545− memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
545+
546546 ST32 (&pCurLayer->pNzc[iMbXy][0], 0);
547547 ST32 (&pCurLayer->pNzc[iMbXy][4], 0);
548548 ST32 (&pCurLayer->pNzc[iMbXy][8], 0);
@@ -558,6 +558,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 9 unmodified lines
558558 }
559559
560560 if (pCurLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) {
561+ memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
561562 int32_t iQpDelta, iId8x8, iId4x4;
562563 WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta));
563564 if (iQpDelta > 25 || iQpDelta < -26) {//out of iQpDelta range
@@ -722,18 +723,6 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 158 unmodified lines
722723 }
723724 }
724725
725− if (MB_TYPE_INTRA16x16 != pCurLayer->pMbType[iMbXy]) {
726− WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, uiCbp));
727− pCurLayer->pCbp[iMbXy] = uiCbp;
728− pSlice->iLastDeltaQp = uiCbp == 0 ? 0: pSlice->iLastDeltaQp;
729− uiCbpChroma = pCurLayer->pCbp[iMbXy] >> 4;
730− uiCbpLuma = pCurLayer->pCbp[iMbXy] & 15;
731− }
732−
733− pCtx->sBlockFunc.pWelsBlockZero16x16Func (pCurLayer->pScaledTCoeff[iMbXy], 16);
734− pCtx->sBlockFunc.pWelsBlockZero8x8Func (pCurLayer->pScaledTCoeff[iMbXy] + 256, 8);
735− pCtx->sBlockFunc.pWelsBlockZero8x8Func (pCurLayer->pScaledTCoeff[iMbXy] + 256 + 64, 8);
736−
737726 ST32 (&pCurLayer->pNzc[iMbXy][0], 0);
738727 ST32 (&pCurLayer->pNzc[iMbXy][4], 0);
739728 ST32 (&pCurLayer->pNzc[iMbXy][8], 0);
@@ -741,7 +730,17 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 1 unmodified line
741730 ST32 (&pCurLayer->pNzc[iMbXy][16], 0);
742731 ST32 (&pCurLayer->pNzc[iMbXy][20], 0);
743732
733+ if (MB_TYPE_INTRA16x16 != pCurLayer->pMbType[iMbXy]) {
734+ WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, uiCbp));
735+ pCurLayer->pCbp[iMbXy] = uiCbp;
736+ pSlice->iLastDeltaQp = uiCbp == 0 ? 0 : pSlice->iLastDeltaQp;
737+ uiCbpChroma = pCurLayer->pCbp[iMbXy] >> 4;
738+ uiCbpLuma = pCurLayer->pCbp[iMbXy] & 15;
739+ }
740+
744741 if (pCurLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) {
742+ memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
743+
745744 int32_t iQpDelta, iId8x8, iId4x4;
746745
747746 WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta));
@@ -863,7 +862,7 @@ int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 115 unmodified lines
863862
864863 pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
865864 memset (pCurLayer->pRefIndex[0][iMbXy], 0, sizeof (int8_t) * 16);
866− pCtx->bMbRefConcealed = pCtx->bRPLRError || pCtx->bMbRefConcealed || !(ppRefPic[0]&&ppRefPic[0]->bIsComplete);
865+ pCtx->bMbRefConcealed = pCtx->bRPLRError || pCtx->bMbRefConcealed || ! (ppRefPic[0] && ppRefPic[0]->bIsComplete);
867866 //predict mv
868867 PredPSkipMvFromNeighbor (pCurLayer, pMv);
869868 for (i = 0; i < 16; i++) {
@@ -871,9 +870,9 @@ int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 1 unmodified line
871870 ST32 (pCurLayer->pMvd[0][iMbXy][i], 0);
872871 }
873872
874− if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag) {
875− memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (int16_t));
876− }
873+ //if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag) {
874+ // memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (int16_t));
875+ //}
877876
878877 //reset rS
879878 pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; //??????????????? dqaunt of previous mb
@@ -1071,7 +1070,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 191 unmodified lines
10711070 pCurLayer->pLumaQp[iMbXy] = 0;
10721071 pCurLayer->pChromaQp[iMbXy] = 0;
10731072 memset (pNzc, 16, sizeof (pCurLayer->pNzc[iMbXy])); //Rec. 9.2.1 for PCM, nzc=16
1074− WELS_READ_VERIFY(InitReadBits (pBs, 0));
1073+ WELS_READ_VERIFY (InitReadBits (pBs, 0));
10751074 return 0;
10761075 } else if (0 == uiMbType) { //reference to JM
10771076 ENFORCE_STACK_ALIGN_1D (int8_t, pIntraPredMode, 48, 16);
@@ -1101,7 +1100,6 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 23 unmodified lines
11011100 WELS_READ_VERIFY (ParseIntra16x16Mode (pCtx, &sNeighAvail, pBs, pCurLayer));
11021101 }
11031102
1104− memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
11051103 ST32A4 (&pNzc[0], 0);
11061104 ST32A4 (&pNzc[4], 0);
11071105 ST32A4 (&pNzc[8], 0);
@@ -1117,6 +1115,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 9 unmodified lines
11171115 }
11181116
11191117 if (pCurLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) {
1118+ memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
11201119 int32_t iQpDelta, iId8x8, iId4x4;
11211120
11221121 WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //mb_qp_delta
@@ -1551,16 +1550,16 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 428 unmodified lines
15511550
15521551 pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
15531552 memset (pCurLayer->pRefIndex[0][iMbXy], 0, sizeof (int8_t) * 16);
1554− pCtx->bMbRefConcealed = pCtx->bRPLRError || pCtx->bMbRefConcealed || !(ppRefPic[0]&&ppRefPic[0]->bIsComplete);
1553+ pCtx->bMbRefConcealed = pCtx->bRPLRError || pCtx->bMbRefConcealed || ! (ppRefPic[0] && ppRefPic[0]->bIsComplete);
15551554 //predict iMv
15561555 PredPSkipMvFromNeighbor (pCurLayer, iMv);
15571556 for (i = 0; i < 16; i++) {
15581557 ST32A2 (pCurLayer->pMv[0][iMbXy][i], * (uint32_t*)iMv);
15591558 }
15601559
1561− if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag) {
1562− memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (int16_t));
1563− }
1560+ //if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag) {
1561+ // memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (int16_t));
1562+ //}
15641563
15651564 //reset rS
15661565 if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag ||

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