History

using WelsRound for all the double-int32_t conversion

Sijia Chen committed 12 years ago

Commit 74130321 parent cc8102010 files · +67 −65Browse files

Showing the changes to codec/processing/src/downsample (2 of 10 files). Show all

Unified · Split

2 files
  1. codec/processing/src/downsample/downsample.h +1 −0
  2. codec/processing/src/downsample/downsamplefuncs.cpp +4 −4
codec/processing/src/downsample/downsample.h+1−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #include "util.h"
4646 #include "WelsFrameWork.h"
4747 #include "IWelsVP.h"
48+#include "macros.h"
4849
4950 WELSVP_NAMESPACE_BEGIN
5051
codec/processing/src/downsample/downsamplefuncs.cpp+4−4
@@ -73,8 +73,8 @@ void GeneralBilinearFastDownsampler_c (uint8_t* pDst, const int32_t kiDstStride, · 72 unmodified lines
7373 uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
7474 const uint32_t kuiScaleBitWidth = 16, kuiScaleBitHeight = 15;
7575 const uint32_t kuiScaleWidth = (1 << kuiScaleBitWidth), kuiScaleHeight = (1 << kuiScaleBitHeight);
76− int32_t fScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
77− int32_t fScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
76+ int32_t fScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kuiScaleWidth);
77+ int32_t fScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kuiScaleHeight);
7878 uint32_t x;
7979 int32_t iYInverse, iXInverse;
8080
@@ -142,8 +142,8 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr · 61 unmodified lines
142142 uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
143143 const int32_t kiScaleBit = 15;
144144 const int32_t kiScale = (1 << kiScaleBit);
145− int32_t iScalex = (int32_t) ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
146− int32_t iScaley = (int32_t) ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
145+ int32_t iScalex = WELS_ROUND ((float)kiSrcWidth / (float)kiDstWidth * kiScale);
146+ int32_t iScaley = WELS_ROUND ((float)kiSrcHeight / (float)kiDstHeight * kiScale);
147147 int64_t x;
148148 int32_t iYInverse, iXInverse;
149149

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