aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-19 15:15:10 +0100
committerClément Bœsch <u@pkh.me>2017-03-20 08:02:30 +0100
commit2b9a52bcca7d0b95c974a9addaad29e917dd3d40 (patch)
tree309287e344d42b6ab44fa7a0219823ccfcf3fa32
parentc30875e8b2bd785ff02cbc828295f583ccc488c6 (diff)
downloadffmpeg-2b9a52bcca7d0b95c974a9addaad29e917dd3d40.tar.gz
swscale: use a function for isAnyRGB
-rw-r--r--libswscale/swscale_internal.h14
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)
{