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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Movie AtomsSample AtomsFigure 2-37 (page 103) presents an example of a time-to-sample table that is based on the chunked media datashown in Figure 2-32 (page 96). That data stream contains a total of nine samples that correspond in countand duration to the entries of the table shown here. Even though samples 4, 5, and 6 are in the same chunk,sample 4 has a duration of 3, and samples 5 and 6 have a duration of 2.Figure 2-37SamplecountAn example of a time-to-sample tableSampleduration432132Composition Offset AtomVideo samples in encoded formats have a decode order and a presentation order (also called compositionorder or display order ). The composition offset atom is used when there are out-of-order video samples.●●If the decode and presentation orders are the same, no composition offset atom will be present. Thetime-to-sample atom provides both the decode and presentation ordering of the video stream, and allowscalculation of the start and end times.If video samples are stored out of presentation order, the time-to-sample atom provides the decode orderand the composition offset atom provides the time of presentation for the decoded samples expressedas a delta on a sample-by-sample basis.Note Decode time does not directly imply presentation time when working with out of order videosamples. The ordering is significant.The composition offset atom contains a sample-by-sample mapping of the decode-to-presentation time. Eachentry in the composition offset table is a time delta from decode to presentation time: CT(n) = DT(n) + CTTS(n)where CTTS(n) is the (uncompressed) table entry for sample n DT is the decode time and CT is the composition(or display) time. The delta expressed in the composition offset table can be positive or negative.When the time-to-sample atom and the composition offset atom are present, a reader parsing out-of-ordervideo samples has all the information necessary to calculate the start and end times, as well as the minimumand maximum offsets between decode time and presentation time. The sample tables are scanned to obtainthese values.<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.103

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

Saved successfully!

Ooh no, something went wrong!