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
10
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)
11
{
12
if
(NULL == input1) {
13
return
ESP_ERR_DSP_PARAM_OUTOFRANGE
;
14
}
15
if
(NULL == input2) {
16
return
ESP_ERR_DSP_PARAM_OUTOFRANGE
;
17
}
18
if
(NULL == output) {
19
return
ESP_ERR_DSP_PARAM_OUTOFRANGE
;
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
}
ESP_ERR_DSP_PARAM_OUTOFRANGE
#define ESP_ERR_DSP_PARAM_OUTOFRANGE
Definition
dsp_err_codes.h:22
dsps_add.h
dsps_add_s16_ansi
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)
Definition
dsps_add_s16_ansi.c:10
esp_err_t
int esp_err_t
Definition
esp_err.h:21
ESP_OK
#define ESP_OK
Definition
esp_err.h:23
components
espressif__esp-dsp
modules
math
add
fixed
dsps_add_s16_ansi.c
Generated by
1.16.1