Ignore:
Timestamp:
10/02/06 23:20:16 (18 years ago)
Author:
r2d
Message:
  • mppenc compiles and runs, but output is not playing
File:
1 edited

Legend:

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

    r65 r66  
    680680                memcpy ( errorL [Band], errorL[Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
    681681            } else {
    682                 QuantizeSubband                 ( subq[Band].L, subx[Band].L, *resL, errorL [Band] );
     682                                QuantizeSubband                 ( subq[Band].L, subx[Band].L, *resL, errorL [Band], MAX_NS_ORDER );
    683683                memcpy ( errorL [Band], errorL[Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
    684684            }
     
    691691                memcpy ( errorR [Band], errorR [Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
    692692            } else {
    693                 QuantizeSubband                 ( subq[Band].R, subx[Band].R, *resR, errorL [Band] );
     693                                QuantizeSubband                 ( subq[Band].R, subx[Band].R, *resR, errorL [Band], MAX_NS_ORDER);
    694694                memcpy ( errorR [Band], errorR [Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
    695695            }
     
    15421542
    15431543
    1544 void
    1545                 OverdriveReport ( mpc_encoder_t * e )
     1544void OverdriveReport ( mpc_encoder_t * e )
    15461545{
    15471546        if ( e->Overflows > 0 ) {                                                // report internal clippings
     
    16031602        Init_ANS ();
    16041603        Klemm    ();
     1604
     1605        e.dword = 0;
     1606        e.filled = 32;
     1607        e.Zaehler = 0;
     1608        e.BufferedBits = 0;
     1609        e.Overflows = 0;
    16051610
    16061611    // initialize PCM-data
     
    17341739    }
    17351740
     1741        e.MS_Channelmode = m.MS_Channelmode;
    17361742    e.BufferedBits     = 0;
    17371743    LastValidFrame   = (SamplesInWAVE + BLOCK - 1) / BLOCK;
    17381744    LastValidSamples = (SamplesInWAVE + BLOCK - 1) - BLOCK * LastValidFrame + 1;
    1739     WriteHeader_SV7 ( m.Max_Band, MainQual, m.MS_Channelmode > 0, LastValidFrame, LastValidSamples, PNS > 0 ? 0x17 : 0x07, m.SampleFreq );
     1745    WriteHeader_SV7 ( &e, m.Max_Band, MainQual, m.MS_Channelmode > 0, LastValidFrame, LastValidSamples, PNS > 0 ? 0x17 : 0x07, m.SampleFreq );
    17401746
    17411747    // initialize timer
     
    18241830        OldSilence      = Silence;
    18251831        OldBufferedBits = e.BufferedBits;
    1826         GetBitstreamPos    ( &bitstreampos );
    1827         WriteBits          ( 0, 20 );                                                      // Reserve 20 bits for jump-information
    1828         WriteBitstream_SV7 ( m.Max_Band, Q );                                                // write SV7-Bitstream
    1829         WriteBitsAt        ( (Uint32_t)(e.BufferedBits - OldBufferedBits - 20), 20, bitstreampos );      // Patch 20 bits for jump-information to the right value
     1832        GetBitstreamPos    ( &e, &bitstreampos );
     1833        WriteBits          ( &e, 0, 20 );                                                      // Reserve 20 bits for jump-information
     1834        WriteBitstream_SV7 ( &e, m.Max_Band, Q );                                                // write SV7-Bitstream
     1835        WriteBitsAt        ( &e, (Uint32_t)(e.BufferedBits - OldBufferedBits - 20), 20, bitstreampos );      // Patch 20 bits for jump-information to the right value
    18301836
    18311837        if ( (Int)(time (NULL) - T) >= 0 ) {                            // output
     
    18651871
    18661872        if ( N == LastValidFrame - 1 ) {
    1867             WriteBits ( LastValidSamples, 11 );
     1873            WriteBits ( &e, LastValidSamples, 11 );
    18681874            // fprintf ( stderr, "\nGltige Samples im letzten Frame: %4u   \n", LastValidSamples );
    18691875        }
     
    18751881
    18761882    // write the last incomplete word to buffer, so it's written during the next flush
    1877     FinishBitstream();
     1883    FinishBitstream(&e);
    18781884    ShowProgress (&m, SamplesInWAVE, SamplesInWAVE, e.BufferedBits );
    18791885
Note: See TracChangeset for help on using the changeset viewer.