comparison DOCS/tech/mpcf.txt @ 10831:3f716efeb27a

moved packet header after startcodes
author alex
date Sun, 07 Sep 2003 01:15:01 +0000
parents 85179ecb5a6e
children 4b956204bed0
comparison
equal deleted inserted replaced
10830:ca838366710d 10831:3f716efeb27a
16 allow adding of new headers in the future 16 allow adding of new headers in the future
17 allow adding more fields at the end of headers 17 allow adding more fields at the end of headers
18 Compact 18 Compact
19 ~0.2% overhead, for normal bitrates 19 ~0.2% overhead, for normal bitrates
20 index is <10kb per hour (1 keyframe every 3sec) 20 index is <10kb per hour (1 keyframe every 3sec)
21 a usual header for a file is about 100bytes (audio + video headers together)
22 a packet header is about ~8 bytes
21 Error resistant 23 Error resistant
22 seeking / playback without an index 24 seeking / playback without an index
23 headers & index can be repeated 25 headers & index can be repeated
24 audio packet reshuffle 26 audio packet reshuffle
25 checksums to allow quick redownloading of damaged parts 27 checksums to allow quick redownloading of damaged parts
80 a encoder MUST NOT write any reserved bytes, as this would make it 82 a encoder MUST NOT write any reserved bytes, as this would make it
81 inpossible to add new fields at the end of packets in the future in 83 inpossible to add new fields at the end of packets in the future in
82 a compatible way 84 a compatible way
83 85
84 main header: 86 main header:
87 main_startcode f(64)
85 packet header 88 packet header
86 main_startcode f(64)
87 version v 89 version v
88 stream_count v 90 stream_count v
89 file_size v 91 file_size v
90 length_in_msec v 92 length_in_msec v
91 reserved_bytes 93 reserved_bytes
92 checksum u(32) 94 checksum u(32)
93 95
94 stream_header: 96 stream_header:
97 stream_startcode f(64)
95 packet_header 98 packet_header
96 stream_startcode f(64)
97 stream_id v 99 stream_id v
98 stream_class v 100 stream_class v
99 fourcc b 101 fourcc b
100 average_bitrate v 102 average_bitrate v
101 language_code b 103 language_code b
128 channel_count v 130 channel_count v
129 reserved_bytes 131 reserved_bytes
130 checksum u(32) 132 checksum u(32)
131 133
132 frame 134 frame
133 packet header
134 if(keyframe){ 135 if(keyframe){
135 keyframe_startcode f(64) 136 keyframe_startcode f(64)
136 } 137 }
137 zero_bit f(1) 138 zero_bit f(1)
138 priority u(2) 139 priority u(2)
139 checksum_flag u(1) 140 checksum_flag u(1)
140 msb_timestamp_flag u(1) 141 msb_timestamp_flag u(1)
141 subpacket_type u(2) 142 subpacket_type u(2)
142 reserved u(1) 143 reserved u(1)
144 packet header
143 stream_id v 145 stream_id v
144 if(msb_timestamp_flag) 146 if(msb_timestamp_flag)
145 msb_timestamp v 147 msb_timestamp v
146 lsb_timestamp s 148 lsb_timestamp s
147 if(sub_packet_type==01) 149 if(sub_packet_type==01)
166 } 168 }
167 if(checksum_flag) 169 if(checksum_flag)
168 frame_checksum u(32) 170 frame_checksum u(32)
169 171
170 Index: 172 Index:
173 index_startcode f(64)
171 packet header 174 packet header
172 index_startcode f(64)
173 stream_id v 175 stream_id v
174 index_length v 176 index_length v
175 for(i=0; i<index_length; i++){ 177 for(i=0; i<index_length; i++){
176 index_timestamp v 178 index_timestamp v
177 index_position v 179 index_position v
178 } 180 }
179 reserved_bytes 181 reserved_bytes
180 checksum u(32) 182 checksum u(32)
181 183
182 info_packet: (optional) 184 info_packet: (optional)
185 info_startcode f(64)
183 packet header 186 packet header
184 info_startcode f(64)
185 for(;;){ 187 for(;;){
186 id v 188 id v
187 if(id==0) break 189 if(id==0) break
188 name= info_table[id][0] 190 name= info_table[id][0]
189 type= info_table[id][1] 191 type= info_table[id][1]