Changeset 64 for mppenc/branches/r2d/libmpcenc/encode_sv7.c
- Timestamp:
- 09/29/06 16:55:39 (18 years ago)
- Location:
- mppenc/branches/r2d/libmpcenc
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
mppenc/branches/r2d/libmpcenc/encode_sv7.c
r60 r64 18 18 */ 19 19 20 #include "mppenc.h" 20 #include <stdlib.h> 21 22 #include "libmpcenc.h" 23 24 // huffsv7.c 25 extern Huffman_t HuffHdr [10]; // contains tables for SV7-header 26 extern Huffman_t HuffSCFI [ 4]; // contains tables for SV7-scalefactor select 27 extern Huffman_t HuffDSCF [16]; // contains tables for SV7-scalefactor coding 28 extern const Huffman_t* HuffQ [2] [8]; // points to tables for SV7-sample coding 21 29 22 30 /* … … 55 63 const unsigned int Profile, 56 64 const unsigned int MS_on, 57 const Uint32_tTotalFrames,65 const mpc_uint32_t TotalFrames, 58 66 const unsigned int SamplesRest, 59 67 const unsigned int StreamVersion, … … 102 110 103 111 void 104 FinishBitstream ( void)105 { 106 Buffer [Zaehler++] =dword; // Assigning the "last" word112 FinishBitstream ( mpc_encoder* e ) 113 { 114 e->Buffer [e->Zaehler++] = e->dword; // Assigning the "last" word 107 115 } 108 116 … … 114 122 } \ 115 123 else { \ 116 if ( new < 0 ) new = 0, Overflows++;\124 if ( new < 0 ) new = 0, e->Overflows++; \ 117 125 WriteBits ( Table[15].Code, Table[15].Length ); \ 118 126 WriteBits ( (unsigned int)new, 6 ); \ … … 126 134 } \ 127 135 else { \ 128 if ( new < 0 ) new = 0, Overflows++;\136 if ( new < 0 ) new = 0, e->Overflows++; \ 129 137 WriteBits ( Table[15].Code, Table[15].Length ); \ 130 138 WriteBits ( (unsigned int)new, 6 ); \ … … 161 169 // formatting and writing SV7-bitstream for one frame 162 170 void 163 WriteBitstream_SV7 ( const int MaxBand, 171 WriteBitstream_SV7 ( mpc_encoder* e, 172 const int MaxBand, 164 173 const SubbandQuantTyp* Q ) 165 174 { … … 180 189 WriteBits ( (unsigned int)Res_L[0], 4 ); // subband 0 181 190 WriteBits ( (unsigned int)Res_R[0], 4 ); 182 if ( MS_Channelmode > 0 && !(Res_L[0]==0 && Res_R[0]==0) )191 if ( e->MS_Channelmode > 0 && !(Res_L[0]==0 && Res_R[0]==0) ) 183 192 WriteBits ( MS_Flag[0] , 1 ); 184 193 … … 205 214 WriteBits ( Res_R[n] , 4 ); 206 215 } 207 if ( MS_Channelmode > 0 && !(Res_L[n]==0 && Res_R[n]==0) )216 if ( e->MS_Channelmode > 0 && !(Res_L[n]==0 && Res_R[n]==0) ) 208 217 WriteBits ( MS_Flag[n], 1 ); 209 218 }
Note: See TracChangeset
for help on using the changeset viewer.