History

update maxbitrate to control bitrate vary range

ruil2 committed 11 years ago

Commit 5ba9e401 parent 065c3a73 files · +17 −1Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+14−0
@@ -533,6 +533,20 @@ int32_t WelsEncoderApplyBitRate (SLogContext* pLogCtx, SWelsSvcCodingParam* pPar · 532 unmodified lines
533533 }
534534 return ENC_RETURN_SUCCESS;
535535 }
536+int32_t WelsEncoderApplyBitVaryRang(SLogContext* pLogCtx, SWelsSvcCodingParam* pParam, int32_t iRang){
537+ SSpatialLayerConfig* pLayerParam;
538+ const int32_t iNumLayers = pParam->iSpatialLayerNum;
539+ for (int32_t i = 0; i < iNumLayers; i++) {
540+ pLayerParam = & (pParam->sSpatialLayers[i]);
541+ pLayerParam->iMaxSpatialBitrate = WELS_MIN(pLayerParam->iSpatialBitrate * (1+ iRang/100.0),pLayerParam->iMaxSpatialBitrate);
542+ if (WelsBitRateVerification (pLogCtx, pLayerParam, i) != ENC_RETURN_SUCCESS)
543+ return ENC_RETURN_UNSUPPORTED_PARA;
544+ WelsLog (pLogCtx, WELS_LOG_INFO,
545+ "WelsEncoderApplyBitVaryRang:UpdateMaxBitrate layerId= %d,iMaxSpatialBitrate = %d", i, pLayerParam->iMaxSpatialBitrate);
546+ }
547+ return ENC_RETURN_SUCCESS;
548+}
549+
536550 /*!
537551 * \brief acquire count number of layers and NALs based on configurable paramters dependency
538552 * \pParam pCtx sWelsEncCtx*

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