diff options
author | Johannes Schickel | 2014-06-02 01:00:15 +0200 |
---|---|---|
committer | Johannes Schickel | 2014-06-02 01:00:15 +0200 |
commit | 4c716539ad2a9cf361b076a9b811aa24f7b874cb (patch) | |
tree | 16b4bc90021f21906dbae3056d281d944be5f5ea /common | |
parent | 2bd2db10aa96c7d6ee17f4132ee6d317ccc6cf62 (diff) | |
download | scummvm-rg350-4c716539ad2a9cf361b076a9b811aa24f7b874cb.tar.gz scummvm-rg350-4c716539ad2a9cf361b076a9b811aa24f7b874cb.tar.bz2 scummvm-rg350-4c716539ad2a9cf361b076a9b811aa24f7b874cb.zip |
COMMON: Use float constants in DCT code.
Makes the DCT code use constants of type float in expressions which only use
type float values otherwise. This silences some floating point conversion
warnings in the DCT code.
Diffstat (limited to 'common')
-rw-r--r-- | common/dct.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/dct.cpp b/common/dct.cpp index dea75f4c45..27e0c0bf41 100644 --- a/common/dct.cpp +++ b/common/dct.cpp @@ -73,7 +73,7 @@ void DCT::calc(float *data) { void DCT::calcDCTI(float *data) { int n = 1 << _bits; - float next = -0.5 * (data[0] - data[n]); + float next = -0.5f * (data[0] - data[n]); for (int i = 0; i < (n / 2); i++) { float tmp1 = data[i ]; @@ -87,7 +87,7 @@ void DCT::calcDCTI(float *data) { next += c; - tmp1 = (tmp1 + tmp2) * 0.5; + tmp1 = (tmp1 + tmp2) * 0.5f; data[i ] = tmp1 - s; data[n - i] = tmp1 + s; @@ -113,7 +113,7 @@ void DCT::calcDCTII(float *data) { s *= tmp1 - tmp2; - tmp1 = (tmp1 + tmp2) * 0.5; + tmp1 = (tmp1 + tmp2) * 0.5f; data[i ] = tmp1 + s; data[n - i - 1] = tmp1 - s; @@ -121,7 +121,7 @@ void DCT::calcDCTII(float *data) { _rdft->calc(data); - float next = data[1] * 0.5; + float next = data[1] * 0.5f; data[1] *= -1; @@ -143,7 +143,7 @@ void DCT::calcDCTIII(float *data) { int n = 1 << _bits; float next = data[n - 1]; - float inv_n = 1.0 / n; + float inv_n = 1.0f / n; for (int i = n - 2; i >= 2; i -= 2) { float val1 = data[i ]; @@ -184,7 +184,7 @@ void DCT::calcDSTI(float *data) { float s = SIN(n, 2 * i); s *= tmp1 + tmp2; - tmp1 = (tmp1 - tmp2) * 0.5; + tmp1 = (tmp1 - tmp2) * 0.5f; data[i ] = s + tmp1; data[n - i] = s - tmp1; @@ -194,7 +194,7 @@ void DCT::calcDSTI(float *data) { _rdft->calc(data); - data[0] *= 0.5; + data[0] *= 0.5f; for (int i = 1; i < (n - 2); i += 2) { data[i + 1] += data[i - 1]; |