stts
Sample Table time-to-sample
時間からサンプルと読んでしまいそうだが、違う
Sampleの属性としてのTimeを表している。
それぞれのSampleはDurationを持っており、その値を示したのがsttsである。
Q. Timeって具体的に何のTime?
The atom contains time deltas: DT(n+1) = DT(n) + STTS(n) where STTS(n) is the (uncompressed) table entry for sample n and DT is the display time for sample (n). The sample entries are ordered by time stamps; therefore, the deltas are all nonnegative. The DT axis has a zero origin; DT(i) = SUM (for j=0 to i-1 of delta(j)), and the sum of all deltas gives the length of the media in the track (not mapped to the overall time scale, and not considering any edit list). The edit list atom provides the initial DT value if it is nonempty (nonzero).
stts Boxは「時間差」を格納している。
Sample Table上のサンプルのうち、インデックスが$ nの要素について、
stts上の対応する要素を$ S_n, サンプルの表示時間を$ D_nとすると、以下のように表せる。
$ D_{n+1} = D_n + S_n
すなわち、表示時間は、$ n \ge 2において、
$ D_n = D_1 + \sum_{n=1}^{n-1}{S_n}
例えば、
$ D_1 = D_1
$ D_2 = D_1 + S_1 = D_{1 + 1} = D_1 + S_1
となる。
したがって、sttsはサンプルの表示時間を計算するための情報を格納しているといえる。
最初のサンプルの表示時間が既知であれば、$ n番目のサンプルの表示時間$ D_nは上式より導ける。
サンプルは表示時間順に並べられている
MP4ではフレームデータはComposition Time順(ではない)
うーん?DeNAの技術ブログではデコード順って書いてあったんだよな…
いや、矛盾しない。英文に忠実に。
「sample entries are order by time stamps」
あくまでこの配列において、要素は表示時間順に並べられているよ。だから時間差も正数だよ、ということ。
表示時間軸には原点がある
英文の方を読むと、多分この原点についての記述は$ D_1 = 0ということだ
こういう式が書いてある
$ D_i = \sum_{j=0}^{i-1}{S_j}
謎
なんで j = 0? jって何?
sttsの和は、最終的にはメディアの時間合計になる
edtsから表示時間の初期値を取得できることがある
初期値って何だろう?