#define _XOPEN_SOURCE 600
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <math.h>
-#include <string.h>
#include <regex.h>
#include <sys/select.h>
/** Information contained in the audio file header. */
struct asf_header_info ahi;
struct getbit_context gb;
- /** Whether to use the bit reservoir. */
- int use_bit_reservoir;
- /** Whether to use variable block length. */
- int use_variable_block_len;
- /** Whether to use exponent coding. */
- int use_exp_vlc;
/** Whether perceptual noise is added. */
int use_noise_coding;
/** Depends on number of the bits per second and the frame length. */
int byte_offset_bits;
- /** Only used if use_exp_vlc is true. */
+ /** Only used if ahi->use_exp_vlc is true. */
struct vlc exp_vlc;
uint16_t exponent_bands[BLOCK_NB_SIZES][25];
/** The index of the first coef in high band. */
int frame_len;
/** log2 of frame_len. */
int frame_len_bits;
- /** Number of block sizes. */
+ /** Number of block sizes, one if !ahi->use_variable_block_len. */
int nb_block_sizes;
/* block info */
int reset_block_lengths;
for (i = 0; i < pwd->nb_block_sizes; i++)
imdct_end(pwd->mdct_ctx[i]);
- if (pwd->use_exp_vlc)
+ if (pwd->ahi.use_exp_vlc)
free_vlc(&pwd->exp_vlc);
if (pwd->use_noise_coding)
free_vlc(&pwd->hgain_vlc);
else
pwd->frame_len_bits = 11;
pwd->frame_len = 1 << pwd->frame_len_bits;
- if (pwd->use_variable_block_len) {
+ if (pwd->ahi.use_variable_block_len) {
int nb_max, nb;
nb = ((flags2 >> 3) & 3) + 1;
if ((ahi->bit_rate / ahi->channels) >= 32000)
pwd->frame_len, bps, bps1,
high_freq, pwd->byte_offset_bits);
PARA_INFO_LOG("use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
- pwd->use_noise_coding, pwd->use_exp_vlc, pwd->nb_block_sizes);
+ pwd->use_noise_coding, pwd->ahi.use_exp_vlc, pwd->nb_block_sizes);
compute_scale_factor_band_sizes(pwd, high_freq);
/* init MDCT windows : simple sinus window */
if (pwd->use_noise_coding) {
/* init the noise generator */
- if (pwd->use_exp_vlc)
+ if (pwd->ahi.use_exp_vlc)
pwd->noise_mult = 0.02;
else
pwd->noise_mult = 0.04;
return ret;
}
- pwd->use_exp_vlc = pwd->ahi.flags2 & 0x0001;
- pwd->use_bit_reservoir = pwd->ahi.flags2 & 0x0002;
- pwd->use_variable_block_len = pwd->ahi.flags2 & 0x0004;
-
ret = wma_init(pwd);
if (ret < 0)
return ret;
wma_hgain_huffcodes, 2);
}
- if (pwd->use_exp_vlc) {
+ if (pwd->ahi.use_exp_vlc) {
PARA_INFO_LOG("using exp_vlc\n");
init_vlc(&pwd->exp_vlc, EXPVLCBITS, sizeof(wma_scale_huffbits),
wma_scale_huffbits, wma_scale_huffcodes, 4);
int nb_coefs[MAX_CHANNELS];
/* compute current block length */
- if (pwd->use_variable_block_len) {
+ if (pwd->ahi.use_variable_block_len) {
n = wma_log2(pwd->nb_block_sizes - 1) + 1;
if (pwd->reset_block_lengths) {
if ((pwd->block_len_bits == pwd->frame_len_bits) || get_bit(&pwd->gb)) {
for (ch = 0; ch < pwd->ahi.channels; ch++) {
if (pwd->channel_coded[ch]) {
- if (pwd->use_exp_vlc) {
+ if (pwd->ahi.use_exp_vlc) {
ret = decode_exp_vlc(pwd, ch);
if (ret < 0)
return ret;
buf_size = pwd->ahi.block_align;
samples = data;
init_get_bits(&pwd->gb, buf, buf_size);
- if (pwd->use_bit_reservoir) {
+ if (pwd->ahi.use_bit_reservoir) {
int i, nb_frames, bit_offset, pos, len;
uint8_t *q;
#define WMA_OUTPUT_BUFFER_SIZE (128 * 1024)
-static int wmadec_post_select(__a_unused struct sched *s, struct task *t)
+static int wmadec_post_select(__a_unused struct sched *s, void *context)
{
- struct filter_node *fn = container_of(t, struct filter_node, task);
+ struct filter_node *fn = context;
int ret, converted, out_size;
struct private_wmadec_data *pwd = fn->private_data;
struct btr_node *btrn = fn->btrn;