- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2
 
Description
Thank you for this interesting project!
As mentioned already in the readme, both the encoding and decoding process can be a bit slow. While this might not necessarily be that relevant for the encoding side, decoding speed of files can be problematic for longer files. On my system, encoding speed is around 0.25x  while decoding is at 0.5x. The culprit is the MDCT conversion that is calculated quite a lot.
One simple approach I did use to improve this is by simply precalculating the MDCT over all possible coefficients when calling the encode/decode function. This needs to be done for short and long window sizes separately, with each lookup table having the size of (winsize * winsize / 2) floats.
At the expense of some temporary memory allocation, this yielded quite some improvements in my tests.
Using a 28 second test file, without the lookup table I had the following times:
- encoding: 122s
 - decoding: 51s
 
With the lookup table:
- encoding: 45s
 - decoding: 2s (!)
 
Encoded and decoded files are of course identical between the two variants, just the processing is around 3 times fast for encoding and around 25 times faster for decoding.
Not sure if this is of interest to any of you, but I thought I would just mention it here in case anyone is playing around with the library like I did. :)