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

Side by Side Diff: webrtc/modules/audio_coding/test/utility.h

Issue 2667383008: Move one CircularBuffer to webrtc::test namespace. (Closed)
Patch Set: Rebase. Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 private: 77 private:
78 void Adjust(); 78 void Adjust();
79 79
80 unsigned short _msec; 80 unsigned short _msec;
81 unsigned char _sec; 81 unsigned char _sec;
82 unsigned char _min; 82 unsigned char _min;
83 unsigned long _hour; 83 unsigned long _hour;
84 }; 84 };
85 85
86 // To avoid clashes with CircularBuffer in APM.
87 namespace test {
88
86 class CircularBuffer { 89 class CircularBuffer {
87 public: 90 public:
88 CircularBuffer(uint32_t len); 91 CircularBuffer(uint32_t len);
89 ~CircularBuffer(); 92 ~CircularBuffer();
90 93
91 void SetArithMean(bool enable); 94 void SetArithMean(bool enable);
92 void SetVariance(bool enable); 95 void SetVariance(bool enable);
93 96
94 void Update(const double newVal); 97 void Update(const double newVal);
95 void IsBufferFull(); 98 void IsBufferFull();
96 99
97 int16_t Variance(double& var); 100 int16_t Variance(double& var);
98 int16_t ArithMean(double& mean); 101 int16_t ArithMean(double& mean);
99 102
100 protected: 103 protected:
101 double* _buff; 104 double* _buff;
102 uint32_t _idx; 105 uint32_t _idx;
103 uint32_t _buffLen; 106 uint32_t _buffLen;
104 107
105 bool _buffIsFull; 108 bool _buffIsFull;
106 bool _calcAvg; 109 bool _calcAvg;
107 bool _calcVar; 110 bool _calcVar;
108 double _sum; 111 double _sum;
109 double _sumSqr; 112 double _sumSqr;
110 }; 113 };
111 114
115 } // namespace test
116
112 int16_t ChooseCodec(CodecInst& codecInst); 117 int16_t ChooseCodec(CodecInst& codecInst);
113 118
114 void PrintCodecs(); 119 void PrintCodecs();
115 120
116 bool FixedPayloadTypeCodec(const char* payloadName); 121 bool FixedPayloadTypeCodec(const char* payloadName);
117 122
118 class VADCallback : public ACMVADCallback { 123 class VADCallback : public ACMVADCallback {
119 public: 124 public:
120 VADCallback(); 125 VADCallback();
121 126
122 int32_t InFrameType(FrameType frame_type) override; 127 int32_t InFrameType(FrameType frame_type) override;
123 128
124 void PrintFrameTypes(); 129 void PrintFrameTypes();
125 void Reset(); 130 void Reset();
126 131
127 private: 132 private:
128 uint32_t _numFrameTypes[5]; 133 uint32_t _numFrameTypes[5];
129 }; 134 };
130 135
131 } // namespace webrtc 136 } // namespace webrtc
132 137
133 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_UTILITY_H_ 138 #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_UTILITY_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/test/APITest.cc ('k') | webrtc/modules/audio_coding/test/utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698