comparison mpegvideo.c @ 3087:526bc949ef31 libavcodec

simplify
author michael
date Sat, 04 Feb 2006 22:18:45 +0000
parents befacb1cb573
children 072dbc669253
comparison
equal deleted inserted replaced
3086:befacb1cb573 3087:526bc949ef31
235 uint32_t tmp= *state << 8; 235 uint32_t tmp= *state << 8;
236 *state= tmp + *(p++); 236 *state= tmp + *(p++);
237 if(tmp == 0x100 || p==end) 237 if(tmp == 0x100 || p==end)
238 return p; 238 return p;
239 } 239 }
240 p--; // need to recheck or might miss one
241 end--; // we need the byte after 00 00 01 too
242 240
243 while(p<end){ 241 while(p<end){
244 if (p[ 0] > 1) p+= 3; 242 if (p[-1] > 1 ) p+= 3;
245 else if(p[-1] ) p+= 2; 243 else if(p[-2] ) p+= 2;
246 else if(p[-2]|(p[0]-1)) p++; 244 else if(p[-3]|(p[-1]-1)) p++;
247 else{ 245 else{
248 p++; 246 p++;
249 break; 247 break;
250 } 248 }
251 } 249 }
252 250
253 p= FFMIN(p, end)-3; 251 p= FFMIN(p, end)-4;
254 *state= be2me_32(unaligned32(p)); 252 *state= be2me_32(unaligned32(p));
255 253
256 return p+4; 254 return p+4;
257 } 255 }
258 256