# SPDX-License-Identifier: BSD-3-Clause

menu "Audio components"

config COMP_DAI
	bool "DAI component"
	default y
	help
	  Select for DAI component

config COMP_VOLUME
	bool "Volume component"
	default y
	help
	  Select for Volume component

config COMP_SRC
	bool "SRC component"
	default y
	help
	  Select for SRC component

if COMP_SRC

choice
        prompt "SRC coefficient set"
        default COMP_SRC_STD

config COMP_SRC_STD
	bool "Full conversions support and high quality"
	help
	  This coefficients set supports a large number of conversions
	  with 8 - 192 kHz input and 8 - 48 kHz output. The coefficients
	  are 32 bits for high conversion quality. The coefficients
	  storage consume 79 kB. The runtime needs 8 kB. Use this if there
	  is critical quality usage for SRC like music via headphones and
	  need high sample rates.

config COMP_SRC_SMALL
	bool "Smaller conversions support and high quality"
	help
	  This coefficients set supports a small number of conversions
	  with 8 - 48 kHz input and output. The coefficients are 32 bits
	  for high conversion quality. The coefficients storage consumes
	  30 kB RAM. Runtime needs 4 kB. Use this if there is critical
	  quality usage for SRC like music via headphones.

config COMP_SRC_TINY
	bool "Reduced conversions support and reduced quality"
	help
	  This coefficients set supports a minimum number of conversions
	  with 8 - 48 kHz input and output. The coefficients are 16 bits
	  that restricts the possible stop-attenuation and could cause
	  some audible aliasing. The bandwidth of the filters is restricted
	  so the full 20 kHz band is not met even if sample rate would
	  allow. The coefficients storage consumes 5 kB RAM. The runtime
	  needs 6 kB. Use this to save RAM for other applications when SRC
	  has no critical usage or when only need with lower quality
	  endpoint like miniature speakers.

endchoice

endif # SRC

config MATH_FIR
	bool "FIR filter library"
	default n
	help
	  This option builds FIR (Finite Impulse Response) filter library. It
	  is selected by components for their digital signal processing. A FIR
	  filter calculates a convolution of input PCM sample and a configurable
	  impulse response.


config COMP_FIR
	bool "FIR component"
	select MATH_FIR
	default y
	help
	  Select for FIR component. FIR performance can differ between DSP
	  ISA and compiler used. FIR will perform best when MAC instructions
	  are available in ISA and are used by the compiler. i.e. xt-xcc on
	  xtensa will generate MAC instructions but GCC on xtensa won't.
	  Filter tap count can be severely restricted to reduce FIR cycles
	  and FIR performance for DSP/compilers with no MAC support

config COMP_IIR
	bool "IIR component"
	default y
	help
	  Select for IIR component

config COMP_TONE
	bool "Tone component"
	default y
	help
	  Select for Tone component

config COMP_MIXER
	bool "Mixer component"
	default y
	help
	  Select for Mixer component

config COMP_MUX
	bool "MUX component"
	default y
	help
	  Select for MUX component

config COMP_SWITCH
	bool "Switch component"
	default y
	help
	  Select for Switch component

config COMP_KPB
	bool "KPB component"
	default y
	help
	  Select for KPB component

config COMP_SEL
	bool "Channel selector component"
	default y
	help
	  Select for SEL component

config COMP_CROSSOVER
	bool "Crossover Filter component"
	default n
	help
	  Select for Crossover Filter component. A crossover can be used to
	  split a signal into two or more frequency ranges, so that the outputs
	  can be sent to drivers that are designed for those ranges.

config COMP_DCBLOCK
	bool "DC Blocking Filter component"
	default y
	help
	  Select for DC Blocking Filter component. This component filters out
	  the DC offset which often originates from a microphone's output.

config MAXIM_DSM
	depends on CAVS && !CAVS_VERSION_1_5
	bool "Maxim DSM component"
	default n
	help
	  Select for Maxim DSM(Dynamic Speaker Management) component.
	  This component protect the speaker from overheating and
	  excursion violation. This consists of two parts which are
	  feedforward processing block running on playback thread and
	  feedback processing block running on capture thread with
	  amp current and voltage feedback.

config COMP_ASRC
	bool "ASRC component"
	default y
	help
	  Select for Asynchronous sample rate conversion (ASRC)
	  component. The ASRC has the capabilities of (synchronous)
	  SRC but can in addition track a slave DAI that is not in
	  sync with firmware timer. The ASRC can be setup for
	  synchronous operation without DAI tracking via topology
	  though it has a bit higher computational load than SRC. The
	  RAM footprint of ASRC is smaller than SRC because it does
	  not have pre-computed filter coefficients for every
	  conversion fraction that SRC does.

if COMP_ASRC

choice
        prompt "ASRC down sampling conversions set"
        default COMP_ASRC_DOWNSAMPLING_FULL

config COMP_ASRC_DOWNSAMPLING_FULL
	bool "Full downsampling conversions support"
	select ASRC_SUPPORT_CONVERSION_24000_TO_08000
	select ASRC_SUPPORT_CONVERSION_24000_TO_16000
	select ASRC_SUPPORT_CONVERSION_48000_TO_08000
	select ASRC_SUPPORT_CONVERSION_48000_TO_11025
	select ASRC_SUPPORT_CONVERSION_48000_TO_12000
	select ASRC_SUPPORT_CONVERSION_48000_TO_16000
	select ASRC_SUPPORT_CONVERSION_48000_TO_22050
	select ASRC_SUPPORT_CONVERSION_48000_TO_24000
	select ASRC_SUPPORT_CONVERSION_48000_TO_32000
	select ASRC_SUPPORT_CONVERSION_48000_TO_44100
	help
	  This option enables all supported downsampling conversions
	  for the asynchronous sample rate conversion. All the
	  upsampling conversions use the same filter always enabled
	  coefficients set so there is no configuration options for
	  them. The enabled conversions consume about 18 kB of memory.

config COMP_ASRC_DOWNSAMPLING_CUSTOM
	bool "Custom downsampling conversions support"
	help
	  This option used to manually select each downsampling ratio.
	  In order to optimize the text code size of the sample rate
	  converter, non-required conversion ratios can be
	  deactivated.  Disregarding these settings, the sample rate
	  converter always supports all conversion ratios with fs_in
	  less or equal to fs_out. Therefore, it is possible to
	  deactivate all conversion ratios listed below, if we only
	  need an (asynchronous) 1:1 sample rate conversion, e.g, from
	  16 kHz to 16 kHz. This option allows to trim down the coefficient
	  memory for conversion down from default 18 kB. Each conversion
	  needs about 2 kB.

endchoice

menu "Supported downsampling conversions"
	visible if COMP_ASRC_DOWNSAMPLING_CUSTOM

config ASRC_SUPPORT_CONVERSION_24000_TO_08000
	bool "Downsample 24 kHz to 8 kHz"
	default n
	help
	  This option enables downsampling from 24 kHz to 8 kHz into
	  the build. The consumption of memory is 2.1 kB.

config ASRC_SUPPORT_CONVERSION_24000_TO_16000
	bool "Downsample 24 kHz to 16 kHz"
	default n
	help
	  This option enables downsampling from 24 kHz to 16 kHz into
	  the build. The consumption of memory is 1.9 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_08000
	bool "Downsample 48 kHz to 8 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 8 kHz into
	  the build. The consumption of memory is 2.1 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_11025
	bool "Downsample 48 kHz to 11.025 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 11.025 kHz
	  into the build. The consumption of memory is 1.5 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_12000
	bool "Downsample 48 kHz to 12 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 12 kHz into
	  the build. The consumption of memory is 1.5 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_16000
	bool "Downsample 48 kHz to 16 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 16 kHz into
	  the build. The consumption of memory is 1.9 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_22050
	bool "Downsample 48 kHz to 22.05 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 22.05 kHz into
	  the build. The consumption of memory is 1.6 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_24000
	bool "Downsample 48 kHz to 24 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 24 kHz into
	  the build. The consumption of memory is 1.6 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_32000
	bool "Downsample 48 kHz to 32 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 32 kHz into
	  the build. The consumption of memory is 1.9 kB.

config ASRC_SUPPORT_CONVERSION_48000_TO_44100
	bool "Downsample 48 kHz to 44.1 kHz"
	default n
	help
	  This option enables downsampling from 48 kHz to 44.1 kHz
	  into the build. The consumption of memory is 1.8 kB.

endmenu # "Downsampling ratios"

endif # COMP_ASRC

config COMP_TDFB
	bool "TDFB component"
	select MATH_FIR
	default y
	help
	  Select for time domain fixed beamformer (TDFB) component. The
          beamformer component enhances microphone capture by spatial
          suppression of noise and improvement of signal-to-noise ratio of
          capture from beam direction. The component is essentially a generic
          single rate FIR filter bank that performs microphone array
          directivity enhancement when programmed with suitable configuration
          for channels selection, channel filter coefficients, and output
          streams mixing.

endmenu # "Audio components"

menu "Data formats"

config FORMAT_S16LE
	bool "Support S16LE"
	default y
	help
	  Support 16 bit processing data format with sign and in little endian format

config FORMAT_S24LE
	bool "Support S24LE"
	default y
	help
	  Support 24 bit processing data format with sign and in little endian format

config FORMAT_S32LE
	bool "Support S32LE"
	default y
	help
	  Support 32 bit processing data format with sign and in little endian format

config FORMAT_FLOAT
	bool "Support float"
	default y
	help
	  Support floating point processing data format

config FORMAT_CONVERT_HIFI3
	bool "HIFI3 optimized conversion"
	default y
	help
	  Use HIFI3 extensions for optimized format conversion (experimental).

endmenu
