Skip to content

Conversation

@brianpopow
Copy link
Collaborator

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 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

This is a follow up PR to #1800: As suggested by @antonfirsov, the clip tables are now accessed via methods.

Also adds some minor improvements to Vp8LBitReader

- Make bitmask static readonly
- Add aggresive inlining
- Change Guard to DebugGuard in ReadValue
@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Merging #1803 (4598b14) into master (49bd35c) will decrease coverage by 0.20%.
The diff coverage is 99.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1803      +/-   ##
==========================================
- Coverage   87.30%   87.10%   -0.21%     
==========================================
  Files         936      936              
  Lines       47855    47848       -7     
  Branches     6011     6010       -1     
==========================================
- Hits        41780    41678     -102     
- Misses       5085     5176      +91     
- Partials      990      994       +4     
Flag Coverage Δ
unittests 87.10% <99.58%> (-0.21%) ⬇️

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

Impacted Files Coverage Δ
.../ImageSharp/Formats/Webp/BitReader/Vp8BitReader.cs 89.02% <ø> (-0.52%) ⬇️
...ImageSharp/Formats/Webp/BitReader/Vp8LBitReader.cs 95.16% <66.66%> (+8.20%) ⬆️
src/ImageSharp/Formats/Webp/Lossy/LossyUtils.cs 100.00% <100.00%> (ø)
src/ImageSharp/Formats/Webp/WebpLookupTables.cs 98.79% <100.00%> (+<0.01%) ⬆️
.../ImageSharp/Formats/Webp/Lossless/LosslessUtils.cs 88.43% <0.00%> (-9.19%) ⬇️
...ageSharp/Formats/Webp/Lossless/PredictorEncoder.cs 89.10% <0.00%> (-9.18%) ⬇️
...rc/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs 97.37% <0.00%> (-0.13%) ⬇️
...mageSharp/Formats/Webp/Lossless/NearLosslessEnc.cs 96.22% <0.00%> (+3.77%) ⬆️

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 49bd35c...4598b14. Read the comment docs.

InitializeFixedCostsI4();
}

private static readonly byte[] Abs0Table =
Copy link
Contributor

Choose a reason for hiding this comment

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

Make these use the ReadOnlySpan-trick?
Cf. #1799 (comment)

It's already used in this class e.g. in LogTable8Bit (above).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before I make this change, i would like to ask for other opinions on that matter. Should we really go all in with that trick and change all byte, sbyte arrays to ReadOnlySpan here?

Copy link
Member

Choose a reason for hiding this comment

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

I would say yes.

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.

Looks good!

@brianpopow brianpopow merged commit 5a7c1f4 into master Nov 3, 2021
@brianpopow brianpopow deleted the bp/cliptables branch November 3, 2021 14:32
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.

5 participants