Skip to main content

Topic: LAME: different compilers producing significantly different bitstreams (Read 29330 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • mixminus1
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #25
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
"Not sure what the question is, but the answer is probably no."

  • john33
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #26
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.
  • Last Edit: 31 January, 2012, 03:37:00 AM by john33
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/

  • john33
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #27
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.
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/

LAME: different compilers producing significantly different bitstreams
Reply #28
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.
  • Last Edit: 31 January, 2012, 12:00:10 PM by Pretentiousman
I feel music enriches the soul.

  • lvqcl
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #29
2 seconds of Liszt.wav (LAME -V1):

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




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



bitrates,  kbps: 207(my,msvs) / 214(debug) / 246(rarewares).
  • Last Edit: 31 January, 2012, 12:10:40 PM by lvqcl

  • john33
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #30
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.
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/

  • JJZolx
  • [*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #31
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.
  • Last Edit: 31 January, 2012, 12:19:27 PM by JJZolx

  • lvqcl
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #32
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.

  • JJZolx
  • [*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #33
But to what degree in terms of overall bitrate? These results seem to be all over the map.

  • Alex B
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #34
Here's how EncSpot Pro sees the differences in the -V5 encoded "Liszt" samples.

lvqcl's compile:


The fixed Rarewares compile:


Bit graph (bitrate/time), both compiles in an animated gif:


I have no idea if the differences can be audible.
  • Last Edit: 31 January, 2012, 12:58:53 PM by Alex B

  • apodtele
  • [*]
LAME: different compilers producing significantly different bitstreams
Reply #35
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.

  • C.R.Helmrich
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #36
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
If I don't reply to your reply, it means I agree with you.

  • apodtele
  • [*]
LAME: different compilers producing significantly different bitstreams
Reply #37
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.
  • Last Edit: 07 February, 2012, 08:43:28 AM by db1989

  • JJZolx
  • [*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #38
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
  • Last Edit: 07 February, 2012, 08:39:58 AM by db1989

  • saratoga
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #39
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

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. 

  • nu774
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #40
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).

  • apodtele
  • [*]
LAME: different compilers producing significantly different bitstreams
Reply #41
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.

  • nu774
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #42
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.
  • Last Edit: 31 January, 2012, 10:53:49 PM by nu774

  • nu774
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #43
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.

  • timcupery
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #44
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.
God kills a kitten every time you encode with CBR 320

  • lvqcl
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #45
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.


  • halb27
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #46
Looks like your MSVC10 compile behaves more reasonable - I guess the sine signal is still encoded fine.
  • Last Edit: 02 February, 2012, 11:48:12 AM by halb27
lame3995o -Q1

  • lvqcl
  • [*][*][*][*][*]
  • Developer
LAME: different compilers producing significantly different bitstreams
Reply #47
Spectrograms of sine+noise (3 seconds from an mp3 file encoded with MSVS compile, then Debug compile, then ICL/Rarewares compile):

N=80:



N=90:



N=95:



N=100:



N=110:


  • apodtele
  • [*]
LAME: different compilers producing significantly different bitstreams
Reply #48
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?

  • halb27
  • [*][*][*][*][*]
LAME: different compilers producing significantly different bitstreams
Reply #49
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?
  • Last Edit: 02 February, 2012, 02:36:51 PM by halb27
lame3995o -Q1