[package]
edition = "2021"
rust-version = "1.92"
name = "zenjpeg"
version = "0.3.0"
authors = ["Lilith River <lilith@imazen.io>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Pure Rust JPEG encoder/decoder with perceptual optimizations"
documentation = "https://docs.rs/zenjpeg"
readme = "README.md"
keywords = [
"jpeg",
"image",
"encoder",
"decoder",
"compression",
]
categories = [
"multimedia::images",
"encoding",
]
license = "AGPL-3.0-or-later"
repository = "https://github.com/imazen/zenjpeg"
[features]
alloc-instrument = ["std"]
archmage-simd = [
"dep:archmage",
"dep:magetypes",
"dep:safe_unaligned_simd",
]
cms = ["cms-lcms2"]
cms-lcms2 = [
"dep:lcms2",
"dep:zune-jpeg",
]
cms-moxcms = [
"dep:moxcms",
"dep:zune-jpeg",
]
corpus-tests = []
debug-tokens = []
decoder = []
default = [
"std",
"yuv",
"archmage-simd",
]
experimental-hybrid-trellis = ["dep:mozjpeg-rs"]
ffi-tests = []
mozjpeg-tables = []
parallel = [
"std",
"dep:rayon",
]
profile = []
sharp-yuv = []
std = []
test-utils = ["std"]
ultrahdr = [
"dep:ultrahdr-core",
"decoder",
"std",
]
wasm-simd = []
wasm-trace = ["dep:web-sys"]
yuv = ["dep:yuv"]
[lib]
name = "zenjpeg"
path = "src/lib.rs"
[[example]]
name = "alloc_analysis"
path = "examples/alloc_analysis.rs"
[[example]]
name = "alloc_tracker"
path = "examples/alloc_tracker.rs"
[[example]]
name = "autovec_transpose"
path = "examples/autovec_transpose.rs"
[[example]]
name = "bench_4k"
path = "examples/bench_4k.rs"
[[example]]
name = "bench_auto_dispatch"
path = "examples/bench_auto_dispatch.rs"
[[example]]
name = "bench_autovec_aq"
path = "examples/bench_autovec_aq.rs"
[[example]]
name = "bench_avx512_dct"
path = "examples/bench_avx512_dct.rs"
[[example]]
name = "bench_encode"
path = "examples/bench_encode.rs"
[[example]]
name = "bench_encode_444"
path = "examples/bench_encode_444.rs"
[[example]]
name = "bench_parallel_entropy"
path = "examples/bench_parallel_entropy.rs"
[[example]]
name = "benchmark_sharp_yuv"
path = "examples/benchmark_sharp_yuv.rs"
[[example]]
name = "build_corpus_tables"
path = "examples/build_corpus_tables.rs"
[[example]]
name = "cjpegli_rs_profile"
path = "examples/cjpegli_rs_profile.rs"
[[example]]
name = "coeff_synthetic_test"
path = "examples/coeff_synthetic_test.rs"
[[example]]
name = "compare_aq_maps"
path = "examples/compare_aq_maps.rs"
[[example]]
name = "compare_dct_coefficients"
path = "examples/compare_dct_coefficients.rs"
[[example]]
name = "compare_xyb_constants"
path = "examples/compare_xyb_constants.rs"
required-features = [
"test-utils",
"ffi-tests",
]
[[example]]
name = "comprehensive_bench"
path = "examples/comprehensive_bench.rs"
[[example]]
name = "cpp_parity_matrix"
path = "examples/cpp_parity_matrix.rs"
required-features = [
"decoder",
"test-utils",
"cms",
]
[[example]]
name = "debug_autovec_aq"
path = "examples/debug_autovec_aq.rs"
[[example]]
name = "debug_ultrahdr_detection"
path = "examples/debug_ultrahdr_detection.rs"
required-features = ["ultrahdr"]
[[example]]
name = "decode_profile"
path = "examples/decode_profile.rs"
[[example]]
name = "edge_mcu_parity"
path = "examples/edge_mcu_parity.rs"
[[example]]
name = "edge_parity_synthetic"
path = "examples/edge_parity_synthetic.rs"
[[example]]
name = "encode_simple"
path = "examples/encode_simple.rs"
[[example]]
name = "encoder_profile"
path = "examples/encoder_profile.rs"
[[example]]
name = "ffi_compare"
path = "examples/ffi_compare.rs"
[[example]]
name = "flamegraph_profile"
path = "examples/flamegraph_profile.rs"
[[example]]
name = "generate_cpp_reference"
path = "examples/generate_cpp_reference.rs"
required-features = ["test-utils"]
[[example]]
name = "heaptrack_encode"
path = "examples/heaptrack_encode.rs"
[[example]]
name = "jpeg_inspect"
path = "examples/jpeg_inspect.rs"
[[example]]
name = "low_q_report"
path = "examples/low_q_report.rs"
required-features = ["test-utils"]
[[example]]
name = "memory_matrix"
path = "examples/memory_matrix.rs"
[[example]]
name = "parallel_bench"
path = "examples/parallel_bench.rs"
[[example]]
name = "parallel_encoder_bench"
path = "examples/parallel_encoder_bench.rs"
[[example]]
name = "profile_2k"
path = "examples/profile_2k.rs"
[[example]]
name = "profile_both"
path = "examples/profile_both.rs"
[[example]]
name = "profile_encode"
path = "examples/profile_encode.rs"
[[example]]
name = "quality_compare"
path = "examples/quality_compare.rs"
[[example]]
name = "quick_parity"
path = "examples/quick_parity.rs"
[[example]]
name = "real_alloc_profile"
path = "examples/real_alloc_profile.rs"
[[example]]
name = "simd_parity_test"
path = "examples/simd_parity_test.rs"
[[example]]
name = "ssim2_comparison"
path = "examples/ssim2_comparison.rs"
[[example]]
name = "stage_profile"
path = "examples/stage_profile.rs"
[[example]]
name = "test_libjpeg_compat"
path = "examples/test_libjpeg_compat.rs"
[[example]]
name = "valgrind_decode"
path = "examples/valgrind_decode.rs"
[[example]]
name = "vec_utilization"
path = "examples/vec_utilization.rs"
[[example]]
name = "wasm_bench"
path = "examples/wasm_bench.rs"
[[example]]
name = "wasm_dct_bench"
path = "examples/wasm_dct_bench.rs"
[[example]]
name = "wasm_magetypes_bench"
path = "examples/wasm_magetypes_bench.rs"
[[example]]
name = "wasm_simd_test"
path = "examples/wasm_simd_test.rs"
[[example]]
name = "wasm_simd_transpose"
path = "examples/wasm_simd_transpose.rs"
[[example]]
name = "xyb_cpp_comparison"
path = "examples/xyb_cpp_comparison.rs"
[[example]]
name = "xyb_dc_debug"
path = "examples/xyb_dc_debug.rs"
[[example]]
name = "xyb_edge_test"
path = "examples/xyb_edge_test.rs"
[[example]]
name = "xyb_parity_test"
path = "examples/xyb_parity_test.rs"
[[example]]
name = "xyb_quality_check"
path = "examples/xyb_quality_check.rs"
[[example]]
name = "xyb_rust_vs_cpp_ssim2"
path = "examples/xyb_rust_vs_cpp_ssim2.rs"
[[example]]
name = "xyb_ulp_parity"
path = "examples/xyb_ulp_parity.rs"
[[example]]
name = "xyb_vs_ycbcr_butteraugli"
path = "examples/xyb_vs_ycbcr_butteraugli.rs"
[[example]]
name = "ycbcr_benchmark"
path = "examples/ycbcr_benchmark.rs"
[[example]]
name = "ycbcr_rust_vs_cpp_ssim2"
path = "examples/ycbcr_rust_vs_cpp_ssim2.rs"
[[example]]
name = "yuv_perf_compare"
path = "examples/yuv_perf_compare.rs"
[[example]]
name = "yuv_quality_test"
path = "examples/yuv_quality_test.rs"
[[test]]
name = "ac_refinement_cpp_comparison"
path = "tests/ac_refinement_cpp_comparison.rs"
[[test]]
name = "ac_refinement_image_types"
path = "tests/ac_refinement_image_types.rs"
[[test]]
name = "ac_refinement_parity"
path = "tests/ac_refinement_parity.rs"
[[test]]
name = "chroma_benchmark"
path = "tests/chroma_benchmark.rs"
[[test]]
name = "codec_corpus_conformance"
path = "tests/codec_corpus_conformance.rs"
[[test]]
name = "codec_coverage"
path = "tests/codec_coverage.rs"
[[test]]
name = "compare_420_cpp"
path = "tests/compare_420_cpp.rs"
[[test]]
name = "compare_sizes"
path = "tests/compare_sizes.rs"
[[test]]
name = "comprehensive_cpp_comparison"
path = "tests/comprehensive_cpp_comparison.rs"
[[test]]
name = "corpus_cpp_comparison"
path = "tests/corpus_cpp_comparison.rs"
[[test]]
name = "coverage_extension"
path = "tests/coverage_extension.rs"
[[test]]
name = "cpp_comparison"
path = "tests/cpp_comparison.rs"
[[test]]
name = "cpp_filesize_comparison"
path = "tests/cpp_filesize_comparison.rs"
[[test]]
name = "cpp_parity_locked"
path = "tests/cpp_parity_locked.rs"
[[test]]
name = "cpp_quality_comparison"
path = "tests/cpp_quality_comparison.rs"
[[test]]
name = "cpp_reference_parity"
path = "tests/cpp_reference_parity.rs"
[[test]]
name = "debug_gray_linear"
path = "tests/debug_gray_linear.rs"
[[test]]
name = "decode_api"
path = "tests/decode_api.rs"
[[test]]
name = "decode_external"
path = "tests/decode_external.rs"
[[test]]
name = "decoder_consistency"
path = "tests/decoder_consistency.rs"
[[test]]
name = "decoder_error_handling"
path = "tests/decoder_error_handling.rs"
[[test]]
name = "decoder_extras"
path = "tests/decoder_extras.rs"
[[test]]
name = "decoder_parity"
path = "tests/decoder_parity.rs"
[[test]]
name = "deringing_quality"
path = "tests/deringing_quality.rs"
[[test]]
name = "determinism"
path = "tests/determinism.rs"
[[test]]
name = "edge_tile_ssim2_comparison"
path = "tests/edge_tile_ssim2_comparison.rs"
[[test]]
name = "encode_api"
path = "tests/encode_api.rs"
[[test]]
name = "encoder_matrix"
path = "tests/encoder_matrix.rs"
[[test]]
name = "error_handling"
path = "tests/error_handling.rs"
[[test]]
name = "fast_math_cpp_comparison"
path = "tests/fast_math_cpp_comparison.rs"
[[test]]
name = "frymire_hash_locked"
path = "tests/frymire_hash_locked.rs"
[[test]]
name = "grayscale_decode_test"
path = "tests/grayscale_decode_test.rs"
[[test]]
name = "high_bit_depth_roundtrip"
path = "tests/high_bit_depth_roundtrip.rs"
[[test]]
name = "linear_pixel_formats"
path = "tests/linear_pixel_formats.rs"
[[test]]
name = "metadata_integration"
path = "tests/metadata_integration.rs"
[[test]]
name = "metrics_comparison"
path = "tests/metrics_comparison.rs"
[[test]]
name = "multi_decoder_compatibility"
path = "tests/multi_decoder_compatibility.rs"
[[test]]
name = "new_api_test"
path = "tests/new_api_test.rs"
[[test]]
name = "parametrized_quality"
path = "tests/parametrized_quality.rs"
[[test]]
name = "parity_enforcement"
path = "tests/parity_enforcement.rs"
[[test]]
name = "parity_reference_locked"
path = "tests/parity_reference_locked.rs"
[[test]]
name = "precision_matrix"
path = "tests/precision_matrix.rs"
[[test]]
name = "progressive_encoding"
path = "tests/progressive_encoding.rs"
[[test]]
name = "progressive_requires_optimization"
path = "tests/progressive_requires_optimization.rs"
[[test]]
name = "progressive_subsampling_bug"
path = "tests/progressive_subsampling_bug.rs"
[[test]]
name = "progressive_xyb_decode"
path = "tests/progressive_xyb_decode.rs"
[[test]]
name = "q100_comparison"
path = "tests/q100_comparison.rs"
[[test]]
name = "quality_matrix"
path = "tests/quality_matrix.rs"
required-features = ["ffi-tests"]
[[test]]
name = "quant_16bit_comparison"
path = "tests/quant_16bit_comparison.rs"
[[test]]
name = "quant_config_effects"
path = "tests/quant_config_effects.rs"
[[test]]
name = "roundtrip_corpus"
path = "tests/roundtrip_corpus.rs"
[[test]]
name = "roundtrip_quality"
path = "tests/roundtrip_quality.rs"
[[test]]
name = "s440_progressive_bug"
path = "tests/s440_progressive_bug.rs"
[[test]]
name = "strip_edge_cpp_comparison"
path = "tests/strip_edge_cpp_comparison.rs"
[[test]]
name = "subsampling_tests"
path = "tests/subsampling_tests.rs"
[[test]]
name = "test_prog_xyb_quality"
path = "tests/test_prog_xyb_quality.rs"
[[test]]
name = "trellis_config_effects"
path = "tests/trellis_config_effects.rs"
[[test]]
name = "ultrahdr_roundtrip"
path = "tests/ultrahdr_roundtrip.rs"
[[test]]
name = "visual_encoding"
path = "tests/visual_encoding.rs"
[[test]]
name = "wasm_decode"
path = "tests/wasm_decode.rs"
[[test]]
name = "wasm_simd"
path = "tests/wasm_simd.rs"
[[test]]
name = "xyb_cpp_comparison"
path = "tests/xyb_cpp_comparison.rs"
[[test]]
name = "xyb_encoding_basic"
path = "tests/xyb_encoding_basic.rs"
[[test]]
name = "xyb_linear_cpp_parity"
path = "tests/xyb_linear_cpp_parity.rs"
[[test]]
name = "ycbcr_locked"
path = "tests/ycbcr_locked.rs"
[[test]]
name = "yuv_crate_comparison"
path = "tests/yuv_crate_comparison.rs"
[[bench]]
name = "aq_simd"
path = "benches/aq_simd.rs"
harness = false
required-features = ["test-utils"]
[[bench]]
name = "bitwriter_bench"
path = "benches/bitwriter_bench.rs"
harness = false
[[bench]]
name = "cpp_comparison"
path = "benches/cpp_comparison.rs"
harness = false
[[bench]]
name = "dct"
path = "benches/dct.rs"
harness = false
[[bench]]
name = "decode"
path = "benches/decode.rs"
harness = false
required-features = ["decoder"]
[[bench]]
name = "decode_compare"
path = "benches/decode_compare.rs"
harness = false
required-features = ["decoder"]
[[bench]]
name = "encode"
path = "benches/encode.rs"
harness = false
[[bench]]
name = "encode_matrix"
path = "benches/encode_matrix.rs"
harness = false
[[bench]]
name = "mage_simd"
path = "benches/mage_simd.rs"
harness = false
required-features = ["archmage-simd"]
[[bench]]
name = "profile_ycbcr"
path = "benches/profile_ycbcr.rs"
harness = false
[[bench]]
name = "quick"
path = "benches/quick.rs"
harness = false
[[bench]]
name = "simd_blocks"
path = "benches/simd_blocks.rs"
harness = false
[[bench]]
name = "simd_load"
path = "benches/simd_load.rs"
harness = false
[[bench]]
name = "vec_variants"
path = "benches/vec_variants.rs"
harness = false
[dependencies.aligned-vec]
version = "0.6"
[dependencies.archmage]
version = "0.3.0"
features = [
"macros",
"bytemuck",
"avx512",
]
optional = true
[dependencies.bytemuck]
version = "1.14"
features = ["derive"]
[dependencies.enough]
version = "0.3"
features = ["std"]
[dependencies.imgref]
version = "1.10"
[dependencies.lcms2]
version = "6.0"
optional = true
[dependencies.linear-srgb]
version = "0.3.1"
[dependencies.magetypes]
version = "0.3.0"
features = ["bytemuck"]
optional = true
[dependencies.moxcms]
version = "0.6"
optional = true
[dependencies.mozjpeg-rs]
version = "0.5.1"
optional = true
[dependencies.multiversed]
version = "0.1"
[dependencies.multiversion]
version = "0.8"
[dependencies.rayon]
version = "1.10"
optional = true
[dependencies.rgb]
version = "0.8"
features = ["as-bytes"]
[dependencies.safe_unaligned_simd]
version = "0.2.3"
optional = true
[dependencies.thiserror]
version = "2.0"
default-features = false
[dependencies.tinyvec]
version = "1.10"
features = ["alloc"]
[dependencies.ultrahdr-core]
version = "0.1.0"
optional = true
[dependencies.web-sys]
version = "0.3"
features = ["console"]
optional = true
[dependencies.whereat]
version = "0.1.3"
[dependencies.wide]
version = "1.1"
[dependencies.yuv]
version = "0.8"
features = ["professional_mode"]
optional = true
[dependencies.zune-jpeg]
version = "0.5"
optional = true
[dev-dependencies.almost-enough]
version = "0.3"
features = ["std"]
[dev-dependencies.fast-ssim2]
version = "0.6"
features = ["imgref"]
[dev-dependencies.serde]
version = "1.0"
features = ["derive"]
[dev-dependencies.serde_json]
version = "1.0"
[dev-dependencies.sha2]
version = "0.10"
[dev-dependencies.smallvec]
version = "1.13"
[dev-dependencies.test-case]
version = "3.3"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.approx]
version = "0.5"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.bincode]
version = "1.3"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.butteraugli]
version = "0.3"
features = ["unsafe-perf"]
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.chrono]
version = "0.4"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.criterion]
version = "0.5"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.dssim]
version = "3.2"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.img-parts]
version = "0.4"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.kamadak-exif]
version = "0.6"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.mozjpeg-rs]
version = "0.5.1"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.png]
version = "0.17"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.proptest]
version = "1.4"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.rayon]
version = "1.10"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.ultrahdr-core]
version = "0.1.0"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.yuv]
version = "0.8"
features = ["professional_mode"]
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.zune-jpeg]
version = "0.5"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.console_error_panic_hook]
version = "0.1.7"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.getrandom]
version = "0.3"
features = ["wasm_js"]
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.wasm-bindgen]
version = "0.2.108"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.wasm-bindgen-test]
version = "0.3.58"
[lints.clippy]
approx_constant = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
doc_markdown = "allow"
doc_overindented_list_items = "allow"
enum_variant_names = "allow"
excessive_precision = "allow"
items_after_statements = "allow"
manual_div_ceil = "allow"
manual_is_multiple_of = "allow"
many_single_char_names = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
must_use_candidate = "allow"
needless_range_loop = "allow"
redundant_closure = "allow"
similar_names = "allow"
too_many_arguments = "allow"
type_complexity = "allow"
uninlined_format_args = "allow"
unnecessary_wraps = "allow"
unreadable_literal = "allow"
unused_self = "allow"
[lints.clippy.all]
level = "warn"
priority = -1
[lints.rust]
unsafe_code = "allow"