summaryrefslogtreecommitdiffstats
path: root/libswscale/swscale_internal.h
diff options
context:
space:
mode:
authorlucabe <lucabe@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-17 15:15:13 +0000
committerlucabe <lucabe@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-17 15:15:13 +0000
commit51cd63eb1ce54742e942942e0604bbc974a4c0cb (patch)
tree731f5eb543ff4e6fbb6631cf15f769ecae180c8c /libswscale/swscale_internal.h
parent212e625ee67fdb0a4e1992260986fea43063f24e (diff)
downloadmpv-51cd63eb1ce54742e942942e0604bbc974a4c0cb.tar.bz2
mpv-51cd63eb1ce54742e942942e0604bbc974a4c0cb.tar.xz
Remove the dependency of libswscale on img_format.h
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19878 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r--libswscale/swscale_internal.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index fd74ecb052..d338c4e3a4 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -173,4 +173,52 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange,
char *sws_format_name(int format);
+//FIXME replace this with something faster
+#define isPlanarYUV(x) ((x)==PIX_FMT_YUV410P || (x)==PIX_FMT_YUV420P \
+ || (x)==PIX_FMT_YUV411P || (x)==PIX_FMT_YUV422P \
+ || (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_NV12 \
+ || (x)==PIX_FMT_NV21)
+#define isYUV(x) ((x)==PIX_FMT_UYVY422 || (x)==PIX_FMT_YUYV422 || isPlanarYUV(x))
+#define isGray(x) ((x)==PIX_FMT_GRAY8)
+#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_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_MONOBLACK)
+
+static inline int fmt_depth(int fmt)
+{
+ switch(fmt) {
+ case PIX_FMT_BGRA:
+ case PIX_FMT_ABGR:
+ case PIX_FMT_RGBA:
+ case PIX_FMT_ARGB:
+ return 32;
+ case PIX_FMT_BGR24:
+ case PIX_FMT_RGB24:
+ return 24;
+ case PIX_FMT_BGR565:
+ case PIX_FMT_RGB565:
+ return 16;
+ case PIX_FMT_BGR555:
+ case PIX_FMT_RGB555:
+ return 15;
+ case PIX_FMT_BGR8:
+ case PIX_FMT_RGB8:
+ return 8;
+ case PIX_FMT_BGR4:
+ case PIX_FMT_RGB4:
+ case PIX_FMT_BGR4_BYTE:
+ case PIX_FMT_RGB4_BYTE:
+ return 4;
+ case PIX_FMT_MONOBLACK:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
#endif