Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: webrtc/modules/audio_processing/test/bitexactness_tools.cc

Issue 1841213002: Renamed the test::BitExactFrame method to test::VectorDifferenceBounded. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changed name of one of the vector comparison methods Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698