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

Side by Side Diff: webrtc/modules/audio_processing/ns/nsx_core_mips.c

Issue 2274083002: Replace calls to assert() with RTC_DCHECK_*() in .c code (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 4 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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
11 #include <assert.h>
12 #include <string.h> 11 #include <string.h>
13 12
13 #include "webrtc/base/checks.h"
14 #include "webrtc/modules/audio_processing/ns/noise_suppression_x.h" 14 #include "webrtc/modules/audio_processing/ns/noise_suppression_x.h"
15 #include "webrtc/modules/audio_processing/ns/nsx_core.h" 15 #include "webrtc/modules/audio_processing/ns/nsx_core.h"
16 16
17 static const int16_t kIndicatorTable[17] = { 17 static const int16_t kIndicatorTable[17] = {
18 0, 2017, 3809, 5227, 6258, 6963, 7424, 7718, 18 0, 2017, 3809, 5227, 6258, 6963, 7424, 7718,
19 7901, 8014, 8084, 8126, 8152, 8168, 8177, 8183, 8187 19 7901, 8014, 8084, 8126, 8152, 8168, 8177, 8183, 8187
20 }; 20 };
21 21
22 // Compute speech/noise probability 22 // Compute speech/noise probability
23 // speech/noise probability is returned in: probSpeechFinal 23 // speech/noise probability is returned in: probSpeechFinal
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 indPriorFX += inst->weightSpecFlat * tmpIndFX; // 6*Q14 178 indPriorFX += inst->weightSpecFlat * tmpIndFX; // 6*Q14
179 } 179 }
180 180
181 //for template spectral-difference 181 //for template spectral-difference
182 if (inst->weightSpecDiff) { 182 if (inst->weightSpecDiff) {
183 tmpU32no1 = 0; 183 tmpU32no1 = 0;
184 if (inst->featureSpecDiff) { 184 if (inst->featureSpecDiff) {
185 normTmp = WEBRTC_SPL_MIN(20 - inst->stages, 185 normTmp = WEBRTC_SPL_MIN(20 - inst->stages,
186 WebRtcSpl_NormU32(inst->featureSpecDiff)); 186 WebRtcSpl_NormU32(inst->featureSpecDiff));
187 assert(normTmp >= 0); 187 RTC_DCHECK_GE(normTmp, 0);
188 tmpU32no1 = inst->featureSpecDiff << normTmp; // Q(normTmp-2*stages) 188 tmpU32no1 = inst->featureSpecDiff << normTmp; // Q(normTmp-2*stages)
189 tmpU32no2 = inst->timeAvgMagnEnergy >> (20 - inst->stages - normTmp); 189 tmpU32no2 = inst->timeAvgMagnEnergy >> (20 - inst->stages - normTmp);
190 if (tmpU32no2 > 0) { 190 if (tmpU32no2 > 0) {
191 // Q(20 - inst->stages) 191 // Q(20 - inst->stages)
192 tmpU32no1 /= tmpU32no2; 192 tmpU32no1 /= tmpU32no2;
193 } else { 193 } else {
194 tmpU32no1 = (uint32_t)(0x7fffffff); 194 tmpU32no1 = (uint32_t)(0x7fffffff);
195 } 195 }
196 } 196 }
197 tmpU32no3 = (inst->thresholdSpecDiff << 17) / 25; 197 tmpU32no3 = (inst->thresholdSpecDiff << 17) / 25;
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 "4: \n\t" 993 "4: \n\t"
994 ".set pop \n\t" 994 ".set pop \n\t"
995 : [t0] "=&r" (t0), [r0] "=&r" (r0), [r1] "=&r" (r1), 995 : [t0] "=&r" (t0), [r0] "=&r" (r0), [r1] "=&r" (r1),
996 [r2] "=&r" (r2), [r3] "=&r" (r3) 996 [r2] "=&r" (r2), [r3] "=&r" (r3)
997 : [len] "r" (len), [shift] "r" (shift), [in] "r" (in), 997 : [len] "r" (len), [shift] "r" (shift), [in] "r" (in),
998 [out] "r" (out) 998 [out] "r" (out)
999 : "memory" 999 : "memory"
1000 ); 1000 );
1001 } 1001 }
1002 1002
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698