Commit 2ad5fa64 authored by Sam Hocevar's avatar Sam Hocevar

Je vous avais pr�venu. Le demoronifier a frapp�.

 D�sol� pour le flood. Les en-t�tes de fonctions ne font plus 81
caract�res, et il n'y a plus d'espaces inutiles, Tous les trailing
spaces ont disparu, j'ai essay� de v�rifier que �a ne p�tait rien,
mais j'ai pu oublier un truc con. J'accepte tous types de ch�timents
� base d'orties fra�ches.

 D�sol� d'avoir aussi modifi� les fichiers de ceux qui formataient
bien proprement leurs en-t�tes � 80 et pas 79 sans emb�ter personne,
mais j'ai d� choisir entre les deux.

 Dor�navant ce serait bien de formater les en-t�tes et les commentaires
justifi�s � droite � 79 colonnes, ou au pire � 80.

 . 1343 moronic long lines destroyed
 . 12893 trailing spaces eradicated
 . 115 ugly macros fixed
 . 959 innocent a_bit_long lines shortened
 But hey, 40054 lines were OK !
parent db2b7d18
......@@ -279,7 +279,7 @@ typedef struct audblk_s
/* Bit allocation pointer results */
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 lfe_bap[7];
......
/******************************************************************************
/*****************************************************************************
* audio_constants.h : defines the MPEG1 Layer I-II audio constants and tables
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* 32 bits (4 bytes) audio frame header definitions
******************************************************************************/
*****************************************************************************/
/*
* syncword == `1111 1111 1111'
*/
......@@ -91,9 +91,9 @@
#define ADEC_HEADER_EMPHASIS_SHIFT 0
/******************************************************************************
/*****************************************************************************
* frame sizes = f( layer, padding_bit, sampling_frequency, bitrate_index )
******************************************************************************
*****************************************************************************
* ISO/IEC 11172-3 2.4.3.1 explains how to find out the number of bytes between
* two consecutive syncwords. In order to work out the body size of the frame,
* we just have to substract 4 bytes for the header size.
......@@ -112,7 +112,7 @@
*
* The frame sizes are stored in the following array :
* frame_size = ADEC_FRAME_SIZE[ 128*layer + 64*padding_bit + 16*sampling_frequency + bitrate_index ]
******************************************************************************/
*****************************************************************************/
#if 0
#define ADEC_FRAME_SIZE \
{ \
......@@ -218,41 +218,41 @@
#endif
/******************************************************************************
/*****************************************************************************
* scale factors = f( scalefactor ) (Layer I & II, see ISO/IEC 11172-3 2.4.1)
******************************************************************************
*****************************************************************************
* Theses values are 2^(1 - index/3) (see ISO/IEC 11172-3 2.4.2.5)
******************************************************************************/
*****************************************************************************/
#define ADEC_SCALE_FACTOR \
{ \
/* 0*/ 2.00000000000000, /* 1*/ 1.58740105196820, /* 2*/ 1.25992104989487, \
/* 3*/ 1.00000000000000, /* 4*/ 0.79370052598410, /* 5*/ 0.62996052494744, \
/* 6*/ 0.50000000000000, /* 7*/ 0.39685026299205, /* 8*/ 0.31498026247372, \
/* 9*/ 0.25000000000000, /*10*/ 0.19842513149602, /*11*/ 0.15749013123686, \
/*12*/ 0.12500000000000, /*13*/ 0.09921256574801, /*14*/ 0.07874506561843, \
/*15*/ 0.06250000000000, /*16*/ 0.04960628287401, /*17*/ 0.03937253280921, \
/*18*/ 0.03125000000000, /*19*/ 0.02480314143700, /*20*/ 0.01968626640461, \
/*21*/ 0.01562500000000, /*22*/ 0.01240157071850, /*23*/ 0.00984313320230, \
/*24*/ 0.00781250000000, /*25*/ 0.00620078535925, /*26*/ 0.00492156660115, \
/*27*/ 0.00390625000000, /*28*/ 0.00310039267963, /*29*/ 0.00246078330058, \
/*30*/ 0.00195312500000, /*31*/ 0.00155019633981, /*32*/ 0.00123039165029, \
/*33*/ 0.00097656250000, /*34*/ 0.00077509816991, /*35*/ 0.00061519582514, \
/*36*/ 0.00048828125000, /*37*/ 0.00038754908495, /*38*/ 0.00030759791257, \
/*39*/ 0.00024414062500, /*40*/ 0.00019377454248, /*41*/ 0.00015379895629, \
/*42*/ 0.00012207031250, /*43*/ 0.00009688727124, /*44*/ 0.00007689947814, \
/*45*/ 0.00006103515625, /*46*/ 0.00004844363562, /*47*/ 0.00003844973907, \
/*48*/ 0.00003051757813, /*49*/ 0.00002422181781, /*50*/ 0.00001922486954, \
/*51*/ 0.00001525878906, /*52*/ 0.00001211090890, /*53*/ 0.00000961243477, \
/*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738, \
/*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869, \
/*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435, \
/* 0*/ 2.00000000000000, /* 1*/ 1.58740105196820, /* 2*/ 1.25992104989487,\
/* 3*/ 1.00000000000000, /* 4*/ 0.79370052598410, /* 5*/ 0.62996052494744,\
/* 6*/ 0.50000000000000, /* 7*/ 0.39685026299205, /* 8*/ 0.31498026247372,\
/* 9*/ 0.25000000000000, /*10*/ 0.19842513149602, /*11*/ 0.15749013123686,\
/*12*/ 0.12500000000000, /*13*/ 0.09921256574801, /*14*/ 0.07874506561843,\
/*15*/ 0.06250000000000, /*16*/ 0.04960628287401, /*17*/ 0.03937253280921,\
/*18*/ 0.03125000000000, /*19*/ 0.02480314143700, /*20*/ 0.01968626640461,\
/*21*/ 0.01562500000000, /*22*/ 0.01240157071850, /*23*/ 0.00984313320230,\
/*24*/ 0.00781250000000, /*25*/ 0.00620078535925, /*26*/ 0.00492156660115,\
/*27*/ 0.00390625000000, /*28*/ 0.00310039267963, /*29*/ 0.00246078330058,\
/*30*/ 0.00195312500000, /*31*/ 0.00155019633981, /*32*/ 0.00123039165029,\
/*33*/ 0.00097656250000, /*34*/ 0.00077509816991, /*35*/ 0.00061519582514,\
/*36*/ 0.00048828125000, /*37*/ 0.00038754908495, /*38*/ 0.00030759791257,\
/*39*/ 0.00024414062500, /*40*/ 0.00019377454248, /*41*/ 0.00015379895629,\
/*42*/ 0.00012207031250, /*43*/ 0.00009688727124, /*44*/ 0.00007689947814,\
/*45*/ 0.00006103515625, /*46*/ 0.00004844363562, /*47*/ 0.00003844973907,\
/*48*/ 0.00003051757813, /*49*/ 0.00002422181781, /*50*/ 0.00001922486954,\
/*51*/ 0.00001525878906, /*52*/ 0.00001211090890, /*53*/ 0.00000961243477,\
/*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738,\
/*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869,\
/*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435,\
/*63*/ 0.0 /* ?? invalid scale factor ?? */ \
}
/******************************************************************************
/*****************************************************************************
* Layer I definitions
******************************************************************************/
*****************************************************************************/
/*
* slope table = f( allocation[ch][sb] (see ISO/IEC 11171-3 2.4.1) )
......@@ -301,9 +301,9 @@
}
/******************************************************************************
/*****************************************************************************
* Layer II definitions
******************************************************************************/
*****************************************************************************/
/*
* Bitrate PER CHANNEL index = f( mode, bitrate_index )
......@@ -1307,102 +1307,102 @@
*/
#define ADEC_LAYER2_REQUANTIZATION_CD \
{ \
{ 0, NULL, .0 , .0 }, /* allocation == 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation == 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation == 2 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation == 3 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation == 4 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation == 5 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation == 6 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation == 7 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation == 8 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation == 9 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation == 10 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation == 11 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation == 12 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation == 13 */ \
{14, NULL, .000122077763535 , -.999938961117}, /* allocation == 14 */ \
{15, NULL, .000061037018952 , -.999969481491} /* allocation == 15 */ \
{ 0, NULL, .0 , .0 }, /* allocation 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation 3 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation 4 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation 5 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation 6 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation 7 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation 8 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation 9 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation 10 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation 11 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation 12 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation 13 */ \
{14, NULL, .000122077763535 , -.999938961117}, /* allocation 14 */ \
{15, NULL, .000061037018952 , -.999969481491} /* allocation 15 */ \
}
#define ADEC_LAYER2_REQUANTIZATION_AB1 \
{ \
{ 0, NULL, .0 , .0 }, /* allocation == 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation == 1 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation == 2 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation == 3 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation == 4 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation == 5 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation == 6 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation == 7 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation == 8 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation == 9 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation == 10 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation == 11 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation == 12 */ \
{14, NULL, .000122077763535 , -.999938961117}, /* allocation == 13 */ \
{15, NULL, .000061037018952 , -.999969481491}, /* allocation == 14 */ \
{16, NULL, .0000305180437933, -.999984740976} /* allocation == 15 */ \
{ 0, NULL, .0 , .0 }, /* allocation 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation 2 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation 3 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation 4 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation 5 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation 6 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation 7 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation 8 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation 9 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation 10 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation 11 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation 12 */ \
{14, NULL, .000122077763535 , -.999938961117}, /* allocation 13 */ \
{15, NULL, .000061037018952 , -.999969481491}, /* allocation 14 */ \
{16, NULL, .0000305180437933, -.999984740976} /* allocation 15 */ \
}
#define ADEC_LAYER2_REQUANTIZATION_AB2 \
{ \
{ 0, NULL, .0 , .0 }, /* allocation == 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation == 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation == 2 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation == 3 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation == 4 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation == 5 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation == 6 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation == 7 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation == 8 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation == 9 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation == 10 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation == 11 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation == 12 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation == 13 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation == 14 */ \
{16, NULL, .0000305180437933, -.999984740976} /* allocation == 15 */ \
{ 0, NULL, .0 , .0 }, /* allocation 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation 3 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation 4 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation 5 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation 6 */ \
{ 6, NULL, .0317460317459 , -.984126984124}, /* allocation 7 */ \
{ 7, NULL, .0157480314961 , -.992125984254}, /* allocation 8 */ \
{ 8, NULL, .00784313725492 , -.996078431375}, /* allocation 9 */ \
{ 9, NULL, .00391389432484 , -.998043052835}, /* allocation 10 */ \
{10, NULL, .00195503421311 , -.999022482897}, /* allocation 11 */ \
{11, NULL, .000977039570107 , -.99951148022 }, /* allocation 12 */ \
{12, NULL, .000488400488398 , -.999755799752}, /* allocation 13 */ \
{13, NULL, .000244170430962 , -.999877914789}, /* allocation 14 */ \
{16, NULL, .0000305180437933, -.999984740976} /* allocation 15 */ \
}
#define ADEC_LAYER2_REQUANTIZATION_AB3 \
{ \
{ 0, NULL, .0 , .0 }, /* allocation == 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation == 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation == 2 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation == 3 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation == 4 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation == 5 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation == 6 */ \
{16, NULL, .0000305180437933, -.999984740976}, /* allocation == 7 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 8 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 9 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 10 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 11 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 12 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 13 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 14 */ \
{ 0, NULL, .0 , .0 } /* allocation == 15 */ \
{ 0, NULL, .0 , .0 }, /* allocation 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
{ 3, NULL, .285714285715 , -.857142857145}, /* allocation 3 */ \
{10, pf_ungroup9, .0 , .0 }, /* allocation 4 */ \
{ 4, NULL, .133333333332 , -.933333333328}, /* allocation 5 */ \
{ 5, NULL, .0645161290325 , -.967741935488}, /* allocation 6 */ \
{16, NULL, .0000305180437933, -.999984740976}, /* allocation 7 */ \
{ 0, NULL, .0 , .0 }, /* allocation 8 */ \
{ 0, NULL, .0 , .0 }, /* allocation 9 */ \
{ 0, NULL, .0 , .0 }, /* allocation 10 */ \
{ 0, NULL, .0 , .0 }, /* allocation 11 */ \
{ 0, NULL, .0 , .0 }, /* allocation 12 */ \
{ 0, NULL, .0 , .0 }, /* allocation 13 */ \
{ 0, NULL, .0 , .0 }, /* allocation 14 */ \
{ 0, NULL, .0 , .0 } /* allocation 15 */ \
}
#define ADEC_LAYER2_REQUANTIZATION_AB4 \
{ \
{ 0, NULL, .0 , .0 }, /* allocation == 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation == 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation == 2 */ \
{16, NULL, .0000305180437933, -.999984740976}, /* allocation == 3 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 4 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 5 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 6 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 7 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 8 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 9 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 10 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 11 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 12 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 13 */ \
{ 0, NULL, .0 , .0 }, /* allocation == 14 */ \
{ 0, NULL, .0 , .0 } /* allocation == 15 */ \
{ 0, NULL, .0 , .0 }, /* allocation 0 */ \
{ 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
{ 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
{16, NULL, .0000305180437933, -.999984740976}, /* allocation 3 */ \
{ 0, NULL, .0 , .0 }, /* allocation 4 */ \
{ 0, NULL, .0 , .0 }, /* allocation 5 */ \
{ 0, NULL, .0 , .0 }, /* allocation 6 */ \
{ 0, NULL, .0 , .0 }, /* allocation 7 */ \
{ 0, NULL, .0 , .0 }, /* allocation 8 */ \
{ 0, NULL, .0 , .0 }, /* allocation 9 */ \
{ 0, NULL, .0 , .0 }, /* allocation 10 */ \
{ 0, NULL, .0 , .0 }, /* allocation 11 */ \
{ 0, NULL, .0 , .0 }, /* allocation 12 */ \
{ 0, NULL, .0 , .0 }, /* allocation 13 */ \
{ 0, NULL, .0 , .0 }, /* allocation 14 */ \
{ 0, NULL, .0 , .0 } /* allocation 15 */ \
}
#define ADEC_LAYER2_REQUANTIZATION_AB \
......
/******************************************************************************
/*****************************************************************************
* audio_decoder.h : audio decoder thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* = Prototyped functions are implemented in audio_decoder/audio_decoder.c
*
* = Required headers :
......@@ -16,7 +16,7 @@
*
* = - MSb = Most Significant bit
* - MSB = Most Significant Byte
******************************************************************************/
*****************************************************************************/
/*
* TODO :
......@@ -28,14 +28,14 @@
#define ADEC_FRAME_SIZE 384
/******************************************************************************
/*****************************************************************************
* adec_frame_t
******************************************************************************/
*****************************************************************************/
typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
/******************************************************************************
/*****************************************************************************
* adec_bank_t
******************************************************************************/
*****************************************************************************/
typedef struct adec_bank_s
{
float v1[512];
......@@ -45,24 +45,24 @@ typedef struct adec_bank_s
} adec_bank_t;
/******************************************************************************
/*****************************************************************************
* adec_thread_t : audio decoder thread descriptor
******************************************************************************
*****************************************************************************
* This type describes an audio decoder thread
******************************************************************************/
*****************************************************************************/
typedef struct adec_thread_s
{
/*
* Thread properties
*/
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
vlc_thread_t thread_id; /* id for thread functions */
boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */
/*
* Input properties
*/
decoder_fifo_t fifo; /* stores the PES stream data */
decoder_fifo_t fifo; /* stores the PES stream data */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
......@@ -75,13 +75,13 @@ typedef struct adec_thread_s
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} adec_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
void adec_DestroyThread ( adec_thread_t * p_adec );
/******************************************************************************
/*****************************************************************************
* audio_dsp.h : header of the dsp functions library
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - "common.h" ( byte_t )
* - "audio_output.h" ( aout_dsp_t )
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
int aout_dspOpen ( aout_dsp_t *p_dsp );
int aout_dspReset ( aout_dsp_t *p_dsp );
int aout_dspSetFormat ( aout_dsp_t *p_dsp );
......
/******************************************************************************
/*****************************************************************************
* audio_math.h : PCM and DCT
* (c)1999 VideoLAN
******************************************************************************/
*****************************************************************************/
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
void DCT32(float *x, adec_bank_t *b);
void PCM(adec_bank_t *b, s16 **pcm, int jump);
/******************************************************************************
/*****************************************************************************
* audio_output.h : audio output thread interface
* (c)1999 VideoLAN
******************************************************************************
*****************************************************************************
* Required headers:
* - <sys/soundcard.h> ( audio_buf_info )
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "vlc_thread.h" ( vlc_thread_t )
******************************************************************************/
*****************************************************************************/
/* TODO :
*
......@@ -59,9 +59,9 @@
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).i_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/******************************************************************************
/*****************************************************************************
* aout_dsp_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* Path to the audio output device (default is set to "/dev/dsp") */
......@@ -81,13 +81,13 @@ typedef struct
} aout_dsp_t;
/******************************************************************************
/*****************************************************************************
* aout_increment_t
******************************************************************************
*****************************************************************************
* This structure is used to keep the progression of an index up-to-date, in
* order to avoid rounding problems and heavy computations, as the function
* that handles this structure only uses additions.
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* The remainder is used to keep track of the fractional part of the
......@@ -109,9 +109,9 @@ typedef struct
} aout_increment_t;
/******************************************************************************
/*****************************************************************************
* aout_fifo_t
******************************************************************************/
*****************************************************************************/
typedef struct
{
/* See the fifo types below */
......@@ -155,9 +155,9 @@ typedef struct
#define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4
/******************************************************************************
/*****************************************************************************
* aout_thread_t
******************************************************************************/
*****************************************************************************/
typedef struct aout_thread_s
{
vlc_thread_t thread_id;
......@@ -184,9 +184,9 @@ typedef struct aout_thread_s
} aout_thread_t;
/******************************************************************************
/*****************************************************************************
* Prototypes
******************************************************************************/
*****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout, int *pi_status );
......
/*******************************************************************************
/*****************************************************************************
* common.h: common definitions
* (c)1998 VideoLAN
*******************************************************************************
*****************************************************************************
* Collection of usefull common types and macros definitions
*******************************************************************************
*****************************************************************************
* required headers:
* config.h
*******************************************************************************/
*****************************************************************************/
/*******************************************************************************
/*****************************************************************************
* Basic types definitions
*******************************************************************************/
*****************************************************************************/
/* Basic types definitions */
typedef signed char s8;
......@@ -23,16 +23,16 @@ typedef unsigned int u32;
typedef unsigned long long u64;
typedef u8 byte_t;
/* Boolean type */
typedef int boolean_t;
/* Counter for statistics and profiling */
typedef unsigned long count_t;
/*******************************************************************************
/*****************************************************************************
* Classes declaration
*******************************************************************************/
*****************************************************************************/
/* Interface */
struct intf_thread_s;
......@@ -76,9 +76,9 @@ typedef struct vdec_thread_s * p_vdec_thread_t;
typedef struct vpar_thread_s * p_vpar_thread_t;
typedef struct video_parser_s * p_video_parser_t;
/*******************************************************************************
/*****************************************************************************
* Macros and inline functions
*******************************************************************************/
*****************************************************************************/
/* CEIL: division with round to nearest greater integer */
#define CEIL(n, d) ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
......@@ -90,7 +90,7 @@ typedef struct video_parser_s * p_video_parser_t;
#define MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
#define MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
/* MSB (big endian)/LSB (little endian) convertions - network order is always
/* MSB (big endian)/LSB (little endian) convertions - network order is always
* MSB, and should be used for both network communications and files. Note that
* 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'
......@@ -101,13 +101,13 @@ typedef struct video_parser_s * p_video_parser_t;
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
#define ntoh16 ntohs
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64 hton64
#elif __BYTE_ORDER == __BIG_ENDIAN
#define hton16 htons
#define hton32 htonl
#define hton64(i) ( i )
#define hton64(i) ( i )
#define ntoh16 ntohs
#define ntoh32 ntohl
#define ntoh64(i) ( i )
......
/*******************************************************************************
/*****************************************************************************
* config.h: limits and configuration
* (c)1999 VideoLAN
*******************************************************************************
*****************************************************************************
* Defines all compilation-time configuration constants and size limits
*******************************************************************************/
*****************************************************************************/
/* Conventions regarding names of symbols and variables
* ----------------------------------------------------
......@@ -11,17 +11,17 @@
* - Symbols should begin with a prefix indicating in which module they are
* used, such as INTF_, VOUT_ or ADEC_.
*
* - Regarding environment variables, which are used as initialization parameters
* - Regarding environment variables, which are used as initialization parameters
* for threads :
* + variable names should end with '_VAR'
* + environment variable default value should end with '_DEFAULT'
* + values having a special meaning with '_VAL'
*
* + values having a special meaning with '_VAL'
*
*/
/*******************************************************************************
/*****************************************************************************
* Program information
*******************************************************************************/
*****************************************************************************/
/* Program version and copyright message */
#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
......@@ -29,9 +29,9 @@
"version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
"compilation options: " PROGRAM_OPTIONS
/*******************************************************************************
/*****************************************************************************
* General compilation options
*******************************************************************************/
*****************************************************************************/
/* Define for DVB support - Note that some extensions or restrictions may be
* incompatible with native MPEG2 streams */
......@@ -50,9 +50,9 @@
/* Define for unthreaded version of the program - ?? not yet implemented */
//#define NO_THREAD
/*******************************************************************************
/*****************************************************************************
* Debugging options - define or undefine symbols
*******************************************************************************/
*****************************************************************************/
#ifdef DEBUG
/* General debugging support, which depends of the DEBUG define, is determined
* in the Makefile */
......@@ -72,9 +72,9 @@
#endif
/*******************************************************************************
/*****************************************************************************
* General configuration
*******************************************************************************/
*****************************************************************************/
/* Automagically spawn input, audio and video threads ? */
// ?? used ?
......@@ -92,9 +92,9 @@
#define FIFO_SIZE 1023
/*******************************************************************************
/*****************************************************************************
* Interface configuration
*******************************************************************************/
*****************************************************************************/
/* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR "vlc_init"
......@@ -118,9 +118,9 @@
/* Title of the X11 window */
#define VOUT_TITLE "VideoLAN Client"
/*******************************************************************************
/*****************************************************************************
* Input thread configuration
*******************************************************************************/
*****************************************************************************/
/* ?? */
#define INPUT_IDLE_SLEEP 100000
......@@ -152,7 +152,7 @@
* INPUT_MAX_TS + 1 must be a power of 2, to optimize the %(INPUT_MAX_TS+1)
* operation with a &INPUT_MAX_TS in the case of a fifo netlist.
* It should be > number of fifos * FIFO_SIZE to avoid input deadlock. */
#define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
#define INPUT_MAX_TS 32767 /* INPUT_MAX_TS + 1 = 2^15 */
/* Same thing with PES packets */
#define INPUT_MAX_PES 16383
......@@ -181,8 +181,8 @@
#define INPUT_PORT_DEFAULT 1234
/*
* Vlan method
*/
* Vlan method
*/
/* Default network interface and environment variable */
#define INPUT_IFACE_VAR "vlc_iface"
......@@ -194,7 +194,7 @@
#define INPUT_VLAN_PORT_VAR "vlc_vlan_port"
#define INPUT_VLAN_PORT_DEFAULT 6010
/* Delay between vlan changes - this is required to avoid flooding the VLAN
/* Delay between vlan changes - this is required to avoid flooding the VLAN
* server */
#define INPUT_VLAN_CHANGE_DELAY 5000000
......@@ -202,9 +202,9 @@
* mark it to be presented */
#define INPUT_PTS_DELAY 2000000
/*******************************************************************************