[FFmpeg-devel] [PATCH] swscale: Implement alphablendaway for planar 4:4:4 formats

Ronald S. Bultje rsbultje at gmail.com
Fri Aug 7 04:24:52 CEST 2015


Hi,

On Thu, Aug 6, 2015 at 4:27 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> From: Michael Niedermayer <michael at niedermayer.cc>
>
> Fixes Ticket4746
>
> TODO: implement packed formats and subsampled formats
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  doc/scaler.texi               |   13 ++++++
>  libswscale/Makefile           |    3 +-
>  libswscale/alphablend.c       |   55 +++++++++++++++++++++++
>  libswscale/options.c          |    3 ++
>  libswscale/swscale_internal.h |   12 +++++
>  libswscale/utils.c            |   97
> +++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 182 insertions(+), 1 deletion(-)
>  create mode 100644 libswscale/alphablend.c
>
> diff --git a/doc/scaler.texi b/doc/scaler.texi
> index 23d6393..4c55334 100644
> --- a/doc/scaler.texi
> +++ b/doc/scaler.texi
> @@ -122,6 +122,19 @@ a_dither).
>
>  @end table
>
> + at item alphablend
> +Set the alpha blending to use when the input has alpha but the output
> does not.
> +Default value is @samp{black}.
> +
> + at table @samp
> + at item black
> +Blend onto black
> +
> + at item none
> +No blending
> +
> + at end table
> +
>  @end table


I must admit I'm not a fan of having just two values for something like
this. It seems to me you want 2 options, "blendmode", being "none" or
"background" (or a float/alpha between 1.0/0.0), and the actual background
color (black, white, blue, r=a,g=b,c=d). "black" vs. "none" seems like a
future compat nightmare. Is it that hard to implement a proper rgb/yuv
value solution?

Ronald


More information about the ffmpeg-devel mailing list