2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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.
13 * This file contains the implementation of functions
14 * WebRtcSpl_MemSetW16()
15 * WebRtcSpl_MemSetW32()
16 * WebRtcSpl_MemCpyReversedOrder()
17 * WebRtcSpl_CopyFromEndW16()
18 * WebRtcSpl_ZerosArrayW16()
19 * WebRtcSpl_ZerosArrayW32()
21 * The description header can be found in signal_processing_library.h
26 #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
29 void WebRtcSpl_MemSetW16(int16_t *ptr, int16_t set_value, int length)
32 int16_t *arrptr = ptr;
34 for (j = length; j > 0; j--)
36 *arrptr++ = set_value;
40 void WebRtcSpl_MemSetW32(int32_t *ptr, int32_t set_value, int length)
43 int32_t *arrptr = ptr;
45 for (j = length; j > 0; j--)
47 *arrptr++ = set_value;
51 void WebRtcSpl_MemCpyReversedOrder(int16_t* dest, int16_t* source, int length)
54 int16_t* destPtr = dest;
55 int16_t* sourcePtr = source;
57 for (j = 0; j < length; j++)
59 *destPtr-- = *sourcePtr++;
63 void WebRtcSpl_CopyFromEndW16(const int16_t *vector_in,
68 // Copy the last <samples> of the input vector to vector_out
69 WEBRTC_SPL_MEMCPY_W16(vector_out, &vector_in[length - samples], samples);
72 void WebRtcSpl_ZerosArrayW16(int16_t *vector, int length)
74 WebRtcSpl_MemSetW16(vector, 0, length);
77 void WebRtcSpl_ZerosArrayW32(int32_t *vector, int length)
79 WebRtcSpl_MemSetW32(vector, 0, length);