> >
> For me the slopes of 25/-10 dB just means that s3_l should be -25 when the
> difference of bval is -1 and -10 when the difference of bval is 1. These are
> slopes around the current band of the calcul. With the formula you
> suggested, the slopes will be different.
Are you confusing db and energy? s3_l, as used in the code
needs to be in units of energy. The formula
if (tempy <= -60.0) s3_l[i][j] = 0.0;
else s3_l[i][j] = exp( (x + tempy)*LN_TO_LOG10 );
just convertes the value (x+tempy) from db to energy.
Thus it is (x_tempy) that should have a slope
of -10/25 db per bark. The formula I wrote
is correct:
if (j>=i) tempy = (bval_l[j] - bval_l[i])*(-10);
else tempy = (bval_l[j] - bval_l[i])*25;
> I applied the coefficients 3 and 1.5 to the layer II and had the impression
> the results were better(i can hear it and recognize the best file when both
> are played randomly) than with 1.05( advice for Toolame) but putting -10 and
> 25 as coefficients for tempy is "non-sense".
When you say using -10 and 25 gives nonsense, I think you are
confusing tempx and tempy? The values of -10 and 25 should be applied
to tempy not tempx, as shown above. They give very reasonable results
which agree with the curve in the Painter article: (taking x=0)
bark=2.764000 x+tempy = -82.920000
bark=2.388000 x+tempy = -71.640000
bark=2.029000 x+tempy = -60.870000
bark=1.684000 x+tempy = -50.520000
bark=1.287000 x+tempy = -38.610000
bark=0.831000 x+tempy = -24.930000
bark=0.404000 x+tempy = -12.120000
bark=0.000000 x+tempy = 0.000000
bark=-0.381000 x+tempy = -5.715000
bark=-0.730000 x+tempy = -10.950000
bark=-1.070000 x+tempy = -16.050000
bark=-1.438000 x+tempy = -21.570000
bark=-1.827000 x+tempy = -27.405000
bark=-2.202000 x+tempy = -33.030000
bark=-2.582000 x+tempy = -38.730000
bark=-2.973000 x+tempy = -44.595000
But setting (as the ISO doc suggests):
if (j>=i) tempy = (bval_l[j] - bval_l[i])*1.5;
else tempy = (bval_l[j] - bval_l[i])*3.0;
and x=0, produces very strange results:
bark=2.764000 x+tempy = -8.292000
bark=2.388000 x+tempy = -7.164000
bark=2.029000 x+tempy = -6.087000
bark=1.684000 x+tempy = -5.052000
bark=1.287000 x+tempy = -3.861000
bark=0.831000 x+tempy = -2.493000
bark=0.404000 x+tempy = -1.212000
bark=0.000000 x+tempy = 0.000000
bark=-0.381000 x+tempy = 0.571500
bark=-0.730000 x+tempy = 1.095000
bark=-1.070000 x+tempy = 1.605000
bark=-1.438000 x+tempy = 2.157000
bark=-1.827000 x+tempy = 2.740500
bark=-2.202000 x+tempy = 3.303000
bark=-2.582000 x+tempy = 3.873000
bark=-2.973000 x+tempy = 4.459500
For comparison, here are the results of the default layer 3 mode,
which uses: (note: tempx, not tempy)
if (j>=i) tempx = (bval_l[i] - bval_l[j])*3.0;
else tempx = (bval_l[i] - bval_l[j])*1.5;
bark=2.764000 x+tempy = -32.260872
bark=2.388000 x+tempy = -26.874085
bark=2.029000 x+tempy = -21.802845
bark=1.684000 x+tempy = -17.028470
bark=1.287000 x+tempy = -18.244921
bark=0.831000 x+tempy = -13.595852
bark=0.404000 x+tempy = -3.452440
bark=0.000000 x+tempy = -0.000000
bark=-0.381000 x+tempy = -10.261171
bark=-0.730000 x+tempy = -31.815638
bark=-1.070000 x+tempy = -55.686492
bark=-1.438000 x+tempy = -82.429881
bark=-1.827000 x+tempy = -111.094077
bark=-2.202000 x+tempy = -138.906188
bark=-2.582000 x+tempy = -167.186221
bark=-2.973000 x+tempy = -196.346120
These results also look buggy.
And here are the results for layer 2: (tempx = (bval_l[i] - bval_l[j])*1.05;)
bark=2.764000 x+tempy = -20.487805
bark=2.388000 x+tempy = -16.859270
bark=2.029000 x+tempy = -18.297550
bark=1.684000 x+tempy = -17.760714
bark=1.287000 x+tempy = -14.744852
bark=0.831000 x+tempy = -8.291966
bark=0.404000 x+tempy = -0.974892
bark=0.000000 x+tempy = -0.000000
bark=-0.381000 x+tempy = -1.181771
bark=-0.730000 x+tempy = -4.615616
bark=-1.070000 x+tempy = -9.927099
bark=-1.438000 x+tempy = -17.154755
bark=-1.827000 x+tempy = -25.764243
bark=-2.202000 x+tempy = -34.593342
bark=-2.582000 x+tempy = -43.849419
bark=-2.973000 x+tempy = -53.574543
Better than the layer 3 results, but the give much more spreading
then is justified by the Painter article.
Mark
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )