Skip to content

Commit

Permalink
Avoid re-making the DCT table if it is already correct when initialis…
Browse files Browse the repository at this point in the history
…ing (#241)
  • Loading branch information
AlexHarker authored Aug 17, 2023
1 parent 6576486 commit f6ec9be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/algorithms/public/DCT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class DCT
assert(inputSize <= mTable.cols());
assert(outputSize <= mTable.rows());

// Do not reinitialise if there is no need

if (mInitialized && mInputSize == inputSize && mOutputSize == outputSize)
return;

mInputSize = inputSize;
mOutputSize = outputSize;
mTable.setZero();
Expand Down

0 comments on commit f6ec9be

Please sign in to comment.