History

using WelsRound for all the double-int32_t conversion

Sijia Chen committed 12 years ago

Commit 74130321 parent cc8102010 files · +67 −65Browse files

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

Unified · Split

codec/encoder/core/src/ratectl.cpp+48−47
@@ -127,10 +127,10 @@ void RcInitSequenceParameter (sWelsEncCtx* pEncCtx) { · 126 unmodified lines
127127
128128 pWelsSvcRc->dSkipBufferRatio = SKIP_RATIO;
129129
130− pWelsSvcRc->iQpRangeUpperInFrame = QP_RANGE_UPPER_MODE1 - (int32_t) ((QP_RANGE_UPPER_MODE1 - QP_RANGE_MODE0) *
131− pWelsSvcRc->dRcVaryRatio + 0.5);
132− pWelsSvcRc->iQpRangeLowerInFrame = QP_RANGE_LOWER_MODE1 - (int32_t) ((QP_RANGE_LOWER_MODE1 - QP_RANGE_MODE0) *
133− pWelsSvcRc->dRcVaryRatio + 0.5);
130+ pWelsSvcRc->iQpRangeUpperInFrame = QP_RANGE_UPPER_MODE1 - WELS_ROUND ((QP_RANGE_UPPER_MODE1 - QP_RANGE_MODE0) *
131+ pWelsSvcRc->dRcVaryRatio);
132+ pWelsSvcRc->iQpRangeLowerInFrame = QP_RANGE_LOWER_MODE1 - WELS_ROUND ((QP_RANGE_LOWER_MODE1 - QP_RANGE_MODE0) *
133+ pWelsSvcRc->dRcVaryRatio);
134134
135135 if (iMbWidth <= MB_WIDTH_THRESHOLD_90P) {
136136 pWelsSvcRc->iSkipQpValue = SKIP_QP_90P;
@@ -149,17 +149,17 @@ void RcInitSequenceParameter (sWelsEncCtx* pEncCtx) { · 12 unmodified lines
149149 iGomRowMode0 = GOM_ROW_MODE0_720P;
150150 iGomRowMode1 = GOM_ROW_MODE1_720P;
151151 }
152− iGomRowMode0 = iGomRowMode1 + (int32_t) ((iGomRowMode0 - iGomRowMode1) * pWelsSvcRc->dRcVaryRatio + 0.5);
152+ iGomRowMode0 = iGomRowMode1 + WELS_ROUND ((iGomRowMode0 - iGomRowMode1) * pWelsSvcRc->dRcVaryRatio);
153153
154154 pWelsSvcRc->iNumberMbGom = iMbWidth * iGomRowMode0;
155155
156156 pWelsSvcRc->iMinQp = GOM_MIN_QP_MODE;
157157 pWelsSvcRc->iMaxQp = GOM_MAX_QP_MODE;
158158
159− pWelsSvcRc->iFrameDeltaQpUpper = LAST_FRAME_QP_RANGE_UPPER_MODE1 - (int32_t) ((LAST_FRAME_QP_RANGE_UPPER_MODE1 -
160− LAST_FRAME_QP_RANGE_UPPER_MODE0) * pWelsSvcRc->dRcVaryRatio + 0.5);
161− pWelsSvcRc->iFrameDeltaQpLower = LAST_FRAME_QP_RANGE_LOWER_MODE1 - (int32_t) ((LAST_FRAME_QP_RANGE_LOWER_MODE1 -
162− LAST_FRAME_QP_RANGE_LOWER_MODE0) * pWelsSvcRc->dRcVaryRatio + 0.5);
159+ pWelsSvcRc->iFrameDeltaQpUpper = LAST_FRAME_QP_RANGE_UPPER_MODE1 - WELS_ROUND ((LAST_FRAME_QP_RANGE_UPPER_MODE1 -
160+ LAST_FRAME_QP_RANGE_UPPER_MODE0) * pWelsSvcRc->dRcVaryRatio);
161+ pWelsSvcRc->iFrameDeltaQpLower = LAST_FRAME_QP_RANGE_LOWER_MODE1 - WELS_ROUND ((LAST_FRAME_QP_RANGE_LOWER_MODE1 -
162+ LAST_FRAME_QP_RANGE_LOWER_MODE0) * pWelsSvcRc->dRcVaryRatio);
163163
164164 pWelsSvcRc->iSkipFrameNum = 0;
165165 pWelsSvcRc->iGomSize = (pWelsSvcRc->iNumberMbFrame + pWelsSvcRc->iNumberMbGom - 1) / pWelsSvcRc->iNumberMbGom;
@@ -213,7 +213,7 @@ void RcUpdateBitrateFps (sWelsEncCtx* pEncCtx) { · 47 unmodified lines
213213 const int32_t kiGopSize = (1 << pDLayerParam->iDecompositionStages);
214214 const int32_t kiHighestTid = pDLayerParam->iHighestTemporalId;
215215 double input_dBitsPerFrame = pDLayerParam->iSpatialBitrate / pDLayerParam->fInputFrameRate;
216− const int32_t kiGopBits = (int32_t) (input_dBitsPerFrame * kiGopSize);
216+ const int32_t kiGopBits = WELS_ROUND (input_dBitsPerFrame * kiGopSize);
217217 int32_t i;
218218
219219 pWelsSvcRc->iBitRate = pDLayerParam->iSpatialBitrate;
@@ -225,16 +225,16 @@ void RcUpdateBitrateFps (sWelsEncCtx* pEncCtx) { · 5 unmodified lines
225225
226226 for (i = 0; i <= kiHighestTid; i++) {
227227 const double kdConstraitBits = kiGopBits * pTOverRc[i].dTlayerWeight;
228− pTOverRc[i].iMinBitsTl = (int32_t) (kdConstraitBits * dMinBitsRatio);
229− pTOverRc[i].iMaxBitsTl = (int32_t) (kdConstraitBits * dMaxBitsRatio);
228+ pTOverRc[i].iMinBitsTl = WELS_ROUND (kdConstraitBits * dMinBitsRatio);
229+ pTOverRc[i].iMaxBitsTl = WELS_ROUND (kdConstraitBits * dMaxBitsRatio);
230230 }
231231 //When bitrate is changed, pBuffer size should be updated
232− pWelsSvcRc->iBufferSizeSkip = (int32_t) (pWelsSvcRc->iBitRate * pWelsSvcRc->dSkipBufferRatio);
233− pWelsSvcRc->iBufferSizePadding = (int32_t) (pWelsSvcRc->iBitRate * PADDING_BUFFER_RATIO);
232+ pWelsSvcRc->iBufferSizeSkip = WELS_ROUND (pWelsSvcRc->iBitRate * pWelsSvcRc->dSkipBufferRatio);
233+ pWelsSvcRc->iBufferSizePadding = WELS_ROUND (pWelsSvcRc->iBitRate * PADDING_BUFFER_RATIO);
234234
235235 //change remaining bits
236236 if (pWelsSvcRc->dBitsPerFrame > 0.1)
237− pWelsSvcRc->iRemainingBits = (int32_t) (pWelsSvcRc->iRemainingBits * input_dBitsPerFrame / pWelsSvcRc->dBitsPerFrame);
237+ pWelsSvcRc->iRemainingBits = WELS_ROUND (pWelsSvcRc->iRemainingBits * input_dBitsPerFrame / pWelsSvcRc->dBitsPerFrame);
238238 pWelsSvcRc->dBitsPerFrame = input_dBitsPerFrame;
239239 }
240240
@@ -245,7 +245,7 @@ void RcInitVGop (sWelsEncCtx* pEncCtx) { · 4 unmodified lines
245245 SRCTemporal* pTOverRc = pWelsSvcRc->pTemporalOverRc;
246246 const int32_t kiHighestTid = pEncCtx->pSvcParam->sDependencyLayers[kiDid].iHighestTemporalId;
247247
248− pWelsSvcRc->iRemainingBits = (int32_t) (VGOP_SIZE * pWelsSvcRc->dBitsPerFrame);
248+ pWelsSvcRc->iRemainingBits = WELS_ROUND (VGOP_SIZE * pWelsSvcRc->dBitsPerFrame);
249249 pWelsSvcRc->dRemainingWeights = pWelsSvcRc->iGopNumberInVGop;
250250
251251 pWelsSvcRc->iFrameCodedInVGop = 0;
@@ -325,9 +325,9 @@ void RcTraceVGopBitrate (sWelsEncCtx* pEncCtx) { · 73 unmodified lines
325325 }
326326 int32_t iFrameInVGop = pWelsSvcRc->iFrameCodedInVGop + pWelsSvcRc->iSkipFrameInVGop;
327327 if (0 != iFrameInVGop)
328− iVGopBitrate = (int32_t) (iTotalBits / iFrameInVGop * pWelsSvcRc->fFrameRate);
328+ iVGopBitrate = WELS_ROUND (iTotalBits / iFrameInVGop * pWelsSvcRc->fFrameRate);
329329 #ifdef _TEST_TEMP_Rc_
330− fprintf (fp_vgop, "%d\n", (int32_t) ((double)iTotalBits / iFrameInVGop));
330+ fprintf (fp_vgop, "%d\n", WELS_ROUND ((double)iTotalBits / iFrameInVGop));
331331 #endif
332332 WelsLog (pEncCtx, WELS_LOG_INFO, "[Rc] VGOPbitrate%d: %d \n", kiDid, iVGopBitrate);
333333 if (iTotalBits > 0) {
@@ -400,7 +400,7 @@ void RcInitIdrQp (sWelsEncCtx* pEncCtx) { · 66 unmodified lines
400400 break;
401401 }
402402 pWelsSvcRc->iInitialQp = dInitialQPArray[iBppIndex][i];
403− pWelsSvcRc->iInitialQp = (int32_t)WELS_CLIP3 (pWelsSvcRc->iInitialQp, MIN_IDR_QP, MAX_IDR_QP);
403+ pWelsSvcRc->iInitialQp = WELS_CLIP3 (pWelsSvcRc->iInitialQp, MIN_IDR_QP, MAX_IDR_QP);
404404 pEncCtx->iGlobalQp = pWelsSvcRc->iInitialQp;
405405 pWelsSvcRc->dQStep = RcConvertQp2QStep (pEncCtx->iGlobalQp);
406406 pWelsSvcRc->iLastCalculatedQScale = pEncCtx->iGlobalQp;
@@ -410,11 +410,12 @@ void RcCalculateIdrQp (sWelsEncCtx* pEncCtx) { · 3 unmodified lines
410410 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
411411 //obtain the idr qp using previous idr complexity
412412 if (pWelsSvcRc->iNumberMbFrame != pWelsSvcRc->iIntraMbCount) {
413− pWelsSvcRc->iIntraComplexity = (int32_t) ((double)pWelsSvcRc->iIntraComplexity * pWelsSvcRc->iNumberMbFrame /
414− pWelsSvcRc->iIntraMbCount + 0.5);
413+ pWelsSvcRc->iIntraComplexity = WELS_ROUND ((double)pWelsSvcRc->iIntraComplexity * pWelsSvcRc->iNumberMbFrame /
414+ pWelsSvcRc->iIntraMbCount);
415415 }
416− pWelsSvcRc->iInitialQp = (int32_t)RcConvertQStep2Qp ((double)pWelsSvcRc->iIntraComplexity / pWelsSvcRc->iTargetBits);
417− pWelsSvcRc->iInitialQp = (int32_t)WELS_CLIP3 (pWelsSvcRc->iInitialQp, MIN_IDR_QP, MAX_IDR_QP);
416+ pWelsSvcRc->iInitialQp = WELS_ROUND (RcConvertQStep2Qp ((double)pWelsSvcRc->iIntraComplexity /
417+ pWelsSvcRc->iTargetBits));
418+ pWelsSvcRc->iInitialQp = WELS_CLIP3 (pWelsSvcRc->iInitialQp, MIN_IDR_QP, MAX_IDR_QP);
418419 pEncCtx->iGlobalQp = pWelsSvcRc->iInitialQp;
419420 pWelsSvcRc->dQStep = RcConvertQp2QStep (pEncCtx->iGlobalQp);
420421 pWelsSvcRc->iLastCalculatedQScale = pEncCtx->iGlobalQp;
@@ -451,7 +452,7 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 30 unmodified lines
451452 pWelsSvcRc->iLastCalculatedQScale = iLumaQp;
452453
453454 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant) {
454− iLumaQp = (int32_t) (iLumaQp - pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp);
455+ iLumaQp = WELS_ROUND (iLumaQp - pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp);
455456 }
456457
457458 pEncCtx->iGlobalQp = iLumaQp;
@@ -462,7 +463,7 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 4 unmodified lines
462463 dCmplxRatio = WELS_CLIP3 (dCmplxRatio, 1.0 - FRAME_CMPLX_RATIO_RANGE, 1.0 + FRAME_CMPLX_RATIO_RANGE);
463464
464465 pWelsSvcRc->dQStep = pTOverRc->dLinearCmplx * dCmplxRatio / pWelsSvcRc->iTargetBits;
465− iLumaQp = (int32_t) (RcConvertQStep2Qp (pWelsSvcRc->dQStep) + 0.5);
466+ iLumaQp = WELS_ROUND (RcConvertQStep2Qp (pWelsSvcRc->dQStep));
466467
467468 //limit QP
468469 int32_t iLastIdxCodecInVGop = pWelsSvcRc->iFrameCodedInVGop - 1;
@@ -487,10 +488,10 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) { · 18 unmodified lines
487488 #ifndef _NOT_USE_AQ_FOR_TEST_
488489 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant) {
489490
490− iLumaQp = (int32_t) (iLumaQp - pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp);
491+ iLumaQp = WELS_ROUND (iLumaQp - pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp);
491492
492493 if (pEncCtx->pSvcParam->iRCMode != RC_LOW_BW_MODE)
493− iLumaQp = (int32_t)WELS_CLIP3 (iLumaQp, pWelsSvcRc->iMinQp, pWelsSvcRc->iMaxQp);
494+ iLumaQp = WELS_CLIP3 (iLumaQp, pWelsSvcRc->iMinQp, pWelsSvcRc->iMaxQp);
494495
495496 }
496497 #endif
@@ -510,7 +511,7 @@ void RcInitSliceInformation (sWelsEncCtx* pEncCtx) { · 13 unmodified lines
510511 pSOverRc->iEndMbSlice += (pCurSliceCtx->pCountMbNumInSlice[i] - 1);
511512 pSOverRc->iTotalQpSlice = 0;
512513 pSOverRc->iTotalMbSlice = 0;
513− pSOverRc->iTargetBitsSlice = (int32_t) (kdBitsPerMb * pCurSliceCtx->pCountMbNumInSlice[i]);
514+ pSOverRc->iTargetBitsSlice = WELS_ROUND (kdBitsPerMb * pCurSliceCtx->pCountMbNumInSlice[i]);
514515 pSOverRc->iFrameBitsSlice = 0;
515516 pSOverRc->iGomBitsSlice = 0;
516517 ++ pSOverRc;
@@ -524,10 +525,10 @@ void RcDecideTargetBits (sWelsEncCtx* pEncCtx) { · 7 unmodified lines
524525 pWelsSvcRc->iCurrentBitsLevel = BITS_NORMAL;
525526 //allocate bits
526527 if (pEncCtx->eSliceType == I_SLICE) {
527− pWelsSvcRc->iTargetBits = (int32_t) (pWelsSvcRc->dBitsPerFrame * IDR_BITRATE_RATIO);
528+ pWelsSvcRc->iTargetBits = WELS_ROUND (pWelsSvcRc->dBitsPerFrame * IDR_BITRATE_RATIO);
528529 } else {
529− pWelsSvcRc->iTargetBits = (int32_t) (pWelsSvcRc->iRemainingBits * pTOverRc->dTlayerWeight /
530− pWelsSvcRc->dRemainingWeights);
530+ pWelsSvcRc->iTargetBits = WELS_ROUND (pWelsSvcRc->iRemainingBits * pTOverRc->dTlayerWeight /
531+ pWelsSvcRc->dRemainingWeights);
531532 if ((pWelsSvcRc->iTargetBits <= 0) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE)) {
532533 pWelsSvcRc->iCurrentBitsLevel = BITS_EXCEEDED;
533534 } else if ((pWelsSvcRc->iTargetBits <= pTOverRc->iMinBitsTl) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE)) {
@@ -625,7 +626,7 @@ void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) { · 91 unmodified lines
625626 dAllocateBits = (double)iLeftBits * pWelsSvcRc_Base->pCurrentFrameGomSad[kiComplexityIndex + 1] / iSumSad;
626627
627628 }
628− pSOverRc->iGomTargetBits = int32_t (dAllocateBits + 0.5);
629+ pSOverRc->iGomTargetBits = WELS_ROUND (dAllocateBits);
629630 }
630631
631632
@@ -665,11 +666,11 @@ void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iSliceId) { · 33 unmodified lines
665666 void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) {
666667 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
667668 SRCTemporal* pTOverRc = pWelsSvcRc->pTemporalOverRc;
668− const int32_t kiOutputBits = (int32_t) (pWelsSvcRc->dBitsPerFrame + 0.5);
669+ const int32_t kiOutputBits = WELS_ROUND (pWelsSvcRc->dBitsPerFrame);
669670 //condition 1: whole pBuffer fullness
670671 pWelsSvcRc->iBufferFullnessSkip += (pWelsSvcRc->iFrameDqBits - kiOutputBits);
671672 //condition 2: VGOP bits constraint
672− const int32_t kiVGopBits = (int32_t) (pWelsSvcRc->dBitsPerFrame * VGOP_SIZE);
673+ const int32_t kiVGopBits = WELS_ROUND (pWelsSvcRc->dBitsPerFrame * VGOP_SIZE);
673674 int32_t iVGopBitsPred = 0;
674675 for (int32_t i = pWelsSvcRc->iFrameCodedInVGop + 1; i < VGOP_SIZE; i++)
675676 iVGopBitsPred += pTOverRc[pWelsSvcRc->iTlOfFrames[i]].iMinBitsTl;
@@ -690,7 +691,7 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 14 unmodified lines
690691 pWelsSvcRc->iBufferFullnessSkip = 0;
691692
692693 if (pEncCtx->iSkipFrameFlag == 1) {
693− pWelsSvcRc->iRemainingBits += (int32_t) (pWelsSvcRc->dBitsPerFrame + 0.5);
694+ pWelsSvcRc->iRemainingBits += WELS_ROUND (pWelsSvcRc->dBitsPerFrame);
694695 pWelsSvcRc->iSkipFrameNum++;
695696 pWelsSvcRc->iSkipFrameInVGop++;
696697 }
@@ -698,8 +699,8 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 1 unmodified line
698699
699700 void RcVBufferCalculationPadding (sWelsEncCtx* pEncCtx) {
700701 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
701− const int32_t kiOutputBits = (int32_t) (pWelsSvcRc->dBitsPerFrame + 0.5);
702− const int32_t kiBufferThreshold = (int32_t) (PADDING_THRESHOLD * (-pWelsSvcRc->iBufferSizePadding));
702+ const int32_t kiOutputBits = WELS_ROUND (pWelsSvcRc->dBitsPerFrame);
703+ const int32_t kiBufferThreshold = WELS_ROUND (PADDING_THRESHOLD * (-pWelsSvcRc->iBufferSizePadding));
703704
704705 pWelsSvcRc->iBufferFullnessPadding += (pWelsSvcRc->iFrameDqBits - kiOutputBits);
705706
@@ -736,7 +737,7 @@ void RcUpdatePictureQpBits (sWelsEncCtx* pEncCtx, int32_t iCodedBits) { · 30 unmodified lines
736737 ++ pSOverRc;
737738 }
738739 if (iTotalMb > 0)
739− pWelsSvcRc->iAverageFrameQp = (int32_t) (1.0 * iTotalQp / iTotalMb + 0.5);
740+ pWelsSvcRc->iAverageFrameQp = WELS_ROUND (1.0 * iTotalQp / iTotalMb);
740741 else
741742 pWelsSvcRc->iAverageFrameQp = pEncCtx->iGlobalQp;
742743 } else {
@@ -753,7 +754,7 @@ void RcUpdateIntraComplexity (sWelsEncCtx* pEncCtx) { · 10 unmodified lines
753754
754755 double dIntraCmplx = pWelsSvcRc->dQStep * pWelsSvcRc->iFrameDqBits;
755756 dIntraCmplx = (1.0 - iAlpha) * pWelsSvcRc->iIntraComplexity + iAlpha * dIntraCmplx;
756− pWelsSvcRc->iIntraComplexity = (int32_t) (dIntraCmplx + 0.5);
757+ pWelsSvcRc->iIntraComplexity = WELS_ROUND (dIntraCmplx);
757758 pWelsSvcRc->iIntraMbCount = pWelsSvcRc->iNumberMbFrame;
758759
759760 pWelsSvcRc->iIdrNum++;
@@ -775,8 +776,8 @@ void RcUpdateFrameComplexity (sWelsEncCtx* pEncCtx) { · 15 unmodified lines
775776 double iAlpha = 1.0 / (1 + pTOverRc->iPFrameNum);
776777 if (iAlpha < SMOOTH_FACTOR_MIN_VALUE)
777778 iAlpha = SMOOTH_FACTOR_MIN_VALUE;
778− pTOverRc->iFrameCmplxMean = (int32_t) ((1.0 - iAlpha) * pTOverRc->iFrameCmplxMean + iAlpha *
779− pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity + 0.5);
779+ pTOverRc->iFrameCmplxMean = WELS_ROUND ((1.0 - iAlpha) * pTOverRc->iFrameCmplxMean + iAlpha *
780+ pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity);
780781
781782 pTOverRc->iPFrameNum++;
782783 if (pTOverRc->iPFrameNum > 255)
@@ -918,10 +919,10 @@ void WelsRcPictureInitDisable (void* pCtx) { · 135 unmodified lines
918919 pEncCtx->iGlobalQp = RcCalculateCascadingQp (pEncCtx, kiQp);
919920
920921 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant && (pEncCtx->eSliceType == P_SLICE)) {
921− pEncCtx->iGlobalQp = (int32_t)WELS_CLIP3 (pEncCtx->iGlobalQp -
922− pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp, GOM_MIN_QP_MODE, GOM_MAX_QP_MODE);
923− }else{
924− pEncCtx->iGlobalQp = WELS_CLIP3(pEncCtx->iGlobalQp, FIX_MIN_QP_MODE, FIX_MAX_QP_MODE);
922+ pEncCtx->iGlobalQp = WELS_CLIP3 (WELS_ROUND (pEncCtx->iGlobalQp -
923+ pEncCtx->pVaa->sAdaptiveQuantParam.dAverMotionTextureIndexToDeltaQp), GOM_MIN_QP_MODE, GOM_MAX_QP_MODE);
924+ } else {
925+ pEncCtx->iGlobalQp = WELS_CLIP3 (pEncCtx->iGlobalQp, FIX_MIN_QP_MODE, FIX_MAX_QP_MODE);
925926 }
926927
927928 pWelsSvcRc->iAverageFrameQp = pEncCtx->iGlobalQp;
@@ -937,8 +938,8 @@ void WelsRcMbInitDisable (void* pCtx, SMB* pCurMb, SSlice* pSlice) { · 9 unmodified lines
937938 if (pEncCtx->pSvcParam->bEnableAdaptiveQuant && (pEncCtx->eSliceType == P_SLICE)) {
938939 iLumaQp = (int8_t)WELS_CLIP3 (iLumaQp +
939940 pEncCtx->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp[pCurMb->iMbXY], GOM_MIN_QP_MODE, 51);
940− }else{
941− iLumaQp = WELS_CLIP3(iLumaQp,FIX_MIN_QP_MODE,FIX_MAX_QP_MODE);
941+ } else {
942+ iLumaQp = WELS_CLIP3 (iLumaQp, FIX_MIN_QP_MODE, FIX_MAX_QP_MODE);
942943 }
943944 pCurMb->uiChromaQp = g_kuiChromaQpTable[iLumaQp];
944945 pCurMb->uiLumaQp = iLumaQp;

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