Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 71 files). Show all
Unified · Split
| @@ -48,7 +48,6 @@ · 47 unmodified lines | ||
| 48 | 48 | |
| 49 | 49 | #define _PARSE_NALHRD_VCLHRD_PARAMS_ 1 |
| 50 | 50 | |
| 51 | −namespace WelsDec { | |
| 52 | 51 | /*! |
| 53 | 52 | ************************************************************************************* |
| 54 | 53 | * \brief Start Code Prefix (0x 00 00 00 01) detection |
| @@ -107,13 +106,13 @@ uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t · 52 unmodified lines | ||
| 107 | 106 | */ |
| 108 | 107 | uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp, |
| 109 | 108 | int32_t iSrcRbspLen, uint8_t* pSrcNal, int32_t iSrcNalLen, int32_t* pConsumedBytes) { |
| 110 | − PNalUnit pCurNal = NULL; | |
| 109 | + PNalUnit pCurNal; | |
| 111 | 110 | uint8_t* pNal = pSrcRbsp; |
| 112 | 111 | int32_t iNalSize = iSrcRbspLen; |
| 113 | − PBitStringAux pBs = NULL; | |
| 112 | + PBitStringAux pBs; | |
| 114 | 113 | bool bExtensionFlag = false; |
| 115 | − int32_t iErr = ERR_NONE; | |
| 116 | − int32_t iBitSize = 0; | |
| 114 | + int32_t iErr; | |
| 115 | + int32_t iBitSize; | |
| 117 | 116 | SDataBuffer* pSavedData = &pCtx->sSavedData; |
| 118 | 117 | SLogContext* pLogCtx = & (pCtx->sLogCtx); |
| 119 | 118 | pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable. |
| @@ -121,7 +120,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 1 unmodified line | ||
| 121 | 120 | //remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1 |
| 122 | 121 | { |
| 123 | 122 | int32_t iIndex = iSrcRbspLen - 1; |
| 124 | − uint8_t uiBsZero = 0; | |
| 123 | + uint8_t uiBsZero; | |
| 125 | 124 | while (iIndex >= 0) { |
| 126 | 125 | uiBsZero = pSrcRbsp[iIndex]; |
| 127 | 126 | if (0 == uiBsZero) { |
| @@ -266,7 +265,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 138 unmodified lines | ||
| 266 | 265 | bExtensionFlag = true; |
| 267 | 266 | case NAL_UNIT_CODED_SLICE: |
| 268 | 267 | case NAL_UNIT_CODED_SLICE_IDR: { |
| 269 | − PAccessUnit pCurAu = NULL; | |
| 268 | + PAccessUnit pCurAu; | |
| 270 | 269 | uint32_t uiAvailNalNum; |
| 271 | 270 | pCurNal = MemGetNextNal (&pCtx->pAccessUnitList, pCtx->pMemAlign); |
| 272 | 271 | if (NULL == pCurNal) { |
| @@ -574,11 +573,11 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const · 301 unmodified lines | ||
| 574 | 573 | */ |
| 575 | 574 | int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen, uint8_t* pSrcNal, |
| 576 | 575 | const int32_t kSrcNalLen) { |
| 577 | − PBitStringAux pBs = NULL; | |
| 578 | − EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0; // make initial value as unspecified | |
| 576 | + PBitStringAux pBs; | |
| 577 | + EWelsNalUnitType eNalType; // make initial value as unspecified | |
| 579 | 578 | int32_t iPicWidth = 0; |
| 580 | 579 | int32_t iPicHeight = 0; |
| 581 | − int32_t iBitSize = 0; | |
| 580 | + int32_t iBitSize; | |
| 582 | 581 | int32_t iErr = ERR_NONE; |
| 583 | 582 | if (kiSrcLen <= 0) |
| 584 | 583 | return iErr; |
| @@ -720,7 +719,7 @@ int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { · 135 unmodified lines | ||
| 720 | 719 | |
| 721 | 720 | |
| 722 | 721 | int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStringAux pBs) { |
| 723 | − PSpsSvcExt pExt = NULL; | |
| 722 | + PSpsSvcExt pExt; | |
| 724 | 723 | uint32_t uiCode; |
| 725 | 724 | int32_t iCode; |
| 726 | 725 | |
| @@ -832,7 +831,6 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 105 unmodified lines | ||
| 832 | 831 | default: |
| 833 | 832 | return NULL; |
| 834 | 833 | } |
| 835 | − return NULL; | |
| 836 | 834 | } |
| 837 | 835 | |
| 838 | 836 | bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) { |
| @@ -912,15 +910,15 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 73 unmodified lines | ||
| 912 | 910 | uint8_t* pSrcNal, const int32_t kSrcNalLen) { |
| 913 | 911 | PBitStringAux pBs = pBsAux; |
| 914 | 912 | SSubsetSps sTempSubsetSps; |
| 915 | − PSps pSps = NULL; | |
| 916 | − PSubsetSps pSubsetSps = NULL; | |
| 913 | + PSps pSps; | |
| 914 | + PSubsetSps pSubsetSps; | |
| 917 | 915 | SNalUnitHeader* pNalHead = &pCtx->sCurNalHead; |
| 918 | 916 | ProfileIdc uiProfileIdc; |
| 919 | 917 | uint8_t uiLevelIdc; |
| 920 | 918 | int32_t iSpsId; |
| 921 | 919 | uint32_t uiCode; |
| 922 | 920 | int32_t iCode; |
| 923 | − int32_t iRet = ERR_NONE; | |
| 921 | + int32_t iRet; | |
| 924 | 922 | bool bConstraintSetFlags[6] = { false }; |
| 925 | 923 | const bool kbUseSubsetFlag = IS_SUBSET_SPS_NAL (pNalHead->eNalUnitType); |
| 926 | 924 | |
| @@ -1185,7 +1183,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 258 unmodified lines | ||
| 1185 | 1183 | SBitStringAux sSubsetSpsBs; |
| 1186 | 1184 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 1187 | 1185 | |
| 1188 | − uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4, | |
| 1186 | + uint8_t* pBsBuf = (uint8_t*) (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4, | |
| 1189 | 1187 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer |
| 1190 | 1188 | if (NULL == pBsBuf) { |
| 1191 | 1189 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "sps buffer alloc failed for parse only!"); |
| @@ -1258,7 +1256,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 66 unmodified lines | ||
| 1258 | 1256 | |
| 1259 | 1257 | *pPicWidth = pSps->iMbWidth << 4; |
| 1260 | 1258 | *pPicHeight = pSps->iMbHeight << 4; |
| 1261 | − PSps pTmpSps = NULL; | |
| 1259 | + PSps pTmpSps; | |
| 1262 | 1260 | if (kbUseSubsetFlag) { |
| 1263 | 1261 | pTmpSps = &pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId].sSps; |
| 1264 | 1262 | } else { |
| @@ -1325,10 +1323,10 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 60 unmodified lines | ||
| 1325 | 1323 | */ |
| 1326 | 1324 | int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal, |
| 1327 | 1325 | const int32_t kSrcNalLen) { |
| 1328 | − | |
| 1329 | − PPps pPps = NULL; | |
| 1326 | + USED(pPpsList); | |
| 1327 | + PPps pPps; | |
| 1330 | 1328 | SPps sTempPps; |
| 1331 | − uint32_t uiPpsId = 0; | |
| 1329 | + uint32_t uiPpsId; | |
| 1332 | 1330 | uint32_t iTmp; |
| 1333 | 1331 | uint32_t uiCode; |
| 1334 | 1332 | int32_t iCode; |
| @@ -1545,7 +1543,7 @@ int32_t ParseVui (PWelsDecoderContext pCtx, PSps pSps, PBitStringAux pBsAux) { · 210 unmodified lines | ||
| 1545 | 1543 | WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //timing_info_present_flag |
| 1546 | 1544 | pVui->bTimingInfoPresentFlag = !!uiCode; |
| 1547 | 1545 | if (pVui->bTimingInfoPresentFlag) { |
| 1548 | − uint32_t uiTmp = 0; | |
| 1546 | + uint32_t uiTmp; | |
| 1549 | 1547 | WELS_READ_VERIFY (BsGetBits (pBsAux, 16, &uiCode)); //num_units_in_tick |
| 1550 | 1548 | uiTmp = (uiCode << 16); |
| 1551 | 1549 | WELS_READ_VERIFY (BsGetBits (pBsAux, 16, &uiCode)); //num_units_in_tick |
| @@ -1657,7 +1655,8 @@ int32_t ParseVui (PWelsDecoderContext pCtx, PSps pSps, PBitStringAux pBsAux) { · 105 unmodified lines | ||
| 1657 | 1655 | */ |
| 1658 | 1656 | int32_t ParseSei (void* pSei, PBitStringAux pBsAux) { // reserved Sei_Msg type |
| 1659 | 1657 | |
| 1660 | − | |
| 1658 | + USED(pSei); | |
| 1659 | + USED(pBsAux); | |
| 1661 | 1660 | return ERR_NONE; |
| 1662 | 1661 | } |
| 1663 | 1662 | /* |
| @@ -1783,5 +1782,3 @@ int32_t ResetFmoList (PWelsDecoderContext pCtx) { · 119 unmodified lines | ||
| 1783 | 1782 | } |
| 1784 | 1783 | return iCountNum; |
| 1785 | 1784 | } |
| 1786 | − | |
| 1787 | −} // namespace WelsDec | |