Commit 023206d0 authored by Jean-Marc Dressler's avatar Jean-Marc Dressler

Il est 6 heure du matin et le parser ... parse !!!!!!!!
Ca � l'air de pas trop mal marcher. Parmis les bugs les plus sauvages
on trouve :
1) le DumpBits sans NeedBits (corrig� par un RemoveBits)
2) Une table � laquelle il manquait une ligne
3) le test de fin de boucle du d�codage des coef dct �tait mal plac�

Meuh, � toi de jouer

Stef & Polux
parent 8d158ef4
...@@ -164,7 +164,7 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream ) ...@@ -164,7 +164,7 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream )
/****************************************************************************** /******************************************************************************
* NeedBits : reads i_bits new bits in the bit stream and stores them in the * NeedBits : reads i_bits new bits in the bit stream and stores them in the
* <F4> bit buffer * bit buffer
****************************************************************************** ******************************************************************************
* - i_bits must be less or equal 32 ! * - i_bits must be less or equal 32 !
* - There is something important to notice with that function : if the number * - There is something important to notice with that function : if the number
...@@ -214,6 +214,24 @@ static __inline__ void DumpBits32( bit_stream_t * p_bit_stream ) ...@@ -214,6 +214,24 @@ static __inline__ void DumpBits32( bit_stream_t * p_bit_stream )
* need to call RealignBits() before). * need to call RealignBits() before).
*/ */
/******************************************************************************
* RemoveBits : removes i_bits bits from the bit buffer
******************************************************************************/
static __inline__ void RemoveBits( bit_stream_t * p_bit_stream, int i_bits )
{
NeedBits( p_bit_stream, i_bits );
DumpBits( p_bit_stream, i_bits );
}
/******************************************************************************
* RemoveBits32 : removes 32 bits from the bit buffer
******************************************************************************/
static __inline__ void RemoveBits32( bit_stream_t * p_bit_stream )
{
NeedBits( p_bit_stream, 32 );
DumpBits32( p_bit_stream );
}
/****************************************************************************** /******************************************************************************
* ShowBits : return i_bits bits from the bit stream * ShowBits : return i_bits bits from the bit stream
******************************************************************************/ ******************************************************************************/
......
...@@ -60,7 +60,7 @@ typedef struct vpar_thread_s ...@@ -60,7 +60,7 @@ typedef struct vpar_thread_s
/* Lookup tables */ /* Lookup tables */
#ifdef MPEG2_COMPLIANT #ifdef MPEG2_COMPLIANT
s16 pi_crop_buf[65536]; s16 pi_crop_buf[8192];
s16 * pi_crop; s16 * pi_crop;
#endif #endif
lookup_t pl_mb_addr_inc[2048]; /* for macroblock lookup_t pl_mb_addr_inc[2048]; /* for macroblock
...@@ -71,8 +71,6 @@ typedef struct vpar_thread_s ...@@ -71,8 +71,6 @@ typedef struct vpar_thread_s
lookup_t * pl_coded_pattern; lookup_t * pl_coded_pattern;
/* variable length codes for the structure dct_dc_size for intra blocks */ /* variable length codes for the structure dct_dc_size for intra blocks */
lookup_t * pppl_dct_dc_size[2][2]; lookup_t * pppl_dct_dc_size[2][2];
/* structure to store the tables B14 & B15 */
dct_lookup_t * pppl_dct_coef[2][65536];
#ifdef STATS #ifdef STATS
/* Statistics */ /* Statistics */
......
...@@ -84,9 +84,9 @@ typedef struct lookup_s ...@@ -84,9 +84,9 @@ typedef struct lookup_s
typedef struct dct_lookup_s typedef struct dct_lookup_s
{ {
int i_run; char i_run;
int i_level; char i_level;
int i_length; char i_length;
} dct_lookup_t; } dct_lookup_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -43,7 +43,7 @@ typedef struct sequence_s ...@@ -43,7 +43,7 @@ typedef struct sequence_s
u32 i_height, i_width, i_size; u32 i_height, i_width, i_size;
u32 i_mb_height, i_mb_width, i_mb_size; u32 i_mb_height, i_mb_width, i_mb_size;
unsigned int i_aspect_ratio; unsigned int i_aspect_ratio;
double d_frame_rate; float r_frame_rate;
boolean_t b_mpeg2; boolean_t b_mpeg2;
boolean_t b_progressive; boolean_t b_progressive;
unsigned int i_scalable_mode; unsigned int i_scalable_mode;
......
...@@ -276,7 +276,7 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb ) ...@@ -276,7 +276,7 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
} }
/* chrominance */ /* chrominance */
for( i_b = 4; i_b < 4 + 2*p_mb->i_chroma_nb_blocks; i_b++ ) for( i_b = 4; i_b < 4 + p_mb->i_chroma_nb_blocks; i_b++ )
{ {
/* /*
* Inverse DCT (ISO/IEC 13818-2 section Annex A) * Inverse DCT (ISO/IEC 13818-2 section Annex A)
......
...@@ -231,12 +231,12 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -231,12 +231,12 @@ static int InitThread( vpar_thread_t *p_vpar )
#if defined(MPEG2_COMPLIANT) && !defined(VDEC_DFT) #if defined(MPEG2_COMPLIANT) && !defined(VDEC_DFT)
vpar_InitCrop( p_vpar ); vpar_InitCrop( p_vpar );
#endif #endif
InitMbAddrInc( p_vpar ); vpar_InitMbAddrInc( p_vpar );
InitDCTTables( p_vpar ); vpar_InitDCTTables( p_vpar );
InitPMBType( p_vpar ); vpar_InitPMBType( p_vpar );
InitBMBType( p_vpar ); vpar_InitBMBType( p_vpar );
InitCodedPattern( p_vpar ); vpar_InitCodedPattern( p_vpar );
InitDCTTables( p_vpar ); vpar_InitDCTTables( p_vpar );
/* Mark thread as running and return */ /* Mark thread as running and return */
intf_DbgMsg("vpar debug: InitThread(%p) succeeded\n", p_vpar); intf_DbgMsg("vpar debug: InitThread(%p) succeeded\n", p_vpar);
......
This diff is collapsed.
This diff is collapsed.
...@@ -73,14 +73,14 @@ static __inline__ int vpar_MotionCode( vpar_thread_t * p_vpar ) ...@@ -73,14 +73,14 @@ static __inline__ int vpar_MotionCode( vpar_thread_t * p_vpar )
if( (i_code = ShowBits(&p_vpar->bit_stream, 9)) >= 64 ) if( (i_code = ShowBits(&p_vpar->bit_stream, 9)) >= 64 )
{ {
i_code >>= 6; i_code >>= 6;
DumpBits( &p_vpar->bit_stream, p_mv_tab0[0].i_len ); RemoveBits( &p_vpar->bit_stream, p_mv_tab0[0].i_len );
return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab0[i_code].i_val : p_mv_tab0[i_code].i_val ); return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab0[i_code].i_val : p_mv_tab0[i_code].i_val );
} }
if( i_code >= 24 ) if( i_code >= 24 )
{ {
i_code >>= 3; i_code >>= 3;
DumpBits( &p_vpar->bit_stream, p_mv_tab1[0].i_len ); RemoveBits( &p_vpar->bit_stream, p_mv_tab1[0].i_len );
return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab1[i_code].i_val : p_mv_tab1[i_code].i_val ); return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab1[i_code].i_val : p_mv_tab1[i_code].i_val );
} }
...@@ -91,7 +91,7 @@ static __inline__ int vpar_MotionCode( vpar_thread_t * p_vpar ) ...@@ -91,7 +91,7 @@ static __inline__ int vpar_MotionCode( vpar_thread_t * p_vpar )
return 0; return 0;
} }
DumpBits( &p_vpar->bit_stream, p_mv_tab2[0].i_len ); RemoveBits( &p_vpar->bit_stream, p_mv_tab2[0].i_len );
return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab2[i_code].i_val : p_mv_tab2[i_code].i_val ); return( GetBits(&p_vpar->bit_stream, 1) ? -p_mv_tab2[i_code].i_val : p_mv_tab2[i_code].i_val );
} }
......
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