niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | /* |
| 12 | * This function mutes a signal linearly on a sample by sample basis. |
| 13 | */ |
| 14 | |
| 15 | #include "dsp_helpfunctions.h" |
| 16 | |
| 17 | #include "signal_processing_library.h" |
| 18 | |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 19 | void WebRtcNetEQ_MuteSignal(int16_t *pw16_inout, int16_t muteSlope, |
| 20 | int16_t N) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | { |
| 22 | int i; |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 23 | int32_t w32_tmp = 1048608; /* (16384<<6 + 32) */ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | |
| 25 | for (i = 0; i < N; i++) |
| 26 | { |
| 27 | pw16_inout[i] |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 28 | = (int16_t) ((WEBRTC_SPL_MUL_16_16((int16_t)(w32_tmp>>6), pw16_inout[i]) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | + 8192) >> 14); |
| 30 | w32_tmp -= muteSlope; |
| 31 | } |
| 32 | } |
| 33 | |