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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int16_t CodingMode; | 46 int16_t CodingMode; |
47 int32_t bottleneck = 0; | 47 int32_t bottleneck = 0; |
48 int framesize = 30; /* ms */ | 48 int framesize = 30; /* ms */ |
49 int cur_framesmpls, err; | 49 int cur_framesmpls, err; |
50 | 50 |
51 /* Runtime statistics */ | 51 /* Runtime statistics */ |
52 double starttime, runtime, length_file; | 52 double starttime, runtime, length_file; |
53 | 53 |
54 int16_t stream_len = 0; | 54 int16_t stream_len = 0; |
55 int declen = 0, declenTC = 0; | 55 int declen = 0, declenTC = 0; |
56 int16_t lostFrame = 0; | 56 bool lostFrame = false; |
57 | 57 |
58 int16_t shortdata[SWBFRAMESAMPLES_10ms]; | 58 int16_t shortdata[SWBFRAMESAMPLES_10ms]; |
59 int16_t vaddata[SWBFRAMESAMPLES_10ms * 3]; | 59 int16_t vaddata[SWBFRAMESAMPLES_10ms * 3]; |
60 int16_t decoded[MAX_FRAMESAMPLES << 1]; | 60 int16_t decoded[MAX_FRAMESAMPLES << 1]; |
61 int16_t decodedTC[MAX_FRAMESAMPLES << 1]; | 61 int16_t decodedTC[MAX_FRAMESAMPLES << 1]; |
62 uint16_t streamdata[500]; | 62 uint16_t streamdata[500]; |
63 int16_t speechType[1]; | 63 int16_t speechType[1]; |
64 int16_t rateBPS = 0; | 64 int16_t rateBPS = 0; |
65 int16_t fixedFL = 0; | 65 int16_t fixedFL = 0; |
66 int16_t payloadSize = 0; | 66 int16_t payloadSize = 0; |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 maxStreamLen30 = | 690 maxStreamLen30 = |
691 (stream_len > maxStreamLen30) ? stream_len : maxStreamLen30; | 691 (stream_len > maxStreamLen30) ? stream_len : maxStreamLen30; |
692 } else { | 692 } else { |
693 maxStreamLen60 = | 693 maxStreamLen60 = |
694 (stream_len > maxStreamLen60) ? stream_len : maxStreamLen60; | 694 (stream_len > maxStreamLen60) ? stream_len : maxStreamLen60; |
695 } | 695 } |
696 | 696 |
697 if (!lostFrame) { | 697 if (!lostFrame) { |
698 lostFrame = ((rand() % 100) < packetLossPercent); | 698 lostFrame = ((rand() % 100) < packetLossPercent); |
699 } else { | 699 } else { |
700 lostFrame = 0; | 700 lostFrame = false; |
701 } | 701 } |
702 | 702 |
703 // RED. | 703 // RED. |
704 if (lostFrame) { | 704 if (lostFrame) { |
705 stream_len = WebRtcIsac_GetRedPayload( | 705 stream_len = WebRtcIsac_GetRedPayload( |
706 ISAC_main_inst, reinterpret_cast<uint8_t*>(streamdata)); | 706 ISAC_main_inst, reinterpret_cast<uint8_t*>(streamdata)); |
707 | 707 |
708 if (doTransCoding) { | 708 if (doTransCoding) { |
709 streamLenTransCoding = WebRtcIsac_GetNewBitStream( | 709 streamLenTransCoding = WebRtcIsac_GetNewBitStream( |
710 ISAC_main_inst, bnIdxTC, jitterInfoTC, rateTransCoding, | 710 ISAC_main_inst, bnIdxTC, jitterInfoTC, rateTransCoding, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 fprintf(stderr, " transcoding rate %.0f kbps", | 933 fprintf(stderr, " transcoding rate %.0f kbps", |
934 (double)numTransCodingBytes * 8.0 * (sampFreqKHz) / totalsmpls); | 934 (double)numTransCodingBytes * 8.0 * (sampFreqKHz) / totalsmpls); |
935 } | 935 } |
936 | 936 |
937 fclose(inp); | 937 fclose(inp); |
938 fclose(outp); | 938 fclose(outp); |
939 WebRtcIsac_Free(ISAC_main_inst); | 939 WebRtcIsac_Free(ISAC_main_inst); |
940 | 940 |
941 exit(0); | 941 exit(0); |
942 } | 942 } |
OLD | NEW |