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

Speedup encoding by memoizing sRGBtoLinear #2

Merged
merged 4 commits into from
Aug 16, 2019

Conversation

michielbuddingh
Copy link
Contributor

This trades encoder performance for memory, so it
might not be desirable in all cases

This trades encoder performance for memory, so it
might not be desirable in all cases
@codecov-io
Copy link

codecov-io commented Jul 6, 2019

Codecov Report

Merging #2 into master will increase coverage by 0.35%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
+ Coverage   92.89%   93.25%   +0.35%     
==========================================
  Files           4        4              
  Lines         169      178       +9     
==========================================
+ Hits          157      166       +9     
  Misses          7        7              
  Partials        5        5
Impacted Files Coverage Δ
encode.go 85.54% <100%> (+1.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69c0b64...67eee1b. Read the comment docs.

The number of linear colour values in an image will never be more than
256, which requires only a modest-sized lookup table.
Wasn't caught by the square test image :)
@michielbuddingh
Copy link
Contributor Author

Looking at comparisons between running the old and new algorithm on the same images, there are some differences the unit tests didn't catch. Don't merge this yet, I'll get back to you on this.

@michielbuddingh
Copy link
Contributor Author

This time it's been tested on a much larger set of images; output is identical compared to the original.

@buckket buckket merged commit 0fe567b into buckket:master Aug 16, 2019
@buckket
Copy link
Owner

buckket commented Aug 16, 2019

Having 256 additional float64s and more encoding speed seems like a good compromise. If memory constraints are an huge issue one wouldn’t use Go anyways. Thanks for your contribution!

@michielbuddingh michielbuddingh deleted the memoize-colors branch July 29, 2020 17:38
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.

None yet

3 participants