diff --git a/src/common_audio/signal_processing/signal_processing_unittest.cc b/src/common_audio/signal_processing/signal_processing_unittest.cc index 4acef5b7f..e20ed74e8 100644 --- a/src/common_audio/signal_processing/signal_processing_unittest.cc +++ b/src/common_audio/signal_processing/signal_processing_unittest.cc @@ -505,14 +505,23 @@ TEST_F(SplTest, CrossCorrelationTest) { const int kStep = 1; const int kSeqDimension = 6; - const int16_t vector16_b[kVector16Size] = {1, 4323, 1963, + const int16_t kVector16[kVector16Size] = {1, 4323, 1963, WEBRTC_SPL_WORD16_MAX, WEBRTC_SPL_WORD16_MIN + 5, -3333, -876, 8483, 142}; - const int32_t expected[3] = {-266947903, -15579555, -171282001}; int32_t vector32[kCrossCorrelationDimension] = {0}; - WebRtcSpl_CrossCorrelation(vector32, vector16, vector16_b, kSeqDimension, + WebRtcSpl_CrossCorrelation(vector32, vector16, kVector16, kSeqDimension, kCrossCorrelationDimension, kShift, kStep); + // WebRtcSpl_CrossCorrelationC() and WebRtcSpl_CrossCorrelationNeon() + // are not bit-exact. + const int32_t kExpected[kCrossCorrelationDimension] = + {-266947903, -15579555, -171282001}; + const int32_t kExpectedNeon[kCrossCorrelationDimension] = + {-266947901, -15579553, -171281999}; + const int32_t* expected = kExpected; + if (WebRtcSpl_CrossCorrelation != WebRtcSpl_CrossCorrelationC) { + expected = kExpectedNeon; + } for (int i = 0; i < kCrossCorrelationDimension; ++i) { EXPECT_EQ(expected[i], vector32[i]); }