Merge pull request #2419 from ruil2/bitrate_update

fix bitrate update issue
This commit is contained in:
sijchen 2016-03-18 16:07:59 -07:00
commit 38313b913d
2 changed files with 12 additions and 2 deletions

View File

@ -4718,7 +4718,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
pOldDlpInternal->fInputFrameRate = pNewDlpInternal->fInputFrameRate; // input frame rate
pOldDlpInternal->fOutputFrameRate = pNewDlpInternal->fOutputFrameRate; // output frame rate
pOldDlp->iSpatialBitrate = pNewDlp->iSpatialBitrate;
pOldDlp->iMaxSpatialBitrate = pNewDlp->iMaxSpatialBitrate;
pOldDlp->uiProfileIdc =
pNewDlp->uiProfileIdc; // value of profile IDC (0 for auto-detection)
pOldDlp->iDLayerQp = pNewDlp->iDLayerQp;

View File

@ -1331,10 +1331,20 @@ void WelsRcPictureInitGomTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp
int32_t iLumaQp = pWelsSvcRc->iLastCalculatedQScale;
int32_t iTl = pEncCtx->uiTemporalId;
SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[iTl];
//decide one frame bits allocated
if (pEncCtx->eSliceType == I_SLICE) {
if (0 == pWelsSvcRc->iIdrNum) { //iIdrNum == 0 means encoder has been initialed
RcInitRefreshParameter (pEncCtx);
}
}
if (RcJudgeBitrateFpsUpdate (pEncCtx)) {
RcUpdateBitrateFps (pEncCtx);
}
if (pEncCtx->uiTemporalId == 0) {
RcUpdateTemporalZero (pEncCtx);
}
//decide one frame bits allocated
if (pEncCtx->eSliceType == I_SLICE) {
if (0 == pWelsSvcRc->iIdrNum) { //iIdrNum == 0 means encoder has been initialed
RcInitIdrQp (pEncCtx);
iLumaQp = pWelsSvcRc->iInitialQp;
pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (