* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.16 2002/03/14 01:35:28 stef Exp $
+ * $Id: vpar_headers.c,v 1.20 2002/05/18 17:47:47 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
/*
* Local prototypes
*/
-static __inline__ void NextStartCode( bit_stream_t * );
+static inline void NextStartCode( bit_stream_t * );
static void SequenceHeader( vpar_thread_t * p_vpar );
static void GroupHeader( vpar_thread_t * p_vpar );
static void PictureHeader( vpar_thread_t * p_vpar );
/*****************************************************************************
* ReferenceUpdate : Update the reference pointers when we have a new picture
*****************************************************************************/
-static void __inline__ ReferenceUpdate( vpar_thread_t * p_vpar,
- int i_coding_type,
- picture_t * p_newref )
+static void inline ReferenceUpdate( vpar_thread_t * p_vpar,
+ int i_coding_type,
+ picture_t * p_newref )
{
if( i_coding_type != B_CODING_TYPE )
{
* ReferenceReplace : Replace the last reference pointer when we destroy
* a picture
*****************************************************************************/
-static void __inline__ ReferenceReplace( vpar_thread_t * p_vpar,
- int i_coding_type,
- picture_t * p_newref )
+static void inline ReferenceReplace( vpar_thread_t * p_vpar, int i_coding_type,
+ picture_t * p_newref )
{
if( i_coding_type != B_CODING_TYPE )
{
/*****************************************************************************
* LoadMatrix : Load a quantization matrix
*****************************************************************************/
-static __inline__ void LoadMatrix( vpar_thread_t * p_vpar,
- quant_matrix_t * p_matrix )
+static inline void LoadMatrix( vpar_thread_t * p_vpar,
+ quant_matrix_t * p_matrix )
{
int i_dummy;
/*****************************************************************************
* LinkMatrix : Link a quantization matrix to another
*****************************************************************************/
-static __inline__ void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
+static inline void LinkMatrix( quant_matrix_t * p_matrix, u8 * pi_array )
{
if( p_matrix->b_allocated )
{
/*****************************************************************************
* ChromaToFourCC: Return a FourCC value used by the video output.
*****************************************************************************/
-static __inline__ u64 ChromaToFourCC( int i_chroma )
+static inline u64 ChromaToFourCC( int i_chroma )
{
switch( i_chroma )
{
case SEQUENCE_END_CODE:
intf_WarnMsg(3, "vpar warning: sequence end code received");
+
+ ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+
return 1;
break;
}
/* check whether the input gives a particular aspect ratio */
- if( p_vpar->p_config->p_demux_data )
+ if( p_vpar->p_config->p_demux_data
+ && ( *(int*)(p_vpar->p_config->p_demux_data) & 0x7 ) )
{
i_aspect = *(int*)(p_vpar->p_config->p_demux_data);
}
/* Initialize values. */
vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure );
P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients;
- p_vpar->picture.i_field_width = ( p_vpar->sequence.i_width
- << ( 1 - p_vpar->picture.b_frame_structure ) );
/* Update the reference pointers. */
ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture );
(i_structure != p_vpar->picture.i_current_structure);
p_vpar->picture.b_current_field =
(i_structure == BOTTOM_FIELD );
+ p_vpar->picture.i_lum_stride = p_vpar->picture.p_picture->Y_PITCH
+ << ( 1 - p_vpar->picture.b_frame_structure );
+ p_vpar->picture.i_chrom_stride = p_vpar->picture.p_picture->U_PITCH
+ << ( 1 - p_vpar->picture.b_frame_structure );
+ /* We suppose the pitch is the same for U and V planes. */
+ p_vpar->picture.i_field_width = p_vpar->sequence.i_width
+ << ( 1 - p_vpar->picture.b_frame_structure );
if( !p_vpar->p_config->p_stream_ctrl->b_grayscale )
{