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
51d25783
Commit
51d25783
authored
Jun 30, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: fix MMX resample code, add emms
Fixes Ticket1495 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7001eee1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
resample.c
libswresample/resample.c
+7
-3
No files found.
libswresample/resample.c
View file @
51d25783
...
...
@@ -412,6 +412,7 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio
int
swri_multiple_resample
(
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
){
int
i
,
ret
=
-
1
;
int
mm_flags
=
av_get_cpu_flags
();
int
need_emms
=
0
;
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
#if ARCH_X86
...
...
@@ -419,15 +420,18 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud
if
(
c
->
format
==
AV_SAMPLE_FMT_S16P
&&
(
mm_flags
&
AV_CPU_FLAG_SSSE3
))
ret
=
swri_resample_int16_ssse3
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
#endif
if
(
c
->
format
==
AV_SAMPLE_FMT_S16P
&&
(
mm_flags
&
AV_CPU_FLAG_MMX2
))
ret
=
swri_resample_int16_mmx2
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
if
(
c
->
format
==
AV_SAMPLE_FMT_S16P
&&
(
mm_flags
&
AV_CPU_FLAG_MMX2
)){
ret
=
swri_resample_int16_mmx2
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
need_emms
=
1
;
}
else
#endif
if
(
c
->
format
==
AV_SAMPLE_FMT_S16P
)
ret
=
swri_resample_int16
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
if
(
c
->
format
==
AV_SAMPLE_FMT_S32P
)
ret
=
swri_resample_int32
(
c
,
(
int32_t
*
)
dst
->
ch
[
i
],
(
const
int32_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
if
(
c
->
format
==
AV_SAMPLE_FMT_FLTP
)
ret
=
swri_resample_float
(
c
,
(
float
*
)
dst
->
ch
[
i
],
(
const
float
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
if
(
c
->
format
==
AV_SAMPLE_FMT_DBLP
)
ret
=
swri_resample_double
(
c
,(
double
*
)
dst
->
ch
[
i
],
(
const
double
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
}
if
(
need_emms
)
emms_c
();
return
ret
;
}
...
...
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