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

Side by Side Diff: webrtc/common_audio/lapped_transform_unittest.cc

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/common_audio/fft4g.c ('k') | webrtc/common_audio/real_fourier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 class FftCheckerCallback : public webrtc::LappedTransform::Callback { 45 class FftCheckerCallback : public webrtc::LappedTransform::Callback {
46 public: 46 public:
47 FftCheckerCallback() : block_num_(0) {} 47 FftCheckerCallback() : block_num_(0) {}
48 48
49 virtual void ProcessAudioBlock(const complex<float>* const* in_block, 49 virtual void ProcessAudioBlock(const complex<float>* const* in_block,
50 int in_channels, int frames, int out_channels, 50 int in_channels, int frames, int out_channels,
51 complex<float>* const* out_block) { 51 complex<float>* const* out_block) {
52 CHECK_EQ(in_channels, out_channels); 52 CHECK_EQ(in_channels, out_channels);
53 53
54 float full_length = (frames - 1) * 2; 54 int full_length = (frames - 1) * 2;
55 ++block_num_; 55 ++block_num_;
56 56
57 if (block_num_ > 0) { 57 if (block_num_ > 0) {
58 ASSERT_NEAR(in_block[0][0].real(), full_length, 1e-5f); 58 ASSERT_NEAR(in_block[0][0].real(), static_cast<float>(full_length),
59 1e-5f);
59 ASSERT_NEAR(in_block[0][0].imag(), 0.0f, 1e-5f); 60 ASSERT_NEAR(in_block[0][0].imag(), 0.0f, 1e-5f);
60 for (int i = 1; i < frames; ++i) { 61 for (int i = 1; i < frames; ++i) {
61 ASSERT_NEAR(in_block[0][i].real(), 0.0f, 1e-5f); 62 ASSERT_NEAR(in_block[0][i].real(), 0.0f, 1e-5f);
62 ASSERT_NEAR(in_block[0][i].imag(), 0.0f, 1e-5f); 63 ASSERT_NEAR(in_block[0][i].imag(), 0.0f, 1e-5f);
63 } 64 }
64 } 65 }
65 } 66 }
66 67
67 int block_num() { 68 int block_num() {
68 return block_num_; 69 return block_num_;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 { 195 {
195 const int kExpectedChunkLength = 160; 196 const int kExpectedChunkLength = 160;
196 const LappedTransform trans(1, 1, kExpectedChunkLength, window, 197 const LappedTransform trans(1, 1, kExpectedChunkLength, window,
197 kBlockLength, kBlockLength, &call); 198 kBlockLength, kBlockLength, &call);
198 199
199 EXPECT_EQ(kExpectedChunkLength, trans.chunk_length()); 200 EXPECT_EQ(kExpectedChunkLength, trans.chunk_length());
200 } 201 }
201 } 202 }
202 203
203 } // namespace webrtc 204 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/fft4g.c ('k') | webrtc/common_audio/real_fourier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698