Browse Source

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.
pull/2/head
Michel Lespinasse 26 years ago
parent
commit
25f0492374
  1. 2
      Makefile
  2. 11
      include/decoder_fifo.h
  3. 3
      src/ac3_decoder/ac3_decoder.c
  4. 3
      src/audio_decoder/audio_decoder.c
  5. 3
      src/misc/decoder_fifo.c
  6. 3
      src/spu_decoder/spu_decoder.c
  7. 3
      src/video_parser/video_parser.c

2
Makefile

@ -22,7 +22,7 @@ AUDIO += dummy
# Video output settings
VIDEO = x11
VIDEO += fb
#VIDEO += fb
#VIDEO += ggi
#VIDEO += glide
# Not yet supported

11
include/decoder_fifo.h

@ -80,8 +80,10 @@ typedef struct bit_stream_s
*/
/* Current TS packet (in the current PES packet of the PES stream) */
ts_packet_t * p_ts;
/* Index of the next byte that is to be read (in the current TS packet) */
unsigned int i_byte;
/* Pointer to the next byte that is to be read (in the current TS packet) */
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
@ -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 )
{
/* 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 */
decoder_fifo_next( p_bit_stream );
}
return( p_bit_stream->p_ts->buffer[ p_bit_stream->i_byte++ ] );
return( *(p_bit_stream->p_byte++));
}
/*****************************************************************************

3
src/ac3_decoder/ac3_decoder.c

@ -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 );
}
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 );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;

3
src/audio_decoder/audio_decoder.c

@ -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 );
}
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 );
/* Now we look for an audio frame header in the input stream */

3
src/misc/decoder_fifo.c

@ -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 );
/* 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;
}

3
src/spu_decoder/spu_decoder.c

@ -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.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 );
/* Mark thread as running and return */

3
src/video_parser/video_parser.c

@ -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 );
}
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 );
/* Initialize parsing data */

Loading…
Cancel
Save