Commit 2f2ce6f4 authored by Jean-Marc Dressler's avatar Jean-Marc Dressler

La plupart des causes de segfault de la video ont �t� �limin�es, les messages

d'erreur qui sont affich�s sur stderr vous donnerons une bonne id�e du nombres
d'occasions de planter qui se pr�sentent au client.

J'ai aussi remis le flag DEBUG � 1 et commenter omit-frame-pointer pour que
tout le monde puisse avoir la chance de participer � la chasse aux segfaults
avec son gdb. Les bugs report sont le bienvenu (surtout si c pour l'audio ;).
parent 7d73d8fd
...@@ -22,7 +22,7 @@ AUDIO += dummy ...@@ -22,7 +22,7 @@ AUDIO += dummy
# Video output settings # Video output settings
VIDEO = x11 VIDEO = x11
#VIDEO += fb VIDEO += fb
#VIDEO += ggi #VIDEO += ggi
#VIDEO += glide #VIDEO += glide
# Not yet supported # Not yet supported
...@@ -50,7 +50,7 @@ MMX=YES ...@@ -50,7 +50,7 @@ MMX=YES
DECODER=new DECODER=new
# Debugging mode on or off (set to 1 to activate) # Debugging mode on or off (set to 1 to activate)
DEBUG=0 DEBUG=1
#----------------- do not change anything below this line ---------------------- #----------------- do not change anything below this line ----------------------
...@@ -140,7 +140,7 @@ CCFLAGS += -D_GNU_SOURCE ...@@ -140,7 +140,7 @@ CCFLAGS += -D_GNU_SOURCE
# Optimizations : don't compile debug versions with them # Optimizations : don't compile debug versions with them
CCFLAGS += -O6 CCFLAGS += -O6
CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CCFLAGS += -fomit-frame-pointer #CCFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy # Optimizations for x86 familiy
ifeq ($(ARCH),X86) ifeq ($(ARCH),X86)
......
...@@ -274,14 +274,20 @@ static __inline__ void Motion420( ...@@ -274,14 +274,20 @@ static __inline__ void Motion420(
/* Temporary variables to avoid recalculating things twice */ /* Temporary variables to avoid recalculating things twice */
int i_source_offset, i_dest_offset, i_c_height, i_c_select; int i_source_offset, i_dest_offset, i_c_height, i_c_select;
/* Luminance */ i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
MotionComponent( /* source */
p_source->p_y
+ (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset + (p_mb->i_motion_l_y + i_offset
+ (i_mv_y >> 1) + (i_mv_y >> 1)
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_width, * p_mb->p_picture->i_width;
if( i_source_offset >= p_source->i_width * p_source->i_height )
{
fprintf( stderr, "vdec error: bad motion vector\n" );
return;
}
/* Luminance */
MotionComponent( /* source */
p_source->p_y + i_source_offset,
/* destination */ /* destination */
p_mb->p_picture->p_y p_mb->p_picture->p_y
+ (p_mb->i_l_x) + (p_mb->i_l_x)
...@@ -300,6 +306,12 @@ static __inline__ void Motion420( ...@@ -300,6 +306,12 @@ static __inline__ void Motion420(
+ ((i_mv_y/2) >> 1)) + ((i_mv_y/2) >> 1))
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_chroma_width; * p_mb->p_picture->i_chroma_width;
if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 )
{
fprintf( stderr, "vdec error: bad motion vector\n" );
return;
}
i_dest_offset = (p_mb->i_c_x) i_dest_offset = (p_mb->i_c_x)
+ (p_mb->i_motion_c_y + b_dest_field) + (p_mb->i_motion_c_y + b_dest_field)
* p_mb->p_picture->i_chroma_width; * p_mb->p_picture->i_chroma_width;
...@@ -345,6 +357,7 @@ static __inline__ void Motion422( ...@@ -345,6 +357,7 @@ static __inline__ void Motion422(
boolean_t b_average /* (explicit) averaging of boolean_t b_average /* (explicit) averaging of
* several predictions */ ) * several predictions */ )
{ {
#if 0
int i_source_offset, i_dest_offset, i_c_select; int i_source_offset, i_dest_offset, i_c_select;
/* Luminance */ /* Luminance */
...@@ -393,6 +406,7 @@ static __inline__ void Motion422( ...@@ -393,6 +406,7 @@ static __inline__ void Motion422(
+ i_dest_offset, + i_dest_offset,
8, i_height, i_c_stride, p_mb->i_c_stride, 8, i_height, i_c_stride, p_mb->i_c_stride,
i_c_select, b_average ); i_c_select, b_average );
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -417,6 +431,7 @@ static __inline__ void Motion444( ...@@ -417,6 +431,7 @@ static __inline__ void Motion444(
boolean_t b_average /* (explicit) averaging of boolean_t b_average /* (explicit) averaging of
* several predictions */ ) * several predictions */ )
{ {
#if 0
int i_source_offset, i_dest_offset, i_select; int i_source_offset, i_dest_offset, i_select;
i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1)) i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
...@@ -453,6 +468,7 @@ static __inline__ void Motion444( ...@@ -453,6 +468,7 @@ static __inline__ void Motion444(
+ i_dest_offset, + i_dest_offset,
16, i_height, i_l_stride, p_mb->i_l_stride, 16, i_height, i_l_stride, p_mb->i_l_stride,
i_select, b_average ); i_select, b_average );
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -502,12 +518,12 @@ void vdec_MotionFieldField420( macroblock_t * p_mb ) ...@@ -502,12 +518,12 @@ void vdec_MotionFieldField420( macroblock_t * p_mb )
void vdec_MotionFieldField422( macroblock_t * p_mb ) void vdec_MotionFieldField422( macroblock_t * p_mb )
{ {
FIELDFIELD( Motion422 ) //FIELDFIELD( Motion422 )
} }
void vdec_MotionFieldField444( macroblock_t * p_mb ) void vdec_MotionFieldField444( macroblock_t * p_mb )
{ {
FIELDFIELD( Motion444 ) //FIELDFIELD( Motion444 )
} }
/***************************************************************************** /*****************************************************************************
...@@ -584,12 +600,12 @@ void vdec_MotionField16x8420( macroblock_t * p_mb ) ...@@ -584,12 +600,12 @@ void vdec_MotionField16x8420( macroblock_t * p_mb )
void vdec_MotionField16x8422( macroblock_t * p_mb ) void vdec_MotionField16x8422( macroblock_t * p_mb )
{ {
FIELD16X8( Motion422 ) //FIELD16X8( Motion422 )
} }
void vdec_MotionField16x8444( macroblock_t * p_mb ) void vdec_MotionField16x8444( macroblock_t * p_mb )
{ {
FIELD16X8( Motion444 ) //FIELD16X8( Motion444 )
} }
/***************************************************************************** /*****************************************************************************
...@@ -626,12 +642,12 @@ void vdec_MotionFieldDMV420( macroblock_t * p_mb ) ...@@ -626,12 +642,12 @@ void vdec_MotionFieldDMV420( macroblock_t * p_mb )
void vdec_MotionFieldDMV422( macroblock_t * p_mb ) void vdec_MotionFieldDMV422( macroblock_t * p_mb )
{ {
FIELDDMV( Motion422 ) //FIELDDMV( Motion422 )
} }
void vdec_MotionFieldDMV444( macroblock_t * p_mb ) void vdec_MotionFieldDMV444( macroblock_t * p_mb )
{ {
FIELDDMV( Motion444 ) //FIELDDMV( Motion444 )
} }
/***************************************************************************** /*****************************************************************************
...@@ -671,12 +687,12 @@ void vdec_MotionFrameFrame420( macroblock_t * p_mb ) ...@@ -671,12 +687,12 @@ void vdec_MotionFrameFrame420( macroblock_t * p_mb )
void vdec_MotionFrameFrame422( macroblock_t * p_mb ) void vdec_MotionFrameFrame422( macroblock_t * p_mb )
{ {
FRAMEFRAME( Motion422 ) //FRAMEFRAME( Motion422 )
} }
void vdec_MotionFrameFrame444( macroblock_t * p_mb ) void vdec_MotionFrameFrame444( macroblock_t * p_mb )
{ {
FRAMEFRAME( Motion444 ) //FRAMEFRAME( Motion444 )
} }
/***************************************************************************** /*****************************************************************************
...@@ -736,12 +752,12 @@ void vdec_MotionFrameField420( macroblock_t * p_mb ) ...@@ -736,12 +752,12 @@ void vdec_MotionFrameField420( macroblock_t * p_mb )
void vdec_MotionFrameField422( macroblock_t * p_mb ) void vdec_MotionFrameField422( macroblock_t * p_mb )
{ {
FRAMEFIELD( Motion422 ) //FRAMEFIELD( Motion422 )
} }
void vdec_MotionFrameField444( macroblock_t * p_mb ) void vdec_MotionFrameField444( macroblock_t * p_mb )
{ {
FRAMEFIELD( Motion444 ) //FRAMEFIELD( Motion444 )
} }
/***************************************************************************** /*****************************************************************************
...@@ -784,10 +800,10 @@ void vdec_MotionFrameDMV420( macroblock_t * p_mb ) ...@@ -784,10 +800,10 @@ void vdec_MotionFrameDMV420( macroblock_t * p_mb )
void vdec_MotionFrameDMV422( macroblock_t * p_mb ) void vdec_MotionFrameDMV422( macroblock_t * p_mb )
{ {
FRAMEDMV( Motion422 ) //FRAMEDMV( Motion422 )
} }
void vdec_MotionFrameDMV444( macroblock_t * p_mb ) void vdec_MotionFrameDMV444( macroblock_t * p_mb )
{ {
FRAMEDMV( Motion444 ) //FRAMEDMV( Motion444 )
} }
...@@ -443,7 +443,14 @@ void vdec_DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb ) ...@@ -443,7 +443,14 @@ void vdec_DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
/* /*
* Motion Compensation (ISO/IEC 13818-2 section 7.6) * Motion Compensation (ISO/IEC 13818-2 section 7.6)
*/ */
if( p_mb->pf_motion == 0 )
{
fprintf( stderr, "vdec error: pf_motion set to NULL\n" );
}
else
{
p_mb->pf_motion( p_mb ); p_mb->pf_motion( p_mb );
}
DECODEBLOCKS( AddBlock ) DECODEBLOCKS( AddBlock )
} }
......
...@@ -1878,6 +1878,11 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar, ...@@ -1878,6 +1878,11 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
do do
{ {
if( i_mb_address_save >= p_vpar->sequence.i_mb_size )
{
p_vpar->picture.b_error = 1;
return;
}
ParseMacroblock( p_vpar, pi_mb_address, i_mb_address_save, ParseMacroblock( p_vpar, pi_mb_address, i_mb_address_save,
i_mb_base, b_mpeg2, i_coding_type, i_mb_base, b_mpeg2, i_coding_type,
i_chroma_format, i_structure, i_chroma_format, i_structure,
......
...@@ -760,9 +760,17 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -760,9 +760,17 @@ static void PictureHeader( vpar_thread_t * p_vpar )
else else
{ {
/* Try to find an optimized function. */ /* Try to find an optimized function. */
if( ppf_picture_data[p_vpar->picture.i_structure][p_vpar->picture.i_coding_type] == NULL )
{
fprintf( stderr, "vpar error: bad ppf_picture_data function pointer (struct:%d, coding type:%d)\n",
p_vpar->picture.i_structure, p_vpar->picture.i_coding_type );
}
else
{
ppf_picture_data[p_vpar->picture.i_structure] ppf_picture_data[p_vpar->picture.i_structure]
[p_vpar->picture.i_coding_type]( p_vpar, i_mb_base ); [p_vpar->picture.i_coding_type]( p_vpar, i_mb_base );
} }
}
if( p_vpar->b_die || p_vpar->b_error ) if( p_vpar->b_die || p_vpar->b_error )
{ {
......
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