summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-31 22:53:25 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-31 22:53:25 +0000
commita326622304cedacce34b31f47dafe7069e076e01 (patch)
treed4046032aae4527ec51bec2dd502b0c55991fc7e /libvo
parent498ad7ba573b80ac8740886b46f9f8e660647858 (diff)
downloadmpv-a326622304cedacce34b31f47dafe7069e076e01.tar.bz2
mpv-a326622304cedacce34b31f47dafe7069e076e01.tar.xz
Add support for 16-bit per component YUV formats.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30152 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c19
-rw-r--r--libvo/vo_gl.c3
-rw-r--r--libvo/vo_gl2.c3
3 files changed, 20 insertions, 5 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 2571959640..ffca3ac35f 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -234,9 +234,15 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt,
if (!gl_format) gl_format = &dummy2;
if (!gl_type) gl_type = &dummy2;
- // these are all the same for our purpose
- if (mp_get_chroma_shift(fmt, NULL, NULL))
- fmt = IMGFMT_YV12;
+ if (mp_get_chroma_shift(fmt, NULL, NULL)) {
+ // reduce the possible cases a bit
+ if (IMGFMT_IS_YUVP16_LE(fmt))
+ fmt = IMGFMT_420P16_LE;
+ else if (IMGFMT_IS_YUVP16_BE(fmt))
+ fmt = IMGFMT_420P16_BE;
+ else
+ fmt = IMGFMT_YV12;
+ }
*bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt);
*gl_texfmt = 3;
@@ -254,6 +260,13 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt,
*gl_format = GL_RGBA;
*gl_type = GL_UNSIGNED_BYTE;
break;
+ case IMGFMT_420P16:
+ supported = 0; // no native YUV support
+ *gl_texfmt = 1;
+ *bpp = 16;
+ *gl_format = GL_LUMINANCE;
+ *gl_type = GL_UNSIGNED_SHORT;
+ break;
case IMGFMT_YV12:
supported = 0; // no native YV12 support
case IMGFMT_Y800:
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index eb71149bbb..95a1b74167 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -971,7 +971,8 @@ query_format(uint32_t format)
caps |= VFCAP_OSD | VFCAP_EOSD | (scaled_osd ? 0 : VFCAP_EOSD_UNSCALED);
if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA)
return caps;
- if (use_yuv && mp_get_chroma_shift(format, NULL, NULL))
+ if (use_yuv && mp_get_chroma_shift(format, NULL, NULL) &&
+ (IMGFMT_IS_YUVP16_NE(format) || !IMGFMT_IS_YUVP16(format)))
return caps;
// HACK, otherwise we get only b&w with some filters (e.g. -vf eq)
// ideally MPlayer should be fixed instead not to use Y800 when it has the choice
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 1cdf7bf83f..626da44c2a 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -822,7 +822,8 @@ draw_frame(uint8_t *src[])
static int
query_format(uint32_t format)
{
- if (use_yuv && mp_get_chroma_shift(format, NULL, NULL))
+ if (use_yuv && mp_get_chroma_shift(format, NULL, NULL) &&
+ (IMGFMT_IS_YUVP16_NE(format) || !IMGFMT_IS_YUVP16(format)))
return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD |
VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE;
switch(format) {