diff options
| author | Mohamed Tarek <mt@rockbox.org> | 2010-07-15 05:38:09 +0000 |
|---|---|---|
| committer | Mohamed Tarek <mt@rockbox.org> | 2010-07-15 05:38:09 +0000 |
| commit | 387af97a26105fce79e6a8726752cf183d40939e (patch) | |
| tree | 25c7898bbf08963b9c7688c8937061b4b3491dec /apps/codecs/libwmapro/get_bits.h | |
| parent | 5d2969c94e97c81e3eb88211b921be80b66bd691 (diff) | |
| download | rockbox-387af97a26105fce79e6a8726752cf183d40939e.zip rockbox-387af97a26105fce79e6a8726752cf183d40939e.tar.gz rockbox-387af97a26105fce79e6a8726752cf183d40939e.tar.bz2 rockbox-387af97a26105fce79e6a8726752cf183d40939e.tar.xz | |
Initial cleanup for libwmapro.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27425 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/get_bits.h')
| -rw-r--r-- | apps/codecs/libwmapro/get_bits.h | 52 |
1 files changed, 14 insertions, 38 deletions
diff --git a/apps/codecs/libwmapro/get_bits.h b/apps/codecs/libwmapro/get_bits.h index ecbfc69..84853d8 100644 --- a/apps/codecs/libwmapro/get_bits.h +++ b/apps/codecs/libwmapro/get_bits.h @@ -30,10 +30,20 @@ #include <stdlib.h> //#include <assert.h> #include "libavutil/bswap.h" -#include "libavutil/common.h" +//#include "libavutil/common.h" #include "libavutil/intreadwrite.h" -#include "libavutil/log.h" -#include "mathops.h" +//#include "libavutil/log.h" + +#define av_log(...) + +/* NEG_* were taken from mathops.h */ +#ifndef NEG_SSR32 +# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) +#endif + +#ifndef NEG_USR32 +# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) +#endif #if defined(ALT_BITSTREAM_READER_LE) && !defined(ALT_BITSTREAM_READER) # define ALT_BITSTREAM_READER @@ -321,24 +331,6 @@ static inline void skip_bits_long(GetBitContext *s, int n){ #endif -/** - * read mpeg1 dc style vlc (sign bit + mantisse with no MSB). - * if MSB not set it is negative - * @param n length in bits - * @author BERO - */ -static inline int get_xbits(GetBitContext *s, int n){ - register int sign; - register int32_t cache; - OPEN_READER(re, s) - UPDATE_CACHE(re, s) - cache = GET_CACHE(re,s); - sign=(~cache)>>31; - LAST_SKIP_BITS(re, s, n) - CLOSE_READER(re, s) - return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; -} - static inline int get_sbits(GetBitContext *s, int n){ register int tmp; OPEN_READER(re, s) @@ -429,13 +421,6 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n){ } /** - * reads 0-32 bits as a signed integer. - */ -static inline int get_sbits_long(GetBitContext *s, int n) { - return sign_extend(get_bits_long(s, n), n); -} - -/** * shows 0-32 bits. */ static inline unsigned int show_bits_long(GetBitContext *s, int n){ @@ -446,15 +431,6 @@ static inline unsigned int show_bits_long(GetBitContext *s, int n){ } } -static inline int check_marker(GetBitContext *s, const char *msg) -{ - int bit= get_bits1(s); - if(!bit) - av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg); - - return bit; -} - /** * init GetBitContext. * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits @@ -594,7 +570,7 @@ void free_vlc(VLC *vlc); * read the longest vlc code * = (max_vlc_length + bits - 1) / bits */ -static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], +static inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth) { int code; |