Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 3 files). Show all
Unified · Split
| @@ -478,7 +478,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 477 unmodified lines | |||
| 478 | iMbHeight = (kiPicHeight + 15) >> 4; | 478 | iMbHeight = (kiPicHeight + 15) >> 4; |
| 479 | iMaxSliceNum = MAX_SLICES_NUM; | 479 | iMaxSliceNum = MAX_SLICES_NUM; |
| 480 | if (iMbHeight > iMaxSliceNum) { | 480 | if (iMbHeight > iMaxSliceNum) { |
| 481 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX!", iMbHeight); | 481 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX(%d)!", iMbHeight, MAX_SLICES_NUM); |
| 482 | return ENC_RETURN_UNSUPPORTED_PARA; | 482 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 483 | } | 483 | } |
| 484 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight; | 484 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight; |
| @@ -514,7 +514,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 29 unmodified lines | |||
| 514 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize - | 514 | if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize - |
| 515 | NAL_HEADER_ADD_0X30BYTES)) { | 515 | NAL_HEADER_ADD_0X30BYTES)) { |
| 516 | WelsLog (pLogCtx, WELS_LOG_WARNING, | 516 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 517 | "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d!", | 517 | "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d, will take uiMaxNalsize!", |
| 518 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize); | 518 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize); |
| 519 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES; | 519 | pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES; |
| 520 | } | 520 | } |
| @@ -4108,9 +4108,13 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 3587 unmodified lines | |||
| 4108 | return iReturn; | 4108 | return iReturn; |
| 4109 | } | 4109 | } |
| 4110 | 4110 | ||
| 4111 | |||
| 4112 | pOldParam = (*ppCtx)->pSvcParam; | 4111 | pOldParam = (*ppCtx)->pSvcParam; |
| 4113 | 4112 | ||
| 4113 | if (pOldParam->iUsageType != pNewParam->iUsageType) { | ||
| 4114 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_ERROR, "WelsEncoderParamAdjust(), does not expect in-middle change of iUsgaeType from %d to %d", pOldParam->iUsageType, pNewParam->iUsageType); | ||
| 4115 | return ENC_RETURN_UNSUPPORTED_PARA; | ||
| 4116 | } | ||
| 4117 | |||
| 4114 | /* Decide whether need reset for IDR frame based on adjusting prarameters changed */ | 4118 | /* Decide whether need reset for IDR frame based on adjusting prarameters changed */ |
| 4115 | /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */ | 4119 | /* Temporal levels, spatial settings and/ or quality settings changed need update parameter sets related. */ |
| 4116 | bNeedReset = (pOldParam == NULL) || | 4120 | bNeedReset = (pOldParam == NULL) || |