|
|
|
04-09-2010 06:12 AM | ||
|
||
Quote:
FIXED (3.46pre2) |
04-09-2010 06:29 AM | |||
|
|||
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. |
04-09-2010 06:51 AM | ||
|
||
Ok, I've forwared your answers to get a statement.
FIXED (3.46pre2) I tried lame.exe ("LAME 3.98.4 modified to add float wav input" version from http://www.rarewares.org) and there I don't loose >0dB content when feeding 32bit float wav into it. I can later bring down the MP3 and nothing got clamped/clipped. |
04-10-2010 07:22 AM | |||
|
|||
schwa,
I think the LAME developer already said that it shouldn't be clamped. I was asking this: Quote:
Quote:
FIXED (3.46pre2) The next version also seems to get 32bit float input support: Quote:
|
04-10-2010 07:46 AM | |||
|
|||
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).
|
04-10-2010 07:54 AM | ||
|
||
But I tried lame.exe ("LAME 3.98.4 modified to add float wav input" version from http://www.rarewares.org) and there I don't loose >0dB content when feeding 32bit float wav into it. I can later bring down the MP3 and nothing got clamped/clipped. No distortion.
Shouldn't lame_enc.dll behave the same? FIXED (3.46pre2) |
04-10-2010 07:57 AM | |||
|
|||
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.
|
04-10-2010 07:57 AM | ||
|
||
Ok, let's wait for some answer(s) then.
FIXED (3.46pre2) |
04-10-2010 12:20 PM | |||
|
|||
the authors (robert) will give a shorter and probably better defined answer.
3.98.4 BladeMP3EncDLL.c http://lame.cvs.sourceforge.net/view....1&view=markup Code:
// accept floating point audio samples, scaled to the range of a signed 16-bit // integer (within +/- 32768), in non-interleaved channels -- DSPguru, jd __declspec(dllexport) BE_ERR beEncodeChunkFloatS16NI(HBE_STREAM hbeStream, DWORD nSamples, PFLOAT buffer_l, PFLOAT buffer_r, PBYTE pOutput, PDWORD pdwOutput) { int nOutputSamples; lame_global_flags* gfp = (lame_global_flags*)hbeStream; nOutputSamples = lame_encode_buffer_float(gfp,buffer_l,buffer_r,nSamples,pOutput,0); if ( nOutputSamples >= 0 ) { *pdwOutput = (DWORD) nOutputSamples; } else { *pdwOutput=0; return BE_ERR_BUFFER_TOO_SMALL; } return BE_ERR_SUCCESSFUL; } otherwise manual scaling is done with: lame.c http://lame.cvs.sourceforge.net/view...43&view=markup Code:
//... ///lame_encode_buffer_sample_t() //... /* Apply user defined re-scaling */ /* user selected scaling of the samples */ if (NEQ(gfp->scale, 0) && NEQ(gfp->scale, 1.0)) { for (i = 0; i < nsamples; ++i) { in_buffer[0][i] *= gfp->scale; if (gfc->channels_out == 2) in_buffer[1][i] *= gfp->scale; } } machine.h http://lame.cvs.sourceforge.net/view...34&view=markup Code:
/* sample_t must be floating point, at least 32 bits */ typedef FLOAT sample_t; typedef sample_t stereo_t[2]; #if 1 #define EQ(a,b) (\ (fabs(a) > fabs(b)) \ ? (fabs((a)-(b)) <= (fabs(a) * 1e-6f)) \ : (fabs((a)-(b)) <= (fabs(b) * 1e-6f))) #else #define EQ(a,b) (fabs((a)-(b))<1E-37) #endif #define NEQ(a,b) (!EQ(a,b)) //... |
04-15-2010 06:11 PM | ||
|
||
@schwa:
Here a new reply: Quote:
So can we change this now in REAPER or is it still now enough proof? FIXED (3.46pre2) |
Issue Tools |
---|
Subscribe to this issue |