using WelsRound for all the double-int32_t conversion

This commit is contained in:
Sijia Chen
2014-05-20 14:06:31 +08:00
parent cc81020875
commit 7413032185
10 changed files with 67 additions and 65 deletions

View File

@@ -101,7 +101,7 @@ void CComplexityAnalysis::AnalyzeFrameComplexityViaSad (SPixMap* pSrcPixMap, SPi
m_sComplexityAnalysisParam.iFrameComplexity = pVaaCalcResults->iFrameSad;
if (m_sComplexityAnalysisParam.iCalcBgd) { //BGD control
m_sComplexityAnalysisParam.iFrameComplexity = (int32_t)GetFrameSadExcludeBackground (pSrcPixMap, pRefPixMap);
m_sComplexityAnalysisParam.iFrameComplexity = GetFrameSadExcludeBackground (pSrcPixMap, pRefPixMap);
}
}

View File

@@ -45,6 +45,7 @@
#include "util.h"
#include "WelsFrameWork.h"
#include "IWelsVP.h"
#include "macros.h"
WELSVP_NAMESPACE_BEGIN

View File

@@ -73,8 +73,8 @@ void GeneralBilinearFastDownsampler_c (uint8_t* pDst, const int32_t kiDstStride,
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
int32_t fScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
int32_t fScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
int32_t fScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
int32_t fScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
uint32_t x;
int32_t iYInverse, iXInverse;
@@ -142,8 +142,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
const int32_t kiScaleBit = 15;
const int32_t kiScale = (1 << kiScaleBit);
int32_t iScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
int32_t iScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
int32_t iScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
int32_t iScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
int64_t x;
int32_t iYInverse, iXInverse;