Changeset 66 for mppenc/branches/r2d/src/mppenc.c
- Timestamp:
- 10/02/06 23:20:16 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mppenc/branches/r2d/src/mppenc.c
r65 r66 680 680 memcpy ( errorL [Band], errorL[Band] + 36, MAX_NS_ORDER * sizeof (**errorL) ); 681 681 } 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 ); 683 683 memcpy ( errorL [Band], errorL[Band] + 36, MAX_NS_ORDER * sizeof (**errorL) ); 684 684 } … … 691 691 memcpy ( errorR [Band], errorR [Band] + 36, MAX_NS_ORDER * sizeof (**errorL) ); 692 692 } 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); 694 694 memcpy ( errorR [Band], errorR [Band] + 36, MAX_NS_ORDER * sizeof (**errorL) ); 695 695 } … … 1542 1542 1543 1543 1544 void 1545 OverdriveReport ( mpc_encoder_t * e ) 1544 void OverdriveReport ( mpc_encoder_t * e ) 1546 1545 { 1547 1546 if ( e->Overflows > 0 ) { // report internal clippings … … 1603 1602 Init_ANS (); 1604 1603 Klemm (); 1604 1605 e.dword = 0; 1606 e.filled = 32; 1607 e.Zaehler = 0; 1608 e.BufferedBits = 0; 1609 e.Overflows = 0; 1605 1610 1606 1611 // initialize PCM-data … … 1734 1739 } 1735 1740 1741 e.MS_Channelmode = m.MS_Channelmode; 1736 1742 e.BufferedBits = 0; 1737 1743 LastValidFrame = (SamplesInWAVE + BLOCK - 1) / BLOCK; 1738 1744 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 ); 1740 1746 1741 1747 // initialize timer … … 1824 1830 OldSilence = Silence; 1825 1831 OldBufferedBits = e.BufferedBits; 1826 GetBitstreamPos ( & bitstreampos );1827 WriteBits ( 0, 20 ); // Reserve 20 bits for jump-information1828 WriteBitstream_SV7 ( m.Max_Band, Q ); // write SV7-Bitstream1829 WriteBitsAt ( (Uint32_t)(e.BufferedBits - OldBufferedBits - 20), 20, bitstreampos ); // Patch 20 bits for jump-information to the right value1832 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 1830 1836 1831 1837 if ( (Int)(time (NULL) - T) >= 0 ) { // output … … 1865 1871 1866 1872 if ( N == LastValidFrame - 1 ) { 1867 WriteBits ( LastValidSamples, 11 );1873 WriteBits ( &e, LastValidSamples, 11 ); 1868 1874 // fprintf ( stderr, "\nGltige Samples im letzten Frame: %4u \n", LastValidSamples ); 1869 1875 } … … 1875 1881 1876 1882 // write the last incomplete word to buffer, so it's written during the next flush 1877 FinishBitstream( );1883 FinishBitstream(&e); 1878 1884 ShowProgress (&m, SamplesInWAVE, SamplesInWAVE, e.BufferedBits ); 1879 1885
Note: See TracChangeset
for help on using the changeset viewer.