Commit 366e4158 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '800ffab4'

* commit '800ffab4':
  dcadsp: Add a new method, qmf_32_subbands
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents c30eb74d 800ffab4
...@@ -1112,10 +1112,8 @@ static void qmf_32_subbands(DCAContext *s, int chans, ...@@ -1112,10 +1112,8 @@ static void qmf_32_subbands(DCAContext *s, int chans,
float scale) float scale)
{ {
const float *prCoeff; const float *prCoeff;
int i;
int sb_act = s->subband_activity[chans]; int sb_act = s->subband_activity[chans];
int subindex;
scale *= sqrt(1 / 8.0); scale *= sqrt(1 / 8.0);
...@@ -1125,25 +1123,11 @@ static void qmf_32_subbands(DCAContext *s, int chans, ...@@ -1125,25 +1123,11 @@ static void qmf_32_subbands(DCAContext *s, int chans,
else /* Perfect reconstruction */ else /* Perfect reconstruction */
prCoeff = fir_32bands_perfect; prCoeff = fir_32bands_perfect;
for (i = sb_act; i < 32; i++) s->dcadsp.qmf_32_subbands(samples_in, sb_act, &s->synth, &s->imdct,
s->raXin[i] = 0.0; s->subband_fir_hist[chans],
&s->hist_index[chans],
/* Reconstructed channel sample index */ s->subband_fir_noidea[chans], prCoeff,
for (subindex = 0; subindex < 8; subindex++) { samples_out, s->raXin, scale);
/* Load in one sample from each subband and clear inactive subbands */
for (i = 0; i < sb_act; i++) {
unsigned sign = (i - 1) & 2;
uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ sign << 30;
AV_WN32A(&s->raXin[i], v);
}
s->synth.synth_filter_float(&s->imdct,
s->subband_fir_hist[chans],
&s->hist_index[chans],
s->subband_fir_noidea[chans], prCoeff,
samples_out, s->raXin, scale);
samples_out += 32;
}
} }
static void lfe_interpolation_fir(DCAContext *s, int decimation_select, static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/intreadwrite.h"
#include "dcadsp.h" #include "dcadsp.h"
static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, static void dca_lfe_fir_c(float *out, const float *in, const float *coefs,
...@@ -45,8 +46,37 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, ...@@ -45,8 +46,37 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs,
} }
} }
static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct,
float synth_buf_ptr[512],
int *synth_buf_offset, float synth_buf2[32],
const float window[512], float *samples_out,
float raXin[32], float scale)
{
int i;
int subindex;
for (i = sb_act; i < 32; i++)
raXin[i] = 0.0;
/* Reconstructed channel sample index */
for (subindex = 0; subindex < 8; subindex++) {
/* Load in one sample from each subband and clear inactive subbands */
for (i = 0; i < sb_act; i++) {
unsigned sign = (i - 1) & 2;
uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ sign << 30;
AV_WN32A(&raXin[i], v);
}
synth->synth_filter_float(imdct, synth_buf_ptr, synth_buf_offset,
synth_buf2, window, samples_out, raXin, scale);
samples_out += 32;
}
}
av_cold void ff_dcadsp_init(DCADSPContext *s) av_cold void ff_dcadsp_init(DCADSPContext *s)
{ {
s->lfe_fir = dca_lfe_fir_c; s->lfe_fir = dca_lfe_fir_c;
s->qmf_32_subbands = dca_qmf_32_subbands;
if (ARCH_ARM) ff_dcadsp_init_arm(s); if (ARCH_ARM) ff_dcadsp_init_arm(s);
} }
...@@ -19,9 +19,18 @@ ...@@ -19,9 +19,18 @@
#ifndef AVCODEC_DCADSP_H #ifndef AVCODEC_DCADSP_H
#define AVCODEC_DCADSP_H #define AVCODEC_DCADSP_H
#include "avfft.h"
#include "synth_filter.h"
typedef struct DCADSPContext { typedef struct DCADSPContext {
void (*lfe_fir)(float *out, const float *in, const float *coefs, void (*lfe_fir)(float *out, const float *in, const float *coefs,
int decifactor, float scale); int decifactor, float scale);
void (*qmf_32_subbands)(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct,
float synth_buf_ptr[512],
int *synth_buf_offset, float synth_buf2[32],
const float window[512], float *samples_out,
float raXin[32], float scale);
} DCADSPContext; } DCADSPContext;
void ff_dcadsp_init(DCADSPContext *s); void ff_dcadsp_init(DCADSPContext *s);
......
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