~ubuntu-branches/ubuntu/natty/vlc/natty

« back to all changes in this revision

Viewing changes to modules/codec/spudec/parse.c

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-06-25 01:09:16 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100625010916-asxhep2mutg6g6pd
Tags: 1.1.0-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports
* Drop xulrunner patches.
* Drop 502_xulrunner_191.diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * parse.c: SPU parser
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2000-2001, 2005, 2006 the VideoLAN team
5
 
 * $Id: b2ea3a177c1f18ae7365a7e3e377ebba60ccb689 $
 
5
 * $Id: 6fc4a4dee441582772326ee2411676a2286ca5cc $
6
6
 *
7
7
 * Authors: Sam Hocevar <sam@zoy.org>
8
8
 *          Laurent Aimar <fenrir@via.ecp.fr>
31
31
#endif
32
32
 
33
33
#include <vlc_common.h>
34
 
#include <vlc_vout.h>
35
34
#include <vlc_codec.h>
36
35
#include <vlc_input.h>
37
36
 
162
161
    decoder_sys_t *p_sys = p_dec->p_sys;
163
162
 
164
163
    /* Our current index in the SPU packet */
165
 
    unsigned int i_index = p_sys->i_rle_size + 4;
 
164
    unsigned int i_index;
166
165
 
167
166
    /* The next start-of-control-sequence index and the previous one */
168
167
    unsigned int i_next_seq = 0, i_cur_seq = 0;
294
293
                return VLC_EGENERIC;
295
294
            }
296
295
 
297
 
            b_cmd_alpha = true;
298
 
            spu_data_cmd.pi_alpha[3] = (p_sys->buffer[i_index+1]>>4)&0x0f;
299
 
            spu_data_cmd.pi_alpha[2] = (p_sys->buffer[i_index+1])&0x0f;
300
 
            spu_data_cmd.pi_alpha[1] = (p_sys->buffer[i_index+2]>>4)&0x0f;
301
 
            spu_data_cmd.pi_alpha[0] = (p_sys->buffer[i_index+2])&0x0f;
 
296
            if(!p_sys->b_disabletrans)
 
297
            { /* If we want to use original transparency values */
 
298
                b_cmd_alpha = true;
 
299
                spu_data_cmd.pi_alpha[3] = (p_sys->buffer[i_index+1]>>4)&0x0f;
 
300
                spu_data_cmd.pi_alpha[2] = (p_sys->buffer[i_index+1])&0x0f;
 
301
                spu_data_cmd.pi_alpha[1] = (p_sys->buffer[i_index+2]>>4)&0x0f;
 
302
                spu_data_cmd.pi_alpha[0] = (p_sys->buffer[i_index+2])&0x0f;
 
303
            }
302
304
 
303
305
            i_index += 3;
304
306
            break;
465
467
    bool b_empty_top = true;
466
468
    unsigned int i_skipped_top = 0, i_skipped_bottom = 0;
467
469
    unsigned int i_transparent_code = 0;
468
 
 
 
470
 
469
471
    /* Colormap statistics */
470
472
    int i_border = -1;
471
473
    int stats[4]; stats[0] = stats[1] = stats[2] = stats[3] = 0;
614
616
                 p_spu->i_width, i_height, p_spu->i_x, i_y );
615
617
#endif
616
618
    }
617
 
 
 
619
 
618
620
    /* Handle color if no palette was found */
619
621
    if( !p_spu_data->b_palette )
620
622
    {
688
690
 
689
691
    /* Create a new subpicture region */
690
692
    memset( &fmt, 0, sizeof(video_format_t) );
691
 
    fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
692
 
    fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
 
693
    fmt.i_chroma = VLC_CODEC_YUVP;
 
694
    fmt.i_sar_num = 0; /* 0 means use aspect ratio of background video */
 
695
    fmt.i_sar_den = 1;
693
696
    fmt.i_width = fmt.i_visible_width = p_spu_properties->i_width;
694
697
    fmt.i_height = fmt.i_visible_height = p_spu_properties->i_height -
695
698
        p_spu_data->i_y_top_offset - p_spu_data->i_y_bottom_offset;
701
704
        fmt.p_palette->palette[i_x][0] = p_spu_data->pi_yuv[i_x][0];
702
705
        fmt.p_palette->palette[i_x][1] = p_spu_data->pi_yuv[i_x][1];
703
706
        fmt.p_palette->palette[i_x][2] = p_spu_data->pi_yuv[i_x][2];
704
 
        fmt.p_palette->palette[i_x][3] =
705
 
            p_spu_data->pi_alpha[i_x] == 0xf ? 0xff :
706
 
            p_spu_data->pi_alpha[i_x] << 4;
 
707
        fmt.p_palette->palette[i_x][3] = p_spu_data->pi_alpha[i_x] * 0x11;
707
708
    }
708
709
 
709
710
    p_spu->p_region = subpicture_region_New( &fmt );