diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-22 12:10:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-22 12:10:59 +0200 |
commit | 366e415836c52cce71b2f0d11fd04eea0a590c97 (patch) | |
tree | c3a1f4d86b172e6c26580115d410e2147733ef90 /libavcodec/dcadsp.c | |
parent | c30eb74d182063c85a895c6fd3c9d47b93370bb0 (diff) | |
parent | 800ffab48a7844dd5dc0a33b8f6b8e5ed718cf2e (diff) | |
download | ffmpeg-366e415836c52cce71b2f0d11fd04eea0a590c97.tar.gz |
Merge commit '800ffab48a7844dd5dc0a33b8f6b8e5ed718cf2e'
* commit '800ffab48a7844dd5dc0a33b8f6b8e5ed718cf2e':
dcadsp: Add a new method, qmf_32_subbands
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dcadsp.c')
-rw-r--r-- | libavcodec/dcadsp.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c index 249aff2a30..abeba2492b 100644 --- a/libavcodec/dcadsp.c +++ b/libavcodec/dcadsp.c @@ -21,6 +21,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/intreadwrite.h" #include "dcadsp.h" 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) { s->lfe_fir = dca_lfe_fir_c; + s->qmf_32_subbands = dca_qmf_32_subbands; if (ARCH_ARM) ff_dcadsp_init_arm(s); } |