Re: fIsMixable
Re: fIsMixable
- Subject: Re: fIsMixable
- From: Andrew Pinski <email@hidden>
- Date: Tue, 17 Jun 2003 23:33:52 -0400
On Tuesday, Jun 17, 2003, at 17:08 US/Eastern, Markus Fritze wrote:
On Dienstag, Juni 17, 2003, at 01:12 Uhr, James Chandler Jr wrote:
If just playing or recording a file, it might be desirable to avoid
float-int conversions.
But in this case performance is not an issue anyhow :-)
Logic does all it's internal processing in float (or even double, if
necessary). I would expect that every even half-professional audio
application does so, too. You don't have to deal with clipping and you
can do real math without converting (converting float->int is
extremely costly on a PowerPC!). How much effort is even a volume
control with clipping in integer math? It is one cycle in float...
float to int is 3 instructions (most of the times gcc does not schedule
this well and it does not use
the optional instruction for storing half of the floating point
registers, this saves space on the stack):
one conversion, one store and one load.
int to float is the really expensive one (gcc really does not schedule
this well at all):
one xor, one load fp, two store ints, one load fp, and one fp subtract
and
one for double to signal floating points(7 instructions).
But you should avoid int to float and float to int, even int to double
and double to int as they
are more expensive than doing additions in floating point (except that
you have to load a "1.0"
into the fp register which can cost if you do not use "1.0f").
Using Shikari from the CHUD tools by Apple (shameless plug here) can
find you bottle-necks for you.
Thanks,
Andrew Pinski
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.