diff options
author | Martijn van Beurden <mvanb1@gmail.com> | 2022-10-11 19:24:35 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-12-26 21:15:36 +0100 |
commit | 909cfdc2059a53ffb55af3b9e0aadcaacae4a339 (patch) | |
tree | 274d6543dd851195daa27f7536978d27f97710df /libavcodec/get_bits.h | |
parent | eeb280f3518a8d7fc2e45f06ac7748f42d8a0000 (diff) | |
download | ffmpeg-909cfdc2059a53ffb55af3b9e0aadcaacae4a339.tar.gz |
libavcodec/flacdec: Implement decoding of 32 bit-per-sample PCM
Add decoding of FLAC files coding for 32 bit-per-sample PCM to libavcodec.
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r-- | libavcodec/get_bits.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 992765dc92..52d13b8242 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -597,6 +597,18 @@ static inline int get_sbits_long(GetBitContext *s, int n) } /** + * Read 0-64 bits as a signed integer. + */ +static inline int64_t get_sbits64(GetBitContext *s, int n) +{ + // sign_extend(x, 0) is undefined + if (!n) + return 0; + + return sign_extend64(get_bits64(s, n), n); +} + +/** * Show 0-32 bits. */ static inline unsigned int show_bits_long(GetBitContext *s, int n) |