FFmpeg
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 "sinewin.h"
26 #include "wma.h"
27 #include "wma_common.h"
28 #include "wma_freqs.h"
29 #include "wmadata.h"
30 
31 /* XXX: use same run/length optimization as mpeg decoders */
32 // FIXME maybe split decode / encode or pass flag
33 static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table,
34  float **plevel_table, uint16_t **pint_table,
35  const CoefVLCTable *vlc_table)
36 {
37  int n = vlc_table->n;
38  const uint8_t *table_bits = vlc_table->huffbits;
39  const uint32_t *table_codes = vlc_table->huffcodes;
40  const uint16_t *levels_table = vlc_table->levels;
41  uint16_t *run_table, *int_table;
42  float *flevel_table;
43  int i, l, j, k, level, ret;
44 
45  ret = vlc_init(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
46  if (ret < 0)
47  return ret;
48 
49  run_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 || !flevel_table || !int_table) {
53  av_freep(&run_table);
54  av_freep(&flevel_table);
55  av_freep(&int_table);
56  return AVERROR(ENOMEM);
57  }
58  i = 2;
59  level = 1;
60  k = 0;
61  while (i < n) {
62  int_table[k] = i;
63  l = levels_table[k++];
64  for (j = 0; j < l; j++) {
65  run_table[i] = j;
66  flevel_table[i] = level;
67  i++;
68  }
69  level++;
70  }
71  *prun_table = run_table;
72  *plevel_table = flevel_table;
73  *pint_table = int_table;
74 
75  return 0;
76 }
77 
78 av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
79 {
80  WMACodecContext *s = avctx->priv_data;
81  int channels = avctx->ch_layout.nb_channels;
82  int i, ret;
83  float bps1, high_freq;
84  float bps;
85  int sample_rate1;
86  int coef_vlc_table;
87 
88  if (avctx->sample_rate <= 0 || avctx->sample_rate > 50000 ||
90  avctx->bit_rate <= 0)
91  return -1;
92 
93 
94  if (avctx->codec->id == AV_CODEC_ID_WMAV1)
95  s->version = 1;
96  else
97  s->version = 2;
98 
99  /* compute MDCT block size */
100  s->frame_len_bits = ff_wma_get_frame_len_bits(avctx->sample_rate,
101  s->version, 0);
102  s->next_block_len_bits = s->frame_len_bits;
103  s->prev_block_len_bits = s->frame_len_bits;
104  s->block_len_bits = s->frame_len_bits;
105 
106  s->frame_len = 1 << s->frame_len_bits;
107  if (s->use_variable_block_len) {
108  int nb_max, nb;
109  nb = ((flags2 >> 3) & 3) + 1;
110  if ((avctx->bit_rate / channels) >= 32000)
111  nb += 2;
112  nb_max = s->frame_len_bits - BLOCK_MIN_BITS;
113  if (nb > nb_max)
114  nb = nb_max;
115  s->nb_block_sizes = nb + 1;
116  } else
117  s->nb_block_sizes = 1;
118 
119  /* init rate dependent parameters */
120  s->use_noise_coding = 1;
121  high_freq = avctx->sample_rate * 0.5;
122 
123  /* if version 2, then the rates are normalized */
124  sample_rate1 = avctx->sample_rate;
125  if (s->version == 2) {
126  if (sample_rate1 >= 44100)
127  sample_rate1 = 44100;
128  else if (sample_rate1 >= 22050)
129  sample_rate1 = 22050;
130  else if (sample_rate1 >= 16000)
131  sample_rate1 = 16000;
132  else if (sample_rate1 >= 11025)
133  sample_rate1 = 11025;
134  else if (sample_rate1 >= 8000)
135  sample_rate1 = 8000;
136  }
137 
138  bps = (float) avctx->bit_rate /
139  (float) (channels * avctx->sample_rate);
140  s->byte_offset_bits = av_log2((int) (bps * s->frame_len / 8.0 + 0.5)) + 2;
141  if (s->byte_offset_bits + 3 > MIN_CACHE_BITS) {
142  av_log(avctx, AV_LOG_ERROR, "byte_offset_bits %d is too large\n", s->byte_offset_bits);
143  return AVERROR_PATCHWELCOME;
144  }
145 
146  /* compute high frequency value and choose if noise coding should
147  * be activated */
148  bps1 = bps;
149  if (channels == 2)
150  bps1 = bps * 1.6;
151  if (sample_rate1 == 44100) {
152  if (bps1 >= 0.61)
153  s->use_noise_coding = 0;
154  else
155  high_freq = high_freq * 0.4;
156  } else if (sample_rate1 == 22050) {
157  if (bps1 >= 1.16)
158  s->use_noise_coding = 0;
159  else if (bps1 >= 0.72)
160  high_freq = high_freq * 0.7;
161  else
162  high_freq = high_freq * 0.6;
163  } else if (sample_rate1 == 16000) {
164  if (bps > 0.5)
165  high_freq = high_freq * 0.5;
166  else
167  high_freq = high_freq * 0.3;
168  } else if (sample_rate1 == 11025)
169  high_freq = high_freq * 0.7;
170  else if (sample_rate1 == 8000) {
171  if (bps <= 0.625)
172  high_freq = high_freq * 0.5;
173  else if (bps > 0.75)
174  s->use_noise_coding = 0;
175  else
176  high_freq = high_freq * 0.65;
177  } else {
178  if (bps >= 0.8)
179  high_freq = high_freq * 0.75;
180  else if (bps >= 0.6)
181  high_freq = high_freq * 0.6;
182  else
183  high_freq = high_freq * 0.5;
184  }
185  ff_dlog(s->avctx, "flags2=0x%x\n", flags2);
186  ff_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%"PRId64" block_align=%d\n",
187  s->version, channels, avctx->sample_rate, avctx->bit_rate,
188  avctx->block_align);
189  ff_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
190  bps, bps1, high_freq, s->byte_offset_bits);
191  ff_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
192  s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
193 
194  /* compute the scale factor band sizes for each MDCT block size */
195  {
196  int a, b, pos, lpos, k, block_len, i, j, n;
197  const uint8_t *table;
198 
199  if (s->version == 1)
200  s->coefs_start = 3;
201  else
202  s->coefs_start = 0;
203  for (k = 0; k < s->nb_block_sizes; k++) {
204  block_len = s->frame_len >> k;
205 
206  if (s->version == 1) {
207  lpos = 0;
208  for (i = 0; i < 25; i++) {
210  b = avctx->sample_rate;
211  pos = ((block_len * 2 * a) + (b >> 1)) / b;
212  if (pos > block_len)
213  pos = block_len;
214  s->exponent_bands[0][i] = pos - lpos;
215  if (pos >= block_len) {
216  i++;
217  break;
218  }
219  lpos = pos;
220  }
221  s->exponent_sizes[0] = i;
222  } else {
223  /* hardcoded tables */
224  table = NULL;
225  a = s->frame_len_bits - BLOCK_MIN_BITS - k;
226  if (a < 3) {
227  if (avctx->sample_rate >= 44100)
229  else if (avctx->sample_rate >= 32000)
231  else if (avctx->sample_rate >= 22050)
233  }
234  if (table) {
235  n = *table++;
236  for (i = 0; i < n; i++)
237  s->exponent_bands[k][i] = table[i];
238  s->exponent_sizes[k] = n;
239  } else {
240  j = 0;
241  lpos = 0;
242  for (i = 0; i < 25; i++) {
244  b = avctx->sample_rate;
245  pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
246  pos <<= 2;
247  if (pos > block_len)
248  pos = block_len;
249  if (pos > lpos)
250  s->exponent_bands[k][j++] = pos - lpos;
251  if (pos >= block_len)
252  break;
253  lpos = pos;
254  }
255  s->exponent_sizes[k] = j;
256  }
257  }
258 
259  /* max number of coefs */
260  s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k;
261  /* high freq computation */
262  s->high_band_start[k] = (int) ((block_len * 2 * high_freq) /
263  avctx->sample_rate + 0.5);
264  n = s->exponent_sizes[k];
265  j = 0;
266  pos = 0;
267  for (i = 0; i < n; i++) {
268  int start, end;
269  start = pos;
270  pos += s->exponent_bands[k][i];
271  end = pos;
272  if (start < s->high_band_start[k])
273  start = s->high_band_start[k];
274  if (end > s->coefs_end[k])
275  end = s->coefs_end[k];
276  if (end > start)
277  s->exponent_high_bands[k][j++] = end - start;
278  }
279  s->exponent_high_sizes[k] = j;
280  }
281  }
282 
283 #ifdef TRACE
284  {
285  int i, j;
286  for (i = 0; i < s->nb_block_sizes; i++) {
287  ff_tlog(s->avctx, "%5d: n=%2d:",
288  s->frame_len >> i,
289  s->exponent_sizes[i]);
290  for (j = 0; j < s->exponent_sizes[i]; j++)
291  ff_tlog(s->avctx, " %d", s->exponent_bands[i][j]);
292  ff_tlog(s->avctx, "\n");
293  }
294  }
295 #endif /* TRACE */
296 
297  /* init MDCT windows : simple sine window */
298  for (i = 0; i < s->nb_block_sizes; i++) {
299  ff_init_ff_sine_windows(s->frame_len_bits - i);
300  s->windows[i] = ff_sine_windows[s->frame_len_bits - i];
301  }
302 
303  s->reset_block_lengths = 1;
304 
305  if (s->use_noise_coding) {
306  /* init the noise generator */
307  if (s->use_exp_vlc)
308  s->noise_mult = 0.02;
309  else
310  s->noise_mult = 0.04;
311 
312 #ifdef TRACE
313  for (i = 0; i < NOISE_TAB_SIZE; i++)
314  s->noise_table[i] = 1.0 * s->noise_mult;
315 #else
316  {
317  unsigned int seed;
318  float norm;
319  seed = 1;
320  norm = (1.0 / (float) (1LL << 31)) * sqrt(3) * s->noise_mult;
321  for (i = 0; i < NOISE_TAB_SIZE; i++) {
322  seed = seed * 314159 + 1;
323  s->noise_table[i] = (float) ((int) seed) * norm;
324  }
325  }
326 #endif /* TRACE */
327  }
328 
329  s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
330  if (!s->fdsp)
331  return AVERROR(ENOMEM);
332 
333  /* choose the VLC tables for the coefficients */
334  coef_vlc_table = 2;
335  if (avctx->sample_rate >= 32000) {
336  if (bps1 < 0.72)
337  coef_vlc_table = 0;
338  else if (bps1 < 1.16)
339  coef_vlc_table = 1;
340  }
341  s->coef_vlcs[0] = &coef_vlcs[coef_vlc_table * 2];
342  s->coef_vlcs[1] = &coef_vlcs[coef_vlc_table * 2 + 1];
343  ret = init_coef_vlc(&s->coef_vlc[0], &s->run_table[0], &s->level_table[0],
344  &s->int_table[0], s->coef_vlcs[0]);
345  if (ret < 0)
346  return ret;
347 
348  return init_coef_vlc(&s->coef_vlc[1], &s->run_table[1], &s->level_table[1],
349  &s->int_table[1], s->coef_vlcs[1]);
350 }
351 
352 int ff_wma_total_gain_to_bits(int total_gain)
353 {
354  if (total_gain < 15)
355  return 13;
356  else if (total_gain < 32)
357  return 12;
358  else if (total_gain < 40)
359  return 11;
360  else if (total_gain < 45)
361  return 10;
362  else
363  return 9;
364 }
365 
367 {
368  WMACodecContext *s = avctx->priv_data;
369  int i;
370 
371  for (i = 0; i < s->nb_block_sizes; i++)
372  av_tx_uninit(&s->mdct_ctx[i]);
373 
374  if (s->use_exp_vlc)
375  ff_vlc_free(&s->exp_vlc);
376  if (s->use_noise_coding)
377  ff_vlc_free(&s->hgain_vlc);
378  for (i = 0; i < 2; i++) {
379  ff_vlc_free(&s->coef_vlc[i]);
380  av_freep(&s->run_table[i]);
381  av_freep(&s->level_table[i]);
382  av_freep(&s->int_table[i]);
383  }
384  av_freep(&s->fdsp);
385 
386  return 0;
387 }
388 
389 /**
390  * Decode an uncompressed coefficient.
391  * @param gb GetBitContext
392  * @return the decoded coefficient
393  */
395 {
396  /** consumes up to 34 bits */
397  int n_bits = 8;
398  /** decode length */
399  if (get_bits1(gb)) {
400  n_bits += 8;
401  if (get_bits1(gb)) {
402  n_bits += 8;
403  if (get_bits1(gb))
404  n_bits += 7;
405  }
406  }
407  return get_bits_long(gb, n_bits);
408 }
409 
410 /**
411  * Decode run level compressed coefficients.
412  * @param avctx codec context
413  * @param gb bitstream reader context
414  * @param vlc vlc table for get_vlc2
415  * @param level_table level codes
416  * @param run_table run codes
417  * @param version 0 for wma1,2 1 for wmapro
418  * @param ptr output buffer
419  * @param offset offset in the output buffer
420  * @param num_coefs number of input coefficients
421  * @param block_len input buffer length (2^n)
422  * @param frame_len_bits number of bits for escaped run codes
423  * @param coef_nb_bits number of bits for escaped level codes
424  * @return 0 on success, -1 otherwise
425  */
427  VLC *vlc, const float *level_table,
428  const uint16_t *run_table, int version,
429  WMACoef *ptr, int offset, int num_coefs,
430  int block_len, int frame_len_bits,
431  int coef_nb_bits)
432 {
433  int code, level, sign;
434  const uint32_t *ilvl = (const uint32_t *) level_table;
435  uint32_t *iptr = (uint32_t *) ptr;
436  const unsigned int coef_mask = block_len - 1;
437  for (; offset < num_coefs; offset++) {
438  code = get_vlc2(gb, vlc->table, VLCBITS, VLCMAX);
439  if (code > 1) {
440  /** normal code */
441  offset += run_table[code];
442  sign = get_bits1(gb) - 1;
443  iptr[offset & coef_mask] = ilvl[code] ^ (sign & 0x80000000);
444  } else if (code == 1) {
445  /** EOB */
446  break;
447  } else {
448  /** escape */
449  if (!version) {
450  level = get_bits(gb, coef_nb_bits);
451  /** NOTE: this is rather suboptimal. reading
452  * block_len_bits would be better */
453  offset += get_bits(gb, frame_len_bits);
454  } else {
456  /** escape decode */
457  if (get_bits1(gb)) {
458  if (get_bits1(gb)) {
459  if (get_bits1(gb)) {
460  av_log(avctx, AV_LOG_ERROR,
461  "broken escape sequence\n");
462  return AVERROR_INVALIDDATA;
463  } else
464  offset += get_bits(gb, frame_len_bits) + 4;
465  } else
466  offset += get_bits(gb, 2) + 1;
467  }
468  }
469  sign = get_bits1(gb) - 1;
470  ptr[offset & coef_mask] = (level ^ sign) - sign;
471  }
472  }
473  /** NOTE: EOB can be omitted */
474  if (offset > num_coefs) {
475  av_log(avctx, AV_LOG_ERROR,
476  "overflow (%d > %d) in spectral RLE, ignoring\n",
477  offset,
478  num_coefs
479  );
480  return AVERROR_INVALIDDATA;
481  }
482 
483  return 0;
484 }
level
uint8_t level
Definition: svq3.c:204
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
ff_sine_windows
SINETABLE_CONST float *const ff_sine_windows[]
Definition: sinewin_tablegen.h:51
coef_vlcs
static const CoefVLCTable coef_vlcs[6]
Definition: wmadata.h:1371
AVCodecContext::sample_rate
int sample_rate
samples per second
Definition: avcodec.h:1064
wma_freqs.h
get_bits_long
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
Definition: get_bits.h:421
exponent_band_32000
static const uint8_t exponent_band_32000[3][25]
Definition: wmadata.h:42
BLOCK_MIN_BITS
#define BLOCK_MIN_BITS
Definition: wma.h:34
b
#define b
Definition: input.c:41
table
static const uint16_t table[]
Definition: prosumer.c:205
CoefVLCTable::n
int n
total number of codes
Definition: wma.h:61
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:317
VLCBITS
#define VLCBITS
Definition: wma.h:55
CoefVLCTable::huffbits
const uint8_t * huffbits
VLC bit size.
Definition: wma.h:64
VLCMAX
#define VLCMAX
Definition: wma.h:56
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:335
init_coef_vlc
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:33
CoefVLCTable
Definition: wma.h:60
AVCodecContext::codec
const struct AVCodec * codec
Definition: avcodec.h:450
WMACoef
float WMACoef
type for decoded coefficients, int16_t would be enough for wma 1/2
Definition: wma.h:58
AVCodecContext::ch_layout
AVChannelLayout ch_layout
Audio channel layout.
Definition: avcodec.h:2107
GetBitContext
Definition: get_bits.h:108
WMACodecContext
Definition: wma.h:68
AV_CODEC_ID_WMAV1
@ AV_CODEC_ID_WMAV1
Definition: codec_id.h:449
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
wma_common.h
float
float
Definition: af_crystalizer.c:121
s
#define s(width, name)
Definition: cbs_vp9.c:198
vlc_init
#define vlc_init(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
Definition: vlc.h:56
channels
channels
Definition: aptx.h:31
ff_wma_critical_freqs
const uint16_t ff_wma_critical_freqs[25]
Definition: wma_freqs.c:23
wma.h
ff_wma_total_gain_to_bits
int ff_wma_total_gain_to_bits(int total_gain)
Definition: wma.c:352
CoefVLCTable::huffcodes
const uint32_t * huffcodes
VLC bit values.
Definition: wma.h:63
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
AVCodecContext::bit_rate
int64_t bit_rate
the average bitrate
Definition: avcodec.h:491
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:388
seed
static unsigned int seed
Definition: videogen.c:78
get_vlc2
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:652
ff_wma_end
int ff_wma_end(AVCodecContext *avctx)
Definition: wma.c:366
ff_dlog
#define ff_dlog(a,...)
Definition: tableprint_vlc.h:28
bps
unsigned bps
Definition: movenc.c:1738
ff_wma_init
av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
Definition: wma.c:78
NOISE_TAB_SIZE
#define NOISE_TAB_SIZE
Definition: wma.h:50
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
sinewin.h
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
attributes.h
version
version
Definition: libkvazaar.c:321
av_tx_uninit
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
Definition: tx.c:294
AVCodec::id
enum AVCodecID id
Definition: codec.h:201
wmadata.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
code
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
Definition: filter_design.txt:178
exponent_band_44100
static const uint8_t exponent_band_44100[3][25]
Definition: wmadata.h:48
av_malloc_array
#define av_malloc_array(a, b)
Definition: tableprint_vlc.h:31
MIN_CACHE_BITS
#define MIN_CACHE_BITS
Definition: get_bits.h:169
avcodec.h
ff_vlc_free
void ff_vlc_free(VLC *vlc)
Definition: vlc.c:509
ret
ret
Definition: filter_design.txt:187
AVCodecContext::block_align
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
Definition: avcodec.h:1113
pos
unsigned int pos
Definition: spdifenc.c:413
AVCodecContext
main external API structure.
Definition: avcodec.h:441
ff_wma_get_frame_len_bits
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
VLC
Definition: vlc.h:33
ff_init_ff_sine_windows
void ff_init_ff_sine_windows(int index)
initialize the specified entry of ff_sine_windows
Definition: sinewin_tablegen.h:101
VLC::table
VLCElem * table
Definition: vlc.h:35
AV_CODEC_FLAG_BITEXACT
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Definition: avcodec.h:338
ff_wma_run_level_decode
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:426
ff_tlog
#define ff_tlog(ctx,...)
Definition: internal.h:153
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:468
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
avpriv_float_dsp_alloc
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
Definition: float_dsp.c:135
exponent_band_22050
static const uint8_t exponent_band_22050[3][25]
Definition: wmadata.h:35
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
CoefVLCTable::levels
const uint16_t * levels
table to build run/level tables
Definition: wma.h:65
ff_wma_get_large_val
unsigned int ff_wma_get_large_val(GetBitContext *gb)
Decode an uncompressed coefficient.
Definition: wma.c:394
int
int
Definition: ffmpeg_filter.c:368
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26