Commit 43f8d0ef authored by Sam Hocevar's avatar Sam Hocevar

  * Small optimization in vpar_blocks.c, sparing a few memset() calls.
  * Additional error checking in vout_sdl.c.
  * Minor manpage fix, conforming to Debian policy version 3.5.5.0
    (Closes Debian bug #99561).
parent 1dafba77
......@@ -16,7 +16,7 @@
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
vlc, gvlc, gnome-vlc, kvlc, qvlc \- The VideoLAN Client
vlc, gvlc, gnome-vlc, qvlc \- The VideoLAN Client
.SH SYNOPSIS
.B vlc
.RI [ OPTIONS ]
......
......@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_sdl.c,v 1.55 2001/06/07 22:14:56 sam Exp $
* $Id: vout_sdl.c,v 1.56 2001/07/06 08:43:31 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
......@@ -246,6 +246,14 @@ static int vout_Init( vout_thread_t *p_vout )
main_GetIntVariable( VOUT_HEIGHT_VAR,VOUT_HEIGHT_DEFAULT ),
SDL_YV12_OVERLAY,
p_vout->p_sys->p_display );
if( p_overlay == NULL )
{
intf_ErrMsg( "vout error: could not create SDL overlay" );
p_vout->b_need_render = 1;
return( 0 );
}
intf_WarnMsg( 2, "vout: YUV acceleration %s",
p_overlay->hw_overlay ? "activated" : "unavailable !" );
p_vout->b_need_render = !p_overlay->hw_overlay;
......@@ -537,12 +545,7 @@ static void vout_Display( vout_thread_t *p_vout )
SDL_Rect disp;
if((p_vout->p_sys->p_display != NULL) && !p_vout->p_sys->b_reopen_display)
{
if( p_vout->b_need_render )
{
/* Change display frame */
SDL_Flip( p_vout->p_sys->p_display );
}
else
if( !p_vout->b_need_render )
{
/*
* p_vout->p_rendered_pic->p_y/u/v contains the YUV buffers to
......@@ -558,37 +561,55 @@ static void vout_Display( vout_thread_t *p_vout )
SDL_YV12_OVERLAY,
p_vout->p_sys->p_display
);
}
if( p_vout->p_sys->p_overlay == NULL )
{
/* Overlay allocation failed, switch back to software mode */
intf_ErrMsg( "vout error: could not create SDL overlay" );
p_vout->b_need_render = 1;
}
else
{
intf_WarnMsg( 2, "vout: YUV acceleration %s",
p_vout->p_sys->p_overlay->hw_overlay
? "activated" : "unavailable !" );
}
? "activated" : "unavailable !" );
SDL_LockYUVOverlay(p_vout->p_sys->p_overlay);
/* copy the data into video buffers */
/* Y first */
memcpy(p_vout->p_sys->p_overlay->pixels[0],
p_vout->p_rendered_pic->p_y,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[0]);
/* then V */
memcpy(p_vout->p_sys->p_overlay->pixels[1],
p_vout->p_rendered_pic->p_v,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[1] / 2);
/* and U */
memcpy(p_vout->p_sys->p_overlay->pixels[2],
p_vout->p_rendered_pic->p_u,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[2] / 2);
#define BUFFER (&p_vout->p_buffer[p_vout->i_buffer_index])
disp.w = BUFFER->i_pic_width;
disp.h = BUFFER->i_pic_height;
#undef BUFFER
disp.x = (p_vout->i_width - disp.w)/2;
disp.y = (p_vout->i_height - disp.h)/2;
SDL_DisplayYUVOverlay( p_vout->p_sys->p_overlay , &disp );
SDL_UnlockYUVOverlay(p_vout->p_sys->p_overlay);
SDL_LockYUVOverlay(p_vout->p_sys->p_overlay);
/* copy the data into video buffers */
/* Y first */
memcpy(p_vout->p_sys->p_overlay->pixels[0],
p_vout->p_rendered_pic->p_y,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[0]);
/* then V */
memcpy(p_vout->p_sys->p_overlay->pixels[1],
p_vout->p_rendered_pic->p_v,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[1] / 2);
/* and U */
memcpy(p_vout->p_sys->p_overlay->pixels[2],
p_vout->p_rendered_pic->p_u,
p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[2] / 2);
disp.w = (&p_vout->p_buffer[p_vout->i_buffer_index])->i_pic_width;
disp.h = (&p_vout->p_buffer[p_vout->i_buffer_index])->i_pic_height;
disp.x = (p_vout->i_width - disp.w)/2;
disp.y = (p_vout->i_height - disp.h)/2;
SDL_DisplayYUVOverlay( p_vout->p_sys->p_overlay , &disp );
SDL_UnlockYUVOverlay(p_vout->p_sys->p_overlay);
return;
}
}
/* Software YUV: change display frame */
SDL_Flip( p_vout->p_sys->p_display );
}
}
......
......@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.c,v 1.82 2001/06/18 23:42:07 sam Exp $
* $Id: vpar_blocks.c,v 1.83 2001/07/06 08:43:31 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -396,6 +396,14 @@ static dct_lookup_t * ppl_dct_tab1[2] = { pl_DCT_tab_ac, pl_DCT_tab0a };
static dct_lookup_t * ppl_dct_tab2[2] = { pl_DCT_tab_ac, pl_DCT_tab_dc };
/* Replacement for memset( p_table, 0, 8*sizeof( int ) ); */
static __inline__ void bzero8int( void *p_table )
{
((int*)p_table)[0] = ((int*)p_table)[1] =
((int*)p_table)[2] = ((int*)p_table)[3] =
((int*)p_table)[4] = ((int*)p_table)[5] =
((int*)p_table)[6] = ((int*)p_table)[7] = 0;
}
/*
* Initialization of lookup tables
......@@ -1662,7 +1670,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
else
{
p_mb->i_mb_type = MB_MOTION_FORWARD;
memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) );
bzero8int( p_mb->pppi_motion_vectors );
}
/* Set the field we use for motion compensation */
......@@ -1811,7 +1819,7 @@ static __inline__ void ParseMacroblock(
if( i_coding_type == P_CODING_TYPE )
{
/* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) );
bzero8int( p_vpar->mb.pppi_pmv );
}
for( i_mb = i_mb_previous + 1; i_mb < *pi_mb_address; i_mb++ )
......@@ -1866,8 +1874,8 @@ static __inline__ void ParseMacroblock(
{
/* Special No-MC macroblock in P pictures (7.6.3.5). */
p_mb->i_mb_type |= MB_MOTION_FORWARD;
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) );
memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) );
bzero8int( p_vpar->mb.pppi_pmv );
bzero8int( p_mb->pppi_motion_vectors );
p_vpar->mb.i_motion_type = 1 + (i_structure == FRAME_STRUCTURE);
p_mb->ppi_field_select[0][0] = (i_structure == BOTTOM_FIELD);
}
......@@ -1917,7 +1925,7 @@ static __inline__ void ParseMacroblock(
if( !p_vpar->picture.b_concealment_mv )
{
/* Reset MV predictors. */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) );
bzero8int( p_vpar->mb.pppi_pmv );
}
else
{
......@@ -2031,7 +2039,7 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
= 1 << (7 + p_vpar->picture.i_intra_dc_precision);
/* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) );
bzero8int( p_vpar->mb.pppi_pmv );
do
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment