-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Spectral Band Replication for HE-AAC v1 #13
base: master
Are you sure you want to change the base?
Conversation
Much faster than arrays of arrays of arrays... Using [babel-plugin-multidimensional-array](https://github.com/devongovett/babel-plugin-multidimensional-array) for compilation.
* No more long vs short tables. * Precompute bit reversal table.
Yay, smaller build!
Separate method to compute just the middle half, excluding parts that can be derived by symmetry. Also should be faster.
Way faster than the previous method. This is based on a procedure to implement the filterbank on the DCT-IV described in Hsu, H.W. et al. "A Complex Quadrature Mirror Filterbanks for MPEG-4 HE-AAC", and implementation in ffmpeg. http://sites.google.com/site/wenchiehlee1020/Papers/ComplexFB_AES_121paper144.pdf
This is quite a bit faster now. It used ~20% CPU on my iMac before (decoding in real time), and now uses ~3-4%, which isn't much higher than simple AAC-LC decoding. Implemented optimizations by pre-allocating memory, and using flattened multidimensional typed arrays rather than arrays of (arrays of...) typed arrays. Made a babel plugin to make this easier: https://github.com/devongovett/babel-plugin-multidimensional-array. That brought CPU usage down to ~10%. The other optimization was switching the QMF filter banks to use IMDCT instead of multiplying by a matrix. This is based on a procedure to implement the filterbank on the DCT-IV described in Hsu, H.W. et al. "A Complex Quadrature Mirror Filterbanks for MPEG-4 HE-AAC", and implementation in ffmpeg. http://sites.google.com/site/wenchiehlee1020/Papers/ComplexFB_AES_121paper144.pdf |
Progress? |
Spectral Band Replication was added to the AAC-LC profile to create HE-AAC v1. It effectively allows cutting the sample rate in half by reconstructing the high-frequency bands using harmonics from the lower/mid frequencies and some small side data (~2kbps). This greatly increases the compression ratio while retaining decent quality at low bit rates. Here is a high level overview, and here is the MPEG/ISO spec.
This is a work in progress, but it kinda works on a few files I tested. Definitely needs more testing though. I'm sure there are tons of bugs.
TODO:
sort
andfill
)?