Commit 7353203b authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Updating DISABLE_STEREO to the new stereo code (i.e. disabling more stuff)

parent dcd580d7
......@@ -251,6 +251,8 @@ int compute_pitch_gain(const CELTMode *m, const celt_norm_t *X, const celt_norm_
return gain_sum > 5;
}
#ifndef DISABLE_STEREO
static void intensity_band(celt_norm_t * restrict X, int len)
{
int j;
......@@ -397,6 +399,8 @@ void deinterleave(celt_norm_t *x, int N)
RESTORE_STACK;
}
#endif /* DISABLE_STEREO */
int folding_decision(const CELTMode *m, celt_norm_t *X, celt_word16_t *average, int *last_decision)
{
int i;
......@@ -557,6 +561,8 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, ce
RESTORE_STACK;
}
#ifndef DISABLE_STEREO
void quant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, celt_mask_t *W, int pitch_used, celt_pgain_t *pgains, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, ec_enc *enc)
{
int i, j, remaining_bits, balance;
......@@ -821,6 +827,7 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t
}
RESTORE_STACK;
}
#endif /* DISABLE_STEREO */
/* Decoding of the residual */
void unquant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, int pitch_used, celt_pgain_t *pgains, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, ec_dec *dec)
......@@ -914,6 +921,8 @@ void unquant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P,
RESTORE_STACK;
}
#ifndef DISABLE_STEREO
void unquant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, int pitch_used, celt_pgain_t *pgains, const celt_ener_t *bandE, int *pulses, int shortBlocks, int fold, int total_bits, ec_dec *dec)
{
int i, j, remaining_bits, balance;
......@@ -1159,3 +1168,5 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm
}
RESTORE_STACK;
}
#endif /* DISABLE_STEREO */
......@@ -774,7 +774,9 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_si
ALLOC(offsets, st->mode->nbEBands, int);
ALLOC(stereo_mode, st->mode->nbEBands, int);
#ifndef DISABLE_STEREO
stereo_decision(st->mode, X, stereo_mode, st->mode->nbEBands);
#endif
for (i=0;i<st->mode->nbEBands;i++)
offsets[i] = 0;
......@@ -790,9 +792,10 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_si
/* Residual quantisation */
if (C==1)
quant_bands(st->mode, X, P, NULL, has_pitch, gains, bandE, pulses, shortBlocks, has_fold, nbCompressedBytes*8, &enc);
#ifndef DISABLE_STEREO
else
quant_bands_stereo(st->mode, X, P, NULL, has_pitch, gains, bandE, pulses, shortBlocks, has_fold, nbCompressedBytes*8, &enc);
#endif
/* Re-synthesis of the coded audio if required */
if (st->pitch_available>0 || optional_synthesis!=NULL)
{
......@@ -1223,7 +1226,9 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
ALLOC(pulses, st->mode->nbEBands, int);
ALLOC(offsets, st->mode->nbEBands, int);
ALLOC(stereo_mode, st->mode->nbEBands, int);
#ifndef DISABLE_STEREO
stereo_decision(st->mode, X, stereo_mode, st->mode->nbEBands);
#endif
for (i=0;i<st->mode->nbEBands;i++)
offsets[i] = 0;
......@@ -1256,9 +1261,10 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
/* Decode fixed codebook and merge with pitch */
if (C==1)
unquant_bands(st->mode, X, P, has_pitch, gains, bandE, pulses, shortBlocks, has_fold, len*8, &dec);
#ifndef DISABLE_STEREO
else
unquant_bands_stereo(st->mode, X, P, has_pitch, gains, bandE, pulses, shortBlocks, has_fold, len*8, &dec);
#endif
/* Synthesis */
denormalise_bands(st->mode, X, freq, bandE);
......
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