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