Commit 25f04923 authored by Michel Lespinasse's avatar Michel Lespinasse

Modification du decoder_fifo : le GetByte devrait etre un chouilla plus rapide,

ce qui devrait au minimum compenser la perte due a ma derniere modification.
parent 2f2ce6f4
...@@ -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
......
...@@ -80,8 +80,10 @@ typedef struct bit_stream_s ...@@ -80,8 +80,10 @@ typedef struct bit_stream_s
*/ */
/* Current TS packet (in the current PES packet of the PES stream) */ /* Current TS packet (in the current PES packet of the PES stream) */
ts_packet_t * p_ts; ts_packet_t * p_ts;
/* Index of the next byte that is to be read (in the current TS packet) */ /* Pointer to the next byte that is to be read (in the current TS packet) */
unsigned int i_byte; byte_t * p_byte;
/* Pointer to the last byte that is to be read (in the current TS packet */
byte_t * p_end;
/* /*
* Bit structures * Bit structures
...@@ -98,13 +100,14 @@ void decoder_fifo_next( bit_stream_t * p_bit_stream ); ...@@ -98,13 +100,14 @@ void decoder_fifo_next( bit_stream_t * p_bit_stream );
static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream ) static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream )
{ {
/* Are there some bytes left in the current TS packet ? */ /* Are there some bytes left in the current TS packet ? */
if ( p_bit_stream->i_byte >= p_bit_stream->p_ts->i_payload_end ) /* could change this test to have a if (! (bytes--)) instead */
if ( p_bit_stream->p_byte >= p_bit_stream->p_end )
{ {
/* no, switch to next TS packet */ /* no, switch to next TS packet */
decoder_fifo_next( p_bit_stream ); decoder_fifo_next( p_bit_stream );
} }
return( p_bit_stream->p_ts->buffer[ p_bit_stream->i_byte++ ] ); return( *(p_bit_stream->p_byte++));
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -177,7 +177,8 @@ static int InitThread( ac3dec_thread_t * p_ac3dec ) ...@@ -177,7 +177,8 @@ static int InitThread( ac3dec_thread_t * p_ac3dec )
vlc_cond_wait( &p_ac3dec->fifo.data_wait, &p_ac3dec->fifo.data_lock ); vlc_cond_wait( &p_ac3dec->fifo.data_wait, &p_ac3dec->fifo.data_lock );
} }
p_ac3dec->bit_stream.p_ts = DECODER_FIFO_START( p_ac3dec->fifo )->p_first_ts; p_ac3dec->bit_stream.p_ts = DECODER_FIFO_START( p_ac3dec->fifo )->p_first_ts;
p_ac3dec->bit_stream.i_byte = p_ac3dec->bit_stream.p_ts->i_payload_start; p_ac3dec->bit_stream.p_byte = p_ac3dec->bit_stream.p_ts->buffer + p_ac3dec->bit_stream.p_ts->i_payload_start;
p_ac3dec->bit_stream.p_end = p_ac3dec->bit_stream.p_ts->buffer + p_ac3dec->bit_stream.p_ts->i_payload_end;
vlc_mutex_unlock( &p_ac3dec->fifo.data_lock ); vlc_mutex_unlock( &p_ac3dec->fifo.data_lock );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO; aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
......
...@@ -721,7 +721,8 @@ static int InitThread( adec_thread_t * p_adec ) ...@@ -721,7 +721,8 @@ static int InitThread( adec_thread_t * p_adec )
vlc_cond_wait( &p_adec->fifo.data_wait, &p_adec->fifo.data_lock ); vlc_cond_wait( &p_adec->fifo.data_wait, &p_adec->fifo.data_lock );
} }
p_adec->bit_stream.p_ts = DECODER_FIFO_START( p_adec->fifo )->p_first_ts; p_adec->bit_stream.p_ts = DECODER_FIFO_START( p_adec->fifo )->p_first_ts;
p_adec->bit_stream.i_byte = p_adec->bit_stream.p_ts->i_payload_start; p_adec->bit_stream.p_byte = p_adec->bit_stream.p_ts->buffer + p_adec->bit_stream.p_ts->i_payload_start;
p_adec->bit_stream.p_end = p_adec->bit_stream.p_ts->buffer + p_adec->bit_stream.p_ts->i_payload_end;
vlc_mutex_unlock( &p_adec->fifo.data_lock ); vlc_mutex_unlock( &p_adec->fifo.data_lock );
/* Now we look for an audio frame header in the input stream */ /* Now we look for an audio frame header in the input stream */
......
...@@ -71,5 +71,6 @@ void decoder_fifo_next( bit_stream_t * p_bit_stream ) ...@@ -71,5 +71,6 @@ void decoder_fifo_next( bit_stream_t * p_bit_stream )
} while ( p_bit_stream->p_ts->i_payload_start == p_bit_stream->p_ts->i_payload_end ); } while ( p_bit_stream->p_ts->i_payload_start == p_bit_stream->p_ts->i_payload_end );
/* We've found a TS packet which contains interesting data... */ /* We've found a TS packet which contains interesting data... */
p_bit_stream->i_byte = p_bit_stream->p_ts->i_payload_start; p_bit_stream->p_byte = p_bit_stream->p_ts->buffer + p_bit_stream->p_ts->i_payload_start;
p_bit_stream->p_end = p_bit_stream->p_ts->buffer + p_bit_stream->p_ts->i_payload_end;
} }
...@@ -141,7 +141,8 @@ static int InitThread( spudec_thread_t *p_spudec ) ...@@ -141,7 +141,8 @@ static int InitThread( spudec_thread_t *p_spudec )
} }
p_spudec->bit_stream.p_ts = DECODER_FIFO_START( p_spudec->fifo )->p_first_ts; p_spudec->bit_stream.p_ts = DECODER_FIFO_START( p_spudec->fifo )->p_first_ts;
p_spudec->bit_stream.i_byte = p_spudec->bit_stream.p_ts->i_payload_start; p_spudec->bit_stream.p_byte = p_spudec->bit_stream.p_ts->buffer + p_spudec->bit_stream.p_ts->i_payload_start;
p_spudec->bit_stream.p_end = p_spudec->bit_stream.p_ts->buffer + p_spudec->bit_stream.p_ts->i_payload_end;
vlc_mutex_unlock( &p_spudec->fifo.data_lock ); vlc_mutex_unlock( &p_spudec->fifo.data_lock );
/* Mark thread as running and return */ /* Mark thread as running and return */
......
...@@ -181,7 +181,8 @@ static int InitThread( vpar_thread_t *p_vpar ) ...@@ -181,7 +181,8 @@ static int InitThread( vpar_thread_t *p_vpar )
vlc_cond_wait( &p_vpar->fifo.data_wait, &p_vpar->fifo.data_lock ); vlc_cond_wait( &p_vpar->fifo.data_wait, &p_vpar->fifo.data_lock );
} }
p_vpar->bit_stream.p_ts = DECODER_FIFO_START( p_vpar->fifo )->p_first_ts; p_vpar->bit_stream.p_ts = DECODER_FIFO_START( p_vpar->fifo )->p_first_ts;
p_vpar->bit_stream.i_byte = p_vpar->bit_stream.p_ts->i_payload_start; p_vpar->bit_stream.p_byte = p_vpar->bit_stream.p_ts->buffer + p_vpar->bit_stream.p_ts->i_payload_start;
p_vpar->bit_stream.p_end = p_vpar->bit_stream.p_ts->buffer + p_vpar->bit_stream.p_ts->i_payload_end;
vlc_mutex_unlock( &p_vpar->fifo.data_lock ); vlc_mutex_unlock( &p_vpar->fifo.data_lock );
/* Initialize parsing data */ /* Initialize parsing data */
......
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