Changeset 05f98788679813a111a48589f12699043e461313

Show
Ignore:
Timestamp:
01/01/04 16:56:56 (5 years ago)
Author:
Rocky Bernstein <rocky@videolan.org>
git-committer:
Rocky Bernstein <rocky@videolan.org> 1072972616 +0000
git-parent:

[7d705ffcb6bb575f483569b75885b1b4fe263467]

git-author:
Rocky Bernstein <rocky@videolan.org> 1072972616 +0000
Message:

RenderRV16 handles scaling. But seems to slow to render subtitles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/ogt/render.c

    r9d12fa3 r05f9878  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: render.c,v 1.6 2004/01/01 13:51:38 rocky Exp $ 
     5 * $Id: render.c,v 1.7 2004/01/01 15:56:56 rocky Exp $ 
    66 * 
    77 * Author: Rocky Bernstein  
     
    315315    /* Common variables */ 
    316316    uint8_t *p_pixel_base; 
    317     ogt_yuvt_t *p_source = (ogt_yuvt_t *)p_spu->p_sys->p_data; 
     317    ogt_yuvt_t *p_src_start = (ogt_yuvt_t *)p_spu->p_sys->p_data; 
     318    ogt_yuvt_t *p_src_end   = &p_src_start[p_spu->i_height * p_spu->i_width]; 
    318319 
    319320    int i_x, i_y; 
     
    324325    /* Crop-specific */ 
    325326    int i_x_start, i_y_start, i_x_end, i_y_end; 
     327 
     328    struct subpicture_sys_t *p_sys = p_spu->p_sys; 
     329 
     330    dbg_print( (DECODE_DBG_CALL|DECODE_DBG_RENDER),  
     331           "spu width: %d, height %d, scaled (%d, %d)",  
     332           p_spu->i_width,  p_spu->i_height,  
     333           p_vout->output.i_width, p_vout->output.i_height ); 
    326334 
    327335    i_xscale = ( p_vout->output.i_width << 6 ) / p_vout->render.i_width; 
     
    344352    for( i_y = 0 ; i_y < i_height ; ) 
    345353    { 
     354        int i_y_src = (i_y / i_yscale) * p_spu->i_width; 
    346355        i_ytmp = i_y >> 6; 
    347356        i_y += i_yscale; 
     357 
    348358 
    349359        /* Check whether we need to draw one line or more than one */ 
    350360        if( i_ytmp + 1 >= ( i_y >> 6 ) ) 
    351361        { 
     362 
    352363            /* Just one line : we precalculate i_y >> 6 */ 
    353364            i_yreal = p_pic->p->i_pitch * i_ytmp; 
    354365 
    355366            /* Draw until we reach the end of the line */ 
    356             for( i_x = i_width ; i_x ; i_x--, p_source++
     367            for( i_x = i_width ; i_x ; i_x--
    357368            { 
     369          ogt_yuvt_t *p_source; 
     370 
    358371          if( b_crop 
    359372          && ( i_x < i_x_start || i_x > i_x_end 
     
    362375          continue; 
    363376                } 
     377 
     378          p_source = &p_src_start[i_y_src + ((i_width - i_x) / i_xscale)]; 
     379 
     380          if (p_source >= p_src_end) { 
     381        msg_Err( p_vout, "Trying to access beyond subtitle %d x %d %d", 
     382             (i_width - i_x) / i_xscale, i_y / i_yscale, i_height); 
     383        return; 
     384          } 
    364385           
    365386          switch( p_source->s.t ) 
     
    405426 
    406427            /* Draw until we reach the end of the line */ 
    407             for( i_x = i_width ; i_x ; i_x--, p_source++
     428            for( i_x = i_width ; i_x ; i_x--
    408429            { 
     430          ogt_yuvt_t *p_source; 
     431 
    409432          if( b_crop 
    410433          && ( i_x < i_x_start || i_x > i_x_end 
     
    413436          continue; 
    414437                } 
     438           
     439          p_source = &p_src_start[i_y_src + ((i_width - i_x) / i_xscale)]; 
     440 
     441          if (p_source >= p_src_end) { 
     442        msg_Err( p_vout, "Trying to access beyond subtitle %d x %d %d", 
     443             (i_width - i_x) / i_xscale, i_y / i_yscale, i_height); 
     444        return; 
     445          } 
    415446           
    416447          switch( p_source->s.t )