Re: Stereo > Mono Downmixing on iOS
Re: Stereo > Mono Downmixing on iOS
- Subject: Re: Stereo > Mono Downmixing on iOS
- From: Brian Willoughby <email@hidden>
- Date: Fri, 01 Apr 2011 01:37:31 -0700
On Mar 31, 2011, at 16:25, Paul Davis wrote:
i don't consider any environment that doesn't use float as its
standard format for handling samples as suitable for 3rd party audio
software development. nobody would dream of converting from 24 bit to
float *just* for summing. if you're not already using float, then you
need to solve how to *add* the samples without overflow in whatever
format you're using. if you are already using float, there is no
problem with the *addition* that needs solving.
It seems like you're somewhat biased, and I will admit that I am
biased towards float to some degree as well. However, there are many
DSP systems based on fixed point that allow third-party development.
Digidesign Pro Tools started out on a DSP system with 56-bit
accumulators, which can hold the 48-bit result of a 24-bit fader
operation and still have 8-bit overflow for summing multiple
channels. Note that the third-party option depends greatly upon how
the API is defined. Digi supposedly altered the default fixed point
bias of their 56000 software so that there were 16 bits of overflow
instead of just 8, although this does reduce the gain settings to 16-
bit when processing 24-bit audio. The problem with Pro Tools was
that third-party developers were basically forced to saturate their I/
O levels to 24-bit, probably because the API would have been too
expensive if it were to pass around 48-bit values (and the DSP
instruction set makes it rather cumbersome to pass around the full 56-
bit accumulator values).
iOS has a canonical format of 8.24 fixed point, and although there is
no third-party plug-in support on iOS it's still theoretically viable.
There are few DSP systems with support for third-party plug-ins. I
can point to many fixed-point systems that support user-selected plug-
ins, but I cannot necessarily point to any who have opened up their
plug-in market to third parties (although some have been promising to
do so for years).
Admittedly, the use of anything but floating point certainly sets the
bar much higher for third-party developers. Perhaps this explains
why there aren't more open fixed-point systems. As if AudioUnits
were not already hard enough to develop, imagine how difficult it
would be with a fixed-point standard!
it is a little hard for me to believe that in 2011, anyone is having
this discussion on a mailing list, let alone this one. as brian
pointed out, there is no single approach to summing samples that is
right for all cases, but this is audio programming at its most basic,
and this is a problem that has been mapped out and clearly understood
for at le
While I share your bias towards floating point, I will say that it's
not necessarily the only choice. It's certainly the easiest.
basically, the story is fairly straightforward:
1) adding samples together may overflow the sample format
2) it is almost certain never to happen if the sample format is
floating point
3) in integer or fixed point formats, you need to "solve" the overflow
problem at the time of the summation
This is not true for iOS, because 8.24 will not overflow at the time
of summation unless more than 128 channels are being summing. Given
the processing speed of the iOS hardware, I'd say it's fairly
reasonable to say that this would "never" happen. In other words,
8.24 is the same as floating point, for all practical considerations
- with the caveat that 8.24 is going to be faster on most iOS platforms.
4) in the floating point case, you need to solve the overflow problem
whenever conversion back to an integer (or fixed point) format occurs
(it may never occur, in theory; in practice it always does).
In the case I described above, the iOS canonical format of 8.24 also
needs to solve the overflow problem when converting to the canonical
16-bit integer output format.
Brian Willoughby
Sound Consulting
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden