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

Faster histogram creation #57

Closed
pmeenan opened this issue Nov 8, 2017 · 0 comments · Fixed by #60
Closed

Faster histogram creation #57

pmeenan opened this issue Nov 8, 2017 · 0 comments · Fixed by #60

Comments

@pmeenan
Copy link

pmeenan commented Nov 8, 2017

If I get a chance I'll take a crack at it but browsing through the code the image pixel processing jumped out at me.

The histogram extraction logic runs through the image top-to-bottom and then across (and repeats for each color channel).

The images are stored in RAM on a row-by-row basis with each pixel color-packed as sequential bytes. As it stands now the CPU caches will be thrashing on the image data. Flipping the for loops to have the height on the outside, width in the middle and color channel on the inside will be much friendlier to the CPU caches and should be a lot faster.

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 a pull request may close this issue.

1 participant