Changeset 159 for libmpc/branches/r2d/libmpcenc
- Timestamp:
- 12/10/06 19:48:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/libmpcenc/quant.c
r156 r159 163 163 float signal = 1.e-30f; 164 164 float error = 1.e-30f; 165 float sig, err;165 float err, sig; 166 166 167 167 // Summation of the absolute power and the quadratic error 168 168 for ( k = 0; k < 36; k++ ) { 169 err= input[k] * NoiseInjectionCompensation1D [res];170 sig = mpc_nearbyintf(err * fac) * invfac - err;171 172 error += sig * sig;173 signal += err * err;169 sig = input[k] * NoiseInjectionCompensation1D [res]; 170 err = mpc_nearbyintf(sig * fac) * invfac - sig; 171 172 error += err * err; 173 signal += sig * sig; 174 174 } 175 175 … … 185 185 float fac = A [res]; 186 186 float invfac = C [res]; 187 float signal, error, ret, sig, err;187 float signal, error, ret, err, sig; 188 188 189 189 // Summation of the absolute power and the quadratic error … … 191 191 signal = error = 1.e-30f; 192 192 for ( ; k < 12; k++ ) { 193 err= input[k] * NoiseInjectionCompensation1D [res];194 sig = mpc_nearbyintf(err * fac) * invfac - err;195 196 error += sig * sig;197 signal += err * err;198 } 199 sig= signal > error ? error / (SNRcomp * signal) : error / signal;200 ret = sig;193 sig = input[k] * NoiseInjectionCompensation1D [res]; 194 err = mpc_nearbyintf(sig * fac) * invfac - sig; 195 196 error += err * err; 197 signal += sig * sig; 198 } 199 err = signal > error ? error / (SNRcomp * signal) : error / signal; 200 ret = err; 201 201 signal = error = 1.e-30f; 202 202 for ( ; k < 24; k++ ) { 203 err= input[k] * NoiseInjectionCompensation1D [res];204 sig = mpc_nearbyintf(err * fac) * invfac - err;205 206 error += sig * sig;207 signal += err * err;208 } 209 sig= signal > error ? error / (SNRcomp * signal) : error / signal;210 ret = maxf(ret, sig);203 sig = input[k] * NoiseInjectionCompensation1D [res]; 204 err = mpc_nearbyintf(sig * fac) * invfac - sig; 205 206 error += err * err; 207 signal += sig * sig; 208 } 209 err = signal > error ? error / (SNRcomp * signal) : error / signal; 210 ret = maxf(ret, err); 211 211 212 212 signal = error = 1.e-30f; 213 213 for ( ; k < 36; k++ ) { 214 err= input[k] * NoiseInjectionCompensation1D [res];215 sig = mpc_nearbyintf(err * fac) * invfac - err;216 217 error += sig * sig;218 signal += err * err;219 } 220 sig= signal > error ? error / (SNRcomp * signal) : error / signal;221 ret = maxf(ret, sig);214 sig = input[k] * NoiseInjectionCompensation1D [res]; 215 err = mpc_nearbyintf(sig * fac) * invfac - sig; 216 217 error += err * err; 218 signal += sig * sig; 219 } 220 err = signal > error ? error / (SNRcomp * signal) : error / signal; 221 ret = maxf(ret, err); 222 222 223 223 return ret;
Note: See TracChangeset
for help on using the changeset viewer.