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
9bd4df16
Commit
9bd4df16
authored
Nov 21, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_chromashift: add support for commands
parent
fbcb141c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
19 deletions
+41
-19
filters.texi
doc/filters.texi
+8
-0
vf_chromashift.c
libavfilter/vf_chromashift.c
+33
-19
No files found.
doc/filters.texi
View file @
9bd4df16
...
...
@@ -6925,6 +6925,10 @@ Set amount to shift chroma-red vertically.
Set
edge
mode
,
can
be
@
var
{
smear
},
default
,
or
@
var
{
warp
}.
@
end
table
@
subsection
Commands
This
filter
supports
the
all
above
options
as
@
ref
{
commands
}.
@
section
ciescope
Display
CIE
color
diagram
with
pixels
overlaid
onto
it
.
...
...
@@ -15511,6 +15515,10 @@ Set amount to shift alpha vertically.
Set edge mode, can be @var{smear}, default, or @var{warp}.
@end table
@subsection Commands
This filter supports the all above options as @ref{commands}.
@section roberts
Apply roberts cross operator to input video stream.
...
...
libavfilter/vf_chromashift.c
View file @
9bd4df16
...
...
@@ -400,17 +400,29 @@ static int config_input(AVFilterLink *inlink)
return
av_image_fill_linesizes
(
s
->
linesize
,
inlink
->
format
,
inlink
->
w
);
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
int
ret
;
ret
=
ff_filter_process_command
(
ctx
,
cmd
,
args
,
res
,
res_len
,
flags
);
if
(
ret
<
0
)
return
ret
;
return
config_input
(
ctx
->
inputs
[
0
]);
}
#define OFFSET(x) offsetof(ChromaShiftContext, x)
#define VF
AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING
_PARAM
#define VF
R AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME
_PARAM
static
const
AVOption
chromashift_options
[]
=
{
{
"cbh"
,
"shift chroma-blue horizontally"
,
OFFSET
(
cbh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"cbv"
,
"shift chroma-blue vertically"
,
OFFSET
(
cbv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"crh"
,
"shift chroma-red horizontally"
,
OFFSET
(
crh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"crv"
,
"shift chroma-red vertically"
,
OFFSET
(
crv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"edge"
,
"set edge operation"
,
OFFSET
(
edge
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
.
flags
=
VF
,
"edge"
},
{
"smear"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
.
flags
=
VF
,
"edge"
},
{
"wrap"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
.
flags
=
VF
,
"edge"
},
{
"cbh"
,
"shift chroma-blue horizontally"
,
OFFSET
(
cbh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"cbv"
,
"shift chroma-blue vertically"
,
OFFSET
(
cbv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"crh"
,
"shift chroma-red horizontally"
,
OFFSET
(
crh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"crv"
,
"shift chroma-red vertically"
,
OFFSET
(
crv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"edge"
,
"set edge operation"
,
OFFSET
(
edge
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
.
flags
=
VF
R
,
"edge"
},
{
"smear"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
.
flags
=
VF
R
,
"edge"
},
{
"wrap"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
.
flags
=
VF
R
,
"edge"
},
{
NULL
},
};
...
...
@@ -443,20 +455,21 @@ AVFilter ff_vf_chromashift = {
.
outputs
=
outputs
,
.
inputs
=
inputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_SLICE_THREADS
,
.
process_command
=
process_command
,
};
static
const
AVOption
rgbashift_options
[]
=
{
{
"rh"
,
"shift red horizontally"
,
OFFSET
(
rh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"rv"
,
"shift red vertically"
,
OFFSET
(
rv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"gh"
,
"shift green horizontally"
,
OFFSET
(
gh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"gv"
,
"shift green vertically"
,
OFFSET
(
gv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"bh"
,
"shift blue horizontally"
,
OFFSET
(
bh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"bv"
,
"shift blue vertically"
,
OFFSET
(
bv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"ah"
,
"shift alpha horizontally"
,
OFFSET
(
ah
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"av"
,
"shift alpha vertically"
,
OFFSET
(
av
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
},
{
"edge"
,
"set edge operation"
,
OFFSET
(
edge
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
.
flags
=
VF
,
"edge"
},
{
"smear"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
.
flags
=
VF
,
"edge"
},
{
"wrap"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
.
flags
=
VF
,
"edge"
},
{
"rh"
,
"shift red horizontally"
,
OFFSET
(
rh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"rv"
,
"shift red vertically"
,
OFFSET
(
rv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"gh"
,
"shift green horizontally"
,
OFFSET
(
gh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"gv"
,
"shift green vertically"
,
OFFSET
(
gv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"bh"
,
"shift blue horizontally"
,
OFFSET
(
bh
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"bv"
,
"shift blue vertically"
,
OFFSET
(
bv
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"ah"
,
"shift alpha horizontally"
,
OFFSET
(
ah
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"av"
,
"shift alpha vertically"
,
OFFSET
(
av
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
255
,
255
,
.
flags
=
VF
R
},
{
"edge"
,
"set edge operation"
,
OFFSET
(
edge
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
.
flags
=
VF
R
,
"edge"
},
{
"smear"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
.
flags
=
VF
R
,
"edge"
},
{
"wrap"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
.
flags
=
VF
R
,
"edge"
},
{
NULL
},
};
...
...
@@ -471,4 +484,5 @@ AVFilter ff_vf_rgbashift = {
.
outputs
=
outputs
,
.
inputs
=
inputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_SLICE_THREADS
,
.
process_command
=
process_command
,
};
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