History

add rc function

ruil2 committed 11 years ago

Commit 5b5cc841 parent 993caea5 files · +228 −96Browse files

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

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+7−5
@@ -228,7 +228,6 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 227 unmodified lines
228 if (pSvcParam->bEnableBackgroundDetection) {228 if (pSvcParam->bEnableBackgroundDetection) {
229 BackgroundDetection (pCtx->pVaa, pCurPic, pRefPic, bCalculateBGD && pRefPic->iPictureType != I_SLICE);229 BackgroundDetection (pCtx->pVaa, pCurPic, pRefPic, bCalculateBGD && pRefPic->iPictureType != I_SLICE);
230 }230 }
231
232 if (bNeededMbAq) {231 if (bNeededMbAq) {
233 AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);232 AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);
234 }233 }
@@ -795,17 +794,20 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 560 unmodified lines
795 794
796 if (pSvcParam->iRCMode == RC_QUALITY_MODE && pCtx->eSliceType == P_SLICE) {795 if (pSvcParam->iRCMode == RC_QUALITY_MODE && pCtx->eSliceType == P_SLICE) {
797 iComplexityAnalysisMode = FRAME_SAD;796 iComplexityAnalysisMode = FRAME_SAD;
798 } else if (((pSvcParam->iRCMode == RC_BITRATE_MODE)||(pSvcParam->iRCMode == RC_TIMESTAMP_MODE)) && pCtx->eSliceType == P_SLICE) {797 } else if (((pSvcParam->iRCMode == RC_BITRATE_MODE) || (pSvcParam->iRCMode == RC_TIMESTAMP_MODE))
798 && pCtx->eSliceType == P_SLICE) {
799 iComplexityAnalysisMode = GOM_SAD;799 iComplexityAnalysisMode = GOM_SAD;
800 } else if (((pSvcParam->iRCMode == RC_BITRATE_MODE)||(pSvcParam->iRCMode == RC_TIMESTAMP_MODE)) && pCtx->eSliceType == I_SLICE) {800 } else if (((pSvcParam->iRCMode == RC_BITRATE_MODE) || (pSvcParam->iRCMode == RC_TIMESTAMP_MODE))
801 && pCtx->eSliceType == I_SLICE) {
801 iComplexityAnalysisMode = GOM_VAR;802 iComplexityAnalysisMode = GOM_VAR;
802 } else {803 } else {
803 return;804 return;
804 }805 }
806
805 sComplexityAnalysisParam->iComplexityAnalysisMode = iComplexityAnalysisMode;807 sComplexityAnalysisParam->iComplexityAnalysisMode = iComplexityAnalysisMode;
806 sComplexityAnalysisParam->pCalcResult = & (pVaaInfo->sVaaCalcInfo);808 sComplexityAnalysisParam->pCalcResult = & (pVaaInfo->sVaaCalcInfo);
807 sComplexityAnalysisParam->pBackgroundMbFlag = pVaaInfo->pVaaBackgroundMbFlag;809 sComplexityAnalysisParam->pBackgroundMbFlag = pVaaInfo->pVaaBackgroundMbFlag;
808 if(pRefPicture)810 if (pRefPicture)
809 SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType);811 SetRefMbType (pCtx, & (sComplexityAnalysisParam->uiRefMbType), pRefPicture->iPictureType);
810 sComplexityAnalysisParam->iCalcBgd = bCalculateBGD;812 sComplexityAnalysisParam->iCalcBgd = bCalculateBGD;
811 sComplexityAnalysisParam->iFrameComplexity = 0;813 sComplexityAnalysisParam->iFrameComplexity = 0;
@@ -833,7 +835,7 @@ void CWelsPreProcess::AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCu · 21 unmodified lines
833 sSrcPixMap.sRect.iRectHeight = pCurPicture->iHeightInPixel;835 sSrcPixMap.sRect.iRectHeight = pCurPicture->iHeightInPixel;
834 sSrcPixMap.eFormat = VIDEO_FORMAT_I420;836 sSrcPixMap.eFormat = VIDEO_FORMAT_I420;
835 837
836 if(pRefPicture){838 if (pRefPicture) {
837 sRefPixMap.pPixel[0] = pRefPicture->pData[0];839 sRefPixMap.pPixel[0] = pRefPicture->pData[0];
838 sRefPixMap.iSizeInBits = g_kiPixMapSizeInBits;840 sRefPixMap.iSizeInBits = g_kiPixMapSizeInBits;
839 sRefPixMap.iStride[0] = pRefPicture->iLineSize[0];841 sRefPixMap.iStride[0] = pRefPicture->iLineSize[0];

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