Skip to content

reduce{h,v}: simplify coefficients handling #3553

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

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

kleisauke
Copy link
Member

  • De-duplicate n_points calculations.
  • Extract the various filters in inline functions.
  • Merge the calculate_coefficients* functions into a single one.
  • Simplify reduce_sum().

Split from: #3532.

@jcupitt
Copy link
Member

jcupitt commented Jun 30, 2023

Does this mean we will build on C++ before C++11? Maybe the "C++ version required" declration in meson.build should change too.

@kleisauke kleisauke force-pushed the simplify-calculate-coefficients branch from 8fe33ce to 963dede Compare June 30, 2023 15:11
@kleisauke
Copy link
Member Author

This will indeed restore compatibility with C++98. Commit 963dede lowers the minimum required C++ version to C++98.

We could also remove that line, but that would not allow us to detect regressions (since most compilers use C++17 as the default nowadays).

@kleisauke
Copy link
Member Author

I just rebased this PR to resolve the merge conflicts.

@kleisauke kleisauke force-pushed the simplify-calculate-coefficients branch 2 times, most recently from dcc63c9 to 91828ae Compare July 20, 2023 14:47
@kleisauke
Copy link
Member Author

Friendly ping, the diff is probably best viewable with the Hide whitespace changes option.

@kleisauke kleisauke force-pushed the simplify-calculate-coefficients branch 2 times, most recently from 05a5155 to 9fba8ff Compare August 14, 2023 11:27
@kleisauke
Copy link
Member Author

Thinking about this further, opting for C++11 as the minimum required version seems appropriate, as it enables the adoption of Highway and use of nullptr (PR #3612). I dropped commit 963dede for now.

@kleisauke kleisauke force-pushed the simplify-calculate-coefficients branch from 9fba8ff to 2ebefa4 Compare September 26, 2023 17:49
@kleisauke kleisauke force-pushed the simplify-calculate-coefficients branch from 2ebefa4 to 1dc076d Compare October 3, 2023 09:36
@kleisauke
Copy link
Member Author

Split into multiple commits to make reviewing easier.

@kleisauke
Copy link
Member Author

Godbolt link to verify the inlining behaviour: https://godbolt.org/z/cYbKWTW6T (i.e. there is only a call made to sin()).

Copy link
Member

@lovell lovell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some testing with this, everything appears to work as before. Much simpler, thanks Kleis.

@kleisauke kleisauke merged commit c09d144 into libvips:master Oct 9, 2023
@kleisauke kleisauke deleted the simplify-calculate-coefficients branch October 9, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants