X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=bitstream.c;h=e9f7126e00fd7392d72dbf414a5e4aeef35c3fa7;hb=898769a86f1881871bc778135395fd6f4a6129a1;hp=11429489ee2b2fb64fa1e9eac25aaf0148e35594;hpb=d80db52bf117414203ed62480b89f2476e736193;p=paraslash.git diff --git a/bitstream.c b/bitstream.c index 11429489..e9f7126e 100644 --- a/bitstream.c +++ b/bitstream.c @@ -155,22 +155,17 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes, * The wrap and size parameters allow to use any memory configuration and * types (byte/word/long) to store the bits and codes tables. */ -int init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, +void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_wrap, int codes_size) { - int ret; - - PARA_INFO_LOG("nb_codes=%d\n", nb_codes); + PARA_INFO_LOG("nb_codes: %d\n", nb_codes); vlc->bits = nb_bits; vlc->table = NULL; vlc->table_allocated = 0; vlc->table_size = 0; - ret = build_table(vlc, nb_bits, nb_codes, bits, + build_table(vlc, nb_bits, nb_codes, bits, codes, codes_wrap, codes_size, 0, 0); - if (ret < 0) - freep(&vlc->table); - return ret; } void free_vlc(struct vlc *vlc)