ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_sub_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_sub.h"
8
9esp_err_t dsps_sub_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) {
13 }
14 if (NULL == input2) {
16 }
17 if (NULL == output) {
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}
#define ESP_ERR_DSP_PARAM_OUTOFRANGE
esp_err_t dsps_sub_s8_ansi(const int8_t *input1, const int8_t *input2, int8_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