Revision 6e4703ca libavcodec/bitstream.h

View differences:

libavcodec/bitstream.h
446 446
}
447 447

  
448 448
static inline void skip_bits_long(GetBitContext *s, int n){
449
    s->index + n;
449
    s->index += n;
450 450
}
451 451

  
452 452
#elif defined LIBMPEG2_BITSTREAM_READER
......
512 512
    return (s->buffer_ptr - s->buffer)*8 - 16 + s->bit_count;
513 513
}
514 514

  
515
static inline void skip_bits_long(GetBitContext *s, int n){
516
    OPEN_READER(re, s)
517
    re_bit_count += n;
518
    re_buffer_ptr += 2*(re_bit_count>>4);
519
    re_bit_count &= 15;
520
    re_cache = ((re_buffer_ptr[-2]<<8) + re_buffer_ptr[-1]) << (16+re_bit_count);
521
    UPDATE_CACHE(re, s)
522
    CLOSE_READER(re, s)
523
}
524

  
515 525
#elif defined A32_BITSTREAM_READER
516 526

  
517 527
#   define MIN_CACHE_BITS 32
......
706 716
#ifdef ALT_BITSTREAM_READER
707 717
    s->index=0;
708 718
#elif defined LIBMPEG2_BITSTREAM_READER
709
#ifdef LIBMPEG2_BITSTREAM_READER_HACK
710
  if ((int)buffer&1) {
711
     /* word alignment */
712
    s->cache = (*buffer++)<<24;
713
    s->buffer_ptr = buffer;
714
    s->bit_count = 16-8;
715
  } else
716
#endif
717
  {
718
    s->buffer_ptr = buffer;
719
    s->bit_count = 16;
720
    s->cache = 0;
721
  }
722
    {
723
        OPEN_READER(re, s)
724
        UPDATE_CACHE(re, s)
725
        UPDATE_CACHE(re, s)
726
        CLOSE_READER(re, s)
727
    }
719
    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));
720
    s->bit_count = 16 + 8*((intptr_t)buffer&1);
721
    skip_bits_long(s, 0);
728 722
#elif defined A32_BITSTREAM_READER
729 723
    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));
730 724
    s->bit_count = 32 + 8*((intptr_t)buffer&3);

Also available in: Unified diff