FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wma.c
Go to the documentation of this file.
1 /*
2  * WMA compatible codec
3  * Copyright (c) 2002-2007 The FFmpeg Project
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/attributes.h"
23 
24 #include "avcodec.h"
25 #include "internal.h"
26 #include "sinewin.h"
27 #include "wma.h"
28 #include "wma_common.h"
29 #include "wma_freqs.h"
30 #include "wmadata.h"
31 
32 /* XXX: use same run/length optimization as mpeg decoders */
33 // FIXME maybe split decode / encode or pass flag
34 static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table,
35  float **plevel_table, uint16_t **pint_table,
36  const CoefVLCTable *vlc_table)
37 {
38  int n = vlc_table->n;
39  const uint8_t *table_bits = vlc_table->huffbits;
40  const uint32_t *table_codes = vlc_table->huffcodes;
41  const uint16_t *levels_table = vlc_table->levels;
42  uint16_t *run_table, *level_table, *int_table;
43  float *flevel_table;
44  int i, l, j, k, level;
45 
46  init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
47 
48  run_table = av_malloc_array(n, sizeof(uint16_t));
49  level_table = av_malloc_array(n, sizeof(uint16_t));
50  flevel_table = av_malloc_array(n, sizeof(*flevel_table));
51  int_table = av_malloc_array(n, sizeof(uint16_t));
52  if (!run_table || !level_table || !flevel_table || !int_table) {
53  av_freep(&run_table);
54  av_freep(&level_table);
55  av_freep(&flevel_table);
56  av_freep(&int_table);
57  return AVERROR(ENOMEM);
58  }
59  i = 2;
60  level = 1;
61  k = 0;
62  while (i < n) {
63  int_table[k] = i;
64  l = levels_table[k++];
65  for (j = 0; j < l; j++) {
66  run_table[i] = j;
67  level_table[i] = level;
68  flevel_table[i] = level;
69  i++;
70  }
71  level++;
72  }
73  *prun_table = run_table;
74  *plevel_table = flevel_table;
75  *pint_table = int_table;
76  av_free(level_table);
77 
78  return 0;
79 }
80 
81 av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
82 {
83  WMACodecContext *s = avctx->priv_data;
84  int i, ret;
85  float bps1, high_freq;
86  volatile float bps;
87  int sample_rate1;
88  int coef_vlc_table;
89 
90  if (avctx->sample_rate <= 0 || avctx->sample_rate > 50000 ||
91  avctx->channels <= 0 || avctx->channels > 2 ||
92  avctx->bit_rate <= 0)
93  return -1;
94 
95 
96  if (avctx->codec->id == AV_CODEC_ID_WMAV1)
97  s->version = 1;
98  else
99  s->version = 2;
100 
101  /* compute MDCT block size */
103  s->version, 0);
107 
108  s->frame_len = 1 << s->frame_len_bits;
109  if (s->use_variable_block_len) {
110  int nb_max, nb;
111  nb = ((flags2 >> 3) & 3) + 1;
112  if ((avctx->bit_rate / avctx->channels) >= 32000)
113  nb += 2;
114  nb_max = s->frame_len_bits - BLOCK_MIN_BITS;
115  if (nb > nb_max)
116  nb = nb_max;
117  s->nb_block_sizes = nb + 1;
118  } else
119  s->nb_block_sizes = 1;
120 
121  /* init rate dependent parameters */
122  s->use_noise_coding = 1;
123  high_freq = avctx->sample_rate * 0.5;
124 
125  /* if version 2, then the rates are normalized */
126  sample_rate1 = avctx->sample_rate;
127  if (s->version == 2) {
128  if (sample_rate1 >= 44100)
129  sample_rate1 = 44100;
130  else if (sample_rate1 >= 22050)
131  sample_rate1 = 22050;
132  else if (sample_rate1 >= 16000)
133  sample_rate1 = 16000;
134  else if (sample_rate1 >= 11025)
135  sample_rate1 = 11025;
136  else if (sample_rate1 >= 8000)
137  sample_rate1 = 8000;
138  }
139 
140  bps = (float) avctx->bit_rate /
141  (float) (avctx->channels * avctx->sample_rate);
142  s->byte_offset_bits = av_log2((int) (bps * s->frame_len / 8.0 + 0.5)) + 2;
143  if (s->byte_offset_bits + 3 > MIN_CACHE_BITS) {
144  av_log(avctx, AV_LOG_ERROR, "byte_offset_bits %d is too large\n", s->byte_offset_bits);
145  return AVERROR_PATCHWELCOME;
146  }
147 
148  /* compute high frequency value and choose if noise coding should
149  * be activated */
150  bps1 = bps;
151  if (avctx->channels == 2)
152  bps1 = bps * 1.6;
153  if (sample_rate1 == 44100) {
154  if (bps1 >= 0.61)
155  s->use_noise_coding = 0;
156  else
157  high_freq = high_freq * 0.4;
158  } else if (sample_rate1 == 22050) {
159  if (bps1 >= 1.16)
160  s->use_noise_coding = 0;
161  else if (bps1 >= 0.72)
162  high_freq = high_freq * 0.7;
163  else
164  high_freq = high_freq * 0.6;
165  } else if (sample_rate1 == 16000) {
166  if (bps > 0.5)
167  high_freq = high_freq * 0.5;
168  else
169  high_freq = high_freq * 0.3;
170  } else if (sample_rate1 == 11025)
171  high_freq = high_freq * 0.7;
172  else if (sample_rate1 == 8000) {
173  if (bps <= 0.625)
174  high_freq = high_freq * 0.5;
175  else if (bps > 0.75)
176  s->use_noise_coding = 0;
177  else
178  high_freq = high_freq * 0.65;
179  } else {
180  if (bps >= 0.8)
181  high_freq = high_freq * 0.75;
182  else if (bps >= 0.6)
183  high_freq = high_freq * 0.6;
184  else
185  high_freq = high_freq * 0.5;
186  }
187  ff_dlog(s->avctx, "flags2=0x%x\n", flags2);
188  ff_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
189  s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate,
190  avctx->block_align);
191  ff_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
192  bps, bps1, high_freq, s->byte_offset_bits);
193  ff_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
195 
196  /* compute the scale factor band sizes for each MDCT block size */
197  {
198  int a, b, pos, lpos, k, block_len, i, j, n;
199  const uint8_t *table;
200 
201  if (s->version == 1)
202  s->coefs_start = 3;
203  else
204  s->coefs_start = 0;
205  for (k = 0; k < s->nb_block_sizes; k++) {
206  block_len = s->frame_len >> k;
207 
208  if (s->version == 1) {
209  lpos = 0;
210  for (i = 0; i < 25; i++) {
211  a = ff_wma_critical_freqs[i];
212  b = avctx->sample_rate;
213  pos = ((block_len * 2 * a) + (b >> 1)) / b;
214  if (pos > block_len)
215  pos = block_len;
216  s->exponent_bands[0][i] = pos - lpos;
217  if (pos >= block_len) {
218  i++;
219  break;
220  }
221  lpos = pos;
222  }
223  s->exponent_sizes[0] = i;
224  } else {
225  /* hardcoded tables */
226  table = NULL;
227  a = s->frame_len_bits - BLOCK_MIN_BITS - k;
228  if (a < 3) {
229  if (avctx->sample_rate >= 44100)
230  table = exponent_band_44100[a];
231  else if (avctx->sample_rate >= 32000)
232  table = exponent_band_32000[a];
233  else if (avctx->sample_rate >= 22050)
234  table = exponent_band_22050[a];
235  }
236  if (table) {
237  n = *table++;
238  for (i = 0; i < n; i++)
239  s->exponent_bands[k][i] = table[i];
240  s->exponent_sizes[k] = n;
241  } else {
242  j = 0;
243  lpos = 0;
244  for (i = 0; i < 25; i++) {
245  a = ff_wma_critical_freqs[i];
246  b = avctx->sample_rate;
247  pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
248  pos <<= 2;
249  if (pos > block_len)
250  pos = block_len;
251  if (pos > lpos)
252  s->exponent_bands[k][j++] = pos - lpos;
253  if (pos >= block_len)
254  break;
255  lpos = pos;
256  }
257  s->exponent_sizes[k] = j;
258  }
259  }
260 
261  /* max number of coefs */
262  s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k;
263  /* high freq computation */
264  s->high_band_start[k] = (int) ((block_len * 2 * high_freq) /
265  avctx->sample_rate + 0.5);
266  n = s->exponent_sizes[k];
267  j = 0;
268  pos = 0;
269  for (i = 0; i < n; i++) {
270  int start, end;
271  start = pos;
272  pos += s->exponent_bands[k][i];
273  end = pos;
274  if (start < s->high_band_start[k])
275  start = s->high_band_start[k];
276  if (end > s->coefs_end[k])
277  end = s->coefs_end[k];
278  if (end > start)
279  s->exponent_high_bands[k][j++] = end - start;
280  }
281  s->exponent_high_sizes[k] = j;
282 #if 0
283  ff_tlog(s->avctx, "%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
284  s->frame_len >> k,
285  s->coefs_end[k],
286  s->high_band_start[k],
287  s->exponent_high_sizes[k]);
288  for (j = 0; j < s->exponent_high_sizes[k]; j++)
289  ff_tlog(s->avctx, " %d", s->exponent_high_bands[k][j]);
290  ff_tlog(s->avctx, "\n");
291 #endif /* 0 */
292  }
293  }
294 
295 #ifdef TRACE
296  {
297  int i, j;
298  for (i = 0; i < s->nb_block_sizes; i++) {
299  ff_tlog(s->avctx, "%5d: n=%2d:",
300  s->frame_len >> i,
301  s->exponent_sizes[i]);
302  for (j = 0; j < s->exponent_sizes[i]; j++)
303  ff_tlog(s->avctx, " %d", s->exponent_bands[i][j]);
304  ff_tlog(s->avctx, "\n");
305  }
306  }
307 #endif /* TRACE */
308 
309  /* init MDCT windows : simple sine window */
310  for (i = 0; i < s->nb_block_sizes; i++) {
312  s->windows[i] = ff_sine_windows[s->frame_len_bits - i];
313  }
314 
315  s->reset_block_lengths = 1;
316 
317  if (s->use_noise_coding) {
318  /* init the noise generator */
319  if (s->use_exp_vlc)
320  s->noise_mult = 0.02;
321  else
322  s->noise_mult = 0.04;
323 
324 #ifdef TRACE
325  for (i = 0; i < NOISE_TAB_SIZE; i++)
326  s->noise_table[i] = 1.0 * s->noise_mult;
327 #else
328  {
329  unsigned int seed;
330  float norm;
331  seed = 1;
332  norm = (1.0 / (float) (1LL << 31)) * sqrt(3) * s->noise_mult;
333  for (i = 0; i < NOISE_TAB_SIZE; i++) {
334  seed = seed * 314159 + 1;
335  s->noise_table[i] = (float) ((int) seed) * norm;
336  }
337  }
338 #endif /* TRACE */
339  }
340 
341  s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
342  if (!s->fdsp)
343  return AVERROR(ENOMEM);
344 
345  /* choose the VLC tables for the coefficients */
346  coef_vlc_table = 2;
347  if (avctx->sample_rate >= 32000) {
348  if (bps1 < 0.72)
349  coef_vlc_table = 0;
350  else if (bps1 < 1.16)
351  coef_vlc_table = 1;
352  }
353  s->coef_vlcs[0] = &coef_vlcs[coef_vlc_table * 2];
354  s->coef_vlcs[1] = &coef_vlcs[coef_vlc_table * 2 + 1];
355  ret = init_coef_vlc(&s->coef_vlc[0], &s->run_table[0], &s->level_table[0],
356  &s->int_table[0], s->coef_vlcs[0]);
357  if (ret < 0)
358  return ret;
359 
360  return init_coef_vlc(&s->coef_vlc[1], &s->run_table[1], &s->level_table[1],
361  &s->int_table[1], s->coef_vlcs[1]);
362 }
363 
364 int ff_wma_total_gain_to_bits(int total_gain)
365 {
366  if (total_gain < 15)
367  return 13;
368  else if (total_gain < 32)
369  return 12;
370  else if (total_gain < 40)
371  return 11;
372  else if (total_gain < 45)
373  return 10;
374  else
375  return 9;
376 }
377 
379 {
380  WMACodecContext *s = avctx->priv_data;
381  int i;
382 
383  for (i = 0; i < s->nb_block_sizes; i++)
384  ff_mdct_end(&s->mdct_ctx[i]);
385 
386  if (s->use_exp_vlc)
387  ff_free_vlc(&s->exp_vlc);
388  if (s->use_noise_coding)
389  ff_free_vlc(&s->hgain_vlc);
390  for (i = 0; i < 2; i++) {
391  ff_free_vlc(&s->coef_vlc[i]);
392  av_freep(&s->run_table[i]);
393  av_freep(&s->level_table[i]);
394  av_freep(&s->int_table[i]);
395  }
396  av_freep(&s->fdsp);
397 
398  return 0;
399 }
400 
401 /**
402  * Decode an uncompressed coefficient.
403  * @param gb GetBitContext
404  * @return the decoded coefficient
405  */
407 {
408  /** consumes up to 34 bits */
409  int n_bits = 8;
410  /** decode length */
411  if (get_bits1(gb)) {
412  n_bits += 8;
413  if (get_bits1(gb)) {
414  n_bits += 8;
415  if (get_bits1(gb))
416  n_bits += 7;
417  }
418  }
419  return get_bits_long(gb, n_bits);
420 }
421 
422 /**
423  * Decode run level compressed coefficients.
424  * @param avctx codec context
425  * @param gb bitstream reader context
426  * @param vlc vlc table for get_vlc2
427  * @param level_table level codes
428  * @param run_table run codes
429  * @param version 0 for wma1,2 1 for wmapro
430  * @param ptr output buffer
431  * @param offset offset in the output buffer
432  * @param num_coefs number of input coefficents
433  * @param block_len input buffer length (2^n)
434  * @param frame_len_bits number of bits for escaped run codes
435  * @param coef_nb_bits number of bits for escaped level codes
436  * @return 0 on success, -1 otherwise
437  */
439  VLC *vlc, const float *level_table,
440  const uint16_t *run_table, int version,
441  WMACoef *ptr, int offset, int num_coefs,
442  int block_len, int frame_len_bits,
443  int coef_nb_bits)
444 {
445  int code, level, sign;
446  const uint32_t *ilvl = (const uint32_t *) level_table;
447  uint32_t *iptr = (uint32_t *) ptr;
448  const unsigned int coef_mask = block_len - 1;
449  for (; offset < num_coefs; offset++) {
450  code = get_vlc2(gb, vlc->table, VLCBITS, VLCMAX);
451  if (code > 1) {
452  /** normal code */
453  offset += run_table[code];
454  sign = get_bits1(gb) - 1;
455  iptr[offset & coef_mask] = ilvl[code] ^ (sign & 0x80000000);
456  } else if (code == 1) {
457  /** EOB */
458  break;
459  } else {
460  /** escape */
461  if (!version) {
462  level = get_bits(gb, coef_nb_bits);
463  /** NOTE: this is rather suboptimal. reading
464  * block_len_bits would be better */
465  offset += get_bits(gb, frame_len_bits);
466  } else {
467  level = ff_wma_get_large_val(gb);
468  /** escape decode */
469  if (get_bits1(gb)) {
470  if (get_bits1(gb)) {
471  if (get_bits1(gb)) {
472  av_log(avctx, AV_LOG_ERROR,
473  "broken escape sequence\n");
474  return -1;
475  } else
476  offset += get_bits(gb, frame_len_bits) + 4;
477  } else
478  offset += get_bits(gb, 2) + 1;
479  }
480  }
481  sign = get_bits1(gb) - 1;
482  ptr[offset & coef_mask] = (level ^ sign) - sign;
483  }
484  }
485  /** NOTE: EOB can be omitted */
486  if (offset > num_coefs) {
487  av_log(avctx, AV_LOG_ERROR,
488  "overflow (%d > %d) in spectral RLE, ignoring\n",
489  offset,
490  num_coefs
491  );
492  return -1;
493  }
494 
495  return 0;
496 }
#define ff_tlog(ctx,...)
Definition: internal.h:60
#define NULL
Definition: coverity.c:32
const struct AVCodec * codec
Definition: avcodec.h:1250
const char * s
Definition: avisynth_c.h:631
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:260
int next_block_len_bits
log2 of next block length
Definition: wma.h:105
const char * b
Definition: vf_curves.c:109
int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb, VLC *vlc, const float *level_table, const uint16_t *run_table, int version, WMACoef *ptr, int offset, int num_coefs, int block_len, int frame_len_bits, int coef_nb_bits)
Decode run level compressed coefficients.
Definition: wma.c:438
#define BLOCK_MIN_BITS
Definition: wma.h:33
const uint16_t ff_wma_critical_freqs[25]
Definition: wma_freqs.c:23
const uint8_t * huffbits
VLC bit size.
Definition: wma.h:63
int version
Definition: avisynth_c.h:629
int n
total number of codes
Definition: wma.h:60
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: avcodec.h:2022
#define NOISE_TAB_SIZE
Definition: wma.h:49
Macro definitions for various function/variable attributes.
int high_band_start[BLOCK_NB_SIZES]
index of first coef in high band
Definition: wma.h:80
int exponent_sizes[BLOCK_NB_SIZES]
Definition: wma.h:78
uint8_t
#define av_cold
Definition: attributes.h:74
float WMACoef
type for decoded coefficients, int16_t would be enough for wma 1/2
Definition: wma.h:57
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:67
Various WMA tables.
const uint32_t * huffcodes
VLC bit values.
Definition: wma.h:62
#define CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Definition: avcodec.h:759
#define av_log(a,...)
int reset_block_lengths
Definition: wma.h:103
int nb_block_sizes
number of block sizes
Definition: wma.h:101
int ff_wma_total_gain_to_bits(int total_gain)
Definition: wma.c:364
uint16_t * int_table[2]
Definition: wma.h:96
enum AVCodecID id
Definition: avcodec.h:3195
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
static const struct endianess table[]
uint16_t exponent_bands[BLOCK_NB_SIZES][25]
Definition: wma.h:79
#define VLCBITS
Definition: wma.h:54
static const uint8_t offset[127][2]
Definition: vf_spp.c:92
Libavcodec external API header.
Definition: get_bits.h:63
int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]
Definition: wma.h:84
int ff_wma_end(AVCodecContext *avctx)
Definition: wma.c:378
AVFloatDSPContext * fdsp
Definition: wma.h:134
int bit_rate
the average bitrate
Definition: avcodec.h:1305
static const uint8_t exponent_band_44100[3][25]
Definition: wmadata.h:48
ret
Definition: avfilter.c:974
av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
Definition: wma.c:81
uint16_t * run_table[2]
Definition: wma.h:94
int version
1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
Definition: wma.h:71
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:555
int n
Definition: avisynth_c.h:547
int frame_len
frame length in samples
Definition: wma.h:99
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
int frame_len_bits
frame_len = 1 << frame_len_bits
Definition: wma.h:100
#define ff_dlog(ctx,...)
Definition: internal.h:54
int sample_rate
samples per second
Definition: avcodec.h:1985
int use_exp_vlc
exponent coding: 0 = lsp, 1 = vlc + delta
Definition: wma.h:74
VLC coef_vlc[2]
Definition: wma.h:93
main external API structure.
Definition: avcodec.h:1241
#define VLCMAX
Definition: wma.h:55
static unsigned int seed
Definition: videogen.c:78
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
Definition: get_bits.h:457
AVCodecContext * avctx
Definition: wma.h:68
int exponent_high_sizes[BLOCK_NB_SIZES]
Definition: wma.h:83
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:304
int use_noise_coding
true if perceptual noise is added
Definition: wma.h:75
SINETABLE_CONST float *const ff_sine_windows[14]
float * level_table[2]
Definition: wma.h:95
int use_variable_block_len
Definition: wma.h:73
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
Definition: float_dsp.c:143
VLC exp_vlc
Definition: wma.h:77
FFTContext mdct_ctx[BLOCK_NB_SIZES]
Definition: wma.h:118
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
Definition: get_bits.h:337
#define MIN_CACHE_BITS
Definition: get_bits.h:125
av_cold int ff_wma_get_frame_len_bits(int sample_rate, int version, unsigned int decode_flags)
Get the samples per frame for this stream.
Definition: wma_common.c:32
uint8_t level
Definition: svq3.c:150
int prev_block_len_bits
log2 of prev block length
Definition: wma.h:106
int coefs_end[BLOCK_NB_SIZES]
max number of coded coefficients
Definition: wma.h:82
common internal api header.
#define ff_mdct_end
Definition: fft.h:168
unsigned bps
Definition: movenc.c:1334
void * priv_data
Definition: avcodec.h:1283
#define av_free(p)
int channels
number of audio channels
Definition: avcodec.h:1986
#define av_log2
Definition: intmath.h:105
VLC_TYPE(* table)[2]
code, bits
Definition: get_bits.h:65
static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table, float **plevel_table, uint16_t **pint_table, const CoefVLCTable *vlc_table)
Definition: wma.c:34
unsigned int ff_wma_get_large_val(GetBitContext *gb)
Decode an uncompressed coefficient.
Definition: wma.c:406
static const CoefVLCTable coef_vlcs[6]
Definition: wmadata.h:1375
#define av_freep(p)
VLC hgain_vlc
Definition: wma.h:85
int coefs_start
first coded coef
Definition: wma.h:81
void INT64 start
Definition: avisynth_c.h:553
int block_len_bits
log2 of current block length
Definition: wma.h:104
#define av_malloc_array(a, b)
int byte_offset_bits
Definition: wma.h:76
static const uint8_t exponent_band_22050[3][25]
Definition: wmadata.h:35
static const uint8_t exponent_band_32000[3][25]
Definition: wmadata.h:42
void ff_free_vlc(VLC *vlc)
Definition: bitstream.c:359
void ff_init_ff_sine_windows(int index)
initialize the specified entry of ff_sine_windows
float noise_table[NOISE_TAB_SIZE]
Definition: wma.h:126
const uint16_t * levels
table to build run/level tables
Definition: wma.h:64
float noise_mult
Definition: wma.h:128
const float * windows[BLOCK_NB_SIZES]
Definition: wma.h:119