Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7b517695
Commit
7b517695
authored
Sep 05, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NEON float to fixed point vectorized conversion
parent
600d2904
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
0 deletions
+114
-0
modules/audio_filter/converter/Modules.am
modules/audio_filter/converter/Modules.am
+4
-0
modules/audio_filter/converter/neon.c
modules/audio_filter/converter/neon.c
+110
-0
No files found.
modules/audio_filter/converter/Modules.am
View file @
7b517695
SOURCES_converter_fixed = fixed.c
SOURCES_converter_float = float.c
SOURCES_converter_neon = neon.c
SOURCES_a52tospdif = a52tospdif.c
SOURCES_a52tofloat32 = a52tofloat32.c
SOURCES_dtstospdif = dtstospdif.c
...
...
@@ -9,3 +10,6 @@ SOURCES_mpgatofixed32 = mpgatofixed32.c
libvlc_LTLIBRARIES += \
libconverter_fixed_plugin.la \
$(NULL)
if HAVE_NEON
libvlc_LTLIBRARIES += libconverter_neon_plugin.la
endif
modules/audio_filter/converter/neon.c
0 → 100644
View file @
7b517695
/*****************************************************************************
* arm_neon.c: NEON assembly optimized audio conversions
*****************************************************************************
* Copyright (C) 2009 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
static
int
Open
(
vlc_object_t
*
);
vlc_module_begin
()
set_description
(
N_
(
"ARM NEON audio format conversions"
)
)
add_submodule
()
set_capability
(
"audio filter"
,
20
)
set_callbacks
(
Open
,
NULL
)
vlc_module_end
()
static
void
Do_F32_S32
(
aout_instance_t
*
,
aout_filter_t
*
,
aout_buffer_t
*
,
aout_buffer_t
*
);
static
int
Open
(
vlc_object_t
*
obj
)
{
aout_filter_t
*
filter
=
(
aout_filter_t
*
)
obj
;
if
(
!
(
vlc_CPU
()
&
CPU_CAPABILITY_NEON
))
return
VLC_EGENERIC
;
if
(
!
AOUT_FMTS_SIMILAR
(
&
filter
->
input
,
&
filter
->
output
))
return
VLC_EGENERIC
;
if
(
filter
->
input
.
i_format
==
VLC_CODEC_FL32
)
{
if
(
filter
->
output
.
i_format
==
VLC_CODEC_FI32
)
filter
->
pf_do_work
=
Do_F32_S32
;
else
return
VLC_EGENERIC
;
}
else
return
VLC_EGENERIC
;
filter
->
b_in_place
=
true
;
return
0
;
}
/**
* Half-precision floating point to signed fixed point conversion.
*/
static
void
Do_F32_S32
(
aout_instance_t
*
aout
,
aout_filter_t
*
filter
,
aout_buffer_t
*
inbuf
,
aout_buffer_t
*
outbuf
)
{
unsigned
nb_samples
=
inbuf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
filter
->
input
);
const
float
*
inp
=
(
float
*
)
inbuf
->
p_buffer
;
const
float
*
endp
=
inp
+
nb_samples
;
int32_t
*
outp
=
(
int32_t
*
)
outbuf
->
p_buffer
;
if
(
nb_samples
&
1
)
*
(
outp
++
)
=
*
(
inp
++
)
*
FIXED32_ONE
;
if
(
nb_samples
&
2
)
asm
volatile
(
"vld1.f32 {d0}, [%[inp]]!
\n
"
"vcvt.s32.f32 d1, d0, #28
\n
"
"vst1.s32 {d1}, [%[outp]]!
\n
"
:
[
outp
]
"+r"
(
outp
),
[
inp
]
"+r"
(
inp
)
:
:
"q0"
,
"memory"
);
if
(
nb_samples
&
4
)
asm
volatile
(
"vld2.f32 {q0}, [%[inp]]!
\n
"
"vcvt.s32.f32 q1, q0, #28
\n
"
"vst2.s32 {q1}, [%[outp]]!
\n
"
:
[
outp
]
"+r"
(
outp
),
[
inp
]
"+r"
(
inp
)
:
:
"q0"
,
"q1"
,
"memory"
);
while
(
inp
!=
endp
)
asm
volatile
(
"vld4.f32 {q0-q1}, [%[inp]]!
\n
"
"vcvt.s32.f32 q2, q0, #28
\n
"
"vcvt.s32.f32 q3, q1, #28
\n
"
"vst4.s32 {q2-q3}, [%[outp]]!
\n
"
:
[
outp
]
"+r"
(
outp
),
[
inp
]
"+r"
(
inp
)
:
:
"q0"
,
"q1"
,
"q2"
,
"q3"
,
"memory"
);
outbuf
->
i_nb_samples
=
inbuf
->
i_nb_samples
;
outbuf
->
i_nb_bytes
=
inbuf
->
i_nb_bytes
;
(
void
)
aout
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment