History

use the same complexity computation branch for screen and camera

ruil2 committed 11 years ago

Commit 173ec601 parent 827c7b22 files · +11 −12Browse files

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

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+9−9
@@ -250,7 +250,6 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 249 unmodified lines
250250
251251 AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);
252252 }
253− AnalyzePictureComplexity (pCtx, pCurPic, pRefPic, kiDidx, bCalculateBGD);
254253 WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]);
255254 }
256255 return 0;
@@ -735,8 +734,6 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 478 unmodified lines
735734 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
736735 int32_t iComplexityAnalysisMode = 0;
737736
738− if (pSvcParam->iRCMode == RC_OFF_MODE)
739− return;
740737 if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) {
741738 SVAAFrameInfoExt* pVaaExt = static_cast<SVAAFrameInfoExt*> (pCtx->pVaa);
742739 SComplexityAnalysisScreenParam* sComplexityAnalysisParam = &pVaaExt->sComplexityScreenParam;
@@ -806,7 +803,8 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 63 unmodified lines
806803 sComplexityAnalysisParam->iComplexityAnalysisMode = iComplexityAnalysisMode;
807804 sComplexityAnalysisParam->pCalcResult = & (pVaaInfo->sVaaCalcInfo);
808805 sComplexityAnalysisParam->pBackgroundMbFlag = pVaaInfo->pVaaBackgroundMbFlag;
809− SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType);
806+ if(pRefPicture)
807+ SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType);
810808 sComplexityAnalysisParam->iCalcBgd = bCalculateBGD;
811809 sComplexityAnalysisParam->iFrameComplexity = 0;
812810
@@ -833,11 +831,13 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 20 unmodified lines
833831 sSrcPixMap.sRect.iRectHeight = pCurPicture->iHeightInPixel;
834832 sSrcPixMap.eFormat = VIDEO_FORMAT_I420;
835833
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+ }
841841 sRefPixMap.eFormat = VIDEO_FORMAT_I420;
842842
843843 iRet = m_pInterfaceVp->Set (iMethodIdx, (void*)sComplexityAnalysisParam);

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