add init_vlc_sparse(). faster than init_vlc() if there are lots of holes in the tables.

Originally committed as revision 9117 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Loren Merritt
2007-05-24 17:38:56 +00:00
parent 4d5588cfb8
commit b613bacca9
2 changed files with 25 additions and 5 deletions

View File

@@ -799,9 +799,19 @@ static inline void align_get_bits(GetBitContext *s)
if(n) skip_bits(s, n);
}
int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
#define init_vlc(vlc, nb_bits, nb_codes,\
bits, bits_wrap, bits_size,\
codes, codes_wrap, codes_size,\
flags)\
init_vlc_sparse(vlc, nb_bits, nb_codes,\
bits, bits_wrap, bits_size,\
codes, codes_wrap, codes_size,\
NULL, 0, 0, flags)
int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
const void *symbols, int symbols_wrap, int symbols_size,
int flags);
#define INIT_VLC_USE_STATIC 1
#define INIT_VLC_LE 2