[FFmpeg-cvslog] swscale: use a function for isAnyRGB
Clément Bœsch
git at videolan.org
Mon Mar 20 09:06:24 EET 2017
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Mar 19 15:15:10 2017 +0100| [2b9a52bcca7d0b95c974a9addaad29e917dd3d40] | committer: Clément Bœsch
swscale: use a function for isAnyRGB
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b9a52bcca7d0b95c974a9addaad29e917dd3d40
---
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 3413074..b1fec42 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)
{
More information about the ffmpeg-cvslog
mailing list