[openbeos] Re: Resampling algorithms for audio mixer

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 28 Nov 2007 01:06:10 +0100

>>> Rather than put workarounds for the denormal problem in
>>> the resampling algorithm (thus slowing it down), I propose
>>> completely disabling denormals on the CPU across the entire
>>> OS as standard.
>> This is up to Haiku devs :-)
>
> At least I have no clue about this, but we don't have to decide
> this today, don't we? :-)
> Do we even have a choice with being BeOS compatible and all
> (as I said, I have no idea what I'm talking about, just in case
> you're wondering)?

Denormals are very small floating numbers.
Calculation under this "subnormal" level often switch FPU into a slower cycle
state, which could hit badly the whole system, especially on P4's.
While in scientific computing field it's obviously well tolerated, when it comes
to near zero floating point audio samples, hit doesn't worth it and a plain
silence is better than an near zero silent but slower system.

CPUs can be set to consider denormals as zero, per SSE+ FTZ & DAZ flags

Some links to learn more:
http://en.wikipedia.org/wiki/Denormal
http://www.compwisdom.com/topics/Denormalization

I don't think it should be set system wide but only in audio media nodes.
There is many areas where discrete near zero values are usefull, while audio
code must take advantage in its knowledge that human ear won't make any
difference...

- Philippe

Other related posts: