The calculation of needed bits for the side channel with the one
needed for the mid channel is a step back. I get ringing artefacts
on even highest possible VBR settings. A while ago I played 
with such things, but never got satisfactory results.
ms_ener_ratio was introduced to decide between stereo and
MS stereo. And if you take a look at its calculation, you will
see that it is some kind of sloppy.
Nevertheless mono encoding is broken I think, because in loop.c 

  /*******************************************************************
   * how many bits would we use of it?
   *******************************************************************/
  for (gr = 0; gr < mode_gr; gr++) {
    int num_chan=2;
    /* determine quality based on mid channel only */
    if (reduce_sidechannel) num_chan=1;  

the number of channels is hard coded to stereo. And for nearly
mono sounds the following will allocate for the side channel 
twice the bits as for the mid channel, instead of reducing it.

  if (reduce_sidechannel) {
    /* number of bits needed was found for MID channel above.  Use formula
     * (fixed bitrate code) to set the side channel bits */
    for (gr = 0; gr < mode_gr; gr++) {
      double fac = .33*(.5-ms_ener_ratio[gr])/.5;
      save_bits[gr][1]=((1+fac)/(1-fac))*save_bits[gr][0];
      used_bits += save_bits[gr][1];
    }
  }

Robert
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to