Revision e08715d3

View differences:

libavcodec/h264.c
1375 1375
    for(i=0; i<length; i++)
1376 1376
        printf("%2X ", src[i]);
1377 1377
#endif
1378

  
1379
#ifdef HAVE_FAST_UNALIGNED
1380
# ifdef HAVE_FAST_64BIT
1381
#   define RS 7
1382
    for(i=0; i+1<length; i+=9){
1383
        if(!((~*(uint64_t*)(src+i) & (*(uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL))
1384
# else
1385
#   define RS 3
1386
    for(i=0; i+1<length; i+=5){
1387
        if(!((~*(uint32_t*)(src+i) & (*(uint32_t*)(src+i) - 0x01000101U)) & 0x80008080U))
1388
# endif
1389
            continue;
1390
        if(i>0 && !src[i]) i--;
1391
        while(src[i]) i++;
1392
#else
1393
#   define RS 0
1378 1394
    for(i=0; i+1<length; i+=2){
1379 1395
        if(src[i]) continue;
1380 1396
        if(i>0 && src[i-1]==0) i--;
1397
#endif
1381 1398
        if(i+2<length && src[i+1]==0 && src[i+2]<=3){
1382 1399
            if(src[i+2]!=3){
1383 1400
                /* startcode, so we must be past the end */

Also available in: Unified diff