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

Side by Side Diff: webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c

Issue 1319683002: AudioDecoder: Replace Init() with Reset() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@buffer
Patch Set: review fixes Created 5 years, 3 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 inst->enc_Energy = 0; 162 inst->enc_Energy = 0;
163 for (i = 0; i < (WEBRTC_CNG_MAX_LPC_ORDER + 1); i++) { 163 for (i = 0; i < (WEBRTC_CNG_MAX_LPC_ORDER + 1); i++) {
164 inst->enc_reflCoefs[i] = 0; 164 inst->enc_reflCoefs[i] = 0;
165 inst->enc_corrVector[i] = 0; 165 inst->enc_corrVector[i] = 0;
166 } 166 }
167 inst->initflag = 1; 167 inst->initflag = 1;
168 168
169 return 0; 169 return 0;
170 } 170 }
171 171
172 int16_t WebRtcCng_InitDec(CNG_dec_inst* cng_inst) { 172 void WebRtcCng_InitDec(CNG_dec_inst* cng_inst) {
173 int i; 173 int i;
174 174
175 WebRtcCngDecoder* inst = (WebRtcCngDecoder*) cng_inst; 175 WebRtcCngDecoder* inst = (WebRtcCngDecoder*) cng_inst;
176 176
177 memset(inst, 0, sizeof(WebRtcCngDecoder)); 177 memset(inst, 0, sizeof(WebRtcCngDecoder));
178 inst->dec_seed = 7777; /* For debugging only. */ 178 inst->dec_seed = 7777; /* For debugging only. */
179 inst->dec_order = 5; 179 inst->dec_order = 5;
180 inst->dec_target_scale_factor = 0; 180 inst->dec_target_scale_factor = 0;
181 inst->dec_used_scale_factor = 0; 181 inst->dec_used_scale_factor = 0;
182 for (i = 0; i < (WEBRTC_CNG_MAX_LPC_ORDER + 1); i++) { 182 for (i = 0; i < (WEBRTC_CNG_MAX_LPC_ORDER + 1); i++) {
183 inst->dec_filtstate[i] = 0; 183 inst->dec_filtstate[i] = 0;
184 inst->dec_target_reflCoefs[i] = 0; 184 inst->dec_target_reflCoefs[i] = 0;
185 inst->dec_used_reflCoefs[i] = 0; 185 inst->dec_used_reflCoefs[i] = 0;
186 } 186 }
187 inst->dec_target_reflCoefs[0] = 0; 187 inst->dec_target_reflCoefs[0] = 0;
188 inst->dec_used_reflCoefs[0] = 0; 188 inst->dec_used_reflCoefs[0] = 0;
189 inst->dec_used_energy = 0; 189 inst->dec_used_energy = 0;
190 inst->initflag = 1; 190 inst->initflag = 1;
191
192 return 0;
193 } 191 }
194 192
195 /**************************************************************************** 193 /****************************************************************************
196 * WebRtcCng_FreeEnc/Dec(...) 194 * WebRtcCng_FreeEnc/Dec(...)
197 * 195 *
198 * These functions frees the dynamic memory of a specified instance 196 * These functions frees the dynamic memory of a specified instance
199 * 197 *
200 * Input: 198 * Input:
201 * - cng_inst : Pointer to created instance that should be freed 199 * - cng_inst : Pointer to created instance that should be freed
202 * 200 *
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 /* Typecast pointer to real structure. */ 594 /* Typecast pointer to real structure. */
597 WebRtcCngEncoder* inst = (WebRtcCngEncoder*) cng_inst; 595 WebRtcCngEncoder* inst = (WebRtcCngEncoder*) cng_inst;
598 return inst->errorcode; 596 return inst->errorcode;
599 } 597 }
600 598
601 int16_t WebRtcCng_GetErrorCodeDec(CNG_dec_inst* cng_inst) { 599 int16_t WebRtcCng_GetErrorCodeDec(CNG_dec_inst* cng_inst) {
602 /* Typecast pointer to real structure. */ 600 /* Typecast pointer to real structure. */
603 WebRtcCngDecoder* inst = (WebRtcCngDecoder*) cng_inst; 601 WebRtcCngDecoder* inst = (WebRtcCngDecoder*) cng_inst;
604 return inst->errorcode; 602 return inst->errorcode;
605 } 603 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/cng/include/webrtc_cng.h ('k') | webrtc/modules/audio_coding/codecs/g722/g722_decode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698