Replace zlib with zlib-rs

This commit is contained in:
LoveSy
2025-03-08 00:48:06 +08:00
committed by John Wu
parent 675471a49e
commit bd0e954fea
9 changed files with 21 additions and 34 deletions
+1
View File
@@ -32,3 +32,4 @@ der = { workspace = true, features = ["derive", "pem"] }
fdt = { workspace = true }
bytemuck = { workspace = true, features = ["derive", "min_const_generics"] }
num-traits = { workspace = true }
libz-rs-sys = { workspace = true }
+2 -2
View File
@@ -153,7 +153,7 @@ class zopfli_encoder : public chunk_out_stream {
public:
explicit zopfli_encoder(out_strm_ptr &&base) :
chunk_out_stream(std::move(base), ZOPFLI_MASTER_BLOCK_SIZE),
zo{}, out(nullptr), outsize(0), crc(crc32_z(0L, Z_NULL, 0)), in_total(0), bp(0) {
zo{}, out(nullptr), outsize(0), crc(crc32(0L, Z_NULL, 0)), in_total(0), bp(0) {
ZopfliInitOptions(&zo);
// This config is already better than gzip -9
@@ -198,7 +198,7 @@ protected:
auto in = static_cast<const unsigned char *>(buf);
in_total += len;
crc = crc32_z(crc, in, len);
crc = crc32(crc, in, len);
ZopfliDeflatePart(&zo, 2, final, in, 0, len, &bp, &out, &outsize);
+1
View File
@@ -3,6 +3,7 @@
#![feature(iter_intersperse)]
#![feature(try_blocks)]
pub use libz_rs_sys::*;
pub use base;
use cpio::cpio_commands;
use dtb::dtb_commands;