Re: [LAD] Floating point Denormals: C++ and Waf

From: David Robillard <d@email-addr-hidden>
Date: Thu Aug 02 2012 - 21:52:32 EEST

On Thu, 2012-08-02 at 20:31 +0200, Martin Homuth-Rosemann wrote:
[...]
> // denormals are zero
> static inline float daz( float f )
> {
> // define an aliasing type to perform a "reinterpret cast"
> typedef __u32 __attribute__ (( __may_alias__ )) u32bit;
> if ( *( (u32bit*)&f ) & 0x7F000000 ) // E > 1 : normal.
> return f;
> else // E <= 1 : zero or _almost_ denormal
> // (may become denormal with next operation)
> return 0.0;
> }
[...]
> float reverb( float xin )
> {
> static float yout = 0.0;
> static float xv0, xv1, yv0, yv1;
> float x, y;
>
> // additional feedback
> x = daz( xin/8 + yout/64 );

Branch per sample, eeck...

-dr

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Received on Fri Aug 3 00:15:08 2012

This archive was generated by hypermail 2.1.8 : Fri Aug 03 2012 - 00:15:10 EEST