Skip to content

Commit

Permalink
cadence: add support for mp3 encoder
Browse files Browse the repository at this point in the history
This adds support for Cadence MP3 Encoder module.

Signed-off-by: Tomasz Lissowski <[email protected]>
  • Loading branch information
tlissows committed May 7, 2024
1 parent 0ea0d62 commit f70ed33
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/audio/module_adapter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ if CADENCE_CODEC
This option is a string and takes the full name of the MP3 library binary.
endif

config CADENCE_CODEC_MP3_ENC
bool "Cadence MP3 encoder"
default n
help
Select for Cadence MP3 encoder support.
This will cause Cadence codec to include Cadence MP3 library
api symbol.

if CADENCE_CODEC_MP3_ENC
config CADENCE_CODEC_MP3_ENC_LIB
string "Cadence MP3 encoder library name"
help
This option is a string and takes the full name of the MP3 library binary.
endif

config CADENCE_CODEC_SBC_DEC
bool "Cadence SBC decoder"
default n
Expand Down
7 changes: 7 additions & 0 deletions src/audio/module_adapter/module/cadence.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum cadence_api_id {
CADENCE_CODEC_SBC_DEC_ID = 0x07,
CADENCE_CODEC_VORBIS_DEC_ID = 0x08,
CADENCE_CODEC_SRC_PP_ID = 0x09,
CADENCE_CODEC_MP3_ENC_ID = 0x0A,
};

#define DEFAULT_CODEC_ID CADENCE_CODEC_WRAPPER_ID
Expand Down Expand Up @@ -78,6 +79,12 @@ static struct cadence_api cadence_api_table[] = {
.api = xa_mp3_dec,
},
#endif
#ifdef CONFIG_CADENCE_CODEC_MP3_ENC
{
.id = CADENCE_CODEC_MP3_ENC_ID,
.api = xa_mp3_enc,
},
#endif
#ifdef CONFIG_CADENCE_CODEC_SBC_DEC
{
.id = CADENCE_CODEC_SBC_DEC_ID,
Expand Down
1 change: 1 addition & 0 deletions src/include/sof/audio/module_adapter/module/cadence.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern xa_codec_func_t xa_bsac_dec;
extern xa_codec_func_t xa_dabplus_dec;
extern xa_codec_func_t xa_drm_dec;
extern xa_codec_func_t xa_mp3_dec;
extern xa_codec_func_t xa_mp3_enc;
extern xa_codec_func_t xa_sbc_dec;
extern xa_codec_func_t xa_vorbis_dec;
extern xa_codec_func_t xa_src_pp;
Expand Down
4 changes: 4 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ if (CONFIG_CADENCE_CODEC_MP3_DEC)
zephyr_library_import(xa_mp3_dec ${CONFIG_CADENCE_CODEC_MP3_DEC_LIB})
endif()

if (CONFIG_CADENCE_CODEC_MP3_ENC)
zephyr_library_import(xa_mp3_enc ${CONFIG_CADENCE_CODEC_MP3_ENC_LIB})
endif()

if (CONFIG_CADENCE_CODEC_AAC_DEC)
zephyr_library_import(xa_aac_dec ${CONFIG_CADENCE_CODEC_AAC_DEC_LIB})
endif()
Expand Down

0 comments on commit f70ed33

Please sign in to comment.