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 ...@@ -72,7 +72,7 @@ typedef struct vpar_thread_s
/* 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][32]; lookup_t pppl_dct_dc_size[2][2][32];
/* structure to store the tables B14 & B15 */ /* structure to store the tables B14 & B15 */
dct_lookup_t *ppl_dct_coef[10]; dct_lookup_t *ppl_dct_coef[11];
#ifdef STATS #ifdef STATS
/* Statistics */ /* Statistics */
......
...@@ -522,16 +522,27 @@ void InitDCTTables( vpar_thread_t * p_vpar ) ...@@ -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, memcpy( p_vpar->pppl_dct_dc_size[1][1], pl_dct_dc_chrom_init_table_2,
sizeof( 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 */ /* 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ); 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 ) ...@@ -164,10 +164,11 @@ static __inline__ void NextStartCode( vpar_thread_t * p_vpar )
/* Re-align the buffer on an 8-bit boundary */ /* Re-align the buffer on an 8-bit boundary */
RealignBits( &p_vpar->bit_stream ); 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, 8 );
} }
DumpBits( &p_vpar->bit_stream, 16 );
} }
/***************************************************************************** /*****************************************************************************
...@@ -262,7 +263,7 @@ int vpar_NextSequenceHeader( vpar_thread_t * p_vpar ) ...@@ -262,7 +263,7 @@ int vpar_NextSequenceHeader( vpar_thread_t * p_vpar )
while( !p_vpar->b_die ) while( !p_vpar->b_die )
{ {
NextStartCode( p_vpar ); 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 0;
} }
return 1; return 1;
...@@ -279,21 +280,28 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar ) ...@@ -279,21 +280,28 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar )
switch( GetBits32( &p_vpar->bit_stream ) ) switch( GetBits32( &p_vpar->bit_stream ) )
{ {
case SEQUENCE_HEADER_CODE: case SEQUENCE_HEADER_CODE:
fprintf( stderr, "begin sequence header\n" );
SequenceHeader( p_vpar ); SequenceHeader( p_vpar );
fprintf( stderr, "end sequence header\n" );
return 0; return 0;
break; break;
case GROUP_START_CODE: case GROUP_START_CODE:
fprintf( stderr, "begin group\n" );
GroupHeader( p_vpar ); GroupHeader( p_vpar );
fprintf( stderr, "end group\n" );
return 0; return 0;
break; break;
case PICTURE_START_CODE: case PICTURE_START_CODE:
fprintf( stderr, "begin picture\n" );
PictureHeader( p_vpar ); PictureHeader( p_vpar );
fprintf( stderr, "end picture\n" );
return 0; return 0;
break; break;
case SEQUENCE_END_CODE: case SEQUENCE_END_CODE:
fprintf( stderr, "sequence header end code\n" );
return 1; return 1;
break; break;
...@@ -531,8 +539,9 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -531,8 +539,9 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/* /*
* Picture Coding Extension * Picture Coding Extension
*/ */
fprintf( stderr, "picture1\n" );
NextStartCode( p_vpar ); 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 */ /* Parse picture_coding_extension */
DumpBits32( &p_vpar->bit_stream ); 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