diff options
| author | Michael Giacomelli <giac2000@hotmail.com> | 2009-07-21 03:40:53 +0000 |
|---|---|---|
| committer | Michael Giacomelli <giac2000@hotmail.com> | 2009-07-21 03:40:53 +0000 |
| commit | c0622592162bc964b70a0615111dcea8ef86e52a (patch) | |
| tree | e86a0d9156bfef8619330b73ad7747cad4ab9c5d /apps/codecs | |
| parent | bebd3f735b0d04c76c5ad033cadf313efdbd91bb (diff) | |
| download | rockbox-c0622592162bc964b70a0615111dcea8ef86e52a.zip rockbox-c0622592162bc964b70a0615111dcea8ef86e52a.tar.gz rockbox-c0622592162bc964b70a0615111dcea8ef86e52a.tar.bz2 rockbox-c0622592162bc964b70a0615111dcea8ef86e52a.tar.xz | |
Rearrange loop to avoid one branch per iteration.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21988 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/libcook/cook_fixpoint.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/codecs/libcook/cook_fixpoint.h b/apps/codecs/libcook/cook_fixpoint.h index 7e3db85..35c3f57 100644 --- a/apps/codecs/libcook/cook_fixpoint.h +++ b/apps/codecs/libcook/cook_fixpoint.h @@ -174,14 +174,20 @@ static void scalar_dequant_math(COOKContext *q, int index, FIXP f; int i; - for(i=0 ; i<SUBBAND_SIZE ; i++) { - f = table[subband_coef_index[i]]; - /* noise coding if subband_coef_index[i] == 0 */ - if (((subband_coef_index[i] == 0) && cook_random(q)) || - ((subband_coef_index[i] != 0) && subband_coef_sign[i])) - f = -f; - - mlt_p[i] = (s >= 64) ? 0 : fixp_pow2(f, -(s/2)); + + if(s >= 64) + mlt_p[i]=0; + else + { + for(i=0 ; i<SUBBAND_SIZE ; i++) { + f = table[subband_coef_index[i]]; + /* noise coding if subband_coef_index[i] == 0 */ + if (((subband_coef_index[i] == 0) && cook_random(q)) || + ((subband_coef_index[i] != 0) && subband_coef_sign[i])) + f = -f; + + mlt_p[i] =fixp_pow2(f, -(s/2)); + } } } |