swscale: use a function for isAnyRGB

This commit is contained in:
Clément Bœsch 2017-03-19 15:15:10 +01:00
parent c30875e8b2
commit 2b9a52bcca

View File

@ -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)
{