13.07.2015 Views

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Media Data Atom TypesSound MediaThese added fields are used to support out-of-band configuration settings for decompression and to allowsome parsing of compressed QuickTime sound tracks without requiring the services of a decompressor.These fields introduce the idea of a packet. For uncompressed audio, a packet is a sample from a single channel.For compressed audio, this field has no real meaning; by convention, it is treated as 1/number-of-channels.These fields also introduce the idea of a frame. For uncompressed audio, a frame is one sample from eachchannel. For compressed audio, a frame is a compressed group of samples whose format is dependent on thecompressor.Important The value of all these fields has different meaning for compressed and uncompressed audio.The meaning may not be easily deducible from the field name.The four new fields are:Samples perpacketBytes perpacketBytes perframeBytes persampleThe number of uncompressed frames generated by a compressed frame (an uncompressedframe is one sample from each channel). This is also the frame duration, expressed in the media’stimescale, where the timescale is equal to the sample rate. For uncompressed formats, this fieldis always 1.For uncompressed audio, the number of bytes in a sample for a single channel. This replacesthe older sampleSize field, which is set to 16.This value is calculated by dividing the framesize by the number of channels. The same calculation is performed to calculate the value ofthis field for compressed audio, but the result of the calculation is not generally meaningfulfor compressed audio.The number of bytes in a frame: for uncompressed audio, an uncompressed frame; forcompressed audio, a compressed frame. This can be calculated by multiplying the bytes perpacket field by the number of channels.The size of an uncompressed sample in bytes. This is set to 1 for 8-bit audio, 2 for all othercases, even if the sample size is greater than 2 bytes.When capturing or compressing audio using the QuickTime API, the value of these fields can be obtained bycalling the Apple Sound Manager’s GetCompression function. Historically, the value returned for the bytesper frame field was not always reliable, however, so this field was set by multiplying bytes per packet by thenumber of channels.To facilitate playback on devices that support only one or two channels of audio in 'raw ' or 'twos' format(such as most early Macintosh and Windows computers), all other uncompressed audio formats are treated ascompressed formats, allowing a simple “decompressor” component to perform the necessary format conversionduring playback. The audio samples are treated as opaque compressed frames for these data types, and thefields for sample size and bytes per sample are not meaningful.<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!