/src/ffmpeg/libswresample/resample_dsp.c
Line | Count | Source |
1 | | /* |
2 | | * audio resampling |
3 | | * Copyright (c) 2004-2012 Michael Niedermayer <michaelni@gmx.at> |
4 | | * |
5 | | * This file is part of FFmpeg. |
6 | | * |
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. |
11 | | * |
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. |
16 | | * |
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 |
20 | | */ |
21 | | |
22 | | /** |
23 | | * @file |
24 | | * audio resampling |
25 | | * @author Michael Niedermayer <michaelni@gmx.at> |
26 | | */ |
27 | | |
28 | | #include "resample.h" |
29 | | |
30 | | #define TEMPLATE_RESAMPLE_S16 |
31 | | #include "resample_template.c" |
32 | | #undef TEMPLATE_RESAMPLE_S16 |
33 | | |
34 | | #define TEMPLATE_RESAMPLE_S32 |
35 | | #include "resample_template.c" |
36 | | #undef TEMPLATE_RESAMPLE_S32 |
37 | | |
38 | | #define TEMPLATE_RESAMPLE_FLT |
39 | | #include "resample_template.c" |
40 | | #undef TEMPLATE_RESAMPLE_FLT |
41 | | |
42 | | #define TEMPLATE_RESAMPLE_DBL |
43 | | #include "resample_template.c" |
44 | | #undef TEMPLATE_RESAMPLE_DBL |
45 | | |
46 | | void swri_resample_dsp_init(ResampleContext *c) |
47 | 130k | { |
48 | 130k | switch(c->format){ |
49 | 519 | case AV_SAMPLE_FMT_S16P: |
50 | 519 | c->dsp.resample_one = resample_one_int16; |
51 | 519 | c->dsp.resample_common = resample_common_int16; |
52 | 519 | c->dsp.resample_linear = resample_linear_int16; |
53 | 519 | break; |
54 | 0 | case AV_SAMPLE_FMT_S32P: |
55 | 0 | c->dsp.resample_one = resample_one_int32; |
56 | 0 | c->dsp.resample_common = resample_common_int32; |
57 | 0 | c->dsp.resample_linear = resample_linear_int32; |
58 | 0 | break; |
59 | 129k | case AV_SAMPLE_FMT_FLTP: |
60 | 129k | c->dsp.resample_one = resample_one_float; |
61 | 129k | c->dsp.resample_common = resample_common_float; |
62 | 129k | c->dsp.resample_linear = resample_linear_float; |
63 | 129k | break; |
64 | 161 | case AV_SAMPLE_FMT_DBLP: |
65 | 161 | c->dsp.resample_one = resample_one_double; |
66 | 161 | c->dsp.resample_common = resample_common_double; |
67 | 161 | c->dsp.resample_linear = resample_linear_double; |
68 | 161 | break; |
69 | 130k | } |
70 | | |
71 | | #if ARCH_X86 && HAVE_X86ASM |
72 | | swri_resample_dsp_x86_init(c); |
73 | | #elif ARCH_ARM |
74 | | swri_resample_dsp_arm_init(c); |
75 | | #elif ARCH_AARCH64 |
76 | | swri_resample_dsp_aarch64_init(c); |
77 | | #endif |
78 | 130k | } |