Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Updates the bulk sRGB Companding method to use the similar LUT approach as MagicScaler (thanks @saucecontrol ! )

Results are awesome. Massive speedup in real world scenarios.

companding

I noticed some oddities (I'd previously introduced) in the existing unit tests during the work which I cleaned up also.

@JimBobSquarePants JimBobSquarePants added this to the 1.1.0 milestone Dec 18, 2020
@JimBobSquarePants JimBobSquarePants requested a review from a team December 18, 2020 11:24
@antonfirsov
Copy link
Member

@saucecontrol can we use this approach for pixel blending? Seems cheaper than #1433.

@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #1481 (5659148) into master (611ff85) will increase coverage by 0.03%.
The diff coverage is 97.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1481      +/-   ##
==========================================
+ Coverage   83.48%   83.52%   +0.03%     
==========================================
  Files         741      741              
  Lines       32575    32664      +89     
  Branches     3652     3661       +9     
==========================================
+ Hits        27194    27281      +87     
- Misses       4668     4669       +1     
- Partials      713      714       +1     
Flag Coverage Δ
unittests 83.52% <97.16%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ImageSharp/PixelFormats/Utils/Vector4Converters.cs 100.00% <ø> (ø)
...ssing/Processors/Transforms/Resize/ResizeWorker.cs 98.73% <50.00%> (-0.02%) ⬇️
src/ImageSharp/Common/Helpers/Numerics.cs 96.99% <60.00%> (-0.82%) ⬇️
...mageSharp/ColorSpaces/Companding/SRgbCompanding.cs 100.00% <100.00%> (ø)
...ssing/Processors/Transforms/Resize/ResizeKernel.cs 100.00% <100.00%> (ø)

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 611ff85...5659148. Read the comment docs.

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

Let's make the lazy code thread-safe + a major concern regarding tests.

Can't comment on the SIMD code (too much time to review properly), but I trust the test coverage as usual.

@saucecontrol
Copy link
Contributor

@saucecontrol can we use this approach for pixel blending? Seems cheaper than #1433.

Yep, I use it for all my linear pixel conversions. It also works great in combination with fixed-point math, which I still use as a fallback on non-RyuJIT netfx. In that case, you can have a 15-bit LUT with direct lookups and no interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants