Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -759,6 +759,7 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 758 unmodified lines | ||
| 759 | 759 | |
| 760 | 760 | int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight) { |
| 761 | 761 | PBitStringAux pBs = pBsAux; |
| 762 | + SSubsetSps sTempSubsetSps; | |
| 762 | 763 | PSps pSps = NULL; |
| 763 | 764 | PSubsetSps pSubsetSps = NULL; |
| 764 | 765 | SNalUnitHeader* pNalHead = &pCtx->sCurNalHead; |
| @@ -770,12 +771,6 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 5 unmodified lines | ||
| 770 | 771 | bool bConstraintSetFlags[6] = { false }; |
| 771 | 772 | const bool kbUseSubsetFlag = IS_SUBSET_SPS_NAL (pNalHead->eNalUnitType); |
| 772 | 773 | |
| 773 | − if (kbUseSubsetFlag) { // SubsetSps | |
| 774 | − pCtx->bSubspsExistAheadFlag = true; | |
| 775 | − } else { // Sps | |
| 776 | − pCtx->bSpsExistAheadFlag = true; | |
| 777 | − } | |
| 778 | − | |
| 779 | 774 | WELS_READ_VERIFY (BsGetBits (pBs, 8, &uiCode)); //profile_idc |
| 780 | 775 | uiProfileIdc = uiCode; |
| 781 | 776 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set0_flag |
| @@ -801,13 +796,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 19 unmodified lines | ||
| 801 | 796 | iSpsId = uiCode; |
| 802 | 797 | |
| 803 | 798 | if (kbUseSubsetFlag) { |
| 804 | − pSubsetSps = &pCtx->sSubsetSpsBuffer[iSpsId]; | |
| 805 | − pSps = &pSubsetSps->sSps; | |
| 806 | 799 | pCtx->bSubspsAvailFlags[iSpsId] = false; |
| 807 | 800 | } else { |
| 808 | − pSps = &pCtx->sSpsBuffer[iSpsId]; | |
| 809 | 801 | pCtx->bSpsAvailFlags[iSpsId] = false; |
| 810 | 802 | } |
| 803 | + pSubsetSps = &sTempSubsetSps; | |
| 804 | + pSps = &sTempSubsetSps.sSps; | |
| 805 | + memset (pSubsetSps, 0, sizeof(SSubsetSps)); | |
| 811 | 806 | const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]); |
| 812 | 807 | if (NULL == pSLevelLimits) { |
| 813 | 808 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc); |
| @@ -986,9 +981,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 172 unmodified lines | ||
| 986 | 981 | *pPicWidth = pSps->iMbWidth << 4; |
| 987 | 982 | *pPicHeight = pSps->iMbHeight << 4; |
| 988 | 983 | if (kbUseSubsetFlag) { |
| 984 | + memcpy (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof(SSubsetSps)); | |
| 989 | 985 | pCtx->bSubspsAvailFlags[iSpsId] = true; |
| 986 | + pCtx->bSubspsExistAheadFlag = true; | |
| 990 | 987 | } else { |
| 988 | + memcpy (&pCtx->sSpsBuffer[iSpsId], pSps, sizeof(SSps)); | |
| 991 | 989 | pCtx->bSpsAvailFlags[iSpsId] = true; |
| 990 | + pCtx->bSpsExistAheadFlag = true; | |
| 992 | 991 | } |
| 993 | 992 | return 0; |
| 994 | 993 | } |
| @@ -1010,6 +1009,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 15 unmodified lines | ||
| 1010 | 1009 | int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) { |
| 1011 | 1010 | |
| 1012 | 1011 | PPps pPps = NULL; |
| 1012 | + SPps sTempPps; | |
| 1013 | 1013 | uint32_t uiPpsId = 0; |
| 1014 | 1014 | uint32_t iTmp; |
| 1015 | 1015 | uint32_t uiCode; |
| @@ -1022,7 +1022,8 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 6 unmodified lines | ||
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | pCtx->bPpsAvailFlags[uiPpsId] = false; |
| 1025 | − pPps = &pPpsList[uiPpsId]; | |
| 1025 | + pPps = &sTempPps; | |
| 1026 | + memset (pPps, 0, sizeof(SPps)); | |
| 1026 | 1027 | |
| 1027 | 1028 | pPps->iPpsId = uiPpsId; |
| 1028 | 1029 | WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //seq_parameter_set_id |
| @@ -1104,6 +1105,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 75 unmodified lines | ||
| 1104 | 1105 | WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag |
| 1105 | 1106 | pPps->bRedundantPicCntPresentFlag = !!uiCode; |
| 1106 | 1107 | |
| 1108 | + memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof(SPps)); | |
| 1107 | 1109 | pCtx->bPpsAvailFlags[uiPpsId] = true; |
| 1108 | 1110 | |
| 1109 | 1111 | return ERR_NONE; |