From c082240c62cb8855e55c0dbe88b8591458599ce9 Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Tue, 27 Nov 2012 04:39:09 -0500 Subject: video: add support for 12 and 14 bit YUV pixel formats Based on a patch by qyot27. Add the missing parts in mp_get_chroma_shift(), which allow allocation of such images, and which make vo_opengl automatically accept the new formats. Change the IMGFMT_IS_YUVP16_LE/BE macros to properly report IMGFMT_444P14 as supported: this pixel format has the highest numerical bit width identifier (0x55), which is not covered by the mask ~0xfc. Remove 1 bit from the mask (makes it 0xf8) so that IMGFMT_IS_YUVP16(IMGFMT_444P14) is 1. This is slightly risky, as the organization of the image format IDs (actually FourCCs + mplayer internal IDs) is messy at best, but it should be ok. --- sub/draw_bmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sub') diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index a0c58324da..594fcabdfd 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -416,6 +416,14 @@ static void get_closest_y444_format(int imgfmt, int *out_format, int *out_bits) *out_format = IMGFMT_444P10; *out_bits = 10; return; + case 12: + *out_format = IMGFMT_444P12; + *out_bits = 12; + return; + case 14: + *out_format = IMGFMT_444P14; + *out_bits = 14; + return; } } } else { -- cgit v1.2.3