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

Side by Side Diff: webrtc/modules/audio_coding/codecs/g722/g722_interface.c

Issue 1172163004: Reformat existing code. There should be no functional effects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync 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) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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
45 return WebRtc_g722_encode_release((G722EncoderState*) G722enc_inst); 45 return WebRtc_g722_encode_release((G722EncoderState*) G722enc_inst);
46 } 46 }
47 47
48 int16_t WebRtcG722_Encode(G722EncInst *G722enc_inst, 48 int16_t WebRtcG722_Encode(G722EncInst *G722enc_inst,
49 const int16_t* speechIn, 49 const int16_t* speechIn,
50 int16_t len, 50 int16_t len,
51 uint8_t* encoded) 51 uint8_t* encoded)
52 { 52 {
53 unsigned char *codechar = (unsigned char*) encoded; 53 unsigned char *codechar = (unsigned char*) encoded;
54 // Encode the input speech vector 54 // Encode the input speech vector
55 return WebRtc_g722_encode((G722EncoderState*) G722enc_inst, 55 return WebRtc_g722_encode((G722EncoderState*) G722enc_inst, codechar,
56 codechar, speechIn, len); 56 speechIn, len);
57 } 57 }
58 58
59 int16_t WebRtcG722_CreateDecoder(G722DecInst **G722dec_inst) 59 int16_t WebRtcG722_CreateDecoder(G722DecInst **G722dec_inst)
60 { 60 {
61 *G722dec_inst=(G722DecInst*)malloc(sizeof(G722DecoderState)); 61 *G722dec_inst=(G722DecInst*)malloc(sizeof(G722DecoderState));
62 if (*G722dec_inst!=NULL) { 62 if (*G722dec_inst!=NULL) {
63 return(0); 63 return(0);
64 } else { 64 } else {
65 return(-1); 65 return(-1);
66 } 66 }
(...skipping 19 matching lines...) Expand all
86 } 86 }
87 87
88 int16_t WebRtcG722_Decode(G722DecInst *G722dec_inst, 88 int16_t WebRtcG722_Decode(G722DecInst *G722dec_inst,
89 const uint8_t *encoded, 89 const uint8_t *encoded,
90 int16_t len, 90 int16_t len,
91 int16_t *decoded, 91 int16_t *decoded,
92 int16_t *speechType) 92 int16_t *speechType)
93 { 93 {
94 // Decode the G.722 encoder stream 94 // Decode the G.722 encoder stream
95 *speechType=G722_WEBRTC_SPEECH; 95 *speechType=G722_WEBRTC_SPEECH;
96 return WebRtc_g722_decode((G722DecoderState*) G722dec_inst, 96 return WebRtc_g722_decode((G722DecoderState*) G722dec_inst, decoded,
97 decoded, encoded, len); 97 encoded, len);
98 } 98 }
99 99
100 int16_t WebRtcG722_Version(char *versionStr, short len) 100 int16_t WebRtcG722_Version(char *versionStr, short len)
101 { 101 {
102 // Get version string 102 // Get version string
103 char version[30] = "2.0.0\n"; 103 char version[30] = "2.0.0\n";
104 if (strlen(version) < (unsigned int)len) 104 if (strlen(version) < (unsigned int)len)
105 { 105 {
106 strcpy(versionStr, version); 106 strcpy(versionStr, version);
107 return 0; 107 return 0;
108 } 108 }
109 else 109 else
110 { 110 {
111 return -1; 111 return -1;
112 } 112 }
113 } 113 }
114 114
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698