diff options
author | Clément Bœsch <u@pkh.me> | 2017-03-19 15:15:10 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-03-20 08:02:30 +0100 |
commit | 2b9a52bcca7d0b95c974a9addaad29e917dd3d40 (patch) | |
tree | 309287e344d42b6ab44fa7a0219823ccfcf3fa32 | |
parent | c30875e8b2bd785ff02cbc828295f583ccc488c6 (diff) | |
download | ffmpeg-2b9a52bcca7d0b95c974a9addaad29e917dd3d40.tar.gz |
swscale: use a function for isAnyRGB
-rw-r--r-- | libswscale/swscale_internal.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 34130740b1..b1fec421fe 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) { |