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
3,343 changes: 1,671 additions & 1,672 deletions src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h

Large diffs are not rendered by default.

6,715 changes: 3,357 additions & 3,358 deletions src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h

Large diffs are not rendered by default.

801 changes: 801 additions & 0 deletions src/audio/src/coef/src_ipc4_int32_7_40_2976_5000.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/audio/src/coef/src_ipc4_int32_define.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2022 Intel Corporation. All rights reserved.
* Copyright(c) 2025 Intel Corporation. All rights reserved.
*
*/

Expand All @@ -13,10 +13,10 @@
#define MAX_BLK_IN 80
#define MAX_BLK_OUT 40
#define NUM_IN_FS 16
#define NUM_OUT_FS 10
#define NUM_OUT_FS 13
#define STAGE1_TIMES_MAX 32
#define STAGE2_TIMES_MAX 32
#define STAGE_BUF_SIZE 672
#define NUM_ALL_COEFFICIENTS 69224
#define NUM_ALL_COEFFICIENTS 70008

#endif /* __SOF_AUDIO_COEFFICIENTS_SRC_SRC_IPC4_INT32_DEFINE_H__ */
65 changes: 60 additions & 5 deletions src/audio/src/coef/src_ipc4_int32_table.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2022 Intel Corporation. All rights reserved.
* Copyright(c) 2025 Intel Corporation. All rights reserved.
*
*/

Expand Down Expand Up @@ -49,6 +49,7 @@
#include "src_ipc4_int32_7_8_2468_5000.h"
#include "src_ipc4_int32_7_8_2721_5000.h"
#include "src_ipc4_int32_7_8_4535_5000.h"
#include "src_ipc4_int32_7_40_2976_5000.h"
#include "src_ipc4_int32_8_7_1361_5000.h"
#include "src_ipc4_int32_8_7_2468_5000.h"
#include "src_ipc4_int32_8_7_2721_5000.h"
Expand Down Expand Up @@ -106,9 +107,9 @@ static const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
static const int src_in_fs[16] = { 8000, 11025, 12000, 16000, 18900, 22050, 24000, 32000,
37800, 44100, 48000, 64000, 88200, 96000, 176400, 192000
};
static const int src_out_fs[10] = { 8000, 16000, 24000, 32000, 44100, 48000, 88200, 96000,
176400, 192000};
static const struct src_stage * const src_table1[10][16] = {
static const int src_out_fs[13] = { 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000,
64000, 88200, 96000, 176400, 192000};
static const struct src_stage * const src_table1[13][16] = {
{ &src_int32_1_1_0_0, &src_int32_16_21_4319_5000,
&src_int32_2_3_4535_5000, &src_int32_1_2_4535_5000,
&src_int32_0_0_0_0, &src_int32_10_21_3455_5000,
Expand All @@ -118,6 +119,15 @@ static const struct src_stage * const src_table1[10][16] = {
&src_int32_5_21_1728_5000, &src_int32_1_4_1512_5000,
&src_int32_4_21_1080_5000, &src_int32_1_6_1134_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_21_80_3968_5000, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_7_40_2976_5000,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_2_1_4535_5000, &src_int32_32_21_4535_5000,
&src_int32_4_3_4535_5000, &src_int32_1_1_0_0,
&src_int32_0_0_0_0, &src_int32_16_21_4319_5000,
Expand All @@ -127,6 +137,15 @@ static const struct src_stage * const src_table1[10][16] = {
&src_int32_8_21_2160_5000, &src_int32_1_3_2268_5000,
&src_int32_5_21_1728_5000, &src_int32_1_4_1512_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_21_40_3968_5000, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_21_80_3968_5000,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_3_1_4535_5000, &src_int32_8_7_4535_5000,
&src_int32_2_1_4535_5000, &src_int32_3_2_4535_5000,
&src_int32_10_9_4535_5000, &src_int32_8_7_4535_5000,
Expand Down Expand Up @@ -163,6 +182,15 @@ static const struct src_stage * const src_table1[10][16] = {
&src_int32_8_7_2468_5000, &src_int32_1_2_4535_5000,
&src_int32_8_21_3239_5000, &src_int32_1_2_2268_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_21_8_4535_5000, &src_int32_2_1_4535_5000,
&src_int32_7_5_4535_5000, &src_int32_21_10_4535_5000,
&src_int32_0_0_0_0, &src_int32_2_1_4535_5000,
Expand Down Expand Up @@ -201,7 +229,7 @@ static const struct src_stage * const src_table1[10][16] = {
}
};

static const struct src_stage * const src_table2[10][16] = {
static const struct src_stage * const src_table2[13][16] = {
{ &src_int32_1_1_0_0, &src_int32_20_21_4535_5000,
&src_int32_1_1_0_0, &src_int32_1_1_0_0,
&src_int32_0_0_0_0, &src_int32_16_21_4535_5000,
Expand All @@ -211,6 +239,15 @@ static const struct src_stage * const src_table2[10][16] = {
&src_int32_8_21_4535_5000, &src_int32_1_3_4535_5000,
&src_int32_5_21_4535_5000, &src_int32_1_4_4535_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_7_8_4535_5000, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_21_32_4535_5000,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_1_1_0_0, &src_int32_20_21_3125_5000,
&src_int32_1_1_0_0, &src_int32_1_1_0_0,
&src_int32_0_0_0_0, &src_int32_20_21_4535_5000,
Expand All @@ -220,6 +257,15 @@ static const struct src_stage * const src_table2[10][16] = {
&src_int32_10_21_4535_5000, &src_int32_1_2_4535_5000,
&src_int32_8_21_4535_5000, &src_int32_1_3_4535_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_7_8_4535_5000, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_7_8_4535_5000,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_1_1_0_0, &src_int32_40_21_3968_5000,
&src_int32_1_1_0_0, &src_int32_1_1_0_0,
&src_int32_8_7_4082_5000, &src_int32_20_21_4167_5000,
Expand Down Expand Up @@ -256,6 +302,15 @@ static const struct src_stage * const src_table2[10][16] = {
&src_int32_10_21_4535_5000, &src_int32_1_1_0_0,
&src_int32_5_7_4535_5000, &src_int32_1_2_4535_5000
},
{ &src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0,
&src_int32_0_0_0_0, &src_int32_0_0_0_0
},
{ &src_int32_21_5_1728_5000, &src_int32_4_1_2268_5000,
&src_int32_21_4_3239_5000, &src_int32_21_8_2160_5000,
&src_int32_0_0_0_0, &src_int32_2_1_2268_5000,
Expand Down
5 changes: 5 additions & 0 deletions src/audio/src/tune/sof_src_generate.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
error('Sample rates in/out matrix size mismatch!');
end

if exist('OCTAVE_VERSION', 'builtin')
pkg load signal
end


Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary second blank line

%% Exported coefficients type int16, int24, int32, float

switch cfg.ctype
Expand Down
41 changes: 22 additions & 19 deletions src/audio/src/tune/sof_src_ipc4_int32.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@

% SPDX-License-Identifier: BSD-3-Clause
%
% Copyright(c) 2022 Intel Corporation. All rights reserved.
% Copyright(c) 2022-2025 Intel Corporation.

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;

fs2 = [8 16 24 32 44.1 48 88.2 96 176.4 192] * 1e3;
fs2 = [ 8 11.025 16 22.05 24 32 44.1 48 64 88.2 96 176.4 192 ] * 1e3;

fs_matrix = [
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
0 0 1 0 1 1 0 0 0 0
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 0 0
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
% 1 1
% 1 1 2 2 3 4 4 6 8 9 7 9
% 8 1 6 2 4 2 4 8 4 8 6 6 2
%
1 0 1 0 1 1 1 1 0 1 1 1 1 % 8
1 0 1 0 1 1 1 1 0 1 1 1 0 % 11
1 0 1 0 1 1 1 1 0 1 1 1 1 % 12
1 0 1 0 1 1 1 1 0 1 1 1 1 % 16
0 0 0 0 1 0 1 1 0 0 0 0 0 % 18.9
1 0 1 0 1 1 1 1 0 1 1 1 1 % 22.05
1 0 1 0 1 1 1 1 0 1 1 1 1 % 24
1 0 1 0 1 1 1 1 0 1 1 1 1 % 32
0 0 0 0 0 0 1 1 0 1 1 0 0 % 37.8
1 0 1 0 1 1 1 1 0 1 1 1 1 % 44.1
1 1 1 1 1 1 1 1 0 1 1 1 1 % 48
1 0 1 0 1 1 1 1 0 1 1 1 1 % 64
1 0 1 0 1 1 1 1 0 1 1 1 1 % 88.2
1 1 1 1 1 1 1 1 0 1 1 1 1 % 96
1 0 1 0 1 1 1 1 0 1 1 1 1 % 176.4
1 0 1 0 1 1 1 1 0 1 1 1 1 % 192
];

cfg.ctype = 'int32';
Expand Down
4 changes: 2 additions & 2 deletions src/audio/src/tune/src_export_coef.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
src.blk_in, src.blk_out, src.halfband, ...
src.gain, vfn);
case { 'int16' 'int24' 'int32' }
fprintf(fh, 'const struct src_stage %s = {\n', sfn);
fprintf(fh, 'static const struct src_stage %s = {\n', sfn);
fprintf(fh, '\t%d, %d, %d, %d, %d, %d, %d, %d, %d,\n\t%s};\n', ...
src.idm, src.odm, src.num_of_subfilters, ...
src.subfilter_length, src.filter_length, ...
Expand All @@ -100,7 +100,7 @@
end

function print_int_coef(src, fh, vtype, vfn, nbits)
fprintf(fh, 'const %s %s[%d] = {\n', ...
fprintf(fh, '__cold_rodata static const %s %s[%d] = {\n', ...
vtype, vfn, src.filter_length);

cint = coef_quant(src, nbits);
Expand Down
30 changes: 15 additions & 15 deletions src/audio/src/tune/src_export_table_2s.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,29 @@
fprintf(fh, '/* SRC table */\n');
switch ctype
case 'float'
fprintf(fh, 'const %s fir_one = 1.0;\n', vtype);
fprintf(fh, 'const struct src_stage src_double_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, 1.0, &fir_one };\n');
fprintf(fh, 'const struct src_stage src_double_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0.0, &fir_one };\n');
fprintf(fh, 'static const %s fir_one = 1.0;\n', vtype);
fprintf(fh, 'static const struct src_stage src_double_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, 1.0, &fir_one };\n');
fprintf(fh, 'static const struct src_stage src_double_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0.0, &fir_one };\n');
case 'int16'
scale16 = 2^15;
fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale16*0.5));
fprintf(fh, 'const struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'const struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale16*0.5));
fprintf(fh, 'static const struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'static const struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
case 'int24'
scale24 = 2^23;
fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale24*0.5));
fprintf(fh, 'const struct src_stage src_int24_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'const struct src_stage src_int24_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale24*0.5));
fprintf(fh, 'static const struct src_stage src_int24_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'static const struct src_stage src_int24_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
case 'int32'
scale32 = 2^31;
fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale32*0.5));
fprintf(fh, 'const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale32*0.5));
fprintf(fh, 'static const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n');
fprintf(fh, 'static const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n');
otherwise
error('Unknown coefficient type!');
end

fprintf(fh, 'const int src_in_fs[%d] = {', n_in);
fprintf(fh, 'static const int src_in_fs[%d] = {', n_in);
j = 1;
for i=1:n_in
fprintf(fh, ' %d', fs_in(i));
Expand All @@ -134,7 +134,7 @@
end
fprintf(fh, '};\n');

fprintf(fh, 'const int src_out_fs[%d] = {', n_out);
fprintf(fh, 'static const int src_out_fs[%d] = {', n_out);
j = 1;
for i=1:n_out
fprintf(fh, ' %d', fs_out(i));
Expand All @@ -150,7 +150,7 @@
fprintf(fh, '};\n');

for n = 1:2
fprintf(fh, 'const struct src_stage * const src_table%d[%d][%d] = {\n', ...
fprintf(fh, 'static const struct src_stage * const src_table%d[%d][%d] = {\n', ...
n, n_out, n_in);
i = 1;
for b = 1:n_out
Expand Down
Loading