comparison DOCS/tech/mpcf.txt @ 17718:86bcb118eab1

simplify flags
author michael
date Fri, 03 Mar 2006 22:30:17 +0000
parents ad3cb21e1b18
children 6f1bc4789a5d
comparison
equal deleted inserted replaced
17717:4de62f7f6f8a 17718:86bcb118eab1
129 tmp_mul=1 129 tmp_mul=1
130 tmp_stream=0 130 tmp_stream=0
131 for(i=0; i<256; ){ 131 for(i=0; i<256; ){
132 tmp_flag v 132 tmp_flag v
133 tmp_fields v 133 tmp_fields v
134 if(tmp_fields>0) tmp_sflag v
135 else tmp_sflag=0
136 if(tmp_fields>1) tmp_pts s 134 if(tmp_fields>1) tmp_pts s
137 if(tmp_fields>2) tmp_mul v 135 if(tmp_fields>2) tmp_mul v
138 if(tmp_fields>3) tmp_stream v 136 if(tmp_fields>3) tmp_stream v
139 if(tmp_fields>4) tmp_size v 137 if(tmp_fields>4) tmp_size v
140 else tmp_size=0 138 else tmp_size=0
145 for(j=7; j<tmp_fields; j++){ 143 for(j=7; j<tmp_fields; j++){
146 tmp_reserved[i] v 144 tmp_reserved[i] v
147 } 145 }
148 for(j=0; j<count && i<256; j++, i++){ 146 for(j=0; j<count && i<256; j++, i++){
149 if (i == 'N') { 147 if (i == 'N') {
150 flags[i]= 4; 148 flags[i]= FLAG_INVALID;
151 j--; 149 j--;
152 continue; 150 continue;
153 } 151 }
154 flags[i]= tmp_flag; 152 flags[i]= tmp_flag;
155 stream_flags[i]= tmp_sflag;
156 stream_id_plus1[i]= tmp_stream; 153 stream_id_plus1[i]= tmp_stream;
157 data_size_mul[i]= tmp_mul; 154 data_size_mul[i]= tmp_mul;
158 data_size_lsb[i]= tmp_size + j; 155 data_size_lsb[i]= tmp_size + j;
159 pts_delta[i]= tmp_pts; 156 pts_delta[i]= tmp_pts;
160 reserved_count[i]= tmp_res; 157 reserved_count[i]= tmp_res;
193 stream_id v 190 stream_id v
194 } 191 }
195 if(pts_delta[frame_code]==0){ 192 if(pts_delta[frame_code]==0){
196 coded_pts v 193 coded_pts v
197 } 194 }
198 if(flags[frame_code]&1){ 195 frame_flags= flags[frame_code]
196 if(frame_flags&FLAG_CODED){
197 coded_flags v
198 frame_flags ^= coded_flags
199 }
200 if(frame_flags&FLAG_SIZE_MSB){
199 data_size_msb v 201 data_size_msb v
200 }
201 if(flags[frame_code]&2){
202 coded_stream_flags v
203 } 202 }
204 for(i=0; i<reserved_count[frame_code]; i++) 203 for(i=0; i<reserved_count[frame_code]; i++)
205 reserved v 204 reserved v
206 if(stream_flags&4){ 205 if(frame_flagsFLAG_CHECKSUM){
207 checksum u(32) 206 checksum u(32)
208 } 207 }
209 data 208 data
210 209
211 index: 210 index:
492 frame_code 491 frame_code
493 the meaning of this byte is stored in the main header 492 the meaning of this byte is stored in the main header
494 the value 78 ('N') is forbidden to ensure that the byte is always 493 the value 78 ('N') is forbidden to ensure that the byte is always
495 different from the first byte of any startcode 494 different from the first byte of any startcode
496 495
497 flags[frame_code] 496 flags[frame_code], frame_flags
498 Bit Name Description 497 Bit Name Description
499 1 data_size_msb if set, data_size_msb is at frame header, 498 1 FLAG_SIZE_MSB if set, data_size_msb is at frame header,
500 otherwise data_size_msb is 0 499 otherwise data_size_msb is 0
501 2 more_flags if set, stream control flags are at frame header. 500 2 FLAG_CHECKSUM if set then the frame header contains a checksum
502 4 invalid if set, frame_code is invalid. 501 4 FLAG_KEY if set, frame is keyframe
503 502 8 FLAG_EOR if set, stream has no relevance on
504 stream_flags 503 presentation. (EOR)
505 stream_flags is "stream_flags[frame_code] ^ coded_stream_flags" 504 256 FLAG_CODED if set, coded_flags are stored in the frame header.
506 505 512 FLAG_INVALID if set, frame_code is invalid.
507 Bit Name Description
508 1 is_key if set, frame is keyframe
509 2 end_of_relevance if set, stream has no relevance on
510 presentation. (EOR)
511 4 has_checksum if set then the frame header contains a checksum
512 506
513 EOR frames MUST be zero-length and must be set keyframe. 507 EOR frames MUST be zero-length and must be set keyframe.
514 All streams SHOULD end with EOR, where the pts of the EOR indicates the 508 All streams SHOULD end with EOR, where the pts of the EOR indicates the
515 end presentation time of the final frame. 509 end presentation time of the final frame.
516 An EOR set stream is unset by the first content frames. 510 An EOR set stream is unset by the first content frames.