From ac2570a8b04cb29044a412238539076180cfbf0f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 18 Feb 2004 01:49:30 +0000 Subject: flac fixes: fix data types of residual&decoded fix twos complement bitfields fix utf8 (no, utf8 is not the same as the simple and compact uvlc used in nut) add truncated bitstream support, both ogg and flac demuxers in mplayer cvs provide incomplete frames, and furthermore it isnt possible to find frameboundaries in flac without decoding it completly add escape-less golomb rice decoder (=flac style golomb rice) (ultra efficient, the longest vlc code is just 2^32-1 bits) printf->av_log fix bps for non independant channels fix a few +-1 bugs fix sample order for independant channels fix data_size Originally committed as revision 2791 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/golomb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavcodec/golomb.h') diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 5ebebe94ce..cd8bdd38d5 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -256,6 +256,14 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int } } +/** + * read unsigned golomb rice code (flac). + */ +static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int esc_len){ + int v= get_ur_golomb_jpegls(gb, k, limit, esc_len); + return (v>>1) ^ -(v&1); +} + #ifdef TRACE static inline int get_ue(GetBitContext *s, char *file, char *func, int line){ -- cgit v1.2.3