Commit f052b1b4 authored by Clément Bœsch's avatar Clément Bœsch

swscale: use a function for isGray

parent 08e1376d
...@@ -687,23 +687,16 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt) ...@@ -687,23 +687,16 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
return (desc->flags & AV_PIX_FMT_FLAG_RGB); return (desc->flags & AV_PIX_FMT_FLAG_RGB);
} }
#if 0 // FIXME static av_always_inline int isGray(enum AVPixelFormat pix_fmt)
#define isGray(x) \ {
(!(av_pix_fmt_desc_get(x)->flags & AV_PIX_FMT_FLAG_PAL) && \ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
av_pix_fmt_desc_get(x)->nb_components <= 2) av_assert0(desc);
#else return !(desc->flags & AV_PIX_FMT_FLAG_PAL) &&
#define isGray(x) \ !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) &&
((x) == AV_PIX_FMT_GRAY8 || \ desc->nb_components <= 2 &&
(x) == AV_PIX_FMT_YA8 || \ pix_fmt != AV_PIX_FMT_MONOBLACK &&
(x) == AV_PIX_FMT_GRAY10BE || \ pix_fmt != AV_PIX_FMT_MONOWHITE;
(x) == AV_PIX_FMT_GRAY10LE || \ }
(x) == AV_PIX_FMT_GRAY12BE || \
(x) == AV_PIX_FMT_GRAY12LE || \
(x) == AV_PIX_FMT_GRAY16BE || \
(x) == AV_PIX_FMT_GRAY16LE || \
(x) == AV_PIX_FMT_YA16BE || \
(x) == AV_PIX_FMT_YA16LE)
#endif
#define isRGBinInt(x) \ #define isRGBinInt(x) \
( \ ( \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment