Mercurial > mplayer.hg
comparison DOCS/tech/mpcf.txt @ 14906:f2fcd2622a61
partial indexes
comments (with alternative suggestions and advantages) welcome
author | michael |
---|---|
date | Thu, 03 Mar 2005 17:16:49 +0000 |
parents | ebc5136f2a56 |
children | 6a8b15582f64 |
comparison
equal
deleted
inserted
replaced
14905:9c42e93022b3 | 14906:f2fcd2622a61 |
---|---|
117 main_startcode f(64) | 117 main_startcode f(64) |
118 packet header | 118 packet header |
119 version v | 119 version v |
120 stream_count v | 120 stream_count v |
121 max_distance v | 121 max_distance v |
122 max_index_distance v | 122 index_distance v |
123 global_time_base_nom v | 123 global_time_base_nom v |
124 global_time_base_denom v | 124 global_time_base_denom v |
125 for(i=0; i<256; ){ | 125 for(i=0; i<256; ){ |
126 tmp_flag v | 126 tmp_flag v |
127 tmp_fields v | 127 tmp_fields v |
158 average_bitrate v | 158 average_bitrate v |
159 time_base_nom v | 159 time_base_nom v |
160 time_base_denom v | 160 time_base_denom v |
161 msb_timestamp_shift v | 161 msb_timestamp_shift v |
162 decode_delay v | 162 decode_delay v |
163 index_modulo v | |
164 index_increment v | |
163 fixed_fps u(1) | 165 fixed_fps u(1) |
164 reserved u(6) | 166 reserved u(6) |
165 codec_specific_data vb | 167 codec_specific_data vb |
166 | 168 |
167 video_stream_header: | 169 video_stream_header: |
201 | 203 |
202 index: | 204 index: |
203 index_startcode f(64) | 205 index_startcode f(64) |
204 packet header | 206 packet header |
205 stream_id v | 207 stream_id v |
208 index_id v | |
206 index_length v | 209 index_length v |
207 for(i=0; i<index_length; i++){ | 210 for(i=0; i<index_length; i++){ |
208 index_timestamp v | 211 index_timestamp v |
209 index_position v | 212 index_position v |
210 } | 213 } |
237 | 240 |
238 Complete definition: | 241 Complete definition: |
239 | 242 |
240 file: | 243 file: |
241 file_id_string | 244 file_id_string |
242 while(!eof && next_code != index_startcode){ | 245 while(!eof){ |
243 main_header | 246 main_header |
244 for(i=0; i<stream_count; i++){ | 247 for(i=0; i<stream_count; i++){ |
245 if(next_packet==video_stream_header) | 248 if(next_packet==video_stream_header) |
246 video_stream_header | 249 video_stream_header |
247 else | 250 else |
248 audio_stream_header | 251 audio_stream_header |
249 } | 252 } |
250 while(next_code != main_startcode){ | 253 while(next_code != main_startcode){ |
251 if(next_code == info_startcode) | 254 if(next_code == info_startcode) |
252 info_packet | 255 info_packet |
253 else{ | 256 else if(next_code == index_startcode){ |
257 index | |
258 }else{ | |
254 if(next_code == frame_startcode) | 259 if(next_code == frame_startcode) |
255 sync_point | 260 sync_point |
256 frame | 261 frame |
257 } | 262 } |
258 } | 263 } |
259 } | 264 } |
260 index | |
261 | 265 |
262 | 266 |
263 | 267 |
264 Tag description: | 268 Tag description: |
265 | 269 |
303 | 307 |
304 SHOULD be set to <=32768 or at least <=65536 unless there is a very | 308 SHOULD be set to <=32768 or at least <=65536 unless there is a very |
305 good reason to set it higher otherwise reasonable error recovery will | 309 good reason to set it higher otherwise reasonable error recovery will |
306 be impossible | 310 be impossible |
307 | 311 |
308 max_index_distance | 312 index_distance |
309 max distance of keyframes which are represented in the index, the | 313 distance at which indexes are approximately stored, or 0 if there are |
310 distance between consecutive entries A and B may only be larger if | 314 no indexes in the file |
311 there are no keyframes within this stream between A and B | 315 in every [x*index_distance, (x+1)*index_distance) interval, there |
312 SHOULD be set to <=32768 or at least <=65536 unless there is a very | 316 must be an index packet for every stream, and these packets must be |
313 good reason to set it higher | 317 located prior to all frames within the interval |
318 reasoning: this ensures good error recovery as there are many and | |
319 evenly distributed indexes, and also allows very quick finding of the | |
320 index packets | |
321 | |
322 index_modulo | |
323 index_id | |
324 each index packet contains every index_moduloth's keyframe of a stream, | |
325 so the i'th keyframe of a stream will be at least in packets with | |
326 (i % index_modulo) == index_id | |
327 | |
328 index_increment | |
329 the index_id increment value, this MUST be a relative prime to | |
330 index_modulo | |
331 index_increment / index_modulo SHOULD be approximately 2/(sqrt(5)+1) | |
314 | 332 |
315 stream_id[FIXME] | 333 stream_id[FIXME] |
316 Stream identifier | 334 Stream identifier |
317 Note: streams with a lower relative class MUST have a lower relative id | 335 Note: streams with a lower relative class MUST have a lower relative id |
318 so a stream with class 0 MUST always have a id which is lower then any | 336 so a stream with class 0 MUST always have a id which is lower then any |
483 stored in this index | 501 stored in this index |
484 | 502 |
485 index_position | 503 index_position |
486 position in bytes of the first byte of a keyframe, relative to the | 504 position in bytes of the first byte of a keyframe, relative to the |
487 last keyframe stored in this index | 505 last keyframe stored in this index |
488 there MUST be no keyframe with the same stream_id as this index between | |
489 2 consecutive index entries if they are more then max_index_distance | |
490 appart | |
491 | 506 |
492 id | 507 id |
493 the id of the type/name pair, so its more compact | 508 the id of the type/name pair, so its more compact |
494 0 means end | 509 0 means end |
495 | 510 |
578 | 593 |
579 info packets which describe the whole file or individual streams/tracks must be | 594 info packets which describe the whole file or individual streams/tracks must be |
580 placed before any video/audio/... frames | 595 placed before any video/audio/... frames |
581 | 596 |
582 Index | 597 Index |
583 every sync-point must be exacty once in the index | |
584 Note: in case of realtime streaming there is no end, so no index there either | |
585 | 598 |
586 Info packets | 599 Info packets |
587 the info_packet can be repeated, it can also contain different names & values | 600 the info_packet can be repeated, it can also contain different names & values |
588 each time but only if also the time is different | 601 each time but only if also the time is different |
589 Info packets can be used to describe the file or some part of it (chapters) | 602 Info packets can be used to describe the file or some part of it (chapters) |