diff options
author | wm4 <wm4@nowhere> | 2016-01-25 10:43:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-25 10:43:35 +0100 |
commit | 3a015b9ec7186a41c91f6d0a565aea237806c8f4 (patch) | |
tree | 2b72d13262e0377c1a4cdc01aeaea717e21b735d /video | |
parent | 3c4f13c23a0363bcfd9e78650795f8352056f7f2 (diff) | |
download | mpv-3a015b9ec7186a41c91f6d0a565aea237806c8f4.tar.bz2 mpv-3a015b9ec7186a41c91f6d0a565aea237806c8f4.tar.xz |
video: remove some useless old RGB formats
Some VOs had support for these - remove them.
Typically, these formats will have only some use in cases where using
RGB software conversion with libswscale is faster than letting the
VO/GPU do it (i.e. almost never). For the sake of testing this case,
keep IMGFMT_RGB565. This is the least messy format, because it has no
padding/alpha bits with unknown semantics.
Note that decoding to these formats still works. We'll let libswscale
repack the data to whatever the VO in use can take.
Diffstat (limited to 'video')
-rw-r--r-- | video/fmt-conversion.c | 13 | ||||
-rw-r--r-- | video/img_format.h | 17 | ||||
-rw-r--r-- | video/out/opengl/video.c | 3 | ||||
-rw-r--r-- | video/out/vo_direct3d.c | 2 | ||||
-rw-r--r-- | video/out/vo_sdl.c | 8 | ||||
-rw-r--r-- | video/out/vo_wayland.c | 20 |
6 files changed, 1 insertions, 62 deletions
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c index d5dad6f244..c23b7bb232 100644 --- a/video/fmt-conversion.c +++ b/video/fmt-conversion.c @@ -30,23 +30,10 @@ static const struct { {IMGFMT_BGRA, AV_PIX_FMT_BGRA}, {IMGFMT_BGR24, AV_PIX_FMT_BGR24}, {IMGFMT_RGB565, AV_PIX_FMT_RGB565}, - {IMGFMT_RGB555, AV_PIX_FMT_RGB555}, - {IMGFMT_RGB444, AV_PIX_FMT_RGB444}, - {IMGFMT_RGB8, AV_PIX_FMT_RGB8}, - {IMGFMT_RGB4, AV_PIX_FMT_RGB4}, - {IMGFMT_MONO, AV_PIX_FMT_MONOBLACK}, - {IMGFMT_MONO_W, AV_PIX_FMT_MONOWHITE}, - {IMGFMT_RGB4_BYTE, AV_PIX_FMT_RGB4_BYTE}, - {IMGFMT_BGR4_BYTE, AV_PIX_FMT_BGR4_BYTE}, {IMGFMT_RGB48, AV_PIX_FMT_RGB48}, {IMGFMT_ABGR, AV_PIX_FMT_ABGR}, {IMGFMT_RGBA, AV_PIX_FMT_RGBA}, {IMGFMT_RGB24, AV_PIX_FMT_RGB24}, - {IMGFMT_BGR565, AV_PIX_FMT_BGR565}, - {IMGFMT_BGR555, AV_PIX_FMT_BGR555}, - {IMGFMT_BGR444, AV_PIX_FMT_BGR444}, - {IMGFMT_BGR8, AV_PIX_FMT_BGR8}, - {IMGFMT_BGR4, AV_PIX_FMT_BGR4}, {IMGFMT_PAL8, AV_PIX_FMT_PAL8}, {IMGFMT_YUYV, AV_PIX_FMT_YUYV422}, {IMGFMT_UYVY, AV_PIX_FMT_UYVY422}, diff --git a/video/img_format.h b/video/img_format.h index 80acb2b3be..b18a6f5d3f 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -178,23 +178,8 @@ enum mp_imgfmt { IMGFMT_RGB0_START = IMGFMT_0RGB, IMGFMT_RGB0_END = IMGFMT_RGB0, - // Accessed with bit-shifts (components ordered from MSB to LSB) - IMGFMT_BGR8, // r3 g3 b2 - IMGFMT_RGB8, - IMGFMT_BGR4_BYTE, // r1 g2 b1 with 1 pixel per byte - IMGFMT_RGB4_BYTE, - IMGFMT_BGR4, // r1 g2 b1, bit-packed - IMGFMT_RGB4, - IMGFMT_MONO, // 1 bit per pixel, bit-packed - IMGFMT_MONO_W, // like IMGFMT_MONO, but inverted (white pixels) - // Accessed with bit-shifts after endian-swapping the uint16_t pixel - IMGFMT_RGB444, // 4r 4g 4b 4a (MSB to LSB) - IMGFMT_RGB555, // 5r 5g 5b 1a - IMGFMT_RGB565, // 5r 6g 5b - IMGFMT_BGR444, // 4b 4r 4g 4a - IMGFMT_BGR555, // 5b 5g 5r 1a - IMGFMT_BGR565, // 5b 6g 5r + IMGFMT_RGB565, // 5r 6g 5b (MSB to LSB) // The first plane has 1 byte per pixel. The second plane is a palette with // 256 entries, with each entry encoded like in IMGFMT_BGR32. diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 3f38388e0f..3c61a4e878 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -231,9 +231,6 @@ struct fmt_entry { // Very special formats, for which OpenGL happens to have direct support static const struct fmt_entry mp_to_gl_formats[] = { - {IMGFMT_BGR555, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, - {IMGFMT_BGR565, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV}, - {IMGFMT_RGB555, GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV}, {IMGFMT_RGB565, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5}, {0}, }; diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index 811a3e43a9..e074572c27 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -222,8 +222,6 @@ static const struct fmt_entry fmt_table[] = { {IMGFMT_RGB32, D3DFMT_X8B8G8R8}, {IMGFMT_BGR24, D3DFMT_R8G8B8}, //untested {IMGFMT_RGB565, D3DFMT_R5G6B5}, - {IMGFMT_RGB555, D3DFMT_X1R5G5B5}, - {IMGFMT_RGB8, D3DFMT_R3G3B2}, //untested // grayscale (can be considered both packed and planar) {IMGFMT_Y8, D3DFMT_L8}, {IMGFMT_Y16, D3DFMT_L16}, diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index 6a175ef7ca..9d34564587 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -68,11 +68,7 @@ const struct formatmap_entry formats[] = { {SDL_PIXELFORMAT_BGR24, IMGFMT_BGR24, 0}, {SDL_PIXELFORMAT_RGB888, IMGFMT_RGB24, 0}, {SDL_PIXELFORMAT_BGR888, IMGFMT_BGR24, 0}, - {SDL_PIXELFORMAT_RGB565, IMGFMT_BGR565, 0}, {SDL_PIXELFORMAT_BGR565, IMGFMT_RGB565, 0}, - {SDL_PIXELFORMAT_RGB555, IMGFMT_BGR555, 0}, - {SDL_PIXELFORMAT_BGR555, IMGFMT_RGB555, 0}, - {SDL_PIXELFORMAT_RGB444, IMGFMT_BGR444, 0} #else {SDL_PIXELFORMAT_RGBX8888, IMGFMT_ABGR, 0}, // has no alpha -> bad for OSD {SDL_PIXELFORMAT_BGRX8888, IMGFMT_ARGB, 0}, // has no alpha -> bad for OSD @@ -85,10 +81,6 @@ const struct formatmap_entry formats[] = { {SDL_PIXELFORMAT_RGB888, IMGFMT_BGR24, 0}, {SDL_PIXELFORMAT_BGR888, IMGFMT_RGB24, 0}, {SDL_PIXELFORMAT_RGB565, IMGFMT_RGB565, 0}, - {SDL_PIXELFORMAT_BGR565, IMGFMT_RGB565, 0}, - {SDL_PIXELFORMAT_RGB555, IMGFMT_RGB555, 0}, - {SDL_PIXELFORMAT_BGR555, IMGFMT_BGR555, 0}, - {SDL_PIXELFORMAT_RGB444, IMGFMT_RGB444, 0} #endif }; diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 946253e890..57d6c7f8b8 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -47,28 +47,8 @@ static const struct wl_buffer_listener buffer_listener; static const format_t format_table[] = { {WL_SHM_FORMAT_ARGB8888, IMGFMT_BGRA}, // 8b 8g 8r 8a {WL_SHM_FORMAT_XRGB8888, IMGFMT_BGR0}, - {WL_SHM_FORMAT_RGB332, IMGFMT_RGB8}, // 3b 3g 2r - {WL_SHM_FORMAT_BGR233, IMGFMT_BGR8}, // 3r 3g 3b, #if BYTE_ORDER == LITTLE_ENDIAN - {WL_SHM_FORMAT_XRGB4444, IMGFMT_RGB444}, // 4b 4g 4r 4a - {WL_SHM_FORMAT_XBGR4444, IMGFMT_BGR444}, // 4r 4g 4b 4a - {WL_SHM_FORMAT_ARGB4444, IMGFMT_RGB444}, - {WL_SHM_FORMAT_ABGR4444, IMGFMT_BGR444}, - {WL_SHM_FORMAT_XRGB1555, IMGFMT_RGB555}, // 5b 5g 5r 1a - {WL_SHM_FORMAT_XBGR1555, IMGFMT_BGR555}, // 5r 5g 5b 1a - {WL_SHM_FORMAT_ARGB1555, IMGFMT_RGB555}, - {WL_SHM_FORMAT_ABGR1555, IMGFMT_BGR555}, {WL_SHM_FORMAT_RGB565, IMGFMT_RGB565}, // 5b 6g 5r - {WL_SHM_FORMAT_BGR565, IMGFMT_BGR565}, // 5r 6g 5b -#else - {WL_SHM_FORMAT_RGBX4444, IMGFMT_BGR444}, // 4a 4b 4g 4r - {WL_SHM_FORMAT_BGRX4444, IMGFMT_RGB444}, // 4a 4r 4g 4b - {WL_SHM_FORMAT_RGBA4444, IMGFMT_BGR444}, - {WL_SHM_FORMAT_BGRA4444, IMGFMT_RGB444}, - {WL_SHM_FORMAT_RGBX5551, IMGFMT_BGR555}, // 1a 5g 5b 5r - {WL_SHM_FORMAT_BGRX5551, IMGFMT_RGB555}, // 1a 5r 5g 5b - {WL_SHM_FORMAT_RGBA5551, IMGFMT_BGR555}, - {WL_SHM_FORMAT_BGRA5551, IMGFMT_RGB555}, #endif {WL_SHM_FORMAT_RGB888, IMGFMT_BGR24}, // 8b 8g 8r {WL_SHM_FORMAT_BGR888, IMGFMT_RGB24}, // 8r 8g 8b |