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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 double rateUB = 0; | 91 double rateUB = 0; |
92 #endif | 92 #endif |
93 FILE* histFile; | 93 FILE* histFile; |
94 FILE* averageFile; | 94 FILE* averageFile; |
95 int sampFreqKHz; | 95 int sampFreqKHz; |
96 int samplesIn10Ms; | 96 int samplesIn10Ms; |
97 int16_t maxStreamLen = 0; | 97 int16_t maxStreamLen = 0; |
98 char histFileName[500]; | 98 char histFileName[500]; |
99 char averageFileName[500]; | 99 char averageFileName[500]; |
100 unsigned int hist[600]; | 100 unsigned int hist[600]; |
101 unsigned int tmpSumStreamLen = 0; | 101 double tmpSumStreamLen = 0; |
kwiberg-webrtc
2015/06/08 13:09:38
0.0 when you assign to a double, for clarity?
Peter Kasting
2015/06/08 20:44:29
I can if you really want, though I'm not a big fan
kwiberg-webrtc
2015/06/09 00:48:12
The WebRTC audio code is littered with float liter
Peter Kasting
2015/06/10 01:09:54
Acknowledged.
| |
102 unsigned int packetCntr = 0; | 102 unsigned int packetCntr = 0; |
103 unsigned int lostPacketCntr = 0; | 103 unsigned int lostPacketCntr = 0; |
104 uint8_t payload[1200]; | 104 uint8_t payload[1200]; |
105 uint8_t payloadRCU[1200]; | 105 uint8_t payloadRCU[1200]; |
106 uint16_t packetLossPercent = 0; | 106 uint16_t packetLossPercent = 0; |
107 int16_t rcuStreamLen = 0; | 107 int16_t rcuStreamLen = 0; |
108 int onlyEncode; | 108 int onlyEncode; |
109 int onlyDecode; | 109 int onlyDecode; |
110 | 110 |
111 BottleNeckModel packetData; | 111 BottleNeckModel packetData; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 | 379 |
380 maxStreamLen = (stream_len > maxStreamLen) ? stream_len : maxStreamLen; | 380 maxStreamLen = (stream_len > maxStreamLen) ? stream_len : maxStreamLen; |
381 packetCntr++; | 381 packetCntr++; |
382 | 382 |
383 hist[stream_len]++; | 383 hist[stream_len]++; |
384 if (averageFile != NULL) { | 384 if (averageFile != NULL) { |
385 tmpSumStreamLen += stream_len; | 385 tmpSumStreamLen += stream_len; |
386 if (packetCntr == 100) { | 386 if (packetCntr == 100) { |
387 // kbps | 387 // kbps |
388 fprintf(averageFile, "%8.3f ", | 388 fprintf(averageFile, "%8.3f ", |
389 (double)tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); | 389 tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); |
390 packetCntr = 0; | 390 packetCntr = 0; |
391 tmpSumStreamLen = 0; | 391 tmpSumStreamLen = 0; |
kwiberg-webrtc
2015/06/08 13:09:38
0.0 here too? (And in any more places?)
| |
392 } | 392 } |
393 } | 393 } |
394 | 394 |
395 if (onlyEncode) { | 395 if (onlyEncode) { |
396 uint8_t auxUW8; | 396 uint8_t auxUW8; |
397 auxUW8 = (uint8_t)(((stream_len & 0x7F00) >> 8) & 0xFF); | 397 auxUW8 = (uint8_t)(((stream_len & 0x7F00) >> 8) & 0xFF); |
398 if (fwrite(&auxUW8, sizeof(uint8_t), 1, outp) != 1) { | 398 if (fwrite(&auxUW8, sizeof(uint8_t), 1, outp) != 1) { |
399 return -1; | 399 return -1; |
400 } | 400 } |
401 | 401 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
499 int n; | 499 int n; |
500 for (n = 0; n < 600; n++) { | 500 for (n = 0; n < 600; n++) { |
501 fprintf(histFile, "%6d ", hist[n]); | 501 fprintf(histFile, "%6d ", hist[n]); |
502 } | 502 } |
503 fprintf(histFile, "\n"); | 503 fprintf(histFile, "\n"); |
504 fclose(histFile); | 504 fclose(histFile); |
505 } | 505 } |
506 if (averageFile != NULL) { | 506 if (averageFile != NULL) { |
507 if (packetCntr > 0) { | 507 if (packetCntr > 0) { |
508 fprintf(averageFile, "%8.3f ", | 508 fprintf(averageFile, "%8.3f ", |
509 (double)tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); | 509 tmpSumStreamLen * 8.0 / (30.0 * packetCntr)); |
510 } | 510 } |
511 fprintf(averageFile, "\n"); | 511 fprintf(averageFile, "\n"); |
512 fclose(averageFile); | 512 fclose(averageFile); |
513 } | 513 } |
514 | 514 |
515 fclose(inp); | 515 fclose(inp); |
516 fclose(outp); | 516 fclose(outp); |
517 | 517 |
518 WebRtcIsac_Free(ISAC_main_inst); | 518 WebRtcIsac_Free(ISAC_main_inst); |
519 | 519 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 str->lastArrivalTime = 0; | 575 str->lastArrivalTime = 0; |
576 | 576 |
577 str->maxPayloadLB = 0; | 577 str->maxPayloadLB = 0; |
578 str->maxPayloadUB = 0; | 578 str->maxPayloadUB = 0; |
579 str->lbBytes = 0; | 579 str->lbBytes = 0; |
580 str->ubBytes = 0; | 580 str->ubBytes = 0; |
581 | 581 |
582 return 0; | 582 return 0; |
583 }; | 583 }; |
584 #endif | 584 #endif |
OLD | NEW |