Changeset 220 for libmpc/branches/r2d/libmpcenc/encode_sv7.c
- Timestamp:
- 02/17/07 18:49:10 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/libmpcenc/encode_sv7.c
r212 r220 60 60 61 61 // writes replay gain info 62 staticvoid writeGainInfo ( mpc_encoder_t * e,63 64 65 66 62 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) 67 67 { 68 68 writeBits ( e, 1, 8 ); // version … … 80 80 const unsigned int SamplesCount, 81 81 const unsigned int SampleFreq, 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) 82 const unsigned int ChannelCount) 87 83 { 88 84 unsigned char tmp[10]; 89 int i, len = encodeSize(SamplesCount, (char *)tmp, MPC_FALSE); 90 91 len = encodeSize(len + 3, (char *)tmp, MPC_TRUE); 92 writeBits ( e, tmp[0] , 8 ); 85 int i, len; 93 86 94 87 writeBits ( e, 8, 8 ); // StreamVersion … … 96 89 len = encodeSize(SamplesCount, (char *)tmp, MPC_FALSE); 97 90 for( i = 0; i < len; i++) // nb of samples 98 writeBits ( e, tmp[i] , 8 ); 91 writeBits ( e, tmp[i], 8 ); 92 writeBits ( e, 0, 8 ); // nb of samples to skip at beginning 93 writeBits ( e, 0, 8 ); // nb of samples to skip at end 99 94 100 95 switch ( SampleFreq ) { … … 107 102 } 108 103 104 writeBits ( e, MaxBand - 1 , 5 ); // Bandwidth 109 105 writeBits ( e, ChannelCount - 1 , 4 ); // Channels 110 writeBits ( e, MaxBand - 1 , 5 ); // Bandwidth111 106 writeBits ( e, MS_on , 1 ); // MS-Coding Flag 112 107 writeBits ( e, FRAMES_PER_BLOCK_PWR >> 1, 3 ); // frames per block (log4 unit) 113 114 writeGainInfo(e, t_gain, t_peak, a_gain, a_peak);115 108 } 116 109 … … 121 114 const int version_major, 122 115 const int version_minor, 123 const int version_implement,124 116 const int version_build ) 125 117 { 126 118 writeBits ( e, (mpc_uint32_t)(profile * 8 + .5), 7 ); 127 119 writeBits ( e, PNS_on, 1 ); 128 writeBits ( e, version_major, 4);120 writeBits ( e, version_major, 8 ); 129 121 writeBits ( e, version_minor, 8 ); 130 writeBits ( e, version_implement, 4 );131 122 writeBits ( e, version_build, 8 ); 132 123 } … … 269 260 for ( n = 0; n < MaxBand; n++ ) { 270 261 int Res = e->Res_L[n]; 271 const unsignedint * q = e->Q[n].L;262 const int * q = e->Q[n].L; 272 263 static const unsigned int thres[] = {0, 0, 3, 7, 9, 1, 3, 4, 8}; 273 264 static const int HuffQ2_var[5*5*5] = … … 356 347 } 357 348 e->block_cnt++; 358 writeBlock(e, "A D", MPC_FALSE, 0);349 writeBlock(e, "AP", MPC_FALSE, 0); 359 350 } 360 351 }
Note: See TracChangeset
for help on using the changeset viewer.