Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MP3 from 16-bit WAV vs from 32-bit WAV (Read 26919 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #25
It is possible to encode +6 dB to MP3 without clipping.

Can this be done with Lame?

Yes, with "LAME 3.98.4 modified to add float wav input" from Rarewares.


Confirmed. Works fine indeed. >0dB stuff isn't lost.


I've just tried it in REAPER (via 3.98.4 lame_enc.dll from Rarewares). Stuff over >0dB gets lost in the MP3. So lame_enc.dll doesn't handle floating point input properly yet? Or is REAPER not feeding it properly (which I doubt)?

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #26
If Reaper is using the old Blade replacement API functions (beEncodeChunk), then it will likely feed LAME with 16 bit short values. Though, it could use some newer functions to pass floating point values into LAME (beEncodeChunkFloatS16NI).

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #27
If Reaper is using the old Blade replacement API functions (beEncodeChunk), then it will likely feed LAME with 16 bit short values. Though, it could use some newer functions to pass floating point values into LAME (beEncodeChunkFloatS16NI).


Thank you Robert. I've created a ticket in the REAPER bug tracker for it: http://forum.cockos.com/project.php?issueid=2298


Is there 32bit or 64bit float input planned or does this make no sense for MP3 encoding?

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #28
@ Robert:


Here two replies from a REAPER developer:

Quote
Reaper uses the Blade API only on Win32.

... note that Reaper does clamp the floating point output to +0dB when encoding to mp3.



Answer to my question on why the output gets clamped:
Quote
Probably because of ambiguity in LAME documentation.  beEncodeChunkFloatS16NI doesn't seem to be documented at all, and lame_encode_buffer_float is documented with

* !! NOTE: !! data must still be scaled to be in the same range as short int, +/- 32768

That does say "scaled" rather than "scaled and clamped" ... before changing Reaper to allow passing unclamped floating point values to LAME for encoding), we should verify that it won't break either by looking in the LAME source code directly, or getting a statement with high confidence from someone who is familiar with the code.


Can you give some proper technical advise on this?

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #29
@Robert: you already "said" that it shouldn't be clamped, right?

It's still unclear to the REAPER dev:
Quote
LAME already has 32 bit float input support (which Reaper uses), the only issue is whether there is any maximum (normalized) absolute value for the floating point inputs.  In fact that last comment suggests that they will be clamping internally (though it isn't totally clear).


Quote
The concern would be that there may be some encoder settings where supplying >0dB inputs would break things.  Or that inputs up to +6dB will work but over +6dB would break, or other details that we don't know about.


MP3 from 16-bit WAV vs from 32-bit WAV

Reply #31
@robet: Can you answer my last questions or do I have to contact someone else?

 

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #32
LAME won't break if you feed float values above "full-scale". But keep in mind, that playback might become seriously distorted, depending on your decoder and its abilities to prevent clipping.


MP3 from 16-bit WAV vs from 32-bit WAV

Reply #34
FIXED (REAPER 3.46pre2)

MP3 from 16-bit WAV vs from 32-bit WAV

Reply #35
I would have said, "will always have zero benefit" except I'm never 100% certain of anything, especially in relation to science


How about maths?