/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /* * This file contains the implementation of functions * WebRtcSpl_MaxAbsValueW16C() * WebRtcSpl_MaxAbsValueW32C() * WebRtcSpl_MaxValueW16C() * WebRtcSpl_MaxValueW32C() * WebRtcSpl_MinValueW16C() * WebRtcSpl_MinValueW32C() * WebRtcSpl_MaxAbsIndexW16() * WebRtcSpl_MaxIndexW16() * WebRtcSpl_MaxIndexW32() * WebRtcSpl_MinIndexW16() * WebRtcSpl_MinIndexW32() * */ #include <stdlib.h> #include <limits.h> #include "rtc_base/checks.h" #include "common_audio/signal_processing/include/signal_processing_library.h" // TODO(bjorn/kma): Consolidate function pairs (e.g. combine // WebRtcSpl_MaxAbsValueW16C and WebRtcSpl_MaxAbsIndexW16 into a single one.) // TODO(kma): Move the next six functions into min_max_operations_c.c. // Maximum absolute value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, size_t length) { … } // Maximum absolute value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MaxAbsValueW32C(const int32_t* vector, size_t length) { … } // Maximum value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MaxValueW16C(const int16_t* vector, size_t length) { … } // Maximum value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MaxValueW32C(const int32_t* vector, size_t length) { … } // Minimum value of word16 vector. C version for generic platforms. int16_t WebRtcSpl_MinValueW16C(const int16_t* vector, size_t length) { … } // Minimum value of word32 vector. C version for generic platforms. int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, size_t length) { … } // Index of maximum absolute value in a word16 vector. size_t WebRtcSpl_MaxAbsIndexW16(const int16_t* vector, size_t length) { … } int16_t WebRtcSpl_MaxAbsElementW16(const int16_t* vector, size_t length) { … } // Index of maximum value in a word16 vector. size_t WebRtcSpl_MaxIndexW16(const int16_t* vector, size_t length) { … } // Index of maximum value in a word32 vector. size_t WebRtcSpl_MaxIndexW32(const int32_t* vector, size_t length) { … } // Index of minimum value in a word16 vector. size_t WebRtcSpl_MinIndexW16(const int16_t* vector, size_t length) { … } // Index of minimum value in a word32 vector. size_t WebRtcSpl_MinIndexW32(const int32_t* vector, size_t length) { … } // Finds both the minimum and maximum elements in an array of 16-bit integers. void WebRtcSpl_MinMaxW16(const int16_t* vector, size_t length, int16_t* min_val, int16_t* max_val) { … }