diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-07-13 14:55:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-07-13 14:55:12 +0000 |
commit | 45a82edbdd041c264521600d5c8195d279c0211e (patch) | |
tree | f6cb9f48760c698dcf730fdc0a06420d5cd69361 /libavcodec/common.h | |
parent | 6b765cd276a1395cc33a361cd07ab418520c2b9f (diff) | |
download | ffmpeg-45a82edbdd041c264521600d5c8195d279c0211e.tar.gz |
rl vlc decoding optimizations
Originally committed as revision 748 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r-- | libavcodec/common.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h index 13ac0693d7..65bfc5127b 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -238,6 +238,12 @@ typedef struct VLC { int table_size, table_allocated; } VLC; +typedef struct RL_VLC_ELEM { + int16_t level; + int8_t len; + uint8_t run; +} RL_VLC_ELEM; + /* used to avoid missaligned exceptions on some archs (alpha, ...) */ #ifdef ARCH_X86 #define unaligned32(a) (*(UINT32*)(a)) @@ -755,6 +761,28 @@ void free_vlc(VLC *vlc); SKIP_BITS(name, gb, n)\ } +#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth)\ +{\ + int n, index, nb_bits;\ +\ + index= SHOW_UBITS(name, gb, bits);\ + level = table[index].level;\ + n = table[index].len;\ +\ + if(max_depth > 1 && n < 0){\ + LAST_SKIP_BITS(name, gb, bits)\ + UPDATE_CACHE(name, gb)\ +\ + nb_bits = -n;\ +\ + index= SHOW_UBITS(name, gb, nb_bits) + level;\ + level = table[index].level;\ + n = table[index].len;\ + }\ + run= table[index].run;\ + SKIP_BITS(name, gb, n)\ +} + // deprecated, dont use get_vlc for new code, use get_vlc2 instead or use GET_VLC directly static inline int get_vlc(GetBitContext *s, VLC *vlc) { @@ -783,6 +811,7 @@ static inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int return code; } + /* define it to include statistics code (useful only for optimizing codec efficiency */ //#define STATS |