diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-05 22:55:56 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-05 22:55:56 +0100 |
| commit | 34afbd6ca21d2b960573d787e6eae46fa86b200e (patch) | |
| tree | 08450aeff4c67fb300428e705910265e6cd59943 /src/tests/audio/test_wav_roundtrip.cc | |
| parent | 35c9ebb0a7ce0e726f631a2b04bb26098926cfab (diff) | |
style: run clang-format to adhere to coding style
Diffstat (limited to 'src/tests/audio/test_wav_roundtrip.cc')
| -rw-r--r-- | src/tests/audio/test_wav_roundtrip.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/audio/test_wav_roundtrip.cc b/src/tests/audio/test_wav_roundtrip.cc index 79de6ad..30f6cda 100644 --- a/src/tests/audio/test_wav_roundtrip.cc +++ b/src/tests/audio/test_wav_roundtrip.cc @@ -12,8 +12,7 @@ static const int SAMPLE_RATE = 32000; static const float PI = 3.14159265358979323846f; static float compute_snr_db(const std::vector<float>& ref, - const std::vector<float>& out, - int skip_samples) { + const std::vector<float>& out, int skip_samples) { const int n = (int)std::min(ref.size(), out.size()); double sig = 0.0, noise = 0.0; for (int i = skip_samples; i < n; ++i) { @@ -21,7 +20,8 @@ static float compute_snr_db(const std::vector<float>& ref, double e = ref[i] - out[i]; noise += e * e; } - if (noise < 1e-30) return 999.0f; + if (noise < 1e-30) + return 999.0f; return 10.0f * (float)log10(sig / noise); } @@ -45,8 +45,8 @@ int main() { // SNR — skip first DCT_SIZE samples (ramp-up transient) const float snr = compute_snr_db(input, output, DCT_SIZE); - printf("Roundtrip SNR: %.1f dB (frames=%d, out_samples=%zu)\n", - snr, num_frames, output.size()); + printf("Roundtrip SNR: %.1f dB (frames=%d, out_samples=%zu)\n", snr, + num_frames, output.size()); const float MIN_SNR_DB = 30.0f; if (snr < MIN_SNR_DB) { |
