Lines Matching refs:vlc
99 static int alloc_table(VLC *vlc, int size, int use_static)
102 index = vlc->table_size;
103 vlc->table_size += size;
104 if (vlc->table_size > vlc->table_allocated) {
107 vlc->table_allocated += (1 << vlc->bits);
108 vlc->table = av_realloc(vlc->table,
109 sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
110 if (!vlc->table)
140 * @param vlc the context to be initted
142 * @param table_nb_bits max length of vlc codes to store directly in this table
147 * @param codes descriptions of the vlc codes
151 static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
160 table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
164 table = &vlc->table[table_index];
219 index = build_table(vlc, subtable_bits, k-i, codes+i, flags);
223 table = &vlc->table[table_index];
240 'bits' : table which gives the size (in bits) of each vlc code.
242 'codes' : table which gives the bit pattern of of each vlc code.
258 int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
267 vlc->bits = nb_bits;
269 if(vlc->table_size && vlc->table_size == vlc->table_allocated){
271 }else if(vlc->table_size){
275 vlc->table = NULL;
276 vlc->table_allocated = 0;
277 vlc->table_size = 0;
308 ret = build_table(vlc, nb_bits, nb_codes, buf, flags);
312 av_freep(&vlc->table);
315 if((flags & INIT_VLC_USE_NEW_STATIC) && vlc->table_size != vlc->table_allocated)
316 av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated);
321 void ff_free_vlc(VLC *vlc)
323 av_freep(&vlc->table);