Skip to content

Commit fdce65a

Browse files
committed
Audio: SRC: Add HiFi5 version, as copy of HiFi4 version
Copying the file as such from HiFi4 and adding it to build as preparation for optimizations. The src_config.h is updated to follow the kconfig of FILTER (CONFIG_FILTER_HIFI_NONE, CONFIG_FILTER_HIFI_3, etc.). The gcc build is no more forced to use 16 bit SRC mode. It's a limitation from HiFi2 platform BYT. The new platforms are powerful enough to run it. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent c4695d1 commit fdce65a

File tree

4 files changed

+574
-47
lines changed

4 files changed

+574
-47
lines changed

src/audio/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

3-
add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_common.c src.c)
3+
add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_hifi5.c src_common.c src.c)
44

55
if(CONFIG_IPC_MAJOR_3)
66
add_local_sources(sof src_ipc3.c)

src/audio/src/src_config.h

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,24 @@
88
#ifndef __SOF_AUDIO_SRC_SRC_CONFIG_H__
99
#define __SOF_AUDIO_SRC_SRC_CONFIG_H__
1010

11-
12-
13-
/* If next define is set to 1 the SRC is configured automatically. Setting
14-
* to zero temporarily is useful is for testing needs.
15-
*/
16-
#define SRC_AUTOARCH 1
17-
18-
/* Force manually some code variant when SRC_AUTODSP is set to zero. These
19-
* are useful in code debugging.
20-
*/
21-
#if SRC_AUTOARCH == 0
22-
#define SRC_GENERIC 1
23-
#define SRC_HIFIEP 0
24-
#define SRC_HIFI3 0
25-
#endif
26-
27-
/* Select optimized code variant when xt-xcc compiler is used */
28-
#if SRC_AUTOARCH == 1
29-
#if defined __XCC__
30-
#include <xtensa/config/core-isa.h>
31-
#define SRC_GENERIC 0
32-
#if XCHAL_HAVE_HIFI4 == 1
33-
#define SRC_HIFI4 1
34-
#define SRC_HIFI3 0
35-
#define SRC_HIFIEP 0
11+
#include <sof/common.h>
12+
13+
/* Follow kconfig for FILTER in SRC component */
14+
#if SOF_USE_MIN_HIFI(5, FILTER)
15+
#define SRC_HIFI5 1
16+
#elif SOF_USE_MIN_HIFI(4, FILTER)
17+
#define SRC_HIFI4 1
18+
#elif SOF_USE_MIN_HIFI(3, FILTER)
19+
#define SRC_HIFI3 1
20+
#elif SOF_USE_HIFI(2, FILTER)
21+
#define SRC_HIFIEP 1
3622
#else
37-
#define SRC_HIFI4 0
38-
#if XCHAL_HAVE_HIFI2EP == 1
39-
#define SRC_HIFIEP 1
40-
#define SRC_HIFI3 0
41-
#endif
42-
#if XCHAL_HAVE_HIFI3 == 1
43-
#define SRC_HIFI3 1
44-
#define SRC_HIFIEP 0
45-
#endif
46-
#endif
47-
#else
48-
/* GCC */
49-
#define SRC_GENERIC 1
50-
#define SRC_HIFIEP 0
51-
#define SRC_HIFI3 0
52-
#if CONFIG_LIBRARY
53-
#else
54-
#define SRC_SHORT 1 /* Need to use for generic code version speed */
55-
#endif
56-
#endif
23+
#define SRC_GENERIC 1
5724
#endif
5825

59-
/* Kconfig option tiny needs 16 bits coefficients, other options use 32 bits */
26+
/* Kconfig option tiny needs 16 bits coefficients, other options use 32 bits,
27+
* also gcc builds for all platforms and testbench (library)
28+
*/
6029
#if !defined(SRC_SHORT)
6130
#if CONFIG_COMP_SRC_TINY
6231
#define SRC_SHORT 1 /* 16 bit coefficients filter core */

0 commit comments

Comments
 (0)