Ignore:
Timestamp:
02/08/07 14:29:39 (17 years ago)
Author:
r2d
Message:
  • added sv7 to sv8 conversion utility (still work to do, but able to convert basic files)
  • moved libmpcenc functions prototypes in libmpcenc.h
  • removed global variables from encode_sv7 (put in mpc_encoder_t)
File:
1 edited

Legend:

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

    r201 r203  
    534534
    535535        // Where is scf{R,L} [0...2] initialized ???
    536         scfL = SCF_Index_L [Band];
    537         scfR = SCF_Index_R [Band];
     536        scfL = e->SCF_Index_L [Band];
     537                scfR = e->SCF_Index_R [Band];
    538538        if (tmp_L [0] > 0.) scfL [0] = IFLOORF (-12.6f * LOG10 (tmp_L [0]) + 57.8945021823f );
    539539        if (tmp_L [1] > 0.) scfL [1] = IFLOORF (-12.6f * LOG10 (tmp_L [1]) + 57.8945021823f );
     
    669669                const int*              resR,
    670670                const SubbandFloatTyp*  subx,
    671                 SubbandQuantTyp*        subq )
     671                                mpc_quantizer*          subq )
    672672{
    673673    static float  errorL [32] [36 + MAX_NS_ORDER];
     
    15001500    PCMDataTyp       Main;                      // contains PCM data for 1600 samples
    15011501    SubbandFloatTyp  X [32];                    // Subbandsamples as float()
    1502     SubbandQuantTyp  Q [32];                    // Subband samples after quantization
    15031502    wave_t           Wave;                      // contains WAV-files arguments
    15041503    mpc_uint64_t        AllSamplesRead   =    0;   // overall read Samples per channel
     
    15181517    // initialize tables which must be initialized once and only once
    15191518
    1520         m.SCF_Index_L = (int*) SCF_Index_L;
    1521         m.SCF_Index_R = (int*) SCF_Index_R;
     1519        m.SCF_Index_L = (int*) e.SCF_Index_L;
     1520        m.SCF_Index_R = (int*) e.SCF_Index_R;
    15221521
    15231522        Init_Psychoakustik (&m);
     
    16721671        // you only get null samples at the output of the filterbank when the last frame contains zeroes
    16731672
    1674         memset ( Res_L, 0, sizeof Res_L );
    1675         memset ( Res_R, 0, sizeof Res_R );
     1673                memset ( e.Res_L, 0, sizeof e.Res_L );
     1674                memset ( e.Res_R, 0, sizeof e.Res_R );
    16761675
    16771676        if ( !Silence  ||  !OldSilence ) {
     
    16811680                                RaiseSMR (&m, m.Max_Band, &SMR );                            // Minimum-operation on SBRs (full bandwidth)
    16821681                        if ( m.MS_Channelmode > 0 )
    1683                                 MS_LR_Entscheidung ( m.Max_Band, MS_Flag, &SMR, X );      // Selection of M/S- or L/R-Coding
     1682                                MS_LR_Entscheidung ( m.Max_Band, e.MS_Flag, &SMR, X );      // Selection of M/S- or L/R-Coding
    16841683                        SCF_Extraktion (&m, &e, m.Max_Band, X );                             // Extraction of the scalefactors and normalization of the subband samples
    16851684            TransientenCalc ( Transient, TransientL, TransientR );
    16861685                        if ( m.NS_Order > 0 ) {
    1687                                 NS_Analyse (&m, m.Max_Band, MS_Flag, SMR, Transient );                  // calculate possible ANS-Filter and the expected gain
     1686                                NS_Analyse (&m, m.Max_Band, e.MS_Flag, SMR, Transient );                  // calculate possible ANS-Filter and the expected gain
    16881687            }
    16891688
    1690             Allocate ( m.Max_Band, Res_L, X[0].L, SCF_Index_L[0], m.SNR_comp_L, SMR.L, Power_L, Transient , m.PNS );   // allocate bits for left + right channel
    1691                         Allocate ( m.Max_Band, Res_R, X[0].R, SCF_Index_R[0], m.SNR_comp_R, SMR.R, Power_R, Transient , m.PNS );
    1692 
    1693                         Quantisierung (&m, m.Max_Band, Res_L, Res_R, X, Q );             // quantize samples
     1689                        Allocate ( m.Max_Band, e.Res_L, X[0].L, e.SCF_Index_L[0], m.SNR_comp_L, SMR.L, Power_L, Transient , m.PNS );   // allocate bits for left + right channel
     1690                        Allocate ( m.Max_Band, e.Res_R, X[0].R, e.SCF_Index_R[0], m.SNR_comp_R, SMR.R, Power_R, Transient , m.PNS );
     1691
     1692                        Quantisierung (&m, m.Max_Band, e.Res_L, e.Res_R, X, e.Q );             // quantize samples
    16941693        }
    16951694
    16961695        OldSilence      = Silence;
    1697         writeBitstream_SV8 ( &e, m.Max_Band, Q ); // write SV8-Bitstream
     1696        writeBitstream_SV8 ( &e, m.Max_Band); // write SV8-Bitstream
    16981697
    16991698        if ( (int)(time (NULL) - T) >= 0 ) {                            // output
Note: See TracChangeset for help on using the changeset viewer.