Commit 3deaaa4a authored by vitor's avatar vitor

Simplify: move division by constant off the loop


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15402 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 51fc0323
...@@ -88,10 +88,11 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) ...@@ -88,10 +88,11 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
sum = av_clipf(sum, 0, 60); sum = av_clipf(sum, 0, 60);
/* block 48 of G.728 spec */ /* 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++) 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; sum = scalar_product_float(buffer, buffer, 5) / 5;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment