summaryrefslogtreecommitdiffstats
path: root/video/img_format.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-21 19:29:18 +0100
committerwm4 <wm4@nowhere>2015-01-21 19:29:18 +0100
commita0caadd512a6f531fd01638570883e629f9dc6e5 (patch)
tree9023c03a9229b1ef2e7c5fee0aea778fbf0c2edc /video/img_format.h
parent30ca30c0a16a7ee034d9e05280ba221427d48ba1 (diff)
downloadmpv-a0caadd512a6f531fd01638570883e629f9dc6e5.tar.bz2
mpv-a0caadd512a6f531fd01638570883e629f9dc6e5.tar.xz
vo_opengl: handle grayscale input better, add YA16 support
Simply clamp off the U/V components in the colormatrix, instead of doing something special in the shader. Also, since YA8/YA16 gave a plane_bits value of 16/32, and a colormatrix calculation overflowed with 32, add a component_bits field to the image format descriptor, which for YA8/YA16 returns 8/16 (the wrong value had no bad consequences otherwise).
Diffstat (limited to 'video/img_format.h')
-rw-r--r--video/img_format.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/img_format.h b/video/img_format.h
index b93e0fe974..7d0762c3ce 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -82,6 +82,7 @@ struct mp_imgfmt_desc {
int8_t bytes[MP_MAX_PLANES]; // bytes per pixel (MP_IMGFLAG_BYTE_ALIGNED)
int8_t bpp[MP_MAX_PLANES]; // bits per pixel
int8_t plane_bits; // number of bits in use for plane 0
+ int8_t component_bits; // number of bits per component (0 if uneven)
// chroma shifts per plane (provided for convenience with planar formats)
int8_t xs[MP_MAX_PLANES];
int8_t ys[MP_MAX_PLANES];
@@ -135,6 +136,7 @@ enum mp_imgfmt {
// Gray with alpha (packed)
IMGFMT_YA8,
+ IMGFMT_YA16,
// Packed YUV formats (components are byte-accessed)
IMGFMT_YUYV, // Y0 U Y1 V