Ignore:
Timestamp:
12/18/06 20:52:54 (18 years ago)
Author:
r2d
Message:
  • changed entropy coding (all huffman tables are canonical)
  • scalefactor range now -6..121, no more clipping
  • compression gain is 2.36% on the test file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/mppenc/mppenc.c

    r149 r161  
    546546        if (tmp_R [2] > 0.) scfR [2] = IFLOORF (-12.6f * LOG10 (tmp_R [2]) + 57.8945021823f );
    547547
    548         // restriction to SCF_Index = 0...63, make note of the internal overflow
     548        // restriction to SCF_Index = -6...121, make note of the internal overflow
    549549        warnL = warnR = 0;
    550         if (scfL[0] & ~63) { if (scfL[0] < 0) { if (XLevel==0) scfL[0] = 0, warnL = 1; } else scfL[0] = 63; }
    551         if (scfL[1] & ~63) { if (scfL[1] < 0) { if (XLevel==0) scfL[1] = 0, warnL = 1; } else scfL[1] = 63; }
    552         if (scfL[2] & ~63) { if (scfL[2] < 0) { if (XLevel==0) scfL[2] = 0, warnL = 1; } else scfL[2] = 63; }
    553         if (scfR[0] & ~63) { if (scfR[0] < 0) { if (XLevel==0) scfR[0] = 0, warnR = 1; } else scfR[0] = 63; }
    554         if (scfR[1] & ~63) { if (scfR[1] < 0) { if (XLevel==0) scfR[1] = 0, warnR = 1; } else scfR[1] = 63; }
    555         if (scfR[2] & ~63) { if (scfR[2] < 0) { if (XLevel==0) scfR[2] = 0, warnR = 1; } else scfR[2] = 63; }
     550                for( n = 0; n < 3; n++){
     551                        if (scfL[n] < -6) scfL[n] = -6, warnL = 1;
     552                        if (scfL[n] > 121) scfL[n] = 121, warnL = 1;
     553                        if (scfR[n] < -6) scfR[n] = -6, warnR = 1;
     554                        if (scfR[n] > 121) scfR[n] = 121, warnR = 1;
     555                }
    556556
    557557        // save old values for compensation calculation
     
    14621462    cw  &=  ~0x300;
    14631463        _asm { fldcw cw };
    1464 #else
    1465     ;
    14661464#endif
    14671465}
     
    17181716
    17191717        OldSilence      = Silence;
    1720         WriteBitstream_SV7 ( &e, m.Max_Band, Q );                                                // write SV7-Bitstream
     1718        writeBitstream_SV8 ( &e, m.Max_Band, Q );                                                // write SV7-Bitstream
    17211719
    17221720        if ( (Int)(time (NULL) - T) >= 0 ) {                            // output
Note: See TracChangeset for help on using the changeset viewer.