comparison DOCS/tech/mpcf.txt @ 12117:e1e5e2124dae

minor changes rename b -> vb, so 'v' is the vlc, 'b' is simply a series of bytes and 'vb' is the length as vlc + the bytes encode the fourcc & language code as v instead of vb, this is much simpler in practice, at least in lavf as the fourcc is an int there
author michael
date Sun, 04 Apr 2004 22:40:48 +0000
parents a34dc5a369ca
children b8fea9441d02
comparison
equal deleted inserted replaced
12116:8d476d8a16ae 12117:e1e5e2124dae
52 temp++ 52 temp++
53 if(temp&1) value= -(temp>>1) 53 if(temp&1) value= -(temp>>1)
54 else value= (temp>>1) 54 else value= (temp>>1)
55 55
56 b (binary data or string) 56 b (binary data or string)
57 length v
58 for(i=0; i<length; i++){ 57 for(i=0; i<length; i++){
59 data[i] u(8) 58 data[i] u(8)
60 } 59 }
61 Note: strings MUST be encoded in utf8 60 Note: strings MUST be encoded in utf8
62 61
63 62 vb
63 length v
64 value b
65
64 f(x) n fixed bits in big endian order 66 f(x) n fixed bits in big endian order
65 u(x) unsigned number encoded in x bits in MSB first order 67 u(x) unsigned number encoded in x bits in MSB first order
66 68
67 69
68 Bitstream syntax: 70 Bitstream syntax:
111 stream_header: 113 stream_header:
112 stream_startcode f(64) 114 stream_startcode f(64)
113 packet_header 115 packet_header
114 stream_id v 116 stream_id v
115 stream_class v 117 stream_class v
116 fourcc b 118 fourcc v
117 average_bitrate v 119 average_bitrate v
118 language_code b 120 language_code v
119 time_base_nom v 121 time_base_nom v
120 time_base_denom v 122 time_base_denom v
121 msb_timestamp_shift v 123 msb_timestamp_shift v
122 initial_timestamp_predictor v(3) 124 initial_timestamp_predictor v(3)
123 initial_data_size_predictor v(2) 125 initial_data_size_predictor v(2)
125 index_flag u(1) 127 index_flag u(1)
126 reserved u(6) 128 reserved u(6)
127 for(;;){ 129 for(;;){
128 codec_specific_data_type v 130 codec_specific_data_type v
129 if(codec_specific_data_type==0) break; 131 if(codec_specific_data_type==0) break;
130 codec_specific_data_size v 132 codec_specific_data vb
131 codec_specific_data b
132 } 133 }
133 134
134 video_stream_header: 135 video_stream_header:
135 stream_header 136 stream_header
136 width v 137 width v
193 id v 194 id v
194 if(id==0) break 195 if(id==0) break
195 name= info_table[id][0] 196 name= info_table[id][0]
196 type= info_table[id][1] 197 type= info_table[id][1]
197 if(type==NULL) 198 if(type==NULL)
198 type b 199 type vb
199 if(name==NULL) 200 if(name==NULL)
200 name b 201 name vb
201 if(type=="v") 202 if(type=="v")
202 value v 203 value v
203 else if(type=="s")
204 value s
205 else 204 else
206 value b 205 value vb
207 } 206 }
208 reserved_bytes 207 reserved_bytes
209 checksum u(32) 208 checksum u(32)
210 209
211 210