diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-02-14 21:43:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-02-15 23:07:42 +0100 |
commit | 1055ece30b9d1d0b457306441837dadcc22e727d (patch) | |
tree | f35a15b2469ae109a952c218304d9c8db01e0f8b | |
parent | a2cfd6062c61e32fe95e872bcd76aabe63201162 (diff) | |
download | ffmpeg-1055ece30b9d1d0b457306441837dadcc22e727d.tar.gz |
swscale/tests/swscale: Implement isALPHA() using AVPixFmtDescriptor
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libswscale/tests/swscale.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index 6c38041ddb..f853bc4c91 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -48,12 +48,12 @@ (!(isGray(x) || \ (x) == AV_PIX_FMT_MONOBLACK || \ (x) == AV_PIX_FMT_MONOWHITE)) -#define isALPHA(x) \ - ((x) == AV_PIX_FMT_BGR32 || \ - (x) == AV_PIX_FMT_BGR32_1 || \ - (x) == AV_PIX_FMT_RGB32 || \ - (x) == AV_PIX_FMT_RGB32_1 || \ - (x) == AV_PIX_FMT_YUVA420P) + +static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + return desc->flags & AV_PIX_FMT_FLAG_ALPHA; +} static uint64_t getSSD(const uint8_t *src1, const uint8_t *src2, int stride1, int stride2, int w, int h) |