Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 2 files). Show all
Unified · Split
| @@ -250,7 +250,6 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 249 unmodified lines | ||
| 250 | 250 | |
| 251 | 251 | AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic); |
| 252 | 252 | } |
| 253 | − AnalyzePictureComplexity (pCtx, pCurPic, pRefPic, kiDidx, bCalculateBGD); | |
| 254 | 253 | WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]); |
| 255 | 254 | } |
| 256 | 255 | return 0; |
| @@ -735,8 +734,6 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 478 unmodified lines | ||
| 735 | 734 | SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; |
| 736 | 735 | int32_t iComplexityAnalysisMode = 0; |
| 737 | 736 | |
| 738 | − if (pSvcParam->iRCMode == RC_OFF_MODE) | |
| 739 | − return; | |
| 740 | 737 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| 741 | 738 | SVAAFrameInfoExt* pVaaExt = static_cast<SVAAFrameInfoExt*> (pCtx->pVaa); |
| 742 | 739 | SComplexityAnalysisScreenParam* sComplexityAnalysisParam = &pVaaExt->sComplexityScreenParam; |
| @@ -806,7 +803,8 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 63 unmodified lines | ||
| 806 | 803 | sComplexityAnalysisParam->iComplexityAnalysisMode = iComplexityAnalysisMode; |
| 807 | 804 | sComplexityAnalysisParam->pCalcResult = & (pVaaInfo->sVaaCalcInfo); |
| 808 | 805 | sComplexityAnalysisParam->pBackgroundMbFlag = pVaaInfo->pVaaBackgroundMbFlag; |
| 809 | − SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType); | |
| 806 | + if(pRefPicture) | |
| 807 | + SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType); | |
| 810 | 808 | sComplexityAnalysisParam->iCalcBgd = bCalculateBGD; |
| 811 | 809 | sComplexityAnalysisParam->iFrameComplexity = 0; |
| 812 | 810 | |
| @@ -833,11 +831,13 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 20 unmodified lines | ||
| 833 | 831 | sSrcPixMap.sRect.iRectHeight = pCurPicture->iHeightInPixel; |
| 834 | 832 | sSrcPixMap.eFormat = VIDEO_FORMAT_I420; |
| 835 | 833 | |
| 836 | − sRefPixMap.pPixel[0] = pRefPicture->pData[0]; | |
| 837 | − sRefPixMap.iSizeInBits = g_kiPixMapSizeInBits; | |
| 838 | − sRefPixMap.iStride[0] = pRefPicture->iLineSize[0]; | |
| 839 | − sRefPixMap.sRect.iRectWidth = pRefPicture->iWidthInPixel; | |
| 840 | − sRefPixMap.sRect.iRectHeight = pRefPicture->iHeightInPixel; | |
| 834 | + if(pRefPicture){ | |
| 835 | + sRefPixMap.pPixel[0] = pRefPicture->pData[0]; | |
| 836 | + sRefPixMap.iSizeInBits = g_kiPixMapSizeInBits; | |
| 837 | + sRefPixMap.iStride[0] = pRefPicture->iLineSize[0]; | |
| 838 | + sRefPixMap.sRect.iRectWidth = pRefPicture->iWidthInPixel; | |
| 839 | + sRefPixMap.sRect.iRectHeight = pRefPicture->iHeightInPixel; | |
| 840 | + } | |
| 841 | 841 | sRefPixMap.eFormat = VIDEO_FORMAT_I420; |
| 842 | 842 | |
| 843 | 843 | iRet = m_pInterfaceVp->Set (iMethodIdx, (void*)sComplexityAnalysisParam); |