-
Notifications
You must be signed in to change notification settings - Fork 313
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
Audio: Copier: Use SOF_DIV_ROUND_UP() instead of ROUND_UP() #9579
Audio: Copier: Use SOF_DIV_ROUND_UP() instead of ROUND_UP() #9579
Conversation
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.
these are two quite different macros. One rounds up, another one divides, rounding up. The former can however be used here by removing the >> 2
shift
@lyakh is correct. SOF_DIV_ROUND_UP() is not equivalent of ROUND_UP().
Closing, sorry! |
The ROUND_UP() is provided by Zephyr headers and can't be used in testbench (IPC4) build. The ROUND_UP is defined in util.h as: "#define ROUND_UP(x, align) \ (((unsigned long)(x) + ((unsigned long)(align) - 1)) & \ ~((unsigned long)(align) - 1))" and SOF_DIV_ROUND_UP in common.h as: "#define SOF_DIV_ROUND_UP(val, div) (((val) + (div) - 1) / (div))" The round up and divide by shift in original code can be replaced with the rounding divide macro from SOF. There is no code speed impact from division since it's done in C pre-processor. The MAX_GAIN_COEFFS_CNT is much less than default 32 bit integer range, so these compute the same. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
21e275c
to
c3925e7
Compare
Thanks @lyakh for avoiding me to break totally the code. Fixed now as you suggested. |
The ROUND_UP() is provided by Zephyr headers and can't be used in testbench (IPC4) build.