Commit 59b68ee8 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '3d3cf674'

* commit '3d3cf674':
  aacdec: use float planar sample format for output

Conflicts:
	libavcodec/aacdec.c
	libavcodec/aacsbr.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a13148f6 3d3cf674
......@@ -236,9 +236,10 @@ typedef struct SingleChannelElement {
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT
DECLARE_ALIGNED(32, float, saved)[1024]; ///< overlap
DECLARE_ALIGNED(32, float, ret)[2048]; ///< PCM output
DECLARE_ALIGNED(32, float, ret_buf)[2048]; ///< PCM output buffer
DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP
PredictorState predictor_state[MAX_PREDICTORS];
float *ret; ///< PCM output
} SingleChannelElement;
/**
......@@ -297,10 +298,10 @@ typedef struct AACContext {
/** @} */
/**
* @name Members used for output interleaving
* @name Members used for output
* @{
*/
float *output_data[MAX_CHANNELS]; ///< Points to each element's 'ret' buffer (PCM output).
SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement
/** @} */
......
This diff is collapsed.
......@@ -191,7 +191,7 @@ WINDOW_FUNC(only_long)
{
const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
float *out = sce->ret;
float *out = sce->ret_buf;
fdsp->vector_fmul (out, audio, lwindow, 1024);
dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
......@@ -201,7 +201,7 @@ WINDOW_FUNC(long_start)
{
const float *lwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
float *out = sce->ret;
float *out = sce->ret_buf;
fdsp->vector_fmul(out, audio, lwindow, 1024);
memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
......@@ -213,7 +213,7 @@ WINDOW_FUNC(long_stop)
{
const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
const float *swindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
float *out = sce->ret;
float *out = sce->ret_buf;
memset(out, 0, sizeof(out[0]) * 448);
fdsp->vector_fmul(out + 448, audio + 448, swindow, 128);
......@@ -226,7 +226,7 @@ WINDOW_FUNC(eight_short)
const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *in = audio + 448;
float *out = sce->ret;
float *out = sce->ret_buf;
int w;
for (w = 0; w < 8; w++) {
......@@ -251,7 +251,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
float *audio)
{
int i;
float *output = sce->ret;
float *output = sce->ret_buf;
apply_window[sce->ics.window_sequence[0]](&s->dsp, &s->fdsp, sce, audio);
......
......@@ -142,7 +142,6 @@ static void sbr_turnoff(SpectralBandReplication *sbr) {
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
{
float mdct_scale;
if(sbr->mdct.mdct_bits)
return;
sbr->kx[0] = sbr->kx[1];
......@@ -152,9 +151,8 @@ av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
/* SBR requires samples to be scaled to +/-32768.0 to work correctly.
* mdct scale factors are adjusted to scale up from +/-1.0 at analysis
* and scale back down at synthesis. */
mdct_scale = ac->avctx->sample_fmt == AV_SAMPLE_FMT_FLT ? 32768.0f : 1.0f;
ff_mdct_init(&sbr->mdct, 7, 1, 1.0 / (64 * mdct_scale));
ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * mdct_scale);
ff_mdct_init(&sbr->mdct, 7, 1, 1.0 / (64 * 32768.0));
ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
ff_ps_ctx_init(&sbr->ps);
ff_sbrdsp_init(&sbr->dsp);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment