diff DOCS/tech/mpcf.txt @ 12501:cd0d9a99b730

remove index flag max_short_distance reserved_v -> reserved_count header repeation rules some of this is from rich
author michael
date Tue, 25 May 2004 20:42:22 +0000
parents bfa269cec22b
children 6db7e319aaa0
line wrap: on
line diff
--- a/DOCS/tech/mpcf.txt	Tue May 25 18:51:53 2004 +0000
+++ b/DOCS/tech/mpcf.txt	Tue May 25 20:42:22 2004 +0000
@@ -89,6 +89,7 @@
 	version					v
 	stream_count				v
 	max_distance				v
+	max_short_distance			v
 	global_time_base_nom			v
 	global_time_base_denom			v
 	short_startcode				v
@@ -113,7 +114,7 @@
 			data_size_mul[i]= tmp_mul;
 			data_size_lsb[i]= tmp_size + j;
 			timestamp_delta[i]= tmp_timestamp;
-			reserved_v[i]= tmp_res;
+			reserved_count[i]= tmp_res;
 		}
 	}
 	reserved_bytes
@@ -132,7 +133,6 @@
 	msb_timestamp_shift			v
 	decode_delay				v
 	fixed_fps				u(1)
-	index_flag				u(1)
 	reserved				u(6)
 	for(;;){
 		codec_specific_data_type	v
@@ -170,14 +170,13 @@
 	if(flags[frame_code]&1){
 		data_size_msb			v
 	}
-	for(i=0; i<reserved_v[frame_code]; i++)
+	for(i=0; i<reserved_count[frame_code]; i++)
 		reserved			v
 	data
                 
 Index:
 	index_startcode				f(64)
 	packet header
-	stream_id				v
 	index_length				v
 	for(i=0; i<index_length; i++){
 		index_timestamp			v
@@ -267,13 +266,25 @@
 	there is only a single frame between the 2 frame_startcodes
 	this can be used by the demuxer to detect damaged frame headers if the
 	damage results in a too long chain
-	SHOULD be set to <=16384 to ensure reasonable error recovery
+	SHOULD be set to <=32768 or at least <=65536 unless there is a very good
+	reason to set it higher otherwise reasonable error recovery will be
+	impossible
+
+max_short_distance
+	max distance of short startcodes or frame_startcodes, the distance may
+	only be larger if there is only a single frame between the 2 
+	frame_startcodes/short startcodes this can be used by the demuxer to
+	detect damaged frame headers if the damage results in a too long chain
+	SHOULD be set to <=4096 or at least <=8192 unless there is a very good
+	reason to set it higher otherwise reasonable error recovery will be
+	impossible
+
 
 short_startcode
 	MUST be 3 bytes long and MUST have 'N' as first byte, the second byte
 	MUST not be a printable uppercase letter / must not be within 65..90, 
 	default is 0x4EFE79
-        
+
 stream_id
 	Note: streams with a lower relative class MUST have a lower relative id
 	so a stream with class 0 MUST allways have a id which is lower then any
@@ -539,11 +550,18 @@
 
 headers may be repated, but if they are then they MUST all be repeated together
 and repeated headers MUST be identical
+headers MAY only repeated at the closest possible positions after 2^x where x is 
+an integer and the file end, so the headers may be repeated at 4102 if thats the
+closest possition after 2^12=4096 at which the headers can be placed
 
-headers MUST be repeated every 10sec at least ? FIXME
-headers MUST be repeated BEFORE keyframes
+headers MUST be placed at least at the begin of the file and immedeatly before
+the index or at the file end if there is no index
 headers MUST be repeated at least twice (so they exist 3 times in a file)
 
+a demuxer MUST not demux a stream which contains more than one stream, or which
+is wrapped in a structure to facilitate more than one stream or otherwise 
+duplicate the role of a container. any such file is to be considered invalid
+
 		Index
 the index can be repeated but there SHOULD be at least one for each stream at
 the end
@@ -561,6 +579,13 @@
 		Unknown packets
 MUST be ignored by the demuxer
 
+			demuxer (non-normative)
+
+in the absence of valid header at beginning, players SHOULD search for backup
+headers starting at offset 2^x for each x players SHOULD end their search from a
+particular offset when any startcode is found (including syncpoint)
+
+
 			Sample code (GPL, & untested)
 
 typedef BufferContext{