[NUT-devel] CVS: main/DOCS/tech mpcf.txt,1.145,1.146

Oded Shimon ods15 at ods15.dyndns.org
Mon Mar 13 08:31:16 CET 2006


On Sun, Mar 12, 2006 at 01:05:48PM -0500, Rich Felker wrote:
> On Sun, Mar 12, 2006 at 06:40:35PM +0100, Oded Shimon CVS wrote:
> > -    value= (tmp / stream_count) * stream[ stream_id ].timebase
> > +    value= (tmp / stream_count) * timebase[stream_id]
> 
> BTW an idea... instead of having timebase stored in the stream header,
> what if we stored a list of timebases in the main header, then the
> stream header just had an index into that list? That was if we had 20
> different streams but only 2 distinct timebases, the universal
> timestamps would still be compact. It would also allow additional
> non-stream timebases to be stored for use in chapter extents.

?

- ods15
-------------- next part --------------
Index: DOCS/tech/mpcf.txt
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/mpcf.txt,v
retrieving revision 1.148
diff -u -r1.148 mpcf.txt
--- DOCS/tech/mpcf.txt	13 Mar 2006 06:50:55 -0000	1.148
+++ DOCS/tech/mpcf.txt	13 Mar 2006 07:29:14 -0000
@@ -107,8 +107,8 @@
 
 t (v coded universal timestamp)
     tmp                                 v
-    stream_id= tmp % stream_count
-    value= (tmp / stream_count) * timebase[stream_id]
+    id= tmp % time_base_count
+    value= (tmp / time_base_count) * time_base[id]
 
 
 Bitstream syntax:
@@ -151,6 +151,11 @@
     version                             v
     stream_count                        v
     max_distance                        v
+    time_base_count                     v
+    for(i=0; i<time_base_count; i++)
+        time_base_nom                   v
+        time_base_denom                 v
+        time_base[i]= time_base_nom/time_base_denom
     tmp_pts=0
     tmp_mul=1
     tmp_stream=0
@@ -188,8 +193,7 @@
     stream_id                           v
     stream_class                        v
     fourcc                              vb
-    time_base_nom                       v
-    time_base_denom                     v
+    time_base_id                        v
     msb_pts_shift                       v
     max_pts_distance                    v
     decode_delay                        v
@@ -444,6 +448,9 @@
         29.97     1001             30000
         23.976    1001             24000
 
+time_base_id
+    id to time_base table
+
 convert_ts
     To switch from 2 different timebases, the following calculation is
     defined:
@@ -616,7 +623,7 @@
 
 global_key_pts
     After a syncpoint, last_pts of each stream is to be set to:
-    last_pts[i] = convert_ts(global_key_pts, timebase[stream], timebase[i])
+    last_pts[i] = convert_ts(global_key_pts, time_base[id], time_base[i])
 
     global_key_pts MUST be bigger or equal to dts of all past frames across
     all streams, and smaller or equal to pts of all future frames.


More information about the NUT-devel mailing list