History

fix bitrate setting and add bitrate validation

ruil2 committed 12 years ago

Commit eb357b51 parent dae4dbf2 files · +15 −2Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+13−0
@@ -112,6 +112,19 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 111 unmodified lines
112112 pCfg->fMaxFrameRate = fMaxFrameRate;
113113 }
114114
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+
115128 return ENC_RETURN_SUCCESS;
116129 }
117130

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t