xref: /aosp_15_r20/external/libjpeg-turbo/README.chromium (revision dfc6aa5c1cfd4bc4e2018dc74aa96e29ee49c6da)
1Name: libjpeg-turbo
2URL: https://github.com/libjpeg-turbo/libjpeg-turbo/
3Version: 2.1.5.1
4License: IJG, BSD-3, Zlib
5License File: LICENSE.md
6Security Critical: yes
7Shipped: yes
8License Android Compatible: yes
9
10Description:
11This consists of the components:
12* libjpeg-turbo 2.1.5.1
13* This file (README.chromium)
14* A build file (BUILD.gn)
15* An OWNERS file
16* A codereview.settings file
17* A DIR_METADATA file
18* Patched header files used by Chromium
19* Deleted unused directories: .github, cmakescripts, doc, fuzz, java, release,
20  sharedlib, simd/mips, simd/mips64, simd/powerpc, and win
21* Deleted unused files: appveyor.yml, CMakeLists.txt, cjpeg.1, croptest.in,
22  djpeg.1, doxygen.config, doxygen-extra.css, example.txt, .gitattributes,
23  jpegtran.1, md5/CMakeLists.txt, md5/md5cmp.c, rdjpgcom.1, simd/CMakeLists.txt,
24  strtest.c, tjbenchtest.in, tjbenchtest.java.in, tjexample.c, tjexampletest.in,
25  tjexampletest.java.in and wrjpgcom.1
26* Deleted legacy Arm Neon assembly files (supporting old compiler versions that
27  do not generate performant code from intrinsics):
28  simd/arm/aarch32/jsimd_neon.S, simd/arm/aarch64/jsimd_neon.S.
29
30This libjpeg-turbo can replace our libjpeg-6b without any modifications in the
31Chromium code.
32
33Same as our copy of libjpeg-6b, this libjpeg-turbo also added a new file
34jpeglibmangler.h and included it from jpeglib.h that changes the names of all
35externally visible functions to chromium_* so that we can avoid conflicts that
36arise when system libraries attempt to use our libjpeg. Also, we applied the
37following changes which are not merged to upstream:
38
39* Configuration files jconfig.h, jconfigint.h and neon-compat.h were generated
40  and then altered manually to be compatible on all of Chromium's platforms.
41  http://crbug.com/608347
42* Fix static const data duplication of jpeg_nbits_table. A unique copy
43  was in the jchuff.obj and jcphuff.obj resulting in an added 65k in
44  .rdata in chrome.dll and chrome_child.dll.  Declaring extern const
45  in the header instead of static const and moving the definition to
46  a new .c file fixes this so only one copy is referenced. Also added
47  extern wrappers around usage in asm files. The jpeg_nbits_table.inc
48  file was also deleted. It was also necessary to give this table hidden
49  visibility to avoid invalid relocations (ignored by ld but rejected by
50  lld) arising from attempts to reference the table from assembler on
51  32-bit x86. This only affects shared libraries, but that's important
52  for downstream Android builds.
53* Merged upstream patch https://github.com/libjpeg-turbo/libjpeg-turbo/commit/0fc7313e545a3ff499c19ee6591bb87f0ad8b2a4
54  This patch resolves an O(n^2) slowdown issue when JPEG files contain an
55  enormous number of markers; this would only occur in a maliciouly-crafted
56  image, or through fuzzing.
57* Patches to enable running the upstream unit tests through GTest.
58  The upstream unit tests are defined here under the section 'TESTS':
59  https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/CMakeLists.txt
60  These changes are tracked by Chromium issue: https://crbug.com/993876
61  - Refactor tjunittest.c to provide test interface
62  - Move tjunittest logs from stdout to stderr
63  - Refactor tjbench.c to provide test interface
64  - Move tbench logs from stdout to stderr
65  - Write tjunittest output files to sdcard on Android
66  - Refactor cjpeg.c to provide test interface
67  - Refactor jpegtran.c to provide test interface
68  - Add input JPEG images for djpeg and jpegtran tests
69  - Refactor djpeg.c to provide test interface
70  A new gtest directory contains GTest wrappers (and associated utilities) for
71  each of tjunittest, tjbench, cjpeg, djpeg and jpegtran.
72
73Refer to working-with-nested-repos [1] for details of how to setup your git
74svn client to update the code (for making local changes, cherry picking from
75upstream, etc).
76
77[1] https://www.chromium.org/developers/how-tos/get-the-code/working-with-nested-repos
78