Loading media/libaaudio/src/flowgraph/resampler/MultiChannelResampler.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -135,10 +135,9 @@ void MultiChannelResampler::generateCoefficients(int32_t inputRate, int coefficientIndex = 0; double phase = 0.0; // ranges from 0.0 to 1.0, fraction between samples // Stretch the sinc function for low pass filtering. const float cutoffScaler = normalizedCutoff * ((outputRate < inputRate) ? ((float)outputRate / inputRate) : ((float)inputRate / outputRate)); const float cutoffScaler = (outputRate < inputRate) ? (normalizedCutoff * (float)outputRate / inputRate) : 1.0f; // Do not filter when upsampling. const int numTapsHalf = getNumTaps() / 2; // numTaps must be even. const float numTapsHalfInverse = 1.0f / numTapsHalf; for (int i = 0; i < numRows; i++) { Loading media/libaaudio/src/flowgraph/resampler/MultiChannelResampler.h +7 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ public: * Set lower to reduce aliasing. * Default is 0.70. * * Note that this value is ignored when upsampling, which is when * the outputRate is higher than the inputRate. * * @param normalizedCutoff anti-aliasing filter cutoff * @return address of this builder for chaining calls */ Loading Loading @@ -227,6 +230,10 @@ protected: /** * Generate the filter coefficients in optimal order. * * Note that normalizedCutoff is ignored when upsampling, which is when * the outputRate is higher than the inputRate. * * @param inputRate sample rate of the input stream * @param outputRate sample rate of the output stream * @param numRows number of rows in the array that contain a set of tap coefficients Loading media/libaaudio/tests/test_resampler.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -193,10 +193,9 @@ TEST(test_resampler, resampler_11025_44100_best) { checkResampler(11025, 44100, MultiChannelResampler::Quality::Best); } // TODO This fails because the output is very low. //TEST(test_resampler, resampler_11025_88200_best) { // checkResampler(11025, 88200, MultiChannelResampler::Quality::Best); //} TEST(test_resampler, resampler_11025_88200_best) { checkResampler(11025, 88200, MultiChannelResampler::Quality::Best); } TEST(test_resampler, resampler_16000_48000_best) { checkResampler(16000, 48000, MultiChannelResampler::Quality::Best); Loading Loading
media/libaaudio/src/flowgraph/resampler/MultiChannelResampler.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -135,10 +135,9 @@ void MultiChannelResampler::generateCoefficients(int32_t inputRate, int coefficientIndex = 0; double phase = 0.0; // ranges from 0.0 to 1.0, fraction between samples // Stretch the sinc function for low pass filtering. const float cutoffScaler = normalizedCutoff * ((outputRate < inputRate) ? ((float)outputRate / inputRate) : ((float)inputRate / outputRate)); const float cutoffScaler = (outputRate < inputRate) ? (normalizedCutoff * (float)outputRate / inputRate) : 1.0f; // Do not filter when upsampling. const int numTapsHalf = getNumTaps() / 2; // numTaps must be even. const float numTapsHalfInverse = 1.0f / numTapsHalf; for (int i = 0; i < numRows; i++) { Loading
media/libaaudio/src/flowgraph/resampler/MultiChannelResampler.h +7 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ public: * Set lower to reduce aliasing. * Default is 0.70. * * Note that this value is ignored when upsampling, which is when * the outputRate is higher than the inputRate. * * @param normalizedCutoff anti-aliasing filter cutoff * @return address of this builder for chaining calls */ Loading Loading @@ -227,6 +230,10 @@ protected: /** * Generate the filter coefficients in optimal order. * * Note that normalizedCutoff is ignored when upsampling, which is when * the outputRate is higher than the inputRate. * * @param inputRate sample rate of the input stream * @param outputRate sample rate of the output stream * @param numRows number of rows in the array that contain a set of tap coefficients Loading
media/libaaudio/tests/test_resampler.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -193,10 +193,9 @@ TEST(test_resampler, resampler_11025_44100_best) { checkResampler(11025, 44100, MultiChannelResampler::Quality::Best); } // TODO This fails because the output is very low. //TEST(test_resampler, resampler_11025_88200_best) { // checkResampler(11025, 88200, MultiChannelResampler::Quality::Best); //} TEST(test_resampler, resampler_11025_88200_best) { checkResampler(11025, 88200, MultiChannelResampler::Quality::Best); } TEST(test_resampler, resampler_16000_48000_best) { checkResampler(16000, 48000, MultiChannelResampler::Quality::Best); Loading