ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_add_s16_ansi.c
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7
8#include "dsps_add.h"
9
10esp_err_t dsps_add_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift)
11{
12 if (NULL == input1) {
14 }
15 if (NULL == input2) {
17 }
18 if (NULL == output) {
20 }
21
22 for (int i = 0 ; i < len ; i++) {
23 int32_t acc = (int32_t)input1[i * step1] + (int32_t)input2[i * step2];
24 output[i * step_out] = acc >> shift;
25 }
26 return ESP_OK;
27}
#define ESP_ERR_DSP_PARAM_OUTOFRANGE
esp_err_t dsps_add_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift)
int esp_err_t
Definition esp_err.h:21
#define ESP_OK
Definition esp_err.h:23