[FFmpeg-devel] [PATCH] lavfi/fade: fix black level for non studio-level pixel formats

Mark Himsley mark at mdsh.com
Sat Mar 31 13:34:32 CEST 2012


On 28/03/2012 23:21, Stefano Sabatini wrote:
> Fix trac ticket #1139, regression introduced in 8c1fb50d077d5f954.
> ---
>  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 79c8994..27f5bad 100644
> --- a/libavfilter/vf_fade.c
> +++ b/libavfilter/vf_fade.c
> @@ -192,9 +192,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;

Crikey - how did I break my own fix and not notice...

Yes, please push.

-- 
Mark


More information about the ffmpeg-devel mailing list