Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -833,11 +833,11 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 832 unmodified lines | ||
| 833 | 833 | WELS_READ_VERIFY (BsGetBits (pBs, 8, &uiCode)); // level_idc |
| 834 | 834 | uiLevelIdc = uiCode; |
| 835 | 835 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id |
| 836 | − iSpsId = uiCode; | |
| 837 | − if (iSpsId >= MAX_SPS_COUNT || iSpsId < 0) { // Modified to check invalid negative iSpsId, 12/1/2009 | |
| 836 | + if (uiCode >= MAX_SPS_COUNT) { // Modified to check invalid negative iSpsId, 12/1/2009 | |
| 838 | 837 | WelsLog (pCtx, WELS_LOG_WARNING, " iSpsId is out of range! \n"); |
| 839 | 838 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW); |
| 840 | 839 | } |
| 840 | + iSpsId = uiCode; | |
| 841 | 841 | |
| 842 | 842 | if (kbUseSubsetFlag) { |
| 843 | 843 | #ifdef MOSAIC_AVOID_BASED_ON_SPS_PPS_ID |
| @@ -891,18 +891,19 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 47 unmodified lines | ||
| 891 | 891 | } |
| 892 | 892 | pSps->uiChromaArrayType = pSps->uiChromaFormatIdc; |
| 893 | 893 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8 |
| 894 | − pSps->uiBitDepthLuma = 8 + uiCode; | |
| 895 | − if (pSps->uiBitDepthLuma != 8) { | |
| 896 | − WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", pSps->uiBitDepthLuma); | |
| 894 | + if (uiCode != 0) { | |
| 895 | + WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode); | |
| 897 | 896 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 898 | 897 | } |
| 898 | + pSps->uiBitDepthLuma = 8 + uiCode; | |
| 899 | 899 | |
| 900 | 900 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8 |
| 901 | − pSps->uiBitDepthChroma = 8 + uiCode; | |
| 902 | − if (pSps->uiBitDepthChroma != 8) { | |
| 903 | − WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", pSps->uiBitDepthChroma); | |
| 901 | + if (uiCode != 0) { | |
| 902 | + WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode); | |
| 904 | 903 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 905 | 904 | } |
| 905 | + pSps->uiBitDepthChroma = 8 + uiCode; | |
| 906 | + | |
| 906 | 907 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //qpprime_y_zero_transform_bypass_flag |
| 907 | 908 | pSps->bQpPrimeYZeroTransfBypassFlag = !!uiCode; |
| 908 | 909 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag |
| @@ -956,19 +957,11 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 47 unmodified lines | ||
| 956 | 957 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //gaps_in_frame_num_value_allowed_flag |
| 957 | 958 | pSps->bGapsInFrameNumValueAllowedFlag = !!uiCode; |
| 958 | 959 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1 |
| 959 | − if (uiCode == 0xffffffff) { | |
| 960 | − WelsLog (pCtx, WELS_LOG_ERROR, " pic_width_in_mbs read error!\n"); | |
| 961 | − return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO); | |
| 962 | − } | |
| 963 | 960 | pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode; |
| 964 | 961 | if ((uint64_t) (pSps->iMbWidth * pSps->iMbWidth) > (8 * pSLevelLimits->iMaxFS)) { |
| 965 | 962 | WelsLog (pCtx, WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n"); |
| 966 | 963 | } |
| 967 | 964 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 |
| 968 | − if (uiCode == 0xffffffff) { | |
| 969 | − WelsLog (pCtx, WELS_LOG_ERROR, " pic_height_in_mbs read error!\n"); | |
| 970 | − return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO); | |
| 971 | − } | |
| 972 | 965 | pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode; |
| 973 | 966 | if ((uint64_t) (pSps->iMbHeight * pSps->iMbHeight) > (8 * pSLevelLimits->iMaxFS)) { |
| 974 | 967 | WelsLog (pCtx, WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n"); |