OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 EXPECT_EQ(expected[i], vector32[i]); | 488 EXPECT_EQ(expected[i], vector32[i]); |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 TEST_F(SplTest, AutoCorrelationTest) { | 492 TEST_F(SplTest, AutoCorrelationTest) { |
493 int scale = 0; | 493 int scale = 0; |
494 int32_t vector32[kVector16Size]; | 494 int32_t vector32[kVector16Size]; |
495 const int32_t expected[kVector16Size] = {302681398, 14223410, -121705063, | 495 const int32_t expected[kVector16Size] = {302681398, 14223410, -121705063, |
496 -85221647, -17104971, 61806945, 6644603, -669329, 43}; | 496 -85221647, -17104971, 61806945, 6644603, -669329, 43}; |
497 | 497 |
498 EXPECT_EQ(-1, WebRtcSpl_AutoCorrelation(vector16, | 498 EXPECT_EQ(-1, WebRtcSpl_AutoCorrelation(vector16, kVector16Size, |
499 kVector16Size, kVector16Size + 1, vector32, &scale)); | 499 kVector16Size + 1, vector32, &scale)); |
500 EXPECT_EQ(kVector16Size, WebRtcSpl_AutoCorrelation(vector16, | 500 EXPECT_EQ(kVector16Size, |
501 kVector16Size, kVector16Size - 1, vector32, &scale)); | 501 WebRtcSpl_AutoCorrelation(vector16, kVector16Size, |
| 502 kVector16Size - 1, vector32, &scale)); |
502 EXPECT_EQ(3, scale); | 503 EXPECT_EQ(3, scale); |
503 for (int i = 0; i < kVector16Size; ++i) { | 504 for (int i = 0; i < kVector16Size; ++i) { |
504 EXPECT_EQ(expected[i], vector32[i]); | 505 EXPECT_EQ(expected[i], vector32[i]); |
505 } | 506 } |
506 } | 507 } |
507 | 508 |
508 TEST_F(SplTest, SignalProcessingTest) { | 509 TEST_F(SplTest, SignalProcessingTest) { |
509 const int kVectorSize = 4; | 510 const int kVectorSize = 4; |
510 int A[] = {1, 2, 33, 100}; | 511 int A[] = {1, 2, 33, 100}; |
511 const int16_t kHanning[4] = { 2399, 8192, 13985, 16384 }; | 512 const int16_t kHanning[4] = { 2399, 8192, 13985, 16384 }; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 // 12-15 are skipped to account for the filter lag. | 602 // 12-15 are skipped to account for the filter lag. |
602 for (int i = 0; i < 12; ++i) { | 603 for (int i = 0; i < 12; ++i) { |
603 EXPECT_EQ(kRefValue32kHz1, out_vector[i]); | 604 EXPECT_EQ(kRefValue32kHz1, out_vector[i]); |
604 EXPECT_EQ(kRefValue16kHz1, out_vector_w16[i]); | 605 EXPECT_EQ(kRefValue16kHz1, out_vector_w16[i]); |
605 } | 606 } |
606 for (int i = 16; i < 2 * kBlockSize; ++i) { | 607 for (int i = 16; i < 2 * kBlockSize; ++i) { |
607 EXPECT_EQ(kRefValue32kHz2, out_vector[i]); | 608 EXPECT_EQ(kRefValue32kHz2, out_vector[i]); |
608 EXPECT_EQ(kRefValue16kHz2, out_vector_w16[i]); | 609 EXPECT_EQ(kRefValue16kHz2, out_vector_w16[i]); |
609 } | 610 } |
610 } | 611 } |
OLD | NEW |