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