Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
923a3241
Commit
923a3241
authored
6 years ago
by
Martin Vignali
Browse files
Options
Downloads
Patches
Plain Diff
swscale/rgb : add X86 SIMD (SSSE3) for shuffle_bytes_2103 and shuffle_bytes_0321
parent
82336278
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libswscale/x86/Makefile
+1
-0
1 addition, 0 deletions
libswscale/x86/Makefile
libswscale/x86/rgb2rgb.c
+9
-1
9 additions, 1 deletion
libswscale/x86/rgb2rgb.c
libswscale/x86/rgb_2_rgb.asm
+80
-0
80 additions, 0 deletions
libswscale/x86/rgb_2_rgb.asm
with
90 additions
and
1 deletion
libswscale/x86/Makefile
+
1
−
0
View file @
923a3241
...
@@ -11,3 +11,4 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
...
@@ -11,3 +11,4 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
X86ASM-OBJS
+=
x86/input.o
\
X86ASM-OBJS
+=
x86/input.o
\
x86/output.o
\
x86/output.o
\
x86/scale.o
\
x86/scale.o
\
x86/rgb_2_rgb.o
\
This diff is collapsed.
Click to expand it.
libswscale/x86/rgb2rgb.c
+
9
−
1
View file @
923a3241
...
@@ -144,11 +144,14 @@ DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset);
...
@@ -144,11 +144,14 @@ DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset);
#endif
/* HAVE_INLINE_ASM */
#endif
/* HAVE_INLINE_ASM */
void
ff_shuffle_bytes_2103_ssse3
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
ff_shuffle_bytes_0321_ssse3
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
av_cold
void
rgb2rgb_init_x86
(
void
)
av_cold
void
rgb2rgb_init_x86
(
void
)
{
{
#if HAVE_INLINE_ASM
int
cpu_flags
=
av_get_cpu_flags
();
int
cpu_flags
=
av_get_cpu_flags
();
#if HAVE_INLINE_ASM
if
(
INLINE_MMX
(
cpu_flags
))
if
(
INLINE_MMX
(
cpu_flags
))
rgb2rgb_init_mmx
();
rgb2rgb_init_mmx
();
if
(
INLINE_AMD3DNOW
(
cpu_flags
))
if
(
INLINE_AMD3DNOW
(
cpu_flags
))
...
@@ -160,4 +163,9 @@ av_cold void rgb2rgb_init_x86(void)
...
@@ -160,4 +163,9 @@ av_cold void rgb2rgb_init_x86(void)
if
(
INLINE_AVX
(
cpu_flags
))
if
(
INLINE_AVX
(
cpu_flags
))
rgb2rgb_init_avx
();
rgb2rgb_init_avx
();
#endif
/* HAVE_INLINE_ASM */
#endif
/* HAVE_INLINE_ASM */
if
(
EXTERNAL_SSSE3
(
cpu_flags
))
{
shuffle_bytes_0321
=
ff_shuffle_bytes_0321_ssse3
;
shuffle_bytes_2103
=
ff_shuffle_bytes_2103_ssse3
;
}
}
}
This diff is collapsed.
Click to expand it.
libswscale/x86/rgb_2_rgb.asm
0 → 100644
+
80
−
0
View file @
923a3241
;******************************************************************************
;* Copyright Nick Kurshev
;* Copyright Michael (michaelni@gmx.at)
;* Copyright 2018 Jokyo Images
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg 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
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION
_RODATA
pb_shuffle2103:
db
2
,
1
,
0
,
3
,
6
,
5
,
4
,
7
,
10
,
9
,
8
,
11
,
14
,
13
,
12
,
15
pb_shuffle0321:
db
0
,
3
,
2
,
1
,
4
,
7
,
6
,
5
,
8
,
11
,
10
,
9
,
12
,
15
,
14
,
13
SECTION
.text
;------------------------------------------------------------------------------
; shuffle_bytes_## (const uint8_t *src, uint8_t *dst, int src_size)
;------------------------------------------------------------------------------
; %1-4 index shuffle
%macro SHUFFLE_BYTES 4
cglobal
shuffle_bytes_
%
1
%
2
%
3
%
4
,
3
,
5
,
2
,
src
,
ds
t
,
w
,
tmp
,
x
VBROADCASTI128
m0
,
[
pb_shuffle
%
1
%
2
%
3
%
4
]
movsxdifnidn
wq
,
wd
mov
xq
,
wq
add
srcq
,
wq
add
ds
tq
,
wq
neg
wq
;calc scalar loop
and
xq
,
mmsize
-
4
je
.loop_simd
.loop_scalar:
mov
tmpb
,
[
srcq
+
wq
+
%
1
]
mov
[
ds
tq
+
wq
+
0
],
tmpb
mov
tmpb
,
[
srcq
+
wq
+
%
2
]
mov
[
ds
tq
+
wq
+
1
],
tmpb
mov
tmpb
,
[
srcq
+
wq
+
%
3
]
mov
[
ds
tq
+
wq
+
2
],
tmpb
mov
tmpb
,
[
srcq
+
wq
+
%
4
]
mov
[
ds
tq
+
wq
+
3
],
tmpb
add
wq
,
4
sub
xq
,
4
jg
.loop_scalar
;check if src_size < mmsize
cmp
wq
,
0
jge
.end
.loop_simd:
movu
m1
,
[
srcq
+
wq
]
pshufb
m1
,
m0
movu
[
ds
tq
+
wq
],
m1
add
wq
,
mmsize
jl
.loop_simd
.end:
RET
%endmacro
INIT_XMM
ss
se3
SHUFFLE_BYTES
2
,
1
,
0
,
3
SHUFFLE_BYTES
0
,
3
,
2
,
1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment