mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 21:20:41 +00:00
Simplify: move division by constant off the loop
Originally committed as revision 15402 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
4e240985d8
commit
a987a126fd
@ -88,10 +88,11 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
|
||||
sum = av_clipf(sum, 0, 60);
|
||||
|
||||
/* block 48 of G.728 spec */
|
||||
sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*gain */
|
||||
/* exp(sum * 0.1151292546497) == pow(10.0,sum/20) */
|
||||
sumsum = exp(sum * 0.1151292546497) * gain / 2048.;
|
||||
|
||||
for (i=0; i < 5; i++)
|
||||
buffer[i] = codetable[cb_coef][i] * sumsum * (1./2048.);
|
||||
buffer[i] = codetable[cb_coef][i] * sumsum;
|
||||
|
||||
sum = scalar_product_float(buffer, buffer, 5) / 5;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user