-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Reimplemented Jpeg postprocessor logic + fixed bugs in stream parsing #322
Conversation
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.
looking good to me, just a tiny (not worth blocking) thing around const
vs readonly static
{ | ||
#pragma warning disable SA1310 // FieldNamesMustNotContainUnderscore | ||
private static readonly float C_1_175876 = 1.175876f; | ||
private static readonly float C_1_175876 = 1.175875602f; |
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.
wouldn't theses be better as const
values instead of readonly static
ones?
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.
Wow, worked with this code a lot but haven't spotted this all the time! I think this is because these values were originally defined as Vector4
.
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.
Yeah, we can fix that as we optimize post beta.
Very happy with this as is. Well done @antonfirsov on this and in getting real tests in there. Will help out post beta to introduce more constants into the decoding process. |
Just leaving the above so we have a known reference point to optimize from. |
Reimplemented Jpeg postprocessor logic + fixed bugs in stream parsing
Prerequisites
Description
Should fix stability and memory issues #224 #214 #178 #159 #151 and provide better accuracy (#245 #155) without significant performance drop. For some images it produces almost identical results to libjpeg-turbo (run
CompareJpegDecoders_Baseline()
for comparison results).