Commit 713654d9 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

get_bits: add get_bitsz for reading 0-25 bits

This can be used to simplify code in a couple of places.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 97c162ad
...@@ -269,6 +269,14 @@ static inline unsigned int get_bits(GetBitContext *s, int n) ...@@ -269,6 +269,14 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
return tmp; return tmp;
} }
/**
* Read 0-25 bits.
*/
static av_always_inline int get_bitsz(GetBitContext *s, int n)
{
return n ? get_bits(s, n) : 0;
}
static inline unsigned int get_bits_le(GetBitContext *s, int n) static inline unsigned int get_bits_le(GetBitContext *s, int n)
{ {
register int tmp; register int tmp;
......
...@@ -816,13 +816,6 @@ static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g, ...@@ -816,13 +816,6 @@ static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g,
} }
} }
/* handle n = 0 too */
static inline int get_bitsz(GetBitContext *s, int n)
{
return n ? get_bits(s, n) : 0;
}
static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos, static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos,
int *end_pos2) int *end_pos2)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment