Commit 36ac163c authored by Sam Hocevar's avatar Sam Hocevar

Le retour du demoronifier qui n'est pas content.

   . 11 moronic long lines destroyed
   . 1282 trailing spaces eradicated
   . 4 ugly macros fixed
   . 5 innocent a_bit_long lines shortened

   . 5987 tabulations transform�es en espaces
   . 153 '??' transform�s en 'XXX??' ou 'FIXME??'
    (ptyx, j'esp�re que ce compromis te convient)

   . commentaires en // corrig�s en /* */
    (je parle bien des commentaires, pas des morceaux de code
     mis en // comme les printf de debug par exemple)

Au passage :

   . version du vlc modifi�e en 0.1.99 (la release sera la 0.2.0)
   . suppression de video_x11.h
   . correction d'un warning dans intf_ctrl.c
parent 3f8bf7fb
...@@ -16,15 +16,15 @@ SHELL=/bin/sh ...@@ -16,15 +16,15 @@ SHELL=/bin/sh
# Audio output settings # Audio output settings
AUDIO = dsp AUDIO = dsp
# Not yet supported # Not yet supported
#AUDIO += esd AUDIO += esd
# Fallback method that should always work # Fallback method that should always work
AUDIO += dummy 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
#VIDEO += beos #VIDEO += beos
#VIDEO += dga #VIDEO += dga
...@@ -59,7 +59,7 @@ DEBUG=0 ...@@ -59,7 +59,7 @@ DEBUG=0
################################################################################ ################################################################################
# Program version - may only be changed by the project leader # Program version - may only be changed by the project leader
PROGRAM_VERSION = 0.95.0 PROGRAM_VERSION = 0.1.99
# audio options # audio options
audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z') audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
......
...@@ -202,14 +202,14 @@ typedef struct audblk_s ...@@ -202,14 +202,14 @@ typedef struct audblk_s
u16 lfefsnroffst; u16 lfefsnroffst;
/* lfe fast gain code */ /* lfe fast gain code */
u16 lfefgaincod; u16 lfefgaincod;
/* Coupling leak info */ /* Coupling leak info */
u16 cplleake; u16 cplleake;
/* coupling fast leak initialization */ /* coupling fast leak initialization */
u16 cplfleak; u16 cplfleak;
/* coupling slow leak initialization */ /* coupling slow leak initialization */
u16 cplsleak; u16 cplsleak;
/* delta bit allocation info */ /* delta bit allocation info */
u16 deltbaie; u16 deltbaie;
/* coupling delta bit allocation exists */ /* coupling delta bit allocation exists */
...@@ -264,7 +264,7 @@ typedef struct audblk_s ...@@ -264,7 +264,7 @@ typedef struct audblk_s
/* Number of coupling exponent groups /* Number of coupling exponent groups
* Derived from cplbegf, cplendf, cplexpstr */ * Derived from cplbegf, cplendf, cplexpstr */
u16 ncplgrps; u16 ncplgrps;
/* End mantissa numbers of fbw channels */ /* End mantissa numbers of fbw channels */
u16 endmant[5]; u16 endmant[5];
...@@ -279,7 +279,7 @@ typedef struct audblk_s ...@@ -279,7 +279,7 @@ typedef struct audblk_s
/* Bit allocation pointer results */ /* Bit allocation pointer results */
u16 fbw_bap[5][256]; u16 fbw_bap[5][256];
//FIXME figure out exactly how many entries there should be (253-37?) /* FIXME?? figure out exactly how many entries there should be (253-37?) */
u16 cpl_bap[256]; u16 cpl_bap[256];
u16 lfe_bap[7]; u16 lfe_bap[7];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define AOUT_DEFAULT_STEREO 1 #define AOUT_DEFAULT_STEREO 1
/* Audio output rate, in Hz */ /* Audio output rate, in Hz */
#define AOUT_MIN_RATE 22050 /* ?? */ #define AOUT_MIN_RATE 22050 /* XXX?? */
#define AOUT_DEFAULT_RATE 44100 #define AOUT_DEFAULT_RATE 44100
#define AOUT_MAX_RATE 48000 #define AOUT_MAX_RATE 48000
......
...@@ -97,7 +97,7 @@ typedef struct video_parser_s * p_video_parser_t; ...@@ -97,7 +97,7 @@ typedef struct video_parser_s * p_video_parser_t;
* byte orders other than little and big endians are not supported, but only * byte orders other than little and big endians are not supported, but only
* the VAX seems to have such exotic properties - note that these 'functions' * the VAX seems to have such exotic properties - note that these 'functions'
* needs <netinet/in.h> or the local equivalent. */ * needs <netinet/in.h> or the local equivalent. */
/* ?? hton64 should be declared as an extern inline function to avoid border /* FIXME??: hton64 should be declared as an extern inline function to avoid border
* effects (see byteorder.h) */ * effects (see byteorder.h) */
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
#define hton16 htons #define hton16 htons
...@@ -114,7 +114,7 @@ typedef struct video_parser_s * p_video_parser_t; ...@@ -114,7 +114,7 @@ typedef struct video_parser_s * p_video_parser_t;
#define ntoh32 ntohl #define ntoh32 ntohl
#define ntoh64(i) ( i ) #define ntoh64(i) ( i )
#else #else
/* ?? cause a compilation error */ /* XXX??: cause a compilation error */
#endif #endif
/* Macros used by input to access the TS buffer */ /* Macros used by input to access the TS buffer */
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* or pictures count won't be available if it not set */ * or pictures count won't be available if it not set */
#define STATS #define STATS
/* Define for unthreaded version of the program - ?? not yet implemented */ /* Define for unthreaded version of the program FIXME: not yet implemented ??*/
//#define NO_THREAD //#define NO_THREAD
/***************************************************************************** /*****************************************************************************
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
/* Automagically spawn input, audio and video threads ? */ /* Automagically spawn input, audio and video threads ? */
// ?? used ? /* XXX?? used ? */
#define AUTO_SPAWN #define AUTO_SPAWN
/* When creating or destroying threads in blocking mode, delay to poll thread /* When creating or destroying threads in blocking mode, delay to poll thread
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
* Input thread configuration * Input thread configuration
*****************************************************************************/ *****************************************************************************/
/* ?? */ /* XXX?? */
#define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ)) #define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
/* /*
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* Macros * Macros
*****************************************************************************/ *****************************************************************************/
/* ?? move to inline functions */ /* FIXME: move to inline functions ??*/
#define DECODER_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end ) #define DECODER_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end )
#define DECODER_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start ) \ #define DECODER_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start ) \
& FIFO_SIZE ) == 0 ) & FIFO_SIZE ) == 0 )
...@@ -80,7 +80,7 @@ typedef struct bit_stream_s ...@@ -80,7 +80,7 @@ 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;
/* Pointer to 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) */
byte_t * p_byte; byte_t * p_byte;
/* Pointer to the last byte that is to be read (in the current TS packet */ /* Pointer to the last byte that is to be read (in the current TS packet */
byte_t * p_end; byte_t * p_end;
...@@ -103,8 +103,8 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream ) ...@@ -103,8 +103,8 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream )
/* could change this test to have a if (! (bytes--)) instead */ /* could change this test to have a if (! (bytes--)) instead */
if ( p_bit_stream->p_byte >= p_bit_stream->p_end ) 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_byte++)); return( *(p_bit_stream->p_byte++));
......
...@@ -95,7 +95,7 @@ typedef struct es_descriptor_t ...@@ -95,7 +95,7 @@ typedef struct es_descriptor_t
u8 i_type; /* stream type */ u8 i_type; /* stream type */
boolean_t b_pcr; /* does the stream include a PCR ? */ boolean_t b_pcr; /* does the stream include a PCR ? */
/* ?? b_pcr will be replaced by something else: since a PCR can't be shared /* XXX?? b_pcr will be replaced by something else: since a PCR can't be shared
* between several ES, we will probably store the PCR fields directly here, * between several ES, we will probably store the PCR fields directly here,
* and one of those fields will probably (again) be used as a test of the * and one of those fields will probably (again) be used as a test of the
* PCR presence */ * PCR presence */
...@@ -119,12 +119,12 @@ typedef struct es_descriptor_t ...@@ -119,12 +119,12 @@ typedef struct es_descriptor_t
* vdec_thread_t. We will use explicit * vdec_thread_t. We will use explicit
* casts. */ * casts. */
/* ?? video stream descriptor ? */ /* XXX?? video stream descriptor ? */
/* ?? audio stream descriptor ? */ /* XXX?? audio stream descriptor ? */
/* ?? hierarchy descriptor ? */ /* XXX?? hierarchy descriptor ? */
/* ?? target background grid descriptor ? */ /* XXX?? target background grid descriptor ? */
/* ?? video window descriptor ? */ /* XXX?? video window descriptor ? */
/* ?? ISO 639 language descriptor ? */ /* XXX?? ISO 639 language descriptor ? */
#ifdef STATS #ifdef STATS
/* Stats */ /* Stats */
...@@ -132,7 +132,7 @@ typedef struct es_descriptor_t ...@@ -132,7 +132,7 @@ typedef struct es_descriptor_t
count_t c_payload_bytes;/* total of payload usefull bytes */ count_t c_payload_bytes;/* total of payload usefull bytes */
count_t c_packets; /* total packets read */ count_t c_packets; /* total packets read */
count_t c_invalid_packets; /* invalid packets read */ count_t c_invalid_packets; /* invalid packets read */
/* ?? ... other stats */ /* XXX?? ... other stats */
#endif #endif
} es_descriptor_t; } es_descriptor_t;
...@@ -173,13 +173,13 @@ typedef struct ...@@ -173,13 +173,13 @@ typedef struct
char* psz_srv_name; char* psz_srv_name;
#endif #endif
/* ?? target background grid descriptor ? */ /* XXX?? target background grid descriptor ? */
/* ?? video window descriptor ? */ /* XXX?? video window descriptor ? */
/* ?? ISO 639 language descriptor ? */ /* XXX?? ISO 639 language descriptor ? */
#ifdef STATS #ifdef STATS
/* Stats */ /* Stats */
/* ?? ...stats */ /* XXX?? ...stats */
#endif #endif
} pgrm_descriptor_t; } pgrm_descriptor_t;
...@@ -241,7 +241,7 @@ typedef struct ...@@ -241,7 +241,7 @@ typedef struct
#ifdef STATS #ifdef STATS
/* Stats */ /* Stats */
/* ?? ...stats */ /* XXX?? ...stats */
#endif #endif
} stream_descriptor_t; } stream_descriptor_t;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_vlan.h: vlan input method * input_vlan.h: vlan input method
* (c)1999 VideoLAN * (c)1999 VideoLAN
***************************************************************************** *****************************************************************************
* ?? * XXX??
***************************************************************************** *****************************************************************************
* Required headers: * Required headers:
* <netinet/in.h> * <netinet/in.h>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/***************************************************************************** /*****************************************************************************
* vdec_thread_t: video decoder thread descriptor * vdec_thread_t: video decoder thread descriptor
***************************************************************************** *****************************************************************************
* ?? * XXX??
*****************************************************************************/ *****************************************************************************/
typedef struct vdec_thread_s typedef struct vdec_thread_s
{ {
...@@ -29,8 +29,7 @@ typedef struct vdec_thread_s ...@@ -29,8 +29,7 @@ typedef struct vdec_thread_s
vlc_thread_t thread_id; /* id for thread functions */ vlc_thread_t thread_id; /* id for thread functions */
/* Thread configuration */ /* Thread configuration */
/* ?? */ /* XXX?? */
/*??*/
// int *pi_status; // int *pi_status;
#ifdef OLD_DECODER #ifdef OLD_DECODER
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
*****************************************************************************/ *****************************************************************************/
#ifdef VDEC_SMP #ifdef VDEC_SMP
/* ?? move to inline functions */ /* FIXME: move to inline functions ??*/
#define VIDEO_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end ) #define VIDEO_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end )
#define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start )\ #define VIDEO_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start )\
& VFIFO_SIZE ) == 0 ) & VFIFO_SIZE ) == 0 )
......
...@@ -166,7 +166,7 @@ typedef struct vout_thread_s ...@@ -166,7 +166,7 @@ typedef struct vout_thread_s
int i_buffer_index; /* buffer index */ int i_buffer_index; /* buffer index */
vout_buffer_t p_buffer[2]; /* buffers properties */ vout_buffer_t p_buffer[2]; /* buffers properties */
/* Videos heap and translation tables */ /* Videos heap and translation tables */
picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */ picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */
subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */ subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */
int i_pictures; /* current heap size */ int i_pictures; /* current heap size */
...@@ -178,7 +178,7 @@ typedef struct vout_thread_s ...@@ -178,7 +178,7 @@ typedef struct vout_thread_s
/* Synchronisation informations - synchro level is updated by the vout /* Synchronisation informations - synchro level is updated by the vout
* thread and read by decoder threads */ * thread and read by decoder threads */
int i_synchro_level; /* trashing level */ int i_synchro_level; /* trashing level */
} vout_thread_t; } vout_thread_t;
/* Flags for changes - these flags are set in the i_changes field when another /* Flags for changes - these flags are set in the i_changes field when another
......
...@@ -60,7 +60,7 @@ typedef struct video_buffer_s ...@@ -60,7 +60,7 @@ typedef struct video_buffer_s
/***************************************************************************** /*****************************************************************************
* vpar_thread_t: video parser thread descriptor * vpar_thread_t: video parser thread descriptor
***************************************************************************** *****************************************************************************
* ?? * XXX??
*****************************************************************************/ *****************************************************************************/
typedef struct vpar_thread_s typedef struct vpar_thread_s
{ {
...@@ -72,8 +72,7 @@ typedef struct vpar_thread_s ...@@ -72,8 +72,7 @@ typedef struct vpar_thread_s
vlc_thread_t thread_id; /* id for thread functions */ vlc_thread_t thread_id; /* id for thread functions */
/* Thread configuration */ /* Thread configuration */
/* ?? */ /* XXX?? */
/*??*/
// int *pi_status; // int *pi_status;
...@@ -143,10 +142,10 @@ vpar_thread_t * vpar_CreateThread ( /* video_cfg_t *p_cfg, */ input_thread ...@@ -143,10 +142,10 @@ vpar_thread_t * vpar_CreateThread ( /* video_cfg_t *p_cfg, */ input_thread
void vpar_DestroyThread ( vpar_thread_t *p_vpar /*, int *pi_status */ ); void vpar_DestroyThread ( vpar_thread_t *p_vpar /*, int *pi_status */ );
/* Time management functions */ /* Time management functions */
/* ?? */ /* XXX?? */
/* Dynamic thread settings */ /* Dynamic thread settings */
/* ?? */ /* XXX?? */
/***************************************************************************** /*****************************************************************************
......
...@@ -59,8 +59,10 @@ static __inline__ int vlc_cond_init ( vlc_cond_t *p_condvar ); ...@@ -59,8 +59,10 @@ static __inline__ int vlc_cond_init ( vlc_cond_t *p_condvar );
static __inline__ int vlc_cond_signal ( vlc_cond_t *p_condvar ); static __inline__ int vlc_cond_signal ( vlc_cond_t *p_condvar );
static __inline__ int vlc_cond_wait ( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex ); static __inline__ int vlc_cond_wait ( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex );
//static _inline__ int vlc_cond_timedwait ( vlc_cond_t * condvar, vlc_mutex_t * mutex, #if 0
// mtime_t absoute_timeout_time ); static _inline__ int vlc_cond_timedwait ( vlc_cond_t * condvar, vlc_mutex_t * mutex,
mtime_t absoute_timeout_time );
#endif
/***************************************************************************** /*****************************************************************************
* vlc_thread_create: create a thread * vlc_thread_create: create a thread
......
...@@ -91,8 +91,8 @@ typedef struct video_synchro_s ...@@ -91,8 +91,8 @@ typedef struct video_synchro_s
int i_coding_type; int i_coding_type;
} video_synchro_t; } video_synchro_t;
#define SYNC_TOLERATE ((int)(0.010*CLOCK_FREQ)) /* 10 ms */ #define SYNC_TOLERATE ((int)(0.010*CLOCK_FREQ)) /* 10 ms */
#define SYNC_DELAY ((int)(0.500*CLOCK_FREQ)) /* 500 ms */ #define SYNC_DELAY ((int)(0.500*CLOCK_FREQ)) /* 500 ms */
#endif #endif
#ifdef POLUX_SYNCHRO #ifdef POLUX_SYNCHRO
...@@ -102,19 +102,19 @@ typedef struct video_synchro_s ...@@ -102,19 +102,19 @@ typedef struct video_synchro_s
typedef struct video_synchro_s typedef struct video_synchro_s
{ {
/* Date Section */ /* Date Section */
/* Dates needed to compute the date of the current frame /* Dates needed to compute the date of the current frame
* We also use the stream frame rate (sequence.r_frame_rate) */ * We also use the stream frame rate (sequence.r_frame_rate) */
mtime_t i_current_frame_date; mtime_t i_current_frame_date;
mtime_t i_backward_frame_date; mtime_t i_backward_frame_date;
/* Frame Trashing Section */ /* Frame Trashing Section */
int i_b_nb, i_p_nb; /* number of decoded P and B between two I */ int i_b_nb, i_p_nb; /* number of decoded P and B between two I */
float r_b_average, r_p_average; float r_b_average, r_p_average;
int i_b_count, i_p_count, i_i_count; int i_b_count, i_p_count, i_i_count;
int i_b_trasher; /* used for brensenham algorithm */ int i_b_trasher; /* used for brensenham algorithm */
} video_synchro_t; } video_synchro_t;
#endif #endif
......
This diff is collapsed.
#include <math.h> #include <math.h>
#include <sys/uio.h> /* "input.h" */ #include <sys/uio.h> /* "input.h" */
#include "common.h"
#include "config.h"
#include "vlc_thread.h"
#include "mtime.h"
#include "input.h"
#include "decoder_fifo.h"
#include "audio_output.h"
#include "ac3_decoder.h" #include "common.h"
#include "ac3_parse.h" #include "config.h"
#include "ac3_exponent.h" #include "vlc_thread.h"
#include "ac3_bit_allocate.h" #include "mtime.h"
#include "ac3_mantissa.h" #include "input.h"
#include "ac3_rematrix.h" #include "decoder_fifo.h"
#include "ac3_imdct.h" #include "audio_output.h"
#include "ac3_downmix.h"
#include "ac3_decoder.h"
#include "ac3_parse.h"
#include "ac3_exponent.h"
#include "ac3_bit_allocate.h"
#include "ac3_mantissa.h"
#include "ac3_rematrix.h"
#include "ac3_imdct.h"
#include "ac3_downmix.h"
int ac3_audio_block (ac3dec_t * p_ac3dec, s16 * buffer) int ac3_audio_block (ac3dec_t * p_ac3dec, s16 * buffer)
{ {
parse_audblk( p_ac3dec ); parse_audblk( p_ac3dec );
exponent_unpack( p_ac3dec ); exponent_unpack( p_ac3dec );
if ( p_ac3dec->b_invalid ) if ( p_ac3dec->b_invalid )
return 1; return 1;
bit_allocate( p_ac3dec ); bit_allocate( p_ac3dec );
mantissa_unpack( p_ac3dec ); mantissa_unpack( p_ac3dec );
if ( p_ac3dec->b_invalid ) if ( p_ac3dec->b_invalid )
return 1; return 1;
if ( p_ac3dec->bsi.acmod == 0x2 ) if ( p_ac3dec->bsi.acmod == 0x2 )
rematrix( p_ac3dec ); rematrix( p_ac3dec );
imdct( p_ac3dec ); imdct( p_ac3dec );
downmix( p_ac3dec, buffer ); downmix( p_ac3dec, buffer );
return 0; return 0;
......
...@@ -146,7 +146,7 @@ static __inline__ int decode_find_sync( ac3dec_thread_t * p_ac3dec ) ...@@ -146,7 +146,7 @@ static __inline__ int decode_find_sync( ac3dec_thread_t * p_ac3dec )
p_ac3dec->ac3_decoder.total_bits_read = 16; p_ac3dec->ac3_decoder.total_bits_read = 16;
return( 0 ); return( 0 );
} }
DumpBits( &(p_ac3dec->ac3_decoder.bit_stream), 1 ); /* XXX */ DumpBits( &(p_ac3dec->ac3_decoder.bit_stream), 1 ); /* XXX?? */
} }
return( -1 ); return( -1 );
} }
...@@ -203,76 +203,76 @@ static void RunThread( ac3dec_thread_t * p_ac3dec ) ...@@ -203,76 +203,76 @@ static void RunThread( ac3dec_thread_t * p_ac3dec )
msleep( INPUT_PTS_DELAY ); msleep( INPUT_PTS_DELAY );
/* Initializing the ac3 decoder thread */ /* Initializing the ac3 decoder thread */
if ( InitThread(p_ac3dec) ) /* XXX */ if ( InitThread(p_ac3dec) ) /* XXX?? */
{ {
p_ac3dec->b_error = 1; p_ac3dec->b_error = 1;
} }
/* ac3 decoder thread's main loop */ /* ac3 decoder thread's main loop */
/* FIXME : do we have enough room to store the decoded frames ? */ /* FIXME : do we have enough room to store the decoded frames ?? */
while ( (!p_ac3dec->b_die) && (!p_ac3dec->b_error) ) while ( (!p_ac3dec->b_die) && (!p_ac3dec->b_error) )
{ {
int i; int i;
p_ac3dec->ac3_decoder.b_invalid = 0; p_ac3dec->ac3_decoder.b_invalid = 0;
decode_find_sync( p_ac3dec ); decode_find_sync( p_ac3dec );
if ( DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts ) if ( DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts )
{ {
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(p_ac3dec->fifo)->i_pts; p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(p_ac3dec->fifo)->i_pts;
DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts = 0; DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts = 0;
} }
else else
{ {
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE; p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE;
} }
parse_syncinfo( &p_ac3dec->ac3_decoder ); parse_syncinfo( &p_ac3dec->ac3_decoder );
switch ( p_ac3dec->ac3_decoder.syncinfo.fscod ) switch ( p_ac3dec->ac3_decoder.syncinfo.fscod )
{ {
case 0: case 0:
p_ac3dec->p_aout_fifo->l_rate = 48000; p_ac3dec->p_aout_fifo->l_rate = 48000;
break; break;
case 1: case 1:
p_ac3dec->p_aout_fifo->l_rate = 44100; p_ac3dec->p_aout_fifo->l_rate = 44100;
break; break;
case 2: case 2:
p_ac3dec->p_aout_fifo->l_rate = 32000; p_ac3dec->p_aout_fifo->l_rate = 32000;
break; break;
default: /* XXX */ default: /* XXX?? */
fprintf( stderr, "ac3dec debug: invalid fscod\n" ); fprintf( stderr, "ac3dec debug: invalid fscod\n" );
p_ac3dec->ac3_decoder.b_invalid = 1; p_ac3dec->ac3_decoder.b_invalid = 1;
break; break;
} }
if ( p_ac3dec->ac3_decoder.b_invalid ) /* XXX */ if ( p_ac3dec->ac3_decoder.b_invalid ) /* XXX?? */
{ {
continue; continue;
} }
parse_bsi( &p_ac3dec->ac3_decoder ); parse_bsi( &p_ac3dec->ac3_decoder );
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
s16 * buffer; s16 * buffer;
buffer = ((ac3dec_frame_t *)p_ac3dec->p_aout_fifo->buffer)[ p_ac3dec->p_aout_fifo->l_end_frame ]; buffer = ((ac3dec_frame_t *)p_ac3dec->p_aout_fifo->buffer)[ p_ac3dec->p_aout_fifo->l_end_frame ];
if (ac3_audio_block (&p_ac3dec->ac3_decoder, buffer)) if (ac3_audio_block (&p_ac3dec->ac3_decoder, buffer))
goto bad_frame; goto bad_frame;
if (i) if (i)
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE; p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE;
vlc_mutex_lock( &p_ac3dec->p_aout_fifo->data_lock ); vlc_mutex_lock( &p_ac3dec->p_aout_fifo->data_lock );
p_ac3dec->p_aout_fifo->l_end_frame = (p_ac3dec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE; p_ac3dec->p_aout_fifo->l_end_frame = (p_ac3dec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal( &p_ac3dec->p_aout_fifo->data_wait ); vlc_cond_signal( &p_ac3dec->p_aout_fifo->data_wait );
vlc_mutex_unlock( &p_ac3dec->p_aout_fifo->data_lock ); vlc_mutex_unlock( &p_ac3dec->p_aout_fifo->data_lock );
} }
parse_auxdata( &p_ac3dec->ac3_decoder ); parse_auxdata( &p_ac3dec->ac3_decoder );
bad_frame: bad_frame:
} }
...@@ -302,7 +302,7 @@ static void ErrorThread( ac3dec_thread_t * p_ac3dec ) ...@@ -302,7 +302,7 @@ static void ErrorThread( ac3dec_thread_t * p_ac3dec )
while( !DECODER_FIFO_ISEMPTY(p_ac3dec->fifo) ) while( !DECODER_FIFO_ISEMPTY(p_ac3dec->fifo) )
{ {
input_NetlistFreePES( p_ac3dec->ac3_decoder.bit_stream.p_input, DECODER_FIFO_START(p_ac3dec->fifo) ); input_NetlistFreePES( p_ac3dec->ac3_decoder.bit_stream.p_input, DECODER_FIFO_START(p_ac3dec->fifo) );
DECODER_FIFO_INCSTART( p_ac3dec->fifo ); DECODER_FIFO_INCSTART( p_ac3dec->fifo );
} }
/* Waiting for the input thread to put new PES packets in the fifo */ /* Waiting for the input thread to put new PES packets in the fifo */
......
This diff is collapsed.
...@@ -31,109 +31,109 @@ static const s16 exps_3[128] = { -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, ...@@ -31,109 +31,109 @@ static const s16 exps_3[128] = { -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1,
static __inline__ void exp_unpack_ch( ac3dec_t * p_ac3dec, u16 type, u16 expstr, u16 ngrps, u16 initial_exp, u16 exps[], u16 * dest ) static __inline__ void exp_unpack_ch( ac3dec_t * p_ac3dec, u16 type, u16 expstr, u16 ngrps, u16 initial_exp, u16 exps[], u16 * dest )
{ {
u16 i,j; u16 i,j;
s16 exp_acc; s16 exp_acc;
if ( expstr == EXP_REUSE ) if ( expstr == EXP_REUSE )
{ {
return; return;
} }
/* Handle the initial absolute exponent */ /* Handle the initial absolute exponent */
exp_acc = initial_exp; exp_acc = initial_exp;
j = 0; j = 0;
/* In the case of a fbw channel then the initial absolute values is /* In the case of a fbw channel then the initial absolute values is
* also an exponent */ * also an exponent */
if ( type != UNPACK_CPL ) if ( type != UNPACK_CPL )
{ {
dest[j++] = exp_acc; dest[j++] = exp_acc;
} }
/* Loop through the groups and fill the dest array appropriately */ /* Loop through the groups and fill the dest array appropriately */
switch ( expstr ) switch ( expstr )
{ {
case EXP_D45: case EXP_D45:
for ( i = 0; i < ngrps; i++ ) for ( i = 0; i < ngrps; i++ )
{ {
if ( exps[i] > 124 ) if ( exps[i] > 124 )
{ {
fprintf( stderr, "ac3dec debug: invalid exponent\n" ); fprintf( stderr, "ac3dec debug: invalid exponent\n" );
p_ac3dec->b_invalid = 1; p_ac3dec->b_invalid = 1;
} }
exp_acc += (exps_1[exps[i]] /*- 2*/); exp_acc += (exps_1[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_2[exps[i]] /*- 2*/); exp_acc += (exps_2[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_3[exps[i]] /*- 2*/); exp_acc += (exps_3[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
} }
break; break;
case EXP_D25: case EXP_D25:
for ( i = 0; i < ngrps; i++ ) for ( i = 0; i < ngrps; i++ )
{ {
if ( exps[i] > 124 ) if ( exps[i] > 124 )
{ {
fprintf( stderr, "ac3dec debug: invalid exponent\n" ); fprintf( stderr, "ac3dec debug: invalid exponent\n" );
p_ac3dec->b_invalid = 1; p_ac3dec->b_invalid = 1;
} }
exp_acc += (exps_1[exps[i]] /*- 2*/); exp_acc += (exps_1[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_2[exps[i]] /*- 2*/); exp_acc += (exps_2[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_3[exps[i]] /*- 2*/); exp_acc += (exps_3[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
dest[j++] = exp_acc; dest[j++] = exp_acc;
} }
break; break;
case EXP_D15: case EXP_D15:
for ( i = 0; i < ngrps; i++ ) for ( i = 0; i < ngrps; i++ )
{ {
if ( exps[i] > 124 ) if ( exps[i] > 124 )
{ {
fprintf( stderr, "ac3dec debug: invalid exponent\n" ); fprintf( stderr, "ac3dec debug: invalid exponent\n" );
p_ac3dec->b_invalid = 1; p_ac3dec->b_invalid = 1;
} }
exp_acc += (exps_1[exps[i]] /*- 2*/); exp_acc += (exps_1[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_2[exps[i]] /*- 2*/); exp_acc += (exps_2[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
exp_acc += (exps_3[exps[i]] /*- 2*/); exp_acc += (exps_3[exps[i]] /*- 2*/);
dest[j++] = exp_acc; dest[j++] = exp_acc;
} }
break; break;
} }
} }
void exponent_unpack( ac3dec_t * p_ac3dec ) void exponent_unpack( ac3dec_t * p_ac3dec )
{ {
u16 i; u16 i;
for ( i = 0; i < p_ac3dec->bsi.nfchans; i++ ) for ( i = 0; i < p_ac3dec->bsi.nfchans; i++ )
{ {
exp_unpack_ch( p_ac3dec, UNPACK_FBW, p_ac3dec->audblk.chexpstr[i], p_ac3dec->audblk.nchgrps[i], p_ac3dec->audblk.exps[i][0], &p_ac3dec->audblk.exps[i][1], p_ac3dec->audblk.fbw_exp[i] ); exp_unpack_ch( p_ac3dec, UNPACK_FBW, p_ac3dec->audblk.chexpstr[i], p_ac3dec->audblk.nchgrps[i], p_ac3dec->audblk.exps[i][0], &p_ac3dec->audblk.exps[i][1], p_ac3dec->audblk.fbw_exp[i] );
} }
if ( p_ac3dec->audblk.cplinu ) if ( p_ac3dec->audblk.cplinu )
{ {
exp_unpack_ch( p_ac3dec, UNPACK_CPL, p_ac3dec->audblk.cplexpstr, p_ac3dec->audblk.ncplgrps, p_ac3dec->audblk.cplabsexp << 1, p_ac3dec->audblk.cplexps, &p_ac3dec->audblk.cpl_exp[p_ac3dec->audblk.cplstrtmant] ); exp_unpack_ch( p_ac3dec, UNPACK_CPL, p_ac3dec->audblk.cplexpstr, p_ac3dec->audblk.ncplgrps, p_ac3dec->audblk.cplabsexp << 1, p_ac3dec->audblk.cplexps, &p_ac3dec->audblk.cpl_exp[p_ac3dec->audblk.cplstrtmant] );
} }
if ( p_ac3dec->bsi.lfeon ) if ( p_ac3dec->bsi.lfeon )
{ {
exp_unpack_ch( p_ac3dec, UNPACK_LFE, p_ac3dec->audblk.lfeexpstr, 2, p_ac3dec->audblk.lfeexps[0], &p_ac3dec->audblk.lfeexps[1], p_ac3dec->audblk.lfe_exp ); exp_unpack_ch( p_ac3dec, UNPACK_LFE, p_ac3dec->audblk.lfeexpstr, 2, p_ac3dec->audblk.lfeexps[0], &p_ac3dec->audblk.lfeexps[1], p_ac3dec->audblk.lfe_exp );
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
/*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738,\ /*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738,\
/*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869,\ /*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869,\
/*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435,\ /*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435,\
/*63*/ 0.0 /* ?? invalid scale factor ?? */ \ /*63*/ 0.0 /* XXX?? invalid scale factor ? */ \
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* "vlc_thread.h" * "vlc_thread.h"
* "input.h" * "input.h"
* "decoder_fifo.h" * "decoder_fifo.h"
* ?? * XXX??
*****************************************************************************/ *****************************************************************************/
/***************************************************************************** /*****************************************************************************
...@@ -50,13 +50,13 @@ typedef struct gdec_thread_s ...@@ -50,13 +50,13 @@ typedef struct gdec_thread_s
input_thread_t * p_input; /* input thread */ input_thread_t * p_input; /* input thread */
decoder_fifo_t fifo; /* PES input fifo */ decoder_fifo_t fifo; /* PES input fifo */
/* ?? status info */ /* XXX?? status info */
int * pi_status; int * pi_status;
/* Files array - these files are used to extract ES streams from a /* Files array - these files are used to extract ES streams from a
* demultiplexed stream */ * demultiplexed stream */
/* ?? */ /* XXX?? */
#ifdef STATS #ifdef STATS
/* Statistics */ /* Statistics */
...@@ -83,7 +83,7 @@ gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg, ...@@ -83,7 +83,7 @@ gdec_thread_t * gdec_CreateThread ( gdec_cfg_t *p_cfg,
void gdec_DestroyThread ( gdec_thread_t *p_gdec, int *pi_status ); void gdec_DestroyThread ( gdec_thread_t *p_gdec, int *pi_status );
/* Time management functions */ /* Time management functions */
/* ?? */ /* XXX?? */
/* Dynamic thread settings */ /* Dynamic thread settings */
/* ?? */ /* XXX?? */
This diff is collapsed.
...@@ -173,7 +173,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id ) ...@@ -173,7 +173,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
p_input->p_es[i_es_loop].p_pes_packet = NULL; p_input->p_es[i_es_loop].p_pes_packet = NULL;
p_input->p_es[i_es_loop].i_continuity_counter = 0xff; p_input->p_es[i_es_loop].i_continuity_counter = 0xff;
p_input->p_es[i_es_loop].b_random = 0; p_input->p_es[i_es_loop].b_random = 0;
/* Mark stream to be demultiplexed. */ /* Mark stream to be demultiplexed. */
intf_DbgMsg("Stream %d added in %d\n", i_current_id, i_selected_es_loop); intf_DbgMsg("Stream %d added in %d\n", i_current_id, i_selected_es_loop);
p_input->pp_selected_es[i_selected_es_loop] = &p_input->p_es[i_es_loop]; p_input->pp_selected_es[i_selected_es_loop] = &p_input->p_es[i_es_loop];
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*****************************************************************************/ *****************************************************************************/
int input_FileOpen( input_thread_t *p_input ) int input_FileOpen( input_thread_t *p_input )
{ {
//?? /* XXX?? */
return( 1 ); return( 1 );
} }
...@@ -32,7 +32,7 @@ int input_FileOpen( input_thread_t *p_input ) ...@@ -32,7 +32,7 @@ int input_FileOpen( input_thread_t *p_input )
int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
size_t i_count ) size_t i_count )
{ {
//?? /* XXX?? */
return( -1 ); return( -1 );
} }
...@@ -41,5 +41,5 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, ...@@ -41,5 +41,5 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
*****************************************************************************/ *****************************************************************************/
void input_FileClose( input_thread_t *p_input ) void input_FileClose( input_thread_t *p_input )
{ {
//?? /* XXX?? */
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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