Skip to content

Commit

Permalink
lavfi: port tinterlace filter from MPlayer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Stefano Sabatini authored and saste committed Dec 31, 2011
1 parent 549b53e commit 8fb03b4
Show file tree
Hide file tree
Showing 7 changed files with 365 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog
Expand Up @@ -11,6 +11,7 @@ version next:
- thumbnail video filter
- XML output in ffprobe
- asplit audio filter
- tinterlace video filter


version 0.9:
Expand Down
1 change: 1 addition & 0 deletions configure
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions doc/filters.texi
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions libavfilter/Makefile
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions libavfilter/allfilters.c
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions libavfilter/avfilter.h
Expand Up @@ -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, \
Expand Down

0 comments on commit 8fb03b4

Please sign in to comment.