[FFmpeg-devel] [PATCH] lavfi: new colorspace conversion filter.

Michael Niedermayer michael at niedermayer.cc
Fri Apr 1 23:20:24 CEST 2016


On Thu, Mar 31, 2016 at 08:29:37PM -0400, Ronald S. Bultje wrote:
> The intent here is similar to colormatrix, but it's LGPLv2.1-or-later
> (instead of GPLv2.0) and supports gamma/chromaticity correction.
> ---
>  doc/filters.texi                     | 183 +++++++
>  libavfilter/Makefile                 |   1 +
>  libavfilter/allfilters.c             |   1 +
>  libavfilter/colorspacedsp.c          | 130 +++++
>  libavfilter/colorspacedsp.h          |  51 ++
>  libavfilter/colorspacedsp_template.c | 256 ++++++++++
>  libavfilter/vf_colorspace.c          | 909 +++++++++++++++++++++++++++++++++++
>  7 files changed, 1531 insertions(+)
>  create mode 100644 libavfilter/colorspacedsp.c
>  create mode 100644 libavfilter/colorspacedsp.h
>  create mode 100644 libavfilter/colorspacedsp_template.c
>  create mode 100644 libavfilter/vf_colorspace.c
[...]

> +#define supported_depth(d) (d == 8 || d == 10 || d == 12)
> +#define supported_subsampling(lcw, lch) \
> +    ((lcw == 0 && lch == 0) || (lcw == 1 && lch == 0) || (lcw == 1 && lch == 1))
> +#define supported_format(d) \
> +    (d != NULL && d->nb_components == 3 && \
> +     !(d->flags & AV_PIX_FMT_FLAG_RGB) && \
> +     supported_depth(d->comp[0].depth) && \
> +     supported_subsampling(d->log2_chroma_w, d->log2_chroma_h))

the macro arguments should be protected by ()
its maybe unlikely with the private macros to hit issues but these
kind of issues can be fun to debug
[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160401/7b394e84/attachment.sig>


More information about the ffmpeg-devel mailing list