/*1* audio resampling2* Copyright (c) 2004-2012 Michael Niedermayer <[email protected]>3*4* This file is part of FFmpeg.5*6* FFmpeg is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* FFmpeg is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with FFmpeg; if not, write to the Free Software18* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19*/2021/**22* @file23* audio resampling24* @author Michael Niedermayer <[email protected]>25*/2627#include "resample.h"2829#define TEMPLATE_RESAMPLE_S1630#include "resample_template.c"31#undef TEMPLATE_RESAMPLE_S163233#define TEMPLATE_RESAMPLE_S3234#include "resample_template.c"35#undef TEMPLATE_RESAMPLE_S323637#define TEMPLATE_RESAMPLE_FLT38#include "resample_template.c"39#undef TEMPLATE_RESAMPLE_FLT4041#define TEMPLATE_RESAMPLE_DBL42#include "resample_template.c"43#undef TEMPLATE_RESAMPLE_DBL4445void swri_resample_dsp_init(ResampleContext *c)46{47switch(c->format){48case AV_SAMPLE_FMT_S16P:49c->dsp.resample_one = resample_one_int16;50c->dsp.resample = c->linear ? resample_linear_int16 : resample_common_int16;51break;52case AV_SAMPLE_FMT_S32P:53c->dsp.resample_one = resample_one_int32;54c->dsp.resample = c->linear ? resample_linear_int32 : resample_common_int32;55break;56case AV_SAMPLE_FMT_FLTP:57c->dsp.resample_one = resample_one_float;58c->dsp.resample = c->linear ? resample_linear_float : resample_common_float;59break;60case AV_SAMPLE_FMT_DBLP:61c->dsp.resample_one = resample_one_double;62c->dsp.resample = c->linear ? resample_linear_double : resample_common_double;63break;64}6566if (ARCH_X86) swri_resample_dsp_x86_init(c);67}686970