* 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)
s->index = 0;
}
-int init_vlc(struct vlc *vlc, int nb_bits, int nb_codes,
- const void *bits, const void *codes, int codes_wrap, int codes_size);
+void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes,
+ const void *bits, const void *codes, int codes_wrap,
+ int codes_size);
void free_vlc(struct vlc *vlc);