-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
Swap jpeg decoders #571
Swap jpeg decoders #571
Conversation
Codecov Report
@@ Coverage Diff @@
## master #571 +/- ##
==========================================
- Coverage 88.79% 88.78% -0.02%
==========================================
Files 851 854 +3
Lines 36037 36097 +60
Branches 2609 2607 -2
==========================================
+ Hits 31999 32047 +48
- Misses 3260 3274 +14
+ Partials 778 776 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In library code, all changes seem formal refactors to me, all looking good.
Managed to identify a few redundant tests however.
[Theory] | ||
[WithFile(TestImages.Jpeg.Baseline.Calliphora, PixelTypes.Rgba32)] | ||
[WithFile(TestImages.Jpeg.Baseline.Testorig420, PixelTypes.Rgba32)] | ||
public void DoProcessorStepPdfJs<TPixel>(TestImageProvider<TPixel> provider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VerifySpectralCorrectness_PdfJs/Golang
should test the first step, here we only need to test JpegImagePostProcessor
, so parsing input with both decoders doesn't add value here.
It's totally fine to run JpegImagePostProcessorTests
with the default jpeg decoder only, which is PdfJsDecoderCore
now.
@@ -80,9 +80,9 @@ internal partial struct Block8x8F | |||
set => this[(y * 8) + x] = value; | |||
} | |||
|
|||
public static Block8x8F operator *(Block8x8F block, float value) | |||
public static Components.Block8x8F operator *(Components.Block8x8F block, float value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting "Qualifier is redundant" tips everywhere.
I wonder which analyzer added the namespace qualifiers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was Resharper, probably due to the struct being a partial.
Did some refactor on JpegDecoderTests + added another test image for #159. Everything LGTM now, feel free to merge! |
Swap jpeg decoders
Prerequisites
Description
This PR switches out the old Golang based Jpeg decoder with the newer PdfJs decoder.
This gives us a robust decoder that produces 100% accurate spectral output. Performance matches the Golang decoder with less memory usage. There is excellent scope for further improving performance also.
We'll keep both decoders in the codebase for now as there might be ideas we can still pinch from the Golang decoder.
Fixes #517 and #518
I've also expanded the unit tests to better cover both decoders and reorganized the internal namespaces to clean up the code.