aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-09-17 23:41:31 -0300
committerJames Almer <jamrial@gmail.com>2017-09-18 00:15:58 -0300
commit3af1060319b46005dbfb3b01f9104539caf30146 (patch)
treed7b0444358102033c5add8b2dd1fe34590c281ce
parent4492237e333c3b5eb57e255d3dba690dcf35940c (diff)
downloadffmpeg-3af1060319b46005dbfb3b01f9104539caf30146.tar.gz
avfilter/tinterlace: Simplify checks for lowpass filtering flags
-rw-r--r--libavfilter/vf_tinterlace.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 66c6d17ed9..9ae9daafc1 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -172,14 +172,12 @@ static int config_out_props(AVFilterLink *outlink)
tinterlace->black_linesize[i] * h);
}
}
- if ((tinterlace->flags & TINTERLACE_FLAG_VLPF
- || tinterlace->flags & TINTERLACE_FLAG_CVLPF)
+ if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF)
&& !(tinterlace->mode == MODE_INTERLEAVE_TOP
|| tinterlace->mode == MODE_INTERLEAVE_BOTTOM)) {
av_log(ctx, AV_LOG_WARNING, "low_pass_filter flags ignored with mode %d\n",
tinterlace->mode);
- tinterlace->flags &= ~TINTERLACE_FLAG_VLPF;
- tinterlace->flags &= ~TINTERLACE_FLAG_CVLPF;
+ tinterlace->flags &= ~(TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF);
}
tinterlace->preout_time_base = inlink->time_base;
if (tinterlace->mode == MODE_INTERLACEX2) {
@@ -263,10 +261,8 @@ void copy_picture_field(TInterlaceContext *tinterlace,
// Low-pass filtering is required when creating an interlaced destination from
// a progressive source which contains high-frequency vertical detail.
// Filtering will reduce interlace 'twitter' and Moire patterning.
- if (flags & TINTERLACE_FLAG_VLPF || flags & TINTERLACE_FLAG_CVLPF) {
- int x = 0;
- if (flags & TINTERLACE_FLAG_CVLPF)
- x = 1;
+ if (flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF)) {
+ int x = !!(flags & TINTERLACE_FLAG_CVLPF);
for (h = lines; h > 0; h--) {
ptrdiff_t pref = src_linesize[plane];
ptrdiff_t mref = -pref;