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
1c6a9199
Commit
1c6a9199
authored
Feb 06, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: add pad opencl filter
parent
6d37ca8a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
516 additions
and
1 deletion
+516
-1
Changelog
Changelog
+1
-0
configure
configure
+1
-0
filters.texi
doc/filters.texi
+77
-0
Makefile
libavfilter/Makefile
+1
-0
allfilters.c
libavfilter/allfilters.c
+1
-0
pad.cl
libavfilter/opencl/pad.cl
+36
-0
opencl_source.h
libavfilter/opencl_source.h
+1
-0
version.h
libavfilter/version.h
+1
-1
vf_pad_opencl.c
libavfilter/vf_pad_opencl.c
+397
-0
No files found.
Changelog
View file @
1c6a9199
...
...
@@ -35,6 +35,7 @@ version <next>:
- xfade video filter
- xfade_opencl filter
- afirsrc audio filter source
- pad_opencl filter
version 4.2:
...
...
configure
View file @
1c6a9199
...
...
@@ -3535,6 +3535,7 @@ overlay_qsv_filter_deps="libmfx"
overlay_qsv_filter_select
=
"qsvvpp"
overlay_vulkan_filter_deps
=
"vulkan libglslang"
owdenoise_filter_deps
=
"gpl"
pad_opencl_filter_deps
=
"opencl"
pan_filter_deps
=
"swresample"
perspective_filter_deps
=
"gpl"
phase_filter_deps
=
"gpl"
...
...
doc/filters.texi
View file @
1c6a9199
...
...
@@ -21172,6 +21172,83 @@ The inputs have same memory layout for color channels , the overlay has addition
@
end
itemize
@
section
pad_opencl
Add
paddings
to
the
input
image
,
and
place
the
original
input
at
the
provided
@
var
{
x
},
@
var
{
y
}
coordinates
.
It
accepts
the
following
options
:
@
table
@
option
@
item
width
,
w
@
item
height
,
h
Specify
an
expression
for
the
size
of
the
output
image
with
the
paddings
added
.
If
the
value
for
@
var
{
width
}
or
@
var
{
height
}
is
0
,
the
corresponding
input
size
is
used
for
the
output
.
The
@
var
{
width
}
expression
can
reference
the
value
set
by
the
@
var
{
height
}
expression
,
and
vice
versa
.
The
default
value
of
@
var
{
width
}
and
@
var
{
height
}
is
0.
@
item
x
@
item
y
Specify
the
offsets
to
place
the
input
image
at
within
the
padded
area
,
with
respect
to
the
top
/
left
border
of
the
output
image
.
The
@
var
{
x
}
expression
can
reference
the
value
set
by
the
@
var
{
y
}
expression
,
and
vice
versa
.
The
default
value
of
@
var
{
x
}
and
@
var
{
y
}
is
0.
If
@
var
{
x
}
or
@
var
{
y
}
evaluate
to
a
negative
number
,
they
'll be changed
so the input image is centered on the padded area.
@item color
Specify the color of the padded area. For the syntax of this option,
check the @ref{color syntax,,"Color" section in the ffmpeg-utils
manual,ffmpeg-utils}.
@item aspect
Pad to an aspect instead to a resolution.
@end table
The value for the @var{width}, @var{height}, @var{x}, and @var{y}
options are expressions containing the following constants:
@table @option
@item in_w
@item in_h
The input video width and height.
@item iw
@item ih
These are the same as @var{in_w} and @var{in_h}.
@item out_w
@item out_h
The output width and height (the size of the padded area), as
specified by the @var{width} and @var{height} expressions.
@item ow
@item oh
These are the same as @var{out_w} and @var{out_h}.
@item x
@item y
The x and y offsets as specified by the @var{x} and @var{y}
expressions, or NAN if not yet specified.
@item a
same as @var{iw} / @var{ih}
@item sar
input sample aspect ratio
@item dar
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
@end table
@section prewitt_opencl
Apply the Prewitt operator (@url{https://en.wikipedia.org/wiki/Prewitt_operator}) to input video stream.
...
...
libavfilter/Makefile
View file @
1c6a9199
...
...
@@ -329,6 +329,7 @@ OBJS-$(CONFIG_OVERLAY_QSV_FILTER) += vf_overlay_qsv.o framesync.o
OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER)
+=
vf_overlay_vulkan.o
vulkan.o
OBJS-$(CONFIG_OWDENOISE_FILTER)
+=
vf_owdenoise.o
OBJS-$(CONFIG_PAD_FILTER)
+=
vf_pad.o
OBJS-$(CONFIG_PAD_OPENCL_FILTER)
+=
vf_pad_opencl.o
opencl.o
opencl/pad.o
OBJS-$(CONFIG_PALETTEGEN_FILTER)
+=
vf_palettegen.o
OBJS-$(CONFIG_PALETTEUSE_FILTER)
+=
vf_paletteuse.o
framesync.o
OBJS-$(CONFIG_PERMS_FILTER)
+=
f_perms.o
...
...
libavfilter/allfilters.c
View file @
1c6a9199
...
...
@@ -313,6 +313,7 @@ extern AVFilter ff_vf_overlay_qsv;
extern
AVFilter
ff_vf_overlay_vulkan
;
extern
AVFilter
ff_vf_owdenoise
;
extern
AVFilter
ff_vf_pad
;
extern
AVFilter
ff_vf_pad_opencl
;
extern
AVFilter
ff_vf_palettegen
;
extern
AVFilter
ff_vf_paletteuse
;
extern
AVFilter
ff_vf_perms
;
...
...
libavfilter/opencl/pad.cl
0 → 100644
View file @
1c6a9199
/*
*
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
*/
const
sampler_t
sampler
=
CLK_NORMALIZED_COORDS_FALSE
|
CLK_FILTER_NEAREST;
__kernel void pad (
__read_only image2d_t src,
__write_only image2d_t dst,
float4 color,
int2 xy)
{
int2 size_src = get_image_dim(src);
int2 loc = (int2)(get_global_id(0), get_global_id(1));
int2 src_pos = (int2)(get_global_id(0) - xy.x, get_global_id(1) - xy.y);
float4 pixel = loc.x >= size_src.x + xy.x ||
loc.y >= size_src.y + xy.y ||
loc.x < xy.x |
|
loc.y
<
xy.y
?
color
:
read_imagef
(
src,
sampler,
src_pos
)
;
write_imagef
(
dst,
loc,
pixel
)
;
}
libavfilter/opencl_source.h
View file @
1c6a9199
...
...
@@ -27,6 +27,7 @@ extern const char *ff_opencl_source_deshake;
extern
const
char
*
ff_opencl_source_neighbor
;
extern
const
char
*
ff_opencl_source_nlmeans
;
extern
const
char
*
ff_opencl_source_overlay
;
extern
const
char
*
ff_opencl_source_pad
;
extern
const
char
*
ff_opencl_source_tonemap
;
extern
const
char
*
ff_opencl_source_transpose
;
extern
const
char
*
ff_opencl_source_unsharp
;
...
...
libavfilter/version.h
View file @
1c6a9199
...
...
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 7
#define LIBAVFILTER_VERSION_MINOR 7
5
#define LIBAVFILTER_VERSION_MINOR 7
6
#define LIBAVFILTER_VERSION_MICRO 100
...
...
libavfilter/vf_pad_opencl.c
0 → 100644
View file @
1c6a9199
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