Changeset 660db6d87715f5b677edbb8fddd071ad236511eb
- Timestamp:
- 06/27/02 21:46:32
(6 years ago)
- Author:
- Sam Hocevar <sam@videolan.org>
- git-committer:
- Sam Hocevar <sam@videolan.org> 1025207192 +0000
- git-parent:
[3a31acccc1b5720c3256c4677ac85282915fc610]
- git-author:
- Sam Hocevar <sam@videolan.org> 1025207192 +0000
- Message:
- ./plugins/dvd/dvd_es.c: error in selecting SPU stream.
- ./plugins/spudec/spu_decoder.c: endianness fix for subtitles colour.
- ./plugins/spudec/spu_decoder.c: little hack for preventing blank alpha
palette.
- ./plugins/spudec/spu_decoder.c: subtitle transparency support.
Patches imported from v0_4_1_branch.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd680938 |
r660db6d |
|
| 175 | 175 | D: IPv6 |
|---|
| 176 | 176 | S: United Kingdom |
|---|
| | 177 | |
|---|
| | 178 | N: Roine Gustafsson |
|---|
| | 179 | E: roine@popstar.com |
|---|
| | 180 | D: spudec bug fixes |
|---|
| 177 | 181 | |
|---|
| 178 | 182 | N: Shane Harper |
|---|
| r62e73f5 |
r660db6d |
|
| 68 | 68 | |
|---|
| 69 | 69 | 0.4.2 |
|---|
| 70 | | Mon, 20 Jun 2002 00:41:26 +0200 |
|---|
| 71 | | |
|---|
| | 70 | Not released yet |
|---|
| | 71 | |
|---|
| | 72 | * ./plugins/dvd/dvd_es.c: error in selecting SPU stream. |
|---|
| | 73 | * ./plugins/spudec/spu_decoder.c: endianness fix for subtitles colour. |
|---|
| | 74 | * ./plugins/spudec/spu_decoder.c: little hack for preventing blank alpha |
|---|
| | 75 | palette. |
|---|
| | 76 | * ./plugins/spudec/spu_decoder.c: subtitle transparency support. |
|---|
| 72 | 77 | * ./plugins/macosx: new controls for audio output, and deinterlacing |
|---|
| 73 | 78 | support. |
|---|
| r695669c |
r660db6d |
|
| 2 | 2 | ***************************************************************************** |
|---|
| 3 | 3 | * Copyright (C) 1998-2001 VideoLAN |
|---|
| 4 | | * $Id: dvd_es.c,v 1.13 2002/06/02 13:49:35 sam Exp $ |
|---|
| | 4 | * $Id: dvd_es.c,v 1.14 2002/06/27 19:46:32 sam Exp $ |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * Author: St�ane Borel <stef@via.ecp.fr> |
|---|
| … | … | |
| 307 | 307 | if( i_spu > 0 ) |
|---|
| 308 | 308 | { |
|---|
| 309 | | i_spu += p_dvd->p_ifo->vts.manager_inf.i_audio_nb; |
|---|
| 310 | | input_SelectES( p_input, p_input->stream.pp_es[i_spu] ); |
|---|
| | 309 | int i = 0, j = 0; |
|---|
| | 310 | for( i = 0; i < p_input->stream.i_es_number; i++ ) |
|---|
| | 311 | { |
|---|
| | 312 | if ( p_input->stream.pp_es[i]->i_type == DVD_SPU_ES ) |
|---|
| | 313 | { |
|---|
| | 314 | j++; |
|---|
| | 315 | if ( i_spu == j ) break; |
|---|
| | 316 | } |
|---|
| | 317 | } |
|---|
| | 318 | if( i_spu == j ) |
|---|
| | 319 | { |
|---|
| | 320 | input_SelectES( p_input, p_input->stream.pp_es[i] ); |
|---|
| | 321 | } |
|---|
| 311 | 322 | } |
|---|
| 312 | 323 | } |
|---|
| r92cae55 |
r660db6d |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2000-2001 VideoLAN |
|---|
| 5 | | * $Id: spu_decoder.c,v 1.28 2002/06/05 18:18:49 stef Exp $ |
|---|
| | 5 | * $Id: spu_decoder.c,v 1.29 2002/06/27 19:46:32 sam Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 379 | 379 | int i_date; |
|---|
| 380 | 380 | |
|---|
| 381 | | int i; |
|---|
| | 381 | int i, pi_alpha[4]; |
|---|
| 382 | 382 | |
|---|
| 383 | 383 | /* XXX: temporary variables */ |
|---|
| … | … | |
| 445 | 445 | GetBits(&p_spudec->bit_stream, 4) ]; |
|---|
| 446 | 446 | |
|---|
| | 447 | /* FIXME: this job should be done sooner */ |
|---|
| | 448 | #ifndef WORDS_BIGENDIAN |
|---|
| 447 | 449 | p_spu->p_sys->pi_yuv[3-i][0] = (i_color>>16) & 0xff; |
|---|
| 448 | 450 | p_spu->p_sys->pi_yuv[3-i][1] = (i_color>>0) & 0xff; |
|---|
| 449 | 451 | p_spu->p_sys->pi_yuv[3-i][2] = (i_color>>8) & 0xff; |
|---|
| | 452 | #else |
|---|
| | 453 | p_spu->p_sys->pi_yuv[3-i][0] = (i_color>>8) & 0xff; |
|---|
| | 454 | p_spu->p_sys->pi_yuv[3-i][1] = (i_color>>24) & 0xff; |
|---|
| | 455 | p_spu->p_sys->pi_yuv[3-i][2] = (i_color>>16) & 0xff; |
|---|
| | 456 | #endif |
|---|
| 450 | 457 | } |
|---|
| 451 | 458 | } |
|---|
| … | … | |
| 461 | 468 | |
|---|
| 462 | 469 | /* 04xxxx (alpha channel) */ |
|---|
| 463 | | for( i = 0; i < 4 ; i++ ) |
|---|
| | 470 | pi_alpha[3] = GetBits( &p_spudec->bit_stream, 4 ); |
|---|
| | 471 | pi_alpha[2] = GetBits( &p_spudec->bit_stream, 4 ); |
|---|
| | 472 | pi_alpha[1] = GetBits( &p_spudec->bit_stream, 4 ); |
|---|
| | 473 | pi_alpha[0] = GetBits( &p_spudec->bit_stream, 4 ); |
|---|
| | 474 | |
|---|
| | 475 | /* Ignore blank alpha palette. Sometimes spurious blank |
|---|
| | 476 | * alpha palettes are present - dunno why. */ |
|---|
| | 477 | if( pi_alpha[0] | pi_alpha[1] | pi_alpha[2] | pi_alpha[3] ) |
|---|
| 464 | 478 | { |
|---|
| 465 | | p_spu->p_sys->pi_alpha[3-i] |
|---|
| 466 | | = GetBits( &p_spudec->bit_stream, 4 ); |
|---|
| | 479 | p_spu->p_sys->pi_alpha[0] = pi_alpha[0]; |
|---|
| | 480 | p_spu->p_sys->pi_alpha[1] = pi_alpha[1]; |
|---|
| | 481 | p_spu->p_sys->pi_alpha[2] = pi_alpha[2]; |
|---|
| | 482 | p_spu->p_sys->pi_alpha[3] = pi_alpha[3]; |
|---|
| 467 | 483 | } |
|---|
| | 484 | else |
|---|
| | 485 | { |
|---|
| | 486 | msg_Warn( p_spudec->p_fifo, |
|---|
| | 487 | "ignoring blank alpha palette" ); |
|---|
| | 488 | } |
|---|
| | 489 | |
|---|
| 468 | 490 | i_index += 2; |
|---|
| 469 | 491 | |
|---|
| … | … | |
| 828 | 850 | u32 p_clut32[4]; |
|---|
| 829 | 851 | u8 *p_dest; |
|---|
| | 852 | u8 *p_destptr = (u8 *)p_dest; |
|---|
| 830 | 853 | u16 *p_source = (u16 *)p_spu->p_sys->p_data; |
|---|
| 831 | 854 | |
|---|
| 832 | 855 | int i_x, i_y; |
|---|
| 833 | | int i_len, i_color; |
|---|
| | 856 | int i_len, i_color, i_colprecomp, i_destalpha; |
|---|
| 834 | 857 | u8 i_cnt; |
|---|
| 835 | 858 | |
|---|
| … | … | |
| 857 | 880 | /* Get the RLE part, then draw the line */ |
|---|
| 858 | 881 | i_color = *p_source & 0x3; |
|---|
| | 882 | i_len = *p_source++ >> 2; |
|---|
| 859 | 883 | |
|---|
| 860 | 884 | switch( p_spu->p_sys->pi_alpha[ i_color ] ) |
|---|
| 861 | 885 | { |
|---|
| 862 | 886 | case 0x00: |
|---|
| 863 | | i_x -= *p_source++ >> 2; |
|---|
| 864 | 887 | break; |
|---|
| 865 | 888 | |
|---|
| 866 | 889 | case 0x0f: |
|---|
| 867 | | i_len = *p_source++ >> 2; |
|---|
| 868 | 890 | memset( p_dest - i_x - i_y, |
|---|
| 869 | 891 | p_spu->p_sys->pi_yuv[i_color][0], i_len ); |
|---|
| 870 | | i_x -= i_len; |
|---|
| 871 | 892 | break; |
|---|
| 872 | 893 | |
|---|
| 873 | 894 | default: |
|---|
| 874 | | /* FIXME: we should do transparency */ |
|---|
| 875 | | i_len = *p_source++ >> 2; |
|---|
| 876 | | memset( p_dest - i_x - i_y, |
|---|
| 877 | | p_spu->p_sys->pi_yuv[i_color][0], i_len ); |
|---|
| 878 | | i_x -= i_len; |
|---|
| 879 | | break; |
|---|
| 880 | | } |
|---|
| | 895 | /* To be able to divide by 16 (>>4) we add 1 to the alpha. |
|---|
| | 896 | * This means Alpha 0 won't be completely transparent, but |
|---|
| | 897 | * that's handled in a special case above anyway. */ |
|---|
| | 898 | i_colprecomp = p_spu->p_sys->pi_yuv[i_color][0] |
|---|
| | 899 | * (p_spu->p_sys->pi_alpha[ i_color ] + 1); |
|---|
| | 900 | i_destalpha = 15 - p_spu->p_sys->pi_alpha[ i_color ]; |
|---|
| | 901 | |
|---|
| | 902 | for ( p_destptr = p_dest - i_x - i_y; |
|---|
| | 903 | p_destptr < p_dest - i_x - i_y + i_len; |
|---|
| | 904 | p_destptr++ ) |
|---|
| | 905 | { |
|---|
| | 906 | *p_destptr = ( i_colprecomp + |
|---|
| | 907 | *p_destptr * i_destalpha ) >> 4; |
|---|
| | 908 | } |
|---|
| | 909 | break; |
|---|
| | 910 | |
|---|
| | 911 | } |
|---|
| | 912 | i_x -= i_len; |
|---|
| 881 | 913 | } |
|---|
| 882 | 914 | } |
|---|