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
5ce703a6
Commit
5ce703a6
authored
8 years ago
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_colorspace: x86-64 SIMD (SSE2) optimizations.
parent
2e2e08a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1543 additions
and
0 deletions
+1543
-0
colorspacedsp.c
libavfilter/colorspacedsp.c
+3
-0
colorspacedsp.h
libavfilter/colorspacedsp.h
+3
-0
Makefile
libavfilter/x86/Makefile
+2
-0
colorspacedsp.asm
libavfilter/x86/colorspacedsp.asm
+1097
-0
colorspacedsp_init.c
libavfilter/x86/colorspacedsp_init.c
+119
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
vf_colorspace.c
tests/checkasm/vf_colorspace.c
+314
-0
No files found.
libavfilter/colorspacedsp.c
View file @
5ce703a6
...
...
@@ -128,4 +128,7 @@ void ff_colorspacedsp_init(ColorSpaceDSPContext *dsp)
init_yuv2yuv_fns
(
2
,
12
);
dsp
->
multiply3x3
=
multiply3x3_c
;
if
(
ARCH_X86
)
ff_colorspacedsp_x86_init
(
dsp
);
}
This diff is collapsed.
Click to expand it.
libavfilter/colorspacedsp.h
View file @
5ce703a6
...
...
@@ -48,4 +48,7 @@ typedef struct ColorSpaceDSPContext {
void
ff_colorspacedsp_init
(
ColorSpaceDSPContext
*
dsp
);
/* internal */
void
ff_colorspacedsp_x86_init
(
ColorSpaceDSPContext
*
dsp
);
#endif
/* AVFILTER_COLORSPACEDSP_H */
This diff is collapsed.
Click to expand it.
libavfilter/x86/Makefile
View file @
5ce703a6
OBJS-$(CONFIG_BLEND_FILTER)
+=
x86/vf_blend_init.o
OBJS-$(CONFIG_BWDIF_FILTER)
+=
x86/vf_bwdif_init.o
OBJS-$(CONFIG_COLORSPACE_FILTER)
+=
x86/colorspacedsp_init.o
OBJS-$(CONFIG_EQ_FILTER)
+=
x86/vf_eq.o
OBJS-$(CONFIG_FSPP_FILTER)
+=
x86/vf_fspp_init.o
OBJS-$(CONFIG_GRADFUN_FILTER)
+=
x86/vf_gradfun_init.o
...
...
@@ -23,6 +24,7 @@ OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif_init.o
YASM-OBJS-$(CONFIG_BLEND_FILTER)
+=
x86/vf_blend.o
YASM-OBJS-$(CONFIG_BWDIF_FILTER)
+=
x86/vf_bwdif.o
YASM-OBJS-$(CONFIG_COLORSPACE_FILTER)
+=
x86/colorspacedsp.o
YASM-OBJS-$(CONFIG_FSPP_FILTER)
+=
x86/vf_fspp.o
YASM-OBJS-$(CONFIG_GRADFUN_FILTER)
+=
x86/vf_gradfun.o
YASM-OBJS-$(CONFIG_HQDN3D_FILTER)
+=
x86/vf_hqdn3d.o
...
...
This diff is collapsed.
Click to expand it.
libavfilter/x86/colorspacedsp.asm
0 → 100644
View file @
5ce703a6
This diff is collapsed.
Click to expand it.
libavfilter/x86/colorspacedsp_init.c
0 → 100644
View file @
5ce703a6
/*
* Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com>
*
* 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/cpu.h"
#include "libavfilter/colorspacedsp.h"
#define decl_yuv2yuv_fn(t) \
void ff_yuv2yuv_##t##_sse2(uint8_t *yuv_out[3], ptrdiff_t yuv_out_stride[3], \
uint8_t *yuv_in[3], ptrdiff_t yuv_in_stride[3], \
int w, int h, const int16_t yuv2yuv_coeffs[3][3][8], \
const int16_t yuv_offset[2][8])
#define decl_yuv2yuv_fns(ss) \
decl_yuv2yuv_fn(ss##p8to8); \
decl_yuv2yuv_fn(ss##p10to8); \
decl_yuv2yuv_fn(ss##p12to8); \
decl_yuv2yuv_fn(ss##p8to10); \
decl_yuv2yuv_fn(ss##p10to10); \
decl_yuv2yuv_fn(ss##p12to10); \
decl_yuv2yuv_fn(ss##p8to12); \
decl_yuv2yuv_fn(ss##p10to12); \
decl_yuv2yuv_fn(ss##p12to12)
decl_yuv2yuv_fns
(
420
);
decl_yuv2yuv_fns
(
422
);
decl_yuv2yuv_fns
(
444
);
#define decl_yuv2rgb_fn(t) \
void ff_yuv2rgb_##t##_sse2(int16_t *rgb_out[3], ptrdiff_t rgb_stride, \
uint8_t *yuv_in[3], ptrdiff_t yuv_stride[3], \
int w, int h, const int16_t coeff[3][3][8], \
const int16_t yuv_offset[8])
#define decl_yuv2rgb_fns(ss) \
decl_yuv2rgb_fn(ss##p8); \
decl_yuv2rgb_fn(ss##p10); \
decl_yuv2rgb_fn(ss##p12)
decl_yuv2rgb_fns
(
420
);
decl_yuv2rgb_fns
(
422
);
decl_yuv2rgb_fns
(
444
);
#define decl_rgb2yuv_fn(t) \
void ff_rgb2yuv_##t##_sse2(uint8_t *yuv_out[3], ptrdiff_t yuv_stride[3], \
int16_t *rgb_in[3], ptrdiff_t rgb_stride, \
int w, int h, const int16_t coeff[3][3][8], \
const int16_t yuv_offset[8])
#define decl_rgb2yuv_fns(ss) \
decl_rgb2yuv_fn(ss##p8); \
decl_rgb2yuv_fn(ss##p10); \
decl_rgb2yuv_fn(ss##p12)
decl_rgb2yuv_fns
(
420
);
decl_rgb2yuv_fns
(
422
);
decl_rgb2yuv_fns
(
444
);
void
ff_multiply3x3_sse2
(
int16_t
*
data
[
3
],
ptrdiff_t
stride
,
int
w
,
int
h
,
const
int16_t
coeff
[
3
][
3
][
8
]);
void
ff_colorspacedsp_x86_init
(
ColorSpaceDSPContext
*
dsp
)
{
int
cpu_flags
=
av_get_cpu_flags
();
if
(
ARCH_X86_64
&&
EXTERNAL_SSE2
(
cpu_flags
))
{
#define assign_yuv2yuv_fns(idx, ss) \
dsp->yuv2yuv[0][0][idx] = ff_yuv2yuv_##ss##p8to8_sse2; \
dsp->yuv2yuv[0][1][idx] = ff_yuv2yuv_##ss##p8to10_sse2; \
dsp->yuv2yuv[0][2][idx] = ff_yuv2yuv_##ss##p8to12_sse2; \
dsp->yuv2yuv[1][0][idx] = ff_yuv2yuv_##ss##p10to8_sse2; \
dsp->yuv2yuv[1][1][idx] = ff_yuv2yuv_##ss##p10to10_sse2; \
dsp->yuv2yuv[1][2][idx] = ff_yuv2yuv_##ss##p10to12_sse2; \
dsp->yuv2yuv[2][0][idx] = ff_yuv2yuv_##ss##p12to8_sse2; \
dsp->yuv2yuv[2][1][idx] = ff_yuv2yuv_##ss##p12to10_sse2; \
dsp->yuv2yuv[2][2][idx] = ff_yuv2yuv_##ss##p12to12_sse2
assign_yuv2yuv_fns
(
2
,
420
);
assign_yuv2yuv_fns
(
1
,
422
);
assign_yuv2yuv_fns
(
0
,
444
);
#define assign_yuv2rgb_fns(idx, ss) \
dsp->yuv2rgb[0][idx] = ff_yuv2rgb_##ss##p8_sse2; \
dsp->yuv2rgb[1][idx] = ff_yuv2rgb_##ss##p10_sse2; \
dsp->yuv2rgb[2][idx] = ff_yuv2rgb_##ss##p12_sse2
assign_yuv2rgb_fns
(
2
,
420
);
assign_yuv2rgb_fns
(
1
,
422
);
assign_yuv2rgb_fns
(
0
,
444
);
#define assign_rgb2yuv_fns(idx, ss) \
dsp->rgb2yuv[0][idx] = ff_rgb2yuv_##ss##p8_sse2; \
dsp->rgb2yuv[1][idx] = ff_rgb2yuv_##ss##p10_sse2; \
dsp->rgb2yuv[2][idx] = ff_rgb2yuv_##ss##p12_sse2
assign_rgb2yuv_fns
(
2
,
420
);
assign_rgb2yuv_fns
(
1
,
422
);
assign_rgb2yuv_fns
(
0
,
444
);
dsp
->
multiply3x3
=
ff_multiply3x3_sse2
;
}
}
This diff is collapsed.
Click to expand it.
tests/checkasm/Makefile
View file @
5ce703a6
...
...
@@ -16,6 +16,7 @@ CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes)
# libavfilter tests
AVFILTEROBJS-$(CONFIG_BLEND_FILTER)
+=
vf_blend.o
AVFILTEROBJS-$(CONFIG_COLORSPACE_FILTER)
+=
vf_colorspace.o
CHECKASMOBJS-$(CONFIG_AVFILTER)
+=
$(AVFILTEROBJS-yes)
...
...
This diff is collapsed.
Click to expand it.
tests/checkasm/checkasm.c
View file @
5ce703a6
...
...
@@ -106,6 +106,9 @@ static const struct {
#if CONFIG_BLEND_FILTER
{
"vf_blend"
,
checkasm_check_blend
},
#endif
#if CONFIG_COLORSPACE_FILTER
{
"vf_colorspace"
,
checkasm_check_colorspace
},
#endif
#endif
{
NULL
}
};
...
...
This diff is collapsed.
Click to expand it.
tests/checkasm/checkasm.h
View file @
5ce703a6
...
...
@@ -33,6 +33,7 @@
void
checkasm_check_alacdsp
(
void
);
void
checkasm_check_blend
(
void
);
void
checkasm_check_bswapdsp
(
void
);
void
checkasm_check_colorspace
(
void
);
void
checkasm_check_flacdsp
(
void
);
void
checkasm_check_fmtconvert
(
void
);
void
checkasm_check_h264pred
(
void
);
...
...
This diff is collapsed.
Click to expand it.
tests/checkasm/vf_colorspace.c
0 → 100644
View file @
5ce703a6
This diff is collapsed.
Click to expand it.
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