Browse Source

lavc: Add get_bitsz()

get_bit variant supporting 0-bits reads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n3.0
Andreas Cadhalpun Luca Barbato 9 years ago
parent
commit
62825236db
2 changed files with 8 additions and 7 deletions
  1. +8
    -0
      libavcodec/get_bits.h
  2. +0
    -7
      libavcodec/mpegaudiodec_template.c

+ 8
- 0
libavcodec/get_bits.h View File

@@ -249,6 +249,14 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
return tmp;
}

/**
* Read 0-25 bits.
*/
static av_always_inline int get_bitsz(GetBitContext *s, int n)
{
return n ? get_bits(s, n) : 0;
}

/**
* Show 1-25 bits.
*/


+ 0
- 7
libavcodec/mpegaudiodec_template.c View File

@@ -795,13 +795,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,
int *end_pos2)
{


Loading…
Cancel
Save