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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 int main(int argc, char* argv[]) | 94 int main(int argc, char* argv[]) |
95 { | 95 { |
96 | 96 |
97 char inname[100], outname[100], outbitsname[100], bottleneck_file[100]; | 97 char inname[100], outname[100], outbitsname[100], bottleneck_file[100]; |
98 FILE *inp, *outp, *f_bn, *outbits; | 98 FILE *inp, *outp, *f_bn, *outbits; |
99 int endfile; | 99 int endfile; |
100 | 100 |
101 int i, errtype, h = 0, k, packetLossPercent = 0; | 101 int i, errtype, h = 0, k, packetLossPercent = 0; |
102 int16_t CodingMode; | 102 int16_t CodingMode; |
103 int16_t bottleneck; | 103 int16_t bottleneck; |
104 int framesize = 30; /* ms */ | 104 int16_t framesize = 30; /* ms */ |
105 int cur_framesmpls, err = 0, lostPackets = 0; | 105 int cur_framesmpls, err = 0, lostPackets = 0; |
106 | 106 |
107 /* Runtime statistics */ | 107 /* Runtime statistics */ |
108 double starttime, runtime, length_file; | 108 double starttime, runtime, length_file; |
109 | 109 |
110 int16_t stream_len = 0; | 110 int16_t stream_len = 0; |
111 int16_t framecnt; | 111 int16_t framecnt, declen = 0; |
112 int declen = 0; | |
113 int16_t shortdata[FRAMESAMPLES_10ms]; | 112 int16_t shortdata[FRAMESAMPLES_10ms]; |
114 int16_t decoded[MAX_FRAMESAMPLES]; | 113 int16_t decoded[MAX_FRAMESAMPLES]; |
115 uint16_t streamdata[500]; | 114 uint16_t streamdata[500]; |
116 int16_t speechType[1]; | 115 int16_t speechType[1]; |
117 int16_t prevFrameSize = 1; | 116 int16_t prevFrameSize = 1; |
118 int16_t rateBPS = 0; | 117 int16_t rateBPS = 0; |
119 int16_t fixedFL = 0; | 118 int16_t fixedFL = 0; |
120 int16_t payloadSize = 0; | 119 int16_t payloadSize = 0; |
121 int32_t payloadRate = 0; | 120 int32_t payloadRate = 0; |
122 int setControlBWE = 0; | 121 int setControlBWE = 0; |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } | 759 } |
761 prevFrameSize = declen/480; | 760 prevFrameSize = declen/480; |
762 | 761 |
763 } else { | 762 } else { |
764 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED | 763 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED |
765 declen = WebRtcIsacfix_DecodeNb( ISAC_main_inst, streamdata, | 764 declen = WebRtcIsacfix_DecodeNb( ISAC_main_inst, streamdata, |
766 stream_len, decoded, speechType ); | 765 stream_len, decoded, speechType ); |
767 #else | 766 #else |
768 declen = -1; | 767 declen = -1; |
769 #endif | 768 #endif |
770 prevFrameSize = static_cast<int16_t>(declen / 240); | 769 prevFrameSize = declen/240; |
771 } | 770 } |
772 } | 771 } |
773 | 772 |
774 if (declen <= 0) { | 773 if (declen <= 0) { |
775 /* exit if returned with error */ | 774 /* exit if returned with error */ |
776 errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); | 775 errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); |
777 printf("\nError in decoder: %d.\n", errtype); | 776 printf("\nError in decoder: %d.\n", errtype); |
778 } | 777 } |
779 | 778 |
780 /* Write decoded speech frame to file */ | 779 /* Write decoded speech frame to file */ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 fclose(inp); | 826 fclose(inp); |
828 fclose(outp); | 827 fclose(outp); |
829 fclose(outbits); | 828 fclose(outbits); |
830 | 829 |
831 if ( testCE == 1) { | 830 if ( testCE == 1) { |
832 WebRtcIsacfix_FreeInternal(ISAC_main_inst); | 831 WebRtcIsacfix_FreeInternal(ISAC_main_inst); |
833 } | 832 } |
834 WebRtcIsacfix_Free(ISAC_main_inst); | 833 WebRtcIsacfix_Free(ISAC_main_inst); |
835 return 0; | 834 return 0; |
836 } | 835 } |
OLD | NEW |