Showing the changes to codec/decoder (2 of 2 files). Show all
Unified · Split
| @@ -48,7 +48,7 @@ · 47 unmodified lines | |||
| 48 | namespace WelsDec { | 48 | namespace WelsDec { |
| 49 | 49 | ||
| 50 | #ifndef MB_XY_T | 50 | #ifndef MB_XY_T |
| 51 | #define MB_XY_T int16_t | 51 | #define MB_XY_T int32_t |
| 52 | #endif//MB_XY_T | 52 | #endif//MB_XY_T |
| 53 | 53 | ||
| 54 | /*! | 54 | /*! |
| @@ -1057,9 +1057,11 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1056 unmodified lines | |||
| 1057 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1057 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1058 | } | 1058 | } |
| 1059 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { | 1059 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1060 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_width_in_mbs exceeds the level limits!"); | ||
| 1061 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { | 1060 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { |
| 1061 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "the pic_width_in_mbs exceeds the level limits!"); | ||
| 1062 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1062 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1063 | } else { | ||
| 1064 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "the pic_width_in_mbs exceeds the level limits!"); | ||
| 1063 | } | 1065 | } |
| 1064 | } | 1066 | } |
| 1065 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 | 1067 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 |
| @@ -1069,16 +1071,23 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 3 unmodified lines | |||
| 1069 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1071 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1070 | } | 1072 | } |
| 1071 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { | 1073 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1072 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_height_in_mbs exceeds the level limits!"); | ||
| 1073 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { | 1074 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { |
| 1075 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "the pic_height_in_mbs exceeds the level limits!"); | ||
| 1074 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1076 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1077 | } else { | ||
| 1078 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "the pic_height_in_mbs exceeds the level limits!"); | ||
| 1075 | } | 1079 | } |
| 1076 | } | 1080 | } |
| 1077 | uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight; | 1081 | uint64_t uiTmp64 = (uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbHeight; |
| 1078 | if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) { | 1082 | if (uiTmp64 > (uint64_t)pSLevelLimits->uiMaxFS) { |
| 1079 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!"); | 1083 | if (uiTmp64 > (uint64_t)pSMaxLevelLimits->uiMaxFS) { |
| 1084 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "the total count of mb exceeds the level limits!"); | ||
| 1085 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | ||
| 1086 | } else { | ||
| 1087 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "the total count of mb exceeds the level limits!"); | ||
| 1088 | } | ||
| 1080 | } | 1089 | } |
| 1081 | pSps->uiTotalMbCount = uiTmp32; | 1090 | pSps->uiTotalMbCount = (uint32_t)uiTmp64; |
| 1082 | WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames", | 1091 | WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames", |
| 1083 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES)); | 1092 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES)); |
| 1084 | // here we check max_num_ref_frames | 1093 | // here we check max_num_ref_frames |