} \
}
-static int alloc_table(struct vlc *vlc, int size)
+static void alloc_table(struct vlc *vlc, int size)
{
- int idx;
-
- idx = vlc->table_size;
vlc->table_size += size;
if (vlc->table_size > vlc->table_allocated) {
vlc->table_allocated += (1 << vlc->bits);
vlc->table = para_realloc(vlc->table,
sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
}
- return idx;
}
static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes,
VLC_TYPE(*table)[2];
table_size = 1 << table_nb_bits;
- ret = alloc_table(vlc, table_size);
- if (ret < 0)
- return ret;
- table_index = ret;
+ table_index = vlc->table_size;
+ alloc_table(vlc, table_size);
table = &vlc->table[table_index];
for (i = 0; i < table_size; i++) {