1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-04 18:29:59 +02:00

Simplify rms(): merge a few operations in the same statement

Originally committed as revision 14639 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2008-08-06 05:11:46 +00:00
parent b4d46e8c06
commit 2f1cad0e58

View File

@ -154,7 +154,7 @@ static unsigned int rms(const int *data)
{
int i;
unsigned int res = 0x10000;
int b = 0;
int b = 10;
for (i=0; i < 10; i++) {
res = (((0x1000000 - data[i]*data[i]) >> 12) * res) >> 12;
@ -168,10 +168,7 @@ static unsigned int rms(const int *data)
}
}
res = t_sqrt(res);
res >>= (b + 10);
return res;
return t_sqrt(res) >> b;
}
static void do_output_subblock(RA144Context *ractx, const uint16_t *lpc_coefs,