Firefox 157 将在所有平台上默认启用 JPEG XL。
Firefox 157 will include JPEG XL by default on all platforms

原始链接: https://groups.google.com/a/mozilla.org/g/dev-platform/c/3YMV4MS34KA?pli=1

Mozilla 计划从 Firefox 157 版本开始,在所有平台上默认启用 JPEG XL 解码。该解码器使用了基于 Rust 的 `jxl-rs` 库,并已完成广泛的测试、模糊测试和基准测试。 主要亮点包括: * **性能:** `jxl-rs` 最近的更新增加了多线程解码功能,使 Firefox 的解码性能可与 Safari 的 C++ 实现相媲美。 * **功能:** 该实现支持动画、渐进式显示,以及针对 HDR 内容的高质量色调映射。 * **兼容性:** 通过支持动画和渐进式渲染,Firefox 的功能集已超过 Safari。 * **质量保证:** 该项目包含了全面的 Web 平台测试 (WPT) 以及涵盖分块解码、损坏处理和遥测技术的自定义 Gecko 测试。 在此之前,用户可通过 `image.jxl.enabled` 首选项使用此功能,该选项目前在 Nightly 版本中已默认开启。开发进度,包括性能基准测试和完整的测试套件,可通过所引用的 Mozilla Bugzilla 报告进行追踪。

Firefox 157 将支持 JPEG XL 图像格式,该功能由 Google Research 开发的全新高性能 Rust 解码器(`jxl-rs`)驱动。Mozilla 要求必须使用 Rust 实现以确保内存安全,因为他们不希望将现有的 10 万行 C++ 参考库(`libjxl`)集成到浏览器中。 Hacker News 上的讨论重点包括: * **安全与性能:** 尽管有人认为 C++ 可以通过优化达到与 Rust 相当的水平,但社区普遍认同 Rust 的类型系统有助于避免内存损坏,使其成为处理不可信互联网内容的理想选择。目前的 Rust 实现已在性能上与 C++ 版本持平,甚至在某些方面有所超越。 * **采用时间线:** JPEG XL 的复苏主要得益于苹果在 Safari 中的早期采用以及随后被纳入 PDF 标准。这促使 Chromium 和 Firefox 重新评估了此前对该格式的拒绝态度。 * **技术优势:** 除了单纯的压缩外,JPEG XL 还因其能够无损地重新压缩旧版 JPEG、支持高位深 HDR,以及相比 AVIF 或 WebP 更卓越的渐进式加载能力而受到青睐。 此举标志着行业正趋向于在关键的、对安全性敏感的基础设施中采用内存安全语言。
相关文章

原文

As of Firefox 157 I intend to turn JPEG XL decoding on by default on all platforms. It has been developed behind image.jxl.enabled, which today is on by default on Nightly only, and has had a Firefox Labs checkbox on every channel since 152. The decoder is jxl-rs, in Rust.

Bug to turn on by default: https://bugzilla.mozilla.org/show_bug.cgi?id=2065096

Standard: ISO/IEC 18181, https://www.iso.org/standard/85066.html

Standards body: ISO/IEC

Platform coverage: all

Preference: image.jxl.enabled

Standards position: https://github.com/mozilla/standards-positions/issues/522 (neutral)

TAG review: https://github.com/w3ctag/design-reviews/issues/633 (satisfied with concerns)

Intent to prototype: https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/53b4e3e0-5eee-4768-a1ba-b069e1e85244n%40mozilla.org

Other browsers: Safari shipped in 17.0 in 2023. Chrome has it behind #enable-jxl-image-format using the same Rust library, no intent to ship yet.

Changes since the intent to prototype:

Performance was a concern raised on the intent to prototype thread. jxl-rs 0.6.0 was released with multithreaded decoding support, and our patches to hook up and enable multithreaded decoding are expected to land soon. Including those patches, I ran a five-format decode benchmark over the same pictures at a range of sizes: we were slightly ahead of Safari (using C++ libjxl) on my machine. Compared to our other image format decoders, JXL is close on large images, but shows a bigger gap on small ones.

It has feature parity with our other image formats and with Blink's JXL implementation, including animation and progressive display. The one exception is HDR: HDR images display as SDR, the same as every other format we support, but our tone mapping for JXL is much better than what we do for other image formats. Safari has neither progressive rendering nor animation.

The wpt jpegxl directory covers decode correctness across bit depths, alpha, grayscale, CMYK, colour management, orientation and the coding tools, plus the HTML and CSS ways an image gets used. Where wpt could not express something I added gecko tests: about 30 gtests for chunked and incremental decoding, animation frame counts, downscale during decode and corrupt files, mochitests for progressive rendering and telemetry, reftests, and decode benchmarks that report to Perfherder. The fuzzing team already fuzzed jxl before it was enabled on nightly and they will fuzz the decoder again before I flip the pref.

Timothy Nikkel


联系我们 contact @ memedata.com