Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -91,6 +91,19 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 90 unmodified lines | ||
| 91 | 91 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | + if (pCfg->iSpatialLayerNum > 1) { | |
| 95 | + int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth; | |
| 96 | + int32_t iFinalHeight = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth; | |
| 97 | + for (i = 0; i < (pCfg->iSpatialLayerNum - 1); i++) { | |
| 98 | + SSpatialLayerConfig* fDlp = &pCfg->sSpatialLayers[i]; | |
| 99 | + if ((fDlp->iVideoWidth > iFinalWidth) || (fDlp->iVideoHeight > iFinalHeight)) { | |
| 100 | + WelsLog (pLogCtx, WELS_LOG_ERROR, | |
| 101 | + "ParamValidation,Invalid resolution layer(%d) resolution(%d x %d) shoudl be less than the highest spatial layer resolution(%d x %d)\n ", | |
| 102 | + i, fDlp->iVideoWidth, fDlp->iVideoHeight, iFinalWidth, iFinalHeight); | |
| 103 | + return ENC_RETURN_UNSUPPORTED_PARA; | |
| 104 | + } | |
| 105 | + } | |
| 106 | + } | |
| 94 | 107 | for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { |
| 95 | 108 | SSpatialLayerInternal* fDlp = &pCfg->sDependencyLayers[i]; |
| 96 | 109 | if (fDlp->fOutputFrameRate > fDlp->fInputFrameRate || (fDlp->fInputFrameRate >= -fEpsn |