commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
4077ebaaa1bd100e4e282fa1ebed590e4a9306b2
Moritz Borcherding
2019-11-24T16:42:58
added explanatory comment
diff --git a/src/streaming_decoder.rs b/src/streaming_decoder.rs index f539280..2eb6ad4 100644 --- a/src/streaming_decoder.rs +++ b/src/streaming_decoder.rs @@ -36,6 +36,11 @@ impl<'a> Read for StreamingDecoder<'a> { return Ok(0) } + // need to loop. The UpToBytes strategy doesnt ...
1
5
0
91a065b06a7d5baed72175a99b6ad918ef84499d
Moritz Borcherding
2019-11-24T16:34:36
added a streaming decoder that does not have to be called decode_* on but just decodes new bytes as needed
diff --git a/src/lib.rs b/src/lib.rs index 9fb7870..791a0fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ pub mod decoding; pub mod errors; pub mod frame; pub mod frame_decoder; +pub mod streaming_decoder; pub mod fse; pub mod huff0; mod tests; @@ -10,3 +11,4 @@ mod tests; pub const VERBOSE: bool = fa...
3
143
2
20b32fffbcd1505532174ec0fd1acdcb8d9aacda
Moritz Borcherding
2019-11-04T10:56:44
add readme to Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml index bf91e85..1dfa61a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ homepage = "https://github.com/KillingSpark/zstd-rs" repository = "https://github.com/KillingSpark/zstd-rs" description = "A decoder for the zstd compression format" exclude = ["decodecorpus_files/*",...
1
1
0
5776d28440a119b6897055476cc65d165c791484
Moritz Borcherding
2019-11-04T10:56:05
added excludes for test files in Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml index 2f1cceb..bf91e85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" homepage = "https://github.com/KillingSpark/zstd-rs" repository = "https://github.com/KillingSpark/zstd-rs" description = "A decoder for the zstd compression format" -exclude = ["decod...
1
1
1
b6ed9c44fbf7776013e062de75a3e9a5fef64c73
Moritz Borcherding
2019-11-04T10:55:36
added excludes for test files in Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml index a18efda..2f1cceb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ license = "MIT" homepage = "https://github.com/KillingSpark/zstd-rs" repository = "https://github.com/KillingSpark/zstd-rs" description = "A decoder for the zstd compression format" +exclude = ["decod...
1
1
0
1f5619aed8480b8010ee0569a3d349b2899fbf7f
Moritz Borcherding
2019-11-04T09:27:45
add some more metadata to the Cargo.toml for crates.io
diff --git a/Cargo.toml b/Cargo.toml index ccc85ae..a18efda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT" homepage = "https://github.com/KillingSpark/zstd-rs" +repository = "https://github.com/KillingSpark/zstd-r...
1
2
0
6b0f851002542fe6f175e975f6f8397832ec8d64
Moritz Borcherding
2019-11-04T09:26:16
add some more metadata to the Cargo.toml for crates.io
diff --git a/Cargo.toml b/Cargo.toml index 4d3ebf4..ccc85ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,8 @@ name = "ruzstd" version = "0.2.0" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" +license = "MIT" +homepage = "https://github.com/KillingSpark/zstd-rs" [dependencies]...
1
2
0
a3d13705cfad4ed625aae1d0791057a4c6e2b61d
Moritz Borcherding
2019-11-04T09:14:23
bump 0.1.1 to 0.2.0 because of the name change
diff --git a/Cargo.toml b/Cargo.toml index 2912a63..4d3ebf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.1.1" +version = "0.2.0" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018"
1
1
1
18fe5173c236b0997356e061b8194ed83eed61ab
Moritz Borcherding
2019-11-04T09:13:27
changed from zstd-rs to ruzstd
diff --git a/Cargo.toml b/Cargo.toml index aa758ff..2912a63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "zstd-rs" -version = "0.1.0" +name = "ruzstd" +version = "0.1.1" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" diff --git a/fuzz/Cargo.toml b/fuzz/C...
4
9
9
bd4cafea46783f8ac785c93e0e59369fd0ed35e0
Moritz Borcherding
2019-11-04T09:05:51
added hint to use decode_blocks instead of decode_from_to
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index b27f809..4f2226d 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -371,6 +371,9 @@ impl FrameDecoder { /// Decodes as many blocks as possible from the source slice and reads from the decodebuffer into the target slice /// The sour...
1
3
0
983f775b2f278dfe7d5eb3b8d12c55144eada630
Moritz Borcherding
2019-11-04T09:03:15
fixed case where the cecksum can be spearated from the rest from the frame in decode_from_to
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index ac289cc..b27f809 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -184,7 +184,11 @@ impl FrameDecoder { None => return true, Some(s) => s, }; - state.frame_finished + if state.frame.header.desc...
2
45
9
1141754e7062b77b25523ba22f9d54b116535cc8
Moritz Borcherding
2019-10-31T19:43:41
added unit test for the foward bitreader
diff --git a/src/tests/bit_reader.rs b/src/tests/bit_reader.rs index 20c26e9..353c0b7 100644 --- a/src/tests/bit_reader.rs +++ b/src/tests/bit_reader.rs @@ -1,10 +1,10 @@ #[test] -fn test_bitreader() { +fn test_bitreader_reversed() { use crate::decoding::bit_reader_reverse::BitReaderReversed; let encoded: ...
1
37
3
c71351fb8e1055c3ebc5b8ebbc3872a24151583a
Moritz Borcherding
2019-10-31T19:30:07
added unit test for the reversed bitreader
diff --git a/src/tests/bit_reader.rs b/src/tests/bit_reader.rs new file mode 100644 index 0000000..20c26e9 --- /dev/null +++ b/src/tests/bit_reader.rs @@ -0,0 +1,33 @@ +#[test] +fn test_bitreader() { + use crate::decoding::bit_reader_reverse::BitReaderReversed; + + let encoded: [u8;16] = [0xC1, 0x41, 0x08, 0x00, ...
2
34
0
d8024e4741b35259826ebbd7f2bc742b4b4b586d
Moritz Borcherding
2019-10-31T18:08:10
added unit test for the dict parser
diff --git a/src/decoding/dictionary.rs b/src/decoding/dictionary.rs index 4899f65..b206f3b 100644 --- a/src/decoding/dictionary.rs +++ b/src/decoding/dictionary.rs @@ -20,9 +20,11 @@ impl Dictionary { dict_content: Vec::new(), offset_hist: [2, 4, 8], }; - let magic_num = &raw[...
2
68
3
e198d52d9a0c806a780af9da8ebcaf69f6e11ea4
Moritz Borcherding
2019-10-28T15:53:16
more clippy suggestions
diff --git a/src/decoding/scratch.rs b/src/decoding/scratch.rs index 397933f..1179c79 100644 --- a/src/decoding/scratch.rs +++ b/src/decoding/scratch.rs @@ -89,6 +89,12 @@ impl HuffmanScratch { } } +impl Default for HuffmanScratch { + fn default() -> Self { + Self::new() + } +} + #[derive(Clone)] ...
5
38
8
229c31be0b6b1001349409db0b91209e74d6f22a
Moritz Borcherding
2019-10-28T15:30:42
moved all manual little-endian decoding into decoding::little_endian
diff --git a/src/decoding/dictionary.rs b/src/decoding/dictionary.rs index 471c64a..4899f65 100644 --- a/src/decoding/dictionary.rs +++ b/src/decoding/dictionary.rs @@ -25,10 +25,7 @@ impl Dictionary { let _ = magic_num; let dict_id = &raw[4..8]; - let dict_id = dict_id[0] as u32 - ...
6
45
102
99a34b159181b625e9c3614860e740d098740d11
Moritz Borcherding
2019-10-28T15:07:19
ran cargo fmt
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs index 06f5383..a3c0ec2 100644 --- a/src/decoding/bit_reader.rs +++ b/src/decoding/bit_reader.rs @@ -5,10 +5,7 @@ pub struct BitReader<'s> { impl<'s> BitReader<'s> { pub fn new(source: &'s [u8]) -> BitReader { - BitReader { - ...
11
85
90
67694c5934136924ae9076d3c5ff4bcc83ce8989
Moritz Borcherding
2019-10-28T15:04:31
fixed offset history decoding
diff --git a/src/decoding/dictionary.rs b/src/decoding/dictionary.rs index 3e696f0..7a9131a 100644 --- a/src/decoding/dictionary.rs +++ b/src/decoding/dictionary.rs @@ -55,16 +55,22 @@ impl Dictionary { let raw_tables = &raw_tables[ll_size as usize..]; let offset1 = &raw_tables[0..4]; - let o...
1
12
6
935aa1c2f0137b2e7a2a6c9b0f52e878e02393ef
Marcel Hellwig
2019-10-27T09:21:03
more clippy suggestsions
diff --git a/src/block/sequence_section.rs b/src/block/sequence_section.rs index 24fa734..0684d27 100644 --- a/src/block/sequence_section.rs +++ b/src/block/sequence_section.rs @@ -36,15 +36,15 @@ impl CompressionModes { } } - pub fn ll_mode(&self) -> ModeType { + pub fn ll_mode(self) -> ModeType ...
16
138
163
1f6749d700f82697584c809b4ca81eeab1bf96bb
Moritz Borcherding
2019-10-27T07:42:17
clippy suggestions implemented
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 388b111..362a8a8 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -9,8 +9,8 @@ struct StateTracker { } fn main() { - let mut file_paths: Vec<_> = std::env::args().filter(|f| !f.starts_with("-")).collect(); - let flags: Vec<_> = std::env::args().filter(...
1
6
7
e55e395c2d8e8f9af721d3b95560d25677d777fa
Moritz Borcherding
2019-10-27T07:38:30
removed unneeded newline
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 264e892..388b111 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -95,7 +95,7 @@ fn main() { eprintln!("Checksums are ok!"); } } - None => eprintln!("No checksums to test\n"), + None => epr...
1
1
1
9f493595562d8b1e5bdc2c70c4208a7fee127347
Moritz Borcherding
2019-10-27T07:37:29
simpler printing to stderr
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 1144359..264e892 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -14,26 +14,20 @@ fn main() { file_paths.remove(0); if !flags.contains(&"-d".to_owned()) { - std::io::stderr() - .write( - b"This zstd implementation on...
1
17
35
7765b69ab927f210e715bb34f041d755b75fb35f
Moritz Borcherding
2019-10-27T07:28:09
ran cargo fmt
diff --git a/src/decoding/dictionary.rs b/src/decoding/dictionary.rs index abdc9ae..bded7c0 100644 --- a/src/decoding/dictionary.rs +++ b/src/decoding/dictionary.rs @@ -18,7 +18,7 @@ impl Dictionary { fse: FSEScratch::new(), huf: HuffmanScratch::new(), dict_content: Vec::new(), - ...
5
47
27
98a8cd485e8ba1a1b386dd642c3f23e0f1c048b1
Moritz Borcherding
2019-10-26T08:25:23
remove printlns and add dictionary support to decode_from_to
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 89f3d90..026b78f 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -122,7 +122,6 @@ impl FrameDecoder { /// Add a dict to the FrameDecoder that can be used when needed. The FrameDecoder uses the appropriate one dynamically pub fn add...
1
28
2
2119540481e5730690a3b8f08625226bbe7cad25
Moritz Borcherding
2019-10-26T08:05:32
add doc comments for the new functions
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 592702b..89f3d90 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -88,6 +88,7 @@ impl FrameDecoder { pub fn init(&mut self, source: &mut Read) -> Result<(), String> { self.reset(source) } + /// Like init but provides the...
1
9
2
089167f55e9994f13dd28ec86c9413f78c19bb87
Moritz Borcherding
2019-10-26T07:59:28
add descriptive error for the case a dict id was specified but the dict was not provided
diff --git a/src/errors/mod.rs b/src/errors/mod.rs index 5ac822c..c43a5bf 100644 --- a/src/errors/mod.rs +++ b/src/errors/mod.rs @@ -7,6 +7,7 @@ pub enum FrameDecoderError { FailedToInitialize(String), FailedToDrainDecodebuffer, TargetTooSmall, + DictNotProvided, } impl std::fmt::Display for Frame...
2
16
5
55c99ed20d8c46642f1da30363eabe0788717991
Moritz Borcherding
2019-10-26T07:54:40
added support for cached dicts in the framedecoder
diff --git a/src/decoding/dictionary.rs b/src/decoding/dictionary.rs new file mode 100644 index 0000000..abdc9ae --- /dev/null +++ b/src/decoding/dictionary.rs @@ -0,0 +1,84 @@ +use crate::decoding::scratch::FSEScratch; +use crate::decoding::scratch::HuffmanScratch; + +pub struct Dictionary { + pub id: u32, + pub...
7
169
8
13a0ad0dd75a4f2d23532798a94e410be5cf412d
Moritz Borcherding
2019-10-26T07:54:19
fixed dictionary-id decoding. Is little endian not big endian
diff --git a/src/frame.rs b/src/frame.rs index 83f222e..04dda96 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -120,8 +120,10 @@ impl FrameHeader { )) } else { let mut value: u32 = 0; + let mut shift = 0; ...
1
3
1
ae02a7676b40864cf51eee910263c3d503910efe
Moritz Borcherding
2019-10-25T10:20:20
add check checksums if available
diff --git a/src/tests/decode_corpus.rs b/src/tests/decode_corpus.rs index 3585071..0ce8202 100644 --- a/src/tests/decode_corpus.rs +++ b/src/tests/decode_corpus.rs @@ -8,6 +8,7 @@ fn test_decode_corpus_files() { let mut fail_counter_diff = 0; let mut fail_counter_size = 0; let mut fail_counter_bytes_rea...
3
52
3
7fa37d58a362d815ddd636b8622ced60518566ed
Moritz Borcherding
2019-10-25T10:19:51
need 4 bytes not three...
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 467dff0..af112d8 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -385,7 +385,7 @@ impl FrameDecoder { state.frame_finished = true; if state.frame.header.descriptor.content_checksum_flag() { ...
1
1
1
3935e7031905b99987d7013648ae072b7087522e
Moritz Borcherding
2019-10-25T10:19:20
needed else clause after removing the early return
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index eeed046..06a68d3 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -99,48 +99,49 @@ impl Decodebuffer { self.buffer.len() )); } - } - - let start_...
1
38
38
0d734011cb02b1bc4ef99dd513aae41eb0acd2fc
Moritz Borcherding
2019-10-25T09:56:20
fixed version of twox-hash
diff --git a/Cargo.toml b/Cargo.toml index 0b7ed2b..aa758ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,4 @@ edition = "2018" [dependencies] byteorder = "1.3.2" -twox-hash = "*" \ No newline at end of file +twox-hash = "1.5.0" \ No newline at end of file
1
1
1
ddd68713e1edc3907167391d21e5685fb8dfd872
Moritz Borcherding
2019-10-25T09:55:34
added support for checksum calculation
diff --git a/Cargo.toml b/Cargo.toml index d8c9ff0..0b7ed2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,5 @@ authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" [dependencies] -byteorder = "*" +byteorder = "1.3.2" +twox-hash = "*" \ No newline at end of file diff --git a/src/bin/zs...
4
80
9
02d31dde931352f0de5a88502796a9ea593600a0
Moritz Borcherding
2019-09-29T13:04:24
bin/zstd is now somewhat compatible with the standard zstd flags. It only supports the zstd -d -c <files> mode for now
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index b70025c..8af5cff 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -9,9 +9,25 @@ struct StateTracker { } fn main() { - let mut file_paths: Vec<_> = std::env::args().collect(); + let mut file_paths: Vec<_> = std::env::args().filter(|f| !f.starts_with("-"...
1
17
1
9e7619e976616e0c92c9234d30f5f9d5f63731a7
Moritz Borcherding
2019-09-29T12:49:29
new state tracker for each file, not for the whole process
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 6955a00..b70025c 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -11,14 +11,15 @@ struct StateTracker { fn main() { let mut file_paths: Vec<_> = std::env::args().collect(); file_paths.remove(0); - let mut tracker = StateTracker { - bytes_us...
1
5
4
600b5cf8b9b3ae1481aed2baa633e6d67f25b2c5
Moritz Borcherding
2019-09-27T16:31:25
more checks for offsets so wrong inputs will not panic the decoder
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 84ab1ca..f5ad6ec 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -59,16 +59,15 @@ impl Decodebuffer { } pub fn repeat(&mut self, offset: usize, match_length: usize) -> Result<(), String> { - ...
1
5
6
74fc81ee1415ec0320f088c3587566c364dd0c8d
Moritz Borcherding
2019-09-27T16:24:52
added support for loading dictionaries and using them in decoding
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index c3e8c21..84ab1ca 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -1,7 +1,9 @@ pub struct Decodebuffer { - buffer: Vec<u8>, + pub buffer: Vec<u8>, + pub dict_content: Vec<u8>, - window_size: usiz...
3
74
12
441d4428788041b156be2f3ef99015dcdc6f3ace
Moritz Borcherding
2019-09-27T06:56:52
need to check if the stream is consumed before all sequences are decoded and return an error if so
diff --git a/src/decoding/block_decoder.rs b/src/decoding/block_decoder.rs index 59f90de..e1f93ec 100644 --- a/src/decoding/block_decoder.rs +++ b/src/decoding/block_decoder.rs @@ -209,6 +209,9 @@ impl BlockDecoder { &mut workspace.fse, &mut workspace.sequences, )?; + ...
2
7
0
de84885ddb296cea0c1c9be3d532846a07fe4342
Moritz Borcherding
2019-09-26T07:44:14
removed old TODOs that were still around
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 58b033a..6955a00 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -19,7 +19,9 @@ fn main() { let mut frame_dec = zstd_rs::FrameDecoder::new(); for path in file_paths { - std::io::stderr().write_fmt(format_args!("File: {}\n", path)).unwrap(); +...
5
23
17
b716f615762b520b117661a792e111f2bf934fd4
Moritz Borcherding
2019-09-24T21:04:24
cargo doc can now generate useful documentation for the framedocder
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index c1e30a9..ac29609 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -59,14 +59,29 @@ impl FrameDecoderState { } impl FrameDecoder { + /// This will create a new decoder without allocating anything yet. + /// init()/reset() will alloc...
1
18
2
e201f16741698f11ef55eaa169e43f1686a82ed4
Moritz Borcherding
2019-09-24T20:52:08
even better line showing percentages
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index a8947be..58b033a 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -46,7 +46,7 @@ fn main() { let percentage = (tracker.bytes_used * 100) / frame_dec.content_size().unwrap(); if percentage as i8 != tracker.old_percentage { ...
1
1
1
bb2e2a84abe34c25df9278ada7904be3b0a9c4a6
Moritz Borcherding
2019-09-24T20:51:08
cooler output with only one self-updating line showing the percentages
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 367d607..a8947be 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -1,6 +1,7 @@ extern crate zstd_rs; use std::fs::File; use std::io::Read; +use std::io::Write; struct StateTracker { bytes_used: u64, @@ -18,12 +19,12 @@ fn main() { let mut frame_d...
1
8
8
dd09ad4cb06443f6112fee8a1e4458b8b6dfc82b
Moritz Borcherding
2019-09-24T20:14:02
run cargo fmt
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index b1b0d17..367d607 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -42,8 +42,7 @@ fn main() { do_something(&mut result, &mut tracker); result.resize(result.capacity(), 0); - let percentage = (tracker.bytes_used *...
20
171
131
a0031b3897e11547a92fa4d8f1225f9da9933219
Moritz Borcherding
2019-09-24T20:12:27
merged the drain/collect functions. Collect will now do the correct things depending on whether the framedecoder has finished or not
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 97348c7..b1b0d17 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -1,7 +1,6 @@ extern crate zstd_rs; use std::fs::File; use std::io::Read; -use zstd_rs::frame_decoder; struct StateTracker { bytes_used: u64, @@ -16,7 +15,7 @@ fn main() { old_p...
5
47
45
df1525576cd3fc2baf018aa0a9a6999ec858cee4
Moritz Borcherding
2019-09-24T16:53:05
added todo with further optimizations
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 19d09d2..878ed1b 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -76,6 +76,8 @@ impl Decodebuffer { self.buffer.push(self.buffer[start_idx + x]); } } else { + ...
1
2
0
ffc697eb5253ba90e95a4cd562f5028897842f26
Moritz Borcherding
2019-09-24T16:47:19
emulate zstd -d -c behaviour and print on stdout to make comparisons fairer
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 3defa9a..97348c7 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -68,5 +68,7 @@ fn main() { fn do_something(data: &Vec<u8>, s: &mut StateTracker) { //Do something. Like writing it to a file or to stdout... + use std::io::Write; + std::io::stdout()...
1
2
0
86ff6c028b56705835a75311c9a4d4c0d9bdc3ac
Moritz Borcherding
2019-09-24T15:23:16
rewrite of decodebuffer::read(_all) to use &[u8]::read instead of copying bytewise
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 869a27a..4c8e177 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -21,13 +21,11 @@ impl std::io::Read for Decodebuffer { return Ok(0); } - let mut counter = 0; - for x in s...
2
12
15
e1b7241ceeefbc021bc649e112fe4e86cb92499d
Moritz Borcherding
2019-09-24T10:10:42
added support to use decode_from_to() for draining as well
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index ce49175..0686120 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -260,82 +260,86 @@ impl FrameDecoder { /// Decodes as many blocks as possible from the source slice and reads from the decodebuffer into the target slice /// The so...
1
63
59
02e1bf0d6865279473b4e21556090a0e3409505a
Moritz Borcherding
2019-09-24T09:59:58
added support for the FrameDecoder::decode_from_to() to receive only partila frames as input
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index a0ea779..ce49175 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -12,7 +12,7 @@ struct FrameDecoderState { decoder_scratch: DecoderScratch, frame_finished: bool, block_counter: usize, - byte_counter: u64, + bytes_read_co...
2
109
25
5d3042d5a01f8067fb3a5e1811401dcca3b23094
Moritz Borcherding
2019-09-18T07:48:53
also measure with which speed data is consumed, not just how many bytes per second are being decoded
diff --git a/src/tests/decode_corpus.rs b/src/tests/decode_corpus.rs index c26e2fb..7f22d36 100644 --- a/src/tests/decode_corpus.rs +++ b/src/tests/decode_corpus.rs @@ -12,6 +12,7 @@ fn test_decode_corpus_files() { let mut failed: Vec<String> = Vec::new(); let mut speeds = Vec::new(); + let mut speeds_re...
1
19
0
ee3c9caa32b9779edf001a374c5592977a63f278
Moritz Borcherding
2019-09-17T21:20:51
added test for framedecoder::decode_from_to()
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index fe12985..a0ea779 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -76,7 +76,7 @@ impl FrameDecoder { pub fn content_size(&self) -> Option<u64> { let state = match &self.state { - None => return None, + No...
2
54
1
268eb19afdf6e903ae313970781074862627cf7c
Moritz Borcherding
2019-09-17T21:00:22
added convenience fn to decode from one byte slice to another one
diff --git a/src/errors/mod.rs b/src/errors/mod.rs index c9d8c2d..c625a03 100644 --- a/src/errors/mod.rs +++ b/src/errors/mod.rs @@ -4,6 +4,9 @@ pub enum FrameDecoderError { FailedToReadBlockBody(String), FailedToReadChecksum, NotYetInitialized, + FailedToInitialize(String), + FailedToDrainDecodebu...
2
27
1
5e3b111e7a8abe52c4880e9759a32654bf2a2b00
Moritz Borcherding
2019-09-17T20:25:42
make fuzzer use new api
diff --git a/fuzz/fuzz_targets/fuzz_target_1.rs b/fuzz/fuzz_targets/fuzz_target_1.rs index 70df1a3..68d189d 100644 --- a/fuzz/fuzz_targets/fuzz_target_1.rs +++ b/fuzz/fuzz_targets/fuzz_target_1.rs @@ -5,8 +5,10 @@ use zstd_rs::frame_decoder; fuzz_target!(|data: &[u8]| { let mut content = data.clone(); - matc...
1
4
2
0e106d309bb178a09965f6b97e016d5334a9863a
Moritz Borcherding
2019-09-17T20:21:50
added init function that does the same as reset for convenience
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 116b8ef..fe2c53d 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -60,6 +60,10 @@ impl FrameDecoder { FrameDecoder{state: None} } + pub fn init(&mut self, source: &mut Read) -> Result<(), String> { + self.reset(sourc...
1
4
0
600fd74760f26971b6cd8a4e00997e535336ccae
Moritz Borcherding
2019-09-17T20:20:35
framedecoder is now reset-able and with that reusable for multiple frames
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index a1bea9f..79418fd 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -16,11 +16,13 @@ fn main() { old_percentage: -1, }; + let mut frame_dec = frame_decoder::FrameDecoder::new(); + for path in file_paths { println!("File: {}", path)...
10
201
54
7f0763ca2273423e7ffcbb3424ad32b496eaddd7
Moritz Borcherding
2019-09-17T19:32:09
added possibility for the framedecoder to return how many bytes it has consumed from the source
diff --git a/src/decoding/block_decoder.rs b/src/decoding/block_decoder.rs index 6ad36a7..a86c5e2 100644 --- a/src/decoding/block_decoder.rs +++ b/src/decoding/block_decoder.rs @@ -36,7 +36,7 @@ impl BlockDecoder { header: &BlockHeader, workspace: &mut DecoderScratch, //reuse this as often as possible...
6
66
19
dc19536dd583c902ff7795580d16c2301c7e1e43
Moritz Borcherding
2019-09-17T13:04:49
moved huff0 into own directory
diff --git a/src/decoding/literals_section_decoder.rs b/src/decoding/literals_section_decoder.rs index 58b8cfc..ca074f0 100644 --- a/src/decoding/literals_section_decoder.rs +++ b/src/decoding/literals_section_decoder.rs @@ -1,5 +1,5 @@ use super::bit_reader_reverse::BitReaderReversed; -use super::huff0::HuffmanDecode...
6
6
4
012dd87a0e78ccbd3868cd995d07632b0f995b1f
Moritz Borcherding
2019-09-17T13:03:00
moved fse into own directory
diff --git a/src/decoding/huff0.rs b/src/decoding/huff0.rs index 5fda6d6..6b13bf3 100644 --- a/src/decoding/huff0.rs +++ b/src/decoding/huff0.rs @@ -1,6 +1,6 @@ use super::bit_reader_reverse::BitReaderReversed; -use super::fse::FSEDecoder; -use super::fse::FSETable; +use crate::fse::FSEDecoder; +use crate::fse::FSETab...
7
10
8
d0f6f96bf67e97a0d1e1dc572f2be1fcb1121518
Moritz Borcherding
2019-09-17T12:58:34
moved decoders from src/block into src/decoding
diff --git a/src/block/mod.rs b/src/block/mod.rs index cbee789..676f22e 100644 --- a/src/block/mod.rs +++ b/src/block/mod.rs @@ -1,6 +1,3 @@ pub mod block; -pub mod block_decoder; pub mod literals_section; -pub mod literals_section_decoder; -pub mod sequence_section; -pub mod sequence_section_decoder; \ No newline at...
7
25
25
fe676ba56f1f1719f03e6ac39d6dd94465bd2a2c
Moritz Borcherding
2019-09-17T12:40:31
rewrite of bit_reader_reversed using byteorder::LittleEndian, which passes the corpus tests
diff --git a/Cargo.toml b/Cargo.toml index 061fa02..d8c9ff0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,4 @@ authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" [dependencies] +byteorder = "*" diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs inde...
2
72
78
def272e9586866e40ed87ded7bfe8cf08cd3b0a3
Moritz Borcherding
2019-09-16T13:46:12
added some comments to frame_decoder for what the different collect/drain functions are supposed to do
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index e34fb39..c0dcc63 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -104,18 +104,22 @@ impl FrameDecoder { Ok(self.frame_finished) } + //collect is for collecting bytes and retain window_size bytes while decoding is still goi...
1
6
0
d1a2c3b9c60eec9023b079bba0205a327fb17e8d
Moritz Borcherding
2019-09-16T13:29:57
print percentages
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index ee24e63..a1bea9f 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -44,11 +44,12 @@ fn main() { let percentage = (tracker.bytes_used * 100) / frame_dec.frame.header.frame_content_size().unwrap(); if percentag...
1
2
1
80440f440de11a2b264f003911c9a2d2bc30f4d1
Moritz Borcherding
2019-09-16T13:23:06
filter artifacts for crashes. ignore slow units
diff --git a/src/tests/fuzz_regressions.rs b/src/tests/fuzz_regressions.rs index cb09b84..09fbf37 100644 --- a/src/tests/fuzz_regressions.rs +++ b/src/tests/fuzz_regressions.rs @@ -6,6 +6,12 @@ fn test_all_artifacts() { for file in fs::read_dir("./fuzz/artifacts/fuzz_target_1").unwrap() { let file_name ...
1
6
0
fc2765ccd1f40f0d4d1c07ff97852e2ecf8809a9
Moritz Borcherding
2019-09-16T12:59:33
added batching for raw blocks and RLE blocks
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 56df1fc..bfddf5f 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -6,8 +6,8 @@ use super::literals_section_decoder::decode_literals; use super::sequence_section::SequencesHeader; use super::sequence_section_decoder::...
1
41
23
70e5cae4e8475cfdd45d9ae8a73e5ed03ac0f84c
Moritz Borcherding
2019-09-16T12:40:42
first try on a std::io::Read impl
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 3eea678..4e45805 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -1,10 +1,20 @@ extern crate zstd_rs; use std::fs::File; +use std::io::Read; use zstd_rs::frame_decoder; +struct StateTracker { + bytes_used: u64, + old_percentage: i8, +} + fn main() {...
3
68
15
23e8237c1144f85ebfb8996de349a70b68289826
Moritz Borcherding
2019-09-16T07:17:51
fixed tests to use new api
diff --git a/fuzz/fuzz_targets/fuzz_target_1.rs b/fuzz/fuzz_targets/fuzz_target_1.rs index a9c330d..70df1a3 100644 --- a/fuzz/fuzz_targets/fuzz_target_1.rs +++ b/fuzz/fuzz_targets/fuzz_target_1.rs @@ -7,7 +7,7 @@ fuzz_target!(|data: &[u8]| { let mut content = data.clone(); match frame_decoder::FrameDecoder::n...
3
3
3
6f4089b0c77ebb2bc55db33050f2b794b550ca79
Moritz Borcherding
2019-09-15T14:44:42
added better aÃpi to the framedecoder and an example on how to use it
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs new file mode 100644 index 0000000..bdf2b77 --- /dev/null +++ b/src/bin/zstd.rs @@ -0,0 +1,45 @@ +extern crate zstd_rs; +use std::fs::File; +use zstd_rs::frame_decoder; + +fn main() { + let mut file_paths: Vec<_> = std::env::args().collect(); + file_paths.remove(0); ...
3
65
2
e269b6a877d214658727b5bdfbc1a49eaf5c0ba0
Moritz Borcherding
2019-09-15T10:49:05
support for partially decoding a frame, either by counting blocks or bytes
diff --git a/src/errors/mod.rs b/src/errors/mod.rs new file mode 100644 index 0000000..668c8f8 --- /dev/null +++ b/src/errors/mod.rs @@ -0,0 +1,24 @@ +#[derive(Debug)] +pub enum FrameDecoderError { + FailedToReadBlockHeader(String), + FailedToReadBlockBody(String), +} + +impl std::fmt::Display for FrameDecoderErr...
6
82
12
a3c2fa8e38e1bd7c38a204607fa525b95f64832f
Moritz Borcherding
2019-09-14T16:47:52
check for offset == 0 while decoding sequences. It's an illegal value for offsets
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index 6cebbbf..dae0a63 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -89,14 +89,18 @@ pub fn decode_sequences( //println!("ml Code: {}", ml_value); //println!(...
2
7
3
dd2156e5d281bb481f241a4349dea6a60936e122
Moritz Borcherding
2019-09-14T16:38:05
check weightsum before building table
diff --git a/src/decoding/huff0.rs b/src/decoding/huff0.rs index 759b7c5..29e69f2 100644 --- a/src/decoding/huff0.rs +++ b/src/decoding/huff0.rs @@ -210,6 +210,10 @@ impl HuffmanTable { weight_sum += if *w > 0 { (1 as u32) << (*w - 1) } else { 0 }; } + if weight_sum == 0 { + re...
1
4
0
643c7e4b659f5929dd999e52553bad3c1ed851cb
Moritz Borcherding
2019-09-14T16:31:41
test actually fails now if one file does not decode correctly
diff --git a/src/tests/decode_corpus.rs b/src/tests/decode_corpus.rs index a2635c4..346cb9f 100644 --- a/src/tests/decode_corpus.rs +++ b/src/tests/decode_corpus.rs @@ -108,7 +108,7 @@ fn test_decode_corpus_files() { total_counter, success_counter, fail_counter_size, fail_counter_diff ); println!("Fa...
1
3
1
2aca7fd9099a109ca944e04405272943f4b7abf9
Moritz Borcherding
2019-09-14T16:31:19
added checks for get's with more than 64 bit
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs index fa9445c..c9176f1 100644 --- a/src/decoding/bit_reader.rs +++ b/src/decoding/bit_reader.rs @@ -27,6 +27,9 @@ impl<'s> BitReader<'s> { } pub fn get_bits(&mut self, n: usize) -> Result<u64, String> { + if n > 64 { + re...
2
7
1
b35adf4caa62eba0e8326a02f10d488b7a7cddf3
Moritz Borcherding
2019-09-14T16:13:05
fixed the fixes. Cant check there for reusing tables. As long as they ar enot being used all is fine
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index f0176f3..ff130dc 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -74,8 +74,8 @@ fn decompress_literals( bytes_read += 6; let source = &source[6..]; - ...
3
6
20
029b724033c7877503d761a6f83e32f4d78ba201
Moritz Borcherding
2019-09-14T16:03:56
check huffamn table before reusing it in Treeless literals-sections
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index 945dd99..f0176f3 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -53,6 +53,11 @@ fn decompress_literals( println!("Built huffman table using {} bytes", byte...
1
5
0
77173673ed2b4245f66945bf5ed4ce78ba856b2d
Moritz Borcherding
2019-09-14T15:57:59
check sizes of slices before reading them
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index 8259c19..945dd99 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -60,12 +60,19 @@ fn decompress_literals( if section.num_streams.unwrap() == 4 { //build jump...
1
7
0
9a54c5521e9141a2e9bec32c0ab6494a61bd7fd5
Moritz Borcherding
2019-09-14T15:53:45
check for unitizialized tables before repeating them
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index e67b2c3..f83c0e0 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -228,13 +228,16 @@ fn maybe_update_fse_tables( scratch.literal_lengths.build_from_probabilities...
2
23
6
d3394a1ec95fa909284bfd6a7100b048a714b7e2
Moritz Borcherding
2019-09-14T15:30:17
dont panic on invalid ll/ml codes
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index 0f045cb..e67b2c3 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -75,8 +75,8 @@ pub fn decode_sequences( of_dec.decode_symbol() }; - let (ll_v...
1
52
50
ec07842974162109a7e34cbdd008580f88072d16
Moritz Borcherding
2019-09-14T15:26:39
less assertion, more error returning
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 6800d58..56df1fc 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -190,7 +190,7 @@ impl BlockDecoder { &mut workspace.fse, &mut workspace.sequences, )?; - execu...
3
32
12
42155139ac882174307acf238d276f23bec9fd32
Moritz Borcherding
2019-09-14T15:15:38
more bounds checks guided by fuzzer
diff --git a/src/block/literals_section.rs b/src/block/literals_section.rs index 23c319a..f2e0528 100644 --- a/src/block/literals_section.rs +++ b/src/block/literals_section.rs @@ -91,6 +91,12 @@ impl LiteralsSection { let t = br.get_bits(2)? as u8; self.ls_type = Self::section_type(t)?; let ...
4
25
1
a33e5ec460cee7ebb0faae1b075b4e9a6a3bf5f3
Moritz Borcherding
2019-09-14T15:02:13
fixes guided by fuzzer
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 019e647..6800d58 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -132,6 +132,10 @@ impl BlockDecoder { }, }; + if raw.len() < upper_limit_for_literals { + return Err(format!("...
5
36
8
515e9eefdf3a3d808b5cf8013d6b74ace5d9c4a5
Moritz Borcherding
2019-09-14T14:39:49
checksum checking was not implemented anyways and was faulty for multiple chained frames anyways
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 769d238..3adc760 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -49,14 +49,7 @@ impl FrameDecoder { if block_header.last_block { //TODO flush buffer if self.frame.header.descriptor.content_chec...
3
20
8
5d2589205d5bc09321d6698571950f58aa385282
Moritz Borcherding
2019-09-14T10:05:42
added some time measurments to the corous test as a crude first benchmark
diff --git a/src/tests/decode_corpus.rs b/src/tests/decode_corpus.rs index a794c0e..ac2656c 100644 --- a/src/tests/decode_corpus.rs +++ b/src/tests/decode_corpus.rs @@ -10,7 +10,10 @@ fn test_decode_corpus_files() { let mut total_counter = 0; let mut failed: Vec<String> = Vec::new(); + let mut speeds = V...
1
32
4
7c1840482e41d061b6460099a3619b3b2a86b860
Moritz Borcherding
2019-09-14T09:29:15
copying tables by hand can go wrong. 4069 -> 4096
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index 3bf3076..fa5cdc1 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -146,7 +146,7 @@ fn lookup_ll_code(code: u8) -> (u32, u8) { 28 => (512, 9), 29 => (1024, 1...
5
28
12
f0643b79deab43489c767eb13875a6600e0ab28c
Moritz Borcherding
2019-09-14T06:05:08
fixed offset_histroy. Dont code when tired or you might even get swapping values in an array wrong...
diff --git a/src/decoding/sequence_execution.rs b/src/decoding/sequence_execution.rs index d17077b..1de41c3 100644 --- a/src/decoding/sequence_execution.rs +++ b/src/decoding/sequence_execution.rs @@ -13,9 +13,9 @@ pub fn execute_sequences(scratch: &mut DecoderScratch) { scratch.buffer.push(literals); ...
1
3
3
a48a56588cb4b9d8f288b3a720f808c8aef2c05a
Moritz Borcherding
2019-09-13T17:39:40
added test for one specific file for convenience
diff --git a/src/decoding/sequence_execution.rs b/src/decoding/sequence_execution.rs index 451af8a..d17077b 100644 --- a/src/decoding/sequence_execution.rs +++ b/src/decoding/sequence_execution.rs @@ -3,7 +3,9 @@ use super::scratch::DecoderScratch; pub fn execute_sequences(scratch: &mut DecoderScratch) { let mut ...
3
62
4
f4ea86a47b8be60b3b10f39104d03fb91909b8b6
Moritz Borcherding
2019-09-13T17:25:41
make print output optional
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 0799652..3eb2ad3 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -116,10 +116,12 @@ impl BlockDecoder { let mut section = LiteralsSection::new(); let bytes_in_literals_header = section.parse_from_hea...
7
88
45
78df280623101d29650514cedfd7e91a79dc1ad3
Moritz Borcherding
2019-09-13T17:14:08
added verification for the results of decompression. about 50% of /decodecorpus_files decode correctly
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index f730efa..c1f3d5b 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -19,7 +19,7 @@ impl FrameDecoder { } } - pub fn decode_blocks(&mut self, source: &mut Read, target: &mut Write) -> Result<(), String> { + pub fn decode_bl...
3
67
8
49d3c4f786f89a6fa61c309dfa7e5c02a452ee32
Moritz Borcherding
2019-09-13T16:45:01
can now execute all sequences with correct offset-history
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 2d3a2cb..0799652 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -7,7 +7,7 @@ use super::sequence_section::SequencesHeader; use super::sequence_section_decoder::decode_sequences; use crate::decoding::scratch::Decode...
8
163
55
18ffa2709a04e66635985fe7e84e519f78a822db
Moritz Borcherding
2019-09-13T14:55:38
fix compiler warning about unused variable
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index 43e72bf..65b2603 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -55,7 +55,7 @@ pub fn decode_sequences( target.clear(); target.reserve(section.num_sequences as us...
1
1
1
994b67289d32aca5c9eb2ac0d9e4542d109238a6
Moritz Borcherding
2019-09-13T12:48:37
1024 is a valid window size. 1023 ist not.
diff --git a/src/frame.rs b/src/frame.rs index 8ef8d3d..b7a87d4 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -88,7 +88,7 @@ impl FrameHeader { let window_size = window_base + window_add; - if window_size > MIN_WINDOW_SIZE { + if window_size >= MIN_WINDOW_SIZE { ...
1
1
1
85b52bafac13036ce55d3ab03d397eca4c94f4bc
Moritz Borcherding
2019-09-13T12:41:10
fixed casting error. Need to cast to u64 before shifting
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index d12f44a..43e72bf 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -201,8 +201,9 @@ fn maybe_update_fse_tables( match modes.ll_mode() { ModeType::FSECompressed =...
3
24
16
18bd78e49721a1c6c96fde4734d1153be1b4e3c7
Moritz Borcherding
2019-09-13T11:32:11
added suppoert for RLE symbols in sequence decoding
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index f703f46..d12f44a 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -11,14 +11,13 @@ pub fn decode_sequences( scratch: &mut FSEScratch, target: &mut Vec<Sequence>, )...
3
71
38
d7763373da5bb9b79cc85739a71d9a43e7da4647
Moritz Borcherding
2019-09-13T10:54:40
fixed huffman decoding and table reuse
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index fbe2d0a..d5b0ad0 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -67,7 +67,8 @@ fn decompress_literals( let streams: [&[u8]; 4] = [stream1, stream2, stream3, stre...
3
11
5
3be516a40cc648a7631afe3b17f415740b20ec47
Moritz Borcherding
2019-09-13T10:17:07
fixed reusing fse tables. Need to reset symbols_counter not just resize
diff --git a/src/block/literals_section_decoder.rs b/src/block/literals_section_decoder.rs index cefe1ad..fbe2d0a 100644 --- a/src/block/literals_section_decoder.rs +++ b/src/block/literals_section_decoder.rs @@ -94,13 +94,26 @@ fn decompress_literals( } else { //just decode the one stream assert...
3
33
5
bbfe685da797064156cad3e742ddd80bec16f94f
Moritz Borcherding
2019-09-13T08:56:18
added predefined fse distributions
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index e4e7a3d..2d3a2cb 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -155,8 +155,8 @@ impl BlockDecoder { raw_literals, &mut workspace.literals_buffer, )?; + assert!(section.regen...
4
79
48
c8db5af9275967af483eac0c9c341459222bd55c
Moritz Borcherding
2019-09-13T08:34:01
fixed huffman decoding
diff --git a/src/block/literals_section.rs b/src/block/literals_section.rs index 942e04f..4f32181 100644 --- a/src/block/literals_section.rs +++ b/src/block/literals_section.rs @@ -1,3 +1,5 @@ +use super::super::decoding::bit_reader::BitReader; + pub struct LiteralsSection { pub regenerated_size: u32, pub co...
5
147
76
8cf03632c54d732230bdeb73ad743ed1d53a0dd6
Moritz Borcherding
2019-09-11T14:57:40
testing for power of two with % 2 is wrong. Go home brain you are not drunk but very dumb...
diff --git a/src/block/sequence_section.rs b/src/block/sequence_section.rs index d016496..1db4240 100644 --- a/src/block/sequence_section.rs +++ b/src/block/sequence_section.rs @@ -102,9 +102,9 @@ fn test_ll_default() { &Vec::from(&LITERALS_LENGTH_DEFAULT_DISTRIBUTION[..]), ); - //for idx in 0..table...
4
33
23
2af69d80b398bd24d8d17b346cbdb6949b689aef
Moritz Borcherding
2019-09-11T13:19:24
fixed fse table description reading
diff --git a/src/block/block_decoder.rs b/src/block/block_decoder.rs index 6c148c0..e4e7a3d 100644 --- a/src/block/block_decoder.rs +++ b/src/block/block_decoder.rs @@ -159,6 +159,7 @@ impl BlockDecoder { assert!(section.regenerated_size == workspace.literals_buffer.len() as u32); let raw = &raw[upp...
4
44
27
292d35bf39d0bd68f5988407fd34455548936a9d
Moritz Borcherding
2019-09-11T11:16:15
added check for maximal accuracy_log for ml/Ãll/of fse-tables
diff --git a/src/block/sequence_section_decoder.rs b/src/block/sequence_section_decoder.rs index 507d1d4..4b97383 100644 --- a/src/block/sequence_section_decoder.rs +++ b/src/block/sequence_section_decoder.rs @@ -59,15 +59,14 @@ pub fn decode_sequences( let (ml_value, ml_num_bits) = lookup_ml_code(ml_code); ...
3
17
12
28db4c885fcacf1780073abd41fbd4daf3807804
Moritz Borcherding
2019-09-11T10:29:57
fixed compiler warnings
diff --git a/src/block/sequence_section.rs b/src/block/sequence_section.rs index 27a8ea8..d016496 100644 --- a/src/block/sequence_section.rs +++ b/src/block/sequence_section.rs @@ -12,7 +12,7 @@ pub struct Sequence { impl std::fmt::Display for Sequence { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), ...
1
12
9