I´m trying to code a tool which is able to remove one channel from a stereo file without reencoding. The output file should be an joint-stereo file at the same bitrate. My idea is to remove one channel, couple as much subbands as possible (0-16) and copy all left data. Unfortunately the ISO specs are very confusing, same as the dist10 code, but that´s what I could find out:
header (32 Bit)
bit allocation - channel/subband (?)
scfsi - channel/subband (2 Bit each)
scalefactor - channel/subband (6 Bit each)
samples - channel/subband (?)
allocation table:
MPEG-1:
0 = samplerate = 48 and bitrate/ch >= 56 (sblimit 27)
or bitrate/ch >= 56 and <= 80
1 = samplerate not 48 and bitrate/ch >= 96 (sblimit 30)
2 = samplerate not 32 and bitrate/ch <= 48 (sblimit 8)
else 3 (sblimit 12)
MPEG-2:
always 4 (sblimit 30)
My question are:
-Bit allocation: this part contains information how the subbands are compressed, right? The size is different for each subband and can be read somehow from the allocation tables, right? It is stored channel[0]/subband[0], channel[0]/subband[1] .... channel[1]/subband[sblimit]. How is it stored for joint-stereo? The first channel normal and then only not-coupled subbands, or the the couples at the beginning and then the first channel, second channel? Also how to interpret the values? It can be that some subbands are not stored, so I now have to work with a new sblimit for each channel, right?
-scfsi: This values are fixed to 2 bits, how they stored with joint stereo (same question as for bit allocation). I now have to work with new sblimit?
-scalefac: Same questions as for scfsi
-samples: This is most difficult part, I don´t anything about that. I need to know how many values are stored, how and at what size.
Is there already something wrong in what I found out? can someone please help me? Thank you very much!