comparison DOCS/tech/mpcf.txt @ 17328:33b03e1e4170

1) remove global_timebase 2) define convert_ts 3) use coded_pts for syncpoint
author ods15
date Fri, 06 Jan 2006 02:06:22 +0000
parents 2a1cc9c01f64
children a31be8f40fc2
comparison
equal deleted inserted replaced
17327:2a1cc9c01f64 17328:33b03e1e4170
133 packet header 133 packet header
134 version v 134 version v
135 stream_count v 135 stream_count v
136 max_distance v 136 max_distance v
137 max_index_distance v 137 max_index_distance v
138 global_time_base_nom v
139 global_time_base_denom v
140 for(i=0; i<256; ){ 138 for(i=0; i<256; ){
141 tmp_flag v 139 tmp_flag v
142 tmp_fields v 140 tmp_fields v
143 if(tmp_fields>0) tmp_pts s 141 if(tmp_fields>0) tmp_pts s
144 if(tmp_fields>1) tmp_mul v 142 if(tmp_fields>1) tmp_mul v
256 packet header 254 packet header
257 info_frame 255 info_frame
258 256
259 syncpoint: 257 syncpoint:
260 syncpoint_startcode f(64) 258 syncpoint_startcode f(64)
261 global_timestamp v 259 coded_pts v
260 stream = coded_pts % stream_count
261 global_key_pts = coded_pts/stream_count
262 back_ptr v 262 back_ptr v
263 263
264 Complete definition: 264 Complete definition:
265 265
266 file: 266 file:
304 real_back_ptr must point to a position such that a syncpoint 304 real_back_ptr must point to a position such that a syncpoint
305 startcode begins within the next 8 bytes, and such that at least 305 startcode begins within the next 8 bytes, and such that at least
306 one keyframe for each stream lies between the syncpoint to which 306 one keyframe for each stream lies between the syncpoint to which
307 real_back_ptr points, and the current syncpoint. 307 real_back_ptr points, and the current syncpoint.
308 308
309 global_key_pts
310 After a syncpoint, last_pts of each stream is to be set to:
311 last_pts[i] = convert_ts(global_key_pts, timebase[stream], timebase[i])
312
309 file_id_string 313 file_id_string
310 "nut/multimedia container\0" 314 "nut/multimedia container\0"
311 315
312 *_startcode 316 *_startcode
313 all startcodes start with 'N' 317 all startcodes start with 'N'
381 fps time_base_nom time_base_denom 385 fps time_base_nom time_base_denom
382 30 1 30 386 30 1 30
383 29.97 1001 30000 387 29.97 1001 30000
384 23.976 1001 24000 388 23.976 1001 24000
385 389
386 global_time_base_nom / global_time_base_denom = global_time_base 390 convert_ts
387 the length of a timer tick in seconds 391 To switch from 2 different timebases, the following calculation is
388 global_time_base_nom and global_time_base_denom MUST NOT be 0 392 defined:
389 global_time_base_nom and global_time_base_denom MUST be relatively prime 393
390 global_time_base_denom MUST be < 2^31 394 ln = from_time_base_nom*to_time_base_denom
391 395 sn = from_timestamp
392 global_timestamp 396 d1 = from_time_base_denom
393 timestamp in global_time_base units 397 d2 = to_time_base_nom
394 when a global_timestamp is encountered the last_pts of all 398 timestamp = (ln/d1*sn + ln%d1*sn/d1)/d2
395 streams is set to the following:
396
397 ln = global_time_base_nom*time_base_denom
398 sn = global_timestamp
399 d1 = global_time_base_denom
400 d2 = time_base_nom
401 last_pts = (ln/d1*sn + ln%d1*sn/d1)/d2
402 Note: this calculation MUST be done with unsigned 64 bit integers, and 399 Note: this calculation MUST be done with unsigned 64 bit integers, and
403 is equivalent to (ln*sn)/(d1*d2) but this would require a 96bit integer 400 is equivalent to (ln*sn)/(d1*d2) but this would require a 96bit integer
404 401
405 msb_pts_shift 402 msb_pts_shift
406 amount of bits in lsb_pts 403 amount of bits in lsb_pts