forked from PAWPAW-Mirror/lib_xua
Re-add support for I2S_DOWNSAMPLE_MONO_IN.
This commit is contained in:
@@ -507,11 +507,10 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
|||||||
{
|
{
|
||||||
long long doubleWordAlignmentEnsured;
|
long long doubleWordAlignmentEnsured;
|
||||||
/* [Number of I2S channels][Number of samples/phases][Taps per phase] */
|
/* [Number of I2S channels][Number of samples/phases][Taps per phase] */
|
||||||
/* TODO: Fix for mono */
|
int32_t delayLine[I2S_DOWNSAMPLE_CHANS_IN][USB_TO_AUD_RATIO][24];
|
||||||
int32_t delayLine[I2S_CHANS_ADC][USB_TO_AUD_RATIO][24];
|
|
||||||
} i2sInDs3;
|
} i2sInDs3;
|
||||||
memset(&i2sInDs3.delayLine, 0, sizeof i2sInDs3.delayLine);
|
memset(&i2sInDs3.delayLine, 0, sizeof i2sInDs3.delayLine);
|
||||||
int64_t i2sInDs3Sum[I2S_CHANS_ADC];
|
int64_t i2sInDs3Sum[I2S_DOWNSAMPLE_CHANS_IN];
|
||||||
|
|
||||||
union i2sOutUs3
|
union i2sOutUs3
|
||||||
{
|
{
|
||||||
@@ -854,7 +853,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
|||||||
|
|
||||||
sample = bitrev(sample);
|
sample = bitrev(sample);
|
||||||
int chanIndex = ((frameCount-1)&(I2S_CHANS_PER_FRAME-1))+i; // channels 1, 3, 5.. on each line.
|
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)
|
if ((USB_TO_AUD_RATIO - 1) == usbToAudioRatioCounter)
|
||||||
{
|
{
|
||||||
samplesIn[buffIndex][chanIndex] =
|
samplesIn[buffIndex][chanIndex] =
|
||||||
@@ -875,7 +874,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
samplesIn[buffIndex][chanIndex] = sample;
|
samplesIn[buffIndex][chanIndex] = sample;
|
||||||
#endif /* (USB_TO_AUD_RATIO > 1) */
|
#endif /* (USB_TO_AUD_RATIO > 1) && !I2S_DOWNSAMPLE_MONO_IN */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,6 @@
|
|||||||
* @brief Only downsample one channel per input I2S frame.
|
* @brief Only downsample one channel per input I2S frame.
|
||||||
*
|
*
|
||||||
* Default: 0 i.e. mono mode is disabled, all input channels will be downsampled.
|
* 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
|
#ifndef I2S_DOWNSAMPLE_MONO_IN
|
||||||
#define I2S_DOWNSAMPLE_MONO_IN (0)
|
#define I2S_DOWNSAMPLE_MONO_IN (0)
|
||||||
@@ -164,7 +163,6 @@
|
|||||||
* @brief Number of incoming (device to host) I2S channels to downsample.
|
* @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.
|
* 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)
|
#if (I2S_DOWNSAMPLE_MONO_IN == 1)
|
||||||
#define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2)
|
#define I2S_DOWNSAMPLE_CHANS_IN (I2S_CHANS_ADC / 2)
|
||||||
@@ -172,7 +170,7 @@
|
|||||||
#error Mono I2S input downsampling is not avaliable in TDM mode
|
#error Mono I2S input downsampling is not avaliable in TDM mode
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define I2S_DOWNSAMPLE_CHANS_IN I2S_CHANS_ADC
|
#define I2S_DOWNSAMPLE_CHANS_IN I2S_CHANS_ADC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user