/**
* @file wmadec.c
* WMA compatible decoder.
+ * This decoder handles Microsoft Windows Media Audio data, versions 1 & 2.
+ * WMA v1 is identified by audio format 0x160 in Microsoft media files
+ * (ASF/AVI/WAV). WMA v2 is identified by audio format 0x161.
+ *
+ * To use this decoder, a calling application must supply the extra data
+ * bytes provided with the WMA data. These are the extra, codec-specific
+ * bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes
+ * to the decoder using the extradata[_size] fields in AVCodecContext. There
+ * should be 4 extra bytes for v1 data and 6 extra bytes for v2 data.
*/
#include "avcodec.h"
+#include "bitstream.h"
#include "dsputil.h"
/* size of blocks */
const uint16_t *p;
int i, l, j, level;
- init_vlc(vlc, 9, n, table_bits, 1, 1, table_codes, 4, 4);
+ init_vlc(vlc, 9, n, table_bits, 1, 1, table_codes, 4, 4, 0);
run_table = av_malloc(n * sizeof(uint16_t));
level_table = av_malloc(n * sizeof(uint16_t));
int i, flags1, flags2;
float *window;
uint8_t *extradata;
- float bps1, high_freq, bps;
+ float bps1, high_freq;
+ volatile float bps;
int sample_rate1;
int coef_vlc_table;
#endif
init_vlc(&s->hgain_vlc, 9, sizeof(hgain_huffbits),
hgain_huffbits, 1, 1,
- hgain_huffcodes, 2, 2);
+ hgain_huffcodes, 2, 2, 0);
}
if (s->use_exp_vlc) {
init_vlc(&s->exp_vlc, 9, sizeof(scale_huffbits),
scale_huffbits, 1, 1,
- scale_huffcodes, 4, 4);
+ scale_huffcodes, 4, 4, 0);
} else {
wma_lsp_to_curve_init(s, s->frame_len);
}
int n, v, a, ch, code, bsize;
int coef_nb_bits, total_gain, parse_exponents;
float window[BLOCK_MAX_SIZE * 2];
+// XXX: FIXME!! there's a bug somewhere which makes this mandatory under altivec
+#ifdef HAVE_ALTIVEC
+ volatile int nb_coefs[MAX_CHANNELS] __attribute__((aligned(16)));
+#else
int nb_coefs[MAX_CHANNELS];
+#endif
float mdct_norm;
#ifdef TRACE