Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc

Issue 1179093002: Reland "Upconvert various types to int.", isac portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int main(int argc, char* argv[]) 95 int main(int argc, char* argv[])
96 { 96 {
97 97
98 char inname[100], outname[100], outbitsname[100], bottleneck_file[100]; 98 char inname[100], outname[100], outbitsname[100], bottleneck_file[100];
99 FILE *inp, *outp, *f_bn, *outbits; 99 FILE *inp, *outp, *f_bn, *outbits;
100 int endfile; 100 int endfile;
101 101
102 int i, errtype, h = 0, k, packetLossPercent = 0; 102 int i, errtype, h = 0, k, packetLossPercent = 0;
103 int16_t CodingMode; 103 int16_t CodingMode;
104 int16_t bottleneck; 104 int16_t bottleneck;
105 int16_t framesize = 30; /* ms */ 105 int framesize = 30; /* ms */
106 int cur_framesmpls, err = 0, lostPackets = 0; 106 int cur_framesmpls, err = 0, lostPackets = 0;
107 107
108 /* Runtime statistics */ 108 /* Runtime statistics */
109 double starttime, runtime, length_file; 109 double starttime, runtime, length_file;
110 110
111 int16_t stream_len = 0; 111 int16_t stream_len = 0;
112 int16_t framecnt, declen = 0; 112 int16_t framecnt;
113 int declen = 0;
113 int16_t shortdata[FRAMESAMPLES_10ms]; 114 int16_t shortdata[FRAMESAMPLES_10ms];
114 int16_t decoded[MAX_FRAMESAMPLES]; 115 int16_t decoded[MAX_FRAMESAMPLES];
115 uint16_t streamdata[500]; 116 uint16_t streamdata[500];
116 int16_t speechType[1]; 117 int16_t speechType[1];
117 int16_t prevFrameSize = 1; 118 int16_t prevFrameSize = 1;
118 int16_t rateBPS = 0; 119 int16_t rateBPS = 0;
119 int16_t fixedFL = 0; 120 int16_t fixedFL = 0;
120 int16_t payloadSize = 0; 121 int16_t payloadSize = 0;
121 int32_t payloadRate = 0; 122 int32_t payloadRate = 0;
122 int setControlBWE = 0; 123 int setControlBWE = 0;
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 } 761 }
761 prevFrameSize = declen/480; 762 prevFrameSize = declen/480;
762 763
763 } else { 764 } else {
764 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 765 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
765 declen = WebRtcIsacfix_DecodeNb( ISAC_main_inst, streamdata, 766 declen = WebRtcIsacfix_DecodeNb( ISAC_main_inst, streamdata,
766 stream_len, decoded, speechType ); 767 stream_len, decoded, speechType );
767 #else 768 #else
768 declen = -1; 769 declen = -1;
769 #endif 770 #endif
770 prevFrameSize = declen/240; 771 prevFrameSize = static_cast<int16_t>(declen / 240);
771 } 772 }
772 } 773 }
773 774
774 if (declen <= 0) { 775 if (declen <= 0) {
775 /* exit if returned with error */ 776 /* exit if returned with error */
776 errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst); 777 errtype=WebRtcIsacfix_GetErrorCode(ISAC_main_inst);
777 printf("\nError in decoder: %d.\n", errtype); 778 printf("\nError in decoder: %d.\n", errtype);
778 } 779 }
779 780
780 /* Write decoded speech frame to file */ 781 /* Write decoded speech frame to file */
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 fclose(inp); 828 fclose(inp);
828 fclose(outp); 829 fclose(outp);
829 fclose(outbits); 830 fclose(outbits);
830 831
831 if ( testCE == 1) { 832 if ( testCE == 1) {
832 WebRtcIsacfix_FreeInternal(ISAC_main_inst); 833 WebRtcIsacfix_FreeInternal(ISAC_main_inst);
833 } 834 }
834 WebRtcIsacfix_Free(ISAC_main_inst); 835 WebRtcIsacfix_Free(ISAC_main_inst);
835 return 0; 836 return 0;
836 } 837 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698