Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ceb9f8d9
Commit
ceb9f8d9
authored
Dec 14, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioconvert: support simd code with specific alignment requirements.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a286b04d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
audioconvert.c
libswresample/audioconvert.c
+17
-1
audioconvert.h
libswresample/audioconvert.h
+2
-0
No files found.
libswresample/audioconvert.c
View file @
ceb9f8d9
...
...
@@ -170,12 +170,28 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
int
ch
;
int
off
=
0
;
const
int
os
=
(
out
->
planar
?
1
:
out
->
ch_count
)
*
out
->
bps
;
unsigned
misaligned
=
0
;
av_assert0
(
ctx
->
channels
==
out
->
ch_count
);
if
(
ctx
->
in_simd_align_mask
)
{
int
planes
=
in
->
planar
?
in
->
ch_count
:
1
;
unsigned
m
=
0
;
for
(
ch
=
0
;
ch
<
planes
;
ch
++
)
m
|=
(
intptr_t
)
in
->
ch
[
ch
];
misaligned
|=
m
&
ctx
->
in_simd_align_mask
;
}
if
(
ctx
->
out_simd_align_mask
)
{
int
planes
=
out
->
planar
?
out
->
ch_count
:
1
;
unsigned
m
=
0
;
for
(
ch
=
0
;
ch
<
planes
;
ch
++
)
m
|=
(
intptr_t
)
out
->
ch
[
ch
];
misaligned
|=
m
&
ctx
->
out_simd_align_mask
;
}
//FIXME optimize common cases
if
(
ctx
->
simd_f
&&
!
ctx
->
ch_map
){
if
(
ctx
->
simd_f
&&
!
ctx
->
ch_map
&&
!
misaligned
){
off
=
len
&~
15
;
av_assert1
(
off
>=
0
);
av_assert1
(
off
<=
len
);
...
...
libswresample/audioconvert.h
View file @
ceb9f8d9
...
...
@@ -38,6 +38,8 @@ typedef void (simd_func_type)(uint8_t **dst, const uint8_t **src, int len);
typedef
struct
AudioConvert
{
int
channels
;
int
in_simd_align_mask
;
int
out_simd_align_mask
;
conv_func_type
*
conv_f
;
simd_func_type
*
simd_f
;
const
int
*
ch_map
;
...
...
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