/* init MDCT */
for(i = 0; i < s->nb_block_sizes; i++)
- ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0);
+ ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0);
avctx->block_align=
s->block_align= avctx->bit_rate*(int64_t)s->frame_len / (avctx->sample_rate*8);
s->output[i+window_len] = audio[j] / n * win[window_len - i - 1];
s->frame_out[channel][i] = audio[j] / n * win[i];
}
- ff_mdct_calc(&s->mdct_ctx[window_index], s->coefs[channel], s->output, s->mdct_tmp);
+ ff_mdct_calc(&s->mdct_ctx[window_index], s->coefs[channel], s->output);
}
}
}
for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]= 1) { //FIXME
+ s->channel_coded[ch] = 1; //FIXME only set channel_coded when needed, instead of always
+ if (s->channel_coded[ch]) {
init_exp(s, ch, fixed_exp);
}
}
for(ch = 0; ch < s->nb_channels; ch++) {
if (s->channel_coded[ch]) {
- int16_t *coefs1;
+ WMACoef *coefs1;
float *coefs, *exponents, mult;
int i, n;
for(ch = 0; ch < s->nb_channels; ch++) {
if (s->channel_coded[ch]) {
int run, tindex;
- int16_t *ptr, *eptr;
+ WMACoef *ptr, *eptr;
tindex = (ch == 1 && s->ms_stereo);
ptr = &s->coefs1[ch][0];
eptr = ptr + nb_coefs[ch];
if(1<<coef_nb_bits <= abs_level)
return -1;
+
+ //Workaround minor rounding differences for the regression tests, FIXME we should find and replace the problematic float by fixpoint for reg tests
+ if(abs_level == 0x71B && (s->avctx->flags & CODEC_FLAG_BITEXACT)) abs_level=0x71A;
+
put_bits(&s->pb, coef_nb_bits, abs_level);
put_bits(&s->pb, s->frame_len_bits, run);
}
put_bits(&s->pb, 8, 'N');
flush_put_bits(&s->pb);
- return pbBufPtr(&s->pb) - s->pb.buf;
+ return put_bits_ptr(&s->pb) - s->pb.buf;
}
AVCodec wmav1_encoder =
encode_init,
encode_superframe,
ff_wma_end,
+ .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
};
AVCodec wmav2_encoder =
encode_init,
encode_superframe,
ff_wma_end,
+ .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
};