Revision 71c465a1 libavcodec/bitstream.h

View differences:

libavcodec/bitstream.h
49 49
//#define A32_BITSTREAM_READER
50 50
#   endif
51 51
#endif
52
#define LIBMPEG2_BITSTREAM_READER_HACK //add BERO
53 52

  
54 53
extern const uint8_t ff_reverse[256];
55 54

  
......
484 483
        (gb)->cache= name##_cache;\
485 484
        (gb)->buffer_ptr= name##_buffer_ptr;\
486 485

  
487
#ifdef LIBMPEG2_BITSTREAM_READER_HACK
488

  
489
#   define UPDATE_CACHE(name, gb)\
490
    if(name##_bit_count >= 0){\
491
        name##_cache+= (int)be2me_16(*(uint16_t*)name##_buffer_ptr) << name##_bit_count;\
492
        name##_buffer_ptr += 2;\
493
        name##_bit_count-= 16;\
494
    }\
495

  
496
#else
497

  
498 486
#   define UPDATE_CACHE(name, gb)\
499 487
    if(name##_bit_count >= 0){\
500
        name##_cache+= ((name##_buffer_ptr[0]<<8) + name##_buffer_ptr[1]) << name##_bit_count;\
488
        name##_cache+= AV_RB16(name##_buffer_ptr) << name##_bit_count; \
501 489
        name##_buffer_ptr+=2;\
502 490
        name##_bit_count-= 16;\
503 491
    }\
504 492

  
505
#endif
506

  
507 493
#   define SKIP_CACHE(name, gb, num)\
508 494
        name##_cache <<= (num);\
509 495

  

Also available in: Unified diff