Line 0
Link Here
|
|
|
1 |
/***************************************************************************** |
2 |
* simple_neon.h : simple channel mixer plug-in using NEON assembly |
3 |
***************************************************************************** |
4 |
* Copyright (C) 2002, 2004, 2006-2009, 2012, 2015 VLC authors and VideoLAN |
5 |
* $Id$ |
6 |
* |
7 |
* Authors: Gildas Bazin <gbazin@videolan.org> |
8 |
* David Geldreich <david.geldreich@free.fr> |
9 |
* Sébastien Toque |
10 |
* Thomas Guillem <thomas@gllm.fr> |
11 |
* |
12 |
* This program is free software; you can redistribute it and/or modify it |
13 |
* under the terms of the GNU Lesser General Public License as published by |
14 |
* the Free Software Foundation; either version 2.1 of the License, or |
15 |
* (at your option) any later version. |
16 |
* |
17 |
* This program is distributed in the hope that it will be useful, |
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 |
* GNU Lesser General Public License for more details. |
21 |
* |
22 |
* You should have received a copy of the GNU Lesser General Public License |
23 |
* along with this program; if not, write to the Free Software Foundation, |
24 |
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
25 |
*****************************************************************************/ |
26 |
|
27 |
#ifdef HAVE_CONFIG_H |
28 |
# include "config.h" |
29 |
#endif |
30 |
#include <vlc_cpu.h> |
31 |
|
32 |
/* Only conversion to Mono, Stereo and 4.0 right now */ |
33 |
/* Only from 7/7.1/5/5.1/3/3.1/2.0 |
34 |
* XXX 5.X rear and middle are handled the same way */ |
35 |
|
36 |
#define NEON_WRAPPER(in, out) \ |
37 |
void convert_##in##_to_##out##_neon_asm(float *dst, const float *src, int num, bool lfeChannel); \ |
38 |
static inline void DoWork_##in##_to_##out##_neon( filter_t *p_filter, block_t *p_in_buf, block_t *p_out_buf ) \ |
39 |
{ \ |
40 |
const float *p_src = (const float *)p_in_buf->p_buffer; \ |
41 |
float *p_dest = (float *)p_out_buf->p_buffer; \ |
42 |
convert_##in##_to_##out##_neon_asm( p_dest, p_src, p_in_buf->i_nb_samples, \ |
43 |
p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ); \ |
44 |
} \ |
45 |
static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, block_t*, block_t*) \ |
46 |
{ \ |
47 |
return vlc_CPU_ARM_NEON() ? DoWork_##in##_to_##out##_neon : DoWork_##in##_to_##out; \ |
48 |
} |
49 |
|
50 |
NEON_WRAPPER(7_x,2_0) |
51 |
NEON_WRAPPER(5_x,2_0) |
52 |
NEON_WRAPPER(4_0,2_0) |
53 |
NEON_WRAPPER(3_x,2_0) |
54 |
NEON_WRAPPER(7_x,1_0) |
55 |
NEON_WRAPPER(5_x,1_0) |
56 |
NEON_WRAPPER(7_x,4_0) |
57 |
NEON_WRAPPER(5_x,4_0) |
58 |
|
59 |
/* TODO: the following conversions are not handled in NEON */ |
60 |
|
61 |
#define C_WRAPPER(in, out) \ |
62 |
static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, block_t*, block_t*) \ |
63 |
{ \ |
64 |
return DoWork_##in##_to_##out; \ |
65 |
} |
66 |
|
67 |
C_WRAPPER(4_0,1_0) |
68 |
C_WRAPPER(3_x,1_0) |
69 |
C_WRAPPER(2_x,1_0) |
70 |
C_WRAPPER(6_1,2_0) |
71 |
C_WRAPPER(7_x,5_x) |
72 |
C_WRAPPER(6_1,5_x) |