OLD | NEW |
1 ******************************************************************************* | 1 ******************************************************************************* |
2 ** Background | 2 ** Background |
3 ******************************************************************************* | 3 ******************************************************************************* |
4 | 4 |
5 libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, | 5 libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, |
6 SSE2, etc.) to accelerate baseline JPEG compression and decompression on x86 | 6 SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, |
7 and x86-64 systems. On such systems, libjpeg-turbo is generally 2-4x as fast | 7 x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as |
8 as the unmodified version of libjpeg, all else being equal. | 8 fast as the unmodified version of libjpeg, all else being equal. |
9 | 9 |
10 libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but | 10 libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but |
11 the TigerVNC and VirtualGL projects made numerous enhancements to the codec in | 11 the TigerVNC and VirtualGL projects made numerous enhancements to the codec in |
12 2009, including improved support for Mac OS X, 64-bit support, support for | 12 2009, including improved support for Mac OS X, 64-bit support, support for |
13 32-bit and big endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman | 13 32-bit and big-endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman |
14 encoding/decoding, and various bug fixes. The goal was to produce a fully open | 14 encoding/decoding, and various bug fixes. The goal was to produce a fully |
15 source codec that could replace the partially closed source TurboJPEG/IPP codec | 15 open-source codec that could replace the partially closed-source TurboJPEG/IPP |
16 used by VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range | 16 codec used by VirtualGL and TurboVNC. libjpeg-turbo generally achieves 80-120% |
17 of 80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others. | 17 of the performance of TurboJPEG/IPP. It is faster in some areas but slower in |
| 18 others. |
18 | 19 |
19 In early 2010, libjpeg-turbo spun off into its own independent project, with | 20 In early 2010, libjpeg-turbo spun off into its own independent project, with |
20 the goal of making high-speed JPEG compression/decompression technology | 21 the goal of making high-speed JPEG compression/decompression technology |
21 available to a broader range of users and developers. The libjpeg-turbo shared | 22 available to a broader range of users and developers. |
22 libraries can be used as drop-in replacements for libjpeg on most systems. | |
23 | 23 |
24 | 24 |
25 ******************************************************************************* | 25 ******************************************************************************* |
26 ** License | 26 ** License |
27 ******************************************************************************* | 27 ******************************************************************************* |
28 | 28 |
29 libjpeg-turbo is licensed under a non-restrictive, BSD-style license | 29 Most of libjpeg-turbo inherits the non-restrictive, BSD-style license used by |
30 (see README.) The TurboJPEG/OSS wrapper (both C and Java versions) and | 30 libjpeg (see README.) The TurboJPEG/OSS wrapper (both C and Java versions) and |
31 associated test programs bear a similar license, which is reproduced below: | 31 associated test programs bear a similar license, which is reproduced below: |
32 | 32 |
33 Redistribution and use in source and binary forms, with or without | 33 Redistribution and use in source and binary forms, with or without |
34 modification, are permitted provided that the following conditions are met: | 34 modification, are permitted provided that the following conditions are met: |
35 | 35 |
36 - Redistributions of source code must retain the above copyright notice, | 36 - Redistributions of source code must retain the above copyright notice, |
37 this list of conditions and the following disclaimer. | 37 this list of conditions and the following disclaimer. |
38 - Redistributions in binary form must reproduce the above copyright notice, | 38 - Redistributions in binary form must reproduce the above copyright notice, |
39 this list of conditions and the following disclaimer in the documentation | 39 this list of conditions and the following disclaimer in the documentation |
40 and/or other materials provided with the distribution. | 40 and/or other materials provided with the distribution. |
(...skipping 14 matching lines...) Expand all Loading... |
55 POSSIBILITY OF SUCH DAMAGE. | 55 POSSIBILITY OF SUCH DAMAGE. |
56 | 56 |
57 | 57 |
58 ******************************************************************************* | 58 ******************************************************************************* |
59 ** Using libjpeg-turbo | 59 ** Using libjpeg-turbo |
60 ******************************************************************************* | 60 ******************************************************************************* |
61 | 61 |
62 libjpeg-turbo includes two APIs that can be used to compress and decompress | 62 libjpeg-turbo includes two APIs that can be used to compress and decompress |
63 JPEG images: | 63 JPEG images: |
64 | 64 |
65 TurboJPEG/OSS: This API wraps libjpeg-turbo and provides an easy-to-use | 65 TurboJPEG API: This API provides an easy-to-use interface for compressing |
66 interface for compressing and decompressing JPEG images in memory. It also | 66 and decompressing JPEG images in memory. It also provides some functionality |
67 provides some features that would not be straightforward to implement using | 67 that would not be straightforward to achieve using the underlying libjpeg |
68 the underlying libjpeg API, such as generating planar YUV images and | 68 API, such as generating planar YUV images and performing multiple |
69 performing multiple simultaneous lossless transforms on an image. The Java | 69 simultaneous lossless transforms on an image. The Java interface for |
70 interface for libjpeg-turbo is written on top of TurboJPEG/OSS. | 70 libjpeg-turbo is written on top of the TurboJPEG API. |
71 | 71 |
72 libjpeg API: This is the industry standard API for compressing and | 72 libjpeg API: This is the de facto industry-standard API for compressing and |
73 decompressing JPEG images. It is more difficult to use than TurboJPEG/OSS | 73 decompressing JPEG images. It is more difficult to use than the TurboJPEG |
74 but also more powerful. libjpeg-turbo is both API/ABI-compatible and | 74 API but also more powerful. libjpeg-turbo is both API/ABI-compatible and |
75 mathematically compatible with libjpeg v6b. It can also optionally be | 75 mathematically compatible with libjpeg v6b. It can also optionally be |
76 configured to be API/ABI-compatible with libjpeg v7 and v8 (see below.) | 76 configured to be API/ABI-compatible with libjpeg v7 and v8 (see below.) |
77 | 77 |
78 | 78 |
79 ============================= | 79 ============================= |
80 Replacing libjpeg at Run Time | 80 Replacing libjpeg at Run Time |
81 ============================= | 81 ============================= |
82 | 82 |
83 If a Unix application is dynamically linked with libjpeg, then you can replace | 83 If a Unix application is dynamically linked with libjpeg, then you can replace |
84 libjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH. | 84 libjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH. |
85 For instance: | 85 For instance: |
86 | 86 |
87 [Using libjpeg] | 87 [Using libjpeg] |
88 > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg | 88 > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg |
89 real 0m0.392s | 89 real 0m0.392s |
90 user 0m0.074s | 90 user 0m0.074s |
91 sys 0m0.020s | 91 sys 0m0.020s |
92 | 92 |
93 [Using libjpeg-turbo] | 93 [Using libjpeg-turbo] |
94 > export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH | 94 > export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH |
95 > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg | 95 > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg |
96 real 0m0.109s | 96 real 0m0.109s |
97 user 0m0.029s | 97 user 0m0.029s |
98 sys 0m0.010s | 98 sys 0m0.010s |
99 | 99 |
100 NOTE: {lib} can be lib, lib32, lib64, or lib/64, depending on the O/S and | 100 NOTE: {lib} can be lib, lib32, lib64, or lib/64, depending on the O/S and |
101 architecture. | 101 architecture. |
102 | 102 |
103 System administrators can also replace the libjpeg sym links in /usr/{lib} with | 103 System administrators can also replace the libjpeg sym links in /usr/{lib} with |
104 links to the libjpeg dynamic library located in /opt/libjpeg-turbo/{lib}. This | 104 links to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}. |
105 will effectively accelerate every dynamically linked libjpeg application on the | 105 This will effectively accelerate every application that uses the libjpeg |
106 system. | 106 dynamic library on the system. |
107 | 107 |
108 The libjpeg-turbo SDK for Visual C++ installs the libjpeg-turbo DLL | 108 The libjpeg-turbo SDK for Visual C++ installs the libjpeg-turbo DLL |
109 (jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether libjpeg v6b, v7, or | 109 (jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether it was built with |
110 v8 emulation is enabled) into c:\libjpeg-turbo[64]\bin, and the PATH | 110 libjpeg v6b, v7, or v8 emulation) into c:\libjpeg-turbo[64]\bin, and the PATH |
111 environment variable can be modified such that this directory is searched | 111 environment variable can be modified such that this directory is searched |
112 before any others that might contain a libjpeg DLL. However, if a libjpeg | 112 before any others that might contain a libjpeg DLL. However, if a libjpeg |
113 DLL exists in an application's install directory, then Windows will load this | 113 DLL exists in an application's install directory, then Windows will load this |
114 DLL first whenever the application is launched. Thus, if an application ships | 114 DLL first whenever the application is launched. Thus, if an application ships |
115 with jpeg62.dll, jpeg7.dll, or jpeg8.dll, then back up the application's | 115 with jpeg62.dll, jpeg7.dll, or jpeg8.dll, then back up the application's |
116 version of this DLL and copy c:\libjpeg-turbo[64]\bin\jpeg*.dll into the | 116 version of this DLL and copy c:\libjpeg-turbo[64]\bin\jpeg*.dll into the |
117 application's install directory to accelerate it. | 117 application's install directory to accelerate it. |
118 | 118 |
119 The version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for | 119 The version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for |
120 Visual C++ requires the Visual C++ 2008 C run time DLL (msvcr90.dll). | 120 Visual C++ requires the Visual C++ 2008 C run-time DLL (msvcr90.dll). |
121 msvcr90.dll ships with more recent versions of Windows, but users of older | 121 msvcr90.dll ships with more recent versions of Windows, but users of older |
122 Windows releases can obtain it from the Visual C++ 2008 Redistributable | 122 Windows releases can obtain it from the Visual C++ 2008 Redistributable |
123 Package, which is available as a free download from Microsoft's web site. | 123 Package, which is available as a free download from Microsoft's web site. |
124 | 124 |
125 NOTE: Features of libjpeg that require passing a C run time structure, such | 125 NOTE: Features of libjpeg that require passing a C run-time structure, such |
126 as a file handle, from an application to libjpeg will probably not work with | 126 as a file handle, from an application to libjpeg will probably not work with |
127 the version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for | 127 the version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for |
128 Visual C++, unless the application is also built to use the Visual C++ 2008 C | 128 Visual C++, unless the application is also built to use the Visual C++ 2008 C |
129 run time DLL. In particular, this affects jpeg_stdio_dest() and | 129 run-time DLL. In particular, this affects jpeg_stdio_dest() and |
130 jpeg_stdio_src(). | 130 jpeg_stdio_src(). |
131 | 131 |
132 Mac applications typically embed their own copies of the libjpeg dylib inside | 132 Mac applications typically embed their own copies of the libjpeg dylib inside |
133 the (hidden) application bundle, so it is not possible to globally replace | 133 the (hidden) application bundle, so it is not possible to globally replace |
134 libjpeg on OS X systems. If an application uses a shared library version of | 134 libjpeg on OS X systems. If an application uses a shared library version of |
135 libjpeg, then it may be possible to replace the application's version of it. | 135 libjpeg, then it may be possible to replace the application's version of it. |
136 This would generally involve copying libjpeg.*.dylib from libjpeg-turbo into | 136 This would generally involve copying libjpeg.*.dylib from libjpeg-turbo into |
137 the appropriate place in the application bundle and using install_name_tool to | 137 the appropriate place in the application bundle and using install_name_tool to |
138 repoint the dylib to the new directory. This requires an advanced knowledge of | 138 repoint the dylib to the new directory. This requires an advanced knowledge of |
139 OS X and would not survive an upgrade or a re-install of the application. | 139 OS X and would not survive an upgrade or a re-install of the application. |
140 Thus, it is not recommended for most users. | 140 Thus, it is not recommended for most users. |
141 | 141 |
142 ======================= | 142 ======================= |
143 Replacing TurboJPEG/IPP | 143 Replacing TurboJPEG/IPP |
144 ======================= | 144 ======================= |
145 | 145 |
146 libjpeg-turbo is a drop-in replacement for the TurboJPEG/IPP SDK used by | 146 libjpeg-turbo is a drop-in replacement for the TurboJPEG/IPP SDK used by |
147 VirtualGL 2.1.x and TurboVNC 0.6 (and prior.) libjpeg-turbo contains a wrapper | 147 VirtualGL 2.1.x and TurboVNC 0.6 (and prior.) libjpeg-turbo contains a wrapper |
148 library (TurboJPEG/OSS) that emulates the TurboJPEG API using libjpeg-turbo | 148 library (TurboJPEG/OSS) that emulates the TurboJPEG API using libjpeg-turbo |
149 instead of the closed source Intel Performance Primitives. You can replace the | 149 instead of the closed-source Intel Performance Primitives. You can replace the |
150 TurboJPEG/IPP package on Linux systems with the libjpeg-turbo package in order | 150 TurboJPEG/IPP package on Linux systems with the libjpeg-turbo package in order |
151 to make existing releases of VirtualGL 2.1.x and TurboVNC 0.x use the new codec | 151 to make existing releases of VirtualGL 2.1.x and TurboVNC 0.x use the new codec |
152 at run time. Note that the 64-bit libjpeg-turbo packages contain only 64-bit | 152 at run time. Note that the 64-bit libjpeg-turbo packages contain only 64-bit |
153 binaries, whereas the TurboJPEG/IPP 64-bit packages contained both 64-bit and | 153 binaries, whereas the TurboJPEG/IPP 64-bit packages contained both 64-bit and |
154 32-bit binaries. Thus, to replace a TurboJPEG/IPP 64-bit package, install | 154 32-bit binaries. Thus, to replace a TurboJPEG/IPP 64-bit package, install |
155 both the 64-bit and 32-bit versions of libjpeg-turbo. | 155 both the 64-bit and 32-bit versions of libjpeg-turbo. |
156 | 156 |
157 You can also build the VirtualGL 2.1.x and TurboVNC 0.6 source code with | 157 You can also build the VirtualGL 2.1.x and TurboVNC 0.6 source code with |
158 the libjpeg-turbo SDK instead of TurboJPEG/IPP. It should work identically. | 158 the libjpeg-turbo SDK instead of TurboJPEG/IPP. It should work identically. |
159 libjpeg-turbo also includes static library versions of TurboJPEG/OSS, which | 159 libjpeg-turbo also includes static library versions of TurboJPEG/OSS, which |
160 are used to build TurboVNC 1.0 and later. | 160 are used to build VirtualGL 2.2 and TurboVNC 1.0 and later. |
161 | 161 |
162 ======================================== | 162 ======================================== |
163 Using libjpeg-turbo in Your Own Programs | 163 Using libjpeg-turbo in Your Own Programs |
164 ======================================== | 164 ======================================== |
165 | 165 |
166 For the most part, libjpeg-turbo should work identically to libjpeg, so in | 166 For the most part, libjpeg-turbo should work identically to libjpeg, so in |
167 most cases, an application can be built against libjpeg and then run against | 167 most cases, an application can be built against libjpeg and then run against |
168 libjpeg-turbo. On Unix systems (including Cygwin), you can build against | 168 libjpeg-turbo. On Unix systems (including Cygwin), you can build against |
169 libjpeg-turbo instead of libjpeg by setting | 169 libjpeg-turbo instead of libjpeg by setting |
170 | 170 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 #ifdef JCS_ALPHA_EXTENSIONS | 250 #ifdef JCS_ALPHA_EXTENSIONS |
251 | 251 |
252 jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check | 252 jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check |
253 for the existence of the colorspace extensions at compile time and run time. | 253 for the existence of the colorspace extensions at compile time and run time. |
254 | 254 |
255 ================================= | 255 ================================= |
256 libjpeg v7 and v8 API/ABI support | 256 libjpeg v7 and v8 API/ABI support |
257 ================================= | 257 ================================= |
258 | 258 |
259 libjpeg v7 and v8 added new features to the API/ABI, and, unfortunately, the | 259 With libjpeg v7 and v8, new features were added that necessitated extending the |
260 compression and decompression structures were extended in a backward- | 260 compression and decompression structures. Unfortunately, due to the exposed |
261 incompatible manner to accommodate these features. Thus, programs that are | 261 nature of those structures, extending them also necessitated breaking backward |
| 262 ABI compatibility with previous libjpeg releases. Thus, programs that are |
262 built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is | 263 built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is |
263 based on the libjpeg v6b code base. Although libjpeg v7 and v8 are still not | 264 based on the libjpeg v6b code base. Although libjpeg v7 and v8 are still not |
264 as widely used as v6b, enough programs (including a few Linux distros) have | 265 as widely used as v6b, enough programs (including a few Linux distros) have |
265 made the switch that it was desirable to provide support for the libjpeg v7/v8 | 266 made the switch that it was desirable to provide support for the libjpeg v7/v8 |
266 API/ABI in libjpeg-turbo. | 267 API/ABI in libjpeg-turbo. Although libjpeg-turbo can now be configured as a |
267 | 268 drop-in replacement for libjpeg v7 or v8, it should be noted that not all of |
268 Some of the libjpeg v7 and v8 features -- DCT scaling, to name one -- involve | 269 the features in libjpeg v7 and v8 are supported (see below.) |
269 deep modifications to the code that cannot be accommodated by libjpeg-turbo | |
270 without either breaking compatibility with libjpeg v6b or producing an | |
271 unsupportable mess. In order to fully support libjpeg v8 with all of its | |
272 features, we would have to essentially port the SIMD extensions to the libjpeg | |
273 v8 code base and maintain two separate code trees. We are hesitant to do this | |
274 until/unless the newer libjpeg code bases garner more community support and | |
275 involvement and until/unless we have some notion of whether future libjpeg | |
276 releases will also be backward-incompatible. | |
277 | 270 |
278 By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an | 271 By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an |
279 argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version | 272 argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version |
280 of libjpeg-turbo that emulates the libjpeg v7 or v8 API/ABI, so that programs | 273 of libjpeg-turbo that emulates the libjpeg v7 or v8 API/ABI, so that programs |
281 that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The | 274 that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The |
282 following section describes which libjpeg v7+ features are supported and which | 275 following section describes which libjpeg v7+ features are supported and which |
283 aren't. | 276 aren't. |
284 | 277 |
285 libjpeg v7 and v8 Features: | 278 libjpeg v7 and v8 Features: |
286 --------------------------- | 279 --------------------------- |
287 | 280 |
288 Fully supported: | 281 Fully supported: |
289 | 282 |
290 -- cjpeg: Separate quality settings for luminance and chrominance | 283 -- cjpeg: Separate quality settings for luminance and chrominance |
291 Note that the libpjeg v7+ API was extended to accommodate this feature only | 284 Note that the libpjeg v7+ API was extended to accommodate this feature only |
292 for convenience purposes. It has always been possible to implement this | 285 for convenience purposes. It has always been possible to implement this |
293 feature with libjpeg v6b (see rdswitch.c for an example.) | 286 feature with libjpeg v6b (see rdswitch.c for an example.) |
294 | 287 |
| 288 -- libjpeg: IDCT scaling extensions in decompressor |
| 289 libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8, |
| 290 1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4 |
| 291 and 1/2 are SIMD-accelerated.) |
| 292 |
295 -- cjpeg: 32-bit BMP support | 293 -- cjpeg: 32-bit BMP support |
296 | 294 |
297 -- jpegtran: lossless cropping | 295 -- jpegtran: lossless cropping |
298 | 296 |
299 -- jpegtran: -perfect option | 297 -- jpegtran: -perfect option |
300 | 298 |
301 -- rdjpgcom: -raw option | 299 -- rdjpgcom: -raw option |
302 | 300 |
303 -- rdjpgcom: locale awareness | 301 -- rdjpgcom: locale awareness |
304 | 302 |
305 | 303 |
306 Fully supported when using libjpeg v7/v8 emulation: | 304 Fully supported when using libjpeg v7/v8 emulation: |
307 | 305 |
308 -- libjpeg: In-memory source and destination managers | 306 -- libjpeg: In-memory source and destination managers |
309 | 307 |
310 | 308 |
311 Not supported: | 309 Not supported: |
312 | 310 |
313 -- libjpeg: DCT scaling in compressor | 311 -- libjpeg: DCT scaling in compressor |
314 cinfo.scale_num and cinfo.scale_denom are silently ignored. | 312 cinfo.scale_num and cinfo.scale_denom are silently ignored. |
| 313 There is no technical reason why DCT scaling cannot be supported, but |
| 314 without the SmartScale extension (see below), it would only be able to |
| 315 down-scale using ratios of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and 8/9, |
| 316 which is of limited usefulness. |
315 | 317 |
316 -- libjpeg: IDCT scaling extensions in decompressor | 318 -- libjpeg: SmartScale |
317 libjpeg-turbo still supports IDCT scaling with scaling factors of 1/2, 1/4, | 319 cinfo.block_size is silently ignored. |
318 and 1/8 (same as libjpeg v6b.) | 320 SmartScale is an extension to the JPEG format that allows for DCT block |
| 321 sizes other than 8x8. It would be difficult to support this feature while |
| 322 retaining backward compatibility with libjpeg v6b. |
319 | 323 |
320 -- libjpeg: Fancy downsampling in compressor | 324 -- libjpeg: Fancy downsampling in compressor |
321 cinfo.do_fancy_downsampling is silently ignored. | 325 cinfo.do_fancy_downsampling is silently ignored. |
| 326 This requires the DCT scaling feature, which is not supported. |
322 | 327 |
323 -- jpegtran: Scaling | 328 -- jpegtran: Scaling |
324 Seems to depend on the DCT scaling feature, which isn't supported. | 329 This requires both the DCT scaling and SmartScale features, which are not |
| 330 supported. |
| 331 |
| 332 -- Lossless RGB JPEG files |
| 333 This requires the SmartScale feature, which is not supported. |
325 | 334 |
326 | 335 |
327 ******************************************************************************* | 336 ******************************************************************************* |
328 ** Performance pitfalls | 337 ** Performance pitfalls |
329 ******************************************************************************* | 338 ******************************************************************************* |
330 | 339 |
331 =============== | 340 =============== |
332 Restart Markers | 341 Restart Markers |
333 =============== | 342 =============== |
334 | 343 |
335 The optimized Huffman decoder in libjpeg-turbo does not handle restart markers | 344 The optimized Huffman decoder in libjpeg-turbo does not handle restart markers |
336 in a way that makes libjpeg happy, so it is necessary to use the slow Huffman | 345 in a way that makes the rest of the libjpeg infrastructure happy, so it is |
337 decoder when decompressing a JPEG image that has restart markers. This can | 346 necessary to use the slow Huffman decoder when decompressing a JPEG image that |
338 cause the decompression performance to drop by as much as 20%, but the | 347 has restart markers. This can cause the decompression performance to drop by |
339 performance will still be much much greater than that of libjpeg v6b. Many | 348 as much as 20%, but the performance will still be much greater than that of |
340 consumer packages, such as PhotoShop, use restart markers when generating JPEG | 349 libjpeg. Many consumer packages, such as PhotoShop, use restart markers when |
341 images, so images generated by those programs will experience this issue. | 350 generating JPEG images, so images generated by those programs will experience |
| 351 this issue. |
342 | 352 |
343 =============================================== | 353 =============================================== |
344 Fast Integer Forward DCT at High Quality Levels | 354 Fast Integer Forward DCT at High Quality Levels |
345 =============================================== | 355 =============================================== |
346 | 356 |
347 The algorithm used by the SIMD-accelerated quantization function cannot produce | 357 The algorithm used by the SIMD-accelerated quantization function cannot produce |
348 correct results whenever the fast integer forward DCT is used along with a JPEG | 358 correct results whenever the fast integer forward DCT is used along with a JPEG |
349 quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization | 359 quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization |
350 function in those cases. This causes performance to drop by as much as 40%. | 360 function in those cases. This causes performance to drop by as much as 40%. |
351 It is therefore strongly advised that you use the slow integer forward DCT | 361 It is therefore strongly advised that you use the slow integer forward DCT |
352 whenever encoding images with a JPEG quality of 98 or higher. | 362 whenever encoding images with a JPEG quality of 98 or higher. |
OLD | NEW |