Commit 563c5e17 authored by Christophe Massiot's avatar Christophe Massiot

* Minor video parser optimization ;

* SDL now displays an error message on 422 streams.
parent 3861944d
......@@ -2,7 +2,7 @@
* vdec_ext-plugins.h : structures from the video decoder exported to plug-ins
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_ext-plugins.h,v 1.6 2001/10/11 13:19:27 massiot Exp $
* $Id: vdec_ext-plugins.h,v 1.7 2001/10/11 16:12:43 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -52,7 +52,7 @@ typedef struct macroblock_s
/* IDCT information */
idct_inner_t p_idcts[12];
int i_coded_block_pattern;
u16 i_coded_block_pattern;
/* which blocks are coded ? */
yuv_data_t * p_y_data;
yuv_data_t * p_u_data;
......
......@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_sdl.c,v 1.63 2001/09/26 12:32:25 massiot Exp $
* $Id: vout_sdl.c,v 1.64 2001/10/11 16:12:43 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
......@@ -559,6 +559,11 @@ static void vout_Display( vout_thread_t *p_vout )
* render
*/
/* TODO: support for streams other than 4:2:0 */
if( p_vout->p_rendered_pic->i_type != YUV_420_PICTURE )
{
intf_ErrMsg("sdl vout error: no support for that kind of pictures");
return;
}
/* create the overlay if necessary */
if( p_vout->p_sys->p_overlay == NULL )
{
......
......@@ -2,7 +2,7 @@
* video_decoder.c : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_decoder.c,v 1.59 2001/10/11 13:19:27 massiot Exp $
* $Id: video_decoder.c,v 1.60 2001/10/11 16:12:43 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
......@@ -249,7 +249,7 @@ static __inline__ void MotionBlock( vdec_pool_t * p_pool,
p_vdec->p_idct_data, p_idct->i_sparse_pos );
#define DECODE_NONINTRA_BLOCK( i_b, p_dest, I_CHROMA ) \
if( p_mb->i_coded_block_pattern & (1 << (3 + p_vpar->sequence.i_chroma_nb_blocks - i_b)) ) \
if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \
{ \
DECODE_INTRA_BLOCK( i_b, p_dest, I_CHROMA ); \
}
......
......@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.c,v 1.13 2001/10/11 13:19:27 massiot Exp $
* $Id: vpar_blocks.c,v 1.14 2001/10/11 16:12:43 massiot Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
......@@ -1000,7 +1000,7 @@ DECLARE_INTRAMB( MPEG2IntraB15MB, MPEG2IntraB15 );
#undef DECODE_CHROMABLOCK
#define DECODE_LUMABLOCK( I_B, PF_MBFUNC ) \
if( p_mb->i_coded_block_pattern & (1 << (3 + p_vpar->sequence.i_chroma_nb_blocks - (I_B))) ) \
if( p_mb->i_coded_block_pattern & (1 << (11 - (I_B))) ) \
{ \
p_idct = &p_mb->p_idcts[I_B]; \
memset( p_idct->pi_block, 0, 64*sizeof(dctelem_t) ); \
......@@ -1009,7 +1009,7 @@ DECLARE_INTRAMB( MPEG2IntraB15MB, MPEG2IntraB15 );
}
#define DECODE_CHROMABLOCK( I_B, PF_MBFUNC ) \
if( p_mb->i_coded_block_pattern & (1 << (3 + p_vpar->sequence.i_chroma_nb_blocks - (I_B))) ) \
if( p_mb->i_coded_block_pattern & (1 << (11 - (I_B))) ) \
{ \
p_idct = &p_mb->p_idcts[I_B]; \
memset( p_idct->pi_block, 0, 64*sizeof(dctelem_t) ); \
......@@ -1589,46 +1589,23 @@ static __inline__ int CodedPattern( vpar_thread_t * p_vpar )
{
p_tab = CBP_7 - 16 + i_code;
RemoveBits( &p_vpar->bit_stream, p_tab->i_length );
if( p_vpar->sequence.i_chroma_format != CHROMA_420 )
{
int i_value = p_tab->i_value;
if( p_vpar->sequence.i_chroma_format != CHROMA_444 )
{
i_value <<= 2;
i_value |= GetBits( &p_vpar->bit_stream, 2 );
}
else
{
i_value <<= 6;
i_value |= GetBits( &p_vpar->bit_stream, 6 );
}
return( i_value );
}
return( p_tab->i_value );
}
else
{
p_tab = CBP_9 + ShowBits( &p_vpar->bit_stream, 9 );
RemoveBits( &p_vpar->bit_stream, p_tab->i_length );
if( p_vpar->sequence.i_chroma_format != CHROMA_420 )
{
int i_value = p_tab->i_value;
if( p_vpar->sequence.i_chroma_format != CHROMA_444 )
{
i_value <<= 2;
i_value |= GetBits( &p_vpar->bit_stream, 2 );
}
else
{
i_value <<= 6;
i_value |= GetBits( &p_vpar->bit_stream, 6 );
}
return( i_value );
}
return( p_tab->i_value );
}
if( p_vpar->sequence.i_chroma_format == CHROMA_420 )
{
return( p_tab->i_value << 6 );
}
if( p_vpar->sequence.i_chroma_format == CHROMA_422 )
{
return( (p_tab->i_value << 6)
| (GetBits( &p_vpar->bit_stream, 2 ) << 4) );
}
return( (p_tab->i_value << 6)
| GetBits( &p_vpar->bit_stream, 6 ) );
}
/*****************************************************************************
......
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