HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: Alex B on 2012-01-28 14:16:43

Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-28 14:16:43
The new 32-bit lame.exe seems to work fine for me on XP Pro SP3 (I have an AMD Phenom II CPU that supports SSE2), but it produces entirely different output than LAME 3.99.3 from the previous "main" bundle. I did not expect that. As far as I can see, the change log does not indicate any further "quality tweaking".

In some cases 3.99.4 seems to produce significantly smaller VBR bitrates than 3.99.3. I tested the settings -V1, -V5 and -V8. When the source tracks were quiet and uncompressed (classical, ambient, etc) the bit rates were 3-12% smaller than before. When the source tracks were loud and compressed (hard rock, metal, etc) the bitrates were about the same as before (or just very slightly smaller).
Title: LAME: different compilers producing significantly different bitstreams
Post by: halb27 on 2012-01-28 21:44:59
With my test set 3.99.4 produces an average bitrate of 254 (was 259 for 3.99.3), 186 (190), and 125 (126) kbps for -V0, -V2, and -V5.

It would be kind if the Lame dev(s) could give us some information about the changes.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-28 22:31:07
I uploaded a sample: http://www.hydrogenaudio.org/forums/index....showtopic=93149 (http://www.hydrogenaudio.org/forums/index.php?showtopic=93149)

In some cases LAME 3.99.4 produces significantly smaller VBR bitrates than 3.99.3.

For example, a 30 s classical piano sample: [attachment=6862:Liszt.flac]
LAME 3.99.4 -V1 => 221 kbps
LAME 3.99.4 -V5 => 106 kbps
LAME 3.99.4 -V8 => 91 kbps

LAME 3.99.3 -V1 => 246 kbps
LAME 3.99.3 -V5 => 119 kbps
LAME 3.99.3 -V8 => 102 kbps

Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-01-28 22:58:15
Different compilers/options IMHO.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-28 23:12:30
At least John did not change the announced compiler version:

From: http://www.rarewares.org/mp3-lame-bundle.php (http://www.rarewares.org/mp3-lame-bundle.php)
Quote
LAME 3.99.4
2012-01-25

Bundle compiled with Intel Compiler 12.1.
Download (754kB)

From: http://webcache.googleusercontent.com/sear...lame-bundle.php (http://webcache.googleusercontent.com/search?q=cache:K5XnaeckDskJ:www.rarewares.org/mp3-lame-bundle.php+http://www.rarewares.org/mp3-lame-bundle.php)
Quote
LAME 3.99.3
2011-11-28

Bundle compiled with Intel Compiler 12.1.
Download (630kB)

Also the size difference is interesting:

32-bit 3.99.3 lame.exe = 626 KB
32-bit 3.99.4 lame.exe = 829 KB
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-28 23:18:48
In some cases LAME 3.99.4 produces significantly smaller VBR bitrates than 3.99.3.


Some smaller, some larger. Occasionally the difference is significant. This has been noted previously. Overall, my Mp3 library is slightly larger when the master FLAC library is transcoded at -V2 using 3.99.3 vs. 3.98.4.


Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-01-28 23:23:55
From RareWares main page: "Compiles are now MSVC9/ICL12.1 to retain Windows 2000 compatibility." (emphasis mine)

Also, here are my MSVS2010 compiles: http://depositfiles.com/files/bje5um8ql (http://depositfiles.com/files/bje5um8ql) (warning: captcha etc...  ).
Title: LAME: different compilers producing significantly different bitstreams
Post by: bbrabant on 2012-01-28 23:40:55
Also, here are my MSVS2010 compiles:


Thanks lvqcl, no problem running your compiles on my system
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-28 23:43:09
Some smaller, some larger. Occasionally the difference is significant. This has been noted previously. Overall, my Mp3 library is slightly larger when the master FLAC library is transcoded at -V2 using 3.99.3 vs. 3.98.4.

We are discussing about 3.99.3 vs 3.99.4, not about 3.98.4 vs 3.99.3/3.99.4.

And my point is this:
... it produces entirely different output than LAME 3.99.3 from the previous "main" bundle. I did not expect that. As far as I can see, the change log does not indicate any further "quality tweaking".

The announced changes:
Quote
LAME 3.99.4  January 25 2012
Robert Hegemann
- Fix for tracker item [ 3475581 ] lame crashes at .w64 input file
- Addressing things brought to attention by tracker item [ 3463197 ] 3.99.x problem WFED and PCST frames
- WFED and PCST frames can now be added, to tag podcasts iTunes recognizes
- USER frames are now supported
- COMM frames can now have a description, when passed via --tv "COMM=description=full text"
- possible divide-by-zero exception should be fixed
- adding malformed user-defined-frames could result in abnormal program termination, fixed
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-28 23:53:27
Ok, then back to lvqcl: Why would a different compilation of the LAME encoder create different audio file encodings?
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-29 00:06:11
Why would a different compilation of the LAME encoder create different audio file encodings?

I'd say that small differences are expected, but not to this extent:

For example, a 30 s classical piano sample: [attachment=6862:Liszt.flac]
LAME 3.99.4 -V1 => 221 kbps
LAME 3.99.4 -V5 => 106 kbps
LAME 3.99.4 -V8 => 91 kbps

LAME 3.99.3 -V1 => 246 kbps
LAME 3.99.3 -V5 => 119 kbps
LAME 3.99.3 -V8 => 102 kbps

and the same sample:

lvqcl's LAME 3.99.4 -V1 => 207 kbps
lvqcl's LAME 3.99.4 -V5 => 97 kbps
lvqcl's LAME 3.99.4 -V8 => 84 kbps

lvqcl's LAME 3.99.3 -V1 => 207 kbps
lvqcl's LAME 3.99.3 -V5 => 97 kbps
lvqcl's LAME 3.99.3 -V8 => 84 kbps

This is quite surprising.

EDIT: added lvqcl's 3.99.3 compile.
Title: LAME: different compilers producing significantly different bitstreams
Post by: C.R.Helmrich on 2012-01-29 01:10:42
Indeed. How was the following done, if I may ask?
Quote
possible divide-by-zero exception should be fixed

I think doing this (or not doing this?) via modification of floating-point registers controlling exceptions, different compilers might produce different results. But I'm not an expert on this.

Chris
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-01-29 11:00:23
It seems that the relevant changes are somewhere in quantize.c: http://lame.cvs.sourceforge.net/viewvc/lam...athrev=lame3_99 (http://lame.cvs.sourceforge.net/viewvc/lame/lame/libmp3lame/quantize_pvt.c?sortby=date&r1=1.169&r2=1.169.2.1&pathrev=lame3_99)

[font= "Courier New"]*pxmin++ = xmin;[/font]  ->  [font= "Courier New"]*pxmin++ = Max(xmin, 1e-20f);[/font] etc.
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-29 22:02:01
It seems that the relevant changes are somewhere in quantize.c:


I ran a test similar as that run by Alex B, except with a sampling of files from my FLAC library, and only encoded at -V2, and found similar results. Unlike Alex, I did find numerous cases where the RareWares 3.99.4 produced higher bitrate (larger) files than 3.99.3.

What I don't understand about this explanation is that in my tests your compiles of 3.99.3 and 3.99.4 produced essentially the same bitrate in the output, unlike the RareWares compiles of the same releases. And in nearly all cases the bitrates were lower than those produced by either RareWares version.

Some examples (all at -V2)

Code: [Select]
Katia Lebeque - Rhapsody in Blue.mp3
RareWares LAME 3.99.4  196 kbps
RareWares LAME 3.99.3  190 kbps
lvcql's   LAME 3.99.4  178 kbps
lvcql's   LAME 3.99.3  178 kbps

The Black Keys - Set You Free.mp3
RareWares LAME 3.99.4  186 kbps
RareWares LAME 3.99.3  202 kbps
lvcql's   LAME 3.99.4  185 kbps
lvcql's   LAME 3.99.3  185 kbps

Yngwie Malmsteen - Leviathan.mp3
RareWares LAME 3.99.4  189 kbps
RareWares LAME 3.99.3  187 kbps
lvcql's   LAME 3.99.4  185 kbps
lvcql's   LAME 3.99.3  185 kbps
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-30 11:42:08
Sorry, guys, there was a compiler option error on my part.  New 32 bit compiles uploaded that should correct this. These will also revert the apparent bit differences, I believe.
Title: LAME: different compilers producing significantly different bitstreams
Post by: halb27 on 2012-01-30 13:54:22
Everything's fine now. Exactly the same average bitrate for 3.99.3 and 3.99.4 using -V0, -V2, and -V5 on my test set.
Sorry I thought there were changes in the source code.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-30 14:11:40
Everything's fine now. Exactly the same average bitrate for 3.99.3 and 3.99.4 using -V0, -V2, and -V5 on my test set.
Sorry I thought there were changes in the source code.

Thanks for the confirmation, and sorry to be the cause of confusion!!
Title: LAME: different compilers producing significantly different bitstreams
Post by: godrick on 2012-01-30 14:56:05
Does the nature of the compiler error require users to reconvert any files that used the previous 3.99.4 compiled version, or is the audio quality unaffected?
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-30 15:01:43
Does the nature of the compiler error require users to reconvert any files that used the previous 3.99.4 compiled version, or is the audio quality unaffected?

There was a small difference in bit allocation which I would very much doubt is in any way audible but I would recommend you test a couple of tracks to determine whether you can detect any difference.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-30 16:16:59
Thanks John.

The new 32-bit exe compile seems to produce identical bitrates with the 3.99.3 compile from the previous Rarewares "main bundle" (I tested only the Listz sample at -V1, -V5 and -V8). Actually, at -V5 both versions produced identical MP3 data. At -V8 and -V1 the resulting files were not exactly the same.

Regarding my test sample, I am still curious about the rather big difference between the Rarewares and ivqcl's compile:

-V1: 246 vs 207 kbps
-V5: 119 vs 97 kbps
-V8: 102 vs 84 kbps
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-30 17:01:13
Thanks John.

The new 32-bit exe compile seems to produce identical bitrates with the 3.99.3 compile from the previous Rarewares "main bundle" (I tested only the Listz sample at -V1, -V5 and -V8). Actually, at -V5 both versions produced identical MP3 data. At -V8 and -V1 the resulting files were not exactly the same.

Regarding my test sample, I am still curious about the rather big difference between the Rarewares and ivqcl's compile:

-V1: 246 vs 207 kbps
-V5: 119 vs 97 kbps
-V8: 102 vs 84 kbps

Hmmm, I am aware that there are differences between VC9/VC10/ICL compiles in terms of the resulting bitrate, but those discrepancies do seem rather larger than I would have expected. Having said that, I can't offer any other explanation either! I did just check that I had the correct 3.99.4 release code and I do, so that's not a possibility either. If anyone else has any thoughts, let's hear them, please.
Title: LAME: different compilers producing significantly different bitstreams
Post by: robert on 2012-01-30 17:16:28
Thanks John.

The new 32-bit exe compile seems to produce identical bitrates with the 3.99.3 compile from the previous Rarewares "main bundle" (I tested only the Listz sample at -V1, -V5 and -V8). Actually, at -V5 both versions produced identical MP3 data. At -V8 and -V1 the resulting files were not exactly the same.

Regarding my test sample, I am still curious about the rather big difference between the Rarewares and ivqcl's compile:

-V1: 246 vs 207 kbps
-V5: 119 vs 97 kbps
-V8: 102 vs 84 kbps

I suspect it has something to do with LAME's usage of libsndfile.
Alex, can you please decode your testsample with foobar first and feed it into LAME without libsndfile support?
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-30 17:36:37
I don't think libsndfile is involved. I used foobar2000 as a frontend. The encoders received decoded PCM through STDIN.

Here is an example of fb2k's log:
Code: [Select]
CLI encoder: lame.exe
Destination file: F:\Test\lame\Liszt.mp3
Encoder stream format: 44100Hz / 2ch / 16bps
Command line: "C:\Soft\LAME\lame.exe" -S --noreplaygain -V 5 - "Liszt.mp3"
Working folder: F:\Test\lame\
Encoder process still running, waiting...
Encoder process terminated cleanly.
Track converted successfully.
Total encoding time: 0:01.109, 27.05x realtime


EDIT

Actually, I think libsndfile is included only in the special rarewares compile. I tested the first, "main", bundle.
Title: LAME: different compilers producing significantly different bitstreams
Post by: mixminus1 on 2012-01-30 20:49:21
I can confirm AlexB's findings vis a vis the bitrate differences between the Rarewares compile of 3.99.4 and lvqcl's on quieter/"easier" to encode material.

I chose two tracks, one with a FLAC -8 bitrate of 461 kb/s ("Shaolin Spirit (duo)", acoustic guitar), and one with a FLAC -8 bitrate of 1105 kb/s ("Rolodex Propaganda", rock).

All encodes were done from the command line in Windows XP SP3 (running on a 3.1 GHz i3-2100) from WAVs:

Code: [Select]
Shaolin Spirit (duo)
                                    V2        V5
3.99.4-20120130 (Rarewares)      170.3      104.8
3.99.4 lvqcl                      159.8      95.1

Rolodex Propaganda
                                    V2        V5
3.99.4-20120130 (Rarewares)      200.1      135.8
3.99.4 lvqcl                      199.3      135.6
I couldn't detect any audible differences between the Rarewares and lvqcl encodes at either -V setting (although neither were transparent at -V5 with "Rolodex Propaganda", but not too suprising...punk-ish rock with open hi-hats  ).

Edit: After confirming that 30s samples of the above tracks demonstrated the same bitrate differences/similarities, I added them to AlexB's previously-linked upload (http://www.hydrogenaudio.org/forums/index.php?showtopic=93149&st=0&gopid=784265&#entry784265) thread.
Title: LAME: different compilers producing significantly different bitstreams
Post by: DigitalMan on 2012-01-30 23:17:23
Assume 64 bit compile is unaffected?  Not at machine; can't test ATM.
Title: LAME: different compilers producing significantly different bitstreams
Post by: mixminus1 on 2012-01-30 23:47:38
No, latest 64-bit version of 3.99.4 (20120125) from Rarewares has higher bitrates on the quieter track, as well, although not quite as much as the 32-bit version

Encodes done on same machine, but under Win7 64-bit, again from the command line, and I've included the bitrates from the previous test:

Code: [Select]
Shaolin Spirit (duo)

3.99.4 Rarewares 32-bit @ V2: 170.3 kbps
3.99.4 Rarewares 64-bit @ V2: 168.7 kbps
3.99.4 lvqcl 32-bit @ V2: 159.8 kbps

3.99.4 Rarewares 32-bit @ V5: 104.8 kbps
3.99.4 Rarewares 64-bit @ V5: 103.7 kbps
3.99.4 lvqcl 32-bit @ V5: 95.1

Rolodex Propaganda

3.99.4 Rarewares 32-bit @ V2: 200.1 kbps
3.99.4 Rarewares 64-bit @ V2: 200.0 kbps
3.99.4 lvqcl 32-bit @ V2: 199.3 kbps

3.99.4 Rarewares 32-bit @ V5: 135.8 kbps
3.99.4 Rarewares 64-bit @ V5: 135.8 kbps
3.99.4 lvqcl 32-bit @ V5: 135.6 kbps
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-31 08:35:21
No, latest 64-bit version of 3.99.4 (20120125) from Rarewares has higher bitrates on the quieter track, as well, although not quite as much as the 32-bit version

Encodes done on same machine, but under Win7 64-bit, again from the command line, and I've included the bitrates from the previous test:

...

Those differences are entirely within what I would expect as the 64 bit compiles do not use the nasm code, although the VC10 numbers still differ more than I would expect. I'll compile using VC10 later and see what differences I get.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-31 16:43:50
OK, done some testing comparing the Rarewares 32 bit compile (ICL12.1) against my own VC10 32 bit compile (not ICL). Results are quite interesting (I think!!):

Code: [Select]
Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation.  All rights reserved.

F:\testdir>lame-vc9 -V 3 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 17960 Hz - 18494 Hz
Encoding 14.wav to 14.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=3)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 14177/14177 (100%)|    0:10/    0:10|    0:10/    0:10|  36.978x|    0:00
 32 [    1] *
 40 [    0]
 48 [  18] %
 56 [  630] %%%*****
 64 [ 2172] %%%%%%%%%%%%**************
 80 [  78] %
 96 [  28] %
112 [  39] %
128 [ 1081] %************
160 [ 5740] %%%%%%%%%%%%%%%%%%%%%%%%%%%%***************************************
192 [ 2469] %%%%%%%%%%%%%%%%%%***********
224 [  454] %%%***
256 [ 1036] %%%%%%%******
320 [  431] %%%***
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  156.9      44.7  55.3        85.4  7.9  6.7
Writing LAME Tag...done
ReplayGain: 0.0dB

F:\testdir>lame-vc10 -V 3 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 17960 Hz - 18494 Hz
Encoding 14.wav to 14.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=3)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 14177/14177 (100%)|    0:10/    0:10|    0:10/    0:10|  35.327x|    0:00
 32 [    4] %
 40 [  35] %
 48 [ 1022] %%%%%*******
 56 [ 1640] %%%%%%%%%***********
 64 [  184] %%*
 80 [  25] %
 96 [  36] %
112 [  30] %
128 [ 1050] %************
160 [ 5768] %%%%%%%%%%%%%%%%%%%%%%%%%%%%***************************************
192 [ 2477] %%%%%%%%%%%%%%%%%%%**********
224 [  443] %%%***
256 [ 1032] %%%%%%%*****
320 [  431] %%%***
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  155.0      44.7  55.3        85.4  7.9  6.7
Writing LAME Tag...done
ReplayGain: 0.0dB

F:\testdir>lame-vc9 -V 5 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding 14.wav to 14.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=5)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 14177/14177 (100%)|    0:09/    0:09|    0:09/    0:09|  38.541x|    0:00
 32 [  23] %
 40 [ 1025] %%%*********
 48 [ 1755] %%%%%%**************
 56 [  86] %
 64 [  28] %
 80 [  42] %
 96 [  302] %***
112 [ 1986] %%********************
128 [ 6081] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%**************************************
160 [ 1267] %%%%%%%%%*****
192 [  684] %%%*****
224 [  500] %%%***
256 [  366] %%***
320 [  32] %
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  121.0      34.6  65.4        85.4  7.9  6.7
Writing LAME Tag...done
ReplayGain: 0.0dB

F:\testdir>lame-vc10 -V 5 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding 14.wav to 14.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=5)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 14177/14177 (100%)|    0:10/    0:10|    0:10/    0:10|  36.358x|    0:00
 32 [ 2843] %%%%%%%%************************
 40 [  40] %
 48 [    8] %
 56 [  16] %
 64 [  32] %
 80 [  37] %
 96 [  316] %***
112 [ 1977] %%********************
128 [ 6070] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%**************************************
160 [ 1265] %%%%%%%%%*****
192 [  669] %%%*****
224 [  510] %%%***
256 [  357] %%**
320 [  37] %
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  118.2      34.6  65.4        85.4  7.9  6.7
Writing LAME Tag...done
ReplayGain: 0.0dB

F:\testdir>lame-vc9 -V 7 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Resampling:  input 44.1 kHz  output 32 kHz
polyphase lowpass filter disabled
Encoding 14.wav to 14.mp3
Encoding as 32 kHz j-stereo MPEG-1 Layer III VBR(q=5.63333)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 10287/10287 (100%)|    0:09/    0:09|    0:09/    0:09|  37.801x|    0:00
 32 [ 1184] %%%%%%%******************
 40 [  905] %%%%%%*************
 48 [  20] %
 56 [  16] %
 64 [  71] %*
 80 [ 1216] %%************************
 96 [ 3250] %%%%%%%%%%%%%%%%%%%%%%%%%%*****************************************
112 [ 1811] %%%%%%%%%%%%%%%%%%%%%%****************
128 [  783] %%%%%%%%*********
160 [  627] %%%%%********
192 [  230] %%***
224 [  152] %%**
256 [  21] %
320 [    1] *
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  95.0      36.1  63.9        86.1  7.8  6.2
Writing LAME Tag...done
ReplayGain: +0.1dB

F:\testdir>lame-vc10 -V 7 14.wav 14.mp3
LAME 3.99.4 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE (ASM used), SSE2
Resampling:  input 44.1 kHz  output 32 kHz
polyphase lowpass filter disabled
Encoding 14.wav to 14.mp3
Encoding as 32 kHz j-stereo MPEG-1 Layer III VBR(q=5.63333)
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 10287/10287 (100%)|    0:10/    0:10|    0:10/    0:10|  35.066x|    0:00
 32 [ 2096] %%%%%%%%%%%%%*******************************
 40 [  12] %
 48 [  19] %
 56 [  11] %
 64 [  70] %*
 80 [ 1217] %%************************
 96 [ 3254] %%%%%%%%%%%%%%%%%%%%%%%%%%*****************************************
112 [ 1820] %%%%%%%%%%%%%%%%%%%%%%****************
128 [  755] %%%%%%%%********
160 [  634] %%%%%*********
192 [  220] %%***
224 [  157] %%**
256 [  21] %
320 [    1] *
-------------------------------------------------------------------------------
  kbps        LR    MS  %    long switch short %
  94.1      36.1  63.9        86.1  7.8  6.2
Writing LAME Tag...done
ReplayGain: +0.1dB

F:\testdir>
This track is neither particularly quiet, nor loud, but what is interesting is that the very quiet parts seem to attract a higher bit allocation with the Intel compile than with the VC10 compile. So, I'm guessing that with particularly quiet tracks, this accounts for the larger difference between the different compiles.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Pretentiousman on 2012-01-31 16:58:12
Is it possible for an executable from one compiler to produce a difference in quality or sound than another executable from different compiler? It seems that a difference in bitrate is possible. I am curious. I am no programmer btw.
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-01-31 17:05:10
2 seconds of Liszt.wav (LAME -V1):

original track, then my compile, then msvs2010 debug compile, then compile from Rarewares.

(http://i.imgur.com/xDSlN.png)


And, differences between original and encoded files: my / my msvs2010 debug / Rarewares compile.

(http://i.imgur.com/Ek32Q.png)

bitrates,  kbps: 207(my,msvs) / 214(debug) / 246(rarewares).
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-01-31 17:12:08
Is it possible for an executable from one compiler to produce a difference in quality or sound than another executable from different compiler? It seems that a difference in bitrate is possible. I am curious. I am no programmer btw.

A question that has been asked many times.  The short answer is that I don't believe anyone has claimed to hear any verifiable discernable differences and that is all that matters.
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-31 17:12:17
Is it possible for an executable from one compiler to produce a difference in quality or sound than another executable from different compiler? It seems that a difference in bitrate is possible.


Which, IMO, is no less concerning than if they produced differences in sound quality.


The short answer is that I don't believe anyone has claimed to hear any verifiable discernable differences and that is all that matters.


It's not all that matters.

The whole point of a lossy codec using VBR is to produce the lowest possible bitrate at a given SQ level. Perhaps it's naïve, but I would expect all compiles on all platforms to produce the same encoding results.
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-01-31 17:38:48
Perhaps it's naïve, but I would expect all compiles on all platforms to produce the same encoding results.


LAME uses floating point calculations, so it is highly unlikely.
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-31 17:45:24
But to what degree in terms of overall bitrate? These results seem to be all over the map.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Alex B on 2012-01-31 17:58:19
Here's how EncSpot Pro sees the differences in the -V5 encoded "Liszt" samples.

lvqcl's compile:
(http://i224.photobucket.com/albums/dd212/AB2K/ha/lvgcl_distribution.png)

The fixed Rarewares compile:
(http://i224.photobucket.com/albums/dd212/AB2K/ha/rw_distribution.png)

Bit graph (bitrate/time), both compiles in an animated gif:
(http://i224.photobucket.com/albums/dd212/AB2K/ha/ivqcl_vs_rw.gif)

I have no idea if the differences can be audible.
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-01-31 20:52:53
Perhaps it's naïve, but I would expect all compiles on all platforms to produce the same encoding results.


LAME uses floating point calculations, so it is highly unlikely.


Please... Given the same CPU, floating point calculations are quite deterministic.

The whole story smells like LAME is too careless about floating overflows and underflows.
Title: LAME: different compilers producing significantly different bitstreams
Post by: C.R.Helmrich on 2012-01-31 22:01:04
Please... Given the same CPU, floating point calculations are quite deterministic.

I wish... well, yes, maybe the calculations are deterministic, but the order of calculations (which can vary between compilers according to optimization algorithms) can have a significant influence on the result. But of course the observations discussed here are extreme.

Chris
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-01-31 22:36:20
Order is defined by precedence and compiler rarely dares to go against left-to-right as specified by the C standard.
I still bet on undeflows of the type that 3.99.4 was trying to paper over with max(x, epsilon). This type of bugfixing is dangerous.
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-01-31 23:21:49
Here's some more data at different VBR quality levels with the fixed RareWares 32-bit compile of 3.99.4. Perhaps it's a little more real world than the 30 second Liszt piano solo (which is included), as all of these tracks are at least several minutes long. These bitrates are more consistent, although lvqcl's compile consistently comes out ahead. The Thelonious Monk track is also a piano solo piece. Interestingly, it shows probably the biggest difference between the two compiles after the Liszt sample.

(My apologies if this is too much data for the forums. It doesn't appear that I can attach a simple text log.) db1989: You can paste the log into a codebox (rather than between code tags) or upload it to our dedicated Uploads subforum. Editing according to the latter:

Code: [Select]
Aerosmith - Sweet Emotion.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   269   228   190   168   149   129   113   100 83
3.99.4 (lvqcl)   264   223   188   168   149   129   112 99 83

Allman Brothers - Melissa.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   263   231   202   184   164   142   124   112 90
3.99.4 (lvqcl)   259   227   198   184   164   142   123   111 90

Bill Evans - Polka Dots And Moonbeams.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   243   207   178   164   144   124   107 97 80
3.99.4 (lvqcl)   243   205   176   164   144   124   105 96 80

Black Keys - Set You Free.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   259   222   186   165   146   128   115 98 79
3.99.4 (lvqcl)   258   219   185   165   146   128   115 98 79

Bob Marley - Redemption Song.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   241   211   175   151   129   107 93 82 72
3.99.4 (lvqcl)   227   197   167   151   128   103 86 78 72

Count Basie - Lester Leaps In.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   280   244   199   180   158   135   120   107 93
3.99.4 (lvqcl)   257   228   196   179   156   130   112   102 93

Cowboy Junkies - Mining For Gold.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   249   208   176   159   139   120   104 93 77
3.99.4 (lvqcl)   248   206   174   159   139   119   102 93 77

Del McCoury - Rambling Boy.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   275   238   204   177   155   131   113   104 90
3.99.4 (lvqcl)   266   225   192   177   155   130   110   102 90

Dizzy Gillespie - Manteca.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   266   229   198   181   162   139   121   109 94
3.99.4 (lvqcl)   262   223   195   181   162   139   119   108 94

Ella Fitzgerald - Anything Goes.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   187   162   142   125   112 97 86 75 63
3.99.4 (lvqcl)   187   159   137   123   109 92 79 71 60

George Baker Selection - Little Green Bag.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   268   236   206   190   171   150   133   120 98
3.99.4 (lvqcl)   267   235   205   190   171   150   133   120 98

George Jones - She Thinks I Still Care.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   258   209   179   164   146   127   111   102 87
3.99.4 (lvqcl)   258   206   177   164   146   126   109   102 87

Jack Johnson - Better Together.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   264   229   195   172   152   130   114   103 87
3.99.4 (lvqcl)   262   226   192   172   152   130   113   103 87

Jimmy Cliff - Ska All Over The World.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   258   228   195   179   160   134   115   106 93
3.99.4 (lvqcl)   248   217   190   179   160   133   113   105 93

John Coltrane - Giant Steps.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   291   241   205   187   167   145   127   121   102
3.99.4 (lvqcl)   291   236   199   187   167   145   126   120   102

Johnny Winter - Mojo Boogie.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   275   238   200   169   149   128   112 97 79
3.99.4 (lvqcl)   259   221   187   169   149   128   110 96 79

Kanye West - Gold Digger.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   249   214   182   160   144   127   112 97 77
3.99.4 (lvqcl)   247   211   176   159   143   125   108 96 77

Katia Lebeque & the Cleveland Orchestra - Rhapsody in Blue.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   267   234   196   161   140   116   102 91 86
3.99.4 (lvqcl)   247   210   178   159   135   108 91 83 82

Leo Kottke - Jesus Maria.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   240   210   185   165   145   121   103 96 87
3.99.4 (lvqcl)   236   204   177   165   144   118 98 94 86

Liszt.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   283   245   183   156   136   119   111   103   101
3.99.4 (lvqcl)   257   207   172   149   125 97 82 76 83

Lotus - Sea Of Tranquility.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   231   196   166   145   128   110 96 86 73
3.99.4 (lvqcl)   228   191   160   142   124   103 88 79 69

Marcos Valle - Para Os Filhos De Abraao.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   261   222   187   167   148   128   114   101 82
3.99.4 (lvqcl)   260   220   186   167   148   128   113   101 81

Nirvana - Smells Like Teen Spirit.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   260   227   193   169   148   128   114 97 79
3.99.4 (lvqcl)   258   223   190   169   148   127   113 96 79

Ottmar Liebert - August Moon.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   300   255   222   202   182   158   136   130   107
3.99.4 (lvqcl)   298   246   216   202   181   157   134   129   107

Peter Tosh - Get Up, Stand Up.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   281   251   220   200   178   152   134   124   107
3.99.4 (lvqcl)   276   246   216   200   177   151   131   123   106

Pointer Sisters - Fire.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   264   230   195   169   149   128   112   102 89
3.99.4 (lvqcl)   261   225   191   169   148   126   110   101 89

Psychedelic Furs - Love My Way.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   267   225   183   164   145   126   111 98 81
3.99.4 (lvqcl)   261   219   181   164   145   125   110 97 81

Rolling Stones - Street Fighting Man.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   270   235   206   192   172   148   123   112 90
3.99.4 (lvqcl)   259   231   204   192   171   147   119   112 90

Shirley Bassey - Moonraker.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   264   229   198   178   157   136   119   103 81
3.99.4 (lvqcl)   261   225   194   177   157   135   118   103 80

Smiths - Please, Please, Please, Let Me Get What I Want.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   271   246   217   195   173   150   133   105 78
3.99.4 (lvqcl)   271   246   217   195   173   150   132   105 78

Steely Dan - Black Friday.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   266   231   196   174   152   129   115   103 85
3.99.4 (lvqcl)   266   231   195   174   152   128   113   102 85

Stevie Ray Vaughan - The House Is Rockin'.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   262   231   201   170   150   130   115   101 83
3.99.4 (lvqcl)   261   229   199   170   150   130   115   100 83

Sublime - Badfish.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   280   242   204   182   161   139   123   113 94
3.99.4 (lvqcl)   275   237   201   182   161   139   122   113 94

Thelonious Monk - Ruby, My Dear.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   229   201   174   153   135   110 94 86 85
3.99.4 (lvqcl)   226   196   166   150   132   101 80 75 80

Tomita - Introduction And Dance Of The Firebird.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   250   225   197   165   141   113 97 86 81
3.99.4 (lvqcl)   236   209   182   164   139   107 88 79 78

U2 - Bullet The Blue Sky.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   256   224   192   168   148   127   113 99 79
3.99.4 (lvqcl)   255   222   190   168   148   127   113 99 79

Van Morrison - Moondance.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   259   225   193   174   155   133   116   105 87
3.99.4 (lvqcl)   254   218   188   174   155   133   114   105 87

Will Ackerman - Abide The Winter.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   255   230   200   168   143   113 95 87 80
3.99.4 (lvqcl)   244   215   186   167   141   108 88 82 78

Yngwie Malmsteen - Leviathan.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   271   228   189   167   146   127   112 96 81
3.99.4 (lvqcl)   268   222   185   166   146   126   111 96 81

Yo-Yo Ma - Boccherini - Cello Concerto No. 7 in G major, G480 I. Allegro.wav
-V0   -V1   -V2   -V3   -V4   -V5   -V6   -V7   -V8
3.99.4 (RareWares)   250   223   189   165   143   118   101 91 83
3.99.4 (lvqcl)   239   209   180   164   141   114 95 87 82
Title: LAME: different compilers producing significantly different bitstreams
Post by: saratoga on 2012-01-31 23:44:51
Perhaps it's naïve, but I would expect all compiles on all platforms to produce the same encoding results.


LAME uses floating point calculations, so it is highly unlikely.


Please... Given the same CPU, floating point calculations are quite deterministic.


Given the same CPU and the same binary, they usually are.  But across different platforms or different compilers, they are not. 

Order is defined by precedence and compiler rarely dares to go against left-to-right as specified by the C standard.


Its not that simple:

http://msdn.microsoft.com/en-us/library/aa...7(v=vs.71).aspx (http://msdn.microsoft.com/en-us/library/aa289157(v=vs.71).aspx)

c specifies operator precedence, but that does not strictly define order, only how a statement is parsed. Compilers still (often quite aggressively) reorder floating point calculations depending on the optimization level and compiler flags.  You can of course disable this, but the performance penalty can be quite large, particularly with vector extensions.   

When talking about different instructions sets, pretty much all bets are off.  Operations can be done at different precision and in different order. 
Title: LAME: different compilers producing significantly different bitstreams
Post by: nu774 on 2012-02-01 01:53:23
Code: [Select]
main()
{
    volatile double x = 53, y = x / 100.0 * 100.0;
    volatile int ny = x / 100.0 * 100.0;
    int nyy = y;
    printf("%g %d %d\n", y, ny, nyy);
}

In my environment, i686-w64-mingw32-gcc and cygwin gcc prints "53 52 53" (On the other hand, CL compiler of MSVC10 prints "53 53 53").
The difference between ny and nyy is only whether calculated value (x / 100.0 * 100.0) is once stored to a double variable y or not.
x86 architecture has fp register wider than double precision(64bit). Therefore, just a store/load can make such difference (introduced by rounding error).
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-02-01 03:23:07
54 52 53

(introduced by rounding error).



You should add 0.5 to achieve proper rounding with whatever compiler.
We need a proper investigation rather than brushing it under ABX rug.
Title: LAME: different compilers producing significantly different bitstreams
Post by: nu774 on 2012-02-01 03:45:10
You should add 0.5 to achieve proper rounding with whatever compiler.

Or, just use lrint() 
However, even if you use "proper rounding", it still remains the same that a simple load/store can change the value of floating point, at least on some architecture.
My point was, how operations (such as load/store) are used/ordered is beyond control of a programmer who programs in high level language such as C, and also varies with compilers or optimization settings or something.

We need a proper investigation rather than brushing it under ABX rug.

Agree with it.
Title: LAME: different compilers producing significantly different bitstreams
Post by: nu774 on 2012-02-01 10:42:19
We need a proper investigation rather than brushing it under ABX rug.

Agree with it.

O My English...
I don't know if it is in the range of expected result of floating point math error. If it is, I don't think investigation should necessarily be done.
Probably Lame dev can answer it.
Title: LAME: different compilers producing significantly different bitstreams
Post by: timcupery on 2012-02-02 02:56:16
We need a proper investigation rather than brushing it under ABX rug.

Very well-said. (not that we can require anyone to do an investigation - all of us LAME users are in debt to the devs as with anything open-source)
But marked differences in bitrate are weirdly striking.


What I wonder: if you ran the differing-bitrate files through mp3packer, would they come out with the same bitrate? i.e., are there wasted bits that can be compressed out? Worth checking at least, unless someone with knowledge of the innards of LAME can say that this wouldn't be the case.
I can run the respective files through mp3packer if anyone wants to send me the files.
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-02-02 15:56:09
Test signal: sine (-12 dBFS) + white noise (-N dBFS), where N = 3...150.

Here is a graph: MP3 bitrate as a function of N, for different compiles.

(http://i.imgur.com/S8DkS.png)
Title: LAME: different compilers producing significantly different bitstreams
Post by: halb27 on 2012-02-02 16:46:17
Looks like your MSVC10 compile behaves more reasonable - I guess the sine signal is still encoded fine.
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-02-02 17:13:30
Spectrograms of sine+noise (3 seconds from an mp3 file encoded with MSVS compile, then Debug compile, then ICL/Rarewares compile):

N=80:
(http://i.imgur.com/3n5XP.png)


N=90:
(http://i.imgur.com/3ZKfP.png)


N=95:
(http://i.imgur.com/YxZbD.png)


N=100:
(http://i.imgur.com/zNQfW.png)


N=110:
(http://i.imgur.com/ngFrU.png)
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-02-02 18:53:37
Spectrograms of sine+noise (3 seconds from an mp3 file encoded with MSVS compile, then Debug compile, then


Why does this junk keeps piling up in later seconds?
Could it be uninitialized variable somewhere that is properly initially set to zero by one compiler but not by the other?
Title: LAME: different compilers producing significantly different bitstreams
Post by: halb27 on 2012-02-02 19:27:51
Looks like it's the decision process for deciding upon 'digital silence' that is varying with compiler.

lvqcl, is the white noise inaudible for N=95?
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-02 19:35:28
Just for the record, Robert is looking at this issue and will be back with something for testing in the not too distant future.  In the meantime, the higher bitrate is not hurting quality but it may be spending unnecessary bits.
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-02-02 20:10:42
Just for the record, Robert is looking at this issue and will be back with something for testing in the not too distant future.  In the meantime, the higher bitrate is not hurting quality but it may be spending unnecessary bits.


It's somewhere in calc_xmin() (in quantize_pvt.c). Move this function to a new file and compile it with MSVC compiler, and the rest with ICC.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-02 22:09:24
...
It's somewhere in calc_xmin() (in quantize_pvt.c)....

So I believe, but I'll leave that to Robert.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Destroid on 2012-02-05 10:49:59
From the sidelines, I found this discussion of the FP rounding and/or compiler-related differences fascinating. Although this was the discussion started regarding LAME 3.99 release I was glad to have read-through it (just like a recent topic about layman's FFT explanation) and wanted to express my appreciation to those involved on the member and developers for sleuthing and posting their information. This is why HA has always rocked for me =)
Title: LAME: different compilers producing significantly different bitstreams
Post by: antman on 2012-02-07 03:08:24
Agreed Destroid.  This has been an interesting read.  I jumped back to find the start of the latest development.

And with that being said, maybe it's time to split the thread?  Little of this thread has been dedicated to the actual quality improvements/unimprovements of Lame 3.99.  It's been more about compiler optimizing and compiler output.
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-02-07 03:28:41
I'm surprised this thread wasn't split a long time ago. I can't imagine that 99% of users who might see this release announcement and  consider updating to 3.99 have either the time or the energy to read through well over 300 posts. I would expect some discussion of new 3.99.x releases and updated Rarewares compiles as they come out, but the minutiae in this thread really belongs in a tech forum.
Title: LAME: different compilers producing significantly different bitstreams
Post by: DARcode on 2012-02-07 13:15:14
The "minutiae" in this thread are actually useful information: the difference in bitrate produced by different compiles might have an impact on quality, still to be determined exactly, and the LAME header issues do have an impact on usability, I'm glad both discussions have been consolidated here, just learn to skip the parts not relevant to you, this isn't a forum for Joe Average anyway.

P.S.
Minutiae is plural, if you wanna show off your Latin at least do it properly.

EDIT: The P.S..
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-07 13:27:42
Robert is currently working on a solution that would make LAME more, or less, "compiler proof", or at least the variations between compilers would become inconsequential. Obviously some testing will be required when he has a solution that is 'fit for purpose' and HA will be the first to know.
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-02-07 15:24:44
Robert is currently working on a solution that would make LAME more, or less, "compiler proof", or at least the variations between compilers would become inconsequential. Obviously some testing will be required when he has a solution that is 'fit for purpose' and HA will be the first to know.


This implies that the exact piece of code in question has been identified. Please confirm that it is in quantize_pvt.c and maybe point to a more precise location.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-07 16:13:50
There is a test compile (32 bit) now available at: www.rarewares.org/files/mp3/lame3.99.5-Test.zip (http://www.rarewares.org/files/mp3/lame3.99.5-Test.zip)

While there is a small bit distribution difference between VC and ICL compiles, the final bitrate is the same on the files tested to date.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-07 16:21:37
This implies that the exact piece of code in question has been identified. Please confirm that it is in quantize_pvt.c and maybe point to a more precise location.

EDIT: See Robert's post, below.
Title: LAME: different compilers producing significantly different bitstreams
Post by: robert on 2012-02-07 16:38:10
This implies that the exact piece of code in question has been identified. Please confirm that it is in quantize_pvt.c and maybe point to a more precise location.

The code was quickly identified last week in vbrquantize.c, which was affected by floating point model fast math.

http://lame.cvs.sourceforge.net/viewvc/lam...amp;sortby=date (http://lame.cvs.sourceforge.net/viewvc/lame/lame/libmp3lame/vbrquantize.c?r1=1.141&r2=1.141.2.1&sortby=date) (line 436)
Title: LAME: different compilers producing significantly different bitstreams
Post by: apodtele on 2012-02-07 20:48:26
The code was quickly identified last week in vbrquantize.c, which was affected by floating point model fast math.

http://lame.cvs.sourceforge.net/viewvc/lam...amp;sortby=date (http://lame.cvs.sourceforge.net/viewvc/lame/lame/libmp3lame/vbrquantize.c?r1=1.141&r2=1.141.2.1&sortby=date) (line 436)


Just a couple of jazz albums to re-encode... It does not look like 3.98.4 had this problem, right?
Title: LAME: different compilers producing significantly different bitstreams
Post by: JJZolx on 2012-02-07 23:24:28
Here's that set of files again, encoded using the RareWares 32-bit LAME 3.95.5-test compile. The differences are very small now. lvqcl's compile still produces slightly smaller files, even at the lowest quality levels, but the differences in file size are generally only a fraction of a percent.

Code: [Select]
Aerosmith - Sweet Emotion.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        269  228  190  168  149  129  113  100    83
3.99.5-test (RareWares)  264  223  189  168  149  129  112    99    83
3.99.4 (lvqcl)            264  223  188  168  149  129  112    99    83

Allman Brothers - Melissa.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        263  231  202  184  164  142  124  112    90
3.99.5-test (RareWares)  260  227  199  184  164  142  123  111    90
3.99.4 (lvqcl)            259  227  198  184  164  142  123  111    90

Bill Evans - Polka Dots And Moonbeams.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        243  207  178  164  144  124  107    97    80
3.99.5-test (RareWares)  243  205  177  164  144  124  105    96    80
3.99.4 (lvqcl)            243  205  176  164  144  124  105    96    80

Black Keys - Set You Free.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        259  222  186  165  146  128  115    98    79
3.99.5-test (RareWares)  258  219  185  165  146  128  115    98    79
3.99.4 (lvqcl)            258  219  185  165  146  128  115    98    79

Bob Marley - Redemption Song.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        241  211  175  151  129  107    93    82    72
3.99.5-test (RareWares)  228  197  167  151  128  103    86    78    72
3.99.4 (lvqcl)            227  197  167  151  128  103    86    78    72

Count Basie - Lester Leaps In.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        280  244  199  180  158  135  120  107    93
3.99.5-test (RareWares)  258  229  197  179  156  130  112  102    93
3.99.4 (lvqcl)            257  228  196  179  156  130  112  102    93

Cowboy Junkies - Mining For Gold.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        249  208  176  159  139  120  104    93    77
3.99.5-test (RareWares)  249  207  175  159  139  119  102    93    77
3.99.4 (lvqcl)            248  206  174  159  139  119  102    93    77

Del McCoury - Rambling Boy.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        275  238  204  177  155  131  113  104    90
3.99.5-test (RareWares)  266  226  193  177  155  130  111  102    89
3.99.4 (lvqcl)            266  225  192  177  155  130  110  102    90

Dizzy Gillespie - Manteca.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        266  229  198  181  162  139  121  109    94
3.99.5-test (RareWares)  263  224  196  181  162  139  119  108    94
3.99.4 (lvqcl)            262  223  195  181  162  139  119  108    94

Ella Fitzgerald - Anything Goes.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        187  162  142  125  112    97    86    75    63
3.99.5-test (RareWares)  187  159  137  123  109    92    79    71    60
3.99.4 (lvqcl)            187  159  137  123  109    92    79    71    60

George Baker Selection - Little Green Bag.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        268  236  206  190  171  150  133  120    98
3.99.5-test (RareWares)  268  235  205  190  171  150  133  120    98
3.99.4 (lvqcl)            267  235  205  190  171  150  133  120    98

George Jones - She Thinks I Still Care.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        258  209  179  164  146  127  111  102    87
3.99.5-test (RareWares)  259  207  177  164  146  126  109  102    87
3.99.4 (lvqcl)            258  206  177  164  146  126  109  102    87

Jack Johnson - Better Together.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        264  229  195  172  152  130  114  103    87
3.99.5-test (RareWares)  263  227  193  172  152  130  113  103    87
3.99.4 (lvqcl)            262  226  192  172  152  130  113  103    87

Jimmy Cliff - Ska All Over The World.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        258  228  195  179  160  134  115  106    93
3.99.5-test (RareWares)  249  218  191  179  160  133  113  105    93
3.99.4 (lvqcl)            248  217  190  179  160  133  113  105    93

John Coltrane - Giant Steps.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        291  241  205  187  167  145  127  121  102
3.99.5-test (RareWares)  292  238  201  187  167  145  126  121  102
3.99.4 (lvqcl)            291  236  199  187  167  145  126  120  102

Johnny Winter - Mojo Boogie.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        275  238  200  169  149  128  112    97    79
3.99.5-test (RareWares)  260  221  187  169  149  128  110    96    79
3.99.4 (lvqcl)            259  221  187  169  149  128  110    96    79

Kanye West - Gold Digger.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        249  214  182  160  144  127  112    97    77
3.99.5-test (RareWares)  249  213  178  159  143  125  109    96    77
3.99.4 (lvqcl)            247  211  176  159  143  125  108    96    77

Katia Lebeque & the Cleveland Orchestra - Rhapsody in Blue.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        267  234  196  161  140  116  102    91    86
3.99.5-test (RareWares)  247  210  178  159  135  108    91    83    82
3.99.4 (lvqcl)            247  210  178  159  135  108    91    83    82

Leo Kottke - Jesus Maria.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        240  210  185  165  145  121  103    96    87
3.99.5-test (RareWares)  236  204  178  165  144  118    98    94    86
3.99.4 (lvqcl)            236  204  177  165  144  118    98    94    86

Liszt.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        283  245  183  156  136  119  111  103  101
3.99.5-test (RareWares)  257  208  172  149  125    97    82    76    83
3.99.4 (lvqcl)            257  207  172  149  125    97    82    76    83

Lotus - Sea Of Tranquility.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        231  196  166  145  128  110    96    86    73
3.99.5-test (RareWares)  229  192  160  142  124  102    88    79    69
3.99.4 (lvqcl)            228  191  160  142  124  103    88    79    69

Marcos Valle - Para Os Filhos De Abraao.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        261  222  187  167  148  128  114  101    82
3.99.5-test (RareWares)  261  221  186  167  148  128  113  101    81
3.99.4 (lvqcl)            260  220  186  167  148  128  113  101    81

Nirvana - Smells Like Teen Spirit.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        260  227  193  169  148  128  114    97    79
3.99.5-test (RareWares)  259  224  191  169  148  127  113    96    79
3.99.4 (lvqcl)            258  223  190  169  148  127  113    96    79

Ottmar Liebert - August Moon.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        300  255  222  202  182  158  136  130  107
3.99.5-test (RareWares)  299  248  218  202  181  157  134  129  107
3.99.4 (lvqcl)            298  246  216  202  181  157  134  129  107

Peter Tosh - Get Up, Stand Up.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        281  251  220  200  178  152  134  124  107
3.99.5-test (RareWares)  277  247  217  201  178  151  131  124  107
3.99.4 (lvqcl)            276  246  216  200  177  151  131  123  106

Pointer Sisters - Fire.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        264  230  195  169  149  128  112  102    89
3.99.5-test (RareWares)  261  226  192  169  148  126  110  101    89
3.99.4 (lvqcl)            261  225  191  169  148  126  110  101    89

Psychedelic Furs - Love My Way.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        267  225  183  164  145  126  111    98    81
3.99.5-test (RareWares)  262  220  182  164  145  125  110    98    81
3.99.4 (lvqcl)            261  219  181  164  145  125  110    97    81

Rolling Stones - Street Fighting Man.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        270  235  206  192  172  148  123  112    90
3.99.5-test (RareWares)  259  232  205  192  171  148  119  112    90
3.99.4 (lvqcl)            259  231  204  192  171  147  119  112    90

Shirley Bassey - Moonraker.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        264  229  198  178  157  136  119  103    81
3.99.5-test (RareWares)  261  225  194  177  157  135  118  103    80
3.99.4 (lvqcl)            261  225  194  177  157  135  118  103    80

Smiths - Please, Please, Please, Let Me Get What I Want.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        271  246  217  195  173  150  133  105    78
3.99.5-test (RareWares)  271  246  217  195  173  150  132  105    78
3.99.4 (lvqcl)            271  246  217  195  173  150  132  105    78

Steely Dan - Black Friday.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        266  231  196  174  152  129  115  103    85
3.99.5-test (RareWares)  266  231  196  174  152  128  113  102    85
3.99.4 (lvqcl)            266  231  195  174  152  128  113  102    85

Stevie Ray Vaughan - The House Is Rockin'.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        262  231  201  170  150  130  115  101    83
3.99.5-test (RareWares)  261  230  200  170  150  130  115  100    83
3.99.4 (lvqcl)            261  229  199  170  150  130  115  100    83

Sublime - Badfish.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        280  242  204  182  161  139  123  113    94
3.99.5-test (RareWares)  276  237  202  182  161  139  122  113    94
3.99.4 (lvqcl)            275  237  201  182  161  139  122  113    94

Thelonious Monk - Ruby, My Dear.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        229  201  174  153  135  110    94    86    85
3.99.5-test (RareWares)  226  196  166  150  132  100    80    75    80
3.99.4 (lvqcl)            226  196  166  150  132  101    80    75    80

Tomita - Introduction And Dance Of The Firebird.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        250  225  197  165  141  113    97    86    81
3.99.5-test (RareWares)  237  209  182  164  139  107    88    80    78
3.99.4 (lvqcl)            236  209  182  164  139  107    88    79    78

U2 - Bullet The Blue Sky.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        256  224  192  168  148  127  113    99    79
3.99.5-test (RareWares)  255  222  190  168  148  127  113    99    79
3.99.4 (lvqcl)            255  222  190  168  148  127  113    99    79

Van Morrison - Moondance.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        259  225  193  174  155  133  116  105    87
3.99.5-test (RareWares)  255  218  189  174  155  133  114  105    87
3.99.4 (lvqcl)            254  218  188  174  155  133  114  105    87

Will Ackerman - Abide The Winter.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        255  230  200  168  143  113    95    87    80
3.99.5-test (RareWares)  244  216  186  167  142  108    88    82    78
3.99.4 (lvqcl)            244  215  186  167  141  108    88    82    78

Yngwie Malmsteen - Leviathan.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        271  228  189  167  146  127  112    96    81
3.99.5-test (RareWares)  268  222  185  166  146  126  111    96    81
3.99.4 (lvqcl)            268  222  185  166  146  126  111    96    81

Yo-Yo Ma - Boccherini - Cello Concerto No. 7 in G major, G480 I. Allegro.wav
                          -V0  -V1  -V2  -V3  -V4  -V5  -V6  -V7  -V8
3.99.4 (RareWares)        250  223  189  165  143  118  101    91    83
3.99.5-test (RareWares)  239  209  180  164  141  114    95    88    82
3.99.4 (lvqcl)            239  209  180  164  141  114    95    87    82
Title: LAME: different compilers producing significantly different bitstreams
Post by: halb27 on 2012-02-09 09:56:14
I checked Alex B's Liszt sample, and 3.99.5 behaves nearly exactly as lvql's MSV10 compile bitratewise (208 kbps for-V1, and 97 kbps for -V5).
I also checked the bitrate distribution for -V5, and the Encspot result looks pretty much the same Alex B gave us.

Thank you, robert.

Oops, sorry, I din't see JJZolx had the sample in his test.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Kilu on 2012-02-10 16:46:22
This thread was an interesting read.

So just to be clear, this is now resolved? Should I grab the 3.99.5-test from RareWares, or wait for 3.99.5 proper?

Another thing I'm wondering, I saw some encoding speed differences earlier in the original thread this was split from.
Was there encoding speed differences with 3.99.5-test and 3.99.4 (lvqcl), how about 32bit vs 64bit builds?
Or was that stuff just completely unrelated?
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-10 17:27:34
This thread was an interesting read.

So just to be clear, this is now resolved? Should I grab the 3.99.5-test from RareWares, or wait for 3.99.5 proper?

Another thing I'm wondering, I saw some encoding speed differences earlier in the original thread this was split from.
Was there encoding speed differences with 3.99.5-test and 3.99.4 (lvqcl), how about 32bit vs 64bit builds?
Or was that stuff just completely unrelated?

I would be inclined to wait for the full release, if I were you. There could be further changes until then, but if you feel inclined to test, please go ahead. 

The speed stuff was unrelated, IRRC.
Title: LAME: different compilers producing significantly different bitstreams
Post by: antman on 2012-02-11 01:37:41
Kilu, in summary, the encoding speed differences were between 3.98 and 3.99.  3.99 encoded slower than 3.98.  Through compiler optimizing 3.99's speed was brought up to par with 3.98.

Sure there is going to be encoding speed differences between 3.99.5-test (ICL), 3.99.4 (MSVS2010), 32 and 64-bit builds, but that's not what's on trial right now.  What's on trial right now is the output between all.
Title: LAME: different compilers producing significantly different bitstreams
Post by: Kilu on 2012-02-11 02:25:27
Alrighty, thanks guys.
I think I'll wait for the full release since I'm not in any kind of hurry, might as well wait a bit.
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-13 09:21:18
3.99.5 test 2 on the link below fixes the decoding regression:

http://www.rarewares.org/files/mp3/lame3.99.5-Test2.zip (http://www.rarewares.org/files/mp3/lame3.99.5-Test2.zip)

Title: LAME: different compilers producing significantly different bitstreams
Post by: psycho on 2012-02-15 20:54:12
3.99.5 is out, compiles anyone? (http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/history.html?revision=HEAD)
Title: LAME: different compilers producing significantly different bitstreams
Post by: lvqcl on 2012-02-15 21:06:27
There's still no mention of 3.99.5 at http://sourceforge.net/projects/lame/files/lame/3.99/ (http://sourceforge.net/projects/lame/files/lame/3.99/) and in the changelog (http://lame.cvs.sourceforge.net/viewvc/lame/lame/ChangeLog?revision=1.26.2.5&pathrev=lame3_99)
Title: LAME: different compilers producing significantly different bitstreams
Post by: john33 on 2012-02-15 22:28:54
3.99.5 is out, compiles anyone? (http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/history.html?revision=HEAD)

That log is incomplete as the release has not yet been made. It's work in progress.