forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Audio: MDRC: Restructure MDRC for effective memory allocation
This check-in refactors the multiband Dynamic Range Control (DRC) component to optimize memory allocation and initialization processes, addressing potential memory leaks and improving cache efficiency. An overview of the changes: 1. Memory Allocation Optimization: - Memory is now allocated by channel instead of by type, enhancing data locality and improving cache efficiency. - Optimized memory layout for crossover, emphasis, and deemphasis coefficients. 2. Initialization Enhancement: - Consolidated initialization routines for filter coefficients. - Added rigorous error handling to ensure that all allocated resources are freed in case of failure. - Refactored multiband_drc_init_coef for better readability and maintainability. 3. Improved Clean-up Procedures: - Detailed clean-up steps to prevent potential memory leaks. - Ensured state is reset correctly in case of initialization errors. Rationale and Impact: - Improved Cache Efficiency: - Grouping memory allocations by channel leads to better data locality, thus enhancing cache performance. - Robustness and Reliability: - Comprehensive error handling and clean-up procedures ensure stability and prevent memory leaks. - Enhanced Maintainability: - The refactored code provides better readability and maintainability with streamlined initialization and clean-up logic. Changes Highlighted by Diff: - Grouped memory allocations by channel within multiband_drc_init_coef. - Added error handling for each allocation step in multiband_drc_init_coef. - Consolidated and refactored filter coefficient initialization. - Improved multiband_drc_free to free IIR filter states and the model handler more robustly. Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
- Loading branch information
1 parent
28a5265
commit d66ceba
Showing
1 changed file
with
83 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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