Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -155,11 +155,16 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 154 unmodified lines | ||
| 155 | 155 | pSpatialLayer->iSpatialBitrate); |
| 156 | 156 | return ENC_RETURN_INVALIDINPUT; |
| 157 | 157 | } |
| 158 | − if (pSpatialLayer->iMaxSpatialBitrate < pSpatialLayer->iSpatialBitrate * 1.1f) { | |
| 158 | + if (pSpatialLayer->iMaxSpatialBitrate == pSpatialLayer->iSpatialBitrate) { | |
| 159 | + WelsLog (pLogCtx, WELS_LOG_INFO, | |
| 160 | + "Setting MaxSpatialBitrate (%d) the same at SpatialBitrate (%d) will make the actual bit rate lower than SpatialBitrate", | |
| 161 | + pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate); | |
| 162 | + } | |
| 163 | + if (pSpatialLayer->iMaxSpatialBitrate < pSpatialLayer->iSpatialBitrate) { | |
| 159 | 164 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 160 | − "MaxSpatialBitrate (%d) should set be larger than 1.1 times of SpatialBitrate (%d)", | |
| 165 | + "MaxSpatialBitrate (%d) should be lower than SpatialBitrate (%d), considering it as invalid setting, adjust it to be UNSPECIFIED(0)", | |
| 161 | 166 | pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate); |
| 162 | −// pSpatialLayer->iSpatialBitrate = (int32_t) (pSpatialLayer->iMaxSpatialBitrate/1.1f); | |
| 167 | + pSpatialLayer->iMaxSpatialBitrate = 0; | |
| 163 | 168 | } |
| 164 | 169 | } |
| 165 | 170 | if (iTotalBitrate > pCfg->iTargetBitrate) { |