本页使用了标题或全文手工转换

Libjpeg

维基百科,自由的百科全书
跳转至: 导航搜索
libjpeg
Logo IJG libjpeg v9
開發者 独立JPEG工作组(Independent JPEG Group)
初始版本 1991年10月7日,​25年前​(1991-10-07
穩定版本 9b(2016年1月17日,​18個月前​(2016-01-17
開發狀態 活跃
编程语言 C
操作系统 跨平台
类型 函式庫
许可协议 自定义类BSD自由软件
網站 ijg.org

libjpeg是一个完全用C语言编写的处理JPEG图像数据格式的自由函式庫。它包含一个JPEG编解码器的算法实现,以及用于处理JPEG数据的多种实用程序。

该套软件采用C语言编写,并分发为附有源代码自由软件,采用自定义的宽松类BSD)自由软件许可证,权利要求为署名英语attribution (copyright)

原始变体[何意?]由独立JPEG工作组(IJG)维护和发布。此外,也有数个提供额外特性的复刻

JPEG JFIF图像在万维网上被广泛使用。它可以调整压缩量级以实现文件大小与视觉质量之间的期望与权衡。[1]

实用程序[编辑]

下列实用程序随libjpeg提供:

  • cjpeg和djpeg:用于JPEG与其他流行的图像文件格式之间的转换。
  • rdjpgcom和wrjpgcom:用于在JPEG文件中插入和提取文字注释。
  • jpegtran:用于在不同JPEG格式之间进行无损转换的工具。

jpegtran[编辑]

jpegtran transforms JPEG data without reencoding
(here with user interface CropGUI)

The command-line program jpegtran provides several features for reformatting and recoding the representation of the DCT coefficients, for transformation of actual image data and for discarding auxiliary data in JPEG files, respectively. The transformations regarding the representation of the coefficients comprise:

These transformations are each completely lossless and reversible. The transformations on the image data comprise:

  • eliminate non-standard application-specific data inserted by some image programs,
  • perform certain transformations on a file, such as:
    • discarding of colour channels (conversion to greyscale),
    • rotating and flipping英语flipped image in steps of 90 degrees,
    • cropping英语cropping at image block borders (every 8×8 or 16×16 pixels),
    • rescaling.[5]

These are 无损数据压缩 and reversible only regarding the image data that is kept. Reencoding with repeated lossy quantisation of the image data (generation loss英语generation loss) does not take place.

有一个相关的Windows应用程序Jpegcrop为“jpegtran”提供了一个用户界面。对于Linux类Unix系统,自由的CropGUI能提供类似功能。 许多程序基于IJG的代码支持JPEG无损转换功能,部分名单见Lossless Applications List(英文)

历史[编辑]

独立JPEG工作组(IJG)的JPEG实现首次公开发布于7 October 1991,并在那是已相当完善。 开发主要由Tom Lane英语Tom Lane (computer scientist)完成。 IJG的开源是其中一个主要的开源包,并且是JPEG标准的成功的关键。许多公司将其整合到各种产品中,如图像编辑器网络浏览器[6]

版本5发布于1994年9月24日,整个代码库被重写。它引入了名为rdjpgcom和wrjpgcom的实用程序用于处理嵌入的文字注释。

版本6于2 August 1995到来,支持渐进JPEG和第一版jpegtran实用程序。

From version 6b of libjpeg of 27 March 1998, Miyasaka Masaru forked a branch named libjpeg/SIMD, which included x86 SIMD optimisations. It got substantial contributions from the TigerVNC and the VirtualGL projects in 2009. On that basis the libjpeg-turbo project was created in 2010.[7]

After 11 years and a change in leadership, the IJG released new versions of libjpeg (7 through 9), of which each broke ABI compatibility with previous versions.[8] The changes that were held in prospect after the 6x series were not delivered.[9] In version 7, support for 算术编码 was introduced, which earlier has been rejected because of the patent situation, as well as the crop feature in jpegtran (-crop).[9]

Versions 8 and 9 served basically for the introduction of controversial[10] incompatible format extensions. These are widely regarded as ineffective and inferior to existing, standardised solutions.[11][12] Their standardisation was rejected after submission to the 國際電信聯盟電信標準化部門. The original organiser Tom Lane and others talk about a break in the goals of the IJG.

On 4 March 2014, the first version of the filesize-optimising fork mozjpeg was published. For this version Josh Aas from Mozilla Research reworked the Perl script jpegcrush from X264's main developer Loren Merritt and integrated it into the code base of libjpeg-turbo.[13]

On 10 July 2014, Mozilla released version 2.0, which mainly added trellis quantisation and is now able to reduce the size of baseline JPEGs also. Facebook, Inc. donated 60,000 dollars for the development of the next version,[14] and CloudFlare assigned a developer for the improvement of mozjpeg.[15]

摘要[编辑]

There are currently two conditions that trigger a major version bump of the JPEG library:

  1. New types of files can be created that are not compatible with prior releases.
  2. Changes in the master records that break the binary compatibility (usually addition of entries for new functions).

In all major upgrades since v6 both conditions came together, while the source compatibility (API) could largely be retained.

主版本 新增文件格式特性 新增主记录项 参考资料
舊版本,不再支持: 6 渐进式JPEG支持 progressive_mode ... ITU-T Recommendation T.81
ISO/IEC IS 10918-1
舊版本,不再支持: 7 算术编码支持 scale_num/scale_denom for
compression (encoding) ...
ITU-T JPEG-Plus Proposal ...[16]
舊版本,不再支持: 8 SmartScale
(可变块大小)
block_size/lim_Se etc. Evolution of JPEG[17]
當前版本: 9 内部颜色转换
(FF F8 LSE扩展标记)
color_transform JPEG 9 Lossless Coding[18]
InfAI JPEG Development Site[19]
图例: 舊版本 舊版本,仍被支持 当前版本 最新预览版本 未来版本

For version 7 both conditions were different subjects (arith_code entry already existed), other versions are same subject.

时间线[编辑]

复刻[编辑]

比较著名的复刻是libjpeg-turbo,它优化了执行的速度;还有mozjpeg,它的优化目标是更小的文件大小。除了这些以外,还有一个出自國際標準化組織(ISO)的libjpeg,其目的是所有JPEG 1标准的完整实现。[20]

libjpeg-turbo[编辑]

libjpeg
Logo libjpeg-turbo
開發者 libjpeg-turbo项目
初始版本 2010年,​前​(2010
穩定版本 1.5.1(2016年9月21日,​10個月前​(2016-09-21
開發狀態 活跃
網站 libjpeg-turbo.org

libjpeg-turbo是libjpeg的一个复刻,它采用单指令流多数据流(SIMD)指令来加速JPEG编码和解码基础效率。许多项目现在使用libjpeg-turbo而不是libjpeg,包括流行的GNU/Linux发行版(FedoraDebianMageiaOpenSUSE等)、MozillaChrome[21][22][23]除了性能方面,部分项目也因它允许向后保留与旧的libjpeg v6b版本的ABI兼容性而选择使用libjpeg-turbo。[24]libjpeg v7、v8和v9已打破与早期版本的ABI兼容性。[8]

libjpeg-turbo可以配置为与libjpeg v7或v8 ABI兼容,但,但它并没有实现IJG近期发布的完整的功能集,包括SmartScale格式的扩展名。[25]libjpeg-turbo项目已选择不支持SmartScale, citing concerns regarding the fact that it is not an 國際電信聯盟電信標準化部門标准和,并引用自己的研究质疑功能的实用性。By extension, since the only major new feature in libjpeg v9 is specific to the SmartScale format, the libjpeg-turbo Project has chosen to forgo emulating libjpeg v9.[11]因此,通过libjpeg v8和之后版本创建的SmartScale文件将不能被libjpeg-turbo正确解压。

mozjpeg[编辑]

libjpeg
mozjpeg
Cjpeg-screenshot.png
mozjpeg尝试若干次对DCT系数频谱的分割
開發者 Mozilla Research
初始版本 2014年3月4日,​3年前​(2014-03-04
穩定版本 3.1(2015年5月18日,​2年前​(2015-05-18
開發狀態 活跃
網站 github.com/mozilla/mozjpeg

mozjpeg是由Josh Aas和其他Mozilla Research人员完成的libjpeg-turbo的一个复刻。它旨在通过减少文件大小(约10%)来加快网页的加载时间,以及在不改变图像质量的前提下提高编码效率。为达到此目的,它在编码(不对称)方面使用更多处理能力,同时保持与JPEG标准的完全兼容性,不需要在解码器侧做任何改变。

它实际通过优化霍夫曼编码树完成,using progressive coding with optimised splitting of the spectrum of DCT coefficients into separate scans and through the use of trellis quantisation英语trellis quantisation. Additionally, the presets are aggressively tuned towards the minimisation of file sizes. 除了libjpeg-turbo,mozjpeg版本也建立在jpegcrush之上,这是Loren Merritt编写的一个Perl脚本。[13][26]

参见[编辑]

参考资料[编辑]

  1. ^ JPEG JFIF
  2. ^ Jpegcrop Preferences and Options description
  3. ^ Filmic Games >> The greatest failure of our patent system was... 互联网档案馆存檔,存档日期2012-09-01.
  4. ^ 680385 - Firefox does not show arithmetic coded jpegs
  5. ^ New jpegtran features
  6. ^ JPEG homepage 互联网档案馆存檔,存档日期2014-11-29.
  7. ^ http://libjpeg-turbo.virtualgl.org/
  8. ^ 8.0 8.1 libjpeg: API changes/compatibility 互联网档案馆存檔,存档日期2014-04-16.. February 9, 2012
  9. ^ 9.0 9.1 Mans Rullgard (Hardwarebug.org), August 4, 2009: IJG is back
  10. ^ Tom Lane, January 16, 2013: jpeg-9, API/ABI compatibility, and the future role of this project
  11. ^ 11.0 11.1 What About libjpeg v9?. libjpeg-turbo team. [February 8, 2013]. 
  12. ^ Mans Rullgard (Hardwarebug.org), February 1, 2010: IJG swings again, and misses
  13. ^ 13.0 13.1 André Kramer (heise.de-Newsticker), January 14, 2013: Mozilla-Encoder verbessert JPEG-Kompression
  14. ^ Sebastian Grüner, 16. Juli 2014: mozjpeg 2.0: Facebook unterstützt JPEG-Encoder von Mozilla
  15. ^ http://www.soeren-hentzschel.at/mozilla/2014/07/30/cloudflare-moechte-zu-mozillas-jpeg-encoder-beitragen/
  16. ^ Contributed document - Word .doc file: ITU-T JPEG-Plus Proposal R3
  17. ^ Contributed document - Word .doc file: Evolution of JPEG
  18. ^ Contributed document - Word .doc file: JPEG 9 Lossless Coding
  19. ^ News c't magazine 2012 issue 18 page 43, Software Links
  20. ^ https://github.com/thorfdbg/libjpeg
  21. ^ Software That Uses or Provides libjpeg-turbo. February 9, 2012.
  22. ^ Issue 48789 – chromium – Use libjpeg-turbo instead of libjpeg. April 14, 2011.
  23. ^ Bug 698519 – Update to libjpeg-turbo 1.2. February 28, 2012
  24. ^ libjpeg for F14. February 9, 2012.
  25. ^ libjpeg-turbo README file 互联网档案馆存檔,存档日期2014-08-12.
  26. ^ Andreas Donath (golem.de), March 6, 2014: Mozilla will JPEGs besser komprimieren

外部链接[编辑]