Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all
Unified · Split
| @@ -112,6 +112,19 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 111 unmodified lines | |||
| 112 | pCfg->fMaxFrameRate = fMaxFrameRate; | 112 | pCfg->fMaxFrameRate = fMaxFrameRate; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | //bitrate setting validation | ||
| 116 | if (pCfg->iRCMode != RC_OFF_MODE){ | ||
| 117 | int32_t iTotalBitrate = 0; | ||
| 118 | for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { | ||
| 119 | SDLayerParam* fDlp = &pCfg->sDependencyLayers[i]; | ||
| 120 | iTotalBitrate += fDlp->iSpatialBitrate; | ||
| 121 | } | ||
| 122 | if(iTotalBitrate > pCfg->iTargetBitrate){ | ||
| 123 | WelsLog(NULL, WELS_LOG_ERROR,"Invalid setttings in bitrate. the sum of each layer bitrate(%) is larger than total bitrate setting(%d)\n", | ||
| 124 | iTotalBitrate,pCfg->iTargetBitrate); | ||
| 125 | } | ||
| 126 | } | ||
| 127 | |||
| 115 | return ENC_RETURN_SUCCESS; | 128 | return ENC_RETURN_SUCCESS; |
| 116 | } | 129 | } |
| 117 | 130 | ||