Commit fa66a86a authored by Jean-Marc Dressler's avatar Jean-Marc Dressler

D�but bu vrai d�buggage du parser. Maintenant le vlc segfaulte
dans Pictureheader au lieu de segfaulter dans l'initialisation
du parser.
parent 54accec0
......@@ -72,7 +72,7 @@ typedef struct vpar_thread_s
/* variable length codes for the structure dct_dc_size for intra blocks */
lookup_t pppl_dct_dc_size[2][2][32];
/* structure to store the tables B14 & B15 */
dct_lookup_t *ppl_dct_coef[10];
dct_lookup_t *ppl_dct_coef[11];
#ifdef STATS
/* Statistics */
......
......@@ -522,16 +522,27 @@ void InitDCTTables( vpar_thread_t * p_vpar )
memcpy( p_vpar->pppl_dct_dc_size[1][1], pl_dct_dc_chrom_init_table_2,
sizeof( pl_dct_dc_chrom_init_table_2 ) );
/* For table B14 & B15, we have a pointer to tables */
p_vpar->ppl_dct_coef[0] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab_dc ) );
memcpy( p_vpar->ppl_dct_coef[0], pl_DCT_tab_dc, sizeof( pl_DCT_tab_dc ) );
p_vpar->ppl_dct_coef[1] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab_ac ) );
memcpy( p_vpar->ppl_dct_coef[1], pl_DCT_tab_ac, sizeof( pl_DCT_tab_ac ) );
p_vpar->ppl_dct_coef[2] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab0 ) );
memcpy( p_vpar->ppl_dct_coef[2], pl_DCT_tab0, sizeof( pl_DCT_tab0 ) );
p_vpar->ppl_dct_coef[3] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab1 ) );
memcpy( p_vpar->ppl_dct_coef[3], pl_DCT_tab1, sizeof( pl_DCT_tab1 ) );
p_vpar->ppl_dct_coef[4] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab2 ) );
memcpy( p_vpar->ppl_dct_coef[4], pl_DCT_tab2, sizeof( pl_DCT_tab2 ) );
p_vpar->ppl_dct_coef[5] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab3 ) );
memcpy( p_vpar->ppl_dct_coef[5], pl_DCT_tab3, sizeof( pl_DCT_tab3 ) );
p_vpar->ppl_dct_coef[6] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab4 ) );
memcpy( p_vpar->ppl_dct_coef[6], pl_DCT_tab4, sizeof( pl_DCT_tab4 ) );
p_vpar->ppl_dct_coef[7] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab5 ) );
memcpy( p_vpar->ppl_dct_coef[7], pl_DCT_tab5, sizeof( pl_DCT_tab5 ) );
p_vpar->ppl_dct_coef[8] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab6 ) );
memcpy( p_vpar->ppl_dct_coef[8], pl_DCT_tab6, sizeof( pl_DCT_tab6 ) );
p_vpar->ppl_dct_coef[9] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab0a ) );
memcpy( p_vpar->ppl_dct_coef[9], pl_DCT_tab0a, sizeof( pl_DCT_tab0a ) );
p_vpar->ppl_dct_coef[10] = (dct_lookup_t*) malloc( sizeof( pl_DCT_tab1a ) );
memcpy( p_vpar->ppl_dct_coef[10], pl_DCT_tab1a, sizeof( pl_DCT_tab1a ) );
}
......
......@@ -164,10 +164,11 @@ static __inline__ void NextStartCode( vpar_thread_t * p_vpar )
/* Re-align the buffer on an 8-bit boundary */
RealignBits( &p_vpar->bit_stream );
while( ShowBits( &p_vpar->bit_stream, 24 ) != 0x01L && !p_vpar->b_die )
while( ShowBits( &p_vpar->bit_stream, 16 ) != 0 && !p_vpar->b_die )
{
DumpBits( &p_vpar->bit_stream, 8 );
}
DumpBits( &p_vpar->bit_stream, 16 );
}
/*****************************************************************************
......@@ -262,7 +263,7 @@ int vpar_NextSequenceHeader( vpar_thread_t * p_vpar )
while( !p_vpar->b_die )
{
NextStartCode( p_vpar );
if( ShowBits( &p_vpar->bit_stream, 32 ) == SEQUENCE_HEADER_CODE )
if( ShowBits( &p_vpar->bit_stream, 16 ) == SEQUENCE_HEADER_CODE )
return 0;
}
return 1;
......@@ -279,21 +280,28 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar )
switch( GetBits32( &p_vpar->bit_stream ) )
{
case SEQUENCE_HEADER_CODE:
fprintf( stderr, "begin sequence header\n" );
SequenceHeader( p_vpar );
fprintf( stderr, "end sequence header\n" );
return 0;
break;
case GROUP_START_CODE:
fprintf( stderr, "begin group\n" );
GroupHeader( p_vpar );
fprintf( stderr, "end group\n" );
return 0;
break;
case PICTURE_START_CODE:
fprintf( stderr, "begin picture\n" );
PictureHeader( p_vpar );
fprintf( stderr, "end picture\n" );
return 0;
break;
case SEQUENCE_END_CODE:
fprintf( stderr, "sequence header end code\n" );
return 1;
break;
......@@ -531,8 +539,9 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/*
* Picture Coding Extension
*/
fprintf( stderr, "picture1\n" );
NextStartCode( p_vpar );
if( ShowBits( &p_vpar->bit_stream, 32 ) == EXTENSION_START_CODE )
if( ShowBits( &p_vpar->bit_stream, 16 ) == EXTENSION_START_CODE )
{
/* Parse picture_coding_extension */
DumpBits32( &p_vpar->bit_stream );
......
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