diff options
Diffstat (limited to 'libavutil/float_dsp.c')
-rw-r--r-- | libavutil/float_dsp.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c index d31fc3d166..c85daffc6a 100644 --- a/libavutil/float_dsp.c +++ b/libavutil/float_dsp.c @@ -1,24 +1,28 @@ /* - * This file is part of Libav. + * Copyright 2005 Balatoni Denes + * Copyright 2006 Loren Merritt * - * Libav is free software; you can redistribute it and/or + * 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. * - * Libav is distributed in the hope that it will be useful, + * 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 Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "attributes.h" #include "float_dsp.h" +#include "mem.h" static void vector_fmul_c(float *dst, const float *src0, const float *src1, int len) @@ -89,7 +93,7 @@ static void vector_fmul_reverse_c(float *dst, const float *src0, dst[i] = src0[i] * src1[-i]; } -static void butterflies_float_c(float *restrict v1, float *restrict v2, +static void butterflies_float_c(float *av_restrict v1, float *av_restrict v2, int len) { int i; @@ -112,8 +116,12 @@ float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len) return p; } -av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) +av_cold AVFloatDSPContext *avpriv_float_dsp_alloc(int bit_exact) { + AVFloatDSPContext *fdsp = av_mallocz(sizeof(AVFloatDSPContext)); + if (!fdsp) + return NULL; + fdsp->vector_fmul = vector_fmul_c; fdsp->vector_fmac_scalar = vector_fmac_scalar_c; fdsp->vector_fmul_scalar = vector_fmul_scalar_c; @@ -132,4 +140,7 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) ff_float_dsp_init_ppc(fdsp, bit_exact); if (ARCH_X86) ff_float_dsp_init_x86(fdsp); + if (ARCH_MIPS) + ff_float_dsp_init_mips(fdsp); + return fdsp; } |