On Thu, 6 Feb 2003 15:28:00 +0000, Steve Harris wrote > On Thu, Feb 06, 2003 at 03:59:31 +0100, Dave Griffiths wrote: > > On Thu, 6 Feb 2003 14:07:06 +0000, Steve Harris wrote > > > On Thu, Feb 06, 2003 at 12:18:47 +0100, Dave Griffiths wrote: > > > > I had a vague attempt at doing something like this (after noticing that > > > > filters filtering silence uses up a lot of cpu). Each sample buffer object > > > > > > OT: Thats probably because the zeros weren't 0.0, they were probably > > > denormal numbers. If you squash them the filter will run at the same > > > cost as when its processing any other data. > > > > ahah, I was hoping for an explanation :) any ideas on how to combat this, what > > the squashing threshold should be? > > I use: > > #define FLUSH_TO_ZERO(fv) (((*(unsigned int*)&(fv))&0x7f800000)==0)?0.0f:(fv) > I think it came from the music-dsp list. > > Its uses pointer casting, which is mildly evil, but C doesn't have a > non-interprting cast like C++ has, I cant remeber the C++ syntax, > but it should be easy to convert. > > It looks for the denormal pattern in the IEEE bitpattern and zeros > the float if its there IIRC. You probably can't do the comparison > with < as that would cause the denormal to be evaluated.
Is this processor specific? I used to get it loads on my PII desktop, but I haven't noticed it as much my PIII machine (might just be because it's twice the speed). Cheers for the info guys, I haven't come across this before (day job=games programming) dave