Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 3 files). Show all
Unified · Split
| @@ -533,6 +533,20 @@ int32_t WelsEncoderApplyBitRate (SLogContext* pLogCtx, SWelsSvcCodingParam* pPar · 532 unmodified lines | |||
| 533 | } | 533 | } |
| 534 | return ENC_RETURN_SUCCESS; | 534 | return ENC_RETURN_SUCCESS; |
| 535 | } | 535 | } |
| 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 | |||
| 536 | /*! | 550 | /*! |
| 537 | * \brief acquire count number of layers and NALs based on configurable paramters dependency | 551 | * \brief acquire count number of layers and NALs based on configurable paramters dependency |
| 538 | * \pParam pCtx sWelsEncCtx* | 552 | * \pParam pCtx sWelsEncCtx* |