Tools: Tune: SRC: Update generator to produce similar as edited#8845
Conversation
tools/tune/src/src_export_table_2s.m
Outdated
| fprintf(fh, '%s fir_one = 1.0;\n', vtype); | ||
| fprintf(fh, 'const %s fir_one = 1.0;\n', vtype); | ||
| fprintf(fh, 'struct src_stage src_double_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, 1.0, &fir_one };\n'); | ||
| fprintf(fh, 'struct src_stage src_double_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0.0, &fir_one };\n'); |
There was a problem hiding this comment.
what about these? Aren't they const now too?
There was a problem hiding this comment.
Yep, you are right!
d169c50 to
baef046
Compare
This patch makes to SRC coefficients tables generator same changes as done in recent git commits. commit 88fdb10 ("audio: src: rename sample rate converter coefficient folder name") moved coefficients files location to src/audio/src/coefs. commit 90fef5a ("src_lite: add module") removed include of src.h from upper level due to another src-lite version. 'commit 7f4e6ae ("src: make coefficients constant") added const to struct src_stage. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
baef046 to
e035c9d
Compare
lyakh
left a comment
There was a problem hiding this comment.
We'll see next time when src headers are updated if anything breaks :-)
| src.gain, vfn); | ||
| case { 'int16' 'int24' 'int32' } | ||
| fprintf(fh, 'struct src_stage %s = {\n', sfn); | ||
| fprintf(fh, 'const struct src_stage %s = {\n', sfn); |
There was a problem hiding this comment.
A side comment, instead of datestr(now(), 'yyyy'); I suggest currentYear = datestr(datetime('now'), 'yyyy');
And there's a unused code , please consider removing it
%% Plot to compare
if 0
f = linspace(0, fs/2, 1000);
h1 = freqz(src.coefs/src.L, 1, f, fs);
h2 = freqz(bq0/sref/src.L, 1, f, fs);
h3 = freqz(bi/sref/src.L, 1, f, fs);
figure;
plot(f, 20*log10(abs(h1)), f, 20*log10(abs(h2)), f, 20*log10(abs(h3)));
grid on;
fprintf('Original = %4.1f dB, optimized = %4.1f dB, delta = %4.1f dB\n', ...
sb1, sb2, sb1-sb2);
end
| else | ||
| fprintf(fh, '#include <%ssrc_%s_%d_%d_%d_%d.h>\n', ... | ||
| ppath, prof_ctype, um_tmp(1:4)); | ||
| fprintf(fh, '#include \"src_%s_%d_%d_%d_%d.h\"\n', ... |
There was a problem hiding this comment.
unused variables are there ppath in the function call, please consider ~
lgirdwood
left a comment
There was a problem hiding this comment.
@singalsu can you make incremental fixes for @ShriramShastry comments. Thanks !
Sure, @ShriramShastry thanks! I'll fix them later. That "if 0" code might be useful, maybe under some debug option. The ppath is clear to remove after the directory locations change. |
This patch makes to SRC coefficients tables generator same changes as done in recent git commits.
commit 88fdb10 ("audio: src: rename sample rate converter coefficient folder name") moved coefficients files location to src/audio/src/coefs.
commit 90fef5a ("src_lite: add module") removed include of src.h from upper level due to another src-lite version.
'commit 7f4e6ae ("src: make coefficients constant") added const to struct src_stage.