summaryrefslogtreecommitdiffstats
path: root/video/img_format.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-14 11:19:04 +0100
committerwm4 <wm4@nowhere>2012-11-14 11:50:02 +0100
commite5f7976000af0fb8da5fd0c3a01cfd44e6e64516 (patch)
treed0745e2f279e2f7e9702d89cbf6e0e6bf58de3f5 /video/img_format.h
parenta86ec729868e9bd5777f5800527e5cd9bf79fe85 (diff)
downloadmpv-e5f7976000af0fb8da5fd0c3a01cfd44e6e64516.tar.bz2
mpv-e5f7976000af0fb8da5fd0c3a01cfd44e6e64516.tar.xz
video: add IMGFMT_Y16/PIX_FMT_GRAY16
This pixel format is sometimes used with yuv4mpeg. vo_direct3d used its own IMGFMT_Y16 internally for some reason. vo_opengl, vo_opengl_old, and vo_direct3d should be able to display this pixel format natively.
Diffstat (limited to 'video/img_format.h')
-rw-r--r--video/img_format.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/video/img_format.h b/video/img_format.h
index c32600f519..f3611a5fab 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -102,7 +102,17 @@
#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x3F)
// AV_PIX_FMT_BGR0
-#define IMGFMT_BGR0 0x1DC70000
+#define IMGFMT_BGR0 0x1DC70000
+// AV_PIX_FMT_GRAY16LE
+#define IMGFMT_Y16LE 0x1DC70001
+// AV_PIX_FMT_GRAY16BE
+#define IMGFMT_Y16BE 0x1DC70002
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IMGFMT_Y16 IMGFMT_Y16BE
+#else
+#define IMGFMT_Y16 IMGFMT_Y16LE
+#endif
/* Planar YUV Formats */
@@ -170,8 +180,8 @@
#endif
// These macros are misnamed - they actually match 9, 10 or 16 bits
-#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt - 0x51000034) & 0xfc0000ff) == 0)
-#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt - 0x34000051) & 0xff0000fc) == 0)
+#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt - 0x51000034) & 0xfc0000ff) == 0 || fmt == IMGFMT_Y16LE)
+#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt - 0x34000051) & 0xff0000fc) == 0 || fmt == IMGFMT_Y16BE)
#define IMGFMT_IS_YUVP16(fmt) (IMGFMT_IS_YUVP16_LE(fmt) || IMGFMT_IS_YUVP16_BE(fmt))
/* Packed YUV Formats */