| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int i, errtype, VADusage = 0, packetLossPercent = 0; | 47 int i, errtype, VADusage = 0, packetLossPercent = 0; |
| 48 int16_t CodingMode; | 48 int16_t CodingMode; |
| 49 int32_t bottleneck = 0; | 49 int32_t bottleneck = 0; |
| 50 int16_t framesize = 30; /* ms */ | 50 int16_t framesize = 30; /* ms */ |
| 51 int cur_framesmpls, err; | 51 int cur_framesmpls, err; |
| 52 | 52 |
| 53 /* Runtime statistics */ | 53 /* Runtime statistics */ |
| 54 double starttime, runtime, length_file; | 54 double starttime, runtime, length_file; |
| 55 | 55 |
| 56 int16_t stream_len = 0; | 56 int16_t stream_len = 0; |
| 57 int16_t declen = 0, lostFrame = 0, declenTC = 0; | 57 int16_t declen = 0, declenTC = 0; |
| 58 bool lostFrame = false; |
| 58 | 59 |
| 59 int16_t shortdata[SWBFRAMESAMPLES_10ms]; | 60 int16_t shortdata[SWBFRAMESAMPLES_10ms]; |
| 60 int16_t vaddata[SWBFRAMESAMPLES_10ms * 3]; | 61 int16_t vaddata[SWBFRAMESAMPLES_10ms * 3]; |
| 61 int16_t decoded[MAX_FRAMESAMPLES << 1]; | 62 int16_t decoded[MAX_FRAMESAMPLES << 1]; |
| 62 int16_t decodedTC[MAX_FRAMESAMPLES << 1]; | 63 int16_t decodedTC[MAX_FRAMESAMPLES << 1]; |
| 63 uint16_t streamdata[500]; | 64 uint16_t streamdata[500]; |
| 64 int16_t speechType[1]; | 65 int16_t speechType[1]; |
| 65 int16_t rateBPS = 0; | 66 int16_t rateBPS = 0; |
| 66 int16_t fixedFL = 0; | 67 int16_t fixedFL = 0; |
| 67 int16_t payloadSize = 0; | 68 int16_t payloadSize = 0; |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 maxStreamLen30 = | 725 maxStreamLen30 = |
| 725 (stream_len > maxStreamLen30) ? stream_len : maxStreamLen30; | 726 (stream_len > maxStreamLen30) ? stream_len : maxStreamLen30; |
| 726 } else { | 727 } else { |
| 727 maxStreamLen60 = | 728 maxStreamLen60 = |
| 728 (stream_len > maxStreamLen60) ? stream_len : maxStreamLen60; | 729 (stream_len > maxStreamLen60) ? stream_len : maxStreamLen60; |
| 729 } | 730 } |
| 730 | 731 |
| 731 if (!lostFrame) { | 732 if (!lostFrame) { |
| 732 lostFrame = ((rand() % 100) < packetLossPercent); | 733 lostFrame = ((rand() % 100) < packetLossPercent); |
| 733 } else { | 734 } else { |
| 734 lostFrame = 0; | 735 lostFrame = false; |
| 735 } | 736 } |
| 736 | 737 |
| 737 // RED. | 738 // RED. |
| 738 if (lostFrame) { | 739 if (lostFrame) { |
| 739 stream_len = WebRtcIsac_GetRedPayload( | 740 stream_len = WebRtcIsac_GetRedPayload( |
| 740 ISAC_main_inst, reinterpret_cast<uint8_t*>(streamdata)); | 741 ISAC_main_inst, reinterpret_cast<uint8_t*>(streamdata)); |
| 741 | 742 |
| 742 if (doTransCoding) { | 743 if (doTransCoding) { |
| 743 streamLenTransCoding = WebRtcIsac_GetNewBitStream( | 744 streamLenTransCoding = WebRtcIsac_GetNewBitStream( |
| 744 ISAC_main_inst, bnIdxTC, jitterInfoTC, rateTransCoding, | 745 ISAC_main_inst, bnIdxTC, jitterInfoTC, rateTransCoding, |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 fprintf(stderr, " transcoding rate %.0f kbps", | 973 fprintf(stderr, " transcoding rate %.0f kbps", |
| 973 (double)numTransCodingBytes * 8.0 * (sampFreqKHz) / totalsmpls); | 974 (double)numTransCodingBytes * 8.0 * (sampFreqKHz) / totalsmpls); |
| 974 } | 975 } |
| 975 | 976 |
| 976 fclose(inp); | 977 fclose(inp); |
| 977 fclose(outp); | 978 fclose(outp); |
| 978 WebRtcIsac_Free(ISAC_main_inst); | 979 WebRtcIsac_Free(ISAC_main_inst); |
| 979 | 980 |
| 980 exit(0); | 981 exit(0); |
| 981 } | 982 } |
| OLD | NEW |