No offence, but I think you're wasting your time. I seriously doubt that there could be any audible difference between TooLAME at 384 kbps (maybe even lower) and the thing you're trying to make.
In any case, claims like
Both encoders don´t provide the quality of MusePack. MusePack has a more advanced encoder, allowing much higher quality.
certainly demand for a proof (especially considering we're talking about bitrates around ~400 kbps).
I understand what you mean, I remember having quite bad results toolame, I just checked twolame and the first sample I´ve tried was easily ABXable (8/8) at 256kbps (and noticeable artifacts at 192kbps) and my ears are not "tuned" to hear encoding artifacts. By the way, I´m not talking about ~400kps bitrates, 384kbps is maximum for mp2 and it would be great if it could already sound transparent at 256kbps. High bitrate doesn´t imply high quality. Try blade at 320kbps for mp3, you will find a lot of killer samples that won´t sound transparent. You also cannot compare this bitrates of a old subband-coder with no entropy coding to modern mdct-based codecs (aac, vorbis or even mp3).
MusePack achieves this high quality because of a highly tuned encoder. Because MP2 is basically MusePack with several features missing it is possible to create mp2 bitstream of similar quality at higher bitrates using the MusePack encoder.
To musepack source:
I take it all back! I was completely wrong. It had nothing to do with "Psychoakustisches_Modell". MS needed to be disabled on two places and I noticed I was coding one quantizer wrong, making the sound quite awful (and I didn´t used that one in my fixed allocation table). So I basically got it, now I need to change the code to a more sophisticated CBR allocation, all the mp2 allocation tables etc.
At the moment there is just one question left: Combine Penalty. It´s about how many scalefactors are coded for each band in a frame (1, 2 or 3). Therefore it uses this magic table:
static const unsigned char Penalty [256] = {
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
0, 2, 5, 9, 15, 23, 36, 54, 79,116,169,246,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
};
#define P(new,old) Penalty [128 + (old) - (new)]
P is called with new and old scalefactor index and the value compared to combine penalty value of the profile (6 default for all profiles). MP2 uses different scalefactors so this table probably needs to be updated with new values. Unfortunately I have no idea what this values represent ans how this values have been calculated in the first place.