Skip to content

Commit

Permalink
avfilter: add unpremultiply filter
Browse files Browse the repository at this point in the history
Signed-off-by: Paul B Mahol <[email protected]>
  • Loading branch information
richardpl committed Aug 2, 2017
1 parent 1193301 commit c79e753
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 46 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ version <next>:
- limiter video filter
- libvmaf video filter
- Dolby E decoder and SMPTE 337M demuxer
- unpremultiply video filter

version 3.3:
- CrystalHD decoder moved to new decode API
Expand Down
19 changes: 19 additions & 0 deletions doc/filters.texi
Original file line number Diff line number Diff line change
Expand Up @@ -14532,6 +14532,25 @@ ffmpeg -i INPUT -vf trim=duration=1

@end itemize

@section unpremultiply
Apply alpha unpremultiply effect to input video stream using first plane
of second stream as alpha.

Both streams must have same dimensions and same pixel format.

The filter accepts the following option:

@table @option
@item planes
Set which planes will be processed, unprocessed planes will be copied.
By default value 0xf, all planes will be processed.

If the format has 1 or 2 components, then luma is bit 0.
If the format has 3 or 4 components:
for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
If present, the alpha channel is always the last bit.
@end table

@anchor{unsharp}
@section unsharp
Expand Down
1 change: 1 addition & 0 deletions libavfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ OBJS-$(CONFIG_TILE_FILTER) += vf_tile.o
OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o
OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o
OBJS-$(CONFIG_TRIM_FILTER) += trim.o
OBJS-$(CONFIG_UNPREMULTIPLY_FILTER) += vf_premultiply.o framesync2.o
OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o
OBJS-$(CONFIG_USPP_FILTER) += vf_uspp.o
OBJS-$(CONFIG_VAGUEDENOISER_FILTER) += vf_vaguedenoiser.o
Expand Down
1 change: 1 addition & 0 deletions libavfilter/allfilters.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ static void register_all(void)
REGISTER_FILTER(TINTERLACE, tinterlace, vf);
REGISTER_FILTER(TRANSPOSE, transpose, vf);
REGISTER_FILTER(TRIM, trim, vf);
REGISTER_FILTER(UNPREMULTIPLY, unpremultiply, vf);
REGISTER_FILTER(UNSHARP, unsharp, vf);
REGISTER_FILTER(USPP, uspp, vf);
REGISTER_FILTER(VAGUEDENOISER, vaguedenoiser, vf);
Expand Down
2 changes: 1 addition & 1 deletion libavfilter/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "libavutil/version.h"

#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 95
#define LIBAVFILTER_VERSION_MINOR 96
#define LIBAVFILTER_VERSION_MICRO 100

#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
Expand Down
Loading

0 comments on commit c79e753

Please sign in to comment.