History

Merge pull request #1536 from sijchen/improve_br_valid

[Encoder] adjust the param validation of max bit rate

ruil2 committed 12 years ago

Commit c13bfe62 parents 0252f3f 7e24efc1 file · +8 −3Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+8−3
@@ -155,11 +155,16 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 154 unmodified lines
155155 pSpatialLayer->iSpatialBitrate);
156156 return ENC_RETURN_INVALIDINPUT;
157157 }
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) {
159164 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)",
161166 pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate);
162−// pSpatialLayer->iSpatialBitrate = (int32_t) (pSpatialLayer->iMaxSpatialBitrate/1.1f);
167+ pSpatialLayer->iMaxSpatialBitrate = 0;
163168 }
164169 }
165170 if (iTotalBitrate > pCfg->iTargetBitrate) {

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