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