Re-add support for I2S_DOWNSAMPLE_MONO_IN.

This commit is contained in:
louis
2017-02-13 08:37:07 +00:00
parent e70b572551
commit c85d8206e2
2 changed files with 5 additions and 8 deletions

View File

@@ -507,11 +507,10 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
{
long long doubleWordAlignmentEnsured;
/* [Number of I2S channels][Number of samples/phases][Taps per phase] */
/* TODO: Fix for mono */
int32_t delayLine[I2S_CHANS_ADC][USB_TO_AUD_RATIO][24];
int32_t delayLine[I2S_DOWNSAMPLE_CHANS_IN][USB_TO_AUD_RATIO][24];
} i2sInDs3;
memset(&i2sInDs3.delayLine, 0, sizeof i2sInDs3.delayLine);
int64_t i2sInDs3Sum[I2S_CHANS_ADC];
int64_t i2sInDs3Sum[I2S_DOWNSAMPLE_CHANS_IN];
union i2sOutUs3
{
@@ -854,7 +853,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
sample = bitrev(sample);
int chanIndex = ((frameCount-1)&(I2S_CHANS_PER_FRAME-1))+i; // channels 1, 3, 5.. on each line.
#if (USB_TO_AUD_RATIO > 1)
#if (USB_TO_AUD_RATIO > 1 && !I2S_DOWNSAMPLE_MONO_IN)
if ((USB_TO_AUD_RATIO - 1) == usbToAudioRatioCounter)
{
samplesIn[buffIndex][chanIndex] =
@@ -875,7 +874,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
}
#else
samplesIn[buffIndex][chanIndex] = sample;
#endif /* (USB_TO_AUD_RATIO > 1) */
#endif /* (USB_TO_AUD_RATIO > 1) && !I2S_DOWNSAMPLE_MONO_IN */
}
#endif

View File

@@ -154,7 +154,6 @@
* @brief Only downsample one channel per input I2S frame.
*
* Default: 0 i.e. mono mode is disabled, all input channels will be downsampled.
* TODO: Remove this define or reintroduce support in audio_io.xc
*/
#ifndef I2S_DOWNSAMPLE_MONO_IN
#define I2S_DOWNSAMPLE_MONO_IN (0)
@@ -164,7 +163,6 @@
* @brief Number of incoming (device to host) I2S channels to downsample.
*
* Default: The number of I2S incoming channels, or half this if mono downsampling is enabled.
* TODO: Remove this define or reintroduce support in audio_io.xc
*/
#if (I2S_DOWNSAMPLE_MONO_IN == 1)
#define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2)
@@ -172,7 +170,7 @@
#error Mono I2S input downsampling is not avaliable in TDM mode
#endif
#else
#define I2S_DOWNSAMPLE_CHANS_IN I2S_CHANS_ADC
#define I2S_DOWNSAMPLE_CHANS_IN I2S_CHANS_ADC
#endif
/**