Commit 95ddb7ac authored by ivo's avatar ivo

cosmetics; one test per line for all isXXX(x) macros


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@23296 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 8c2d448a
...@@ -102,22 +102,54 @@ untested special converters ...@@ -102,22 +102,54 @@ untested special converters
#define PI 3.14159265358979323846 #define PI 3.14159265358979323846
#endif #endif
#define isSupportedIn(x) ((x)==PIX_FMT_YUV420P || (x)==PIX_FMT_YUYV422 || (x)==PIX_FMT_UYVY422 \ #define isSupportedIn(x) ( \
|| (x)==PIX_FMT_RGB32 || (x)==PIX_FMT_BGR24 || (x)==PIX_FMT_BGR565 || (x)==PIX_FMT_BGR555 \ (x)==PIX_FMT_YUV420P \
|| (x)==PIX_FMT_BGR32 || (x)==PIX_FMT_RGB24 || (x)==PIX_FMT_RGB565 || (x)==PIX_FMT_RGB555 \ || (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE \ || (x)==PIX_FMT_RGB32 \
|| (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_YUV422P || (x)==PIX_FMT_YUV411P \ || (x)==PIX_FMT_BGR24 \
|| (x)==PIX_FMT_PAL8 || (x)==PIX_FMT_BGR8 || (x)==PIX_FMT_RGB8 \ || (x)==PIX_FMT_BGR565 \
|| (x)==PIX_FMT_BGR4_BYTE || (x)==PIX_FMT_RGB4_BYTE) || (x)==PIX_FMT_BGR555 \
#define isSupportedOut(x) ((x)==PIX_FMT_YUV420P || (x)==PIX_FMT_YUYV422 || (x)==PIX_FMT_UYVY422 \ || (x)==PIX_FMT_BGR32 \
|| (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_YUV422P || (x)==PIX_FMT_YUV411P \ || (x)==PIX_FMT_RGB24 \
|| isRGB(x) || isBGR(x) \ || (x)==PIX_FMT_RGB565 \
|| (x)==PIX_FMT_NV12 || (x)==PIX_FMT_NV21 \ || (x)==PIX_FMT_RGB555 \
|| (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE \ || (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_YUV410P) || (x)==PIX_FMT_YUV410P \
#define isPacked(x) ((x)==PIX_FMT_PAL8 || (x)==PIX_FMT_YUYV422 || \ || (x)==PIX_FMT_GRAY16BE \
(x)==PIX_FMT_UYVY422 || isRGB(x) || isBGR(x)) || (x)==PIX_FMT_GRAY16LE \
|| (x)==PIX_FMT_YUV444P \
|| (x)==PIX_FMT_YUV422P \
|| (x)==PIX_FMT_YUV411P \
|| (x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_BGR8 \
|| (x)==PIX_FMT_RGB8 \
|| (x)==PIX_FMT_BGR4_BYTE \
|| (x)==PIX_FMT_RGB4_BYTE \
)
#define isSupportedOut(x) ( \
(x)==PIX_FMT_YUV420P \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_YUV444P \
|| (x)==PIX_FMT_YUV422P \
|| (x)==PIX_FMT_YUV411P \
|| isRGB(x) \
|| isBGR(x) \
|| (x)==PIX_FMT_NV12 \
|| (x)==PIX_FMT_NV21 \
|| (x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
|| (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_YUV410P \
)
#define isPacked(x) ( \
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| isRGB(x) \
|| isBGR(x) \
)
#define RGB2YUV_SHIFT 16 #define RGB2YUV_SHIFT 16
#define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5)) #define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
......
...@@ -171,21 +171,49 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, ...@@ -171,21 +171,49 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange,
char *sws_format_name(int format); char *sws_format_name(int format);
//FIXME replace this with something faster //FIXME replace this with something faster
#define isPlanarYUV(x) ((x)==PIX_FMT_YUV410P || (x)==PIX_FMT_YUV420P \ #define isPlanarYUV(x) ( \
|| (x)==PIX_FMT_YUV411P || (x)==PIX_FMT_YUV422P \ (x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_NV12 \ || (x)==PIX_FMT_YUV420P \
|| (x)==PIX_FMT_NV21) || (x)==PIX_FMT_YUV411P \
#define isYUV(x) ((x)==PIX_FMT_UYVY422 || (x)==PIX_FMT_YUYV422 || isPlanarYUV(x)) || (x)==PIX_FMT_YUV422P \
#define isGray(x) ((x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE) || (x)==PIX_FMT_YUV444P \
#define isGray16(x) ((x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE) || (x)==PIX_FMT_NV12 \
#define isRGB(x) ((x)==PIX_FMT_BGR32 || (x)==PIX_FMT_RGB24 \ || (x)==PIX_FMT_NV21 \
|| (x)==PIX_FMT_RGB565 || (x)==PIX_FMT_RGB555 \ )
|| (x)==PIX_FMT_RGB8 || (x)==PIX_FMT_RGB4 || (x)==PIX_FMT_RGB4_BYTE \ #define isYUV(x) ( \
|| (x)==PIX_FMT_MONOBLACK) (x)==PIX_FMT_UYVY422 \
#define isBGR(x) ((x)==PIX_FMT_RGB32 || (x)==PIX_FMT_BGR24 \ || (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_BGR565 || (x)==PIX_FMT_BGR555 \ || isPlanarYUV(x) \
|| (x)==PIX_FMT_BGR8 || (x)==PIX_FMT_BGR4 || (x)==PIX_FMT_BGR4_BYTE \ )
|| (x)==PIX_FMT_MONOBLACK) #define isGray(x) ( \
(x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
)
#define isGray16(x) ( \
(x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
)
#define isRGB(x) ( \
(x)==PIX_FMT_BGR32 \
|| (x)==PIX_FMT_RGB24 \
|| (x)==PIX_FMT_RGB565 \
|| (x)==PIX_FMT_RGB555 \
|| (x)==PIX_FMT_RGB8 \
|| (x)==PIX_FMT_RGB4 \
|| (x)==PIX_FMT_RGB4_BYTE \
|| (x)==PIX_FMT_MONOBLACK \
)
#define isBGR(x) ( \
(x)==PIX_FMT_RGB32 \
|| (x)==PIX_FMT_BGR24 \
|| (x)==PIX_FMT_BGR565 \
|| (x)==PIX_FMT_BGR555 \
|| (x)==PIX_FMT_BGR8 \
|| (x)==PIX_FMT_BGR4 \
|| (x)==PIX_FMT_BGR4_BYTE \
|| (x)==PIX_FMT_MONOBLACK \
)
static inline int fmt_depth(int fmt) static inline int fmt_depth(int fmt)
{ {
......
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