[Scummvm-git-logs] scummvm master -> 84cdfd7ed1a3142f4497efec7cf839755be4670d
whoozle
noreply at scummvm.org
Sun Nov 30 19:20:49 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
84cdfd7ed1 MATH: constify DCT calc functions
Commit: 84cdfd7ed1a3142f4497efec7cf839755be4670d
https://github.com/scummvm/scummvm/commit/84cdfd7ed1a3142f4497efec7cf839755be4670d
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2025-11-30T19:20:28Z
Commit Message:
MATH: constify DCT calc functions
Changed paths:
math/dct.cpp
math/dct.h
diff --git a/math/dct.cpp b/math/dct.cpp
index 3f98d852eed..33c69cc461e 100644
--- a/math/dct.cpp
+++ b/math/dct.cpp
@@ -48,7 +48,7 @@ DCT::~DCT() {
delete[] _csc2;
}
-void DCT::calc(float *data) {
+void DCT::calc(float *data) const {
switch (_trans) {
case DCT_I:
calcDCTI(data);
@@ -72,7 +72,7 @@ void DCT::calc(float *data) {
/* cos((M_PI * x / (2*n)) */
#define COS(n,x) (_tCos[x])
-void DCT::calcDCTI(float *data) {
+void DCT::calcDCTI(float *data) const {
int n = 1 << _bits;
float next = -0.5f * (data[0] - data[n]);
@@ -104,7 +104,7 @@ void DCT::calcDCTI(float *data) {
data[i] = data[i - 2] - data[i];
}
-void DCT::calcDCTII(float *data) {
+void DCT::calcDCTII(float *data) const {
int n = 1 << _bits;
for (int i = 0; i < (n / 2); i++) {
@@ -141,7 +141,7 @@ void DCT::calcDCTII(float *data) {
}
}
-void DCT::calcDCTIII(float *data) {
+void DCT::calcDCTIII(float *data) const {
int n = 1 << _bits;
float next = data[n - 1];
@@ -175,7 +175,7 @@ void DCT::calcDCTIII(float *data) {
}
}
-void DCT::calcDSTI(float *data) {
+void DCT::calcDSTI(float *data) const {
int n = 1 << _bits;
data[0] = 0;
diff --git a/math/dct.h b/math/dct.h
index 9453766832d..e9f44316b81 100644
--- a/math/dct.h
+++ b/math/dct.h
@@ -61,7 +61,7 @@ public:
DCT(int bits, TransformType trans);
~DCT();
- void calc(float *data);
+ void calc(float *data) const;
private:
int _bits;
@@ -74,10 +74,10 @@ private:
RDFT *_rdft;
- void calcDCTI (float *data);
- void calcDCTII (float *data);
- void calcDCTIII(float *data);
- void calcDSTI (float *data);
+ void calcDCTI(float *data) const;
+ void calcDCTII(float *data) const;
+ void calcDCTIII(float *data) const;
+ void calcDSTI(float *data) const;
};
/** @} */
More information about the Scummvm-git-logs
mailing list