[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] Re: Changes checked into CVS
From: |
Mihail Zenkov |
Subject: |
Re: [fluid-dev] Re: Changes checked into CVS |
Date: |
Mon, 11 Dec 2006 00:19:05 +0200 |
On Sun, 10 Dec 2006 16:28:52 +0000
Josh Green <address@hidden> wrote:
> Your dithering patch at this point isn't complete, so I wanted to get it
> right before next release :) Therefore, returning to this discussion..
>
> On Fri, 2006-11-24 at 21:19 +0200, Mihail Zenkov wrote:
> >
> > Yes you right, but in case without roundf we have two time bigger
> > amplitude and imho bigger THD (i see it when compare spectrum in
> > audacity). See attach to more undersend.
>
> Sounds like it would be good to use roundf. I'll need to add
> a ./configure detection for it though, since I imagine it wont be
> available on Windows and possibly OSX? Not sure. I was thinking of
> just making a macro like:
>
> #define FLUID_ROUNDF roundf
>
> Which gets defined if roundf is truly available. Any ideas of a
> semi-efficient equivalent that could be used in place of this macro if
> roundf() is not available? I suppose it does not need to be as good as
> roundf, just as long as it is improving things in regards to dithering.
IMHO better replace roundf with this code in all case:
inline int roundi(float x)
{
if (x >= 0.0f)
return (int)(x+0.5f);
else
return (int)(x-0.5f);
}
It slightly faster then gcc roundf (1.5 time).