Skip to content
Open

P20 drc #11001

Show file tree
Hide file tree
Changes from 1 commit
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
51 changes: 51 additions & 0 deletions test/cmocka/src/audio/drc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,54 @@ cmocka_test(drc_math_test
)

target_include_directories(drc_math_test PRIVATE ${PROJECT_SOURCE_DIR}/src/audio)

cmocka_test(drc_process
drc_process.c
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same: ztest?


target_include_directories(drc_process PRIVATE ${PROJECT_SOURCE_DIR}/src/audio)

# make small version of libaudio so we don't have to care
# about unused missing references

add_compile_options(-DUNIT_TEST)

add_library(audio_for_drc STATIC
${PROJECT_SOURCE_DIR}/src/audio/drc/drc.c
${PROJECT_SOURCE_DIR}/src/audio/drc/drc_generic.c
${PROJECT_SOURCE_DIR}/src/audio/drc/drc_math_generic.c
${PROJECT_SOURCE_DIR}/src/audio/drc/drc_math_hifi3.c
${PROJECT_SOURCE_DIR}/src/audio/drc/drc_log.c
${PROJECT_SOURCE_DIR}/src/math/numbers.c
${PROJECT_SOURCE_DIR}/src/math/exp_fcn.c
${PROJECT_SOURCE_DIR}/src/math/exp_fcn_hifi.c
${PROJECT_SOURCE_DIR}/src/math/lut_trig.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c
${PROJECT_SOURCE_DIR}/src/audio/buffers/comp_buffer.c
${PROJECT_SOURCE_DIR}/src/audio/buffers/audio_buffer.c
${PROJECT_SOURCE_DIR}/src/audio/source_api_helper.c
${PROJECT_SOURCE_DIR}/src/audio/sink_api_helper.c
${PROJECT_SOURCE_DIR}/src/audio/sink_source_utils.c
${PROJECT_SOURCE_DIR}/src/audio/audio_stream.c
${PROJECT_SOURCE_DIR}/src/audio/component.c
${PROJECT_SOURCE_DIR}/src/audio/data_blob.c
${PROJECT_SOURCE_DIR}/src/module/audio/source_api.c
${PROJECT_SOURCE_DIR}/src/module/audio/sink_api.c
${PROJECT_SOURCE_DIR}/src/ipc/ipc3/helper.c
${PROJECT_SOURCE_DIR}/src/ipc/ipc-common.c
${PROJECT_SOURCE_DIR}/src/ipc/ipc-helper.c
${PROJECT_SOURCE_DIR}/src/lib/objpool.c
${PROJECT_SOURCE_DIR}/test/cmocka/src/notifier_mocks.c
${PROJECT_SOURCE_DIR}/src/audio/pipeline/pipeline-graph.c
${PROJECT_SOURCE_DIR}/src/audio/pipeline/pipeline-params.c
${PROJECT_SOURCE_DIR}/src/audio/pipeline/pipeline-schedule.c
${PROJECT_SOURCE_DIR}/src/audio/pipeline/pipeline-stream.c
${PROJECT_SOURCE_DIR}/src/audio/pipeline/pipeline-xrun.c
)
sof_append_relative_path_definitions(audio_for_drc)

target_link_libraries(audio_for_drc PRIVATE sof_options)

target_link_libraries(drc_process PRIVATE audio_for_drc)
42 changes: 42 additions & 0 deletions test/cmocka/src/audio/drc/cmocka_drc_coef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2024 Intel Corporation.
*
* DRC configuration blobs for the process unit test. Generated from
* tools/ctl/ipc4/drc/{passthrough,speaker_default}.txt (see
* src/audio/drc/tune/sof_example_drc.m). Each array is a sof_abi_hdr
* header followed by a struct sof_drc_config payload.
*/

#ifndef CMOCKA_DRC_COEF_H
#define CMOCKA_DRC_COEF_H

#include <stdint.h>

/* Pass-through configuration (params.enabled = 0) */
static const uint32_t drc_coef_pass_2ch[35] = {
0x00464f53, 0x00000000, 0x0000006c, 0x03013000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x0000006c, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0xe8000000, 0x1e000000,
0x0c000000, 0x00624dd3, 0x0409c2b1, 0x05555555,
0x001efa50, 0x00946055, 0xff6a987e, 0x01fec983,
0x22474764, 0x01745617, 0x0071c71c, 0xff777777,
0x001f77d8, 0x00000005, 0x00438000, 0x00047dd7,
0x0025cea0, 0x00097dd7, 0x0000b5b1
};

/* Enabled configuration, small speaker default (params.enabled = 1) */
static const uint32_t drc_coef_enabled_2ch[35] = {
0x00464f53, 0x00000000, 0x0000006c, 0x03013000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x0000006c, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000001, 0xe2000000, 0x14000000,
0x0a000000, 0x00624dd3, 0x02061b8a, 0x06666666,
0x00ba972f, 0x001e0c18, 0xffe04220, 0x0050f44e,
0x08349f9a, 0x04d82cd3, 0x0071c71c, 0xff777777,
0x001f77d8, 0x00000005, 0x00438000, 0x00047dd7,
0x0025cea0, 0x00097dd7, 0x0000b5b1
};

#endif /* CMOCKA_DRC_COEF_H */
Loading