summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index c094a14caa..c530015169 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -229,6 +229,20 @@ static inline int get_xbits(GetBitContext *s, int n)
return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
}
+static inline int get_xbits_le(GetBitContext *s, int n)
+{
+ register int sign;
+ register int32_t cache;
+ OPEN_READER(re, s);
+ av_assert2(n>0 && n<=25);
+ UPDATE_CACHE_LE(re, s);
+ cache = GET_CACHE(re, s);
+ sign = sign_extend(~cache, n) >> 31;
+ LAST_SKIP_BITS(re, s, n);
+ CLOSE_READER(re, s);
+ return (zero_extend(sign ^ cache, n) ^ sign) - sign;
+}
+
static inline int get_sbits(GetBitContext *s, int n)
{
register int tmp;