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

Side by Side Diff: webrtc/common_audio/signal_processing/filter_ar_fast_q12_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, 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) 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 #include <assert.h>
11 10
11 #include "webrtc/base/checks.h"
12 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" 12 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h"
13 13
14 void WebRtcSpl_FilterARFastQ12(const int16_t* data_in, 14 void WebRtcSpl_FilterARFastQ12(const int16_t* data_in,
15 int16_t* data_out, 15 int16_t* data_out,
16 const int16_t* __restrict coefficients, 16 const int16_t* __restrict coefficients,
17 size_t coefficients_length, 17 size_t coefficients_length,
18 size_t data_length) { 18 size_t data_length) {
19 int r0, r1, r2, r3; 19 int r0, r1, r2, r3;
20 int coef0, offset; 20 int coef0, offset;
21 int i, j, k; 21 int i, j, k;
22 int coefptr, outptr, tmpout, inptr; 22 int coefptr, outptr, tmpout, inptr;
23 #if !defined(MIPS_DSP_R1_LE) 23 #if !defined(MIPS_DSP_R1_LE)
24 int max16 = 0x7FFF; 24 int max16 = 0x7FFF;
25 int min16 = 0xFFFF8000; 25 int min16 = 0xFFFF8000;
26 #endif // #if !defined(MIPS_DSP_R1_LE) 26 #endif // #if !defined(MIPS_DSP_R1_LE)
27 27
28 assert(data_length > 0); 28 RTC_DCHECK_GT(data_length, 0);
29 assert(coefficients_length > 1); 29 RTC_DCHECK_GT(coefficients_length, 1);
30 30
31 __asm __volatile ( 31 __asm __volatile (
32 ".set push \n\t" 32 ".set push \n\t"
33 ".set noreorder \n\t" 33 ".set noreorder \n\t"
34 "addiu %[i], %[data_length], 0 \n\t" 34 "addiu %[i], %[data_length], 0 \n\t"
35 "lh %[coef0], 0(%[coefficients]) \n\t" 35 "lh %[coef0], 0(%[coefficients]) \n\t"
36 "addiu %[j], %[coefficients_length], -1 \n\t" 36 "addiu %[j], %[coefficients_length], -1 \n\t"
37 "andi %[k], %[j], 1 \n\t" 37 "andi %[k], %[j], 1 \n\t"
38 "sll %[offset], %[j], 1 \n\t" 38 "sll %[offset], %[j], 1 \n\t"
39 "subu %[outptr], %[data_out], %[offset] \n\t" 39 "subu %[outptr], %[data_out], %[offset] \n\t"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 : [coefficients] "r" (coefficients), [data_length] "r" (data_length), 131 : [coefficients] "r" (coefficients), [data_length] "r" (data_length),
132 [coefficients_length] "r" (coefficients_length), 132 [coefficients_length] "r" (coefficients_length),
133 #if !defined(MIPS_DSP_R1_LE) 133 #if !defined(MIPS_DSP_R1_LE)
134 [max16] "r" (max16), [min16] "r" (min16), 134 [max16] "r" (max16), [min16] "r" (min16),
135 #endif 135 #endif
136 [data_out] "r" (data_out), [data_in] "r" (data_in) 136 [data_out] "r" (data_out), [data_in] "r" (data_in)
137 : "hi", "lo", "memory" 137 : "hi", "lo", "memory"
138 ); 138 );
139 } 139 }
140 140
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698