3 * Copyright (c) 2004-2012 Michael Niedermayer <michaelni@gmx.at>
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * @author Michael Niedermayer <michaelni@gmx.at>
30 #define TEMPLATE_RESAMPLE_S16
31 #include "resample_template.c"
32 #undef TEMPLATE_RESAMPLE_S16
34 #define TEMPLATE_RESAMPLE_S32
35 #include "resample_template.c"
36 #undef TEMPLATE_RESAMPLE_S32
38 #define TEMPLATE_RESAMPLE_FLT
39 #include "resample_template.c"
40 #undef TEMPLATE_RESAMPLE_FLT
42 #define TEMPLATE_RESAMPLE_DBL
43 #include "resample_template.c"
44 #undef TEMPLATE_RESAMPLE_DBL
46 void swri_resample_dsp_init(ResampleContext
*c
)
49 case AV_SAMPLE_FMT_S16P
:
50 c
->dsp
.resample_one
= resample_one_int16
;
51 c
->dsp
.resample
= c
->linear
? resample_linear_int16
: resample_common_int16
;
53 case AV_SAMPLE_FMT_S32P
:
54 c
->dsp
.resample_one
= resample_one_int32
;
55 c
->dsp
.resample
= c
->linear
? resample_linear_int32
: resample_common_int32
;
57 case AV_SAMPLE_FMT_FLTP
:
58 c
->dsp
.resample_one
= resample_one_float
;
59 c
->dsp
.resample
= c
->linear
? resample_linear_float
: resample_common_float
;
61 case AV_SAMPLE_FMT_DBLP
:
62 c
->dsp
.resample_one
= resample_one_double
;
63 c
->dsp
.resample
= c
->linear
? resample_linear_double
: resample_common_double
;
67 if (ARCH_X86
) swri_resample_dsp_x86_init(c
);