summaryrefslogtreecommitdiff
path: root/src/video_out/alphablend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/alphablend.c')
-rw-r--r--src/video_out/alphablend.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c
index 65f96e5c0..a9f373832 100644
--- a/src/video_out/alphablend.c
+++ b/src/video_out/alphablend.c
@@ -240,9 +240,14 @@ void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
int dst_width, int dst_height)
{
/* FIXME: my_clut should disappear once I find out how to get the clut from the MPEG2 stream. */
-/* This happens to work with "The Matrix" using 0(black), 8(white) and 9(edges) */
+/* It looks like it comes from the ,IFO file, so will have to wait for IFO parser in xine.
+ * Here is an extract of another DVD player (oms)
+ * clut = ifoGetCLUT (priv->pgci);
+ * codec->ctrl (codec, CTRL_SPU_SET_CLUT, clut);
+ */
+/* This happens to work with "The Matrix" using 0(edges), 8(white) */
clut_t my_clut[] = {
- {y: 0x51, cr: 0xef, cb:0x5a},
+ {y: 0x00, cr: 0x80, cb:0x80},
{y: 0xbf, cr: 0x80, cb:0x80},
{y: 0x10, cr: 0x80, cb:0x80},
{y: 0x28, cr: 0x6d, cb:0xef},
@@ -251,7 +256,8 @@ void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
{y: 0x36, cr: 0x80, cb:0x80},
{y: 0x28, cr: 0x6d, cb:0xef},
{y: 0xbf, cr: 0x80, cb:0x80},
- {y: 0x5c, cr: 0x80, cb:0x80},
+ {y: 0x51, cr: 0x80, cb:0x80},
+ {y: 0xbf, cr: 0x80, cb:0x80},
{y: 0x10, cr: 0x80, cb:0x80},
{y: 0x28, cr: 0x6d, cb:0xef},
{y: 0x5c, cr: 0x80, cb:0x80},
@@ -273,24 +279,24 @@ void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
uint8_t *dst_cb = dst_img + (dst_width * dst_height * 5) / 4 +
(y_off / 2) * (dst_width / 2) + (x_off / 2) + 1;
- int x,
- y;
-
+ int x, y;
for (y = 0; y < src_height; y++) {
for (x = 0; x < src_width; x++) {
uint8_t clr;
+ uint8_t mask;
uint8_t o;
+ mask = (*src_data) >> 4 ;
+
+ if (mask) {
clr = img_overl->clut[*src_data & 0x03];
o = img_overl->trans[*src_data & 0x03];
-
- if (clr) {
*dst_y = BLEND_YUV (*dst_y, my_clut[clr].y, o);
}
dst_y++;
if (y & x & 1) {
- if (clr) {
+ if (mask) {
*dst_cr = BLEND_YUV (*dst_cr, my_clut[clr].cr, o);
*dst_cb = BLEND_YUV (*dst_cb, my_clut[clr].cb, o);
}