diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-03-29 00:17:23 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-04-04 08:45:16 +0200 |
commit | 5667eaf010461bd973278f61f31a27e8ecf6a05e (patch) | |
tree | 6f729016a9e351d13e755895d31edf64b56aeab9 | |
parent | 89f2d6c349ae9e4417af2eb41402fb69256a63a5 (diff) | |
download | ffmpeg-5667eaf010461bd973278f61f31a27e8ecf6a05e.tar.gz |
lavfi/fade: fix black level for non studio-level pixel formats
Fix trac ticket #1139, regression introduced in 8c1fb50d077d5f954.
(cherry picked from commit 95ce0ddcfe99182365e0e57f5f41d7f1a01c57eb)
-rw-r--r-- | libavfilter/vf_fade.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 68cb567571..f20ba71c55 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -191,9 +191,9 @@ static int config_props(AVFilterLink *inlink) fade->alpha = fade->alpha ? ff_fmt_is_in(inlink->format, alpha_pix_fmts) : 0; fade->is_packed_rgb = ff_fill_rgba_map(fade->rgba_map, inlink->format) >= 0; - /* CCIR601/709 black level unless input is RGB or has alpha */ + /* use CCIR601/709 black level for studio-level pixel non-alpha components */ fade->black_level = - ff_fmt_is_in(inlink->format, studio_level_pix_fmts) || fade->alpha ? 0 : 16; + ff_fmt_is_in(inlink->format, studio_level_pix_fmts) && !fade->alpha ? 16 : 0; /* 32768 = 1 << 15, it is an integer representation * of 0.5 and is for rounding. */ fade->black_level_scaled = (fade->black_level << 16) + 32768; |