Lines Matching refs:vlc
119 static int alloc_table(VLC *vlc, int size, int use_static)
122 index = vlc->table_size;
123 vlc->table_size += size;
124 if (vlc->table_size > vlc->table_allocated) {
127 vlc->table_allocated += (1 << vlc->bits);
129 vlc->table = ff_realloc_static(vlc->table,
130 sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
132 vlc->table = av_realloc(vlc->table,
133 sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
134 if (!vlc->table)
140 static int build_table(VLC *vlc, int table_nb_bits,
152 table_index = alloc_table(vlc, table_size, flags & (INIT_VLC_USE_STATIC|INIT_VLC_USE_NEW_STATIC));
159 table = &vlc->table[table_index];
231 index = build_table(vlc, n, nb_codes,
240 table = &vlc->table[table_index];
256 'bits' : table which gives the size (in bits) of each vlc code.
258 'codes' : table which gives the bit pattern of of each vlc code.
274 int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
280 vlc->bits = nb_bits;
282 if(vlc->table_size && vlc->table_size == vlc->table_allocated){
284 }else if(vlc->table_size){
288 vlc->table = NULL;
289 vlc->table_allocated = 0;
290 vlc->table_size = 0;
293 if vlc->table != NULL to avoid double allocation */
294 if(vlc->table)
302 if (build_table(vlc, nb_bits, nb_codes,
307 av_freep(&vlc->table);
310 if((flags & INIT_VLC_USE_NEW_STATIC) && vlc->table_size != vlc->table_allocated)
311 av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated);
316 void free_vlc(VLC *vlc)
318 av_freep(&vlc->table);