mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit 'b574e1e97ea7067a5fcd3876e30a67df0e4e6611'
* commit 'b574e1e97ea7067a5fcd3876e30a67df0e4e6611': get_bits: Add OPEN_READER macro variant w/o size_plus8 Conflicts: libavcodec/get_bits.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
8c6cfffa01
@ -96,7 +96,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
|
|||||||
int partial_bit_count = mb->partial_bit_count;
|
int partial_bit_count = mb->partial_bit_count;
|
||||||
int level, run, vlc_len, index;
|
int level, run, vlc_len, index;
|
||||||
|
|
||||||
OPEN_READER(re, gb);
|
OPEN_READER_NOSIZE(re, gb);
|
||||||
UPDATE_CACHE(re, gb);
|
UPDATE_CACHE(re, gb);
|
||||||
|
|
||||||
/* if we must parse a partial VLC, we do it here */
|
/* if we must parse a partial VLC, we do it here */
|
||||||
|
@ -125,17 +125,18 @@ typedef struct RL_VLC_ELEM {
|
|||||||
# define MIN_CACHE_BITS 25
|
# define MIN_CACHE_BITS 25
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UNCHECKED_BITSTREAM_READER
|
#define OPEN_READER_NOSIZE(name, gb) \
|
||||||
#define OPEN_READER(name, gb) \
|
|
||||||
unsigned int name ## _index = (gb)->index; \
|
unsigned int name ## _index = (gb)->index; \
|
||||||
unsigned int av_unused name ## _cache
|
unsigned int av_unused name ## _cache
|
||||||
|
|
||||||
|
#if UNCHECKED_BITSTREAM_READER
|
||||||
|
#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
|
||||||
|
|
||||||
#define BITS_AVAILABLE(name, gb) 1
|
#define BITS_AVAILABLE(name, gb) 1
|
||||||
#else
|
#else
|
||||||
#define OPEN_READER(name, gb) \
|
#define OPEN_READER(name, gb) \
|
||||||
unsigned int name ## _index = (gb)->index; \
|
OPEN_READER_NOSIZE(name, gb); \
|
||||||
unsigned int av_unused name ## _cache = 0; \
|
unsigned int name ## _size_plus8 = (gb)->size_in_bits_plus8
|
||||||
unsigned int av_unused name ## _size_plus8 = (gb)->size_in_bits_plus8
|
|
||||||
|
|
||||||
#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
|
#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
|
||||||
#endif
|
#endif
|
||||||
@ -286,7 +287,7 @@ static inline unsigned int get_bits_le(GetBitContext *s, int n)
|
|||||||
static inline unsigned int show_bits(GetBitContext *s, int n)
|
static inline unsigned int show_bits(GetBitContext *s, int n)
|
||||||
{
|
{
|
||||||
register int tmp;
|
register int tmp;
|
||||||
OPEN_READER(re, s);
|
OPEN_READER_NOSIZE(re, s);
|
||||||
av_assert2(n>0 && n<=25);
|
av_assert2(n>0 && n<=25);
|
||||||
UPDATE_CACHE(re, s);
|
UPDATE_CACHE(re, s);
|
||||||
tmp = SHOW_UBITS(re, s, n);
|
tmp = SHOW_UBITS(re, s, n);
|
||||||
|
Loading…
Reference in New Issue
Block a user