yading@10: /* yading@10: * Copyright (c) 2004 Gildas Bazin yading@10: * Copyright (c) 2010 Mans Rullgard yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #include "config.h" yading@10: #include "dcadsp.h" yading@10: yading@10: static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, yading@10: int decifactor, float scale) yading@10: { yading@10: float *out2 = out + decifactor; yading@10: const float *cf0 = coefs; yading@10: const float *cf1 = coefs + 256; yading@10: int j, k; yading@10: yading@10: /* One decimated sample generates 2*decifactor interpolated ones */ yading@10: for (k = 0; k < decifactor; k++) { yading@10: float v0 = 0.0; yading@10: float v1 = 0.0; yading@10: for (j = 0; j < 256 / decifactor; j++) { yading@10: float s = in[-j]; yading@10: v0 += s * *cf0++; yading@10: v1 += s * *--cf1; yading@10: } yading@10: *out++ = v0 * scale; yading@10: *out2++ = v1 * scale; yading@10: } yading@10: } yading@10: yading@10: void ff_dcadsp_init(DCADSPContext *s) yading@10: { yading@10: s->lfe_fir = dca_lfe_fir_c; yading@10: if (ARCH_ARM) ff_dcadsp_init_arm(s); yading@10: }