diff options
author | wm4 <wm4@nowhere> | 2012-12-19 12:04:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 20:04:11 +0100 |
commit | aa6ba6372c627bc602647d225bdfb076f93bd291 (patch) | |
tree | dd9a9840b123af5f48881d4d52b1697671018c02 /video/out/vo_x11.c | |
parent | ab94c64ed2d8b90bd7b0c348e79c2d8b8d055ee6 (diff) | |
download | mpv-aa6ba6372c627bc602647d225bdfb076f93bd291.tar.bz2 mpv-aa6ba6372c627bc602647d225bdfb076f93bd291.tar.xz |
mp_image: change how palette is handled
According to DOCS/OUTDATED-tech/colorspaces.txt, the following formats
are supposed to be palettized:
IMGFMT_BGR8
IMGFMT_RGB8,
IMGFMT_BGR4_CHAR
IMGFMT_RGB4_CHAR
IMGFMT_BGR4
IMGFMT_RGB4
Of these, only BGR8 and RGB8 are actually treated as palettized in some
way. ffmpeg has only one palettized format (AV_PIX_FMT_PAL8), and
IMGFMT_BGR8 was inconsistently mapped to packed non-palettized RGB
formats too (AV_PIX_FMT_BGR8). Moreover, vf_scale.c contained messy
hacks to generate a palette when AV_PIX_FMT_BGR8 is output. (libswscale
does not support AV_PIX_FMT_PAL8 output in the first place.)
Get rid of all of this, and introduce IMGFMT_PAL8, which directly maps
to AV_PIX_FMT_PAL8. Remove the palette creation code from vf_scale.c.
IMGFMT_BGR8 maps to AV_PIX_FMT_RGB8 (don't ask me why it's swapped),
without any palette use. Enabling it in vo_x11 or using it as vf_scale
input seems to give correct results.
Diffstat (limited to 'video/out/vo_x11.c')
-rw-r--r-- | video/out/vo_x11.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index b323c34865..4bdb209891 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -526,8 +526,8 @@ static int query_format(struct vo *vo, uint32_t format) "vo_x11: query_format was called: %x (%s)\n", format, vo_format_name(format)); if (IMGFMT_IS_BGR(format)) { - if (IMGFMT_BGR_DEPTH(format) <= 8) - return 0; // TODO 8bpp not yet fully implemented + if (IMGFMT_BGR_DEPTH(format) < 8) + return 0; if (IMGFMT_BGR_DEPTH(format) == vo->x11->depthonscreen) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_FLIP; |