History

improve the para checking of max-br

Sijia Chen committed 11 years ago

Commit ee40ba61 parent 8bef6bc1 file · +9 −8Browse 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+9−8
@@ -76,11 +76,6 @@ int32_t WelsBitRateVerification (SLogContext* pLogCtx, SSpatialLayerConfig* pLay · 75 unmodified lines
76 pLayerParam->iSpatialBitrate);76 pLayerParam->iSpatialBitrate);
77 return ENC_RETURN_UNSUPPORTED_PARA;77 return ENC_RETURN_UNSUPPORTED_PARA;
78 }78 }
79 if (pLayerParam->iMaxSpatialBitrate == pLayerParam->iSpatialBitrate) {
80 WelsLog (pLogCtx, WELS_LOG_INFO,
81 "Setting MaxSpatialBitrate (%d) the same at SpatialBitrate (%d) will make the actual bit rate lower than SpatialBitrate",
82 pLayerParam->iMaxSpatialBitrate, pLayerParam->iSpatialBitrate);
83 }
84 int32_t iLevelMaxBitrate = g_ksLevelLimits[pLayerParam->uiLevelIdc - 1].uiMaxBR * CpbBrNalFactor;79 int32_t iLevelMaxBitrate = g_ksLevelLimits[pLayerParam->uiLevelIdc - 1].uiMaxBR * CpbBrNalFactor;
85 if (pLayerParam->iMaxSpatialBitrate == UNSPECIFIED_BIT_RATE) {80 if (pLayerParam->iMaxSpatialBitrate == UNSPECIFIED_BIT_RATE) {
86 pLayerParam->iMaxSpatialBitrate = iLevelMaxBitrate;81 pLayerParam->iMaxSpatialBitrate = iLevelMaxBitrate;
@@ -90,15 +85,21 @@ int32_t WelsBitRateVerification (SLogContext* pLogCtx, SSpatialLayerConfig* pLay · 3 unmodified lines
90 if (pLayerParam->iMaxSpatialBitrate > iLevelMaxBitrate) {85 if (pLayerParam->iMaxSpatialBitrate > iLevelMaxBitrate) {
91 ELevelIdc iCurLevel = pLayerParam->uiLevelIdc;86 ELevelIdc iCurLevel = pLayerParam->uiLevelIdc;
92 if (WelsAdjustLevel (pLayerParam)) {87 if (WelsAdjustLevel (pLayerParam)) {
88 int32_t iLevel52MaxBitrate = g_ksLevelLimits[LEVEL_NUMBER - 1].uiMaxBR * CpbBrNalFactor;
93 WelsLog (pLogCtx, WELS_LOG_WARNING,89 WelsLog (pLogCtx, WELS_LOG_WARNING,
94 "MaxSpatialBitrate (%d) is larger that the limitation LEVEL_5_2, the setting will be invalid",90 "MaxSpatialBitrate (%d) is larger that the limitation LEVEL_5_2, the setting will be invalid, and will use max-br (%d) of LEVEL_5_2",
95 pLayerParam->iMaxSpatialBitrate);91 pLayerParam->iMaxSpatialBitrate, iLevel52MaxBitrate);
92 pLayerParam->iMaxSpatialBitrate = iLevel52MaxBitrate;
96 }93 }
97 WelsLog (pLogCtx, WELS_LOG_INFO,94 WelsLog (pLogCtx, WELS_LOG_INFO,
98 "Level is changed from (%d) to (%d) according to the maxbitrate",95 "Level is changed from (%d) to (%d) according to the maxbitrate",
99 iCurLevel, pLayerParam->uiLevelIdc);96 iCurLevel, pLayerParam->uiLevelIdc);
100 }97 }
101 if (pLayerParam->iMaxSpatialBitrate < pLayerParam->iSpatialBitrate) {98 if (pLayerParam->iMaxSpatialBitrate == pLayerParam->iSpatialBitrate) {
99 WelsLog (pLogCtx, WELS_LOG_INFO,
100 "Setting MaxSpatialBitrate (%d) the same at SpatialBitrate (%d) will make the actual bit rate lower than SpatialBitrate",
101 pLayerParam->iMaxSpatialBitrate, pLayerParam->iSpatialBitrate);
102 } else if (pLayerParam->iMaxSpatialBitrate < pLayerParam->iSpatialBitrate) {
102 WelsLog (pLogCtx, WELS_LOG_ERROR,103 WelsLog (pLogCtx, WELS_LOG_ERROR,
103 "MaxSpatialBitrate (%d) should be larger than SpatialBitrate (%d), considering it as error setting",104 "MaxSpatialBitrate (%d) should be larger than SpatialBitrate (%d), considering it as error setting",
104 pLayerParam->iMaxSpatialBitrate, pLayerParam->iSpatialBitrate);105 pLayerParam->iMaxSpatialBitrate, pLayerParam->iSpatialBitrate);

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