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

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

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
« no previous file with comments | « webrtc/modules/audio_coding/test/utility.h ('k') | no next file » | 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) 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 CodecInst codecInst; 129 CodecInst codecInst;
130 printf("No Name [Hz] [bps]\n"); 130 printf("No Name [Hz] [bps]\n");
131 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) { 131 for (uint8_t codecCntr = 0; codecCntr < noCodec; codecCntr++) {
132 AudioCodingModule::Codec(codecCntr, &codecInst); 132 AudioCodingModule::Codec(codecCntr, &codecInst);
133 printf("%2d- %-18s %5d %6d\n", codecCntr, codecInst.plname, 133 printf("%2d- %-18s %5d %6d\n", codecCntr, codecInst.plname,
134 codecInst.plfreq, codecInst.rate); 134 codecInst.plfreq, codecInst.rate);
135 } 135 }
136 136
137 } 137 }
138 138
139 namespace test {
140
139 CircularBuffer::CircularBuffer(uint32_t len) 141 CircularBuffer::CircularBuffer(uint32_t len)
140 : _buff(NULL), 142 : _buff(NULL),
141 _idx(0), 143 _idx(0),
142 _buffIsFull(false), 144 _buffIsFull(false),
143 _calcAvg(false), 145 _calcAvg(false),
144 _calcVar(false), 146 _calcVar(false),
145 _sum(0), 147 _sum(0),
146 _sumSqr(0) { 148 _sumSqr(0) {
147 _buff = new double[len]; 149 _buff = new double[len];
148 if (_buff == NULL) { 150 if (_buff == NULL) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } else { 260 } else {
259 if (_idx > 0) { 261 if (_idx > 0) {
260 var = _sumSqr / (double) _idx; 262 var = _sumSqr / (double) _idx;
261 return 0; 263 return 0;
262 } else { 264 } else {
263 return -1; 265 return -1;
264 } 266 }
265 } 267 }
266 } 268 }
267 269
270 } // namespace test
271
268 bool FixedPayloadTypeCodec(const char* payloadName) { 272 bool FixedPayloadTypeCodec(const char* payloadName) {
269 char fixPayloadTypeCodecs[NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE][32] = { "PCMU", 273 char fixPayloadTypeCodecs[NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE][32] = { "PCMU",
270 "PCMA", "GSM", "G723", "DVI4", "LPC", "PCMA", "G722", "QCELP", "CN", 274 "PCMA", "GSM", "G723", "DVI4", "LPC", "PCMA", "G722", "QCELP", "CN",
271 "MPA", "G728", "G729" }; 275 "MPA", "G728", "G729" };
272 276
273 for (int n = 0; n < NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE; n++) { 277 for (int n = 0; n < NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE; n++) {
274 if (!STR_CASE_CMP(payloadName, fixPayloadTypeCodecs[n])) { 278 if (!STR_CASE_CMP(payloadName, fixPayloadTypeCodecs[n])) {
275 return true; 279 return true;
276 } 280 }
277 } 281 }
(...skipping 15 matching lines...) Expand all
293 printf("kVideoFrameKey...... %d\n", _numFrameTypes[kVideoFrameKey]); 297 printf("kVideoFrameKey...... %d\n", _numFrameTypes[kVideoFrameKey]);
294 printf("kVideoFrameDelta.... %d\n", _numFrameTypes[kVideoFrameDelta]); 298 printf("kVideoFrameDelta.... %d\n", _numFrameTypes[kVideoFrameDelta]);
295 } 299 }
296 300
297 int32_t VADCallback::InFrameType(FrameType frame_type) { 301 int32_t VADCallback::InFrameType(FrameType frame_type) {
298 _numFrameTypes[frame_type]++; 302 _numFrameTypes[frame_type]++;
299 return 0; 303 return 0;
300 } 304 }
301 305
302 } // namespace webrtc 306 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/test/utility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698