[FFmpeg-devel] [PATCH 4/5] swscale: use a function for isAnyRGB
Clément Bœsch
u at pkh.me
Sun Mar 19 16:33:42 EET 2017
---
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 b3bb1695fb..9a28d180f1 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 !strncmp(desc->name, "bayer_", 6);
}
-#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)
{
--
2.12.0
More information about the ffmpeg-devel
mailing list