Commit 156dce5c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Update name of all constants

parent 957281b5
......@@ -43,26 +43,26 @@ typedef float level_t;
typedef struct dca_state_s dca_state_t;
#define DTS_MONO 0
#define DTS_CHANNEL 1
#define DTS_STEREO 2
#define DTS_STEREO_SUMDIFF 3
#define DTS_STEREO_TOTAL 4
#define DTS_3F 5
#define DTS_2F1R 6
#define DTS_3F1R 7
#define DTS_2F2R 8
#define DTS_3F2R 9
#define DTS_4F2R 10
#define DTS_DOLBY 101 /* FIXME */
#define DTS_CHANNEL_MAX DTS_3F2R /* We don't handle anything above that */
#define DTS_CHANNEL_BITS 6
#define DTS_CHANNEL_MASK 0x3F
#define DTS_LFE 0x80
#define DTS_ADJUST_LEVEL 0x100
#define DCA_MONO 0
#define DCA_CHANNEL 1
#define DCA_STEREO 2
#define DCA_STEREO_SUMDIFF 3
#define DCA_STEREO_TOTAL 4
#define DCA_3F 5
#define DCA_2F1R 6
#define DCA_3F1R 7
#define DCA_2F2R 8
#define DCA_3F2R 9
#define DCA_4F2R 10
#define DCA_DOLBY 101 /* FIXME */
#define DCA_CHANNEL_MAX DCA_3F2R /* We don't handle anything above that */
#define DCA_CHANNEL_BITS 6
#define DCA_CHANNEL_MASK 0x3F
#define DCA_LFE 0x80
#define DCA_ADJUST_LEVEL 0x100
dca_state_t * dts_init (uint32_t mm_accel);
......
......@@ -20,6 +20,26 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <dca.h>
#ifndef LIBDCA_COMPAT_H
# define LIBDCA_COMPAT_H 1
# include <dca.h>
typedef struct dca_state_s dts_state_t;
# define DTS_MONO DCA_MONO
# define DTS_CHANNEL DCA_CHANNEL
# define DTS_STEREO DCA_STEREO
# define DTS_STEREO_SUMDIFF DCA_STEREO_SUMDIFF
# define DTS_STEREO_TOTAL DCA_STEREO_TOTAL
# define DTS_3F DCA_3F
# define DTS_2F1R DCA_2F1R
# define DTS_3F1R DCA_3F1R
# define DTS_2F2R DCA_2F2R
# define DTS_3F2R DCA_3F2R
# define DTS_4F2R DCA_4F2R
# define DTS_DOLBY DCA_DOLBY
# define DTS_CHANNEL_MAX DCA_CHANNEL_MAX
# define DTS_CHANNEL_BITS DCA_CHANNEL_BITS
# define DTS_CHANNEL_MASK DCA_CHANNEL_MASK
# define DTS_LFE DCA_LFE
# define DTS_ADJUST_LEVEL DCA_ADJUST_LEVEL
#endif
......@@ -142,10 +142,10 @@ static ao_instance_t * aif_open (int flags)
ao_instance_t * ao_aif_open (void)
{
return aif_open (DTS_STEREO);
return aif_open (DCA_STEREO);
}
ao_instance_t * ao_aifdolby_open (void)
{
return aif_open (DTS_DOLBY);
return aif_open (DCA_DOLBY);
}
......@@ -75,7 +75,7 @@ static int al_play (ao_instance_t * _instance, int flags, sample_t * _samples)
#endif
chans = channels_multi (flags);
flags &= DTS_CHANNEL_MASK | DTS_LFE;
flags &= DCA_CHANNEL_MASK | DCA_LFE;
if (instance->set_params) {
ALconfig config;
......@@ -107,12 +107,12 @@ static int al_play (ao_instance_t * _instance, int flags, sample_t * _samples)
instance->flags = flags;
instance->set_params = 0;
} else if ((flags == DTS_DOLBY) && (instance->flags == DTS_STEREO)) {
} else if ((flags == DCA_DOLBY) && (instance->flags == DCA_STEREO)) {
fprintf (stderr, "Switching from stereo to dolby surround\n");
instance->flags = DTS_DOLBY;
} else if ((flags == DTS_STEREO) && (instance->flags == DTS_DOLBY)) {
instance->flags = DCA_DOLBY;
} else if ((flags == DCA_STEREO) && (instance->flags == DCA_DOLBY)) {
fprintf (stderr, "Switching from dolby surround to stereo\n");
instance->flags = DTS_STEREO;
instance->flags = DCA_STEREO;
} else if (flags != instance->flags)
return 1;
......@@ -158,22 +158,22 @@ static ao_instance_t * al_open (int flags)
ao_instance_t * ao_al_open (void)
{
return al_open (DTS_STEREO);
return al_open (DCA_STEREO);
}
ao_instance_t * ao_aldolby_open (void)
{
return al_open (DTS_DOLBY);
return al_open (DCA_DOLBY);
}
ao_instance_t * ao_al4_open (void)
{
return al_open (DTS_2F2R);
return al_open (DCA_2F2R);
}
ao_instance_t * ao_al6_open (void)
{
return al_open (DTS_3F2R | DTS_LFE);
return al_open (DCA_3F2R | DCA_LFE);
}
#endif
......@@ -33,7 +33,7 @@
static int float_setup (ao_instance_t * instance, int sample_rate, int * flags,
level_t * level, sample_t * bias)
{
*flags = DTS_STEREO;
*flags = DCA_STEREO;
*level = CONVERT_LEVEL;
*bias = 0;
......
......@@ -59,21 +59,21 @@ static null_instance_t instance = {{null_setup, null_play, null_close}, 0};
ao_instance_t * ao_null_open (void)
{
instance.channels = DTS_STEREO;
instance.channels = DCA_STEREO;
return (ao_instance_t *) &instance;
}
ao_instance_t * ao_null4_open (void)
{
instance.channels = DTS_2F2R;
instance.channels = DCA_2F2R;
return (ao_instance_t *) &instance;
}
ao_instance_t * ao_null6_open (void)
{
instance.channels = DTS_3F2R | DTS_LFE;
instance.channels = DCA_3F2R | DCA_LFE;
return (ao_instance_t *) &instance;
}
......@@ -99,7 +99,7 @@ static int oss_play (ao_instance_t * _instance, int flags, sample_t * _samples)
#endif
chans = channels_multi (flags);
flags &= DTS_CHANNEL_MASK | DTS_LFE;
flags &= DCA_CHANNEL_MASK | DCA_LFE;
if (instance->set_params) {
int tmp;
......@@ -121,12 +121,12 @@ static int oss_play (ao_instance_t * _instance, int flags, sample_t * _samples)
instance->flags = flags;
instance->set_params = 0;
} else if ((flags == DTS_DOLBY) && (instance->flags == DTS_STEREO)) {
} else if ((flags == DCA_DOLBY) && (instance->flags == DCA_STEREO)) {
fprintf (stderr, "Switching from stereo to dolby surround\n");
instance->flags = DTS_DOLBY;
} else if ((flags == DTS_STEREO) && (instance->flags == DTS_DOLBY)) {
instance->flags = DCA_DOLBY;
} else if ((flags == DCA_STEREO) && (instance->flags == DCA_DOLBY)) {
fprintf (stderr, "Switching from dolby surround to stereo\n");
instance->flags = DTS_STEREO;
instance->flags = DCA_STEREO;
} else if (flags != instance->flags)
return 1;
......@@ -180,22 +180,22 @@ static ao_instance_t * oss_open (int flags)
ao_instance_t * ao_oss_open (void)
{
return oss_open (DTS_STEREO);
return oss_open (DCA_STEREO);
}
ao_instance_t * ao_ossdolby_open (void)
{
return oss_open (DTS_DOLBY);
return oss_open (DCA_DOLBY);
}
ao_instance_t * ao_oss4_open (void)
{
return oss_open (DTS_2F2R);
return oss_open (DCA_2F2R);
}
ao_instance_t * ao_oss6_open (void)
{
return oss_open (DTS_3F2R | DTS_LFE);
return oss_open (DCA_3F2R | DCA_LFE);
}
#endif
......@@ -72,10 +72,10 @@ static ao_instance_t * peak_open (int flags)
ao_instance_t * ao_peak_open (void)
{
return peak_open (DTS_STEREO);
return peak_open (DCA_STEREO);
}
ao_instance_t * ao_peakdolby_open (void)
{
return peak_open (DTS_DOLBY);
return peak_open (DCA_DOLBY);
}
......@@ -106,12 +106,12 @@ static int solaris_play (ao_instance_t * _instance, int flags,
instance->flags = flags;
instance->set_params = 0;
} else if ((flags == DTS_DOLBY) && (instance->flags == DTS_STEREO)) {
} else if ((flags == DCA_DOLBY) && (instance->flags == DCA_STEREO)) {
fprintf (stderr, "Switching from stereo to dolby surround\n");
instance->flags = DTS_DOLBY;
} else if ((flags == DTS_STEREO) && (instance->flags == DTS_DOLBY)) {
instance->flags = DCA_DOLBY;
} else if ((flags == DCA_STEREO) && (instance->flags == DCA_DOLBY)) {
fprintf (stderr, "Switching from dolby surround to stereo\n");
instance->flags = DTS_STEREO;
instance->flags = DCA_STEREO;
} else if (flags != instance->flags)
return 1;
......@@ -156,12 +156,12 @@ static ao_instance_t * solaris_open (int flags)
ao_instance_t * ao_solaris_open (void)
{
return solaris_open (DTS_STEREO);
return solaris_open (DCA_STEREO);
}
ao_instance_t * ao_solarisdolby_open (void)
{
return solaris_open (DTS_DOLBY);
return solaris_open (DCA_DOLBY);
}
#endif
......@@ -99,7 +99,7 @@ static int wav_setup (ao_instance_t * _instance, int sample_rate, int * flags,
*level = CONVERT_LEVEL;
*bias = 0;
if( instance->flags == DTS_STEREO );
if( instance->flags == DCA_STEREO );
*bias = CONVERT_BIAS;
return 0;
......@@ -143,10 +143,10 @@ static int wav_channels (int flags, uint32_t * speaker_flags)
};
int chans;
*speaker_flags = speaker_tbl[flags & DTS_CHANNEL_MASK];
chans = nfchans_tbl[flags & DTS_CHANNEL_MASK];
*speaker_flags = speaker_tbl[flags & DCA_CHANNEL_MASK];
chans = nfchans_tbl[flags & DCA_CHANNEL_MASK];
if (flags & DTS_LFE) {
if (flags & DCA_LFE) {
*speaker_flags |= SPEAKER_LOW_FREQUENCY;
chans++;
}
......@@ -169,28 +169,28 @@ static int wav_play (ao_instance_t * _instance, int flags, sample_t * _samples)
uint32_t speaker_flags;
static const int chan_map[10][6] =
{ { 0, 0, 0, 0, 0, 0 }, /* DTS_MONO */
{ 0, 1, 0, 0, 0, 0 }, /* DTS_CHANNEL */
{ 0, 1, 0, 0, 0, 0 }, /* DTS_STEREO */
{ 0, 1, 0, 0, 0, 0 }, /* DTS_STEREO_SUMDIFF */
{ 0, 1, 0, 0, 0, 0 }, /* DTS_STEREO_TOTAL */
{ 2, 0, 1, 0, 0, 0 }, /* DTS_3F */
{ 0, 1, 2, 0, 0, 0 }, /* DTS_2F1R */
{ 2, 0, 1, 3, 0, 0 }, /* DTS_3F1R */
{ 0, 1, 2, 3, 0, 0 }, /* DTS_2F2R */
{ 2, 0, 1, 3, 4, 0 }, /* DTS_3F2R */
{ { 0, 0, 0, 0, 0, 0 }, /* DCA_MONO */
{ 0, 1, 0, 0, 0, 0 }, /* DCA_CHANNEL */
{ 0, 1, 0, 0, 0, 0 }, /* DCA_STEREO */
{ 0, 1, 0, 0, 0, 0 }, /* DCA_STEREO_SUMDIFF */
{ 0, 1, 0, 0, 0, 0 }, /* DCA_STEREO_TOTAL */
{ 2, 0, 1, 0, 0, 0 }, /* DCA_3F */
{ 0, 1, 2, 0, 0, 0 }, /* DCA_2F1R */
{ 2, 0, 1, 3, 0, 0 }, /* DCA_3F1R */
{ 0, 1, 2, 3, 0, 0 }, /* DCA_2F2R */
{ 2, 0, 1, 3, 4, 0 }, /* DCA_3F2R */
};
static const int chan_map_lfe[10][6] =
{ { 0, 1, 0, 0, 0, 0 }, /* DTS_MONO */
{ 0, 1, 2, 0, 0, 0 }, /* DTS_CHANNEL */
{ 0, 1, 2, 0, 0, 0 }, /* DTS_STEREO */
{ 0, 1, 2, 0, 0, 0 }, /* DTS_STEREO_SUMDIFF */
{ 0, 1, 2, 0, 0, 0 }, /* DTS_STEREO_TOTAL */
{ 2, 0, 1, 3, 0, 0 }, /* DTS_3F */
{ 0, 1, 3, 2, 0, 0 }, /* DTS_2F1R */
{ 2, 0, 1, 4, 3, 0 }, /* DTS_3F1R */
{ 0, 1, 3, 4, 2, 0 }, /* DTS_2F2R */
{ 2, 0, 1, 4, 5, 3 }, /* DTS_3F2R */
{ { 0, 1, 0, 0, 0, 0 }, /* DCA_MONO */
{ 0, 1, 2, 0, 0, 0 }, /* DCA_CHANNEL */
{ 0, 1, 2, 0, 0, 0 }, /* DCA_STEREO */
{ 0, 1, 2, 0, 0, 0 }, /* DCA_STEREO_SUMDIFF */
{ 0, 1, 2, 0, 0, 0 }, /* DCA_STEREO_TOTAL */
{ 2, 0, 1, 3, 0, 0 }, /* DCA_3F */
{ 0, 1, 3, 2, 0, 0 }, /* DCA_2F1R */
{ 2, 0, 1, 4, 3, 0 }, /* DCA_3F1R */
{ 0, 1, 3, 4, 2, 0 }, /* DCA_2F2R */
{ 2, 0, 1, 4, 5, 3 }, /* DCA_3F2R */
};
#ifdef LIBDCA_DOUBLE
......@@ -233,9 +233,9 @@ static int wav_play (ao_instance_t * _instance, int flags, sample_t * _samples)
} else {
int i, j;
if (flags & DTS_LFE)
if (flags & DCA_LFE)
{
flags &= ~DTS_LFE;
flags &= ~DCA_LFE;
for (j = 0; j < chans; j++)
for (i = 0; i < 256; i++)
ordered_samples.floats[i * chans + chan_map_lfe[flags][j]] =
......@@ -297,17 +297,17 @@ static ao_instance_t * wav_open (int flags)
ao_instance_t * ao_wav_open (void)
{
return wav_open (DTS_STEREO);
return wav_open (DCA_STEREO);
}
ao_instance_t * ao_wavdolby_open (void)
{
return wav_open (DTS_DOLBY);
return wav_open (DCA_DOLBY);
}
ao_instance_t * ao_wav6_open (void)
{
return wav_open (DTS_3F2R|DTS_LFE);
return wav_open (DCA_3F2R|DCA_LFE);
}
ao_instance_t * ao_wavall_open (void)
......
......@@ -85,7 +85,7 @@ static int win_play (ao_instance_t * _instance, int flags, sample_t * _samples)
convert_t * samples = _samples;
#endif
flags &= DTS_CHANNEL_MASK | DTS_LFE;
flags &= DCA_CHANNEL_MASK | DCA_LFE;
if (instance->set_params) {
WAVEFORMATEX waveformat;
......@@ -114,12 +114,12 @@ static int win_play (ao_instance_t * _instance, int flags, sample_t * _samples)
instance->flags = flags;
instance->set_params = 0;
} else if ((flags == DTS_DOLBY) && (instance->flags == DTS_STEREO)) {
} else if ((flags == DCA_DOLBY) && (instance->flags == DCA_STEREO)) {
fprintf (stderr, "Switching from stereo to dolby surround\n");
instance->flags = DTS_DOLBY;
} else if ((flags == DTS_STEREO) && (instance->flags == DTS_DOLBY)) {
instance->flags = DCA_DOLBY;
} else if ((flags == DCA_STEREO) && (instance->flags == DCA_DOLBY)) {
fprintf (stderr, "Switching from dolby surround to stereo\n");
instance->flags = DTS_STEREO;
instance->flags = DCA_STEREO;
} else if (flags != instance->flags)
return 1;
......@@ -195,12 +195,12 @@ static ao_instance_t * win_open (int flags)
ao_instance_t * ao_win_open (void)
{
return win_open (DTS_STEREO);
return win_open (DCA_STEREO);
}
ao_instance_t * ao_windolby_open (void)
{
return win_open (DTS_DOLBY);
return win_open (DCA_DOLBY);
}
#endif
......@@ -102,11 +102,11 @@ void convert2s16_5 (convert_t * _f, int16_t * s16)
int channels_multi (int flags)
{
if (flags & DTS_LFE)
if (flags & DCA_LFE)
return 6;
else if (flags & 1) /* center channel */
return 5;
else if ((flags & DTS_CHANNEL_MASK) == DTS_2F2R)
else if ((flags & DCA_CHANNEL_MASK) == DCA_2F2R)
return 4;
else
return 2;
......@@ -118,18 +118,18 @@ void convert2s16_multi (convert_t * _f, int16_t * s16, int flags)
int32_t * f = (int32_t *) _f;
switch (flags) {
case DTS_MONO:
case DCA_MONO:
for (i = 0; i < 256; i++) {
s16[5*i] = s16[5*i+1] = s16[5*i+2] = s16[5*i+3] = 0;
s16[5*i+4] = convert (f[i]);
}
break;
case DTS_CHANNEL:
case DTS_STEREO:
case DTS_DOLBY:
case DCA_CHANNEL:
case DCA_STEREO:
case DCA_DOLBY:
convert2s16_2 (_f, s16);
break;
case DTS_3F:
case DCA_3F:
for (i = 0; i < 256; i++) {
s16[5*i] = convert (f[i]);
s16[5*i+1] = convert (f[i+512]);
......@@ -137,22 +137,22 @@ void convert2s16_multi (convert_t * _f, int16_t * s16, int flags)
s16[5*i+4] = convert (f[i+256]);
}
break;
case DTS_2F2R:
case DCA_2F2R:
convert2s16_4 (_f, s16);
break;
case DTS_3F2R:
case DCA_3F2R:
convert2s16_5 (_f, s16);
break;
case DTS_MONO | DTS_LFE:
case DCA_MONO | DCA_LFE:
for (i = 0; i < 256; i++) {
s16[6*i] = s16[6*i+1] = s16[6*i+2] = s16[6*i+3] = 0;
s16[6*i+4] = convert (f[i+256]);
s16[6*i+5] = convert (f[i]);
}
break;
case DTS_CHANNEL | DTS_LFE:
case DTS_STEREO | DTS_LFE:
case DTS_DOLBY | DTS_LFE:
case DCA_CHANNEL | DCA_LFE:
case DCA_STEREO | DCA_LFE:
case DCA_DOLBY | DCA_LFE:
for (i = 0; i < 256; i++) {
s16[6*i] = convert (f[i+256]);
s16[6*i+1] = convert (f[i+512]);
......@@ -160,7 +160,7 @@ void convert2s16_multi (convert_t * _f, int16_t * s16, int flags)
s16[6*i+5] = convert (f[i]);
}
break;
case DTS_3F | DTS_LFE:
case DCA_3F | DCA_LFE:
for (i = 0; i < 256; i++) {
s16[6*i] = convert (f[i+256]);
s16[6*i+1] = convert (f[i+768]);
......@@ -169,7 +169,7 @@ void convert2s16_multi (convert_t * _f, int16_t * s16, int flags)
s16[6*i+5] = convert (f[i]);
}
break;
case DTS_2F2R | DTS_LFE:
case DCA_2F2R | DCA_LFE:
for (i = 0; i < 256; i++) {
s16[6*i] = convert (f[i+256]);
s16[6*i+1] = convert (f[i+512]);
......@@ -179,7 +179,7 @@ void convert2s16_multi (convert_t * _f, int16_t * s16, int flags)
s16[6*i+5] = convert (f[i]);
}
break;
case DTS_3F2R | DTS_LFE:
case DCA_3F2R | DCA_LFE:
for (i = 0; i < 256; i++) {
s16[6*i] = convert (f[i+256]);
s16[6*i+1] = convert (f[i+768]);
......
......@@ -22,12 +22,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define DTS_SUBFRAMES_MAX (16)
#define DTS_PRIM_CHANNELS_MAX (5)
#define DTS_SUBBANDS (32)
#define DTS_ABITS_MAX (32) /* Should be 28 */
#define DTS_SUBSUBFAMES_MAX (4)
#define DTS_LFE_MAX (3)
#define DCA_SUBFRAMES_MAX (16)
#define DCA_PRIM_CHANNELS_MAX (5)
#define DCA_SUBBANDS (32)
#define DCA_ABITS_MAX (32) /* Should be 28 */
#define DCA_SUBSUBFAMES_MAX (4)
#define DCA_LFE_MAX (3)
struct dca_state_s {
......@@ -64,55 +64,55 @@ struct dca_state_s {
int subframes; /* number of subframes */
int prim_channels; /* number of primary audio channels */
/* subband activity count */
int subband_activity[DTS_PRIM_CHANNELS_MAX];
int subband_activity[DCA_PRIM_CHANNELS_MAX];
/* high frequency vq start subband */
int vq_start_subband[DTS_PRIM_CHANNELS_MAX];
int vq_start_subband[DCA_PRIM_CHANNELS_MAX];
/* joint intensity coding index */
int joint_intensity[DTS_PRIM_CHANNELS_MAX];
int joint_intensity[DCA_PRIM_CHANNELS_MAX];
/* transient mode code book */
int transient_huffman[DTS_PRIM_CHANNELS_MAX];
int transient_huffman[DCA_PRIM_CHANNELS_MAX];
/* scale factor code book */
int scalefactor_huffman[DTS_PRIM_CHANNELS_MAX];
int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX];
/* bit allocation quantizer select */
int bitalloc_huffman[DTS_PRIM_CHANNELS_MAX];
int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX];
/* quantization index codebook select */
int quant_index_huffman[DTS_PRIM_CHANNELS_MAX][DTS_ABITS_MAX];
int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX];
/* scale factor adjustment */
float scalefactor_adj[DTS_PRIM_CHANNELS_MAX][DTS_ABITS_MAX];
float scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX];
/* Primary audio coding side information */
int subsubframes; /* number of subsubframes */
int partial_samples; /* partial subsubframe samples count */
/* prediction mode (ADPCM used or not) */
int prediction_mode[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int prediction_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* prediction VQ coefs */
int prediction_vq[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* bit allocation index */
int bitalloc[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* transition mode (transients) */
int transition_mode[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* scale factors (2 if transient)*/
int scale_factor[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS][2];
int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];
/* joint subband scale factors codebook */
int joint_huff[DTS_PRIM_CHANNELS_MAX];
int joint_huff[DCA_PRIM_CHANNELS_MAX];
/* joint subband scale factors */
int joint_scale_factor[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* stereo downmix coefficients */
int downmix_coef[DTS_PRIM_CHANNELS_MAX][2];
int downmix_coef[DCA_PRIM_CHANNELS_MAX][2];
/* dynamic range coefficient */
int dynrange_coef;
/* VQ encoded high frequency subbands */
int high_freq_vq[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
/* Low frequency effect data */
double lfe_data[2*DTS_SUBSUBFAMES_MAX*DTS_LFE_MAX * 2 /*history*/];
double lfe_data[2*DCA_SUBSUBFAMES_MAX*DCA_LFE_MAX * 2 /*history*/];
int lfe_scale_factor;
/* Subband samples history (for ADPCM) */
double subband_samples_hist[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS][4];
double subband_fir_hist[DTS_PRIM_CHANNELS_MAX][512];
double subband_fir_noidea[DTS_PRIM_CHANNELS_MAX][64];
double subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
double subband_fir_hist[DCA_PRIM_CHANNELS_MAX][512];
double subband_fir_noidea[DCA_PRIM_CHANNELS_MAX][64];
/* Audio output */
level_t clev; /* centre channel mix level */
......
......@@ -30,146 +30,146 @@
#include "dca.h"
#include "dca_internal.h"
#define CONVERT(acmod,output) (((output) << DTS_CHANNEL_BITS) + (acmod))
#define CONVERT(acmod,output) (((output) << DCA_CHANNEL_BITS) + (acmod))
int dts_downmix_init (int input, int flags, level_t * level,
level_t clev, level_t slev)
{
static uint8_t table[11][10] = {
/* DTS_MONO */
{DTS_MONO, DTS_MONO, DTS_MONO, DTS_MONO,
DTS_MONO, DTS_MONO, DTS_MONO, DTS_MONO,
DTS_MONO, DTS_MONO},
/* DTS_CHANNEL */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO},
/* DTS_STEREO */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO},
/* DTS_STEREO_SUMDIFF */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO},
/* DTS_STEREO_TOTAL */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO},
/* DTS_3F */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_3F, DTS_3F, DTS_3F,
DTS_3F, DTS_3F},
/* DTS_2F1R */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_2F1R, DTS_2F1R, DTS_2F1R,
DTS_2F1R, DTS_2F1R},
/* DTS_3F1R */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_3F, DTS_3F1R, DTS_3F1R,
DTS_3F1R, DTS_3F1R},
/* DTS_2F2R */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_STEREO, DTS_2F2R, DTS_2F2R,
DTS_2F2R, DTS_2F2R},
/* DTS_3F2R */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_3F, DTS_3F2R, DTS_3F2R,
DTS_3F2R, DTS_3F2R},
/* DTS_4F2R */
{DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
DTS_STEREO, DTS_4F2R, DTS_4F2R, DTS_4F2R,
DTS_4F2R, DTS_4F2R},
/* DCA_MONO */
{DCA_MONO, DCA_MONO, DCA_MONO, DCA_MONO,
DCA_MONO, DCA_MONO, DCA_MONO, DCA_MONO,
DCA_MONO, DCA_MONO},
/* DCA_CHANNEL */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO},
/* DCA_STEREO */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO},
/* DCA_STEREO_SUMDIFF */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO},
/* DCA_STEREO_TOTAL */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO},
/* DCA_3F */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_3F, DCA_3F, DCA_3F,
DCA_3F, DCA_3F},
/* DCA_2F1R */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_2F1R, DCA_2F1R, DCA_2F1R,
DCA_2F1R, DCA_2F1R},
/* DCA_3F1R */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_3F, DCA_3F1R, DCA_3F1R,
DCA_3F1R, DCA_3F1R},
/* DCA_2F2R */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_STEREO, DCA_2F2R, DCA_2F2R,
DCA_2F2R, DCA_2F2R},
/* DCA_3F2R */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_3F, DCA_3F2R, DCA_3F2R,
DCA_3F2R, DCA_3F2R},
/* DCA_4F2R */
{DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
DCA_STEREO, DCA_4F2R, DCA_4F2R, DCA_4F2R,
DCA_4F2R, DCA_4F2R},
};
int output;