00001 /* 00002 * Copyright 2005 Balatoni Denes 00003 * Copyright 2006 Loren Merritt 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #include "config.h" 00023 00024 #include "float_dsp.h" 00025 00026 static void vector_fmul_c(float *dst, const float *src0, const float *src1, 00027 int len) 00028 { 00029 int i; 00030 for (i = 0; i < len; i++) 00031 dst[i] = src0[i] * src1[i]; 00032 } 00033 00034 static void vector_fmac_scalar_c(float *dst, const float *src, float mul, 00035 int len) 00036 { 00037 int i; 00038 for (i = 0; i < len; i++) 00039 dst[i] += src[i] * mul; 00040 } 00041 00042 void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) 00043 { 00044 fdsp->vector_fmul = vector_fmul_c; 00045 fdsp->vector_fmac_scalar = vector_fmac_scalar_c; 00046 00047 #if ARCH_ARM 00048 ff_float_dsp_init_arm(fdsp); 00049 #elif ARCH_PPC 00050 ff_float_dsp_init_ppc(fdsp, bit_exact); 00051 #elif ARCH_X86 00052 ff_float_dsp_init_x86(fdsp); 00053 #endif 00054 }