# HG changeset patch # User vitor # Date 1217999506 0 # Node ID f516e1101167614d8101716b63b2a00611a104f8 # Parent 8f89a4d76a71d86524a6c6fdf93acc481744396b Simplify rms(): merge a few operations in the same statement diff -r 8f89a4d76a71 -r f516e1101167 ra144.c --- a/ra144.c Wed Aug 06 05:08:48 2008 +0000 +++ b/ra144.c Wed Aug 06 05:11:46 2008 +0000 @@ -154,7 +154,7 @@ { 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 @@ } } - 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,