Re: fIsMixable
Re: fIsMixable
- Subject: Re: fIsMixable
- From: James Chandler Jr <email@hidden>
- Date: Tue, 17 Jun 2003 16:12:57 -0400
On Tuesday, June 17, 2003, at 03:36 PM, BlazeAudio Developer wrote:
Is it because the application would probably want to do all processing
in
float?
Does the application have to do this conversion?
Can an application not work with ints all the way?
Just one ignorant opinion, from one limited perspective--
If just playing or recording a file, it might be desirable to avoid
float-int conversions.
But most audio software is gonna do something more elaborate than
merely shovel an un-changed stream of bits from source to destination.
At the very least it might want to change gain on the stream.
Back when computers were much slower, fixed-point integer math was
useful on audio. FPU math performance was so slow, fixed-point integer
math was typically faster.
But nowadays, many CPUs can do just about any operation (including
float operations) in a single clock cycle. Of course they can do
multiple operations per clock cycle with vector operations.
Given the typical modern CPU, fixed-point integer math could turn out
MUCH SLOWER than float math.
Your float operations (ferinstance, multiply) might be kicking at 1 or
more per clock cycle...
But each fixed-point-integer multiply might require several integer
operations to get the same accuracy as a float multiply. At one clock
cycle per operation, the chain of integer operations could take more
time than one float operation.
Also, it can be difficult to avoid making pesky "implied decimal point"
errors, when programming complicated multi-step fixed-point-integer
math. It is much easier/faster to write error-free float audio
processing code.
When you use longer data, you do lose a little overhead to memory
bandwidth and hard drive bandwidth, but this is usually not a problem.
James Chandler Jr.
_______________________________________________
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.