audio: tdfb: place IIR emphasis coefficients in .rodata - #11116
Open
kv2019i wants to merge 1 commit into
Open
Conversation
The direction-of-arrival emphasis coefficient tables iir_emphasis_48k and iir_emphasis_16k were declared as mutable globals, so the linker placed them in the .data section. The tables are read-only coefficient data, never modified, so mark them static const. This mirrors how sound_dose stores its IIR coefficient table. As another benefit, this change makes it possible to run tdfb in user-space as user threads can access rodata. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR moves the direction-of-arrival (tdfb) IIR emphasis coefficient tables into read-only memory by marking them static const, ensuring the linker places them in .rodata instead of .data and enabling safer user-space access.
Changes:
- Mark
iir_emphasis_48kandiir_emphasis_16kasstatic constso they are treated as read-only data - Prevent mutable global placement of coefficient tables (reducing
.datausage and supporting user-space execution)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| */ | ||
|
|
||
| uint32_t iir_emphasis_48k[20] = { | ||
| static const uint32_t iir_emphasis_48k[20] = { |
| }; | ||
|
|
||
| uint32_t iir_emphasis_16k[20] = { | ||
| static const uint32_t iir_emphasis_16k[20] = { |
lyakh
approved these changes
Aug 25, 2026
lgirdwood
approved these changes
Aug 25, 2026
Collaborator
Author
|
@singalsu Can you check, ok to you? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The direction-of-arrival emphasis coefficient tables iir_emphasis_48k and iir_emphasis_16k were declared as mutable globals, so the linker placed them in the .data section.
The tables are read-only coefficient data, never modified, so mark them static const. This mirrors how sound_dose stores its IIR coefficient table.
As another benefit, this change makes it possible to run tdfb in user-space as user threads can access rodata.