From 2b9a52bcca7d0b95c974a9addaad29e917dd3d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u@pkh.me> Date: Sun, 19 Mar 2017 15:15:10 +0100 Subject: [PATCH] swscale: use a function for isAnyRGB --- libswscale/swscale_internal.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 34130740b17..b1fec421fea 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -767,13 +767,13 @@ static av_always_inline int isBayer(enum AVPixelFormat pix_fmt) return !!(desc->flags & AV_PIX_FMT_FLAG_BAYER); } -#define isAnyRGB(x) \ - ( \ - isBayer(x) || \ - isRGBinInt(x) || \ - isBGRinInt(x) || \ - isRGB(x) \ - ) +static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_RGB) || + pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE; +} static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) { -- GitLab