FFmpeg/libavcodec/sbrdsp_template.c
Matthieu Bouron 0a24d7ca83 lavc/aarch64: add sbrdsp neon implementation
autocorrelate_c: 644.0
autocorrelate_neon: 420.0
hf_apply_noise_0_c: 1688.5
hf_apply_noise_0_neon: 1498.6
hf_apply_noise_1_c: 1691.2
hf_apply_noise_1_neon: 1500.6
hf_apply_noise_2_c: 1688.1
hf_apply_noise_2_neon: 1500.3
hf_apply_noise_3_c: 1696.6
hf_apply_noise_3_neon: 1502.2
hf_g_filt_c: 2117.8
hf_g_filt_neon: 1218.7
hf_gen_c: 4573.4
hf_gen_neon: 2461.0
neg_odd_64_c: 72.0
neg_odd_64_neon: 64.7
qmf_deint_bfly_c: 1107.6
qmf_deint_bfly_neon: 291.6
qmf_deint_neg_c: 210.4
qmf_deint_neg_neon: 107.4
qmf_post_shuffle_c: 163.0
qmf_post_shuffle_neon: 107.7
qmf_pre_shuffle_c: 120.5
qmf_pre_shuffle_neon: 110.7
sum64x5_c: 1361.6
sum64x5_neon: 435.4
sum_square_c: 1686.4
sum_square_neon: 787.2
2017-07-03 14:29:22 +02:00

105 lines
3.6 KiB
C

/*
* AAC Spectral Band Replication decoding functions
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
* Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
static void sbr_sum64x5_c(INTFLOAT *z)
{
int k;
for (k = 0; k < 64; k++) {
INTFLOAT f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
z[k] = f;
}
}
static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1)
{
int i;
for (i = 0; i < 64; i++) {
#if USE_FIXED
v[ i] = (int)(0x10U + src0[i] - src1[63 - i]) >> 5;
v[127 - i] = (int)(0x10U + src0[i] + src1[63 - i]) >> 5;
#else
v[ i] = src0[i] - src1[63 - i];
v[127 - i] = src0[i] + src1[63 - i];
#endif
}
}
static void sbr_hf_apply_noise_0(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
const AAC_FLOAT *q_filt, int noise,
int kx, int m_max)
{
sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)1.0, (INTFLOAT)0.0, m_max);
}
static void sbr_hf_apply_noise_1(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
const AAC_FLOAT *q_filt, int noise,
int kx, int m_max)
{
INTFLOAT phi_sign = 1 - 2 * (kx & 1);
sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)0.0, phi_sign, m_max);
}
static void sbr_hf_apply_noise_2(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
const AAC_FLOAT *q_filt, int noise,
int kx, int m_max)
{
sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)-1.0, (INTFLOAT)0.0, m_max);
}
static void sbr_hf_apply_noise_3(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
const AAC_FLOAT *q_filt, int noise,
int kx, int m_max)
{
INTFLOAT phi_sign = 1 - 2 * (kx & 1);
sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)0.0, -phi_sign, m_max);
}
av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s)
{
s->sum64x5 = sbr_sum64x5_c;
s->sum_square = sbr_sum_square_c;
s->neg_odd_64 = sbr_neg_odd_64_c;
s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
s->qmf_deint_neg = sbr_qmf_deint_neg_c;
s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
s->autocorrelate = sbr_autocorrelate_c;
s->hf_gen = sbr_hf_gen_c;
s->hf_g_filt = sbr_hf_g_filt_c;
s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
#if !USE_FIXED
if (ARCH_ARM)
ff_sbrdsp_init_arm(s);
if (ARCH_AARCH64)
ff_sbrdsp_init_aarch64(s);
if (ARCH_X86)
ff_sbrdsp_init_x86(s);
if (ARCH_MIPS)
ff_sbrdsp_init_mips(s);
#endif /* !USE_FIXED */
}