Ivan Smirnov
|
2a764a1132
|
Further encoder improvements
|
2021-12-31 14:37:42 +03:00 |
|
Ivan Smirnov
|
637ac22a99
|
(Clippy fixes across the board)
|
2021-12-31 14:37:42 +03:00 |
|
Ivan Smirnov
|
b315ea20a7
|
Mark consts mod as doc(hidden)
|
2021-12-31 13:38:19 +03:00 |
|
Ivan Smirnov
|
2dcbdd19c2
|
Rework ColorSpace to match the latest spec (0 | 1)
|
2021-12-31 13:38:19 +03:00 |
|
Ivan Smirnov
|
c39844fb98
|
Implement From<!> for Error
|
2021-12-31 13:38:19 +03:00 |
|
Ivan Smirnov
|
5b0d420200
|
Specialize the decoder by source channels as well
|
2021-12-31 13:38:19 +03:00 |
|
Ivan Smirnov
|
9e7c508a34
|
Add forbid(unsafe_code) at crate root
|
2021-12-31 02:01:24 +03:00 |
|
Ivan Smirnov
|
a9a01c6fbd
|
Rework the decoder so it's safe, add bytemuck dep
|
2021-12-31 02:01:24 +03:00 |
|
Ivan Smirnov
|
6ce544950d
|
Rework the encoder, replace all unsafe code
|
2021-12-31 02:01:24 +03:00 |
|
Ivan Smirnov
|
239a22926c
|
Get rid of most unsafe in decoder (1% speed loss)
|
2021-12-31 02:01:24 +03:00 |
|
Ivan Smirnov
|
b25b060945
|
Simplify likely/unlikely/cold helpers
|
2021-12-31 02:01:24 +03:00 |
|
Ivan Smirnov
|
b0467472ae
|
Big rework: everything now matches the latest spec
|
2021-12-30 13:25:52 +03:00 |
|
Ivan Smirnov
|
6ed5f13487
|
Remove canonical mod and remove it from benches
|
2021-12-29 22:40:41 +03:00 |
|
Ivan Smirnov
|
24775b1014
|
(Remove temporary tests from crate root)
|
2021-12-29 22:39:14 +03:00 |
|
Ivan Smirnov
|
f906d13e90
|
Update pixel hash function to the latest spec
|
2021-12-29 16:11:27 +03:00 |
|
Ivan Smirnov
|
6640bc571a
|
Add unique stream-end marker (7 zeros and one 1)
|
2021-12-29 16:07:54 +03:00 |
|
Ivan Smirnov
|
4d0d760f92
|
Enforce maximum size of 400Mp (QOI_PIXELS_MAX)
|
2021-12-29 16:00:16 +03:00 |
|
Ivan Smirnov
|
3ec3d34987
|
Add Header::new() and with_colorspace()
|
2021-12-02 15:57:57 +00:00 |
|
Ivan Smirnov
|
02734e4eca
|
Replace Header::SIZE -> encoded_size()
|
2021-12-02 15:57:03 +00:00 |
|
Ivan Smirnov
|
0825c0aa3a
|
Fix a few clippy lints
|
2021-12-02 15:55:56 +00:00 |
|
Ivan Smirnov
|
bfbf032fff
|
Implement Debug manually for ColorSpace
|
2021-12-01 17:17:26 +00:00 |
|
Ivan Smirnov
|
0d612fd3c2
|
Fix: check decode buffer end after the run opcode
|
2021-12-01 17:13:50 +00:00 |
|
Ivan Smirnov
|
4067d83829
|
Mark a few methods as inline in header mod
|
2021-12-01 17:07:32 +00:00 |
|
Ivan Smirnov
|
7446a0f171
|
Add Header::validate(), don't check in qoi_dec_hdr
|
2021-12-01 17:07:21 +00:00 |
|
Ivan Smirnov
|
fc41914a48
|
Refactor decoder so it now uses qoi_decode_header
|
2021-12-01 17:01:41 +00:00 |
|
Ivan Smirnov
|
d9507911f7
|
Encoding: mark unlikely and inline
|
2021-12-01 16:57:20 +00:00 |
|
Ivan Smirnov
|
8f0a78a8c9
|
Add Header::n_pixels()
|
2021-12-01 16:04:04 +00:00 |
|
Ivan Smirnov
|
f17d2b6201
|
Add decode::qoi_decode_header()
|
2021-12-01 16:01:58 +00:00 |
|
Ivan Smirnov
|
d7c8346e39
|
Error::BadDecodingDataSize -> InputBufferTooSmall
|
2021-12-01 16:01:17 +00:00 |
|
Ivan Smirnov
|
cd6f8df1fa
|
Remove unneeded mut
|
2021-12-01 00:05:04 +00:00 |
|
Ivan Smirnov
|
1ad85dc019
|
Re-export qoi_encode_to_buf / encode_size_required
|
2021-12-01 00:04:51 +00:00 |
|
Ivan Smirnov
|
36383a3ea5
|
Re-export consts module
|
2021-12-01 00:04:28 +00:00 |
|
Ivan Smirnov
|
dd2ed70e70
|
Decoder: check read buffer bounds for safety
|
2021-11-30 14:31:33 +00:00 |
|
Ivan Smirnov
|
572194c0f2
|
Decoder: mark redundant match arm as unreachable
|
2021-11-30 14:30:55 +00:00 |
|
Ivan Smirnov
|
09976fb889
|
Add stable likely/unlikely to utils module
|
2021-11-30 14:30:13 +00:00 |
|
Ivan Smirnov
|
1bb6ee118c
|
Add qoi_encode_to_buf() and encode_size_required()
|
2021-11-30 02:46:04 +00:00 |
|
Ivan Smirnov
|
439a285920
|
Add canonical mod with reference i16-diff encode
|
2021-11-29 23:24:47 +00:00 |
|
Ivan Smirnov
|
b290afbc02
|
Re-export Header type at the crate root
|
2021-11-29 22:39:06 +00:00 |
|
Ivan Smirnov
|
62a659eb03
|
Change magic type to u32 (like in reference impl)
|
2021-11-29 22:38:09 +00:00 |
|
Ivan Smirnov
|
f19c0ee641
|
Remove unused imports from decode module
|
2021-11-29 22:33:27 +00:00 |
|
Ivan Smirnov
|
fd71a24506
|
Mark tag masks in consts mod as allow(unused)
|
2021-11-29 22:32:04 +00:00 |
|
Ivan Smirnov
|
236f55ed3c
|
Change Header::default() impl so it's a valid one
|
2021-11-29 22:30:53 +00:00 |
|
Ivan Smirnov
|
7d0b0a5b62
|
Change colorspace in Header to ColorSpace type
|
2021-11-29 22:30:29 +00:00 |
|
Ivan Smirnov
|
83e75b1b65
|
Add colorspace support to qoi_encode_to_vec()
|
2021-11-29 22:27:17 +00:00 |
|
Ivan Smirnov
|
9ef519164b
|
Add ColorSpace type
|
2021-11-29 22:23:39 +00:00 |
|
Ivan Smirnov
|
3dc0d6adab
|
Add mask comments to consts module
|
2021-11-29 13:58:11 +00:00 |
|
Ivan Smirnov
|
899270e42e
|
Rework all branching in the decoder
|
2021-11-29 11:30:09 +00:00 |
|
Ivan Smirnov
|
cbae67b07d
|
No bound checks when indexing during decoding
|
2021-11-29 04:21:50 +00:00 |
|
Ivan Smirnov
|
f8ec8011fc
|
Initial working version (but lots of temp stuff)
|
2021-11-28 16:20:24 +00:00 |
|