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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc

Issue 1484343003: NetEq: Add codec name and RTP timestamp rate to DecoderInfo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years 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
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 16 matching lines...) Expand all
27 namespace test { 27 namespace test {
28 28
29 int64_t NetEqPerformanceTest::Run(int runtime_ms, 29 int64_t NetEqPerformanceTest::Run(int runtime_ms,
30 int lossrate, 30 int lossrate,
31 double drift_factor) { 31 double drift_factor) {
32 const std::string kInputFileName = 32 const std::string kInputFileName =
33 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"); 33 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
34 const int kSampRateHz = 32000; 34 const int kSampRateHz = 32000;
35 const webrtc::NetEqDecoder kDecoderType = 35 const webrtc::NetEqDecoder kDecoderType =
36 webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz; 36 webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz;
37 const std::string kDecoderName = "pcm16-swb32";
37 const int kPayloadType = 95; 38 const int kPayloadType = 95;
38 39
39 // Initialize NetEq instance. 40 // Initialize NetEq instance.
40 NetEq::Config config; 41 NetEq::Config config;
41 config.sample_rate_hz = kSampRateHz; 42 config.sample_rate_hz = kSampRateHz;
42 NetEq* neteq = NetEq::Create(config); 43 NetEq* neteq = NetEq::Create(config);
43 // Register decoder in |neteq|. 44 // Register decoder in |neteq|.
44 if (neteq->RegisterPayloadType(kDecoderType, kPayloadType) != 0) 45 if (neteq->RegisterPayloadType(kDecoderType, kDecoderName, kPayloadType) != 0)
45 return -1; 46 return -1;
46 47
47 // Set up AudioLoop object. 48 // Set up AudioLoop object.
48 AudioLoop audio_loop; 49 AudioLoop audio_loop;
49 const size_t kMaxLoopLengthSamples = kSampRateHz * 10; // 10 second loop. 50 const size_t kMaxLoopLengthSamples = kSampRateHz * 10; // 10 second loop.
50 const size_t kInputBlockSizeSamples = 60 * kSampRateHz / 1000; // 60 ms. 51 const size_t kInputBlockSizeSamples = 60 * kSampRateHz / 1000; // 60 ms.
51 if (!audio_loop.Init(kInputFileName, kMaxLoopLengthSamples, 52 if (!audio_loop.Init(kInputFileName, kMaxLoopLengthSamples,
52 kInputBlockSizeSamples)) 53 kInputBlockSizeSamples))
53 return -1; 54 return -1;
54 55
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 drift_flipped = true; 125 drift_flipped = true;
125 } 126 }
126 } 127 }
127 int64_t end_time_ms = clock->TimeInMilliseconds(); 128 int64_t end_time_ms = clock->TimeInMilliseconds();
128 delete neteq; 129 delete neteq;
129 return end_time_ms - start_time_ms; 130 return end_time_ms - start_time_ms;
130 } 131 }
131 132
132 } // namespace test 133 } // namespace test
133 } // namespace webrtc 134 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698