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 18 matching lines...) Expand all Loading... |
29 if (rlen >= length) | 29 if (rlen >= length) |
30 return false; | 30 return false; |
31 memset(data + rlen, 0, (length - rlen) * sizeof(int16_t)); | 31 memset(data + rlen, 0, (length - rlen) * sizeof(int16_t)); |
32 return true; | 32 return true; |
33 } | 33 } |
34 | 34 |
35 int main(int argc, char* argv[]) { | 35 int main(int argc, char* argv[]) { |
36 char inname[80], outname[40], bitname[40]; | 36 char inname[80], outname[40], bitname[40]; |
37 FILE* inp; | 37 FILE* inp; |
38 FILE* outp; | 38 FILE* outp; |
39 FILE* bitp = NULL; | 39 FILE* bitp = nullptr; |
40 int framecnt; | 40 int framecnt; |
41 bool endfile; | 41 bool endfile; |
42 | 42 |
43 size_t framelength = 80; | 43 size_t framelength = 80; |
44 | 44 |
45 /* Runtime statistics */ | 45 /* Runtime statistics */ |
46 double starttime; | 46 double starttime; |
47 double runtime; | 47 double runtime; |
48 double length_file; | 48 double length_file; |
49 | 49 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 framelength = static_cast<size_t>(framelength_int); | 86 framelength = static_cast<size_t>(framelength_int); |
87 | 87 |
88 /* Get compression law */ | 88 /* Get compression law */ |
89 strcpy(law, argv[2]); | 89 strcpy(law, argv[2]); |
90 | 90 |
91 /* Get Input and Output files */ | 91 /* Get Input and Output files */ |
92 sscanf(argv[3], "%s", inname); | 92 sscanf(argv[3], "%s", inname); |
93 sscanf(argv[4], "%s", outname); | 93 sscanf(argv[4], "%s", outname); |
94 if (argc == 6) { | 94 if (argc == 6) { |
95 sscanf(argv[5], "%s", bitname); | 95 sscanf(argv[5], "%s", bitname); |
96 if ((bitp = fopen(bitname, "wb")) == NULL) { | 96 if ((bitp = fopen(bitname, "wb")) == nullptr) { |
97 printf(" G.711: Cannot read file %s.\n", bitname); | 97 printf(" G.711: Cannot read file %s.\n", bitname); |
98 exit(1); | 98 exit(1); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 if ((inp = fopen(inname, "rb")) == NULL) { | 102 if ((inp = fopen(inname, "rb")) == nullptr) { |
103 printf(" G.711: Cannot read file %s.\n", inname); | 103 printf(" G.711: Cannot read file %s.\n", inname); |
104 exit(1); | 104 exit(1); |
105 } | 105 } |
106 if ((outp = fopen(outname, "wb")) == NULL) { | 106 if ((outp = fopen(outname, "wb")) == nullptr) { |
107 printf(" G.711: Cannot write file %s.\n", outname); | 107 printf(" G.711: Cannot write file %s.\n", outname); |
108 exit(1); | 108 exit(1); |
109 } | 109 } |
110 printf("\nInput: %s\nOutput: %s\n", inname, outname); | 110 printf("\nInput: %s\nOutput: %s\n", inname, outname); |
111 if (argc == 6) { | 111 if (argc == 6) { |
112 printf("\nBitfile: %s\n", bitname); | 112 printf("\nBitfile: %s\n", bitname); |
113 } | 113 } |
114 | 114 |
115 starttime = clock() / (double) CLOCKS_PER_SEC_G711; /* Runtime statistics */ | 115 starttime = clock() / (double) CLOCKS_PER_SEC_G711; /* Runtime statistics */ |
116 | 116 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 printf("Time to run G.711: %.2f s (%.2f %% of realtime)\n\n", | 161 printf("Time to run G.711: %.2f s (%.2f %% of realtime)\n\n", |
162 runtime, | 162 runtime, |
163 (100 * runtime / length_file)); | 163 (100 * runtime / length_file)); |
164 printf("---------------------END----------------------\n"); | 164 printf("---------------------END----------------------\n"); |
165 | 165 |
166 fclose(inp); | 166 fclose(inp); |
167 fclose(outp); | 167 fclose(outp); |
168 | 168 |
169 return 0; | 169 return 0; |
170 } | 170 } |
OLD | NEW |