Ignore:
Timestamp:
02/13/07 11:40:24 (17 years ago)
Author:
r2d
Message:
  • changed replay gain implementation (using sv8 representation)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/libmpcenc/encode_sv7.c

    r204 r212  
    6060
    6161// writes replay gain info
    62 static void writeGainInfo ( mpc_encoder_t * e )
     62static void writeGainInfo ( mpc_encoder_t * e,
     63                                                        unsigned short t_gain,
     64                                                        unsigned short t_peak,
     65                                                        unsigned short a_gain,
     66                                                        unsigned short a_peak)
    6367{
    6468        writeBits ( e, 1,  8 ); // version
    65         writeBits ( e, 0,  16 ); // Title gain
    66         writeBits ( e, 0,  16 ); // Title peak
    67         writeBits ( e, 0,  16 ); // Album gain
    68         writeBits ( e, 0,  16 ); // Album peak
     69        writeBits ( e, t_gain,  16 ); // Title gain
     70        writeBits ( e, t_peak,  16 ); // Title peak
     71        writeBits ( e, a_gain,  16 ); // Album gain
     72        writeBits ( e, a_peak,  16 ); // Album peak
    6973}
    7074
     
    7680                  const unsigned int  SamplesCount,
    7781                  const unsigned int  SampleFreq,
    78                                   const unsigned int  ChannelCount)
     82                                  const unsigned int  ChannelCount,
     83                                  unsigned short t_gain,
     84                                  unsigned short t_peak,
     85                                  unsigned short a_gain,
     86                                  unsigned short a_peak)
    7987{
    8088        unsigned char tmp[10];
     
    104112        writeBits ( e, FRAMES_PER_BLOCK_PWR >> 1,  3 );    // frames per block (log4 unit)
    105113
    106         writeGainInfo(e);
     114        writeGainInfo(e, t_gain, t_peak, a_gain, a_peak);
    107115}
    108116
Note: See TracChangeset for help on using the changeset viewer.