Index: webrtc/modules/audio_processing/test/bitexactness_tools.cc |
diff --git a/webrtc/modules/audio_processing/test/bitexactness_tools.cc b/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
index 965820ca3b142c1819e9185c599805319e23eff8..e15e3da12f9ec9eb0a2ade42ac4ce775d5e5a036 100644 |
--- a/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
+++ b/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
@@ -70,11 +70,12 @@ void ReadFloatSamplesFromStereoFile(size_t samples_per_channel, |
} |
} |
-::testing::AssertionResult BitExactFrame(size_t samples_per_channel, |
- size_t num_channels, |
- rtc::ArrayView<const float> reference, |
- rtc::ArrayView<const float> output, |
- float tolerance) { |
+::testing::AssertionResult StackedFrameDifferenceBounded( |
+ size_t samples_per_channel, |
+ size_t num_channels, |
+ rtc::ArrayView<const float> reference, |
+ rtc::ArrayView<const float> output, |
+ float element_error_bound) { |
// Form vectors to compare the reference to. Only the first values of the |
// outputs are compared in order not having to specify all preceeding frames |
// as testvectors. |
@@ -89,12 +90,14 @@ void ReadFloatSamplesFromStereoFile(size_t samples_per_channel, |
reference_frame_length); |
} |
- return BitExactVector(reference, output_to_verify, tolerance); |
+ return VectorDifferenceBounded(reference, output_to_verify, |
+ element_error_bound); |
} |
-::testing::AssertionResult BitExactVector(rtc::ArrayView<const float> reference, |
- rtc::ArrayView<const float> output, |
- float tolerance) { |
+::testing::AssertionResult VectorDifferenceBounded( |
+ rtc::ArrayView<const float> reference, |
+ rtc::ArrayView<const float> output, |
+ float element_error_bound) { |
// The vectors are deemed to be bitexact only if |
// a) output have a size at least as long as the reference. |
// b) the samples in the reference are bitexact with the corresponding samples |
@@ -106,7 +109,7 @@ void ReadFloatSamplesFromStereoFile(size_t samples_per_channel, |
} else { |
// Compare the first samples in the vectors. |
for (size_t k = 0; k < reference.size(); ++k) { |
- if (fabs(output[k] - reference[k]) > tolerance) { |
+ if (fabs(output[k] - reference[k]) > element_error_bound) { |
equal = false; |
break; |
} |