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

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/filterbanks_neon.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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 // Contains a function for WebRtcIsacfix_AllpassFilter2FixDec16Neon() 11 // Contains a function for WebRtcIsacfix_AllpassFilter2FixDec16Neon()
12 // in iSAC codec, optimized for ARM Neon platform. Bit exact with function 12 // in iSAC codec, optimized for ARM Neon platform. Bit exact with function
13 // WebRtcIsacfix_AllpassFilter2FixDec16C() in filterbanks.c. Prototype 13 // WebRtcIsacfix_AllpassFilter2FixDec16C() in filterbanks.c. Prototype
14 // C code is at end of this file. 14 // C code is at end of this file.
15 15
16 #include <arm_neon.h> 16 #include <arm_neon.h>
17 #include <assert.h> 17
18 #include "webrtc/base/checks.h"
18 19
19 void WebRtcIsacfix_AllpassFilter2FixDec16Neon( 20 void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
20 int16_t* data_ch1, // Input and output in channel 1, in Q0 21 int16_t* data_ch1, // Input and output in channel 1, in Q0
21 int16_t* data_ch2, // Input and output in channel 2, in Q0 22 int16_t* data_ch2, // Input and output in channel 2, in Q0
22 const int16_t* factor_ch1, // Scaling factor for channel 1, in Q15 23 const int16_t* factor_ch1, // Scaling factor for channel 1, in Q15
23 const int16_t* factor_ch2, // Scaling factor for channel 2, in Q15 24 const int16_t* factor_ch2, // Scaling factor for channel 2, in Q15
24 const int length, // Length of the data buffers 25 const int length, // Length of the data buffers
25 int32_t* filter_state_ch1, // Filter state for channel 1, in Q16 26 int32_t* filter_state_ch1, // Filter state for channel 1, in Q16
26 int32_t* filter_state_ch2) { // Filter state for channel 2, in Q16 27 int32_t* filter_state_ch2) { // Filter state for channel 2, in Q16
27 assert(length % 2 == 0); 28 RTC_DCHECK_EQ(0, length % 2);
28 int n = 0; 29 int n = 0;
29 int16x4_t factorv; 30 int16x4_t factorv;
30 int16x4_t datav; 31 int16x4_t datav;
31 int32x4_t statev; 32 int32x4_t statev;
32 33
33 // Load factor_ch1 and factor_ch2. 34 // Load factor_ch1 and factor_ch2.
34 factorv = vld1_dup_s16(factor_ch1); 35 factorv = vld1_dup_s16(factor_ch1);
35 factorv = vld1_lane_s16(factor_ch1 + 1, factorv, 1); 36 factorv = vld1_lane_s16(factor_ch1 + 1, factorv, 1);
36 factorv = vld1_lane_s16(factor_ch2, factorv, 2); 37 factorv = vld1_lane_s16(factor_ch2, factorv, 2);
37 factorv = vld1_lane_s16(factor_ch2 + 1, factorv, 3); 38 factorv = vld1_lane_s16(factor_ch2 + 1, factorv, 3);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // state1_ch2 = WebRtcSpl_AddSatW32(a1_ch2<<1, (uint32_t)sample1_ch2<<16); 268 // state1_ch2 = WebRtcSpl_AddSatW32(a1_ch2<<1, (uint32_t)sample1_ch2<<16);
268 // 269 //
269 // data_ch1[n + 1] = (int16_t) (b1_ch1 >> 16); //Save as Q0 270 // data_ch1[n + 1] = (int16_t) (b1_ch1 >> 16); //Save as Q0
270 // data_ch2[n + 1] = (int16_t) (b1_ch2 >> 16); 271 // data_ch2[n + 1] = (int16_t) (b1_ch2 >> 16);
271 // 272 //
272 // filter_state_ch1[0] = state0_ch1; 273 // filter_state_ch1[0] = state0_ch1;
273 // filter_state_ch1[1] = state1_ch1; 274 // filter_state_ch1[1] = state1_ch1;
274 // filter_state_ch2[0] = state0_ch2; 275 // filter_state_ch2[0] = state0_ch2;
275 // filter_state_ch2[1] = state1_ch2; 276 // filter_state_ch2[1] = state1_ch2;
276 //} 277 //}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698