summaryrefslogtreecommitdiffstats
path: root/sub/sub.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-09 22:59:36 +0200
committerwm4 <wm4@nowhere>2013-08-12 00:50:28 +0200
commit689a25003fc8098e5fdfbb2faefc0e18365d3acb (patch)
tree1735960be82a994c75549e4c5c45a88f1bc9ea8c /sub/sub.h
parent8fe4790ec8945cae52ea7600312f54e1dbdf8162 (diff)
downloadmpv-689a25003fc8098e5fdfbb2faefc0e18365d3acb.tar.bz2
mpv-689a25003fc8098e5fdfbb2faefc0e18365d3acb.tar.xz
sub: support straight alpha additionally to premultiplied alpha
This is for VAAPI support. VAAPI does not support premultiplied alpha for OSD. (Normally, we prefer premultiplied, because it has better behavior on scaling.) I'm not sure whether blending in the ASS->RGBA part is correct and I didn't test it extensively.
Diffstat (limited to 'sub/sub.h')
-rw-r--r--sub/sub.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sub/sub.h b/sub/sub.h
index 3cb140565c..3463022c88 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -25,11 +25,12 @@
#include "mpvcore/m_option.h"
-// NOTE: VOs must support at least SUBBITMAP_RGBA.
+// NOTE: VOs must support at least SUBBITMAP_RGBA or SUBBITMAP_RGBA_STR.
enum sub_bitmap_format {
SUBBITMAP_EMPTY = 0,// no bitmaps; always has num_parts==0
SUBBITMAP_LIBASS, // A8, with a per-surface blend color (libass.color)
SUBBITMAP_RGBA, // B8G8R8A8 (MSB=A, LSB=B), scaled, premultiplied alpha
+ SUBBITMAP_RGBA_STR, // like RGBA, but straight (not premultiplied) alpha
SUBBITMAP_INDEXED, // scaled, bitmap points to osd_bmp_indexed
SUBBITMAP_COUNT
@@ -38,8 +39,7 @@ enum sub_bitmap_format {
// For SUBBITMAP_INDEXED
struct osd_bmp_indexed {
uint8_t *bitmap;
- // Each entry is like a pixel in SUBBITMAP_RGBA format, but using straight
- // alpha.
+ // Each entry is like a pixel in SUBBITMAP_RGBA_STR format.
uint32_t palette[256];
};