Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Usage of UnsignedFixed type



Hi,

evaluating some sample code, I stumbled about the UnsignedFixed type. Doing a search through the header
files revealed, that while there are some conversion and utility functions for the Fixed and the Extended type, there
seems to be only one (UnsignedFixedMulDiv) for UnsignedFixed, which is only related to multiplication.

According to the MacTypes.h UnsignedFixed internally is divided into a16-bit unsigned integer with a 16-bit fraction.

Searching this list, Brad Ford recommended to use the following macro to create a UnsignedFixed number from a float:

#define Float64ToUnsignedFixed(f64SampleRate) ((UnsignedFixed ) (((f64SampleRate) * 65536.0) + 0.5))

As this macro does not use the fraction, this leaves the following questions:

How is the fraction supposed to work ?
Is it generally used or ignored by quicktime functions and only a placeholder for more exact implementations in the future ?

Also I'd like to know if there exist conversion functions as for the Fixed Type, such as Fix2Long , that I might have missed.

Thanks,
Martin
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.