# HG changeset patch # User ods15 # Date 1136513182 0 # Node ID 33b03e1e4170dcd846f46da94757f4fa91763fe2 # Parent 2a1cc9c01f64c29d130577580818807900d0d379 1) remove global_timebase 2) define convert_ts 3) use coded_pts for syncpoint diff -r 2a1cc9c01f64 -r 33b03e1e4170 DOCS/tech/mpcf.txt --- a/DOCS/tech/mpcf.txt Fri Jan 06 02:05:57 2006 +0000 +++ b/DOCS/tech/mpcf.txt Fri Jan 06 02:06:22 2006 +0000 @@ -135,8 +135,6 @@ stream_count v max_distance v max_index_distance v - global_time_base_nom v - global_time_base_denom v for(i=0; i<256; ){ tmp_flag v tmp_fields v @@ -258,7 +256,9 @@ syncpoint: syncpoint_startcode f(64) - global_timestamp v + coded_pts v + stream = coded_pts % stream_count + global_key_pts = coded_pts/stream_count back_ptr v Complete definition: @@ -306,6 +306,10 @@ one keyframe for each stream lies between the syncpoint to which real_back_ptr points, and the current syncpoint. +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]) + file_id_string "nut/multimedia container\0" @@ -383,22 +387,15 @@ 29.97 1001 30000 23.976 1001 24000 -global_time_base_nom / global_time_base_denom = global_time_base - the length of a timer tick in seconds - global_time_base_nom and global_time_base_denom MUST NOT be 0 - global_time_base_nom and global_time_base_denom MUST be relatively prime - global_time_base_denom MUST be < 2^31 +convert_ts + To switch from 2 different timebases, the following calculation is + defined: -global_timestamp - timestamp in global_time_base units - when a global_timestamp is encountered the last_pts of all - streams is set to the following: - - ln = global_time_base_nom*time_base_denom - sn = global_timestamp - d1 = global_time_base_denom - d2 = time_base_nom - last_pts = (ln/d1*sn + ln%d1*sn/d1)/d2 + ln = from_time_base_nom*to_time_base_denom + sn = from_timestamp + d1 = from_time_base_denom + d2 = to_time_base_nom + timestamp = (ln/d1*sn + ln%d1*sn/d1)/d2 Note: this calculation MUST be done with unsigned 64 bit integers, and is equivalent to (ln*sn)/(d1*d2) but this would require a 96bit integer