Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -2899,21 +2899,20 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { · 2898 unmodified lines | ||
| 2899 | 2899 | return ENC_RETURN_SUCCESS; |
| 2900 | 2900 | } |
| 2901 | 2901 | |
| 2902 | −int32_t GetSubSequenceId(sWelsEncCtx* pCtx,EVideoFrameType eFrameType){ | |
| 2902 | +int32_t GetSubSequenceId (sWelsEncCtx* pCtx, EVideoFrameType eFrameType) { | |
| 2903 | 2903 | int32_t iSubSeqId = 0; |
| 2904 | − if(eFrameType == videoFrameTypeIDR ) | |
| 2904 | + if (eFrameType == videoFrameTypeIDR) | |
| 2905 | 2905 | iSubSeqId = 0; |
| 2906 | − else if(eFrameType == videoFrameTypeI) | |
| 2906 | + else if (eFrameType == videoFrameTypeI) | |
| 2907 | 2907 | iSubSeqId = 1; |
| 2908 | − else if (eFrameType == videoFrameTypeP){ | |
| 2909 | − if(pCtx->bCurFrameMarkedAsSceneLtr) | |
| 2908 | + else if (eFrameType == videoFrameTypeP) { | |
| 2909 | + if (pCtx->bCurFrameMarkedAsSceneLtr) | |
| 2910 | 2910 | iSubSeqId = 2; |
| 2911 | − else | |
| 2911 | + else | |
| 2912 | 2912 | iSubSeqId = 3 + pCtx->uiTemporalId; //T0:3 T1:4 T2:5 T3:6 |
| 2913 | − } | |
| 2914 | − else | |
| 2913 | + } else | |
| 2915 | 2914 | iSubSeqId = 3 + MAX_TEMPORAL_LAYER_NUM; |
| 2916 | − return iSubSeqId; | |
| 2915 | + return iSubSeqId; | |
| 2917 | 2916 | } |
| 2918 | 2917 | /*! |
| 2919 | 2918 | * \brief core svc encoding process |
| @@ -3556,7 +3555,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 636 unmodified lines | ||
| 3556 | 3555 | ++ pCtx->iCodingIndex; |
| 3557 | 3556 | pCtx->eLastNalPriority = eNalRefIdc; |
| 3558 | 3557 | pFbi->iLayerNum = iLayerNum; |
| 3559 | − pFbi->iSubSeqId = GetSubSequenceId(pCtx,eFrameType); | |
| 3558 | + pFbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | |
| 3560 | 3559 | WelsEmms(); |
| 3561 | 3560 | |
| 3562 | 3561 | pFbi->eFrameType = eFrameType; |
| @@ -3817,12 +3816,13 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 254 unmodified lines | ||
| 3817 | 3816 | int16_t* pFirstMbInSlice = (int16_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int16_t), "pSliceSeg->pFirstMbInSlice"); |
| 3818 | 3817 | if (NULL == pFirstMbInSlice) |
| 3819 | 3818 | return ENC_RETURN_MEMALLOCERR; |
| 3820 | − memset(pFirstMbInSlice, 0, sizeof(int16_t) * iMaxSliceNum); | |
| 3819 | + memset (pFirstMbInSlice, 0, sizeof (int16_t) * iMaxSliceNum); | |
| 3821 | 3820 | memcpy (pFirstMbInSlice, pCurLayer->pSliceEncCtx->pFirstMbInSlice, sizeof (int16_t) * iMaxSliceNumOld); |
| 3822 | 3821 | pMA->WelsFree (pCurLayer->pSliceEncCtx->pFirstMbInSlice, "pSliceSeg->pFirstMbInSlice"); |
| 3823 | 3822 | pCurLayer->pSliceEncCtx->pFirstMbInSlice = pFirstMbInSlice; |
| 3824 | 3823 | |
| 3825 | − int32_t* pCountMbNumInSlice = (int32_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int32_t),"pSliceSeg->pCountMbNumInSlice"); | |
| 3824 | + int32_t* pCountMbNumInSlice = (int32_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int32_t), | |
| 3825 | + "pSliceSeg->pCountMbNumInSlice"); | |
| 3826 | 3826 | if (NULL == pCountMbNumInSlice) |
| 3827 | 3827 | return ENC_RETURN_MEMALLOCERR; |
| 3828 | 3828 | memcpy (pCountMbNumInSlice, pCurLayer->pSliceEncCtx->pCountMbNumInSlice, sizeof (int32_t) * iMaxSliceNumOld); |
| @@ -3840,13 +3840,15 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 11 unmodified lines | ||
| 3840 | 3840 | memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld); |
| 3841 | 3841 | uiSliceIdx = iMaxSliceNumOld; |
| 3842 | 3842 | SRCSlicing* pSORC = &pSlcingOverRc[uiSliceIdx]; |
| 3843 | − const int32_t kiBitsPerMb = WELS_DIV_ROUND(pCtx->pWelsSvcRc->iTargetBits * INT_MULTIPLY, pCtx->pWelsSvcRc->iNumberMbFrame); | |
| 3843 | + const int32_t kiBitsPerMb = WELS_DIV_ROUND (pCtx->pWelsSvcRc->iTargetBits * INT_MULTIPLY, | |
| 3844 | + pCtx->pWelsSvcRc->iNumberMbFrame); | |
| 3844 | 3845 | while (uiSliceIdx < iMaxSliceNum) { |
| 3845 | 3846 | pSORC->iComplexityIndexSlice = 0; |
| 3846 | 3847 | pSORC->iCalculatedQpSlice = pCtx->iGlobalQp; |
| 3847 | 3848 | pSORC->iTotalQpSlice = 0; |
| 3848 | 3849 | pSORC->iTotalMbSlice = 0; |
| 3849 | − pSORC->iTargetBitsSlice = WELS_DIV_ROUND(kiBitsPerMb * pCurLayer->pSliceEncCtx->pCountMbNumInSlice[uiSliceIdx], INT_MULTIPLY); | |
| 3850 | + pSORC->iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb * pCurLayer->pSliceEncCtx->pCountMbNumInSlice[uiSliceIdx], | |
| 3851 | + INT_MULTIPLY); | |
| 3850 | 3852 | pSORC->iFrameBitsSlice = 0; |
| 3851 | 3853 | pSORC->iGomBitsSlice = 0; |
| 3852 | 3854 | pSORC ++; |