Ignore:
Timestamp:
11/11/06 18:19:44 (17 years ago)
Author:
r2d
Message:
  • added "EI" and "RG" blocks in output
  • updated "SI" block according to the spec
  • added "SE" block at the end of the stream
File:
1 edited

Legend:

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

    r78 r116  
    8080// writes SV8-header
    8181void
    82 WriteHeader_SV8 ( mpc_encoder_t*e,
     82writeStreamInfo ( mpc_encoder_t*e,
    8383                                  const unsigned int  MaxBand,
    8484                  const unsigned int  MS_on,
    8585                  const unsigned int  SamplesCount,
    86                   const unsigned int  StreamVersion,
    87                                   const unsigned int  PNS_on,
    8886                  const unsigned int  SampleFreq,
    8987                                  const unsigned int  ChannelCount)
     
    9391        int i;
    9492
    95     writeBits ( e, StreamVersion,  8 );    // StreamVersion
     93    writeBits ( e, 0x08,  8 );    // StreamVersion
    9694
    9795        for( i = 0; i < samplesCountLen; i++) // nb of samples
     
    109107        writeBits ( e, ChannelCount - 1  ,  4 );    // Channels
    110108        writeBits ( e, MaxBand - 1  ,  5 );    // Bandwidth
    111         writeBits ( e, 0            ,  1 );    // former IS-Flag (not supported anymore)
    112109        writeBits ( e, MS_on        ,  1 );    // MS-Coding Flag
    113         writeBits ( e, PNS_on       ,  1 );    // PNS flag
    114110        writeBits ( e, FRAMES_PER_BLOCK_PWR,  4 );    // frames per block (log2 unit)
     111}
     112
     113// writes encoder signature
     114void writeEncoderInfo ( mpc_encoder_t * e,
     115                                                const int profile,
     116                                                const int PNS_on,
     117                                                const int version_major,
     118                                                const int version_minor,
     119                                                const int version_implement,
     120                                                const int version_build )
     121{
     122        writeBits ( e, profile,  4 );
     123        writeBits ( e, PNS_on,  1 );
     124        writeBits ( e, 0,  3 ); // unused
     125        writeBits ( e, version_major,  4 );
     126        writeBits ( e, version_minor,  8 );
     127        writeBits ( e, version_implement,  4 );
     128        writeBits ( e, version_build,  8 );
     129}
     130
     131// writes replay gain info
     132void writeGainInfo ( mpc_encoder_t * e )
     133{
     134        writeBits ( e, 1,  8 ); // version
     135        writeBits ( e, 0,  16 ); // Title gain
     136        writeBits ( e, 0,  16 ); // Title peak
     137        writeBits ( e, 0,  16 ); // Album gain
     138        writeBits ( e, 0,  16 ); // Album peak
    115139}
    116140
Note: See TracChangeset for help on using the changeset viewer.