Skip to content
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

Merged

Commits on Oct 16, 2024

  1. Audio: Copier: Use SOF_DIV_ROUND_UP() instead of ROUND_UP()

    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>
    singalsu committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    c3925e7 View commit details
    Browse the repository at this point in the history