-
Notifications
You must be signed in to change notification settings - Fork 349
Tools: Tune: SRC: Update generator to produce similar as edited #8845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lgirdwood
merged 1 commit into
thesofproject:main
from
singalsu:src_tune_recent_changes_to_generator
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,45 +82,44 @@ | |
| um_tmp = unique_modes(i,:); | ||
| if isequal(um_tmp(1:2),[1 1]) || isequal(um_tmp(1:2),[0 0]) | ||
| 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', ... | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused variables are there |
||
| prof_ctype, um_tmp(1:4)); | ||
|
|
||
| n = all_modes(ia(i), 5); | ||
| a = all_modes(ia(i), 6); | ||
| b = all_modes(ia(i), 7); | ||
| sfl = sfl +taps_2s(n, a, b); % Count sum of filter lengths | ||
| end | ||
| end | ||
| fprintf(fh, '#include <sof/audio/src/src.h>\n'); | ||
| fprintf(fh, '#include <stdint.h>\n'); | ||
| fprintf(fh,'\n'); | ||
|
|
||
| fprintf(fh, '/* SRC table */\n'); | ||
| switch ctype | ||
| case 'float' | ||
| fprintf(fh, '%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'); | ||
| 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'); | ||
| case 'int16' | ||
| scale16 = 2^15; | ||
| fprintf(fh, '%s fir_one = %d;\n', vtype, round(scale16*0.5)); | ||
| fprintf(fh, 'struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); | ||
| fprintf(fh, 'struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); | ||
| 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'); | ||
| case 'int24' | ||
| scale24 = 2^23; | ||
| fprintf(fh, '%s fir_one = %d;\n', vtype, round(scale24*0.5)); | ||
| fprintf(fh, 'struct src_stage src_int24_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); | ||
| fprintf(fh, 'struct src_stage src_int24_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); | ||
| 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'); | ||
| case 'int32' | ||
| scale32 = 2^31; | ||
| fprintf(fh, '%s fir_one = %d;\n', vtype, round(scale32*0.5)); | ||
| fprintf(fh, 'struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); | ||
| fprintf(fh, 'struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); | ||
| 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'); | ||
| otherwise | ||
| error('Unknown coefficient type!'); | ||
| end | ||
|
|
||
| fprintf(fh, 'int src_in_fs[%d] = {', n_in); | ||
| fprintf(fh, 'const int src_in_fs[%d] = {', n_in); | ||
| j = 1; | ||
| for i=1:n_in | ||
| fprintf(fh, ' %d', fs_in(i)); | ||
|
|
@@ -135,7 +134,7 @@ | |
| end | ||
| fprintf(fh, '};\n'); | ||
|
|
||
| fprintf(fh, 'int src_out_fs[%d] = {', n_out); | ||
| fprintf(fh, 'const int src_out_fs[%d] = {', n_out); | ||
| j = 1; | ||
| for i=1:n_out | ||
| fprintf(fh, ' %d', fs_out(i)); | ||
|
|
@@ -151,7 +150,7 @@ | |
| fprintf(fh, '};\n'); | ||
|
|
||
| for n = 1:2 | ||
| fprintf(fh, 'struct src_stage *src_table%d[%d][%d] = {\n', ... | ||
| fprintf(fh, 'const struct src_stage * const src_table%d[%d][%d] = {\n', ... | ||
| n, n_out, n_in); | ||
| i = 1; | ||
| for b = 1:n_out | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A side comment, instead of
datestr(now(), 'yyyy');I suggestcurrentYear = datestr(datetime('now'), 'yyyy');And there's a unused code , please consider removing it