Mercurial > libavcodec.hg
comparison ra288.c @ 7275:c5bcb9e4c5b2 libavcodec
Revert r14218. FFMAX is a macro, so
sum = FFMAX(1, scalar_product(...));
might calculate the scalar product twice, which is slower.
author | vitor |
---|---|
date | Mon, 14 Jul 2008 14:41:01 +0000 |
parents | 26818b216bfb |
children | bf3952d5e76c |
comparison
equal
deleted
inserted
replaced
7274:25914f8a9bb3 | 7275:c5bcb9e4c5b2 |
---|---|
67 sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ | 67 sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ |
68 | 68 |
69 for (x=0; x < 5; x++) | 69 for (x=0; x < 5; x++) |
70 buffer[x] = codetable[cb_coef][x] * sumsum; | 70 buffer[x] = codetable[cb_coef][x] * sumsum; |
71 | 71 |
72 sum = FFMAX(1, scalar_product_float(buffer, buffer, 5) / 5); | 72 sum = scalar_product_float(buffer, buffer, 5) / 5; |
73 | |
74 sum = FFMAX(sum, 1); | |
73 | 75 |
74 /* shift and store */ | 76 /* shift and store */ |
75 memmove(glob->lhist, glob->lhist - 1, 10 * sizeof(*glob->lhist)); | 77 memmove(glob->lhist, glob->lhist - 1, 10 * sizeof(*glob->lhist)); |
76 | 78 |
77 *glob->lhist = glob->history[glob->phase] = 10 * log10(sum) - 32; | 79 *glob->lhist = glob->history[glob->phase] = 10 * log10(sum) - 32; |