[UT] fix a random failure of UT
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 3 files). Show all
Unified · Split
| @@ -491,7 +491,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 490 unmodified lines | ||
| 491 | 491 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 492 | 492 | iMaxSliceNum = MAX_SLICES_NUM; |
| 493 | 493 | if (iMbHeight > iMaxSliceNum) { |
| 494 | − WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX!", iMbHeight); | |
| 494 | + WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX(%d)!", iMbHeight, MAX_SLICES_NUM); | |
| 495 | 495 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 496 | 496 | } |
| 497 | 497 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight; |
| @@ -527,7 +527,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 29 unmodified lines | ||
| 527 | 527 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize - |
| 528 | 528 | NAL_HEADER_ADD_0X30BYTES)) { |
| 529 | 529 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 530 | − "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d!", | |
| 530 | + "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d, will take uiMaxNalsize!", | |
| 531 | 531 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize); |
| 532 | 532 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES; |
| 533 | 533 | } |
| @@ -4121,9 +4121,13 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 3587 unmodified lines | ||
| 4121 | 4121 | return iReturn; |
| 4122 | 4122 | } |
| 4123 | 4123 | |
| 4124 | − | |
| 4125 | 4124 | pOldParam = (*ppCtx)->pSvcParam; |
| 4126 | 4125 | |
| 4126 | + if (pOldParam->iUsageType != pNewParam->iUsageType) { | |
| 4127 | + WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_ERROR, "WelsEncoderParamAdjust(), does not expect in-middle change of iUsgaeType from %d to %d", pOldParam->iUsageType, pNewParam->iUsageType); | |
| 4128 | + return ENC_RETURN_UNSUPPORTED_PARA; | |
| 4129 | + } | |
| 4130 | + | |
| 4127 | 4131 | /* Decide whether need reset for IDR frame based on adjusting prarameters changed */ |
| 4128 | 4132 | /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */ |
| 4129 | 4133 | bNeedReset = (pOldParam == NULL) || |