Lines Matching defs:code
97 int *recode; ///< table for converting from code indexes to values
106 int max_bits; ///< maximum length of code
107 int min_bits; ///< minimum length of code
117 * @returns the length of the longest code or an AVERROR code
149 static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
164 "length: %i, max code length: %i\n", huff.val_bits, huff.max_bits);
201 res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num,
207 code->bits = huff.max_bits;
208 code->length = huff.max_num;
209 code->recode = huff.nums;
222 static void tm2_free_codes(TM2Codes *code)
224 av_free(code->recode);
225 if (code->vlc.table)
226 ff_free_vlc(&code->vlc);
229 static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
232 val = get_vlc2(gb, code->vlc.table, code->bits, 1);
235 return code->recode[val];