Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
audio: src: move filter and delay line allocation to init phase#10846
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
Open
jsarha
wants to merge
3
commits into
thesofproject:mainChoose a base branch
from
jsarha:src_move_allocs_to_init
base:main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Uh oh!
There was an error while loading. Please reload this page.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
| @@ -128,6 +128,37 @@ static inline void src_polyphase_reset(struct polyphase_src *src) | ||
| src_state_reset(&src->state2); | ||
| } | ||
| /** | ||
jsarha marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| * src_polyphase_reset_state - reset filter state while preserving structure | ||
| * | ||
| * Zeros the delay line contents and resets read/write pointers to their | ||
| * initial positions. The filter stage pointers, delay line allocations, | ||
| * and sizes are preserved. | ||
| */ | ||
| static inline void src_polyphase_reset_state(struct polyphase_src *src) | ||
| { | ||
| struct src_state *s1 = &src->state1; | ||
| struct src_state *s2 = &src->state2; | ||
| if (s1->fir_delay && s1->fir_delay_size) | ||
| memset(s1->fir_delay, 0, sizeof(int32_t) * s1->fir_delay_size); | ||
| if (s1->out_delay && s1->out_delay_size) | ||
| memset(s1->out_delay, 0, sizeof(int32_t) * s1->out_delay_size); | ||
| s1->fir_wp = s1->fir_delay ? &s1->fir_delay[s1->fir_delay_size - 1] : NULL; | ||
| s1->out_rp = s1->out_delay; | ||
| if (s2->fir_delay && s2->fir_delay_size) | ||
| memset(s2->fir_delay, 0, sizeof(int32_t) * s2->fir_delay_size); | ||
| if (s2->out_delay && s2->out_delay_size) | ||
| memset(s2->out_delay, 0, sizeof(int32_t) * s2->out_delay_size); | ||
| s2->fir_wp = s2->fir_delay ? &s2->fir_delay[s2->fir_delay_size - 1] : NULL; | ||
| s2->out_rp = s2->out_delay; | ||
| } | ||
| int src_polyphase(struct polyphase_src *src, int32_t x[], int32_t y[], | ||
| int n_in); | ||
| @@ -167,6 +198,7 @@ struct comp_data { | ||
| int (*src_func)(struct comp_data *cd, struct sof_source *source, | ||
| struct sof_sink *sink); | ||
| void (*polyphase_func)(struct src_stage_prm *s); | ||
| int (*setup_stages)(struct processing_module *mod); | ||
| }; | ||
| #if CONFIG_IPC_MAJOR_4 | ||
| @@ -218,6 +250,7 @@ static inline int src_fallback(struct comp_data *cd, | ||
| int src_allocate_copy_stages(struct processing_module *mod, struct src_param *prm, | ||
| const struct src_stage *stage_src1, | ||
| const struct src_stage *stage_src2); | ||
| int src_allocate_delay_lines(struct processing_module *mod); | ||
| int src_rate_check(const void *spec); | ||
| int src_set_params(struct processing_module *mod, struct sof_sink *sink); | ||
| @@ -227,6 +260,9 @@ int src_prepare_general(struct processing_module *mod, | ||
| struct sof_source *source, | ||
| struct sof_sink *sink); | ||
| int src_init(struct processing_module *mod); | ||
| int src_init_stages(struct processing_module *mod); | ||
| int src_do_prepare(struct processing_module *mod, | ||
| struct sof_source *source, struct sof_sink *sink); | ||
| int src_copy_sxx(struct comp_data *cd, struct sof_source *source, | ||
| struct sof_sink *sink); | ||
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
why in src_common.c if it's only used with IPC4? Looks like this is duplicating code now for IPC3 and IPC4. Can we not extract and reuse some common functions?
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.
Common is more correct place for this, but I did not dare to touch ipc3 as I do not know how to test that code.
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.
I was about to say it's still possible to build testbench for ipc3 and run with it.... but seems it doesn't compile any more: