Skip to content

Commit 69e2d33

Browse files
andrula-songsingalsu
authored andcommitted
Audio: Volume: Add HiFi5 implementation.
Add HiFi5 implementation of volume functions, compared with HiFi3 version, can reduce about 28% cycles. Signed-off-by: Andrula Song <andrula.song@intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 45de1b6 commit 69e2d33

File tree

9 files changed

+1176
-7
lines changed

9 files changed

+1176
-7
lines changed

src/audio/volume/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ if(CONFIG_COMP_VOLUME)
55
volume_generic.c
66
volume_hifi3.c
77
volume_hifi4.c
8+
volume_hifi5.c
89
volume_generic_with_peakvol.c
910
volume_hifi3_with_peakvol.c
1011
volume_hifi4_with_peakvol.c
12+
volume_hifi5_with_peakvol.c
1113
volume.c)
1214
if(CONFIG_IPC_MAJOR_3)
1315
add_local_sources(sof volume_ipc3.c)

src/audio/volume/Kconfig.simd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ choice "VOLUME_SIMD_LEVEL_SELECT"
1414
When this was selected, optimization level will be determined
1515
by toolchain pre-defined macros in core isa header file.
1616

17+
config VOLUME_HIFI_5
18+
prompt "choose HIFI5 intrinsic optimized volume module"
19+
bool
20+
help
21+
This option used to build HIFI5 optimized volume code
22+
1723
config VOLUME_HIFI_4
1824
prompt "choose HIFI4 intrinsic optimized volume module"
1925
bool

src/audio/volume/volume.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,19 +646,21 @@ static vol_zc_func vol_get_zc_function(struct comp_dev *dev,
646646
static void volume_set_alignment(struct audio_stream *source,
647647
struct audio_stream *sink)
648648
{
649-
#if SOF_USE_HIFI(3, VOLUME) || SOF_USE_HIFI(4, VOLUME) || SOF_USE_HIFI(5, VOLUME)
650-
/* Both source and sink buffer in HiFi 3 or HiFi4 processing version,
649+
/* Both source and sink buffer in HiFi5 processing version,
650+
* xtensa intrinsics ask for 16-byte aligned.
651+
*
652+
* Both source and sink buffer in HiFi 3 or HiFi4 processing version,
651653
* xtensa intrinsics ask for 8-byte aligned. 5.1 format SSE audio
652654
* requires 16-byte aligned.
653655
*/
654-
const uint32_t byte_align = audio_stream_get_channels(source) == 6 ? 16 : 8;
656+
const uint32_t byte_align = audio_stream_get_channels(source) == 6 ?
657+
SOF_FRAME_BYTE_ALIGN_6CH : SOF_FRAME_BYTE_ALIGN;
655658

656659
/*There is no limit for frame number, so both source and sink set it to be 1*/
657660
const uint32_t frame_align_req = 1;
658661

659662
audio_stream_set_align(byte_align, frame_align_req, source);
660663
audio_stream_set_align(byte_align, frame_align_req, sink);
661-
#endif
662664
}
663665

664666
/**

src/audio/volume/volume_hifi4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LOG_MODULE_DECLARE(volume_hifi4, CONFIG_SOF_LOG_LEVEL);
2121

2222
#include "volume.h"
2323

24-
#if SOF_USE_HIFI(4, VOLUME) || SOF_USE_HIFI(5, VOLUME)
24+
#if SOF_USE_HIFI(4, VOLUME)
2525

2626
#if (!CONFIG_COMP_PEAK_VOL)
2727

src/audio/volume/volume_hifi4_with_peakvol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LOG_MODULE_DECLARE(volume_hifi4, CONFIG_SOF_LOG_LEVEL);
2121

2222
#include "volume.h"
2323

24-
#if SOF_USE_HIFI(4, VOLUME) || SOF_USE_HIFI(5, VOLUME)
24+
#if SOF_USE_HIFI(4, VOLUME)
2525

2626
#if CONFIG_COMP_PEAK_VOL
2727
#include <xtensa/tie/xt_hifi4.h>

0 commit comments

Comments
 (0)