[Scummvm-git-logs] scummvm master -> cf99bb0a5e4ff796dbede334e66cad4a0682baf4

sev- sev at scummvm.org
Sat Aug 25 23:50:10 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cf99bb0a5e COMMON: Update RDFT and DCT cos/sin table constructor usage


Commit: cf99bb0a5e4ff796dbede334e66cad4a0682baf4
    https://github.com/scummvm/scummvm/commit/cf99bb0a5e4ff796dbede334e66cad4a0682baf4
Author: David Fioramonti (dafioram at gmail.com)
Date: 2018-08-25T23:50:07+02:00

Commit Message:
COMMON: Update RDFT and DCT cos/sin table constructor usage

When the constructor for the cos/sin table was changed from
number of bits to number of points all usages thoughout the
code should of been changed, but this was missed in RDFT and DCT.

Fixes Trac#10683.

Changed paths:
    common/dct.cpp
    common/rdft.cpp


diff --git a/common/dct.cpp b/common/dct.cpp
index 9d551b9..374eee0 100644
--- a/common/dct.cpp
+++ b/common/dct.cpp
@@ -30,7 +30,7 @@
 
 namespace Common {
 
-DCT::DCT(int bits, TransformType trans) : _bits(bits), _cos(_bits + 2), _trans(trans), _rdft(nullptr) {
+DCT::DCT(int bits, TransformType trans) : _bits(bits), _cos(1 << (_bits + 2) ), _trans(trans), _rdft(nullptr) {
 	int n = 1 << _bits;
 
 	_tCos = _cos.getTable();
diff --git a/common/rdft.cpp b/common/rdft.cpp
index b6af6cb..f09f983 100644
--- a/common/rdft.cpp
+++ b/common/rdft.cpp
@@ -28,7 +28,7 @@
 
 namespace Common {
 
-RDFT::RDFT(int bits, TransformType trans) : _bits(bits), _sin(bits), _cos(bits), _fft(nullptr) {
+RDFT::RDFT(int bits, TransformType trans) : _bits(bits), _sin(1 << bits), _cos(1 << bits), _fft(nullptr) {
 	assert((_bits >= 4) && (_bits <= 16));
 
 	_inverse        = trans == IDFT_C2R || trans == DFT_C2R;





More information about the Scummvm-git-logs mailing list