mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
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
This commit is contained in:
parent
1124713acb
commit
ed945e31c1
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue