QUOTE(alonsag @ Sep 15 2005, 09:29 AM)
I read the ISO file but did not understand how 6 bit can contain the numbers that the ISO11172-3. table of scalefactor have .
The answer is:
QUOTE(ISO11172-3 Chapter 2.4.3.3 Layer II)
Scalefactor decoding
For every subband with a nonzero bit allocation the coded scalefactor for that subband are read from the bitstream. The number of coded scalefactors and the part of the subband samples they refer to is defined by scfsi[sb]. The 6 bits of a coded scalefactor should be interpreted as an unsigned integer index to 3-Annex B, Table 3-B.1 "LAYER I, II SCALEFACTORS". This table gives the scalefactor by which the relevant subband samples should be multiplied after requantization.
So, if you write a program that modifies the coded (6bit) scalefactors in the bitstream you have to keep in mind that table of scalefactors which is part of the decoder.
The conclusions for your program are:
-all scalefactors of a frame must be modified (added or subtracted) by the same amount
-to
increase the volume of the decoded samples, you have to
decrease the coded (6bit) scalefactors (and vice versa)
-the changes can be applied in discrete steps only (integer
n), which result in a factor of 2^(-
n/3)
-example: add
n=1 -> factor=2^(-1/3)=0,7937 (volume decrease)
-example: add
n=-1 -> factor=2^(1/3)=1,2599 (volume increase)
-example: add
n=-4 -> factor=2^(4/3)=2,5198 (volume increase)
Hope this helps a bit.