Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 71 files). Show all
Unified · Split
| @@ -43,7 +43,6 @@ · 42 unmodified lines | ||
| 43 | 43 | #include "memory_align.h" |
| 44 | 44 | #include "error_concealment.h" |
| 45 | 45 | |
| 46 | −namespace WelsDec { | |
| 47 | 46 | static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { |
| 48 | 47 | PDqLayer pCurDq = pCtx->pCurDqLayer; |
| 49 | 48 | PPicture pPic = pCtx->pDec; |
| @@ -90,9 +89,9 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 40 unmodified lines | ||
| 90 | 89 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 91 | 90 | if (dsErrorFree == pCtx->iErrorCode) { //correct decoding, add to data buffer |
| 92 | 91 | SParserBsInfo* pParser = pCtx->pParserBsInfo; |
| 93 | − SNalUnit* pCurNal = NULL; | |
| 92 | + SNalUnit* pCurNal; | |
| 94 | 93 | int32_t iTotalNalLen = 0; |
| 95 | − int32_t iNalLen = 0; | |
| 94 | + int32_t iNalLen; | |
| 96 | 95 | int32_t iNum = 0; |
| 97 | 96 | while (iNum < pParser->iNalNum) { |
| 98 | 97 | iTotalNalLen += pParser->pNalLenInByte[iNum++]; |
| @@ -100,7 +99,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 1 unmodified line | ||
| 100 | 99 | uint8_t* pDstBuf = pParser->pDstBuff + iTotalNalLen; |
| 101 | 100 | int32_t iIdx = pCurAu->uiStartPos; |
| 102 | 101 | int32_t iEndIdx = pCurAu->uiEndPos; |
| 103 | − uint8_t* pNalBs = NULL; | |
| 102 | + uint8_t* pNalBs; | |
| 104 | 103 | pParser->uiOutBsTimeStamp = (pCurAu->pNalUnitsList [iIdx]) ? pCurAu->pNalUnitsList [iIdx]->uiTimeStamp : 0; |
| 105 | 104 | //pParser->iNalNum = 0; |
| 106 | 105 | pParser->iSpsWidthInPixel = (pCtx->pSps->iMbWidth << 4) - ((pCtx->pSps->sFrameCrop.iLeftOffset + |
| @@ -117,8 +116,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 10 unmodified lines | ||
| 117 | 116 | WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, ExpandBsLenBuffer (pCtx, pParser->iNalNum + 2)) |
| 118 | 117 | } |
| 119 | 118 | bool bSubSps = (NAL_UNIT_CODED_SLICE_EXT == pCurAu->pNalUnitsList [iIdx]->sNalHeaderExt.sNalUnitHeader.eNalUnitType); |
| 120 | − SSpsBsInfo* pSpsBs = NULL; | |
| 121 | − SPpsBsInfo* pPpsBs = NULL; | |
| 119 | + SSpsBsInfo* pSpsBs; | |
| 120 | + SPpsBsInfo* pPpsBs; | |
| 122 | 121 | int32_t iSpsId = pCtx->pSps->iSpsId; |
| 123 | 122 | int32_t iPpsId = pCtx->pPps->iPpsId; |
| 124 | 123 | pCtx->bParamSetsLostFlag = false; |
| @@ -323,12 +322,12 @@ int32_t ParsePredWeightedTable (PBitStringAux pBs, PSliceHeader pSh) { · 198 unmodified lines | ||
| 323 | 322 | int32_t iCode; |
| 324 | 323 | |
| 325 | 324 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); |
| 326 | − WELS_CHECK_SE_BOTH_ERROR_NOLOG (uiCode, 0, 7, "luma_log2_weight_denom", | |
| 325 | + WELS_CHECK_SE_BOTH_ERROR_NOLOG ((int)uiCode, 0, 7, "luma_log2_weight_denom", | |
| 327 | 326 | GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_LUMA_LOG2_WEIGHT_DENOM)); |
| 328 | 327 | pSh->sPredWeightTable.uiLumaLog2WeightDenom = uiCode; |
| 329 | 328 | if (pSh->pSps->uiChromaArrayType != 0) { |
| 330 | 329 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); |
| 331 | − WELS_CHECK_SE_BOTH_ERROR_NOLOG (uiCode, 0, 7, "chroma_log2_weight_denom", | |
| 330 | + WELS_CHECK_SE_BOTH_ERROR_NOLOG ((int)uiCode, 0, 7, "chroma_log2_weight_denom", | |
| 332 | 331 | GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_CHROMA_LOG2_WEIGHT_DENOM)); |
| 333 | 332 | pSh->sPredWeightTable.uiChromaLog2WeightDenom = uiCode; |
| 334 | 333 | } |
| @@ -544,7 +543,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 209 unmodified lines | ||
| 544 | 543 | bMmco4Exist = true; |
| 545 | 544 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 |
| 546 | 545 | int32_t iMaxLongTermFrameIdx = -1 + uiCode; |
| 547 | − if (iMaxLongTermFrameIdx > int32_t (pSps->uiLog2MaxFrameNum)) { | |
| 546 | + if (iMaxLongTermFrameIdx > (int32_t) (pSps->uiLog2MaxFrameNum)) { | |
| 548 | 547 | //ISO/IEC 14496-10:2009(E) 7.4.3.3 Decoded reference picture marking semantics page 96 |
| 549 | 548 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_MARKING); |
| 550 | 549 | } |
| @@ -609,26 +608,26 @@ int32_t InitBsBuffer (PWelsDecoderContext pCtx) { · 58 unmodified lines | ||
| 609 | 608 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 610 | 609 | |
| 611 | 610 | pCtx->iMaxBsBufferSizeInByte = MIN_ACCESS_UNIT_CAPACITY * MAX_BUFFERED_NUM; |
| 612 | − if ((pCtx->sRawData.pHead = static_cast<uint8_t*> (pMa->WelsMallocz (pCtx->iMaxBsBufferSizeInByte, | |
| 611 | + if ((pCtx->sRawData.pHead = (uint8_t*) (pMa->WelsMallocz (pCtx->iMaxBsBufferSizeInByte, | |
| 613 | 612 | "pCtx->sRawData.pHead"))) == NULL) { |
| 614 | 613 | return ERR_INFO_OUT_OF_MEMORY; |
| 615 | 614 | } |
| 616 | 615 | pCtx->sRawData.pStartPos = pCtx->sRawData.pCurPos = pCtx->sRawData.pHead; |
| 617 | 616 | pCtx->sRawData.pEnd = pCtx->sRawData.pHead + pCtx->iMaxBsBufferSizeInByte; |
| 618 | 617 | if (pCtx->pParam->bParseOnly) { |
| 619 | − pCtx->pParserBsInfo = static_cast<SParserBsInfo*> (pMa->WelsMallocz (sizeof (SParserBsInfo), "pCtx->pParserBsInfo")); | |
| 618 | + pCtx->pParserBsInfo = (SParserBsInfo*) (pMa->WelsMallocz (sizeof (SParserBsInfo), "pCtx->pParserBsInfo")); | |
| 620 | 619 | if (pCtx->pParserBsInfo == NULL) { |
| 621 | 620 | return ERR_INFO_OUT_OF_MEMORY; |
| 622 | 621 | } |
| 623 | 622 | memset (pCtx->pParserBsInfo, 0, sizeof (SParserBsInfo)); |
| 624 | − pCtx->pParserBsInfo->pDstBuff = static_cast<uint8_t*> (pMa->WelsMallocz (MAX_ACCESS_UNIT_CAPACITY * sizeof (uint8_t), | |
| 623 | + pCtx->pParserBsInfo->pDstBuff = (uint8_t*) (pMa->WelsMallocz (MAX_ACCESS_UNIT_CAPACITY * sizeof (uint8_t), | |
| 625 | 624 | "pCtx->pParserBsInfo->pDstBuff")); |
| 626 | 625 | if (pCtx->pParserBsInfo->pDstBuff == NULL) { |
| 627 | 626 | return ERR_INFO_OUT_OF_MEMORY; |
| 628 | 627 | } |
| 629 | 628 | memset (pCtx->pParserBsInfo->pDstBuff, 0, MAX_ACCESS_UNIT_CAPACITY * sizeof (uint8_t)); |
| 630 | 629 | |
| 631 | − if ((pCtx->sSavedData.pHead = static_cast<uint8_t*> (pMa->WelsMallocz (pCtx->iMaxBsBufferSizeInByte, | |
| 630 | + if ((pCtx->sSavedData.pHead = (uint8_t*) (pMa->WelsMallocz (pCtx->iMaxBsBufferSizeInByte, | |
| 632 | 631 | "pCtx->sSavedData.pHead"))) == NULL) { |
| 633 | 632 | return ERR_INFO_OUT_OF_MEMORY; |
| 634 | 633 | } |
| @@ -636,7 +635,7 @@ int32_t InitBsBuffer (PWelsDecoderContext pCtx) { · 1 unmodified line | ||
| 636 | 635 | pCtx->sSavedData.pEnd = pCtx->sSavedData.pHead + pCtx->iMaxBsBufferSizeInByte; |
| 637 | 636 | |
| 638 | 637 | pCtx->iMaxNalNum = MAX_NAL_UNITS_IN_LAYER + 2; //2 reserved for SPS+PPS |
| 639 | − pCtx->pParserBsInfo->pNalLenInByte = static_cast<int*> (pMa->WelsMallocz (pCtx->iMaxNalNum * sizeof (int), | |
| 638 | + pCtx->pParserBsInfo->pNalLenInByte = (int*) (pMa->WelsMallocz (pCtx->iMaxNalNum * sizeof (int), | |
| 640 | 639 | "pCtx->pParserBsInfo->pNalLenInByte")); |
| 641 | 640 | if (pCtx->pParserBsInfo->pNalLenInByte == NULL) { |
| 642 | 641 | return ERR_INFO_OUT_OF_MEMORY; |
| @@ -654,7 +653,7 @@ int32_t ExpandBsBuffer (PWelsDecoderContext pCtx, const int kiSrcLen) { · 11 unmodified lines | ||
| 654 | 653 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 655 | 654 | |
| 656 | 655 | //Realloc sRawData |
| 657 | − uint8_t* pNewBsBuff = static_cast<uint8_t*> (pMa->WelsMallocz (iNewBuffLen, "pCtx->sRawData.pHead")); | |
| 656 | + uint8_t* pNewBsBuff = (uint8_t*) (pMa->WelsMallocz (iNewBuffLen, "pCtx->sRawData.pHead")); | |
| 658 | 657 | if (pNewBsBuff == NULL) { |
| 659 | 658 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "ExpandBsBuffer() Failed for malloc pNewBsBuff (%d)", iNewBuffLen); |
| 660 | 659 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -679,7 +678,7 @@ int32_t ExpandBsBuffer (PWelsDecoderContext pCtx, const int kiSrcLen) { · 18 unmodified lines | ||
| 679 | 678 | |
| 680 | 679 | if (pCtx->pParam->bParseOnly) { |
| 681 | 680 | //Realloc sSavedData |
| 682 | − uint8_t* pNewSavedBsBuff = static_cast<uint8_t*> (pMa->WelsMallocz (iNewBuffLen, "pCtx->sSavedData.pHead")); | |
| 681 | + uint8_t* pNewSavedBsBuff = (uint8_t*) (pMa->WelsMallocz (iNewBuffLen, "pCtx->sSavedData.pHead")); | |
| 683 | 682 | if (pNewSavedBsBuff == NULL) { |
| 684 | 683 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "ExpandBsBuffer() Failed for malloc pNewSavedBsBuff (%d)", iNewBuffLen); |
| 685 | 684 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -704,7 +703,7 @@ int32_t ExpandBsLenBuffer (PWelsDecoderContext pCtx, const int kiCurrLen) { · 18 unmodified lines | ||
| 704 | 703 | if (!pParser->pNalLenInByte) |
| 705 | 704 | return ERR_INFO_INVALID_ACCESS; |
| 706 | 705 | |
| 707 | − int iNewLen = kiCurrLen; | |
| 706 | + int iNewLen; | |
| 708 | 707 | if (kiCurrLen >= MAX_MB_SIZE + 2) { //exceeds the max MB number of level 5.2 |
| 709 | 708 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Current nal num (%d) exceededs %d.", kiCurrLen, MAX_MB_SIZE); |
| 710 | 709 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -715,7 +714,7 @@ int32_t ExpandBsLenBuffer (PWelsDecoderContext pCtx, const int kiCurrLen) { · 4 unmodified lines | ||
| 715 | 714 | } |
| 716 | 715 | |
| 717 | 716 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 718 | − int* pNewLenBuffer = static_cast<int*> (pMa->WelsMallocz (iNewLen * sizeof (int), | |
| 717 | + int* pNewLenBuffer = (int*) (pMa->WelsMallocz (iNewLen * sizeof (int), | |
| 719 | 718 | "pCtx->pParserBsInfo->pNalLenInByte")); |
| 720 | 719 | if (pNewLenBuffer == NULL) { |
| 721 | 720 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -854,7 +853,7 @@ void UpdateDecoderStatisticsForActiveParaset (SDecoderStatistics* pDecoderStatis · 132 unmodified lines | ||
| 854 | 853 | pDecoderStatistics->iCurrentActiveSpsId = pSps->iSpsId; |
| 855 | 854 | |
| 856 | 855 | pDecoderStatistics->iCurrentActivePpsId = pPps->iPpsId; |
| 857 | − pDecoderStatistics->uiProfile = static_cast<unsigned int> (pSps->uiProfileIdc); | |
| 856 | + pDecoderStatistics->uiProfile = (unsigned int) (pSps->uiProfileIdc); | |
| 858 | 857 | pDecoderStatistics->uiLevel = pSps->uiLevelIdc; |
| 859 | 858 | } |
| 860 | 859 | |
| @@ -876,19 +875,19 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 15 unmodified lines | ||
| 876 | 875 | pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - |
| 877 | 876 | 1]; |
| 878 | 877 | |
| 879 | − PNalUnitHeaderExt pNalHeaderExt = NULL; | |
| 880 | − PSliceHeader pSliceHead = NULL; | |
| 881 | − PSliceHeaderExt pSliceHeadExt = NULL; | |
| 878 | + PNalUnitHeaderExt pNalHeaderExt; | |
| 879 | + PSliceHeader pSliceHead; | |
| 880 | + PSliceHeaderExt pSliceHeadExt; | |
| 882 | 881 | PSubsetSps pSubsetSps = NULL; |
| 883 | − PSps pSps = NULL; | |
| 884 | − PPps pPps = NULL; | |
| 885 | − EWelsNalUnitType eNalType = static_cast<EWelsNalUnitType> (0); | |
| 886 | − int32_t iPpsId = 0; | |
| 887 | − int32_t iRet = ERR_NONE; | |
| 888 | − uint8_t uiSliceType = 0; | |
| 882 | + PSps pSps; | |
| 883 | + PPps pPps; | |
| 884 | + EWelsNalUnitType eNalType; | |
| 885 | + int32_t iPpsId; | |
| 886 | + int32_t iRet; | |
| 887 | + uint8_t uiSliceType; | |
| 889 | 888 | uint8_t uiQualityId = BASE_QUALITY_ID; |
| 890 | − bool bIdrFlag = false; | |
| 891 | − bool bSgChangeCycleInvolved = false; // involved slice group change cycle ? | |
| 889 | + bool bIdrFlag; | |
| 890 | + bool bSgChangeCycleInvolved; // involved slice group change cycle ? | |
| 892 | 891 | uint32_t uiCode; |
| 893 | 892 | int32_t iCode; |
| 894 | 893 | SLogContext* pLogCtx = & (pCtx->sLogCtx); |
| @@ -942,7 +941,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 47 unmodified lines | ||
| 942 | 941 | } |
| 943 | 942 | } |
| 944 | 943 | |
| 945 | − pSliceHead->eSliceType = static_cast <EWelsSliceType> (uiSliceType); | |
| 944 | + pSliceHead->eSliceType = (EWelsSliceType) (uiSliceType); | |
| 946 | 945 | |
| 947 | 946 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_parameter_set_id |
| 948 | 947 | WELS_CHECK_SE_UPPER_ERROR (uiCode, (MAX_PPS_COUNT - 1), "iPpsId out of range", |
| @@ -1253,7 +1252,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 304 unmodified lines | ||
| 1253 | 1252 | bSgChangeCycleInvolved = (bSgChangeCycleInvolved && (uiQualityId == BASE_QUALITY_ID)); |
| 1254 | 1253 | if (bSgChangeCycleInvolved) { |
| 1255 | 1254 | if (pPps->uiSliceGroupChangeRate > 0) { |
| 1256 | − const int32_t kiNumBits = (int32_t)WELS_CEIL (log (static_cast<double> (1 + pPps->uiPicSizeInMapUnits / | |
| 1255 | + const int32_t kiNumBits = (int32_t)WELS_CEIL (log ((double) (1 + pPps->uiPicSizeInMapUnits / | |
| 1257 | 1256 | pPps->uiSliceGroupChangeRate))); |
| 1258 | 1257 | WELS_READ_VERIFY (BsGetBits (pBs, kiNumBits, &uiCode)); //lice_group_change_cycle |
| 1259 | 1258 | pSliceHead->iSliceGroupChangeCycle = uiCode; |
| @@ -1392,11 +1391,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 132 unmodified lines | ||
| 1392 | 1391 | * ppDst: succeeded VCL NAL based AVC (I/P Slice) |
| 1393 | 1392 | */ |
| 1394 | 1393 | bool PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kppDst, PNalUnit const kpSrc) { |
| 1395 | − PNalUnitHeaderExt pNalHdrExtD = NULL, pNalHdrExtS = NULL; | |
| 1396 | − PSliceHeaderExt pShExtD = NULL; | |
| 1397 | − PPrefixNalUnit pPrefixS = NULL; | |
| 1398 | − PSps pSps = NULL; | |
| 1399 | − int32_t iIdx = 0; | |
| 1394 | + PNalUnitHeaderExt pNalHdrExtD, pNalHdrExtS; | |
| 1395 | + PSliceHeaderExt pShExtD ; | |
| 1396 | + PPrefixNalUnit pPrefixS; | |
| 1397 | + PSps pSps; | |
| 1398 | + int32_t iIdx; | |
| 1400 | 1399 | |
| 1401 | 1400 | if (kppDst == NULL || kpSrc == NULL) |
| 1402 | 1401 | return false; |
| @@ -1792,7 +1791,6 @@ void UninitialDqLayersContext (PWelsDecoderContext pCtx) { · 389 unmodified lines | ||
| 1792 | 1791 | } |
| 1793 | 1792 | pMa->WelsFree (pDq, "pDq"); |
| 1794 | 1793 | |
| 1795 | − pDq = NULL; | |
| 1796 | 1794 | pCtx->pDqLayersList[i] = NULL; |
| 1797 | 1795 | |
| 1798 | 1796 | ++ i; |
| @@ -1880,7 +1878,7 @@ void CheckAvailNalUnitsListContinuity (PWelsDecoderContext pCtx, int32_t iStartI · 81 unmodified lines | ||
| 1880 | 1878 | uint8_t uiLastNuDependencyId, uiLastNuLayerDqId; |
| 1881 | 1879 | uint8_t uiCurNuDependencyId, uiCurNuQualityId, uiCurNuLayerDqId, uiCurNuRefLayerDqId; |
| 1882 | 1880 | |
| 1883 | − int32_t iCurNalUnitIdx = 0; | |
| 1881 | + int32_t iCurNalUnitIdx; | |
| 1884 | 1882 | |
| 1885 | 1883 | //check the continuity of pNalUnitsList forwards (from pIdxNoInterLayerPred to end_postion) |
| 1886 | 1884 | uiLastNuDependencyId = pCurAu->pNalUnitsList[iStartIdx]->sNalHeaderExt.uiDependencyId;//starting nal unit |
| @@ -2020,7 +2018,7 @@ bool CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) { · 133 unmodified lines | ||
| 2020 | 2018 | } else { //P_SLICE |
| 2021 | 2019 | //step 1: search uiDependencyId equal to pCtx->cur_seq_interval_target_dependency_id |
| 2022 | 2020 | bool bGetDependId = false; |
| 2023 | − int32_t iIdxDependId = 0; | |
| 2021 | + int32_t iIdxDependId; | |
| 2024 | 2022 | |
| 2025 | 2023 | iIdxDependId = kiEndPos; |
| 2026 | 2024 | while (iIdxDependId >= 0) { |
| @@ -2256,7 +2254,7 @@ void DecodeFinishUpdate (PWelsDecoderContext pCtx) { · 229 unmodified lines | ||
| 2256 | 2254 | * 0 - success; otherwise returned error_no defined in error_no.h |
| 2257 | 2255 | */ |
| 2258 | 2256 | int32_t WelsDecodeInitAccessUnitStart (PWelsDecoderContext pCtx, SBufferInfo* pDstInfo) { |
| 2259 | − int32_t iErr = ERR_NONE; | |
| 2257 | + int32_t iErr; | |
| 2260 | 2258 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 2261 | 2259 | pCtx->bAuReadyFlag = false; |
| 2262 | 2260 | pCtx->pLastDecPicInfo->bLastHasMmco5 = false; |
| @@ -2313,7 +2311,7 @@ int32_t AllocPicBuffOnNewSeqBegin (PWelsDecoderContext pCtx) { · 50 unmodified lines | ||
| 2313 | 2311 | * 0 - success; otherwise returned error_no defined in error_no.h |
| 2314 | 2312 | */ |
| 2315 | 2313 | int32_t InitConstructAccessUnit (PWelsDecoderContext pCtx, SBufferInfo* pDstInfo) { |
| 2316 | − int32_t iErr = ERR_NONE; | |
| 2314 | + int32_t iErr; | |
| 2317 | 2315 | |
| 2318 | 2316 | iErr = WelsDecodeInitAccessUnitStart (pCtx, pDstInfo); |
| 2319 | 2317 | if (ERR_NONE != iErr) { |
| @@ -2342,7 +2340,7 @@ int32_t InitConstructAccessUnit (PWelsDecoderContext pCtx, SBufferInfo* pDstInfo · 22 unmodified lines | ||
| 2342 | 2340 | * 0 - success; otherwise returned error_no defined in error_no.h |
| 2343 | 2341 | */ |
| 2344 | 2342 | int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { |
| 2345 | − int32_t iErr = ERR_NONE; | |
| 2343 | + int32_t iErr; | |
| 2346 | 2344 | if (GetThreadCount (pCtx) <= 1) { |
| 2347 | 2345 | iErr = InitConstructAccessUnit (pCtx, pDstInfo); |
| 2348 | 2346 | if (ERR_NONE != iErr) { |
| @@ -2425,7 +2423,8 @@ void WelsDqLayerDecodeStart (PWelsDecoderContext pCtx, PNalUnit pCurNal, PSps pS · 76 unmodified lines | ||
| 2425 | 2423 | } |
| 2426 | 2424 | |
| 2427 | 2425 | int32_t InitRefPicList (PWelsDecoderContext pCtx, const uint8_t kuiNRi, int32_t iPoc) { |
| 2428 | − int32_t iRet = ERR_NONE; | |
| 2426 | + USED(kuiNRi); | |
| 2427 | + int32_t iRet; | |
| 2429 | 2428 | if (pCtx->eSliceType == B_SLICE) { |
| 2430 | 2429 | iRet = WelsInitBSliceRefList (pCtx, iPoc); |
| 2431 | 2430 | CreateImplicitWeightTable (pCtx); |
| @@ -2480,8 +2479,9 @@ void InitCurDqLayerData (PWelsDecoderContext pCtx, PDqLayer pCurDq) { · 48 unmodified lines | ||
| 2480 | 2479 | * Decode current access unit when current AU is completed. |
| 2481 | 2480 | */ |
| 2482 | 2481 | int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) { |
| 2483 | − PNalUnit pNalCur = pCtx->pNalCur = NULL; | |
| 2482 | + PNalUnit pNalCur; | |
| 2484 | 2483 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 2484 | + pCtx->pNalCur = NULL; | |
| 2485 | 2485 | |
| 2486 | 2486 | int32_t iIdx = pCurAu->uiStartPos; |
| 2487 | 2487 | int32_t iEndIdx = pCurAu->uiEndPos; |
| @@ -2501,18 +2501,16 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 13 unmodified lines | ||
| 2501 | 2501 | } |
| 2502 | 2502 | } |
| 2503 | 2503 | int32_t iThreadCount = GetThreadCount (pCtx); |
| 2504 | − int32_t iPpsId = 0; | |
| 2505 | − int32_t iRet = ERR_NONE; | |
| 2506 | − | |
| 2504 | + int32_t iPpsId; | |
| 2505 | + int32_t iRet; | |
| 2507 | 2506 | bool bAllRefComplete = true; // Assume default all ref picutres are complete |
| 2508 | 2507 | |
| 2509 | 2508 | const uint8_t kuiTargetLayerDqId = GetTargetDqId (pCtx->uiTargetDqId, pCtx->pParam); |
| 2510 | 2509 | const uint8_t kuiDependencyIdMax = (kuiTargetLayerDqId & 0x7F) >> 4; |
| 2511 | 2510 | int16_t iLastIdD = -1, iLastIdQ = -1; |
| 2512 | − int16_t iCurrIdD = 0, iCurrIdQ = 0; | |
| 2511 | + int16_t iCurrIdD, iCurrIdQ; | |
| 2513 | 2512 | pCtx->uiNalRefIdc = 0; |
| 2514 | − bool bFreshSliceAvailable = | |
| 2515 | − true; // Another fresh slice comingup for given dq layer, for multiple slices in case of header parts of slices sometimes loss over error-prone channels, 8/14/2008 | |
| 2513 | + bool bFreshSliceAvailable; // Another fresh slice comingup for given dq layer, for multiple slices in case of header parts of slices sometimes loss over error-prone channels, 8/14/2008 | |
| 2516 | 2514 | |
| 2517 | 2515 | //update pCurDqLayer at the starting of AU decoding |
| 2518 | 2516 | if (pCtx->bInitialDqLayersMem || pCtx->pCurDqLayer == NULL) { |
| @@ -2525,7 +2523,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 6 unmodified lines | ||
| 2525 | 2523 | while (iIdx <= iEndIdx) { |
| 2526 | 2524 | PDqLayer dq_cur = pCtx->pCurDqLayer; |
| 2527 | 2525 | SLayerInfo pLayerInfo; |
| 2528 | − PSliceHeaderExt pShExt = NULL; | |
| 2526 | + PSliceHeaderExt pShExt; | |
| 2529 | 2527 | PSliceHeader pSh = NULL; |
| 2530 | 2528 | bool isNewFrame = true; |
| 2531 | 2529 | if (iThreadCount > 1) { |
| @@ -2723,6 +2721,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 191 unmodified lines | ||
| 2723 | 2721 | SET_EVENT (&pThreadCtx->sSliceDecodeStart); |
| 2724 | 2722 | } |
| 2725 | 2723 | iRet = WelsDecodeAndConstructSlice (pCtx); |
| 2724 | +fprint(2, "WelsDecodeAndConstructSlice %d\n", iRet); | |
| 2726 | 2725 | } else { |
| 2727 | 2726 | iRet = WelsDecodeSlice (pCtx, bFreshSliceAvailable, pNalCur); |
| 2728 | 2727 | } |
| @@ -2834,7 +2833,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 105 unmodified lines | ||
| 2834 | 2833 | ++i; |
| 2835 | 2834 | } |
| 2836 | 2835 | } |
| 2837 | − iRet = WelsMarkAsRef (pCtx); | |
| 2836 | + iRet = WelsMarkAsRef (pCtx, NULL); | |
| 2838 | 2837 | if (iRet != ERR_NONE) { |
| 2839 | 2838 | if (iRet == ERR_INFO_DUPLICATE_FRAME_NUM) |
| 2840 | 2839 | pCtx->iErrorCode |= dsBitstreamError; |
| @@ -2997,4 +2996,3 @@ bool CheckRefPicturesComplete (PWelsDecoderContext pCtx) { · 156 unmodified lines | ||
| 2997 | 2996 | |
| 2998 | 2997 | return bAllRefComplete; |
| 2999 | 2998 | } |
| 3000 | −} // namespace WelsDec | |