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
dd2793c8
Commit
dd2793c8
authored
May 28, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add LUT (LookUp Table) generic filters
parent
83f9bc8a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
488 additions
and
1 deletion
+488
-1
Changelog
Changelog
+1
-0
filters.texi
doc/filters.texi
+112
-0
Makefile
libavfilter/Makefile
+3
-0
allfilters.c
libavfilter/allfilters.c
+3
-0
avfilter.h
libavfilter/avfilter.h
+1
-1
vf_lut.c
libavfilter/vf_lut.c
+368
-0
No files found.
Changelog
View file @
dd2793c8
...
...
@@ -16,6 +16,7 @@ version 0.7:
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
- 4:4:4 H.264 decoding support
- 10-bit H.264 optimizations for x86
- lut, lutrgb, and lutyuv filters added
version 0.7_beta2:
...
...
doc/filters.texi
View file @
dd2793c8
...
...
@@ -701,6 +701,118 @@ a float number which specifies chroma temporal strength, defaults to
@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}
@end table
@section lut, lutrgb, lutyuv
Compute a look-up table for binding each pixel component input value
to an output value, and apply it to input video.
@var{lutyuv} applies a lookup table to a YUV input video, @var{lutrgb}
to an RGB input video.
These filters accept in input a ":"-separated list of options, which
specify the expressions used for computing the lookup table for the
corresponding pixel component values.
The @var{lut} filter requires either YUV or RGB pixel formats in
input, and accepts the options:
@table @option
@var{c0} (first pixel component)
@var{c1} (second pixel component)
@var{c2} (third pixel component)
@var{c3} (fourth pixel component, corresponds to the alpha component)
@end table
The exact component associated to each option depends on the format in
input.
The @var{lutrgb} filter requires RGB pixel formats in input, and
accepts the options:
@table @option
@var{r} (red component)
@var{g} (green component)
@var{b} (blue component)
@var{a} (alpha component)
@end table
The @var{lutyuv} filter requires YUV pixel formats in input, and
accepts the options:
@table @option
@var{y} (Y/luminance component)
@var{u} (U/Cb component)
@var{v} (V/Cr component)
@var{a} (alpha component)
@end table
The expressions can contain the following constants and functions:
@table @option
@item E, PI, PHI
the corresponding mathematical approximated values for e
(euler number), pi (greek PI), PHI (golden ratio)
@item w, h
the input width and heigth
@item val
input value for the pixel component
@item clipval
the input value clipped in the @var{minval}-@var{maxval} range
@item maxval
maximum value for the pixel component
@item minval
minimum value for the pixel component
@item negval
the negated value for the pixel component value clipped in the
@var{minval}-@var{maxval} range , it corresponds to the expression
"maxval-clipval+minval"
@item clip(val)
the computed value in @var{val} clipped in the
@var{minval}-@var{maxval} range
@item gammaval(gamma)
the computed gamma correction value of the pixel component value
clipped in the @var{minval}-@var{maxval} range, corresponds to the
expression
"pow((clipval-minval)/(maxval-minval)\,@var{gamma})*(maxval-minval)+minval"
@end table
All expressions default to "val".
Some examples follow:
@example
# negate input video
lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
# the above is the same as
lutrgb="r=negval:g=negval:b=negval"
lutyuv="y=negval:u=negval:v=negval"
# negate luminance
lutyuv=negval
# remove chroma components, turns the video into a graytone image
lutyuv="u=128:v=128"
# apply a luma burning effect
lutyuv="y=2*val"
# remove green and blue components
lutrgb="g=0:b=0"
# set a constant alpha channel value on input
format=rgba,lutrgb=a="maxval-minval/2"
# correct luminance gamma by a 0.5 factor
lutyuv=y=gammaval(0.5)
@end example
@section mp
Apply an MPlayer filter to the input video.
...
...
libavfilter/Makefile
View file @
dd2793c8
...
...
@@ -38,6 +38,9 @@ OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
OBJS-$(CONFIG_GRADFUN_FILTER)
+=
vf_gradfun.o
OBJS-$(CONFIG_HFLIP_FILTER)
+=
vf_hflip.o
OBJS-$(CONFIG_HQDN3D_FILTER)
+=
vf_hqdn3d.o
OBJS-$(CONFIG_LUT_FILTER)
+=
vf_lut.o
OBJS-$(CONFIG_LUTRGB_FILTER)
+=
vf_lut.o
OBJS-$(CONFIG_LUTYUV_FILTER)
+=
vf_lut.o
OBJS-$(CONFIG_MP_FILTER)
+=
vf_mp.o
OBJS-$(CONFIG_NOFORMAT_FILTER)
+=
vf_format.o
OBJS-$(CONFIG_NULL_FILTER)
+=
vf_null.o
...
...
libavfilter/allfilters.c
View file @
dd2793c8
...
...
@@ -54,6 +54,9 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
GRADFUN
,
gradfun
,
vf
);
REGISTER_FILTER
(
HFLIP
,
hflip
,
vf
);
REGISTER_FILTER
(
HQDN3D
,
hqdn3d
,
vf
);
REGISTER_FILTER
(
LUT
,
lut
,
vf
);
REGISTER_FILTER
(
LUTRGB
,
lutrgb
,
vf
);
REGISTER_FILTER
(
LUTYUV
,
lutyuv
,
vf
);
REGISTER_FILTER
(
MP
,
mp
,
vf
);
REGISTER_FILTER
(
NOFORMAT
,
noformat
,
vf
);
REGISTER_FILTER
(
NULL
,
null
,
vf
);
...
...
libavfilter/avfilter.h
View file @
dd2793c8
...
...
@@ -26,7 +26,7 @@
#include "libavutil/samplefmt.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 1
8
#define LIBAVFILTER_VERSION_MINOR 1
9
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
...
libavfilter/vf_lut.c
0 → 100644
View file @
dd2793c8
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