Revision ee3e3631 libavcodec/h263.c

View differences:

libavcodec/h263.c
3293 3293
}
3294 3294

  
3295 3295
/**
3296
 * finds the next resync_marker
3297
 * @param p pointer to buffer to scan
3298
 * @param end pointer to the end of the buffer
3299
 * @return pointer to the next resync_marker, or \p end if none was found
3300
 */
3301
const uint8_t *ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t * restrict end)
3302
{
3303
    assert(p < end);
3304

  
3305
    end-=2;
3306
    p++;
3307
    for(;p<end; p+=2){
3308
        if(!*p){
3309
            if     (!p[-1] && p[1]) return p - 1;
3310
            else if(!p[ 1] && p[2]) return p;
3311
        }
3312
    }
3313
    return end+2;
3314
}
3315

  
3316
/**
3296 3317
 * decodes the group of blocks / video packet header.
3297 3318
 * @return bit position of the resync_marker, or <0 if none was found
3298 3319
 */

Also available in: Unified diff