Changeset 18 for branches/zorg/src/requant.c
- Timestamp:
- 09/16/06 16:33:17 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/zorg/src/requant.c
r10 r18 71 71 72 72 #ifdef MPC_FIXED_POINT 73 static mpc_uint 32_t find_shift(double fval)73 static mpc_uint8_t find_shift(double fval) 74 74 { 75 75 mpc_int64_t val = (mpc_int64_t)fval; … … 78 78 while(val) {val>>=1;ptr++;} 79 79 80 return ptr > 31 ? 0 : 31 - ptr;80 return ptr > 31 ? 0 : (mpc_uint8_t) 31 - ptr; 81 81 } 82 82 #endif … … 84 84 /* F U N C T I O N S */ 85 85 86 #define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));86 #define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = find_shift(X)); 87 87 88 88 void 89 89 mpc_decoder_scale_output(mpc_decoder *d, double factor) 90 90 { 91 mpc_ int32_tn;92 double f1;93 double f2;91 mpc_uint8_t n; 92 double f1; 93 double f2; 94 94 #ifndef MPC_FIXED_POINT 95 95 factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1)); … … 107 107 108 108 for ( n = 1; n <= 128; n++ ) { 109 SET_SCF( (unsigned char)(1+n),f1);110 SET_SCF( (unsigned char)(1-n),f2);109 SET_SCF(1+n,f1); 110 SET_SCF(1-n,f2); 111 111 f1 *= 0.83298066476582673961; 112 112 f2 *= 1/0.83298066476582673961;
Note: See TracChangeset
for help on using the changeset viewer.