Skip to content

Commit

Permalink
release: 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Jul 7, 2024
2 parents a571c4a + 6c728ce commit abd18aa
Show file tree
Hide file tree
Showing 26 changed files with 3,158 additions and 1,888 deletions.
14 changes: 7 additions & 7 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Project Dependencies
Package: flaca
Version: 3.1.2
Generated: 2024-06-18 04:53:29 UTC
Version: 3.1.3
Generated: 2024-07-07 07:18:53 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.11 | [Tom Kaitchuck](mailto:[email protected]) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.7.2 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [bitvec](https://github.com/bitvecto-rs/bitvec) | 1.0.1 | | MIT |
| [bytecount](https://github.com/llogiq/bytecount) | 0.6.8 | [Andre Bogus](mailto:[email protected]) and [Joshua Landau](mailto:[email protected]) | Apache-2.0 or MIT |
| [bytemuck](https://github.com/Lokathor/bytemuck) | 1.16.0 | [Lokathor](mailto:[email protected]) | Apache-2.0, MIT, or Zlib |
| [bytemuck](https://github.com/Lokathor/bytemuck) | 1.16.1 | [Lokathor](mailto:[email protected]) | Apache-2.0, MIT, or Zlib |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [crc32fast](https://github.com/srijs/rust-crc32fast) | 1.4.2 | [Sam Rijs](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) | 0.5.13 | | Apache-2.0 or MIT |
Expand All @@ -19,24 +19,24 @@
| [dowser](https://github.com/Blobfolio/dowser) | 0.9.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [equivalent](https://github.com/cuviper/equivalent) | 1.0.1 | | Apache-2.0 or MIT |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.0 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 or MIT |
| flapfli | 3.1.2 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| flapfli | 3.1.3 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [funty](https://github.com/myrrlyn/funty) | 2.0.0 | [myrrlyn](mailto:[email protected]) | MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.13.6 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [hashbrown](https://github.com/rust-lang/hashbrown) | 0.14.5 | [Amanieu d'Antras](mailto:[email protected]) | Apache-2.0 or MIT |
| [indexmap](https://github.com/indexmap-rs/indexmap) | 2.2.6 | | Apache-2.0 or MIT |
| [libc](https://github.com/rust-lang/libc) | 0.2.155 | The Rust Project Developers | Apache-2.0 or MIT |
| [libdeflate-sys](https://github.com/adamkewley/libdeflater) | 1.20.0 | [Adam Kewley](mailto:[email protected]) | Apache-2.0 |
| [libdeflater](https://github.com/adamkewley/libdeflater) | 1.20.0 | [Adam Kewley](mailto:[email protected]) | Apache-2.0 |
| [log](https://github.com/rust-lang/log) | 0.4.21 | The Rust Project Developers | Apache-2.0 or MIT |
| [log](https://github.com/rust-lang/log) | 0.4.22 | The Rust Project Developers | Apache-2.0 or MIT |
| [mozjpeg-sys](https://github.com/kornelski/mozjpeg-sys.git) | 2.2.0 | [Kornel](mailto:[email protected]) | IJG AND Zlib AND BSD-3-Clause |
| [oxipng](https://github.com/shssoichiro/oxipng) | 9.1.1 | [Joshua Holmer](mailto:[email protected]) | MIT |
| [radium](https://github.com/bitvecto-rs/radium) | 0.7.0 | [Nika Layzell](mailto:[email protected]) and [myrrlyn](mailto:[email protected]) | MIT |
| [rgb](https://github.com/kornelski/rust-rgb) | 0.8.37 | [Kornel Lesiński](mailto:[email protected]) | MIT |
| [rgb](https://github.com/kornelski/rust-rgb) | 0.8.40 | [Kornel Lesiński](mailto:[email protected]) | MIT |
| [rustc-hash](https://github.com/rust-lang-nursery/rustc-hash) | 1.1.0 | The Rust Project Developers | Apache-2.0 or MIT |
| [tap](https://github.com/myrrlyn/tap) | 1.0.1 | [Elliott Linder](mailto:[email protected]) and [myrrlyn](mailto:[email protected]) | MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.10.1 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | Apache-2.0 or MIT |
| [terminal_size](https://github.com/eminence/terminal-size) | 0.3.0 | [Andrew Chin](mailto:[email protected]) | Apache-2.0 or MIT |
| [unicode-width](https://github.com/unicode-rs/unicode-width) | 0.1.13 | [kwantam](mailto:[email protected]) and [Manish Goregaokar](mailto:[email protected]) | Apache-2.0 or MIT |
| [write_atomic](https://github.com/Blobfolio/write_atomic) | 0.5.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [wyz](https://github.com/myrrlyn/wyz) | 0.5.1 | [myrrlyn](mailto:[email protected]) | MIT |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.34 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.35 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
2 changes: 1 addition & 1 deletion flaca/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flaca"
version = "3.1.2"
version = "3.1.3"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down
5 changes: 1 addition & 4 deletions flaca/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ use dactyl::{
NiceElapsed,
NiceU64,
traits::{
BytesToSigned,
BytesToUnsigned,
NiceInflection,
},
Expand Down Expand Up @@ -140,9 +139,7 @@ fn _main() -> Result<(), FlacaError> {

// Zopfli iterations.
if let Some(n) = args.option(b"-z") {
let n = i32::btoi(n)
.filter(|n| n.is_positive())
.ok_or(FlacaError::ZopfliIterations)?;
let n = u32::btou(n).ok_or(FlacaError::ZopfliIterations)?;
flapfli::ZOPFLI_ITERATIONS.store(n, Relaxed);
}

Expand Down
7 changes: 1 addition & 6 deletions flapfli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flapfli"
version = "3.1.2"
version = "3.1.3"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand All @@ -17,11 +17,6 @@ exclude = [

[dependencies]
crc32fast = "=1.4.*"
dactyl = "0.7.*"

[dependencies.ahash]
version = "=0.8.*"
default-features = false

[build-dependencies]
bindgen = "0.69.*"
Expand Down
52 changes: 50 additions & 2 deletions flapfli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ const DISTANCE_EXTRA_BITS_MASK: [(u32, u32); 16] = [
(8193, 4095), (16_385, 8191), (32_769, 16_383),
];

/// # Distance Extra Byts (by Symbol).
const DISTANCE_BITS: [u8; 32] = [
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0,
];

/// # Length Symbol Bits (by Litlen).
const LENGTH_SYMBOL_BITS: [u8; 259] = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0,
];

const ZOPFLI_WINDOW_SIZE: u16 = 32_768;


Expand Down Expand Up @@ -80,11 +101,12 @@ fn build_symbols() {
use std::fmt::Write;

let mut out = format!(
"{}{}{}{}{}{}",
NumEnum::new(0..19_u8, "Whackadoodle Deflate Indices.", "DeflateSym")
"{}{}{}{}{}{}{}",
NumEnum::new(0..19_u8, "Extended Deflate Indices.", "DeflateSym")
.with_debug()
.with_eq()
.with_iter(),
NumEnum::new(0..16_u8, "Basic Deflate Indices.", "DeflateSymBasic").with_eq(),
NumEnum::new(0..32_u16, "Distance Symbols.", "Dsym"),
NumEnum::new(0..259_u16, "Lit/Lengths.", "LitLen").with_eq().with_iter(),
NumEnum::new(0..286_u16, "Lit/Length Symbols.", "Lsym"),
Expand Down Expand Up @@ -135,6 +157,26 @@ pub(crate) const DISTANCE_VALUES: &[u16; 32_768] = &[");
}
out.push_str("\n];\n");

/// # Distance and length bits.
///
/// Generate integer and float constants for our bit arrays.
fn bits_and_bobs<const N: usize>(title: &str, name: &str, arr: [u8; N]) -> String {
format!(
"/// # {title}.
pub(crate) const {name}: [u8; {N}] = {arr:?};
/// # {title} (Float).
///
/// This is identical to the `u8` version, but avoids a lot of `f64::from` calls.
pub(crate) const {name}_F: [f64; {N}] = {:?};
",
arr.map(f64::from),
)
}

out.push_str(&bits_and_bobs("Distance Bits (by Symbol)", "DISTANCE_BITS", DISTANCE_BITS));
out.push_str(&bits_and_bobs("Length Bits (by Symbol)", "LENGTH_SYMBOL_BITS", LENGTH_SYMBOL_BITS));

// Save it!
write(&out_path("symbols.rs"), out.as_bytes());
}
Expand Down Expand Up @@ -328,6 +370,7 @@ pub(crate) struct {name}Iter({kind});
impl Iterator for {name}Iter {{
type Item = {name};
fn next(&mut self) -> Option<Self::Item> {{
let old = self.0;
if old < {end} {{
Expand All @@ -337,6 +380,11 @@ impl Iterator for {name}Iter {{
}}
else {{ None }}
}}
fn size_hint(&self) -> (usize, Option<usize>) {{
let len = self.len();
(len, Some(len))
}}
}}
impl ExactSizeIterator for {name}Iter {{
Expand Down
Loading

0 comments on commit abd18aa

Please sign in to comment.