-
Notifications
You must be signed in to change notification settings - Fork 34
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
Apply and test patch to convert internal buffers to floats #1
Comments
@eblanca what do you think of this? |
I will need to study various parts of the code and see what's going to change with this patch. |
I downloaded the patch and I'm reading it, but cannot reach the page |
Just checked and I think SourceForge deleted the old issue tracker. Thanks for looking at this. |
So, this code should replace short integer with double precision float. |
I guess one of benefits is to reduce the number of times of converting between integer and floats and the errors that may introduce. @klauspost were you the original submitter? (many years ago!) |
Indeed, must be 10 years ago. It was added, so input could be float numbers normalized to 1.0 and not have back/forth conversions. |
What about the current twolame API? |
Yes, a floating point API was on my todo list at one point. Lame has:
|
This turned out to be a challenging (yet interesting!) job.
|
Thank you for looking into this Elio.
One disadvantage to doing this is is that there may be some embedded systems that don't have native floating point support. |
In my branch |
My branch 'move_to_float' https://github.com/eblanca/twolame/tree/move_to_float is now in a working clean state, would you please give it a look and validate the new encoding engine? Edit: the FLOAT type is now 'float' (32 bit) |
Original tracker ticket:
https://sourceforge.net/tracker/?func=detail&aid=1760298&group_id=136040&atid=735435
Patch here:
https://gist.github.com/762513
I've attached a patch, that enables internal FLOAT buffer support. All internal 16 bit code has been replaced.
Should be compatible with existing interface.
It also replaces:
With:
Since the former triggers a compiler error on MSVC++ 8, making it overwrite values in global_opt->smem->off[0].
Right now the internal buffer is the same as FLOAT is defined as in common.h - changing it from double to float results in a significant slowdown on windows - probably because there are a lot of float <-> double conversions needed. Functions would need to be replaced by float ones.
There are still some places that should be investigated:
psycho_1.c - Line 533 & psycho_1.c - Line 128:
max = 20 * log10 (scale[i] * 32768) - 10; /* level for each subband */
ath.c, line 98 - guess that one is for general confusion.
Regards, Klaus Post.
The text was updated successfully, but these errors were encountered: