diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-12-22 08:33:49 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-12-22 08:33:49 +0000 |
commit | ed945e31c1d522d5d3c4998781e476d95a8170e9 (patch) | |
tree | c552ee8cf263cb15b491af5ff8651b1efa72bcf9 /apps/codecs | |
parent | 1124713acbd8707bbbea2f0dcb9666b3cb9c1f87 (diff) |
Slight speedup for the APE filters. Most noticeable on coldfire (+3.5% for -c2000), but also helps on the arm targets (+0.9% for -c2000 on PP5002). This transformation is oveflow safe, as absres < 2^24 is guaranteed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19556 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/demac/libdemac/filter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/codecs/demac/libdemac/filter.c b/apps/codecs/demac/libdemac/filter.c index df17d357c0..bab830a8bd 100644 --- a/apps/codecs/demac/libdemac/filter.c +++ b/apps/codecs/demac/libdemac/filter.c @@ -138,9 +138,9 @@ static void ICODE_ATTR_DEMAC do_apply_filter_3980(struct filter_t* f, /* Update the adaption coefficients */ absres = (res < 0 ? -res : res); - if (UNLIKELY(absres > (f->avg * 3))) + if (UNLIKELY(absres > 3 * f->avg)) *f->adaptcoeffs = ((res >> 25) & 64) - 32; - else if (absres > (f->avg * 4) / 3) + else if (3 * absres > 4 * f->avg) *f->adaptcoeffs = ((res >> 26) & 32) - 16; else if (LIKELY(absres > 0)) *f->adaptcoeffs = ((res >> 27) & 16) - 8; |