Commit 8fb03b4d authored by Stefano Sabatini's avatar Stefano Sabatini Committed by Stefano Sabatini

lavfi: port tinterlace filter from MPlayer

Port MPlayer tinterlace filter from MPlayer, with some ideas taken
from the FFmbc/libavfilter port, with the following main differences:

* added support for full-scale YUVJ formats
* added support for YUVA420P
* request_frame() on the filter is forced to return a frame
* some code factorization (related to the copy_picture_fields() function)
* fixed black padding values for mode 3
parent 549b53e8
......@@ -11,6 +11,7 @@ version next:
- thumbnail video filter
- XML output in ffprobe
- asplit audio filter
- tinterlace video filter
version 0.9:
......
......@@ -1652,6 +1652,7 @@ mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
ocv_filter_deps="libopencv"
scale_filter_deps="swscale"
tinterlace_filter_deps="gpl"
yadif_filter_deps="gpl"
# libraries
......
......@@ -2433,6 +2433,40 @@ Complete example of a thumbnail creation with @command{ffmpeg}:
ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
@end example
@section tinterlace
Perform various types of temporal field interlacing.
Frames are counted starting from 1, so the first input frame is
considered odd.
This filter accepts a single parameter specifying the mode. Available
modes are:
@table @samp
@item 0
Move odd frames into the upper field, even into the lower field,
generating a double height frame at half framerate.
@item 1
Only output even frames, odd frames are dropped, generating a frame with
unchanged height at half framerate.
@item 2
Only output odd frames, even frames are dropped, generating a frame with
unchanged height at half framerate.
@item 3
Expand each frame to full height, but pad alternate lines with black,
generating a frame with double height at the same input framerate.
@item 4
Interleave the upper field from odd frames with the lower field from
even frames, generating a frame with unchanged height at half framerate.
@end table
Default mode is 0.
@section transpose
Transpose rows with columns in the input video and optionally flip it.
......
......@@ -81,6 +81,7 @@ OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o
OBJS-$(CONFIG_SLICIFY_FILTER) += vf_slicify.o
OBJS-$(CONFIG_SPLIT_FILTER) += vf_split.o
OBJS-$(CONFIG_THUMBNAIL_FILTER) += vf_thumbnail.o
OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o
OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o
OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o
OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o
......
......@@ -91,6 +91,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (SLICIFY, slicify, vf);
REGISTER_FILTER (SPLIT, split, vf);
REGISTER_FILTER (THUMBNAIL, thumbnail, vf);
REGISTER_FILTER (TINTERLACE, tinterlace, vf);
REGISTER_FILTER (TRANSPOSE, transpose, vf);
REGISTER_FILTER (UNSHARP, unsharp, vf);
REGISTER_FILTER (VFLIP, vflip, vf);
......
......@@ -30,8 +30,8 @@
#include "libavcodec/avcodec.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 55
#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_MINOR 56
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment