#include "avcodec.h"
#include "bytestream.h"
#include "fft.h"
-#include "fmtconvert.h"
#include "get_bits.h"
#include "internal.h"
AtracGCContext gainc_ctx;
FFTContext mdct_ctx;
- FmtConvertContext fmt_conv;
AVFloatDSPContext fdsp;
} ATRAC3Context;
static DECLARE_ALIGNED(32, float, mdct_window)[MDCT_SIZE];
static VLC_TYPE atrac3_vlc_table[4096][2];
static VLC spectral_coeff_tab[7];
-static float gain_tab1[16];
-static float gain_tab2[31];
-
/**
* Regular 512 points IMDCT without overlapping, with the exception of the
return off;
}
-static av_cold void init_atrac3_window(void)
+static av_cold void init_imdct_window(void)
{
int i, j;
{
int i;
- init_atrac3_window();
+ init_imdct_window();
ff_atrac_generate_tables();
/* Initialize the VLC tables. */
huff_bits[i], 1, 1,
huff_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
-
- /* Generate gain tables */
- for (i = 0; i < 16; i++)
- gain_tab1[i] = powf(2.0, (4 - i));
-
- for (i = -15; i < 16; i++)
- gain_tab2[i + 15] = powf(2.0, i * -0.125);
}
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
FF_INPUT_BUFFER_PADDING_SIZE);
- if (q->decoded_bytes_buffer == NULL)
+ if (!q->decoded_bytes_buffer)
return AVERROR(ENOMEM);
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
ff_atrac_init_gain_compensation(&q->gainc_ctx, 4, 3);
avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
- ff_fmt_convert_init(&q->fmt_conv, avctx);
q->units = av_mallocz(sizeof(*q->units) * avctx->channels);
if (!q->units) {