History

change FrameQP control and complexity calculation

Karina committed 10 years ago

Commit ffe11831 parent 44d85608 files · +4782 −4817Browse files

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

Unified · Split

codec/encoder/core/src/ratectl.cpp+154−189
@@ -163,7 +163,7 @@ void RcInitSequenceParameter (sWelsEncCtx* pEncCtx) { · 162 unmodified lines
163163
164164 pWelsSvcRc->iSkipFrameNum = 0;
165165 pWelsSvcRc->iGomSize = (pWelsSvcRc->iNumberMbFrame + pWelsSvcRc->iNumberMbGom - 1) / pWelsSvcRc->iNumberMbGom;
166−
166+ pWelsSvcRc->bEnableGomQp = true;
167167
168168 RcInitLayerMemory (pWelsSvcRc, pEncCtx->pMemAlign, 1 + pEncCtx->pSvcParam->sDependencyLayers[j].iHighestTemporalId);
169169
@@ -281,7 +281,7 @@ void RcInitRefreshParameter (sWelsEncCtx* pEncCtx) { · 111 unmodified lines
281281 //I frame R-Q Model
282282 pWelsSvcRc->iIntraComplexity = 0;
283283 pWelsSvcRc->iIntraMbCount = 0;
284−
284+ pWelsSvcRc->iIntraComplxMean = 0;
285285 //P frame R-Q Model
286286 for (i = 0; i <= kiHighestTid; i++) {
287287 pTOverRc[i].iPFrameNum = 0;
@@ -399,7 +399,6 @@ void RcInitIdrQp (sWelsEncCtx* pEncCtx) { · 111 unmodified lines
399399 pDLayerParam->iVideoHeight);
400400 else
401401 dBpp = 0.1;
402−
403402 //Area*2
404403 if (pDLayerParam->iVideoWidth * pDLayerParam->iVideoHeight <= 28800) // 90p video:160*90
405404 iBppIndex = 0;
@@ -420,6 +419,10 @@ void RcInitIdrQp (sWelsEncCtx* pEncCtx) { · 14 unmodified lines
420419 pEncCtx->iGlobalQp = pWelsSvcRc->iInitialQp;
421420 pWelsSvcRc->iQStep = RcConvertQp2QStep (pEncCtx->iGlobalQp);
422421 pWelsSvcRc->iLastCalculatedQScale = pEncCtx->iGlobalQp;
422+ pWelsSvcRc->iMinFrameQp = WELS_CLIP3 (pEncCtx->iGlobalQp - DELTA_QP_BGD_THD, pEncCtx->pSvcParam->iMinQp,
423+ pEncCtx->pSvcParam->iMaxQp);
424+ pWelsSvcRc->iMaxFrameQp = WELS_CLIP3 (pEncCtx->iGlobalQp + DELTA_QP_BGD_THD, pEncCtx->pSvcParam->iMinQp,
425+ pEncCtx->pSvcParam->iMaxQp);
423426 }
424427
425428 void RcCalculateIdrQp (sWelsEncCtx* pEncCtx) {
@@ -429,12 +432,21 @@ void RcCalculateIdrQp (sWelsEncCtx* pEncCtx) { · 3 unmodified lines
429432 pWelsSvcRc->iIntraComplexity = pWelsSvcRc->iIntraComplexity * pWelsSvcRc->iNumberMbFrame /
430433 pWelsSvcRc->iIntraMbCount;
431434 }
432− pWelsSvcRc->iInitialQp = RcConvertQStep2Qp (WELS_DIV_ROUND (pWelsSvcRc->iIntraComplexity,
433− pWelsSvcRc->iTargetBits));
435+
436+ int64_t iCmplxRatio = WELS_DIV_ROUND64 (pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity * INT_MULTIPLY,
437+ pWelsSvcRc->iIntraComplxMean);
438+ iCmplxRatio = WELS_CLIP3 (iCmplxRatio, INT_MULTIPLY - FRAME_CMPLX_RATIO_RANGE, INT_MULTIPLY + FRAME_CMPLX_RATIO_RANGE);
439+ pWelsSvcRc->iQStep = WELS_DIV_ROUND ((pWelsSvcRc->iIntraComplexity * iCmplxRatio),
440+ (pWelsSvcRc->iTargetBits * INT_MULTIPLY));
441+ pWelsSvcRc->iInitialQp = RcConvertQStep2Qp (pWelsSvcRc->iQStep);
434442 pWelsSvcRc->iInitialQp = WELS_CLIP3 (pWelsSvcRc->iInitialQp, pEncCtx->pSvcParam->iMinQp, pEncCtx->pSvcParam->iMaxQp);
435443 pEncCtx->iGlobalQp = pWelsSvcRc->iInitialQp;
436444 pWelsSvcRc->iQStep = RcConvertQp2QStep (pEncCtx->iGlobalQp);
437445 pWelsSvcRc->iLastCalculatedQScale = pEncCtx->iGlobalQp;
446+ pWelsSvcRc->iMinFrameQp = WELS_CLIP3 (pEncCtx->iGlobalQp - DELTA_QP_BGD_THD, pEncCtx->pSvcParam->iMinQp,
447+ pEncCtx->pSvcParam->iMaxQp);
448+ pWelsSvcRc->iMaxFrameQp = WELS_CLIP3 (pEncCtx->iGlobalQp + DELTA_QP_BGD_THD, pEncCtx->pSvcParam->iMinQp,
449+ pEncCtx->pSvcParam->iMaxQp);
438450 }
439451
440452
@@ -443,36 +455,22 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 2 unmodified lines
443455 int32_t iTl = pEncCtx->uiTemporalId;
444456 SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[iTl];
445457 int32_t iLumaQp = 0;
446−
458+ int32_t iDeltaQpTemporal = 0;
447459 if (0 == pTOverRc->iPFrameNum) {
448460 iLumaQp = pWelsSvcRc->iInitialQp;
449461 } else if (pWelsSvcRc->iCurrentBitsLevel == BITS_EXCEEDED) {
450− iLumaQp = MAX_LOW_BR_QP;
462+ iLumaQp = pWelsSvcRc->iLastCalculatedQScale + DELTA_QP_BGD_THD;
451463 //limit QP
452464 int32_t iLastIdxCodecInVGop = pWelsSvcRc->iFrameCodedInVGop - 1;
453465 if (iLastIdxCodecInVGop < 0)
454466 iLastIdxCodecInVGop += VGOP_SIZE;
455467 int32_t iTlLast = pWelsSvcRc->iTlOfFrames[iLastIdxCodecInVGop];
456− int32_t iDeltaQpTemporal = iTl - iTlLast;
468+ iDeltaQpTemporal = iTl - iTlLast;
457469 if (0 == iTlLast && iTl > 0)
458− iDeltaQpTemporal += 3;
470+ iDeltaQpTemporal += 1;
459471 else if (0 == iTl && iTlLast > 0)
460− iDeltaQpTemporal -= 3;
461−
462− iLumaQp = WELS_CLIP3 (iLumaQp,
463− pWelsSvcRc->iLastCalculatedQScale - pWelsSvcRc->iFrameDeltaQpLower + iDeltaQpTemporal,
464− pWelsSvcRc->iLastCalculatedQScale + pWelsSvcRc->iFrameDeltaQpUpper + iDeltaQpTemporal);
465− iLumaQp = WELS_CLIP3 (iLumaQp, pTOverRc->iMinQp, pTOverRc->iMaxQp);
466−
467− if (pEncCtx->pSvcParam->bEnableAdaptiveQuant) {
468− iLumaQp = WELS_CLIP3 ((iLumaQp * INT_MULTIPLY - pEncCtx->pVaa->sAdaptiveQuantParam.iAverMotionTextureIndexToDeltaQp) /
469− INT_MULTIPLY, pTOverRc->iMinQp, pTOverRc->iMaxQp);
470− }
471− pWelsSvcRc->iQStep = RcConvertQp2QStep (iLumaQp);
472− pWelsSvcRc->iLastCalculatedQScale = iLumaQp;
473− pEncCtx->iGlobalQp = iLumaQp;
472+ iDeltaQpTemporal -= 1;
474473
475− return;
476474 } else {
477475 int64_t iCmplxRatio = WELS_DIV_ROUND64 (pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity * INT_MULTIPLY,
478476 pTOverRc->iFrameCmplxMean);
@@ -480,7 +478,9 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 1 unmodified line
480478
481479 pWelsSvcRc->iQStep = WELS_DIV_ROUND ((pTOverRc->iLinearCmplx * iCmplxRatio), (pWelsSvcRc->iTargetBits * INT_MULTIPLY));
482480 iLumaQp = RcConvertQStep2Qp (pWelsSvcRc->iQStep);
483−
481+ WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
482+ "iCmplxRatio = %d,frameComplexity = %lld,iFrameCmplxMean = %d,iQStep = %d,iLumaQp = %d", (int)iCmplxRatio,
483+ pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity, pTOverRc->iFrameCmplxMean, pWelsSvcRc->iQStep, iLumaQp);
484484 //limit QP
485485 int32_t iLastIdxCodecInVGop = pWelsSvcRc->iFrameCodedInVGop - 1;
486486 if (iLastIdxCodecInVGop < 0)
@@ -488,21 +488,22 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 1 unmodified line
488488 int32_t iTlLast = pWelsSvcRc->iTlOfFrames[iLastIdxCodecInVGop];
489489 int32_t iDeltaQpTemporal = iTl - iTlLast;
490490 if (0 == iTlLast && iTl > 0)
491− iDeltaQpTemporal += 3;
491+ iDeltaQpTemporal += 1;
492492 else if (0 == iTl && iTlLast > 0)
493− iDeltaQpTemporal -= 3;
494−
495− iLumaQp = WELS_CLIP3 (iLumaQp,
496− pWelsSvcRc->iLastCalculatedQScale - pWelsSvcRc->iFrameDeltaQpLower + iDeltaQpTemporal,
497− pWelsSvcRc->iLastCalculatedQScale + pWelsSvcRc->iFrameDeltaQpUpper + iDeltaQpTemporal);
493+ iDeltaQpTemporal -= 1;
498494 }
495+ pWelsSvcRc->iMinFrameQp = WELS_CLIP3 (pWelsSvcRc->iLastCalculatedQScale - pWelsSvcRc->iFrameDeltaQpLower +
496+ iDeltaQpTemporal, pTOverRc->iMinQp, pTOverRc->iMaxQp) ;
497+ pWelsSvcRc->iMaxFrameQp = WELS_CLIP3 (pWelsSvcRc->iLastCalculatedQScale + pWelsSvcRc->iFrameDeltaQpUpper +
498+ iDeltaQpTemporal, pTOverRc->iMinQp, pTOverRc->iMaxQp);
499+
500+ iLumaQp = WELS_CLIP3 (iLumaQp, pWelsSvcRc->iMinFrameQp, pWelsSvcRc->iMaxFrameQp);
499501
500− iLumaQp = WELS_CLIP3 (iLumaQp, pTOverRc->iMinQp, pTOverRc->iMaxQp);
501502 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant) {
502503
503504 iLumaQp = WELS_DIV_ROUND (iLumaQp * INT_MULTIPLY - pEncCtx->pVaa->sAdaptiveQuantParam.iAverMotionTextureIndexToDeltaQp,
504505 INT_MULTIPLY);
505− iLumaQp = WELS_CLIP3 (iLumaQp, pTOverRc->iMinQp, pTOverRc->iMaxQp);
506+ iLumaQp = WELS_CLIP3 (iLumaQp, pWelsSvcRc->iMinFrameQp, pWelsSvcRc->iMaxFrameQp);
506507 }
507508 pWelsSvcRc->iQStep = RcConvertQp2QStep (iLumaQp);
508509 pWelsSvcRc->iLastCalculatedQScale = iLumaQp;
@@ -554,6 +555,57 @@ void RcDecideTargetBits (sWelsEncCtx* pEncCtx) { · 45 unmodified lines
554555 pWelsSvcRc->iRemainingWeights -= pTOverRc->iTlayerWeight;
555556 }
556557
558+void RcDecideTargetBitsTimestamp (sWelsEncCtx* pEncCtx) {
559+ //decide one frame bits allocated
560+ SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
561+ SSpatialLayerConfig* pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId];
562+ int32_t iTl = pEncCtx->uiTemporalId;
563+ SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[iTl];
564+
565+ pWelsSvcRc->iCurrentBitsLevel = BITS_NORMAL;
566+ if (pEncCtx->eSliceType == I_SLICE) {
567+ int32_t iBufferTh = static_cast<int32_t> (pWelsSvcRc->iBufferSizeSkip - pWelsSvcRc->iBufferFullnessSkip);
568+ if (iBufferTh <= 0) {
569+ pWelsSvcRc->iCurrentBitsLevel = BITS_EXCEEDED;
570+ pWelsSvcRc->iTargetBits = pTOverRc->iMinBitsTl;
571+ } else {
572+ int32_t iMaxTh = iBufferTh * 3 / 4;
573+ int32_t iMinTh = iBufferTh * 2 / pDLayerParam->fFrameRate;
574+ pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (
575+ pDLayerParam->fFrameRate) * IDR_BITRATE_RATIO));
576+ WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
577+ "iMaxTh = %d,iMinTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= %"
578+ PRId64 ,
579+ iMaxTh, iMinTh, pWelsSvcRc->iTargetBits, pWelsSvcRc->iBufferSizeSkip, pWelsSvcRc->iBufferFullnessSkip);
580+ pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, iMinTh, iMaxTh);
581+ }
582+
583+ } else {
584+ int32_t iBufferTh = static_cast<int32_t> (pWelsSvcRc->iBufferSizeSkip - pWelsSvcRc->iBufferFullnessSkip);
585+ if (iBufferTh <= 0) {
586+ pWelsSvcRc->iCurrentBitsLevel = BITS_EXCEEDED;
587+ pWelsSvcRc->iTargetBits = pTOverRc->iMinBitsTl;
588+ WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
589+ "iMaxTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= %" PRId64,
590+ iBufferTh, pWelsSvcRc->iTargetBits, pWelsSvcRc->iBufferSizeSkip, pWelsSvcRc->iBufferFullnessSkip);
591+ } else {
592+
593+ SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId];
594+ const int32_t kiGopSize = (1 << pDLayerParamInternal->iDecompositionStages);
595+ int32_t iAverageFrameSize = (int32_t) ((double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate));
596+ const int32_t kiGopBits = iAverageFrameSize * kiGopSize;
597+ pWelsSvcRc->iTargetBits = WELS_DIV_ROUND (pTOverRc->iTlayerWeight * kiGopBits, INT_MULTIPLY * 10 * 2);
598+
599+ int32_t iMaxTh = iBufferTh / 2;
600+ int32_t iMinTh = iBufferTh * 2 / pDLayerParam->fFrameRate;
601+ WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
602+ "iMaxTh = %d,iMinTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= % "
603+ PRId64,
604+ iMaxTh, iMinTh, pWelsSvcRc->iTargetBits, pWelsSvcRc->iBufferSizeSkip, pWelsSvcRc->iBufferFullnessSkip);
605+ pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, iMinTh, iMaxTh);
606+ }
607+ }
608+}
557609
558610 void RcInitGomParameters (sWelsEncCtx* pEncCtx) {
559611 SSlice* pSliceInLayer = pEncCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
@@ -563,8 +615,6 @@ void RcInitGomParameters (sWelsEncCtx* pEncCtx) { · 3 unmodified lines
563615 const int32_t kiGlobalQp = pEncCtx->iGlobalQp;
564616
565617 pWelsSvcRc->iAverageFrameQp = 0;
566− pWelsSvcRc->iMinFrameQp = 51;
567− pWelsSvcRc->iMaxFrameQp = 0;
568618 for (int32_t i = 0; i < kiSliceNum; ++i) {
569619 pSOverRc = &pSliceInLayer[i].sSlicingOverRc;
570620 pSOverRc->iComplexityIndexSlice = 0;
@@ -581,11 +631,11 @@ void RcCalculateMbQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, const int32_t kiSliceId · 10 unmodified lines
581631
582632 int32_t iLumaQp = pSOverRc->iCalculatedQpSlice;
583633 SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
584− SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[pEncCtx->uiTemporalId];
585634 const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset;
586635 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant) {
587636 iLumaQp = (int8_t)WELS_CLIP3 (iLumaQp +
588− pEncCtx->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp[pCurMb->iMbXY], pTOverRc->iMinQp, pTOverRc->iMaxQp);
637+ pEncCtx->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp[pCurMb->iMbXY], pWelsSvcRc->iMinFrameQp,
638+ pWelsSvcRc->iMaxFrameQp);
589639 }
590640 pCurMb->uiChromaQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (iLumaQp + kuiChromaQpIndexOffset)];
591641 pCurMb->uiLumaQp = iLumaQp;
@@ -637,15 +687,15 @@ void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) { · 45 unmodified lines
637687 } else {
638688 pWelsSvcRc_Base = RcJudgeBaseUsability (pEncCtx);
639689 pWelsSvcRc_Base = (pWelsSvcRc_Base) ? pWelsSvcRc_Base : pWelsSvcRc;
640− for (i = kiComplexityIndex; i <= iLastGomIndex; i++) {
690+ for (i = kiComplexityIndex + 1; i <= iLastGomIndex; i++) {
641691 iSumSad += pWelsSvcRc_Base->pCurrentFrameGomSad[i];
642692 }
693+
643694 if (0 == iSumSad)
644695 iAllocateBits = WELS_DIV_ROUND (iLeftBits, (iLastGomIndex - kiComplexityIndex));
645696 else
646697 iAllocateBits = WELS_DIV_ROUND ((int64_t)iLeftBits * pWelsSvcRc_Base->pCurrentFrameGomSad[kiComplexityIndex + 1],
647698 iSumSad);
648−
649699 }
650700 pSOverRc->iGomTargetBits = iAllocateBits;
651701 }
@@ -660,7 +710,6 @@ void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iSliceId) { · 8 unmodified lines
660710
661711 int64_t iLeftBits = pSOverRc->iTargetBitsSlice - pSOverRc->iFrameBitsSlice;
662712 int64_t iTargetLeftBits = iLeftBits + pSOverRc->iGomBitsSlice - pSOverRc->iGomTargetBits;
663−
664713 if ((iLeftBits <= 0) || (iTargetLeftBits <= 0)) {
665714 pSOverRc->iCalculatedQpSlice += 2;
666715 } else {
@@ -675,8 +724,9 @@ void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iSliceId) { · 8 unmodified lines
675724 else if (iBitsRatio > 11900) //2^(1.5/6)*10000
676725 pSOverRc->iCalculatedQpSlice -= 2;
677726 }
678− pSOverRc->iCalculatedQpSlice = WELS_CLIP3 (pSOverRc->iCalculatedQpSlice, pWelsSvcRc->iMinQp, pWelsSvcRc->iMaxQp);
679−
727+ pSOverRc->iCalculatedQpSlice = WELS_CLIP3 (pSOverRc->iCalculatedQpSlice, pWelsSvcRc->iMinFrameQp,
728+ pWelsSvcRc->iMaxFrameQp);
729+// WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,"iCalculatedQpSlice =%d,iBitsRatio = %d\n",pSOverRc->iCalculatedQpSlice,iBitsRatio);
680730 pSOverRc->iGomBitsSlice = 0;
681731
682732 }
@@ -707,6 +757,9 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 24 unmodified lines
707757 || (dIncPercent > pWelsSvcRc->iRcVaryPercentage)) {
708758 pWelsSvcRc->bSkipFlag = true;
709759 }
760+ WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
761+ "[Rc] VBV_Skip,dIncPercent = %f,iRcVaryPercentage = %d,pWelsSvcRc->bSkipFlag = %d", dIncPercent,
762+ pWelsSvcRc->iRcVaryPercentage, pWelsSvcRc->bSkipFlag);
710763 }
711764 void CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, const long long uiTimeStamp, int32_t iDidIdx) {
712765 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[iDidIdx];
@@ -769,7 +822,7 @@ void CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, const long long uiTimeStamp · 56 unmodified lines
769822 }
770823 }
771824
772−bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_t iSpatialNum,int32_t iCurDid) {
825+bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_t iSpatialNum, int32_t iCurDid) {
773826
774827 bool bSkipMustFlag = false;
775828
@@ -787,7 +840,7 @@ bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_ · 11 unmodified lines
787840 }
788841 //check max_br skip
789842 if (pEncCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr) {
790− if ((!bSkipMustFlag)&&(pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate != UNSPECIFIED_BIT_RATE)) {
843+ if ((!bSkipMustFlag) && (pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate != UNSPECIFIED_BIT_RATE)) {
791844 pEncCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr (pEncCtx, uiTimeStamp, iDidIdx);
792845 if (true == pEncCtx->pWelsSvcRc[iDidIdx].bSkipFlag) {
793846 bSkipMustFlag = true;
@@ -810,11 +863,11 @@ bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_ · 16 unmodified lines
810863 pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, uiTimeStamp, iDidIdx);
811864 }
812865 if (true == pEncCtx->pWelsSvcRc[iDidIdx].bSkipFlag) {
813− bSkipMustFlag = true;
866+ bSkipMustFlag = true;
814867 }
815868 //check max_br skip
816869 if (pEncCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr) {
817− if ((!bSkipMustFlag)&&(pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate != UNSPECIFIED_BIT_RATE)) {
870+ if ((!bSkipMustFlag) && (pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate != UNSPECIFIED_BIT_RATE)) {
818871 pEncCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr (pEncCtx, uiTimeStamp, iDidIdx);
819872 if (true == pEncCtx->pWelsSvcRc[iDidIdx].bSkipFlag) {
820873 bSkipMustFlag = true;
@@ -847,7 +900,7 @@ void UpdateBufferWhenFrameSkipped (sWelsEncCtx* pEncCtx, int32_t iCurDid) { · 26 unmodified lines
847900 pWelsSvcRc->iBufferMaxBRFullness[ODD_TIME_WINDOW] -= kiOutputMaxBits;
848901 WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
849902 "[Rc] iDid = %d,bits in buffer = %" PRId64 ", bits in Max bitrate buffer = %" PRId64,
850− iCurDid,pWelsSvcRc->iBufferFullnessSkip, pWelsSvcRc->iBufferMaxBRFullness[EVEN_TIME_WINDOW]);
903+ iCurDid, pWelsSvcRc->iBufferFullnessSkip, pWelsSvcRc->iBufferMaxBRFullness[EVEN_TIME_WINDOW]);
851904
852905 pWelsSvcRc->iBufferFullnessSkip = WELS_MAX (pWelsSvcRc->iBufferFullnessSkip, 0);
853906
@@ -859,7 +912,7 @@ void UpdateBufferWhenFrameSkipped (sWelsEncCtx* pEncCtx, int32_t iCurDid) { · 5 unmodified lines
859912 //output a warning when iContinualSkipFrames is large enough, which may indicate subjective quality problem
860913 //note that here iContinualSkipFrames must be >0, so the log output will be 3/6/....
861914 WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_WARNING, "[Rc] iDid = %d,iContinualSkipFrames(%d) is large",
862− iCurDid,pWelsSvcRc->iContinualSkipFrames);
915+ iCurDid, pWelsSvcRc->iContinualSkipFrames);
863916 }
864917 }
865918 void UpdateMaxBrCheckWindowStatus (sWelsEncCtx* pEncCtx, int32_t iSpatialNum, const long long uiTimeStamp) {
@@ -992,10 +1045,22 @@ void RcUpdateIntraComplexity (sWelsEncCtx* pEncCtx) { · 126 unmodified lines
9921045 if (iAlpha < (INT_MULTIPLY / 4)) iAlpha = INT_MULTIPLY / 4;
9931046 int32_t iQStep = RcConvertQp2QStep (pWelsSvcRc->iAverageFrameQp);
9941047 int64_t iIntraCmplx = iQStep * static_cast<int64_t> (pWelsSvcRc->iFrameDqBits);
995− pWelsSvcRc->iIntraComplexity = WELS_DIV_ROUND (((INT_MULTIPLY - iAlpha) * pWelsSvcRc->iIntraComplexity + iAlpha *
996− iIntraCmplx), INT_MULTIPLY);
997− pWelsSvcRc->iIntraMbCount = pWelsSvcRc->iNumberMbFrame;
1048+ if (pWelsSvcRc->iIdrNum == 0) {
1049+ pWelsSvcRc->iIntraComplexity = iIntraCmplx;
1050+ pWelsSvcRc->iIntraComplxMean = pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity;
1051+ } else {
1052+ pWelsSvcRc->iIntraComplexity = WELS_DIV_ROUND (((LINEAR_MODEL_DECAY_FACTOR) * pWelsSvcRc->iIntraComplexity +
1053+ (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) *
1054+ iIntraCmplx), INT_MULTIPLY);
9981055
1056+
1057+ pWelsSvcRc->iIntraComplxMean = WELS_DIV_ROUND64 (((LINEAR_MODEL_DECAY_FACTOR) * static_cast<int64_t>
1058+ (pWelsSvcRc->iIntraComplxMean)
1059+ + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * (pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity)),
1060+ INT_MULTIPLY);
1061+ }
1062+
1063+ pWelsSvcRc->iIntraMbCount = pWelsSvcRc->iNumberMbFrame;
9991064 pWelsSvcRc->iIdrNum++;
10001065 if (pWelsSvcRc->iIdrNum > 255)
10011066 pWelsSvcRc->iIdrNum = 255;
@@ -1011,20 +1076,21 @@ void RcUpdateFrameComplexity (sWelsEncCtx* pEncCtx) { · 9 unmodified lines
10111076 SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[kiTl];
10121077
10131078 int32_t iQStep = RcConvertQp2QStep (pWelsSvcRc->iAverageFrameQp);
1079+ int32_t iAlpha = WELS_DIV_ROUND (INT_MULTIPLY, (1 + pTOverRc->iPFrameNum));
1080+ if (iAlpha < SMOOTH_FACTOR_MIN_VALUE)
1081+ iAlpha = SMOOTH_FACTOR_MIN_VALUE;
10141082 if (0 == pTOverRc->iPFrameNum) {
10151083 pTOverRc->iLinearCmplx = ((int64_t)pWelsSvcRc->iFrameDqBits) * iQStep;
1084+ pTOverRc->iFrameCmplxMean = pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity;
10161085 } else {
1017− pTOverRc->iLinearCmplx = WELS_DIV_ROUND64 ((LINEAR_MODEL_DECAY_FACTOR * (int64_t)pTOverRc->iLinearCmplx
1086+ pTOverRc->iLinearCmplx = WELS_DIV_ROUND64 (((LINEAR_MODEL_DECAY_FACTOR) * (int64_t)pTOverRc->iLinearCmplx
10181087 + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * ((int64_t)pWelsSvcRc->iFrameDqBits * iQStep)),
10191088 INT_MULTIPLY);
1089+ pTOverRc->iFrameCmplxMean = WELS_DIV_ROUND (((LINEAR_MODEL_DECAY_FACTOR) * static_cast<int64_t>
1090+ (pTOverRc->iFrameCmplxMean)
1091+ + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity),
1092+ INT_MULTIPLY);
10201093 }
1021− int32_t iAlpha = WELS_DIV_ROUND (INT_MULTIPLY, (1 + pTOverRc->iPFrameNum));
1022− if (iAlpha < SMOOTH_FACTOR_MIN_VALUE)
1023− iAlpha = SMOOTH_FACTOR_MIN_VALUE;
1024− pTOverRc->iFrameCmplxMean = WELS_DIV_ROUND ((LINEAR_MODEL_DECAY_FACTOR * static_cast<int64_t>
1025− (pTOverRc->iFrameCmplxMean)
1026− + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity),
1027− INT_MULTIPLY);
10281094
10291095
10301096 pTOverRc->iPFrameNum++;
@@ -1066,7 +1132,19 @@ void WelsRcPictureInitGom (sWelsEncCtx* pEncCtx, long long uiTimeStamp) { · 35 unmodified lines
10661132 if (pEncCtx->uiTemporalId == 0) {
10671133 RcUpdateTemporalZero (pEncCtx);
10681134 }
1069− RcDecideTargetBits (pEncCtx);
1135+ if (pEncCtx->pSvcParam->iRCMode == RC_TIMESTAMP_MODE) {
1136+ RcDecideTargetBitsTimestamp (pEncCtx);
1137+ pWelsSvcRc->uiLastTimeStamp = uiTimeStamp;
1138+ } else {
1139+ RcDecideTargetBits (pEncCtx);
1140+ }
1141+ //turn off GOM QP when slicenum is larger 1
1142+ if ((pWelsSvcRc->iSliceNum > 1) || ((pEncCtx->pSvcParam->iRCMode == RC_BITRATE_MODE)
1143+ && (pEncCtx->eSliceType == I_SLICE))) {
1144+ pWelsSvcRc->bEnableGomQp = false;
1145+ } else
1146+ pWelsSvcRc->bEnableGomQp = true;
1147+
10701148 //decide globe_qp
10711149 if (pEncCtx->eSliceType == I_SLICE) {
10721150 if (0 == pWelsSvcRc->iIdrNum)
@@ -1079,7 +1157,6 @@ void WelsRcPictureInitGom (sWelsEncCtx* pEncCtx, long long uiTimeStamp) { · 6 unmodified lines
10791157 }
10801158 RcInitSliceInformation (pEncCtx);
10811159 RcInitGomParameters (pEncCtx);
1082−
10831160 }
10841161
10851162 void WelsRcPictureInfoUpdateGom (sWelsEncCtx* pEncCtx, int32_t iLayerSize) {
@@ -1114,21 +1191,22 @@ void WelsRcMbInitGom (sWelsEncCtx* pEncCtx, SMB* pCurMb, SSlice* pSlice) { · 28 unmodified lines
11141191 const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset;
11151192
11161193 pSOverRc->iBsPosSlice = pEncCtx->pFuncList->pfGetBsPosition (pSlice);
1117− if ((pEncCtx->pSvcParam->iRCMode == RC_BITRATE_MODE) && (pEncCtx->eSliceType == I_SLICE)) {
1194+ if (pWelsSvcRc->bEnableGomQp) {
1195+ //calculate gom qp and target bits at the beginning of gom
1196+ if (0 == (pCurMb->iMbXY % pWelsSvcRc->iNumberMbGom)) {
1197+ if (pCurMb->iMbXY != pSOverRc->iStartMbSlice) {
1198+ pSOverRc->iComplexityIndexSlice++;
1199+ RcCalculateGomQp (pEncCtx, pCurMb, kiSliceId);
1200+ }
1201+ RcGomTargetBits (pEncCtx, kiSliceId);
1202+ }
1203+
1204+ RcCalculateMbQp (pEncCtx, pCurMb, kiSliceId);
1205+ } else {
11181206 pCurMb->uiLumaQp = pEncCtx->iGlobalQp;
11191207 pCurMb->uiChromaQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (pCurMb->uiLumaQp + kuiChromaQpIndexOffset)];
1120− return;
1121− }
1122− //calculate gom qp and target bits at the beginning of gom
1123− if (0 == (pCurMb->iMbXY % pWelsSvcRc->iNumberMbGom)) {
1124− if (pCurMb->iMbXY != pSOverRc->iStartMbSlice) {
1125− pSOverRc->iComplexityIndexSlice++;
1126− RcCalculateGomQp (pEncCtx, pCurMb, kiSliceId);
1127− }
1128− RcGomTargetBits (pEncCtx, kiSliceId);
11291208 }
11301209
1131− RcCalculateMbQp (pEncCtx, pCurMb, kiSliceId);
11321210 }
11331211
11341212 void WelsRcMbInfoUpdateGom (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iCostLuma, SSlice* pSlice) {
@@ -1144,9 +1222,6 @@ void WelsRcMbInfoUpdateGom (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iCostLuma · 9 unmodified lines
11441222 pSOverRc->iGomBitsSlice += iCurMbBits;
11451223
11461224 pWelsSvcRc->pGomCost[kiComplexityIndex] += iCostLuma;
1147−
1148− pWelsSvcRc->iMinFrameQp = WELS_MIN (pWelsSvcRc->iMinFrameQp, pCurMb->uiLumaQp);
1149− pWelsSvcRc->iMaxFrameQp = WELS_MAX (pWelsSvcRc->iMaxFrameQp, pCurMb->uiLumaQp);
11501225 if (iCurMbBits > 0) {
11511226 pSOverRc->iTotalQpSlice += pCurMb->uiLumaQp;
11521227 pSOverRc->iTotalMbSlice++;
@@ -1326,7 +1401,8 @@ void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp · 173 unmodified lines
13261401 pWelsSvcRc->iBufferSizePadding = WELS_DIV_ROUND (pDLayerConfig->iSpatialBitrate * PADDING_BUFFER_RATIO, INT_MULTIPLY);
13271402
13281403 pWelsSvcRc->iBufferFullnessSkip -= iSentBits;
1329− pWelsSvcRc->iBufferFullnessSkip = WELS_MAX (0, pWelsSvcRc->iBufferFullnessSkip);
1404+ pWelsSvcRc->iBufferFullnessSkip = WELS_MAX ((-1) * (pDLayerConfig->iSpatialBitrate / 4),
1405+ pWelsSvcRc->iBufferFullnessSkip);
13301406
13311407 if (pEncCtx->pSvcParam->bEnableFrameSkip) {
13321408 pWelsSvcRc->bSkipFlag = true;
@@ -1340,121 +1416,10 @@ void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp · 7 unmodified lines
13401416 }
13411417 WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
13421418 "WelsRcFrameDelayJudgeTimeStamp iDidIdx = %d,iSkipFrameNum = %d,buffer = %" PRId64
1343− ",threadhold = %d,bitrate = %d,iSentBits = %d,lasttimestamp = %lld,timestamp=%lld\n", iDidIdx,
1419+ ",threadhold = %d,bitrate = %d,iSentBits = %d,lasttimestamp = %lld,timestamp=%lld", iDidIdx,
13441420 pWelsSvcRc->iSkipFrameNum, pWelsSvcRc->iBufferFullnessSkip, pWelsSvcRc->iBufferSizeSkip, iBitRate, iSentBits,
13451421 pWelsSvcRc->uiLastTimeStamp, uiTimeStamp);
13461422 }
1347−void WelsRcPictureInitGomTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp) {
1348− SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
1349− SSpatialLayerConfig* pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId];
1350− int32_t iLumaQp = pWelsSvcRc->iLastCalculatedQScale;
1351− int32_t iTl = pEncCtx->uiTemporalId;
1352− SRCTemporal* pTOverRc = &pWelsSvcRc->pTemporalOverRc[iTl];
1353− if (pEncCtx->eSliceType == I_SLICE) {
1354− if (0 == pWelsSvcRc->iIdrNum) { //iIdrNum == 0 means encoder has been initialed
1355− RcInitRefreshParameter (pEncCtx);
1356− }
1357− }
1358− if (RcJudgeBitrateFpsUpdate (pEncCtx)) {
1359− RcUpdateBitrateFps (pEncCtx);
1360− }
1361− if (pEncCtx->uiTemporalId == 0) {
1362− RcUpdateTemporalZero (pEncCtx);
1363− }
1364− //decide one frame bits allocated
1365− if (pEncCtx->eSliceType == I_SLICE) {
1366− if (0 == pWelsSvcRc->iIdrNum) { //iIdrNum == 0 means encoder has been initialed
1367− RcInitIdrQp (pEncCtx);
1368− iLumaQp = pWelsSvcRc->iInitialQp;
1369− pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (
1370− pDLayerParam->fFrameRate) *
1371− IDR_BITRATE_RATIO));
1372−
1373− WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
1374− "[Rc] First IDR iSpatialBitrate = %d,iBufferFullnessSkip = %" PRId64 ",iTargetBits= %d,initQp = %d",
1375− pDLayerParam->iSpatialBitrate, pWelsSvcRc->iBufferFullnessSkip, pWelsSvcRc->iTargetBits,
1376− pWelsSvcRc->iInitialQp);
1377−
1378− } else {
1379− int32_t iMaxTh = static_cast<int32_t> (pWelsSvcRc->iBufferSizeSkip - pWelsSvcRc->iBufferFullnessSkip);
1380− int32_t iMinTh = iMaxTh / 2;
1381− pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (
1382− pDLayerParam->fFrameRate) *
1383− IDR_BITRATE_RATIO));
1384− if (iMaxTh > 0) {
1385− pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, iMinTh, iMaxTh);
1386−
1387− pWelsSvcRc->iQStep = WELS_DIV_ROUND (pWelsSvcRc->iIntraComplexity, pWelsSvcRc->iTargetBits);
1388− iLumaQp = RcConvertQStep2Qp (pWelsSvcRc->iQStep);
1389−
1390− iLumaQp = WELS_CLIP3 (iLumaQp, pWelsSvcRc->iLastCalculatedQScale - DELTA_QP_BGD_THD,
1391− pWelsSvcRc->iLastCalculatedQScale + DELTA_QP_BGD_THD);
1392−
1393− } else {
1394− iLumaQp = pEncCtx->iGlobalQp + DELTA_QP_BGD_THD;
1395− }
1396− iLumaQp = WELS_CLIP3 (iLumaQp, pTOverRc->iMinQp, pTOverRc->iMaxQp);
1397− WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
1398− "[Rc]I iLumaQp = %d,iQStep = %d,iTargetBits = %d,iBufferFullnessSkip =%" PRId64
1399− ",iMaxTh=%d,iMinTh = %d,iFrameComplexity= %" PRId64,
1400− iLumaQp, pWelsSvcRc->iQStep, pWelsSvcRc->iTargetBits, pWelsSvcRc->iBufferFullnessSkip, iMaxTh, iMinTh,
1401− pWelsSvcRc->iIntraComplexity);
1402−
1403− }
1404−
1405− } else {
1406− int32_t iMaxTh = static_cast<int32_t> (pWelsSvcRc->iBufferSizeSkip - pWelsSvcRc->iBufferFullnessSkip);
1407− int32_t iMinTh = iMaxTh / (iTl + 2);
1408−
1409− SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId];
1410− const int32_t kiGopSize = (1 << pDLayerParamInternal->iDecompositionStages);
1411− int32_t iAverageFrameSize = (int32_t) ((double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate));
1412− const int32_t kiGopBits = iAverageFrameSize * kiGopSize;
1413− int64_t iCmplxRatio = WELS_DIV_ROUND64 (pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity * INT_MULTIPLY,
1414− pTOverRc->iFrameCmplxMean);
1415− iCmplxRatio = WELS_CLIP3 (iCmplxRatio, INT_MULTIPLY - FRAME_CMPLX_RATIO_RANGE, INT_MULTIPLY + FRAME_CMPLX_RATIO_RANGE);
1416−
1417− pWelsSvcRc->iTargetBits = WELS_DIV_ROUND (pTOverRc->iTlayerWeight * kiGopBits, INT_MULTIPLY * 10 * 2);
1418− if (iMaxTh > 0) {
1419− pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, iMinTh, iMaxTh);
1420− if (0 == pTOverRc->iPFrameNum)
1421− iLumaQp = pWelsSvcRc->iInitialQp + DELTA_QP_BGD_THD;
1422− else {
1423−
1424− pWelsSvcRc->iQStep = WELS_DIV_ROUND ((pTOverRc->iLinearCmplx * iCmplxRatio), (pWelsSvcRc->iTargetBits * INT_MULTIPLY));
1425− iLumaQp = RcConvertQStep2Qp (pWelsSvcRc->iQStep);
1426− iLumaQp = WELS_CLIP3 (iLumaQp, pWelsSvcRc->iLastCalculatedQScale - DELTA_QP_BGD_THD,
1427− pWelsSvcRc->iLastCalculatedQScale + DELTA_QP_BGD_THD);
1428− }
1429− } else {
1430− iLumaQp = pEncCtx->iGlobalQp + DELTA_QP_BGD_THD;
1431− }
1432−
1433− iLumaQp = WELS_CLIP3 (iLumaQp, pTOverRc->iMinQp, pTOverRc->iMaxQp);
1434−
1435− WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
1436− "[Rc]P iTl = %d,iLumaQp = %d,iQStep = %d,iTargetBits = %d,iBufferFullnessSkip =%" PRId64
1437− ",iMaxTh=%d,iMinTh = %d,iFrameComplexity= %lld,iCmplxRatio=%" PRId64,
1438− iTl, iLumaQp, pWelsSvcRc->iQStep, pWelsSvcRc->iTargetBits, pWelsSvcRc->iBufferFullnessSkip, iMaxTh, iMinTh,
1439− pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity, iCmplxRatio);
1440− }
1441−
1442− pWelsSvcRc->iQStep = RcConvertQp2QStep (iLumaQp);
1443− pWelsSvcRc->iLastCalculatedQScale = iLumaQp;
1444− pEncCtx->iGlobalQp = iLumaQp;
1445−
1446− RcInitSliceInformation (pEncCtx);
1447− RcInitGomParameters (pEncCtx);
1448− float fInstantFps = (uiTimeStamp - pWelsSvcRc->uiLastTimeStamp) > 0 ? (1000.0f / (uiTimeStamp -
1449− pWelsSvcRc->uiLastTimeStamp)) : 0;
1450− WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
1451− "[Rc]Tid = %d,Did = %d,pEncCtx->iGlobalQp= %d,iLumaQp = %d,uiTimeStamp = %lld,uiLastTimeStamp = %lld,InstantFps = %f,settingFps = %f",
1452− pEncCtx->uiTemporalId, pEncCtx->uiDependencyId,
1453− pEncCtx->iGlobalQp, iLumaQp, uiTimeStamp, pWelsSvcRc->uiLastTimeStamp,
1454− fInstantFps, pDLayerParam->fFrameRate);
1455− pWelsSvcRc->uiLastTimeStamp = uiTimeStamp;
1456−
1457−}
14581423
14591424 void WelsRcPictureInfoUpdateGomTimeStamp (sWelsEncCtx* pEncCtx, int32_t iLayerSize) {
14601425 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
@@ -1531,7 +1496,7 @@ void WelsRcInitFuncPointers (sWelsEncCtx* pEncCtx, RC_MODES iRcMode) { · 70 unmodified lines
15311496 pRcf->pfWelsRcMbInfoUpdate = WelsRcMbInfoUpdateDisable;
15321497
15331498 } else {
1534− pRcf->pfWelsRcPictureInit = WelsRcPictureInitGomTimeStamp;
1499+ pRcf->pfWelsRcPictureInit = WelsRcPictureInitGom;
15351500 pRcf->pfWelsRcPictureInfoUpdate = WelsRcPictureInfoUpdateGomTimeStamp;
15361501 pRcf->pfWelsRcMbInit = WelsRcMbInitGom;
15371502 pRcf->pfWelsRcMbInfoUpdate = WelsRcMbInfoUpdateGom;

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