Skip to content

Commit 0d5e731

Browse files
singalsulgirdwood
authored andcommitted
Audio: SRC: Add IPC4 full conversions matrix to SRC comp and tools
This patch adds the Kconfig option COMP_SRC_IPC4_FULL_MATRIX and adds handling to src.c. Testbench build was changed to use this largest matrix. The coefficients were generated with script src_ipc4_int32.m. The new sample rates were added to test script src_test.m. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent a0ff2bb commit 0d5e731

5 files changed

Lines changed: 58 additions & 9 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
CONFIG_LIBRARY=y
2+
CONFIG_TRACEV=y
23
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n
34
CONFIG_COMP_CROSSOVER=y
45
CONFIG_COMP_DRC=y
56
CONFIG_COMP_MULTIBAND_DRC=y
67
CONFIG_COMP_CODEC_ADAPTER=y
7-
CONFIG_TRACEV=y
8+
CONFIG_COMP_SRC=y
9+
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y

src/audio/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ config COMP_SRC_TINY
132132
has no critical usage or when only need with lower quality
133133
endpoint like miniature speakers.
134134

135+
config COMP_SRC_IPC4_FULL_MATRIX
136+
bool "Full IPC4 conversions matrix support and high quality"
137+
help
138+
This coefficients set supports a large number of conversions
139+
with 8 - 192 kHz input 8 - 192 kHz output. The 32 bits coefficients
140+
storate consumes 241 kB. The runtime needs 9 kB. Use this to
141+
make the full conversions set available for IPC4 build.
142+
135143
endchoice
136144

137145
endif # SRC

src/audio/src/src.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@
3737
#if SRC_SHORT || CONFIG_COMP_SRC_TINY
3838
#include <sof/audio/coefficients/src/src_tiny_int16_define.h>
3939
#include <sof/audio/coefficients/src/src_tiny_int16_table.h>
40-
#else
41-
#if CONFIG_COMP_SRC_SMALL
40+
#elif CONFIG_COMP_SRC_SMALL
4241
#include <sof/audio/coefficients/src/src_small_int32_define.h>
4342
#include <sof/audio/coefficients/src/src_small_int32_table.h>
44-
#endif
45-
#if CONFIG_COMP_SRC_STD
43+
#elif CONFIG_COMP_SRC_STD
4644
#include <sof/audio/coefficients/src/src_std_int32_define.h>
4745
#include <sof/audio/coefficients/src/src_std_int32_table.h>
48-
#endif
46+
#elif CONFIG_COMP_SRC_IPC4_FULL_MATRIX
47+
#include <sof/audio/coefficients/src/src_ipc4_int32_define.h>
48+
#include <sof/audio/coefficients/src/src_ipc4_int32_table.h>
49+
#else
50+
#error "No valid configuration selected for SRC"
4951
#endif
5052

5153
/* The FIR maximum lengths are per channel so need to multiply them */

tools/test/audio/src_test.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
bits_out = 32;
3333
end
3434
if nargin < 3
35-
fs_in_list = [8 11.025 12 16 22.050 24 32 44.1 48 ...
36-
50 64 88.2 96 176.4 192] * 1e3;
35+
fs_in_list = [ 8 11.025 12 16 18.9 22.050 24 32 37.8 44.1 48 ...
36+
50 64 88.2 96 176.4 192] * 1e3;
3737
end
3838
if nargin < 4
39-
fs_out_list = [8 11.025 12 16 22.05 24 32 44.1 48 50] * 1e3;
39+
fs_out_list = [ 8 11.025 12 16 22.05 24 32 44.1 48 ...
40+
50 64 88.2 96 176.4 192] * 1e3;
4041
end
4142

4243
%% Generic test pass/fail criteria

tools/tune/src/src_ipc4_int32.m

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
%% Export full set of conversions for IPC4
2+
3+
% SPDX-License-Identifier: BSD-3-Clause
4+
%
5+
% Copyright(c) 2022 Intel Corporation. All rights reserved.
6+
7+
fs1 = [ 8 11.025 12 16 18.9 22.05 24 32 37.8 44.1 48 64 88.2 96 176.4 192 ] * 1e3;
8+
9+
fs2 = [8 16 24 32 44.1 48 88.2 96 176.4 192] * 1e3;
10+
11+
fs_matrix = [
12+
1 1 1 1 1 1 1 1 1 1
13+
1 1 1 1 1 1 1 1 1 0
14+
1 1 1 1 1 1 1 1 1 1
15+
1 1 1 1 1 1 1 1 1 1
16+
0 0 1 0 1 1 0 0 0 0
17+
1 1 1 1 1 1 1 1 1 1
18+
1 1 1 1 1 1 1 1 1 1
19+
1 1 1 1 1 1 1 1 1 1
20+
0 0 0 0 1 1 1 1 0 0
21+
1 1 1 1 1 1 1 1 1 1
22+
1 1 1 1 1 1 1 1 1 1
23+
1 1 1 1 1 1 1 1 1 1
24+
1 1 1 1 1 1 1 1 1 1
25+
1 1 1 1 1 1 1 1 1 1
26+
1 1 1 1 1 1 1 1 1 1
27+
1 1 1 1 1 1 1 1 1 1
28+
];
29+
30+
cfg.ctype = 'int32';
31+
cfg.profile = 'ipc4';
32+
cfg.quality = 1.0;
33+
cfg.speed = 0;
34+
cfg.gain = 0; % Make gain 0 dB
35+
36+
src_generate(fs1, fs2, fs_matrix, cfg);

0 commit comments

Comments
 (0)