Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/audio/asrc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ config COMP_ASRC

if COMP_ASRC

rsource "Kconfig.simd"

choice
prompt "ASRC down sampling conversions set"
default COMP_ASRC_DOWNSAMPLING_FULL
Expand Down
40 changes: 40 additions & 0 deletions src/audio/asrc/Kconfig.simd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: BSD-3-Clause

comment "ASRC optimization level select"

choice "ASRC_SIMD_LEVEL_SELECT"
prompt "choose which SIMD level used for ASRC module"
depends on COMP_ASRC
default ASRC_HIFI_MAX

config ASRC_HIFI_MAX
prompt "SIMD will selected by toolchain pre-defined header"
bool
help
When this was selected, optimization level will be determined
by toolchain pre-defined macros in core isa header file.

config ASRC_HIFI_5
prompt "choose HIFI5 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI5 optimized ASRC code

config ASRC_HIFI_4
prompt "choose HIFI4 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI4 optimized ASRC code

config ASRC_HIFI_3
prompt "choose HIFI3 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI3 intrinsic optimized ASRC code

config ASRC_HIFI_NONE
prompt "choose generic C ASRC module, no HIFI SIMD involved"
bool
help
This option used to build ASRC generic code.
endchoice
39 changes: 0 additions & 39 deletions src/audio/asrc/asrc_config.h

This file was deleted.

1 change: 0 additions & 1 deletion src/audio/asrc/asrc_farrow.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <sof/trace/trace.h>
#include <sof/audio/format.h>
#include <user/trace.h>
#include "asrc_config.h"
#include "asrc_farrow.h"

LOG_MODULE_DECLARE(asrc, CONFIG_SOF_LOG_LEVEL);
Expand Down
6 changes: 3 additions & 3 deletions src/audio/asrc/asrc_farrow_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//
// Copyright(c) 2012-2019 Intel Corporation. All rights reserved.

#include "asrc_config.h"
#include <sof/common.h>

#if ASRC_GENERIC == 1
#if SOF_USE_HIFI(NONE, ASRC)

#include "asrc_farrow.h"
#include <sof/audio/format.h>
Expand Down Expand Up @@ -360,4 +360,4 @@ void asrc_calc_impulse_response_n7(struct asrc_farrow *src_obj)
}
}

#endif /* ASRC_GENERIC */
#endif /* ASRC_HIFI_NONE */
8 changes: 4 additions & 4 deletions src/audio/asrc/asrc_farrow_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//
// Copyright(c) 2012-2019 Intel Corporation. All rights reserved.

#include "asrc_config.h"
#include "asrc_farrow.h"
#include <sof/common.h>

#if ASRC_HIFI3 == 1
#if SOF_USE_HIFI(3, ASRC) || SOF_USE_HIFI(4, ASRC) || SOF_USE_HIFI(5, ASRC)

#include "asrc_farrow.h"
#include <xtensa/tie/xt_hifi3.h>

LOG_MODULE_DECLARE(asrc, CONFIG_SOF_LOG_LEVEL);
Expand Down Expand Up @@ -401,4 +401,4 @@ void asrc_calc_impulse_response_n7(struct asrc_farrow *src_obj)
AE_SA64POS_FP(align_out, result_P);
}

#endif /* ASRC Hifi3 */
#endif /* ASRC_HIFI_3 */
2 changes: 2 additions & 0 deletions src/audio/copier/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

rsource "Kconfig.simd"

config COMP_COPIER
bool "COPIER component"
default y
Expand Down
40 changes: 40 additions & 0 deletions src/audio/copier/Kconfig.simd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: BSD-3-Clause

comment "COPIER optimization level select"

choice "COPIER_SIMD_LEVEL_SELECT"
prompt "choose which SIMD level used for COPIER module"
depends on COMP_COPIER
default COPIER_HIFI_MAX

config COPIER_HIFI_MAX
prompt "SIMD will selected by toolchain pre-defined header"
bool
help
When this was selected, optimization level will be determined
by toolchain pre-defined macros in core isa header file.

config COPIER_HIFI_5
prompt "choose HIFI5 intrinsic optimized COPIER module"
bool
help
This option used to build HIFI5 optimized COPIER code

config COPIER_HIFI_4
prompt "choose HIFI4 intrinsic optimized COPIER module"
bool
help
This option used to build HIFI4 optimized COPIER code

config COPIER_HIFI_3
prompt "choose HIFI3 intrinsic optimized COPIER module"
bool
help
This option used to build HIFI3 intrinsic optimized COPIER code

config COPIER_HIFI_NONE
prompt "choose generic C COPIER module, no HIFI SIMD involved"
bool
help
This option used to build COPIER generic code.
endchoice
11 changes: 0 additions & 11 deletions src/audio/copier/copier.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@
#include <sof/audio/buffer.h>
#include <sof/audio/pcm_converter.h>

#define COPIER_GENERIC

#if defined(__XCC__)
#include <xtensa/config/core-isa.h>

#if XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4
#undef COPIER_GENERIC
#endif

#endif

static const uint32_t INVALID_QUEUE_ID = 0xFFFFFFFF;

/* copier Module Configuration & Interface
Expand Down
4 changes: 2 additions & 2 deletions src/audio/copier/copier_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
#include <ipc4/base-config.h>
#include <sof/audio/component_ext.h>
#include "copier.h"
#include <sof/common.h>

LOG_MODULE_DECLARE(copier, CONFIG_SOF_LOG_LEVEL);

#ifdef COPIER_GENERIC
#if SOF_USE_HIFI(NONE, COPIER)

#include <sof/audio/buffer.h>
#include <sof/audio/format.h>
#include <sof/audio/pipeline.h>
#include <sof/audio/component.h>
#include <sof/common.h>
#include <stddef.h>
#include <errno.h>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions src/audio/copier/copier_hifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
//
// Author: Andrula Song <xiaoyuan.song@intel.com>
#include "copier.h"
#include <sof/common.h>

#if __XCC__ && (XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4)
#if SOF_USE_HIFI(3, COPIER) || SOF_USE_HIFI(4, COPIER) || SOF_USE_HIFI(5, COPIER)

#include <sof/audio/buffer.h>
#include <sof/audio/component_ext.h>
#include <sof/audio/format.h>
#include <sof/audio/pipeline.h>
#include <sof/audio/component.h>
#include <sof/common.h>
#include <stddef.h>
#include <errno.h>
#include <stdint.h>
Expand Down
2 changes: 2 additions & 0 deletions src/audio/drc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

rsource "Kconfig.simd"

config COMP_DRC
bool "Dynamic Range Compressor component"
select CORDIC_FIXED
Expand Down
40 changes: 40 additions & 0 deletions src/audio/drc/Kconfig.simd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: BSD-3-Clause

comment "DRC optimization level select"

choice "DRC_SIMD_LEVEL_SELECT"
prompt "choose which SIMD level used for DRC module"
depends on COMP_DRC
default DRC_HIFI_MAX

config DRC_HIFI_MAX
prompt "SIMD will selected by toolchain pre-defined header"
bool
help
When this was selected, optimization level will be determined
by toolchain pre-defined macros in core isa header file.

config DRC_HIFI_5
prompt "choose HIFI5 intrinsic optimized DRC module"
bool
help
This option used to build HIFI5 optimized DRC code

config DRC_HIFI_4
prompt "choose HIFI4 intrinsic optimized DRC module"
bool
help
This option used to build HIFI4 optimized DRC code

config DRC_HIFI_3
prompt "choose HIFI3 intrinsic optimized DRC module"
bool
help
This option used to build HIFI3 intrinsic optimized DRC code

config DRC_HIFI_NONE
prompt "choose generic C DRC module, no HIFI SIMD involved"
bool
help
This option used to build DRC generic code.
endchoice
1 change: 0 additions & 1 deletion src/audio/drc/drc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <sof/audio/buffer.h>
#include <sof/platform.h>

#include "drc_plat_conf.h"
#include "drc_user.h"

struct audio_stream;
Expand Down
7 changes: 4 additions & 3 deletions src/audio/drc/drc_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#include <sof/audio/format.h>
#include <sof/math/exp_fcn.h>
#include <sof/math/numbers.h>
#include <sof/common.h>
#include <stdint.h>

#include "drc.h"
#include "drc_algorithm.h"
#include "drc_math.h"

#if DRC_GENERIC
#if SOF_USE_HIFI(NONE, DRC)

#define ONE_Q20 Q_CONVERT_FLOAT(1.0f, 20) /* Q12.20 */
#define ONE_Q21 Q_CONVERT_FLOAT(1.0f, 21) /* Q11.21 */
Expand Down Expand Up @@ -450,9 +451,9 @@ void drc_compress_output(struct drc_state *state,
}
}

#endif /* DRC_GENERIC */
#endif /* DRC_HIFI_NONE */

#if DRC_GENERIC || DRC_HIFI3
#if SOF_USE_HIFI(NONE, DRC) || SOF_USE_HIFI(3, DRC)
/* After one complete division of samples have been received (and one division of
* samples have been output), we calculate shaped power average
* (detector_average) from the input division, update envelope parameters from
Expand Down
5 changes: 3 additions & 2 deletions src/audio/drc/drc_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#include <sof/audio/format.h>
#include <sof/math/exp_fcn.h>
#include <sof/math/numbers.h>
#include <sof/common.h>
#include <stdint.h>

#include "drc.h"
#include "drc_algorithm.h"
#include "drc_math.h"

#if DRC_HIFI3
#if SOF_USE_HIFI(3, DRC)

#include <xtensa/tie/xt_hifi3.h>

Expand Down Expand Up @@ -494,4 +495,4 @@ void drc_compress_output(struct drc_state *state,
}
}

#endif /* DRC_HIFI3 */
#endif /* DRC_HIFI_3 */
5 changes: 3 additions & 2 deletions src/audio/drc/drc_hifi4.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#include <sof/audio/format.h>
#include <sof/math/exp_fcn.h>
#include <sof/math/numbers.h>
#include <sof/common.h>
#include <stdint.h>

#include "drc.h"
#include "drc_algorithm.h"
#include "drc_math.h"

#if DRC_HIFI4
#if SOF_USE_HIFI(4, DRC)

#include <xtensa/tie/xt_hifi4.h>

Expand Down Expand Up @@ -910,4 +911,4 @@ const struct drc_proc_fnmap drc_proc_fnmap[] = {

const size_t drc_proc_fncount = ARRAY_SIZE(drc_proc_fnmap);

#endif /* DRC_HIFI4 */
#endif /* DRC_HIFI_4 */
7 changes: 3 additions & 4 deletions src/audio/drc/drc_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
#include <sof/math/numbers.h>
#include <sof/math/lut_trig.h>
#include <sof/math/trig.h>

#include "drc_plat_conf.h"
#include <sof/common.h>

/* Unmark this define to use cordic arc sine implementation. */
/* #define DRC_USE_CORDIC_ASIN */

#if DRC_HIFI3 || DRC_HIFI4
#if SOF_USE_HIFI(4, DRC) || SOF_USE_HIFI(3, DRC)

#include <xtensa/tie/xt_hifi3.h>

Expand Down Expand Up @@ -106,7 +105,7 @@ static inline int32_t drc_asin_fixed(int32_t x)
}
#endif /* DRC_USE_CORDIC_ASIN */

#endif /* DRC_HIFI3 */
#endif /* DRC_HIFI_3/4 */

int32_t drc_lin2db_fixed(int32_t linear); /* Input:Q6.26 Output:Q11.21 */
int32_t drc_log_fixed(int32_t x); /* Input:Q6.26 Output:Q6.26 */
Expand Down
Loading