Repository navigation
Refactor JpegDecoder to use Buffers. - #210
Conversation
… to centralize memory management.
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
==========================================
- Coverage 89.91% 89.89% -0.03%
==========================================
Files 502 501 -1
Lines 22339 22324 -15
Branches 1563 1564 +1
==========================================
- Hits 20087 20069 -18
- Misses 1828 1830 +2
- Partials 424 425 +1
Continue to review full report at Codecov.
|
| byte[] pixels = BytePool.Rent(size); | ||
| return new JpegPixelArea(pixels, width, 0); | ||
| } | ||
| public static JpegPixelArea CreatePooled(int width, int height) => new JpegPixelArea(Buffer2D<byte>.CreateClean(width, height), width, 0); |
There was a problem hiding this comment.
We should remove CreatePooled() / ReturnPooled() entirely, because this is an ownership/lifecycle concern. JpegDecoderCore and YCbCrImage should own (create + dispose) Buffer2D<byte> instead.
JpegPixelArea has to be a temporal struct to manage a (sub)area of pixels owned by Buffer2D<byte>.
…separate memory management.
|
Looks good now, thanks a lot @firenero! Has anyone any concerns, or can I merge this now? @JimBobSquarePants? |
|
I'll merge it now. Thanks @firenero really appreciate your help! 👍 |
Prerequisites
Description
Remove
DecodedBlockArraystruct and replace it usages with newBuffer<T>. One of the cases in #192