Hi all.

I found a bug of MS threshold adjustment, but I don't have a paper
describing the algorithm(*). so I want to someone to check this.

(*) Johnston & Ferreira 1992 ICASSP paper

current LAME calculates mld as

    /* setup stereo demasking thresholds */
    /* formula reverse enginerred from plot in paper */
    for ( sb = 0; sb < SBPSY_s; sb++ ) {
      FLOAT8 mld = 1.25*(1-cos(PI*sb/SBPSY_s))-2.5;
      gfc->mld_s[sb] = pow(10.0,mld);
    }
    for ( sb = 0; sb < SBPSY_l; sb++ ) {
      FLOAT8 mld = 1.25*(1-cos(PI*sb/SBPSY_l))-2.5;
      gfc->mld_l[sb] = pow(10.0,mld);
    }

but this is clearly bug, I think. it does not think the sampling frequency.
see the FAAC code, we should bark value of sb, not sb itself.

the code should be like below

    /* setup stereo demasking thresholds */
    /* formula reverse enginerred from plot in paper */
    for ( sb = 0; sb < SBPSY_s; sb++ ) {
      FLOAT8 bark = freq2bark(sfreq * scale_band.s[sb] / 576);
      FLOAT8 mld = 1.25*(1-cos(PI*Min(bark, 15.5)/15.5))-2.5;
      gfc->mld_s[sb] = pow(10.0,mld);
    }
    for ( sb = 0; sb < SBPSY_l; sb++ ) {
      FLOAT8 bark = freq2bark(sfreq * scale_band.l[sb] / 576);
      FLOAT8 mld = 1.25*(1-cos(PI*Min(bark, 15.5)/15.5))-2.5;
      gfc->mld_l[sb] = pow(10.0,mld);
    }

does it fit the paper's algorithm ?
--- 
Takehiro TOMINAGA // may the source be with you!
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to