Compare commits
314 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8c47a86eec | ||
|
1d5a2e924b | ||
|
13811a19d6 | ||
|
81998f50d0 | ||
|
9378ba2ae8 | ||
|
7f345f2a1c | ||
|
5a620689c4 | ||
|
4a6a0e13ea | ||
|
a268e8c4f7 | ||
|
b3e0cdedc6 | ||
|
ab4e78b435 | ||
|
daaf3a2eba | ||
|
ec2f36c6b2 | ||
|
508c39a3ae | ||
|
c364f22ac9 | ||
|
e69ebaccf0 | ||
|
73fc1f93e8 | ||
|
1d8bcfbb55 | ||
|
ada43d3d8c | ||
|
472548264f | ||
|
419505ab01 | ||
|
5fa5013ddf | ||
|
1ea0397356 | ||
|
0db58b62ee | ||
|
c5e45d735c | ||
|
4034daa12e | ||
|
069d509718 | ||
|
5333d5d8c5 | ||
|
07b690bcdb | ||
|
c35d186774 | ||
|
d2adbb338c | ||
|
3ae80cfa8e | ||
|
e071eb1302 | ||
|
781b55b24e | ||
|
eeedebf33e | ||
|
29b0669784 | ||
|
19fedbafb5 | ||
|
d55a3eb57e | ||
|
8edba37d54 | ||
|
e3d8eddb3a | ||
|
68af1067ac | ||
|
f464d4f75a | ||
|
5d33ae6d94 | ||
|
f95f872818 | ||
|
e41cb4db84 | ||
|
b427721f58 | ||
|
e23409738e | ||
|
20e5aba3b9 | ||
|
78224fdaa7 | ||
|
cafda99d2c | ||
|
701735f8d7 | ||
|
a4a8ab2c38 | ||
|
f4caf0d0e5 | ||
|
ab5a5764b2 | ||
|
7b2ebe5fa6 | ||
|
5e548d3592 | ||
|
751892a21c | ||
|
a34a352682 | ||
|
0943ad0241 | ||
|
28b015342d | ||
|
fb61cd8df8 | ||
|
0c43162109 | ||
|
a4fa3cce0b | ||
|
c4748f909c | ||
|
e2c0cc9bb3 | ||
|
00326c9dc1 | ||
|
93eb4b4453 | ||
|
eaad8fe730 | ||
|
a778580339 | ||
|
c5d904639d | ||
|
a904254e0b | ||
|
d81e160055 | ||
|
940414aff1 | ||
|
a9922920c6 | ||
|
340c54f834 | ||
|
4d6832d03f | ||
|
06799b58dd | ||
|
531a53c796 | ||
|
435f853ae3 | ||
|
208979ed01 | ||
|
76962609d0 | ||
|
1eb30c274b | ||
|
5b96d64dce | ||
|
36c7513106 | ||
|
36cc28470f | ||
|
a6699dd0df | ||
|
47a842ee0c | ||
|
168438dc31 | ||
|
f411be7a4a | ||
|
8b0e639697 | ||
|
991fb57e78 | ||
|
489c983864 | ||
|
259b7638fc | ||
|
f575ed4b15 | ||
|
4ef7856603 | ||
|
5508942081 | ||
|
d8f1611961 | ||
|
5c370569e5 | ||
|
504cdf2f47 | ||
|
1c4e727c52 | ||
|
92fe1eba0a | ||
|
7624144005 | ||
|
69eade9854 | ||
|
d04c436ab1 | ||
|
6e03d17f2f | ||
|
0692398b0b | ||
|
fa7a839530 | ||
|
0d7248345d | ||
|
7a7996beb5 | ||
|
80c3d4a20a | ||
|
12994284f4 | ||
|
3d697e4a45 | ||
|
329af94573 | ||
|
ee55cd6b0c | ||
|
f919d9a2da | ||
|
5cbebeda54 | ||
|
224f91fb29 | ||
|
f0cf48d81e | ||
|
259021703b | ||
|
c0eb13e0fb | ||
|
7ba34cbcb0 | ||
|
77a02f18cd | ||
|
d721300fe0 | ||
|
46214c96af | ||
|
11740acbca | ||
|
58af0a3db5 | ||
|
caa68b9c53 | ||
|
25e0e6273d | ||
|
512c2cf2fb | ||
|
35ecd0b69d | ||
|
a2b1ab0e6e | ||
|
df65a30d5c | ||
|
5b2f753884 | ||
|
b7f2057ab1 | ||
|
a3b2230780 | ||
|
00b6af34a4 | ||
|
d4e2c39dae | ||
|
a0adcb7bd9 | ||
|
3fe33f5143 | ||
|
1184b79381 | ||
|
d6bda220f7 | ||
|
9115c84103 | ||
|
4bb4512649 | ||
|
122a9512fc | ||
|
43f2244581 | ||
|
90c85b880e | ||
|
96e08d2de6 | ||
|
58ac181a8d | ||
|
3a29996548 | ||
|
823ed71e22 | ||
|
1e42f022cc | ||
|
f7f5919558 | ||
|
710777d5d3 | ||
|
66cc65b92b | ||
|
e54112b467 | ||
|
b11508aa54 | ||
|
c74799fa59 | ||
|
c86c028efd | ||
|
22b82fbb96 | ||
|
47fed5b007 | ||
|
33c98d8fff | ||
|
26dc7f012a | ||
|
e1e032d083 | ||
|
3315a400fc | ||
|
232bd0a05f | ||
|
c6aec7eda3 | ||
|
d9b7b0f159 | ||
|
36c55eb7eb | ||
|
8e3b83ad55 | ||
|
2fbcca719e | ||
|
5a1f9cf8c3 | ||
|
4220aa7870 | ||
|
ad5186479a | ||
|
ad74e4597d | ||
|
7d95572211 | ||
|
36a8bdbc84 | ||
|
5ddec6ba08 | ||
|
c81a339866 | ||
|
7d7afe1d2b | ||
|
6bd2457765 | ||
|
edf5c7a346 | ||
|
2161414cdf | ||
|
67f54c1ebe | ||
|
07e8390b45 | ||
|
be28eb44a8 | ||
|
7ea9f0d3bb | ||
|
afb3289548 | ||
|
08d6cb7673 | ||
|
ca0dedf9ea | ||
|
7593cbc474 | ||
|
c92ca4a41f | ||
|
6a60192ac0 | ||
|
2f030c2cf3 | ||
|
6cfb6519b3 | ||
|
017a18f58d | ||
|
f1cff873c9 | ||
|
f432c08882 | ||
|
ce2d68ebe1 | ||
|
02f8657ca2 | ||
|
2c6524167e | ||
|
85908c9c27 | ||
|
e9ae7cf31f | ||
|
cf92591348 | ||
|
283d9b01dc | ||
|
d2c5aa90e5 | ||
|
70600c8c7d | ||
|
19aa8de06c | ||
|
66b3562651 | ||
|
423ddcb232 | ||
|
aa5911d34d | ||
|
8c8f4c8c48 | ||
|
157be588f7 | ||
|
34369b5e90 | ||
|
b150901525 | ||
|
c2827e617c | ||
|
27493cc4f2 | ||
|
0912459c9d | ||
|
66e06b2963 | ||
|
abeee81577 | ||
|
3ba1122a02 | ||
|
4b71f1c590 | ||
|
52c0c4efcc | ||
|
0cf046cc7c | ||
|
67a9c600ad | ||
|
44879f8cde | ||
|
8a3fde00bf | ||
|
322ffe643c | ||
|
1bf5d3af1a | ||
|
3f31b643b1 | ||
|
eb192256e7 | ||
|
4c8f2e881e | ||
|
e2f35fa684 | ||
|
9d43d55b21 | ||
|
303e9168eb | ||
|
5e32c51b7a | ||
|
182868f4d0 | ||
|
b84e1f0526 | ||
|
a649475339 | ||
|
567837a742 | ||
|
07c33ab76f | ||
|
bdccc51bc1 | ||
|
044ac31b24 | ||
|
3f23d27dd5 | ||
|
cb5f69882e | ||
|
3271df912b | ||
|
1253069f65 | ||
|
5839535c9f | ||
|
440a6ac65f | ||
|
ed54545d0d | ||
|
96df877ebc | ||
|
9c80104cfd | ||
|
3dd88d367f | ||
|
9eac4b1faf | ||
|
0b4bfe1757 | ||
|
25e20ae39e | ||
|
2a0186420c | ||
|
28b138cbc2 | ||
|
277b8dde1a | ||
|
7110eb7ca1 | ||
|
d96bbd999f | ||
|
b8e404f6d0 | ||
|
13bbb1d9b9 | ||
|
6cddd0e8cf | ||
|
1e5566c2e9 | ||
|
13c19db171 | ||
|
1e6a680f83 | ||
|
89bd5a7e73 | ||
|
a5a37a7529 | ||
|
5705133066 | ||
|
d1b009cbbb | ||
|
2812f0861c | ||
|
52b739776d | ||
|
f0b93f7a4b | ||
|
fa2323e37b | ||
|
1930af194c | ||
|
f73cd386c3 | ||
|
515e9a1427 | ||
|
40b33adb7a | ||
|
15f29c3a24 | ||
|
7bbbfc38ce | ||
|
c6d07c5418 | ||
|
a4a5b4288e | ||
|
8476ac456e | ||
|
cb90cdbd65 | ||
|
e1e4b1b780 | ||
|
197dfcd36f | ||
|
45237fa54c | ||
|
f470cc2da9 | ||
|
31f07f3114 | ||
|
28798478ba | ||
|
1fd2124de7 | ||
|
f2e9505aa1 | ||
|
41e59afc41 | ||
|
d1646b37b1 | ||
|
4a9292f169 | ||
|
2465184351 | ||
|
f7d44cc6da | ||
|
ee932d3ed5 | ||
|
1304b6705e | ||
|
52889ded67 | ||
|
d570f19652 | ||
|
e8b3593ecb | ||
|
cc1dc42c1f | ||
|
19ab8bf7e7 | ||
|
1e310b5a45 | ||
|
9a322dfdea | ||
|
b207332b93 | ||
|
3a71e387d9 | ||
|
4ddc50c0cd | ||
|
6bffb8e3e1 | ||
|
52ad1de1f6 | ||
|
c7b3c5a082 | ||
|
afec5935ea | ||
|
3a50e51b01 |
@ -4,4 +4,4 @@ CONFIG += warning_clean
|
||||
QT_SOURCE_TREE = $$PWD
|
||||
QT_BUILD_TREE = $$shadowed($$PWD)
|
||||
|
||||
MODULE_VERSION = 5.12.5
|
||||
MODULE_VERSION = 5.12.12
|
||||
|
1331
LICENSE.QT-LICENSE-AGREEMENT
Normal file
1331
LICENSE.QT-LICENSE-AGREEMENT
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,913 +0,0 @@
|
||||
QT LICENSE AGREEMENT
|
||||
Agreement version 4.0
|
||||
|
||||
This License Agreement ("Agreement") is a legal agreement between The Qt
|
||||
Company (as defined below) and the Licensee (as defined below) for the license
|
||||
of Licensed Software (as defined below). Capitalized terms used herein are
|
||||
defined in Section 1.
|
||||
|
||||
WHEREAS:
|
||||
|
||||
(A). Licensee wishes to use the Licensed Software for the purpose of developing
|
||||
and distributing Applications and/or Devices; and
|
||||
|
||||
(B). The Qt Company is willing to grant the Licensee a right to use Licensed
|
||||
Software for such purpose pursuant to term and conditions of this Agreement.
|
||||
|
||||
NOW, THEREFORE, THE PARTIES HEREBY AGREE AS FOLLOWS:
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Affiliate" of a Party shall mean an entity (i) which is directly or indirectly
|
||||
controlling such Party; (ii) which is under the same direct or indirect
|
||||
ownership or control as such Party; or (iii) which is directly or indirectly
|
||||
owned or controlled by such Party. For these purposes, an entity shall be
|
||||
treated as being controlled by another if that other entity has fifty percent
|
||||
(50 %) or more of the votes in such entity, is able to direct its affairs
|
||||
and/or to control the composition of its board of directors or equivalent body.
|
||||
|
||||
"Applications" shall mean Licensee's software products created using the
|
||||
Licensed Software, which may include the Redistributables, or part
|
||||
thereof.
|
||||
|
||||
"Contractor(s)" shall mean third party consultants, distributors and
|
||||
contractors performing services to a Party under applicable contractual
|
||||
arrangement.
|
||||
|
||||
"Customer(s)" shall mean Licensee's end users to whom Licensee, directly or
|
||||
indirectly, distributes copies of the Redistributables.
|
||||
|
||||
"Deployment Platforms" shall mean operating systems specified in the License
|
||||
Certificate, in which the Redistributables can be distributed pursuant to the
|
||||
terms and conditions of this Agreement.
|
||||
|
||||
"Designated User(s)" shall mean the employee(s) of Licensee or Licensee's
|
||||
Affiliates acting within the scope of their employment or Licensee's
|
||||
Contractors acting within the scope of their services for Licensee and on
|
||||
behalf of Licensee. Designated Users shall be named in the License Certificate.
|
||||
|
||||
"Development License" shall mean the license needed by the Licensee for each
|
||||
Designated User to use the Licensed Software under the license grant described
|
||||
in Section 3.1 of this Agreement.
|
||||
|
||||
"Development Platforms" shall mean those operating systems specified in the
|
||||
License Certificate, in which the Licensed Software can be used under the
|
||||
Development License, but not distributed in any form or used for any other
|
||||
purpose.
|
||||
|
||||
"Devices" shall mean hardware devices or products that 1) are manufactured
|
||||
and/or distributed by the Licensee or its Affiliates or Contractors, and
|
||||
(2)(i) incorporate or integrate the Redistributables or parts thereof; or (ii)
|
||||
do not incorporate or integrate the Redistributables at the time of
|
||||
distribution, but where, when used by a Customer, the main user interface or
|
||||
substantial functionality of such device is provided by Application(s) or
|
||||
otherwise depends on the Licensed Software.
|
||||
|
||||
"Distribution License(s)" shall mean the license required for distribution of
|
||||
Redistributables in connection with Devices pursuant to license grant described
|
||||
in Section 3.3 of this Agreement.
|
||||
|
||||
"Distribution License Packs" shall mean set of prepaid Distribution Licenses
|
||||
for distribution of Redistributables, as defined in The Qt Company's standard
|
||||
price list, quote, Purchase Order confirmation or in an appendix hereto,
|
||||
as the case may be.
|
||||
|
||||
"Intellectual Property Rights" shall mean patents (including utility models),
|
||||
design patents, and designs (whether or not capable of registration), chip
|
||||
topography rights and other like protection, copyrights, trademarks, service
|
||||
marks, trade names, logos or other words or symbols and any other form of
|
||||
statutory protection of any kind and applications for any of the foregoing as
|
||||
well as any trade secrets.
|
||||
|
||||
"License Certificate" shall mean a certificate generated by The Qt Company for
|
||||
each Designated User respectively upon them downloading the licensed Software.
|
||||
License Certificate will be available under respective Designated User's Qt
|
||||
Account at account.qt.io and it will specify the Designated User, the
|
||||
Development Platforms, Deployment Platforms and the License Term. The terms of
|
||||
the License Certificate are considered part of this Agreement and shall be
|
||||
updated from time to time to reflect any agreed changes to the foregoing terms
|
||||
relating to Designated User's rights to the Licensed Software.
|
||||
|
||||
"License Fee" shall mean the fee charged to the Licensee for rights granted
|
||||
under the terms of this Agreement.
|
||||
|
||||
"License Term" shall mean the agreed validity period of the Development
|
||||
License of the respective Designated User, during which time the
|
||||
Designated User is entitled to use the Licensed Software, as set forth in the
|
||||
respective License Certificate.
|
||||
|
||||
"Licensed Software" shall mean all versions of the
|
||||
|
||||
(i) Qt Toolkit (including Qt Essentials, Qt Add-Ons and Value-Add modules) as
|
||||
described in http://doc.qt.io/qt-5/qtmodules.html,
|
||||
|
||||
(ii) Qt Creator (including Creator IDE tool) as described in
|
||||
http://doc.qt.io/qtcreator/index.html,
|
||||
|
||||
(iii) Qt 3D Studio as described in http://doc.qt.io/qt3dstudio/index.html, and
|
||||
|
||||
as well as corresponding online or electronic documentation, associated media
|
||||
and printed materials, including the source code, example programs and the
|
||||
documentation, licensed to the Licensee under this Agreement. Licensed Software
|
||||
does not include Third Party Software (as defined in Section 4), Open Source
|
||||
Qt, or other software products of The Qt Company (for example Qt Safe Renderer
|
||||
and Qt for Automation), unless such other software products of The Qt Company
|
||||
are separately agreed in writing to be included in scope of the Licensed
|
||||
Software.
|
||||
|
||||
"Licensee" shall mean the individual or legal entity that is party to this
|
||||
Agreement, as identified on the signature page hereof.
|
||||
|
||||
"Licensee's Records" shall mean books and records that are likely to contain
|
||||
information bearing on Licensee's compliance with this Agreement or the
|
||||
payments due to The Qt Company under this Agreement, including, but not limited
|
||||
to: assembly logs, sales records and distribution records.
|
||||
|
||||
"Modified Software" shall have the meaning as set forth in Section 2.3.
|
||||
|
||||
"Online Services" shall mean any services or access to systems made available
|
||||
by The Qt Company to the Licensee over the Internet relating to the Licensed
|
||||
Software or for the purpose of use by the Licensee of the Licensed Software or
|
||||
Support. Use of any such Online Services is discretionary for the Licensee and
|
||||
some of them may be subject to additional fees.
|
||||
|
||||
"Open Source Qt" shall mean the non-commercial Qt computer software products,
|
||||
licensed under the terms of the GNU Lesser General Public License, version
|
||||
2.1 or later ("LGPL") or the GNU General Public License, version 2.0 or later
|
||||
("GPL"). For clarity, Open Source Qt shall not be provided nor governed under
|
||||
this Agreement.
|
||||
|
||||
"Party" or "Parties" shall mean Licensee and/or The Qt Company.
|
||||
|
||||
"Redistributables" shall mean the portions of the Licensed Software set forth
|
||||
in Appendix 1, Section 1 that may be distributed pursuant to the terms of this
|
||||
Agreement in object code form only, including any relevant documentation.
|
||||
Where relevant, any reference to Licensed Software in this Agreement shall
|
||||
include and refer also to Redistributables.
|
||||
|
||||
"Renewal Term" shall mean an extension of previous License Term as agreed
|
||||
between the Parties.
|
||||
|
||||
"Submitted Modified Software" shall have the meaning as set forth in
|
||||
Section 2.3.
|
||||
|
||||
"Support" shall mean standard developer support that is provided by The Qt
|
||||
Company to assist Designated Users in using the Licensed Software in
|
||||
accordance with The Qt Company's standard support terms and as further
|
||||
defined in Section 8 hereunder.
|
||||
|
||||
"Taxes" shall have the meaning set forth in Section 10.5.
|
||||
|
||||
"Term" shall have the meaning set forth in Section 12.
|
||||
|
||||
"The Qt Company" shall mean:
|
||||
|
||||
(i) in the event Licensee is an individual residing in the United States or a
|
||||
legal entity incorporated in the United States or having its headquarters in
|
||||
the United States, The Qt Company Inc., a Delaware corporation with its office
|
||||
at 2350 Mission College Blvd., Suite 1020, Santa Clara, CA 95054, USA.; or
|
||||
|
||||
(ii) in the event the Licensee is an individual residing outside of the United
|
||||
States or a legal entity incorporated outside of the United States or having
|
||||
its registered office outside of the United States, The Qt Company Ltd., a
|
||||
Finnish company with its registered office at Bertel Jungin aukio D3A, 02600
|
||||
Espoo, Finland.
|
||||
|
||||
"Third Party Software " shall have the meaning set forth in Section 4.
|
||||
|
||||
"Updates" shall mean a release or version of the Licensed Software containing
|
||||
bug fixes, error corrections and other changes that are generally made
|
||||
available to users of the Licensed Software that have contracted for Support.
|
||||
Updates are generally depicted as a change to the digits following the decimal
|
||||
in the Licensed Software version number. The Qt Company shall make Updates
|
||||
available to the Licensee under the Support. Updates shall be considered as
|
||||
part of the Licensed Software hereunder.
|
||||
|
||||
"Upgrades" shall mean a release or version of the Licensed Software containing
|
||||
enhancements and new features and are generally depicted as a change to the
|
||||
first digit of the Licensed Software version number. In the event Upgrades are
|
||||
provided to the Licensee under this Agreement, they shall be considered as
|
||||
part of the Licensed Software hereunder.
|
||||
|
||||
2. OWNERSHIP
|
||||
|
||||
2.1 Ownership of The Qt Company
|
||||
|
||||
The Licensed Software is protected by copyright laws and international
|
||||
copyright treaties, as well as other intellectual property laws and treaties.
|
||||
The Licensed Software is licensed, not sold.
|
||||
|
||||
All The Qt Company's Intellectual Property Rights are and shall remain the
|
||||
exclusive property of The Qt Company or its licensors respectively.
|
||||
|
||||
2.2 Ownership of Licensee
|
||||
|
||||
All the Licensee's Intellectual Property Rights are and shall remain the
|
||||
exclusive property of the Licensee or its licensors respectively.
|
||||
|
||||
All Intellectual Property Rights to the Modified Software, Applications and
|
||||
Devices shall remain with the Licensee and no rights thereto shall be granted
|
||||
by the Licensee to The Qt Company under this Agreement (except as set forth in
|
||||
Section 2.3 below).
|
||||
|
||||
2.3 Modified Software
|
||||
|
||||
Licensee may create bug-fixes, error corrections, patches or modifications to
|
||||
the Licensed Software ("Modified Software"). Such Modified Software may break
|
||||
the source or binary compatibility with the Licensed Software (including
|
||||
without limitation through changing the application programming interfaces
|
||||
("API") or by adding, changing or deleting any variable, method, or class
|
||||
signature in the Licensed Software and/or any inter-process protocols, services
|
||||
or standards in the Licensed Software libraries). To the extent that Licensee's
|
||||
Modified Software so breaks source or binary compatibility with the Licensed
|
||||
Software, Licensee acknowledges that The Qt Company's ability to provide
|
||||
Support may be prevented or limited and Licensee's ability to make use of
|
||||
Updates may be restricted.
|
||||
|
||||
Licensee may, at its sole and absolute discretion, choose to submit Modified
|
||||
Software to The Qt Company ("Submitted Modified Software") in connection with
|
||||
Licensee's Support request, service request or otherwise. In the event Licensee
|
||||
does so, then, Licensee hereby grants The Qt Company a sublicensable,
|
||||
assignable, irrevocable, perpetual, worldwide, non-exclusive, royalty-free and
|
||||
fully paid-up license, under all of Licensee's Intellectual Property Rights, to
|
||||
reproduce, adapt, translate, modify, and prepare derivative works of, publicly
|
||||
display, publicly perform, sublicense, make available and distribute such
|
||||
Submitted Modified Software as The Qt Company sees fit at its free and absolute
|
||||
discretion.
|
||||
|
||||
3. LICENSES GRANTED
|
||||
|
||||
3.1 Development with Licensed Software
|
||||
|
||||
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
|
||||
personal, worldwide, non-exclusive, non-transferable license, valid for the
|
||||
License Term, to use, modify and copy the Licensed Software by Designated Users
|
||||
on the Development Platforms for the sole purposes of designing, developing,
|
||||
demonstrating and testing Application(s) and/or Devices, and to provide thereto
|
||||
related support and other related services to end-user Customers.
|
||||
|
||||
Licensee may install copies of the Licensed Software on an unlimited number of
|
||||
computers provided that (i) only the Designated Users may use the Licensed
|
||||
Software, and (ii) all Designated Users must have a valid Development License
|
||||
to use Licensed Software.
|
||||
|
||||
Licensee may at any time designate another Designated User to replace a then-
|
||||
current Designated User by notifying The Qt Company in writing, provided that
|
||||
any Designated User may be replaced only once during any six-month period.
|
||||
|
||||
Upon expiry of the initially agreed License Term, the respective License Terms
|
||||
shall be automatically extended to one or more Renewal Term(s), unless and
|
||||
until either Party notifies the other Party in writing that it does not wish to
|
||||
continue the License Term, such notification to be provided to the other Party
|
||||
no less than ninety (90) days before expiry of the respective License Term.
|
||||
Unless otherwise agreed between the Parties, Renewal Term shall be of equal
|
||||
length with the initial Term.
|
||||
|
||||
Any such Renewal Term shall be subject to License Fees agreed between the
|
||||
Parties or, if no advance agreement exists, subject to The Qt Company's
|
||||
standard pricing applicable at the commencement date of any such Renewal Term.
|
||||
|
||||
3.2 Distribution of Applications
|
||||
|
||||
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
|
||||
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
|
||||
pursuant to this Agreement) right and license, valid for the Term, to
|
||||
|
||||
(i) distribute, by itself or through its Contractors, Redistributables as
|
||||
installed, incorporated or integrated into Applications for execution on the
|
||||
Deployment Platforms, and
|
||||
|
||||
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
|
||||
Customers solely for Customer's internal use and to the extent necessary in
|
||||
order for the Customers to use the Applications for their respective intended
|
||||
purposes.
|
||||
|
||||
Right to distribute the Redistributables as part of an Application as provided
|
||||
herein is not royalty-bearing but is conditional upon the Licensee having paid
|
||||
the agreed Development Licenses from The Qt Company before distributing any
|
||||
Redistributables to Customers.
|
||||
|
||||
3.3 Distribution of Devices
|
||||
|
||||
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
|
||||
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
|
||||
pursuant to this Agreement) right and license, valid for the Term, to
|
||||
|
||||
(i) distribute, by itself or through one or more tiers of Contractors,
|
||||
Redistributables as installed, incorporated or integrated, or intended to be
|
||||
installed, incorporated or integrated into Devices for execution on the
|
||||
Deployment Platforms, and
|
||||
|
||||
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
|
||||
Customers solely for Customer's internal use and to the extent necessary in
|
||||
order for the Customers to use the Devices for their respective intended
|
||||
purposes.
|
||||
|
||||
Right to distribute the Redistributables with Devices as provided herein is
|
||||
conditional upon the Licensee having purchased and paid the appropriate amount
|
||||
of Development and Distribution Licenses from The Qt Company before
|
||||
distributing any Redistributables to Customers.
|
||||
|
||||
3.4 Further Requirements
|
||||
|
||||
The licenses granted above in this Section 3 by The Qt Company to Licensee are
|
||||
conditional and subject to Licensee's compliance with the following terms:
|
||||
|
||||
(i) Licensee shall not remove or alter any copyright, trademark or other
|
||||
proprietary rights notice contained in any portion of the Licensed Software;
|
||||
|
||||
(ii) Applications must add primary and substantial functionality to the
|
||||
Licensed Software;
|
||||
|
||||
(iii) Applications may not pass on functionality which in any way makes it
|
||||
possible for others to create software with the Licensed Software; provided
|
||||
however that Licensee may use the Licensed Software's scripting and QML ("Qt
|
||||
Quick") functionality solely in order to enable scripting, themes and styles
|
||||
that augment the functionality and appearance of the Application(s) without
|
||||
adding primary and substantial functionality to the Application(s);
|
||||
|
||||
(iv) Applications must not compete with the Licensed Software;
|
||||
|
||||
(v) Licensee shall not use The Qt Company's or any of its suppliers' names,
|
||||
logos, or trademarks to market Applications, except that Licensee may use
|
||||
"Built with Qt" logo to indicate that Application(s) was developed using the
|
||||
Licensed Software;
|
||||
|
||||
(vi) Licensee shall not distribute, sublicense or disclose source code of
|
||||
Licensed Software to any third party (provided however that Licensee may
|
||||
appoint employee(s) of Contractors as Designated Users to use Licensed
|
||||
Software pursuant to this Agreement). Such right may be available for the
|
||||
Licensee subject to a separate software development kit ("SDK") license
|
||||
agreement to be concluded with The Qt Company;
|
||||
|
||||
(vii) Licensee shall not grant the Customers a right to (i) make copies of the
|
||||
Redistributables except when and to the extent required to use the Applications
|
||||
and/or Devices for their intended purpose, (ii) modify the Redistributables or
|
||||
create derivative works thereof, (iii) decompile, disassemble or otherwise
|
||||
reverse engineer Redistributables, or (iv) redistribute any copy or portion of
|
||||
the Redistributables to any third party, except as part of the onward sale of
|
||||
the Device on which the Redistributables are installed;
|
||||
|
||||
(viii) Licensee shall not and shall cause that its Affiliates or Contractors
|
||||
shall not a) in any way combine, incorporate or integrate Licensed Software
|
||||
with, or use Licensed Software for creation of, any software created with or
|
||||
incorporating Open Source Qt, or b) incorporate or integrate Applications
|
||||
into a hardware device or product other than a Device, unless Licensee has
|
||||
received an advance written permission from The Qt Company to do so. Absent
|
||||
such written permission, any and all distribution by the Licensee during the
|
||||
Term of a hardware device or product a) which incorporate or integrate any
|
||||
part of Licensed Software or Open Source Qt; or b) where the main user
|
||||
interface or substantial functionality is provided by software build with
|
||||
Licensed Software or Open Source Qt or otherwise depends on the Licensed
|
||||
Software or Open Source Qt, shall be considered as a Device distribution under
|
||||
this Agreement and dependent on compliance thereof (including but not limited
|
||||
to obligation to pay applicable License Fees for such distribution);
|
||||
|
||||
(ix) Licensee shall cause all of its Affiliates and Contractors entitled to
|
||||
make use of the licenses granted under this Agreement, to be contractually
|
||||
bound to comply with the relevant terms of this Agreement and not to use the
|
||||
Licensed Software beyond the terms hereof and for any purposes other than
|
||||
operating within the scope of their services for Licensee. Licensee shall be
|
||||
responsible for any and all actions and omissions of its Affiliates and
|
||||
Contractors relating to the Licensed Software and use thereof (including but
|
||||
not limited to payment of all applicable License Fees);
|
||||
|
||||
(x) Except when and to the extent explicitly provided in this Section 3,
|
||||
Licensee shall not transfer, publish, disclose, display or otherwise make
|
||||
available the Licensed Software;
|
||||
|
||||
; and
|
||||
|
||||
(xi) Licensee shall not attempt or enlist a third party to conduct or attempt
|
||||
to conduct any of the above.
|
||||
|
||||
Above terms shall not be applicable if and to the extent they conflict with any
|
||||
mandatory provisions of any applicable laws.
|
||||
|
||||
Any use of Licensed Software beyond the provisions of this Agreement is
|
||||
strictly prohibited and requires an additional license from The Qt Company.
|
||||
|
||||
4. THIRD PARTY SOFTWARE
|
||||
|
||||
The Licensed Software may provide links to third party libraries or code
|
||||
(collectively "Third Party Software") to implement various functions. Third
|
||||
Party Software does not comprise part of the Licensed Software. In some cases,
|
||||
access to Third Party Software may be included in the Licensed Software. Such
|
||||
Third Party Software will be listed in the ".../src/3rdparty" source tree
|
||||
delivered with the Licensed Software or documented in the Licensed Software, as
|
||||
such may be amended from time to time. Licensee acknowledges that use or
|
||||
distribution of Third Party Software is in all respects subject to applicable
|
||||
license terms of applicable third party right holders.
|
||||
|
||||
5. PRE-RELEASE CODE
|
||||
|
||||
The Licensed Software may contain pre-release code and functionality marked or
|
||||
otherwise stated as "Technology Preview", "Alpha", "Beta" or similar
|
||||
designation. Such pre-release code may be present in order to provide
|
||||
experimental support for new platforms or preliminary versions of one or more
|
||||
new functionalities. The pre-release code may not be at the level of
|
||||
performance and compatibility of a final, generally available, product
|
||||
offering of the Licensed Software. The pre-release parts of the Licensed
|
||||
Software may not operate correctly, may contain errors and may be substantially
|
||||
modified by The Qt Company prior to the first commercial product release, if
|
||||
any. The Qt Company is under no obligation to make pre-release code
|
||||
commercially available, or provide any Support or Updates relating thereto. The
|
||||
Qt Company assumes no liability whatsoever regarding any pre-release code, but
|
||||
any use thereof is exclusively at Licensee's own risk and expense.
|
||||
|
||||
6. LIMITED WARRANTY AND WARRANTY DISCLAIMER
|
||||
|
||||
The Qt Company hereby represents and warrants that it has the power and
|
||||
authority to grant the rights and licenses granted to Licensee under this
|
||||
Agreement.
|
||||
|
||||
Except as set forth above, the Licensed Software is licensed to Licensee
|
||||
"as is" and Licensee's exclusive remedy and The Qt Company's entire liability
|
||||
for errors in the Licensed Software shall be limited, at The Qt Company's
|
||||
option, to correction of the error, replacement of the Licensed Software or
|
||||
return of the applicable fees paid for the defective Licensed Software for the
|
||||
time period during which the License is not able to utilize the Licensed
|
||||
Software under the terms of this Agreement.
|
||||
|
||||
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE QT COMPANY ON BEHALF OF
|
||||
ITSELF AND ITS LICENSORS, SUPPLIERS AND AFFILIATES, DISCLAIMS ALL OTHER
|
||||
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-
|
||||
INFRINGEMENT WITH REGARD TO THE LICENSED SOFTWARE. THE QT COMPANY DOES NOT
|
||||
WARRANT THAT THE LICENSED SOFTWARE WILL SATISFY LICENSEE'S REQUIREMENTS OR THAT
|
||||
IT WILL OPERATE WITHOUT DEFECT OR ERROR OR THAT THE OPERATION THEREOF WILL BE
|
||||
UNINTERRUPTED. ALL USE OF AND RELIANCE ON THE LICENSED SOFTWARE IS AT THE SOLE
|
||||
RISK OF AND RESPONSIBILITY OF LICENSEE.
|
||||
|
||||
7. INDEMNIFICATION AND LIMITATION OF LIABILITY
|
||||
|
||||
7.1 Limitation of Liability
|
||||
|
||||
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
|
||||
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN NO
|
||||
EVENT SHALL EITHER PARTY BE LIABLE TO THE OTHER PARTY FOR ANY LOSS OF PROFIT,
|
||||
LOSS OF DATA, LOSS OF BUSINESS OR GOODWILL OR ANY OTHER INDIRECT, SPECIAL,
|
||||
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE COST, DAMAGES OR EXPENSE OF ANY KIND,
|
||||
HOWSOEVER ARISING UNDER OR IN CONNECTION WITH THIS AGREEMENT. PARTIES
|
||||
SPECIFICALLY AGREE THAT LICENSEE'S OBLIGATION TO PAY LICENSE AND OTHER FEES
|
||||
CORRESPONDING TO ACTUAL USAGE OF LICENSED SOFTWARE HEREUNDER SHALL BE
|
||||
CONSIDERED AS A DIRECT DAMAGE.
|
||||
|
||||
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
|
||||
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN
|
||||
NO EVENT SHALL EITHER PARTY'S TOTAL AGGREGATE LIABILITY UNDER THIS AGREEMENT
|
||||
EXCEED THE AGGREGATE LICENSE FEES PAID OR PAYABLE TO THE QT COMPANY FROM
|
||||
LICENSEE DURING THE PERIOD OF TWELVE (12) MONTHS IMMEDIATELY PRECEDING THE
|
||||
EVENT RESULTING IN SUCH LIABILITY.
|
||||
|
||||
THE PROVISIONS OF THIS SECTION 7 ALLOCATE THE RISKS UNDER THIS AGREEMENT
|
||||
BETWEEN THE QT COMPANY AND LICENSEE AND THE PARTIES HAVE RELIED UPON THE
|
||||
LIMITATIONS SET FORTH HEREIN IN DETERMINING WHETHER TO ENTER INTO THIS AGREEMENT.
|
||||
|
||||
7.2 Licensee's Indemnification
|
||||
|
||||
Licensee shall indemnify and hold harmless The Qt Company from and against any
|
||||
claim, injury, judgment, settlement, loss or expense, including attorneys' fees
|
||||
related to: (a) Licensee's misrepresentation in connection with The Qt Company
|
||||
or the Licensed Software or breach of this Agreement, (b) the Application or
|
||||
Device (except where such cause of liability is solely attributable to the
|
||||
Licensed Software).
|
||||
|
||||
8. SUPPORT, UPDATES AND ONLINE SERVICES
|
||||
|
||||
Upon due payment of the agreed License Fees the Licensee will be eligible to
|
||||
receive Support and Updates and to use the Online Services during the License
|
||||
Term, provided, however, that in the event the License Term is longer than 36
|
||||
months, Support is provided only for the first 12 months, unless the Parties
|
||||
specifically otherwise agree.
|
||||
|
||||
Unless otherwise decided by The Company at its free and absolute discretion,
|
||||
Upgrades will not be included in the Support but may be available subject to
|
||||
additional fees.
|
||||
|
||||
From time to time The Qt Company may change the Support terms, provided that
|
||||
during the respective ongoing License Term the level of Support provided by The
|
||||
Qt Company may not be reduced without the consent of the Licensee.
|
||||
|
||||
Unless otherwise agreed, The Qt Company shall not be responsible for providing
|
||||
any service or support to Customers.
|
||||
|
||||
9. CONFIDENTIALITY
|
||||
|
||||
Each Party acknowledges that during the Term of this Agreement each Party may
|
||||
receive information about the other Party's business, business methods,
|
||||
business plans, customers, business relations, technology, and other
|
||||
information, including the terms of this Agreement, that is confidential and
|
||||
of great value to the other Party, and the value of which would be
|
||||
significantly reduced if disclosed to third parties ("Confidential
|
||||
Information"). Accordingly, when a Party (the "Receiving Party") receives
|
||||
Confidential Information from the other Party (the "Disclosing Party"), the
|
||||
Receiving Party shall only disclose such information to employees and
|
||||
Contractors on a need to know basis, and shall cause its employees and
|
||||
employees of its Affiliates to: (i) maintain any and all Confidential
|
||||
Information in confidence; (ii) not disclose the Confidential Information to a
|
||||
third party without the Disclosing Party's prior written approval; and (iii)
|
||||
not, directly or indirectly, use the Confidential Information for any purpose
|
||||
other than for exercising its rights and fulfilling its responsibilities
|
||||
pursuant to this Agreement. Each Party shall take reasonable measures to
|
||||
protect the Confidential Information of the other Party, which measures shall
|
||||
not be less than the measures taken by such Party to protect its own
|
||||
confidential and proprietary information.
|
||||
|
||||
Obligation of confidentiality shall not apply to information that (i) is or
|
||||
becomes generally known to the public through no act or omission of the
|
||||
Receiving Party; (ii) was in the Receiving Party's lawful possession prior to
|
||||
the disclosure hereunder and was not subject to limitations on disclosure or
|
||||
use; (iii) is developed independently by employees or Contractors of the
|
||||
Receiving Party or other persons working for the Receiving Party who have not
|
||||
had access to the Confidential Information of the Disclosing Party, as proven
|
||||
by the written records of the Receiving Party; (iv) is lawfully disclosed to
|
||||
the Receiving Party without restrictions, by a third party not under an
|
||||
obligation of confidentiality; or (v) the Receiving Party is legally compelled
|
||||
to disclose, in which case the Receiving Party shall notify the Disclosing
|
||||
Party of such compelled disclosure and assert the privileged and confidential
|
||||
nature of the information and cooperate fully with the Disclosing Party to
|
||||
limit the scope of disclosure and the dissemination of disclosed Confidential
|
||||
Information to the minimum extent necessary.
|
||||
|
||||
The obligations under this Section 9 shall continue to remain in force for a
|
||||
period of five (5) years after the last disclosure, and, with respect to trade
|
||||
secrets, for so long as such trade secrets are protected under applicable trade
|
||||
secret laws.
|
||||
|
||||
10. FEES, DELIVERY AND PAYMENT
|
||||
|
||||
10.1 License Fees
|
||||
|
||||
License Fees are described in The Qt Company's standard price list, quote or
|
||||
Purchase Order confirmation or in an appendix hereto, as the case may be.
|
||||
|
||||
The License Fees shall not be refunded or claimed as a credit in any event or
|
||||
for any reason whatsoever.
|
||||
|
||||
10.2 Ordering Licenses
|
||||
|
||||
Licensee may purchase Development Licenses and Distribution Licenses pursuant
|
||||
to agreed pricing terms or, if no specific pricing terms have been agreed upon,
|
||||
at The Qt Company's standard pricing terms applicable at the time of purchase.
|
||||
|
||||
Licensee shall submit all purchase orders for Development Licenses and
|
||||
Distribution Licenses to The Qt Company by email or any other method acceptable
|
||||
to The Qt Company (each such order is referred to herein as a "Purchase Order")
|
||||
for confirmation, whereupon the Purchase Order shall become binding between the
|
||||
Parties.
|
||||
|
||||
10.3 Distribution License Packs
|
||||
|
||||
Unless otherwise agreed, Distribution Licenses shall be purchased by way of
|
||||
Distribution License Packs.
|
||||
|
||||
Upon due payment of the ordered Distribution License Pack(s), the Licensee will
|
||||
have an account of Distribution Licenses available for installing, bundling or
|
||||
integrating (all jointly "installing") the Redistributables with the Devices or
|
||||
for otherwise distributing the Redistributables in accordance with this
|
||||
Agreement.
|
||||
|
||||
Each time Licensee "installs" or distributes a copy of Redistributables, then
|
||||
one Distribution License is used, and Licensee's account of available
|
||||
Distribution Licenses is decreased accordingly.
|
||||
|
||||
Licensee may "install" copies of the Redistributables so long as Licensee has
|
||||
Distribution Licenses remaining on its account.
|
||||
|
||||
Redistributables will be deemed to have been "installed" into a Device when one
|
||||
of the following circumstances shall have occurred: a) the Redistributables
|
||||
have been loaded onto the Device and used outside of the Licensee's premises or
|
||||
b) the Device has been fully tested and placed into Licensee's inventory
|
||||
(or sold) for the first time (i.e., Licensee will not be required to use
|
||||
(or pay for) more than one Distribution License for each individual Device,
|
||||
e.g. in a situation where a Device is returned to Licensee's inventory after
|
||||
delivery to a distributor or sale to a Customer). In addition, if Licensee
|
||||
includes a back-up copy of the Redistributables on a CD-ROM or other storage
|
||||
medium along with the product, that backup copy of the Redistributables will
|
||||
not be deemed to have been "installed" and will not require an additional
|
||||
Distribution License.
|
||||
|
||||
10.4 Payment Terms
|
||||
|
||||
License Fees and any other charges under this Agreement shall be paid by
|
||||
Licensee no later than thirty (30) days from the date of the applicable invoice
|
||||
from The Qt Company.
|
||||
|
||||
The Qt Company will submit an invoice to Licensee after the date of this
|
||||
Agreement and/or after The Qt Company receives a Purchase Order from
|
||||
Licensee.
|
||||
|
||||
A late payment charge of the lower of (a) one percent per month; or (b) the
|
||||
interest rate stipulated by applicable law, shall be charged on any unpaid
|
||||
balances that remain past due.
|
||||
|
||||
The Qt Company shall have the right to suspend, terminate or withhold grants
|
||||
of all rights to the Licensed Software hereunder, including but not limited to
|
||||
the Developer License, Distribution License, and Support, should Licensee fail
|
||||
to make payment in timely fashion.
|
||||
|
||||
10.5 Taxes
|
||||
|
||||
All License Fees and other charges payable hereunder are gross amounts but
|
||||
exclusive of any value added tax, use tax, sales tax and other taxes, duties or
|
||||
tariffs ("Taxes"). Such applicable Taxes shall be paid by Licensee, or, where
|
||||
applicable, in lieu of payment of such Taxes, Licensee shall provide an
|
||||
exemption certificate to The Qt Company and any applicable authority.
|
||||
|
||||
11 RECORD-KEEPING AND REPORTING OBLIGATIONS; AUDIT RIGHTS
|
||||
|
||||
11.1 Licensee's Record-keeping
|
||||
|
||||
Licensee shall at all times maintain accurate and up-to-date written records of
|
||||
Licensee's activities related to the use of Licensed Software and distribution
|
||||
of Redistributables. The records shall be adequate to determine Licensee's
|
||||
compliance with the provisions of this Agreement and to demonstrate the number
|
||||
of Designated Users and Redistributables distributed by Licensee. The records
|
||||
shall conform to good accounting practices reasonably acceptable to The Qt
|
||||
Company.
|
||||
|
||||
Licensee shall, within thirty (30) days from receiving The Qt Company's request
|
||||
to that effect, deliver to The Qt Company a report on Licensee's usage of
|
||||
Licensed Software, such report to copies of Redistributables distributed by
|
||||
Licensee during that calendar quarter, and also detailing the number of
|
||||
undistributed copies of Redistributables made by Licensee and remaining in its
|
||||
account contain information, in sufficient detail, on (i) amount of users
|
||||
working with Licensed Software, (ii) copies of Redistributables distributed by
|
||||
Licensee during that calendar quarter, (iii) number of undistributed copies of
|
||||
Redistributables and corresponding number of unused Distribution Licenses
|
||||
remaining on Licensee's account, and (iv) any other information as The Qt
|
||||
Company may reasonably require from time to time.
|
||||
|
||||
11.2. The Qt Company's Audit Rights
|
||||
|
||||
The Qt Company or an independent auditor acting on behalf of The Qt Company's,
|
||||
may, upon at least five (5) business days' prior written notice and at its
|
||||
expense, audit Licensee with respect to the use of the Redistributables, but
|
||||
not more frequently than once during each 6-month period. Such audit may be
|
||||
conducted by mail, electronic means or through an in-person visit to Licensee's
|
||||
place of business. Any such in-person audit shall be conducted during regular
|
||||
business hours at Licensee's facilities and shall not unreasonably interfere
|
||||
with Licensee's business activities. The Qt Company or the independent auditor
|
||||
acting on behalf of The Qt Company shall be entitled to inspect Licensee's
|
||||
Records. All such Licensee's Records and use thereof shall be subject to an
|
||||
obligation of confidentiality under this Agreement.
|
||||
|
||||
If an audit reveals that Licensee is using the Licensed Software beyond scope
|
||||
of the licenses Licensee has paid for, Licensee agrees to immediately pay The
|
||||
Qt Company any amounts owed for such unauthorized use.
|
||||
|
||||
In addition, in the event the audit reveals a material violation of the terms
|
||||
of this Agreement (underpayment of more than 5% of License Fees shall always be
|
||||
deemed a material violation for purposes of this section), then the Licensee
|
||||
shall pay The Qt Company's reasonable cost of conducting such audit.
|
||||
|
||||
12 TERM AND TERMINATION
|
||||
|
||||
12.1 Term
|
||||
|
||||
This Agreement shall enter into force upon due acceptance by both Parties and
|
||||
remain in force for as long as there is any Development License(s) in force
|
||||
("Term"), unless and until terminated pursuant to the terms of this Section 12.
|
||||
|
||||
12.2 Termination by The Qt Company
|
||||
|
||||
The Qt Company shall have the right to terminate this Agreement upon thirty
|
||||
(30) days prior written notice if the Licensee is in material breach of any
|
||||
obligation of this Agreement and fails to remedy such breach within such notice
|
||||
period.
|
||||
|
||||
12.3 Mutual Right to Terminate
|
||||
|
||||
Either Party shall have the right to terminate this Agreement immediately upon
|
||||
written notice in the event that the other Party becomes insolvent, files for
|
||||
any form of bankruptcy, makes any assignment for the benefit of creditors, has
|
||||
a receiver, administrative receiver or officer appointed over the whole or a
|
||||
substantial part of its assets, ceases to conduct business, or an act
|
||||
equivalent to any of the above occurs under the laws of the jurisdiction of the
|
||||
other Party.
|
||||
|
||||
12.4 Parties' Rights and Duties upon Termination
|
||||
|
||||
Upon expiry or termination of the Agreement Licensee shall cease and shall
|
||||
cause all Designated Users (including those of its Affiliates' and
|
||||
Contractors') to cease using the Licensed Software and distribution of the
|
||||
Redistributables under this Agreement.
|
||||
|
||||
Notwithstanding the above, in the event the Agreement expires or is terminated:
|
||||
|
||||
(i) as a result of The Qt Company choosing not to renew the Development
|
||||
License(s) as set forth in Section 3.1, then all valid licenses possessed by
|
||||
the Licensee at such date shall be extended to be valid in perpetuity under the
|
||||
terms of this Agreement and Licensee is entitled to purchase additional
|
||||
licenses as set forth in Section 10.2; or
|
||||
|
||||
(ii) for reason other than by The Qt Company pursuant to item (i) above or
|
||||
pursuant to Section 12.2, then the Licensee is entitled, for a period of six
|
||||
(6) months after the effective date of termination, to continue distribution of
|
||||
Devices under the Distribution Licenses paid but unused at such effective date
|
||||
of termination.
|
||||
|
||||
Upon any such termination the Licensee shall destroy or return to The Qt
|
||||
Company all copies of the Licensed Software and all related materials and will
|
||||
certify the same to The Qt Company upon its request, provided however that
|
||||
Licensee may retain and exploit such copies of the Licensed Software as it may
|
||||
reasonably require in providing continued support to Customers.
|
||||
|
||||
Expiry or termination of this Agreement for any reason whatsoever shall not
|
||||
relieve Licensee of its obligation to pay any License Fees accrued or payable
|
||||
to The Qt Company prior to the effective date of termination, and Licensee
|
||||
shall immediately pay to The Qt Company all such fees upon the effective date
|
||||
of termination. Termination of this Agreement shall not affect any rights of
|
||||
Customers to continue use of Applications and Devices (and therein incorporated
|
||||
Redistributables).
|
||||
|
||||
12.5 Extension in case of bankruptcy
|
||||
|
||||
In the event The Qt Company is declared bankrupt under a final, non-cancellable
|
||||
decision by relevant court of law, and this Agreement is not, at the date of
|
||||
expiry of the Development License(s) pursuant to Section 3.1, assigned to
|
||||
party, who has assumed The Qt Company's position as a legitimate licensor of
|
||||
Licensed Software under this Agreement, then all valid licenses possessed by
|
||||
the Licensee at such date of expiry, and which the Licensee has not notified
|
||||
for expiry, shall be extended to be valid in perpetuity under the terms of
|
||||
this Agreement.
|
||||
|
||||
13. GOVERNING LAW AND LEGAL VENUE
|
||||
|
||||
In the event this Agreement is in the name of The Qt Company Inc., a Delaware
|
||||
Corporation, then:
|
||||
|
||||
(i) this Agreement shall be construed and interpreted in accordance with the
|
||||
laws of the State of California, USA, excluding its choice of law provisions;
|
||||
|
||||
(ii) the United Nations Convention on Contracts for the International Sale of
|
||||
Goods will not apply to this Agreement; and
|
||||
|
||||
(iii) any dispute, claim or controversy arising out of or relating to this
|
||||
Agreement or the breach, termination, enforcement, interpretation or validity
|
||||
thereof, including the determination of the scope or applicability of this
|
||||
Agreement to arbitrate, shall be determined by arbitration in San Francisco,
|
||||
USA, before one arbitrator. The arbitration shall be administered by JAMS
|
||||
pursuant to JAMS' Streamlined Arbitration Rules and Procedures. Judgment on the
|
||||
Award may be entered in any court having jurisdiction. This Section shall not
|
||||
preclude parties from seeking provisional remedies in aid of arbitration from a
|
||||
court of appropriate jurisdiction.
|
||||
|
||||
In the event this Agreement is in the name of The Qt Company Ltd., a Finnish
|
||||
Company, then:
|
||||
|
||||
(i) this Agreement shall be construed and interpreted in accordance with the
|
||||
laws of Finland, excluding its choice of law provisions;
|
||||
|
||||
(ii) the United Nations Convention on Contracts for the International Sale of
|
||||
Goods will not apply to this Agreement; and
|
||||
|
||||
(iii) any disputes, controversy or claim arising out of or relating to this
|
||||
Agreement, or the breach, termination or validity thereof shall be shall be
|
||||
finally settled by arbitration in accordance with the Arbitration Rules of
|
||||
Finland Chamber of Commerce. The arbitration tribunal shall consist of one (1),
|
||||
or if either Party so requires, of three (3), arbitrators. The award shall be
|
||||
final and binding and enforceable in any court of competent jurisdiction. The
|
||||
arbitration shall be held in Helsinki, Finland and the process shall be
|
||||
conducted in the English language. This Section shall not preclude parties from
|
||||
seeking provisional remedies in aid of arbitration from a court of appropriate
|
||||
jurisdiction.
|
||||
|
||||
14. GENERAL PROVISIONS
|
||||
|
||||
14.1 No Assignment
|
||||
|
||||
Except in the case of a merger or sale of substantially all of its corporate
|
||||
assets, Licensee shall not be entitled to assign or transfer all or any of its
|
||||
rights, benefits and obligations under this Agreement without the prior written
|
||||
consent of The Qt Company, which shall not be unreasonably withheld or delayed.
|
||||
The Qt Company shall be entitled to freely assign or transfer any of its
|
||||
rights, benefits or obligations under this Agreement.
|
||||
|
||||
14.2 No Third Party Representations
|
||||
|
||||
Licensee shall make no representations or warranties concerning the Licensed
|
||||
Software on behalf of The Qt Company. Any representation or warranty Licensee
|
||||
makes or purports to make on The Qt Company's behalf shall be void as to The
|
||||
Qt Company.
|
||||
|
||||
14.3 Surviving Sections
|
||||
|
||||
Any terms and conditions that by their nature or otherwise reasonably should
|
||||
survive termination of this Agreement shall so be deemed to survive.
|
||||
|
||||
14.4 Entire Agreement
|
||||
|
||||
This Agreement, the exhibits hereto, the License Certificate and any applicable
|
||||
Purchase Order constitute the complete agreement between the Parties and
|
||||
supersedes all prior or contemporaneous discussions, representations, and
|
||||
proposals, written or oral, with respect to the subject matters discussed
|
||||
herein.
|
||||
|
||||
In the event of any conflict or inconsistency between this Agreement and any
|
||||
Purchase Order, the terms of this Agreement will prevail over the terms of the
|
||||
Purchase Order with respect to such conflict or inconsistency.
|
||||
|
||||
Parties specifically acknowledge and agree that this Agreement prevails over
|
||||
any click-to-accept or similar agreements the Designated Users may need to
|
||||
accept online upon download of the Licensed Software, as may be required by
|
||||
The Qt Company's applicable processes relating to Licensed Software.
|
||||
|
||||
14.5 Modifications
|
||||
|
||||
No modification of this Agreement shall be effective unless contained in a
|
||||
writing executed by an authorized representative of each Party. No term or
|
||||
condition contained in Licensee's Purchase Order shall apply unless expressly
|
||||
accepted by The Qt Company in writing.
|
||||
|
||||
14.6 Force Majeure
|
||||
|
||||
Except for the payment obligations hereunder, neither Party shall be liable to
|
||||
the other for any delay or non-performance of its obligations hereunder in the
|
||||
event and to the extent that such delay or non-performance is due to an event
|
||||
of act of God, terrorist attack or other similar unforeseeable catastrophic
|
||||
event that prevents either Party for fulfilling its obligations under this
|
||||
Agreement and which such Party cannot avoid or circumvent ("Force Majeure
|
||||
Event"). If the Force Majeure Event results in a delay or non-performance of a
|
||||
Party for a period of three (3) months or longer, then either Party shall have
|
||||
the right to terminate this Agreement with immediate effect without any
|
||||
liability (except for the obligations of payment arising prior to the event of
|
||||
Force Majeure) towards the other Party.
|
||||
|
||||
14.7 Notices
|
||||
|
||||
Any notice given by one Party to the other shall be deemed properly given and
|
||||
deemed received if specifically acknowledged by the receiving Party in writing
|
||||
or when successfully delivered to the recipient by hand, fax, or special
|
||||
courier during normal business hours on a business day to the addresses
|
||||
specified for each Party on the signature page. Each communication and document
|
||||
made or delivered by one Party to the other Party pursuant to this Agreement
|
||||
shall be in the English language.
|
||||
|
||||
14.8 Export Control
|
||||
|
||||
Licensee acknowledges that the Redistributables may be subject to export
|
||||
control restrictions under the applicable laws of respective countries.
|
||||
Licensee shall fully comply with all applicable export license restrictions
|
||||
and requirements as well as with all laws and regulations relating to the
|
||||
Redistributables and exercise of licenses hereunder and shall procure all
|
||||
necessary governmental authorizations, including without limitation, all
|
||||
necessary licenses, approvals, permissions or consents, where necessary for the
|
||||
re-exportation of the Redistributables, Applications and/or Devices.
|
||||
|
||||
14.9 No Implied License
|
||||
|
||||
There are no implied licenses or other implied rights granted under this
|
||||
Agreement, and all rights, save for those expressly granted hereunder, shall
|
||||
remain with The Qt Company and its licensors. In addition, no licenses or
|
||||
immunities are granted to the combination of the Licensed Software with any
|
||||
other software or hardware not delivered by The Qt Company under this Agreement.
|
||||
|
||||
14.10 Attorney Fees
|
||||
|
||||
The prevailing Party in any action to enforce this Agreement shall be entitled
|
||||
to recover its attorney's fees and costs in connection with such action.
|
||||
|
||||
14.11 Severability
|
||||
|
||||
If any provision of this Agreement shall be adjudged by any court of competent
|
||||
jurisdiction to be unenforceable or invalid, that provision shall be limited or
|
||||
eliminated to the minimum extent necessary so that this Agreement shall
|
||||
otherwise remain in full force and effect and enforceable.
|
||||
|
||||
|
||||
IN WITNESS WHEREOF, the Parties hereto, intending to be legally bound hereby,
|
||||
have caused this Agreement to be executed by Licensee's authorized
|
||||
representative installing the Licensed Software and accepting the terms
|
||||
hereof in connection therewith.
|
||||
|
||||
|
||||
Appendix 1
|
||||
|
||||
1. Parts of the Licensed Software that are permitted for distribution in
|
||||
object code form only ("Redistributables") under this Agreement:
|
||||
|
||||
- The Licensed Software's Qt Essentials and Qt Add-on libraries
|
||||
- The Licensed Software's configuration tool ("qtconfig")
|
||||
- The Licensed Software's help tool ("Qt Assistant")
|
||||
- The Licensed Software's internationalization tools ("Qt Linguist", "lupdate",
|
||||
"lrelease")
|
||||
- The Licensed Software's QML ("Qt Quick") launcher tool ("qmlscene" or
|
||||
"qmlviewer")
|
||||
- The Licensed Software's installer framework
|
||||
|
||||
2. Parts of the Licensed Software that are not permitted for distribution
|
||||
include, but are not limited to:
|
||||
|
||||
- The Licensed Software's source code and header files
|
||||
- The Licensed Software's documentation
|
||||
- The Licensed Software's documentation generation tool ("qdoc")
|
||||
- The Licensed Software's tool for writing makefiles ("qmake")
|
||||
- The Licensed Software's Meta Object Compiler ("moc")
|
||||
- The Licensed Software's User Interface Compiler ("uic")
|
||||
- The Licensed Software's Resource Compiler ("rcc")
|
||||
- The Licensed Software's parts of the IDE tool ("Qt Creator")
|
||||
- The Licensed Software's parts of the Design tools ("Qt 3D Studio" or
|
||||
"Qt Quick Designer")
|
||||
- The Licensed Software's Emulator
|
1285
LICENSE.QT-LICENSE-AGREEMENT-4.2
Normal file
1285
LICENSE.QT-LICENSE-AGREEMENT-4.2
Normal file
File diff suppressed because it is too large
Load Diff
5
configure
vendored
5
configure
vendored
@ -271,12 +271,9 @@ macSDKify()
|
||||
val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
|
||||
echo "$var=$val"
|
||||
;;
|
||||
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*)
|
||||
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*|QMAKE_LFLAGS=*)
|
||||
echo "$line -isysroot $sysroot $version_min_flag"
|
||||
;;
|
||||
QMAKE_LFLAGS=*)
|
||||
echo "$line -Wl,-syslibroot,$sysroot $version_min_flag"
|
||||
;;
|
||||
*)
|
||||
echo "$line"
|
||||
;;
|
||||
|
@ -61,6 +61,8 @@ defineTest(qtConfCommandline_sanitize) {
|
||||
# callbacks
|
||||
|
||||
defineReplace(qtConfFunc_crossCompile) {
|
||||
!isEmpty(config.input.xplatform): return(true)
|
||||
!isEmpty(config.input.device-option): return(true)
|
||||
!isEmpty(config.input.sysroot): return(true)
|
||||
spec = $$[QMAKE_SPEC]
|
||||
!equals(spec, $$[QMAKE_XSPEC]): return(true)
|
||||
@ -72,7 +74,7 @@ defineReplace(qtConfFunc_licenseCheck) {
|
||||
hasOpenSource = true
|
||||
else: \
|
||||
hasOpenSource = false
|
||||
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0): \
|
||||
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT): \
|
||||
hasCommercial = true
|
||||
else: \
|
||||
hasCommercial = false
|
||||
@ -202,7 +204,7 @@ defineReplace(qtConfFunc_licenseCheck) {
|
||||
affix = either
|
||||
}
|
||||
} else {
|
||||
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0, lines)
|
||||
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT, lines)
|
||||
theLicense = $$first(theLicense)
|
||||
showWhat = "Type '?' to view the $${theLicense}."
|
||||
}
|
||||
@ -229,7 +231,7 @@ defineReplace(qtConfFunc_licenseCheck) {
|
||||
} else: equals(val, n)|equals(val, no) {
|
||||
return(false)
|
||||
} else: equals(commercial, yes):equals(val, ?) {
|
||||
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0
|
||||
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT
|
||||
} else: equals(commercial, no):equals(val, l) {
|
||||
licenseFile = $$QT_SOURCE_TREE/LICENSE.LGPL3
|
||||
} else: equals(commercial, no):equals(val, g):$$gpl2Ok {
|
||||
|
109
dist/changes-5.12.10
vendored
Normal file
109
dist/changes-5.12.10
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
Qt 5.12.10 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.9.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5.12/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Important Behavior Changes *
|
||||
****************************************************************************
|
||||
|
||||
****************************************************************************
|
||||
* Library *
|
||||
****************************************************************************
|
||||
|
||||
- [oss-fuzz-24347] QXmlStreamReader: No longer resizes readBuffer to a size
|
||||
it already has. When resizing it to 0 it will cause it to allocate memory.
|
||||
This will then cause append() to copy the data from the other string instead
|
||||
of using copy on write.
|
||||
- [oss-fuzz-24702] QTextHtmlParserNode: Fixed an integer-overflow in variantHash() due
|
||||
to extreme values for the font's pixelsize.
|
||||
- [QTBUG-86702] Gif decoder: fixed a read error caused by a ub check
|
||||
The recently added check to avoid negative-bitshift ub ignored that
|
||||
the algorithm will sometimes use a negative bitcount value as a flag.
|
||||
This caused a reading failure for some frames.
|
||||
- [QTBUG-86547] Fixed a double deletion in QDomAttr::setNodeValue()
|
||||
- [QTBUG-86691] xpm handler: fixed read error caused by off-by-one in overflow check
|
||||
The recently introduced overflow check for 8 bit images was too
|
||||
aggressive, causing the last pixel on each line to be rejected. This is also
|
||||
fixed for 32bit images.
|
||||
- [oss-fuzz-22997] Avoided a potential ub in a corrupt bmp file
|
||||
- [QTBUG-85725] Cocoa: Translated the buttons used for the native font and
|
||||
color dialogs
|
||||
- [QTBUG-86019] Fixed crash when serializing default-constructed QTimeZone
|
||||
- [oss-fuzz-24273] QBezier: No longer calculates a unit vector when length is null to
|
||||
prevent a divide by zero.
|
||||
- [QTBUG-81723] xcb: Fixed flushing of native subwindows when not using shared memory
|
||||
When using X-forwarding shared memory is not used for the backing
|
||||
store image, and ended up in a code path where we first copied the updated
|
||||
parts of the backing store from our client side image over to the
|
||||
server, and then flush those parts from the server-side image to the
|
||||
window.
|
||||
- [QTBUG-85764] Fixed starting of iOS applications on Big Sur
|
||||
- [QTBUG-85580] QByteArray::toDouble: fixed buffer overflow reads on fromRawData()
|
||||
- [QTBUG-85193] Allowed smooth curve stroking for very wide lines to ensure they
|
||||
are rendered better.
|
||||
- [QTBUG-85915] macOS: Fixed crash when re-using the backing store for a
|
||||
re-created QWindow. This was triggered when reopening a QComboBox after
|
||||
switching from one screen to another.
|
||||
- [oss-fuzz-23220] Sanitized the lengthValue in CSS parser by limiting the
|
||||
LengthData to the integer range before rounding it, taking into account
|
||||
that qRound() substracts 1 from negative values.
|
||||
- [oss-fuzz-21860] Checked return values of hex2int in get_hex_rgb
|
||||
- [oss-fuzz-23988] Fixed buffer overflow
|
||||
- [oss-fuzz-23735] Multiplied instead of shifting for negative values
|
||||
- [QTBUG-85528] Disabled PCRE2 JIT on macOS ARM64
|
||||
- [QTBUG-85279] macOS: Excluded 32-bit builds by checking pointer size
|
||||
- [QTBUG-85279] Fixed compilation of Qt on Apple Silicon (arm64)
|
||||
- [QTBUG-76924] Prevented the setting of focus on a proxy widget that does
|
||||
not take focus
|
||||
- [QTBUG-71548] Worked around a regression in the MSVC 2019 6.6 STL triggered
|
||||
when building qttranslations.
|
||||
- [QTBUG-84383] Fixed UITouch event handling on tvOS to prevent a crash
|
||||
when touchesEnd: could be called with touches that were not included in
|
||||
touchesBegain:.
|
||||
- [QTBUG-84762] macOS: Ensured QCocoaGLContext cleans up more often to
|
||||
release unneeded NSViews
|
||||
- [QTBUG-77320] Android: Accessibility is now activated when appropriate
|
||||
- [QTCREATORBUG-24195] Now always shows a submenu on its parent menu's screen
|
||||
|
||||
QCosmeticStroker
|
||||
----------------
|
||||
|
||||
- [oss-fuzz-25243] Avoided a heap-buffer-overflow
|
||||
|
||||
QOutlineMapper
|
||||
--------------
|
||||
|
||||
- [oss-fuzz-24615] Avoided a heap-buffer-overflow
|
||||
|
||||
QtSQL
|
||||
-----
|
||||
|
||||
- sqlite was updated to version 3.33.0
|
||||
|
||||
Third-Party Code
|
||||
----------------
|
||||
|
||||
- Fix aggregated copyright information of TinyCBOR component to reflect the
|
||||
years in the individual source files. Note that this is not same as the
|
||||
Copyright year in the upstream MIT license text.
|
||||
|
||||
- Changed classification of the wintab license from "Custom" to
|
||||
"LCS-Telegraphics License"
|
||||
|
||||
- libjpeg-turbo was updated to version 2.0.5
|
||||
|
53
dist/changes-5.12.6
vendored
Normal file
53
dist/changes-5.12.6
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
Qt 5.12.6 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.0 through 5.12.5.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* QtCore *
|
||||
****************************************************************************
|
||||
|
||||
- QLocale:
|
||||
* The system locale's UI languages list now includes, as for that of an
|
||||
ordinary locale, the results of adding likely sub-tags from each
|
||||
locale name, and of removing some, where this doesn't change which
|
||||
locale is specified. This gives searches for translation files a
|
||||
better chance of finding a suitable file.
|
||||
|
||||
****************************************************************************
|
||||
* Windows *
|
||||
****************************************************************************
|
||||
|
||||
- Text:
|
||||
* [QTBUG-57180] Removed confusing DirectWrite warning when loading
|
||||
bitmap fonts.
|
||||
|
||||
****************************************************************************
|
||||
* Android *
|
||||
****************************************************************************
|
||||
|
||||
- Fixed regression that made it impossible for an application to use the
|
||||
tap-and-hold gesture.
|
||||
|
||||
****************************************************************************
|
||||
* Third-Party Code *
|
||||
****************************************************************************
|
||||
|
||||
- libjpeg-turbo was updated to version 2.0.3
|
||||
|
||||
- QtSQL
|
||||
* Updated sqlite to v3.29.0
|
25
dist/changes-5.12.7
vendored
Normal file
25
dist/changes-5.12.7
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
Qt 5.12.7 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.0 through 5.12.6.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* QtSQL *
|
||||
****************************************************************************
|
||||
|
||||
- sqlite:
|
||||
* Updated to v3.30.1
|
70
dist/changes-5.12.8
vendored
Normal file
70
dist/changes-5.12.8
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
Qt 5.12.8 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.0 through 5.12.7.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* QtCore *
|
||||
****************************************************************************
|
||||
|
||||
- QLockFile:
|
||||
* Suppressed the warning on QNX that said 'setNativeLocks failed:
|
||||
"Function not implemented"'. There is no difference in behavior: Qt
|
||||
will continue not to be able to apply an OS- level file lock, which
|
||||
means the lock could be accidentally stolen by buggy software. Correct
|
||||
software using QLockFile should not be affected.
|
||||
|
||||
- QXmlStream:
|
||||
* QTBUG-47417: QXmlStreamReader does now limit the expansion of
|
||||
entities to 4096 characters. Documents where a single entity
|
||||
expands to more characters than the limit are not considered well
|
||||
formed. The limit is there to avoid DoS attacks through
|
||||
recursively expanding entities when loading untrusted content. Qt
|
||||
5.15 will add methods that allow changing that limit.
|
||||
|
||||
****************************************************************************
|
||||
* QtSQL *
|
||||
****************************************************************************
|
||||
|
||||
- sqlite:
|
||||
* Updated to v3.31.1
|
||||
* [QTBUG-82533] Fixed CVE-2020-9327
|
||||
|
||||
****************************************************************************
|
||||
* QtNetwork *
|
||||
****************************************************************************
|
||||
|
||||
- QSslCertificate:
|
||||
* Fix a potential heap buffer overflow when parsing certificates
|
||||
- QTBUG-81762: Fix SSL symbol resolving for OPENSSL_NO_NEXPROTONEG
|
||||
|
||||
****************************************************************************
|
||||
* Platform specific changes *
|
||||
****************************************************************************
|
||||
|
||||
- macOS:
|
||||
* QTBUG-82986: Improve performance when flushing sublayers
|
||||
* QTBUG-79139: Avoid repainting OpenGL layers when resizing the window
|
||||
|
||||
- xcb/X11:
|
||||
* QTBUG-76147, QTBUG-76354, QTBUG-68864: Fix handling of minimized state
|
||||
|
||||
- QNX:
|
||||
* QTBUG-81701: QLockFile: Disable flock() on QNX
|
||||
|
||||
|
||||
|
95
dist/changes-5.12.9
vendored
Normal file
95
dist/changes-5.12.9
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
Qt 5.12.9 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.0 through 5.12.8.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Platform-specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
- [QTBUG-63584] Fixed a crash in evdev when multiple touchscreens are in use.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
- Fixed a compatibility issue found when linking code compiled with
|
||||
MSVC version 16.6 to a Qt compiled with 16.5.
|
||||
- [QTBUG-80436] Fixed a crash when changing screen during session lock.
|
||||
- [QTBUG-84265] Direct Write Font engine: Fix a memory leak
|
||||
|
||||
macOS
|
||||
-----
|
||||
|
||||
- [QTBUG-84405] Respect window type when determining main window status
|
||||
|
||||
****************************************************************************
|
||||
* QtCore *
|
||||
****************************************************************************
|
||||
|
||||
- QCborValue:
|
||||
* fromCbor() now limits decoding to at most 1024 nested maps, arrays,
|
||||
and tags to prevent stack overflows. This should be sufficient for
|
||||
most uses of CBOR. An API to limit further or to relax the limit will
|
||||
be provided in 5.15. Meanwhile, if decoding more is required,
|
||||
QCborStreamReader can be used (note that each level of map and array
|
||||
allocates memory).
|
||||
|
||||
****************************************************************************
|
||||
* QtSQL *
|
||||
****************************************************************************
|
||||
|
||||
- sqlite:
|
||||
* Updated to v3.32.1 which includes fixes for CVE-2020-11655 and
|
||||
CVE-2020-11656
|
||||
|
||||
****************************************************************************
|
||||
* QtNetwork *
|
||||
****************************************************************************
|
||||
|
||||
- [QTBUG-83450] OpenSSL: handle SSL_shutdown's errors properly
|
||||
|
||||
****************************************************************************
|
||||
* QtGui *
|
||||
****************************************************************************
|
||||
|
||||
- QIcon:
|
||||
* [QTBUG-74252] If you call QIcon::setFallbackThemeName(), do it before
|
||||
creating a QGuiApplication. We fixed a race condition which was
|
||||
preventing loading the first icon from the fallback theme.
|
||||
|
||||
- QImage:
|
||||
* [oss-fuzz 22557] Fixed undefined behavior in bmp/ico decoder
|
||||
* [oss-fuzz 22741] Fixed crash in gif decoder
|
||||
|
||||
- [QTBUG-84189] Avoid format conversion when uploading textures for the
|
||||
backing store
|
||||
|
||||
****************************************************************************
|
||||
* QtWidgets *
|
||||
****************************************************************************
|
||||
|
||||
- QWidgetWindow:
|
||||
* [QTBUG-84222] Fixed crash in QWidgetWindow::event() when
|
||||
handling closeEvent.
|
||||
|
||||
- QMenu:
|
||||
* [QTBUG-76162] A submenu now always opens on the same screen as
|
||||
the parent menu.
|
||||
|
@ -3,7 +3,7 @@
|
||||
dita.metadata.default.author = Qt Project
|
||||
dita.metadata.default.permissions = all
|
||||
dita.metadata.default.publisher = Qt Project
|
||||
dita.metadata.default.copyryear = 2019
|
||||
dita.metadata.default.copyryear = 2020
|
||||
dita.metadata.default.copyrholder = The Qt Company Ltd
|
||||
dita.metadata.default.audience = programmer
|
||||
|
||||
|
@ -78,7 +78,7 @@ HTML.footer += \
|
||||
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
|
||||
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:feedback@theqtcompany.com?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
|
||||
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
|
||||
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2019 The Qt Company</a></li>\n" \
|
||||
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2020 The Qt Company</a></li>\n" \
|
||||
" </ul>\n" \
|
||||
"</div>\n" \
|
||||
"</div>\n" \
|
||||
|
@ -8,7 +8,7 @@ HTML.footer = \
|
||||
"</div>\n" \
|
||||
"<div class=\"footer\">\n" \
|
||||
" <p>\n" \
|
||||
" <acronym title=\"Copyright\">©</acronym> 2019 The Qt Company Ltd.\n" \
|
||||
" <acronym title=\"Copyright\">©</acronym> 2020 The Qt Company Ltd.\n" \
|
||||
" Documentation contributions included herein are the copyrights of\n" \
|
||||
" their respective owners.<br/>" \
|
||||
" The documentation provided herein is licensed under the terms of the" \
|
||||
|
@ -19,27 +19,11 @@ HTML.headerstyles = \
|
||||
" }, 0);\n" \
|
||||
" </script>\n"
|
||||
|
||||
HTML.postheader = \
|
||||
"<body>\n" \
|
||||
"<div class=\"header\" id=\"qtdocheader\">\n"\
|
||||
" <div class=\"main\">\n" \
|
||||
" <div class=\"main-rounded\">\n" \
|
||||
" <div class=\"navigationbar\">\n" \
|
||||
" <table><tr>\n"
|
||||
|
||||
HTML.postpostheader = \
|
||||
" </tr></table>\n"\
|
||||
" </div>\n" \
|
||||
" </div>\n" \
|
||||
"<div class=\"content\">\n" \
|
||||
"<div class=\"line\">\n" \
|
||||
"<div class=\"content mainContent\">\n"
|
||||
|
||||
HTML.navigationseparator = \
|
||||
"<span class=\"naviSeparator\"> ◦ </span>\n"
|
||||
|
||||
# Add some padding around code snippets, as we cannot
|
||||
# currectly style them for QTextBrowser using only CSS.
|
||||
codeindent = 2
|
||||
codeprefix = "\n\n"
|
||||
codesuffix = "\n\n"
|
||||
codeindent = 1
|
||||
codeprefix = "\n"
|
||||
codesuffix = "\n"
|
||||
|
@ -5,7 +5,7 @@
|
||||
HTML.footer = \
|
||||
" </div>\n" \
|
||||
" <p class=\"copy-notice\">\n" \
|
||||
" <acronym title=\"Copyright\">©</acronym> 2019 The Qt Company Ltd.\n" \
|
||||
" <acronym title=\"Copyright\">©</acronym> 2020 The Qt Company Ltd.\n" \
|
||||
" Documentation contributions included herein are the copyrights of\n" \
|
||||
" their respective owners. " \
|
||||
" The documentation provided herein is licensed under the terms of the" \
|
||||
|
@ -297,11 +297,14 @@ table.buildversion {
|
||||
|
||||
#buildversion {
|
||||
font-style: italic;
|
||||
font-size: small;
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#buildversion a {
|
||||
background: none;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
/* table of content
|
||||
|
@ -17,8 +17,16 @@ os_directory = $$(INTEGRITY_DIR)
|
||||
isEmpty(os_directory): \
|
||||
error("This qmakespec requires $INTEGRITY_DIR to be set")
|
||||
|
||||
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
|
||||
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
|
||||
iy_build_target = $$(INTEGRITY_BUILD_TARGET)
|
||||
isEmpty(iy_build_target): \
|
||||
message("This qmakespec requires $INTEGRITY_BUILD_TARGET to be set [dbg|rel|chk|cov] for Integrity versions 11.7.6 and higher")
|
||||
|
||||
start_name = $$(INTEGRITY_DIR)/libs/$$(INTEGRITY_BSP)/$$(INTEGRITY_BUILD_TARGET)
|
||||
rtos_name= libs/$$(INTEGRITY_BSP)/$$(INTEGRITY_BUILD_TARGET)
|
||||
|
||||
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared -startfile_dir=$$start_name --rtos_library_directory=$$rtos_name --rtos_library_directory=libs/arm64/$$iy_build_target
|
||||
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared -startfile_dir=$$start_name --rtos_library_directory=$$rtos_name --rtos_library_directory=libs/arm64/$$iy_build_target
|
||||
|
||||
QMAKE_LINK = $$QMAKE_CXX
|
||||
QMAKE_AR = $$QMAKE_CXX -archive -o
|
||||
|
||||
|
@ -7,8 +7,9 @@ QMAKE_MAC_SDK = macosx
|
||||
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
|
||||
QMAKE_APPLE_DEVICE_ARCHS = x86_64
|
||||
|
||||
QT_MAC_SDK_VERSION_MIN = 10.13
|
||||
QT_MAC_SDK_VERSION_MAX = 10.15
|
||||
QT_MAC_SDK_VERSION_MAX = 11.0
|
||||
|
||||
device.sdk = macosx
|
||||
device.target = device
|
||||
|
@ -35,7 +35,7 @@ isEmpty(gl_lib_directory): \
|
||||
|
||||
QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR)
|
||||
|
||||
QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary
|
||||
QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary -lmmosalrfs -llogger -lnet -lsocket -lrfs_client -lshm_client -lmmapext
|
||||
QMAKE_LIBS_OPENGL_ES2 += $${QMAKE_LIBS_EGL}
|
||||
|
||||
QMAKE_CFLAGS += -DINTEGRITY
|
||||
|
@ -228,7 +228,8 @@ mac {
|
||||
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
||||
} else {
|
||||
qt_framework {
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}_debug
|
||||
# Intentionally there is no '_debug' infix for framework builds.
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
||||
CMAKE_BUILD_IS_FRAMEWORK = "true"
|
||||
} else {
|
||||
|
@ -97,21 +97,22 @@ macx-xcode {
|
||||
qmake_pkginfo_typeinfo.value = "????"
|
||||
QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
|
||||
|
||||
!isEmpty(VERSION) {
|
||||
l = $$split(VERSION, '.') 0 0 # make sure there are at least three
|
||||
VER_MAJ = $$member(l, 0, 0)
|
||||
VER_MIN = $$member(l, 1, 1)
|
||||
VER_PAT = $$member(l, 2, 2)
|
||||
unset(l)
|
||||
bundle_version = $$VERSION
|
||||
isEmpty(bundle_version): bundle_version = 1.0.0
|
||||
|
||||
qmake_full_version.name = QMAKE_FULL_VERSION
|
||||
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
|
||||
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
|
||||
l = $$split(bundle_version, '.') 0 0 # make sure there are at least three
|
||||
VER_MAJ = $$member(l, 0, 0)
|
||||
VER_MIN = $$member(l, 1, 1)
|
||||
VER_PAT = $$member(l, 2, 2)
|
||||
unset(l)
|
||||
|
||||
qmake_short_version.name = QMAKE_SHORT_VERSION
|
||||
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
|
||||
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
|
||||
}
|
||||
qmake_full_version.name = QMAKE_FULL_VERSION
|
||||
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
|
||||
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
|
||||
|
||||
qmake_short_version.name = QMAKE_SHORT_VERSION
|
||||
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
|
||||
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
|
||||
|
||||
!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
|
||||
debug_information_format.name = DEBUG_INFORMATION_FORMAT
|
||||
@ -196,7 +197,7 @@ macx-xcode {
|
||||
-isysroot$$xcodeSDKInfo(Path, $$sdk)
|
||||
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
|
||||
-Xarch_$${arch} \
|
||||
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
|
||||
-isysroot$$xcodeSDKInfo(Path, $$sdk)
|
||||
|
||||
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
|
||||
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
|
||||
@ -217,7 +218,7 @@ macx-xcode {
|
||||
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
|
||||
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
QMAKE_LFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
}
|
||||
|
||||
# Enable precompiled headers for multiple architectures
|
||||
|
@ -25,7 +25,8 @@ contains(TEMPLATE, .*lib) {
|
||||
if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
|
||||
unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
|
||||
qtConfig(separate_debug_info): CONFIG += separate_debug_info
|
||||
|
||||
}
|
||||
contains(TEMPLATE, .*lib)|contains(TEMPLATE, aux) {
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
|
||||
else: \
|
||||
|
@ -821,9 +821,9 @@ defineTest(qtConfLibrary_pkgConfig) {
|
||||
!qtConfResolveLibs($${1}.libs, $$libs): \
|
||||
return(false)
|
||||
contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") {
|
||||
qtRunLoggedCommand("$$pkg_config --static --libs-only-L $$args", libpaths)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --static --libs-only-l $$args", libs)|return(false)
|
||||
eval(libs = $$libpaths $$libs)
|
||||
qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false)
|
||||
# Split by space
|
||||
eval(libs = $$libs)
|
||||
!qtConfResolveLibs($${1}.libs, $$libs): \
|
||||
return(false)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
QMAKE_TARGET_COMPANY = The Qt Company Ltd.
|
||||
isEmpty(QMAKE_TARGET_PRODUCT): QMAKE_TARGET_PRODUCT = Qt5
|
||||
isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = C++ Application Development Framework
|
||||
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2019 The Qt Company Ltd.
|
||||
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2020 The Qt Company Ltd.
|
||||
|
@ -36,7 +36,11 @@ win32 {
|
||||
plugin_target = $$QMAKE_PLUGIN_BUNDLE_NAME
|
||||
else: \
|
||||
plugin_target = $$TARGET
|
||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${plugin_target}.plugin
|
||||
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
||||
plugin_ext = .plugin
|
||||
else: \
|
||||
plugin_ext = $$QMAKE_BUNDLE_EXTENSION
|
||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${plugin_target}$${plugin_ext}
|
||||
!shallow_bundle: \
|
||||
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
|
||||
else: \
|
||||
@ -46,7 +50,11 @@ win32 {
|
||||
framework_target = $$QMAKE_FRAMEWORK_BUNDLE_NAME
|
||||
else: \
|
||||
framework_target = $$TARGET
|
||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}.framework
|
||||
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
||||
framework_ext = .framework
|
||||
else: \
|
||||
framework_ext = $$QMAKE_BUNDLE_EXTENSION
|
||||
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}$${framework_ext}
|
||||
!shallow_bundle {
|
||||
TEMP_VERSION = $$section(VERSION, ., 0, 0)
|
||||
isEmpty(TEMP_VERSION):TEMP_VERSION = A
|
||||
|
@ -182,6 +182,10 @@ isEmpty($${target_prefix}.INCDIRS) {
|
||||
# UIKit simulator platforms will see the device SDK's sysroot in
|
||||
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
|
||||
darwin {
|
||||
# Clang doesn't pick up the architecture from the sysroot, and will
|
||||
# default to the host architecture, so we need to manually set it.
|
||||
cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS
|
||||
|
||||
uikit:macx-xcode: \
|
||||
cxx_flags += -isysroot $$sdk_path_device.value
|
||||
else: \
|
||||
|
@ -9,7 +9,7 @@ uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
|
||||
uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
|
||||
uic.input = FORMS
|
||||
uic.variable_out = GENERATED_FILES
|
||||
uic.CONFIG += no_link target_predeps dep_lines
|
||||
uic.CONFIG += no_link target_predeps dep_lines dep_existing_only
|
||||
uic.name = UIC ${QMAKE_FILE_IN}
|
||||
silent:uic.commands = @echo uic ${QMAKE_FILE_IN} && $$uic.commands
|
||||
QMAKE_EXTRA_COMPILERS += uic
|
||||
|
@ -28,7 +28,7 @@ macx-xcode {
|
||||
device_family.value = $$QMAKE_APPLE_TARGETED_DEVICE_FAMILY
|
||||
QMAKE_MAC_XCODE_SETTINGS += device_family
|
||||
|
||||
ios {
|
||||
equals(TEMPLATE, app):ios {
|
||||
# Set up default 4-inch iPhone/iPod launch image so that our apps
|
||||
# support the full screen resolution of those devices.
|
||||
qmake_launch_image = Default-568h@2x.png
|
||||
|
@ -2,8 +2,6 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildSystemType</key>
|
||||
<string>Original</string>
|
||||
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
|
||||
<false/>
|
||||
</dict>
|
||||
|
@ -27,7 +27,7 @@ QOBJS = \
|
||||
qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o \
|
||||
qmetatype.o qsystemerror.o qvariant.o \
|
||||
quuid.o \
|
||||
qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \
|
||||
qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o \
|
||||
qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o \
|
||||
qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \
|
||||
qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o \
|
||||
@ -108,6 +108,7 @@ DEPEND_SRC = \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
|
||||
$(SOURCE_PATH)/src/corelib/tools/qbytearraylist.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
|
||||
@ -307,6 +308,9 @@ qarraydata.o: $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp
|
||||
qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
qbytearraylist.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraylist.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
|
@ -71,6 +71,7 @@ QTOBJS= \
|
||||
qfsfileengine_iterator.obj \
|
||||
qarraydata.obj \
|
||||
qbytearray.obj \
|
||||
qbytearraylist.obj \
|
||||
qvsnprintf.obj \
|
||||
qbytearraymatcher.obj \
|
||||
qdatetime.obj \
|
||||
|
@ -4728,6 +4728,11 @@
|
||||
\li explicit_dependencies
|
||||
\li The dependencies for the output only get generated from the depends
|
||||
member and from nowhere else.
|
||||
\row
|
||||
\li dep_existing_only
|
||||
\li Every dependency that is a result of .depend_command is checked for
|
||||
existence. Non-existing dependencies are ignored.
|
||||
This value was introduced in Qt 5.12.6.
|
||||
\row
|
||||
\li dep_lines
|
||||
\li The output from the .depend_command is interpreted to be one file
|
||||
|
@ -783,6 +783,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
{
|
||||
QString mkfile = pbx_dir + Option::dir_sep + "qt_preprocess.mak";
|
||||
QFile mkf(mkfile);
|
||||
ProStringList outputPaths;
|
||||
ProStringList inputPaths;
|
||||
if(mkf.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
writingUnixMakefileGenerator = true;
|
||||
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
|
||||
@ -832,8 +834,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
++added;
|
||||
const QString file_name = fileFixify(fn, FileFixifyFromOutdir);
|
||||
const QString tmpOut = fileFixify(tmp_out.first().toQString(), FileFixifyFromOutdir);
|
||||
mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
|
||||
QString path = escapeDependencyPath(Option::fixPathToTargetOS(
|
||||
replaceExtraCompilerVariables(tmpOut, file_name, QString(), NoShell)));
|
||||
mkt << ' ' << path;
|
||||
inputPaths << fn;
|
||||
outputPaths << path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -844,6 +849,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
mkt.flush();
|
||||
mkf.close();
|
||||
}
|
||||
// Remove duplicates from build steps with "combine"
|
||||
outputPaths.removeDuplicates();
|
||||
|
||||
// Don't create cycles. We only have one qt_preprocess.mak which runs different compilers
|
||||
// whose inputs may depend on the output of another. The "compilers" step will run all
|
||||
// compilers anyway
|
||||
inputPaths.removeEach(outputPaths);
|
||||
|
||||
mkfile = fileFixify(mkfile);
|
||||
QString phase_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET");
|
||||
// project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
|
||||
@ -854,6 +867,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
|
||||
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
||||
<< "\t\t\t" << writeSettings("name", "Qt Preprocessors") << ";\n"
|
||||
<< "\t\t\t" << writeSettings("inputPaths", inputPaths, SettingsAsList, 4) << ";\n"
|
||||
<< "\t\t\t" << writeSettings("outputPaths", outputPaths, SettingsAsList, 4) << ";\n"
|
||||
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
|
||||
<< "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(Option::output_dir)
|
||||
+ " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
|
||||
|
@ -1870,6 +1870,61 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &
|
||||
return {};
|
||||
}
|
||||
|
||||
void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCompiler,
|
||||
const QString &dep_cd_cmd,
|
||||
const QString &tmp_dep_cmd,
|
||||
const QString &inpf,
|
||||
const QString &tmp_out,
|
||||
bool dep_lines,
|
||||
QStringList *deps,
|
||||
bool existingDepsOnly,
|
||||
bool checkCommandAvailability)
|
||||
{
|
||||
char buff[256];
|
||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
|
||||
if (checkCommandAvailability && !canExecute(dep_cmd))
|
||||
return;
|
||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QByteArray depData;
|
||||
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
|
||||
depData.append(buff, read_in);
|
||||
QT_PCLOSE(proc);
|
||||
const QString indeps = QString::fromLocal8Bit(depData);
|
||||
if (indeps.isEmpty())
|
||||
return;
|
||||
QDir outDir(Option::output_dir);
|
||||
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
|
||||
for (int i = 0; i < dep_cmd_deps.count(); ++i) {
|
||||
QString &file = dep_cmd_deps[i];
|
||||
const QString absFile = outDir.absoluteFilePath(file);
|
||||
if (absFile == file) {
|
||||
// already absolute; don't do any checks.
|
||||
} else if (exists(absFile)) {
|
||||
file = absFile;
|
||||
} else {
|
||||
const QString localFile = resolveDependency(outDir, file);
|
||||
if (localFile.isEmpty()) {
|
||||
if (exists(file)) {
|
||||
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
|
||||
" prints paths relative to source directory",
|
||||
extraCompiler.toLatin1().constData());
|
||||
} else if (existingDepsOnly) {
|
||||
file.clear();
|
||||
} else {
|
||||
file = absFile; // fallback for generated resources
|
||||
}
|
||||
} else {
|
||||
file = localFile;
|
||||
}
|
||||
}
|
||||
if (!file.isEmpty())
|
||||
file = fileFixify(file);
|
||||
}
|
||||
deps->append(dep_cmd_deps);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
{
|
||||
@ -1984,6 +2039,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
}
|
||||
t << endl;
|
||||
}
|
||||
const bool existingDepsOnly = config.contains("dep_existing_only");
|
||||
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
|
||||
if (config.indexOf("combine") != -1) {
|
||||
if (tmp_out.contains(QRegExp("(^|[^$])\\$\\{QMAKE_(?!VAR_)"))) {
|
||||
@ -1999,44 +2055,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
deps += findDependencies(inpf);
|
||||
inputs += Option::fixPathToTargetOS(inpf, false);
|
||||
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
|
||||
char buff[256];
|
||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
|
||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QByteArray depData;
|
||||
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
|
||||
depData.append(buff, read_in);
|
||||
QT_PCLOSE(proc);
|
||||
const QString indeps = QString::fromLocal8Bit(depData);
|
||||
if(!indeps.isEmpty()) {
|
||||
QDir outDir(Option::output_dir);
|
||||
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
|
||||
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
||||
QString &file = dep_cmd_deps[i];
|
||||
QString absFile = outDir.absoluteFilePath(file);
|
||||
if (absFile == file) {
|
||||
// already absolute; don't do any checks.
|
||||
} else if (exists(absFile)) {
|
||||
file = absFile;
|
||||
} else {
|
||||
QString localFile = resolveDependency(outDir, file);
|
||||
if (localFile.isEmpty()) {
|
||||
if (exists(file))
|
||||
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
|
||||
" prints paths relative to source directory",
|
||||
(*it).toLatin1().constData());
|
||||
else
|
||||
file = absFile; // fallback for generated resources
|
||||
} else {
|
||||
file = localFile;
|
||||
}
|
||||
}
|
||||
if(!file.isEmpty())
|
||||
file = fileFixify(file);
|
||||
}
|
||||
deps += dep_cmd_deps;
|
||||
}
|
||||
}
|
||||
callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
|
||||
tmp_out, dep_lines, &deps, existingDepsOnly);
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < inputs.size(); ) {
|
||||
@ -2084,44 +2104,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
|
||||
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
|
||||
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
|
||||
char buff[256];
|
||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
|
||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QByteArray depData;
|
||||
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
|
||||
depData.append(buff, read_in);
|
||||
QT_PCLOSE(proc);
|
||||
const QString indeps = QString::fromLocal8Bit(depData);
|
||||
if(!indeps.isEmpty()) {
|
||||
QDir outDir(Option::output_dir);
|
||||
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
|
||||
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
|
||||
QString &file = dep_cmd_deps[i];
|
||||
QString absFile = outDir.absoluteFilePath(file);
|
||||
if (absFile == file) {
|
||||
// already absolute; don't do any checks.
|
||||
} else if (exists(absFile)) {
|
||||
file = absFile;
|
||||
} else {
|
||||
QString localFile = resolveDependency(outDir, file);
|
||||
if (localFile.isEmpty()) {
|
||||
if (exists(file))
|
||||
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
|
||||
" prints paths relative to source directory",
|
||||
(*it).toLatin1().constData());
|
||||
else
|
||||
file = absFile; // fallback for generated resources
|
||||
} else {
|
||||
file = localFile;
|
||||
}
|
||||
}
|
||||
if(!file.isEmpty())
|
||||
file = fileFixify(file);
|
||||
}
|
||||
deps += dep_cmd_deps;
|
||||
}
|
||||
}
|
||||
callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
|
||||
tmp_out, dep_lines, &deps, existingDepsOnly);
|
||||
//use the depend system to find includes of these included files
|
||||
QStringList inc_deps;
|
||||
for(int i = 0; i < deps.size(); ++i) {
|
||||
|
@ -84,6 +84,11 @@ protected:
|
||||
void writeExtraVariables(QTextStream &t);
|
||||
void writeExtraTargets(QTextStream &t);
|
||||
QString resolveDependency(const QDir &outDir, const QString &file);
|
||||
void callExtraCompilerDependCommand(const ProString &extraCompiler, const QString &dep_cd_cmd,
|
||||
const QString &tmp_dep_cmd, const QString &inpf,
|
||||
const QString &tmp_out, bool dep_lines, QStringList *deps,
|
||||
bool existingDepsOnly,
|
||||
bool checkCommandAvailability = false);
|
||||
void writeExtraCompilerTargets(QTextStream &t);
|
||||
void writeExtraCompilerVariables(QTextStream &t);
|
||||
bool writeDummyMakefile(QTextStream &t);
|
||||
|
@ -2350,33 +2350,15 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
||||
if (!tmp_dep.isEmpty())
|
||||
deps = tmp_dep;
|
||||
if (!tmp_dep_cmd.isEmpty()) {
|
||||
// Execute dependency command, and add every line as a dep
|
||||
char buff[256];
|
||||
QString dep_cmd = Project->replaceExtraCompilerVariables(
|
||||
tmp_dep_cmd, inFile, out, MakefileGenerator::LocalShell);
|
||||
if(Project->canExecute(dep_cmd)) {
|
||||
dep_cmd.prepend(QLatin1String("cd ")
|
||||
+ IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
|
||||
+ QLatin1String(" && "));
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QString indeps;
|
||||
while(!feof(proc)) {
|
||||
int read_in = (int)fread(buff, 1, 255, proc);
|
||||
if(!read_in)
|
||||
break;
|
||||
indeps += QByteArray(buff, read_in);
|
||||
}
|
||||
QT_PCLOSE(proc);
|
||||
if(!indeps.isEmpty()) {
|
||||
QStringList extradeps = indeps.split(QLatin1Char('\n'));
|
||||
for (int i = 0; i < extradeps.count(); ++i) {
|
||||
QString dd = extradeps.at(i).simplified();
|
||||
if (!dd.isEmpty())
|
||||
deps += Project->fileFixify(dd, MakefileGenerator::FileFixifyFromOutdir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const QString dep_cd_cmd = QLatin1String("cd ")
|
||||
+ IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
|
||||
+ QLatin1String(" && ");
|
||||
Project->callExtraCompilerDependCommand(extraCompilerName, dep_cd_cmd, tmp_dep_cmd,
|
||||
inFile, out,
|
||||
true, // dep_lines
|
||||
&deps,
|
||||
configs.contains("dep_existing_only"),
|
||||
true /* checkCommandAvailability */);
|
||||
}
|
||||
for (int i = 0; i < deps.count(); ++i)
|
||||
deps[i] = Option::fixPathToTargetOS(
|
||||
|
@ -1575,12 +1575,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
|
||||
if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
|
||||
continue;
|
||||
|
||||
QString tmp_out = project->first(outputs.first().toKey()).toQString();
|
||||
QString tmp_out;
|
||||
if (!outputs.isEmpty())
|
||||
tmp_out = project->first(outputs.first().toKey()).toQString();
|
||||
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
|
||||
// Combined output, only one file result
|
||||
extraCompile.addFile(Option::fixPathToTargetOS(
|
||||
replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false));
|
||||
} else {
|
||||
} else if (!inputVars.isEmpty()) {
|
||||
// One output file per input
|
||||
const ProStringList &tmp_in = project->values(inputVars.first().toKey());
|
||||
for (int i = 0; i < tmp_in.count(); ++i) {
|
||||
|
@ -68,6 +68,8 @@ public:
|
||||
bool usePCH;
|
||||
VCProjectWriter *projectWriter;
|
||||
|
||||
using Win32MakefileGenerator::callExtraCompilerDependCommand;
|
||||
|
||||
protected:
|
||||
virtual VCProjectWriter *createProjectWriter();
|
||||
bool doDepends() const override { return false; } // Never necessary
|
||||
|
1
src/3rdparty/.gitattributes
vendored
1
src/3rdparty/.gitattributes
vendored
@ -1,3 +1,4 @@
|
||||
gradle/gradlew eol=lf
|
||||
libpng/projects/cbuilder5/libpng.bpf -crlf
|
||||
libpng/projects/cbuilder5/libpng.bpg -crlf
|
||||
libpng/projects/cbuilder5/libpng.bpr -crlf
|
||||
|
2
src/3rdparty/_clang-format
vendored
Normal file
2
src/3rdparty/_clang-format
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Ignore formatting of third party code.
|
||||
DisableFormat: true
|
@ -11,16 +11,22 @@ Changes:
|
||||
- remove the locale_t parameter and use ascii_isspace instead of isspace_l
|
||||
- fix compilation with -Wcast-qual (requires C++)
|
||||
|
||||
---
|
||||
src/3rdparty/freebsd/strtoll.c | 27 ++++-----------------------
|
||||
src/3rdparty/freebsd/strtoull.c | 27 ++++-----------------------
|
||||
2 files changed, 8 insertions(+), 46 deletions(-)
|
||||
src/3rdparty/freebsd/strtoll.c | 27 +++------------------------
|
||||
src/3rdparty/freebsd/strtoull.c | 27 +++------------------------
|
||||
2 files changed, 6 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/freebsd/strtoll.c b/src/3rdparty/freebsd/strtoll.c
|
||||
index 16a8196..7b4505e 100644
|
||||
index c87aefb1cd..89da83425d 100644
|
||||
--- a/src/3rdparty/freebsd/strtoll.c
|
||||
+++ b/src/3rdparty/freebsd/strtoll.c
|
||||
@@ -32,18 +32,6 @@
|
||||
@@ -1,6 +1,4 @@
|
||||
/*-
|
||||
- * SPDX-License-Identifier: BSD-3-Clause
|
||||
- *
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@@ -34,18 +32,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
@ -39,7 +45,7 @@ index 16a8196..7b4505e 100644
|
||||
/*
|
||||
* Convert a string to a long long integer.
|
||||
*
|
||||
@@ -51,15 +39,13 @@ __FBSDID("$FreeBSD$");
|
||||
@@ -53,15 +39,13 @@ __FBSDID("$FreeBSD$");
|
||||
* alphabets and digits are each contiguous.
|
||||
*/
|
||||
long long
|
||||
@ -56,7 +62,7 @@ index 16a8196..7b4505e 100644
|
||||
|
||||
/*
|
||||
* Skip white space and pick up leading +/- sign if any.
|
||||
@@ -69,7 +55,7 @@ strtoll_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
@@ -71,7 +55,7 @@ strtoll_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
s = nptr;
|
||||
do {
|
||||
c = *s++;
|
||||
@ -65,12 +71,9 @@ index 16a8196..7b4505e 100644
|
||||
if (c == '-') {
|
||||
neg = 1;
|
||||
c = *s++;
|
||||
@@ -141,13 +127,8 @@ strtoll_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
noconv:
|
||||
errno = EINVAL;
|
||||
@@ -145,11 +129,6 @@ noconv:
|
||||
} else if (neg)
|
||||
- acc = -acc;
|
||||
+ acc = (unsigned long long) -(long long)acc;
|
||||
acc = -acc;
|
||||
if (endptr != NULL)
|
||||
- *endptr = (char *)(any ? s - 1 : nptr);
|
||||
+ *endptr = const_cast<char *>(any ? s - 1 : nptr);
|
||||
@ -82,10 +85,17 @@ index 16a8196..7b4505e 100644
|
||||
- return strtoll_l(nptr, endptr, base, __get_locale());
|
||||
-}
|
||||
diff --git a/src/3rdparty/freebsd/strtoull.c b/src/3rdparty/freebsd/strtoull.c
|
||||
index dc40e0e..1eb9257 100644
|
||||
index 58a9b23b56..cf151691ad 100644
|
||||
--- a/src/3rdparty/freebsd/strtoull.c
|
||||
+++ b/src/3rdparty/freebsd/strtoull.c
|
||||
@@ -32,18 +32,6 @@
|
||||
@@ -1,6 +1,4 @@
|
||||
/*-
|
||||
- * SPDX-License-Identifier: BSD-3-Clause
|
||||
- *
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@@ -34,18 +32,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
@ -104,7 +114,7 @@ index dc40e0e..1eb9257 100644
|
||||
/*
|
||||
* Convert a string to an unsigned long long integer.
|
||||
*
|
||||
@@ -51,15 +39,13 @@ __FBSDID("$FreeBSD$");
|
||||
@@ -53,15 +39,13 @@ __FBSDID("$FreeBSD$");
|
||||
* alphabets and digits are each contiguous.
|
||||
*/
|
||||
unsigned long long
|
||||
@ -121,7 +131,7 @@ index dc40e0e..1eb9257 100644
|
||||
|
||||
/*
|
||||
* See strtoq for comments as to the logic used.
|
||||
@@ -67,7 +53,7 @@ strtoull_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
@@ -69,7 +53,7 @@ strtoull_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
s = nptr;
|
||||
do {
|
||||
c = *s++;
|
||||
@ -130,12 +140,9 @@ index dc40e0e..1eb9257 100644
|
||||
if (c == '-') {
|
||||
neg = 1;
|
||||
c = *s++;
|
||||
@@ -119,13 +105,8 @@ strtoull_l(const char * __restrict nptr, char ** __restrict endptr, int base,
|
||||
noconv:
|
||||
errno = EINVAL;
|
||||
@@ -123,11 +107,6 @@ noconv:
|
||||
} else if (neg)
|
||||
- acc = -acc;
|
||||
+ acc = (unsigned long long) -(long long)acc;
|
||||
acc = -acc;
|
||||
if (endptr != NULL)
|
||||
- *endptr = (char *)(any ? s - 1 : nptr);
|
||||
+ *endptr = const_cast<char *>(any ? s - 1 : nptr);
|
||||
@ -147,5 +154,5 @@ index dc40e0e..1eb9257 100644
|
||||
- return strtoull_l(nptr, endptr, base, __get_locale());
|
||||
-}
|
||||
--
|
||||
2.1.4
|
||||
2.25.1
|
||||
|
||||
|
2
src/3rdparty/freebsd/strtoll.c
vendored
2
src/3rdparty/freebsd/strtoll.c
vendored
@ -127,7 +127,7 @@ qt_strtoll(const char * nptr, char **endptr, int base)
|
||||
noconv:
|
||||
errno = EINVAL;
|
||||
} else if (neg)
|
||||
acc = (unsigned long long) -(long long)acc;
|
||||
acc = -acc;
|
||||
if (endptr != NULL)
|
||||
*endptr = const_cast<char *>(any ? s - 1 : nptr);
|
||||
return (acc);
|
||||
|
2
src/3rdparty/freebsd/strtoull.c
vendored
2
src/3rdparty/freebsd/strtoull.c
vendored
@ -105,7 +105,7 @@ qt_strtoull(const char * nptr, char **endptr, int base)
|
||||
noconv:
|
||||
errno = EINVAL;
|
||||
} else if (neg)
|
||||
acc = (unsigned long long) -(long long)acc;
|
||||
acc = -acc;
|
||||
if (endptr != NULL)
|
||||
*endptr = const_cast<char *>(any ? s - 1 : nptr);
|
||||
return (acc);
|
||||
|
1
src/3rdparty/libjpeg.pri
vendored
1
src/3rdparty/libjpeg.pri
vendored
@ -5,7 +5,6 @@ gcc: QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main
|
||||
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$PWD/libjpeg \
|
||||
$$PWD/libjpeg/src
|
||||
|
||||
SOURCES += \
|
||||
|
29
src/3rdparty/libjpeg/LICENSE
vendored
29
src/3rdparty/libjpeg/LICENSE
vendored
@ -14,7 +14,7 @@ libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
||||
This license covers the TurboJPEG API library and associated programs, as
|
||||
well as the build system.
|
||||
|
||||
- The zlib License, which is listed below
|
||||
- The [zlib License](https://opensource.org/licenses/Zlib)
|
||||
|
||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||
SIMD extensions.
|
||||
@ -66,7 +66,7 @@ best of our understanding.
|
||||
|
||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||
your product documentation must include the text of the Modified BSD
|
||||
License.
|
||||
License (see below.)
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the Modified BSD License
|
||||
@ -91,7 +91,8 @@ best of our understanding.
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)\<YEAR\> \<AUTHOR\>. All Rights Reserved.
|
||||
Copyright (C)2009-2021 D. R. Commander. All Rights Reserved.<br>
|
||||
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
@ -118,28 +119,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
The zlib License
|
||||
================
|
||||
|
||||
Copyright (C) \<YEAR\>, \<AUTHOR\>.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
Why Three Licenses?
|
||||
===================
|
||||
|
||||
|
34
src/3rdparty/libjpeg/ijg-license.txt
vendored
Normal file
34
src/3rdparty/libjpeg/ijg-license.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
software (or portions thereof) for any purpose, without fee, subject to these
|
||||
conditions:
|
||||
(1) If any part of the source code for this software is distributed, then this
|
||||
README file must be included, with this copyright and no-warranty notice
|
||||
unaltered; and any additions, deletions, or changes to the original files
|
||||
must be clearly indicated in accompanying documentation.
|
||||
(2) If only executable code is distributed, then the accompanying
|
||||
documentation must state that "this software is based in part on the work of
|
||||
the Independent JPEG Group".
|
||||
(3) Permission for use of this software is granted only if the user accepts
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
These conditions apply to any software derived from or based on the IJG code,
|
||||
not just to the unmodified library. If you use our work, you ought to
|
||||
acknowledge us.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
software".
|
||||
|
||||
We specifically permit and encourage the use of this software as the basis of
|
||||
commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
@ -126,6 +126,7 @@ FILES="
|
||||
jdmaster.c
|
||||
jdmaster.h
|
||||
jdmerge.c
|
||||
jdmerge.h
|
||||
jdmrgext.c
|
||||
jdmrg565.c
|
||||
jdpostct.c
|
||||
@ -164,4 +165,4 @@ for i in $FILES; do
|
||||
copy_file "$i" "src/$i"
|
||||
done
|
||||
|
||||
echo Done. $TARGET_DIR/jconfig.h and jconfigint.h may need manual updating.
|
||||
echo Done. $TARGET_DIR/src/jconfig.h and jconfigint.h may need manual updating.
|
||||
|
23
src/3rdparty/libjpeg/jconfig.h
vendored
23
src/3rdparty/libjpeg/jconfig.h
vendored
@ -1,23 +0,0 @@
|
||||
// Definitions for building in Qt source, ref. src/jconfig.h.in
|
||||
|
||||
#define JPEG_LIB_VERSION 80
|
||||
|
||||
#define LIBJPEG_TURBO_VERSION 2.0.0
|
||||
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER 2000000
|
||||
|
||||
#define C_ARITH_CODING_SUPPORTED
|
||||
|
||||
#define D_ARITH_CODING_SUPPORTED
|
||||
|
||||
#define MEM_SRCDST_SUPPORTED
|
||||
|
||||
#define BITS_IN_JSAMPLE 8
|
||||
|
||||
#define HAVE_STDDEF_H
|
||||
|
||||
#define HAVE_STDLIB_H
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
|
||||
#define HAVE_UNSIGNED_SHORT
|
21
src/3rdparty/libjpeg/qt_attribution.json
vendored
21
src/3rdparty/libjpeg/qt_attribution.json
vendored
@ -6,19 +6,20 @@
|
||||
|
||||
"Description": "The Independent JPEG Group's JPEG software",
|
||||
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
|
||||
"Version": "2.0.0",
|
||||
"License": "Independent JPEG Group License",
|
||||
"LicenseId": "IJG",
|
||||
"LicenseFile": "LICENSE",
|
||||
"Copyright": "Copyright (C) 2009-2018 D. R. Commander
|
||||
Copyright (C) 2011-2016 Siarhei Siamashka
|
||||
"Version": "2.1.1",
|
||||
"License": "Independent JPEG Group License and BSD 3-Clause \"New\" or \"Revised\" License and zlib License",
|
||||
"LicenseId": "IJG AND BSD-3-Clause AND Zlib",
|
||||
"LicenseFiles": [ "LICENSE", "ijg-license.txt", "zlib-license.txt"],
|
||||
"Copyright": "Copyright (C) 2009-2021 D. R. Commander
|
||||
Copyright (C) 2015, 2020 Google, Inc.
|
||||
Copyright (C) 2019 Arm Limited
|
||||
Copyright (C) 2015-2016, 2018 Matthieu Darbois
|
||||
Copyright (C) 2011-2016 Siarhei Siamashka
|
||||
Copyright (C) 2015 Intel Corporation
|
||||
Copyright (C) 2015 Google, Inc.
|
||||
Copyright (C) 2013-2014 Linaro Limited
|
||||
Copyright (C) 2013-2014 MIPS Technologies, Inc.
|
||||
Copyright (C) 2013 Linaro Limited
|
||||
Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB
|
||||
Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)
|
||||
Copyright (C) 2009 Pierre Ossman for Cendio AB
|
||||
Copyright (C) 1999-2006 MIYASAKA Masaru
|
||||
Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
|
||||
Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding"
|
||||
}
|
||||
|
528
src/3rdparty/libjpeg/src/ChangeLog.md
vendored
528
src/3rdparty/libjpeg/src/ChangeLog.md
vendored
@ -1,3 +1,441 @@
|
||||
2.1.1
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.1.0
|
||||
|
||||
1. Fixed a regression introduced in 2.1.0 that caused build failures with
|
||||
non-GCC-compatible compilers for Un*x/Arm platforms.
|
||||
|
||||
2. Fixed a regression introduced by 2.1 beta1[13] that prevented the Arm 32-bit
|
||||
(AArch32) Neon SIMD extensions from building unless the C compiler flags
|
||||
included `-mfloat-abi=softfp` or `-mfloat-abi=hard`.
|
||||
|
||||
3. Fixed an issue in the AArch32 Neon SIMD Huffman encoder whereby reliance on
|
||||
undefined C compiler behavior led to crashes ("SIGBUS: illegal alignment") on
|
||||
Android systems when running AArch32/Thumb builds of libjpeg-turbo built with
|
||||
recent versions of Clang.
|
||||
|
||||
4. Added a command-line argument (`-copy icc`) to jpegtran that causes it to
|
||||
copy only the ICC profile markers from the source file and discard any other
|
||||
metadata.
|
||||
|
||||
5. libjpeg-turbo should now build and run on CHERI-enabled architectures, which
|
||||
use capability pointers that are larger than the size of `size_t`.
|
||||
|
||||
6. Fixed a regression introduced by 2.1 beta1[5] that caused a segfault in the
|
||||
64-bit SSE2 Huffman encoder when attempting to losslessly transform a
|
||||
specially-crafted malformed JPEG image.
|
||||
|
||||
|
||||
2.1.0
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.1 beta1
|
||||
|
||||
1. Fixed a regression introduced by 2.1 beta1[6(b)] whereby attempting to
|
||||
decompress certain progressive JPEG images with one or more component planes of
|
||||
width 8 or less caused a buffer overrun.
|
||||
|
||||
2. Fixed a regression introduced by 2.1 beta1[6(b)] whereby attempting to
|
||||
decompress a specially-crafted malformed progressive JPEG image caused the
|
||||
block smoothing algorithm to read from uninitialized memory.
|
||||
|
||||
3. Fixed an issue in the Arm Neon SIMD Huffman encoders that caused the
|
||||
encoders to generate incorrect results when using the Clang compiler with
|
||||
Visual Studio.
|
||||
|
||||
4. Fixed a floating point exception (CVE-2021-20205) that occurred when
|
||||
attempting to compress a specially-crafted malformed GIF image with a specified
|
||||
image width of 0 using cjpeg.
|
||||
|
||||
5. Fixed a regression introduced by 2.0 beta1[15] whereby attempting to
|
||||
generate a progressive JPEG image on an SSE2-capable CPU using a scan script
|
||||
containing one or more scans with lengths divisible by 32 and non-zero
|
||||
successive approximation low bit positions would, under certain circumstances,
|
||||
result in an error ("Missing Huffman code table entry") and an invalid JPEG
|
||||
image.
|
||||
|
||||
6. Introduced a new flag (`TJFLAG_LIMITSCANS` in the TurboJPEG C API and
|
||||
`TJ.FLAG_LIMIT_SCANS` in the TurboJPEG Java API) and a corresponding TJBench
|
||||
command-line argument (`-limitscans`) that causes the TurboJPEG decompression
|
||||
and transform functions/operations to return/throw an error if a progressive
|
||||
JPEG image contains an unreasonably large number of scans. This allows
|
||||
applications that use the TurboJPEG API to guard against an exploit of the
|
||||
progressive JPEG format described in the report
|
||||
["Two Issues with the JPEG Standard"](https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf).
|
||||
|
||||
7. The PPM reader now throws an error, rather than segfaulting (due to a buffer
|
||||
overrun) or generating incorrect pixels, if an application attempts to use the
|
||||
`tjLoadImage()` function to load a 16-bit binary PPM file (a binary PPM file
|
||||
with a maximum value greater than 255) into a grayscale image buffer or to load
|
||||
a 16-bit binary PGM file into an RGB image buffer.
|
||||
|
||||
8. Fixed an issue in the PPM reader that caused incorrect pixels to be
|
||||
generated when using the `tjLoadImage()` function to load a 16-bit binary PPM
|
||||
file into an extended RGB image buffer.
|
||||
|
||||
9. Fixed an issue whereby, if a JPEG buffer was automatically re-allocated by
|
||||
one of the TurboJPEG compression or transform functions and an error
|
||||
subsequently occurred during compression or transformation, the JPEG buffer
|
||||
pointer passed by the application was not updated when the function returned.
|
||||
|
||||
|
||||
2.0.90 (2.1 beta1)
|
||||
==================
|
||||
|
||||
### Significant changes relative to 2.0.6:
|
||||
|
||||
1. The build system, x86-64 SIMD extensions, and accelerated Huffman codec now
|
||||
support the x32 ABI on Linux, which allows for using x86-64 instructions with
|
||||
32-bit pointers. The x32 ABI is generally enabled by adding `-mx32` to the
|
||||
compiler flags.
|
||||
|
||||
Caveats:
|
||||
- CMake 3.9.0 or later is required in order for the build system to
|
||||
automatically detect an x32 build.
|
||||
- Java does not support the x32 ABI, and thus the TurboJPEG Java API will
|
||||
automatically be disabled with x32 builds.
|
||||
|
||||
2. Added Loongson MMI SIMD implementations of the RGB-to-grayscale, 4:2:2 fancy
|
||||
chroma upsampling, 4:2:2 and 4:2:0 merged chroma upsampling/color conversion,
|
||||
and fast integer DCT/IDCT algorithms. Relative to libjpeg-turbo 2.0.x, this
|
||||
speeds up:
|
||||
|
||||
- the compression of RGB source images into grayscale JPEG images by
|
||||
approximately 20%
|
||||
- the decompression of 4:2:2 JPEG images by approximately 40-60% when
|
||||
using fancy upsampling
|
||||
- the decompression of 4:2:2 and 4:2:0 JPEG images by approximately
|
||||
15-20% when using merged upsampling
|
||||
- the compression of RGB source images by approximately 30-45% when using
|
||||
the fast integer DCT
|
||||
- the decompression of JPEG images into RGB destination images by
|
||||
approximately 2x when using the fast integer IDCT
|
||||
|
||||
The overall decompression speedup for RGB images is now approximately
|
||||
2.3-3.7x (compared to 2-3.5x with libjpeg-turbo 2.0.x.)
|
||||
|
||||
3. 32-bit (Armv7 or Armv7s) iOS builds of libjpeg-turbo are no longer
|
||||
supported, and the libjpeg-turbo build system can no longer be used to package
|
||||
such builds. 32-bit iOS apps cannot run in iOS 11 and later, and the App Store
|
||||
no longer allows them.
|
||||
|
||||
4. 32-bit (i386) OS X/macOS builds of libjpeg-turbo are no longer supported,
|
||||
and the libjpeg-turbo build system can no longer be used to package such
|
||||
builds. 32-bit Mac applications cannot run in macOS 10.15 "Catalina" and
|
||||
later, and the App Store no longer allows them.
|
||||
|
||||
5. The SSE2 (x86 SIMD) and C Huffman encoding algorithms have been
|
||||
significantly optimized, resulting in a measured average overall compression
|
||||
speedup of 12-28% for 64-bit code and 22-52% for 32-bit code on various Intel
|
||||
and AMD CPUs, as well as a measured average overall compression speedup of
|
||||
0-23% on platforms that do not have a SIMD-accelerated Huffman encoding
|
||||
implementation.
|
||||
|
||||
6. The block smoothing algorithm that is applied by default when decompressing
|
||||
progressive Huffman-encoded JPEG images has been improved in the following
|
||||
ways:
|
||||
|
||||
- The algorithm is now more fault-tolerant. Previously, if a particular
|
||||
scan was incomplete, then the smoothing parameters for the incomplete scan
|
||||
would be applied to the entire output image, including the parts of the image
|
||||
that were generated by the prior (complete) scan. Visually, this had the
|
||||
effect of removing block smoothing from lower-frequency scans if they were
|
||||
followed by an incomplete higher-frequency scan. libjpeg-turbo now applies
|
||||
block smoothing parameters to each iMCU row based on which scan generated the
|
||||
pixels in that row, rather than always using the block smoothing parameters for
|
||||
the most recent scan.
|
||||
- When applying block smoothing to DC scans, a Gaussian-like kernel with a
|
||||
5x5 window is used to reduce the "blocky" appearance.
|
||||
|
||||
7. Added SIMD acceleration for progressive Huffman encoding on Arm platforms.
|
||||
This speeds up the compression of full-color progressive JPEGs by about 30-40%
|
||||
on average (relative to libjpeg-turbo 2.0.x) when using modern Arm CPUs.
|
||||
|
||||
8. Added configure-time and run-time auto-detection of Loongson MMI SIMD
|
||||
instructions, so that the Loongson MMI SIMD extensions can be included in any
|
||||
MIPS64 libjpeg-turbo build.
|
||||
|
||||
9. Added fault tolerance features to djpeg and jpegtran, mainly to demonstrate
|
||||
methods by which applications can guard against the exploits of the JPEG format
|
||||
described in the report
|
||||
["Two Issues with the JPEG Standard"](https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf).
|
||||
|
||||
- Both programs now accept a `-maxscans` argument, which can be used to
|
||||
limit the number of allowable scans in the input file.
|
||||
- Both programs now accept a `-strict` argument, which can be used to
|
||||
treat all warnings as fatal.
|
||||
|
||||
10. CMake package config files are now included for both the libjpeg and
|
||||
TurboJPEG API libraries. This facilitates using libjpeg-turbo with CMake's
|
||||
`find_package()` function. For example:
|
||||
|
||||
find_package(libjpeg-turbo CONFIG REQUIRED)
|
||||
|
||||
add_executable(libjpeg_program libjpeg_program.c)
|
||||
target_link_libraries(libjpeg_program PUBLIC libjpeg-turbo::jpeg)
|
||||
|
||||
add_executable(libjpeg_program_static libjpeg_program.c)
|
||||
target_link_libraries(libjpeg_program_static PUBLIC
|
||||
libjpeg-turbo::jpeg-static)
|
||||
|
||||
add_executable(turbojpeg_program turbojpeg_program.c)
|
||||
target_link_libraries(turbojpeg_program PUBLIC
|
||||
libjpeg-turbo::turbojpeg)
|
||||
|
||||
add_executable(turbojpeg_program_static turbojpeg_program.c)
|
||||
target_link_libraries(turbojpeg_program_static PUBLIC
|
||||
libjpeg-turbo::turbojpeg-static)
|
||||
|
||||
11. Since the Unisys LZW patent has long expired, cjpeg and djpeg can now
|
||||
read/write both LZW-compressed and uncompressed GIF files (feature ported from
|
||||
jpeg-6a and jpeg-9d.)
|
||||
|
||||
12. jpegtran now includes the `-wipe` and `-drop` options from jpeg-9a and
|
||||
jpeg-9d, as well as the ability to expand the image size using the `-crop`
|
||||
option. Refer to jpegtran.1 or usage.txt for more details.
|
||||
|
||||
13. Added a complete intrinsics implementation of the Arm Neon SIMD extensions,
|
||||
thus providing SIMD acceleration on Arm platforms for all of the algorithms
|
||||
that are SIMD-accelerated on x86 platforms. This new implementation is
|
||||
significantly faster in some cases than the old GAS implementation--
|
||||
depending on the algorithms used, the type of CPU core, and the compiler. GCC,
|
||||
as of this writing, does not provide a full or optimal set of Neon intrinsics,
|
||||
so for performance reasons, the default when building libjpeg-turbo with GCC is
|
||||
to continue using the GAS implementation of the following algorithms:
|
||||
|
||||
- 32-bit RGB-to-YCbCr color conversion
|
||||
- 32-bit fast and accurate inverse DCT
|
||||
- 64-bit RGB-to-YCbCr and YCbCr-to-RGB color conversion
|
||||
- 64-bit accurate forward and inverse DCT
|
||||
- 64-bit Huffman encoding
|
||||
|
||||
A new CMake variable (`NEON_INTRINSICS`) can be used to override this
|
||||
default.
|
||||
|
||||
Since the new intrinsics implementation includes SIMD acceleration
|
||||
for merged upsampling/color conversion, 1.5.1[5] is no longer necessary and has
|
||||
been reverted.
|
||||
|
||||
14. The Arm Neon SIMD extensions can now be built using Visual Studio.
|
||||
|
||||
15. The build system can now be used to generate a universal x86-64 + Armv8
|
||||
libjpeg-turbo SDK package for both iOS and macOS.
|
||||
|
||||
|
||||
2.0.6
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.5:
|
||||
|
||||
1. Fixed "using JNI after critical get" errors that occurred on Android
|
||||
platforms when using any of the YUV encoding/compression/decompression/decoding
|
||||
methods in the TurboJPEG Java API.
|
||||
|
||||
2. Fixed or worked around multiple issues with `jpeg_skip_scanlines()`:
|
||||
|
||||
- Fixed segfaults or "Corrupt JPEG data: premature end of data segment"
|
||||
errors in `jpeg_skip_scanlines()` that occurred when decompressing 4:2:2 or
|
||||
4:2:0 JPEG images using merged (non-fancy) upsampling/color conversion (that
|
||||
is, when setting `cinfo.do_fancy_upsampling` to `FALSE`.) 2.0.0[6] was a
|
||||
similar fix, but it did not cover all cases.
|
||||
- `jpeg_skip_scanlines()` now throws an error if two-pass color
|
||||
quantization is enabled. Two-pass color quantization never worked properly
|
||||
with `jpeg_skip_scanlines()`, and the issues could not readily be fixed.
|
||||
- Fixed an issue whereby `jpeg_skip_scanlines()` always returned 0 when
|
||||
skipping past the end of an image.
|
||||
|
||||
3. The Arm 64-bit (Armv8) Neon SIMD extensions can now be built using MinGW
|
||||
toolchains targetting Arm64 (AArch64) Windows binaries.
|
||||
|
||||
4. Fixed unexpected visual artifacts that occurred when using
|
||||
`jpeg_crop_scanline()` and interblock smoothing while decompressing only the DC
|
||||
scan of a progressive JPEG image.
|
||||
|
||||
5. Fixed an issue whereby libjpeg-turbo would not build if 12-bit-per-component
|
||||
JPEG support (`WITH_12BIT`) was enabled along with libjpeg v7 or libjpeg v8
|
||||
API/ABI emulation (`WITH_JPEG7` or `WITH_JPEG8`.)
|
||||
|
||||
|
||||
2.0.5
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.4:
|
||||
|
||||
1. Worked around issues in the MIPS DSPr2 SIMD extensions that caused failures
|
||||
in the libjpeg-turbo regression tests. Specifically, the
|
||||
`jsimd_h2v1_downsample_dspr2()` and `jsimd_h2v2_downsample_dspr2()` functions
|
||||
in the MIPS DSPr2 SIMD extensions are now disabled until/unless they can be
|
||||
fixed, and other functions that are incompatible with big endian MIPS CPUs are
|
||||
disabled when building libjpeg-turbo for such CPUs.
|
||||
|
||||
2. Fixed an oversight in the `TJCompressor.compress(int)` method in the
|
||||
TurboJPEG Java API that caused an error ("java.lang.IllegalStateException: No
|
||||
source image is associated with this instance") when attempting to use that
|
||||
method to compress a YUV image.
|
||||
|
||||
3. Fixed an issue (CVE-2020-13790) in the PPM reader that caused a buffer
|
||||
overrun in cjpeg, TJBench, or the `tjLoadImage()` function if one of the values
|
||||
in a binary PPM/PGM input file exceeded the maximum value defined in the file's
|
||||
header and that maximum value was less than 255. libjpeg-turbo 1.5.0 already
|
||||
included a similar fix for binary PPM/PGM files with maximum values greater
|
||||
than 255.
|
||||
|
||||
4. The TurboJPEG API library's global error handler, which is used in functions
|
||||
such as `tjBufSize()` and `tjLoadImage()` that do not require a TurboJPEG
|
||||
instance handle, is now thread-safe on platforms that support thread-local
|
||||
storage.
|
||||
|
||||
|
||||
2.0.4
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.3:
|
||||
|
||||
1. Fixed a regression in the Windows packaging system (introduced by
|
||||
2.0 beta1[2]) whereby, if both the 64-bit libjpeg-turbo SDK for GCC and the
|
||||
64-bit libjpeg-turbo SDK for Visual C++ were installed on the same system, only
|
||||
one of them could be uninstalled.
|
||||
|
||||
2. Fixed a signed integer overflow and subsequent segfault that occurred when
|
||||
attempting to decompress images with more than 715827882 pixels using the
|
||||
64-bit C version of TJBench.
|
||||
|
||||
3. Fixed out-of-bounds write in `tjDecompressToYUV2()` and
|
||||
`tjDecompressToYUVPlanes()` (sometimes manifesting as a double free) that
|
||||
occurred when attempting to decompress grayscale JPEG images that were
|
||||
compressed with a sampling factor other than 1 (for instance, with
|
||||
`cjpeg -grayscale -sample 2x2`).
|
||||
|
||||
4. Fixed a regression introduced by 2.0.2[5] that caused the TurboJPEG API to
|
||||
incorrectly identify some JPEG images with unusual sampling factors as 4:4:4
|
||||
JPEG images. This was known to cause a buffer overflow when attempting to
|
||||
decompress some such images using `tjDecompressToYUV2()` or
|
||||
`tjDecompressToYUVPlanes()`.
|
||||
|
||||
5. Fixed an issue (CVE-2020-17541), detected by ASan, whereby attempting to
|
||||
losslessly transform a specially-crafted malformed JPEG image containing an
|
||||
extremely-high-frequency coefficient block (junk image data that could never be
|
||||
generated by a legitimate JPEG compressor) could cause the Huffman encoder's
|
||||
local buffer to be overrun. (Refer to 1.4.0[9] and 1.4beta1[15].) Given that
|
||||
the buffer overrun was fully contained within the stack and did not cause a
|
||||
segfault or other user-visible errant behavior, and given that the lossless
|
||||
transformer (unlike the decompressor) is not generally exposed to arbitrary
|
||||
data exploits, this issue did not likely pose a security risk.
|
||||
|
||||
6. The Arm 64-bit (Armv8) Neon SIMD assembly code now stores constants in a
|
||||
separate read-only data section rather than in the text section, to support
|
||||
execute-only memory layouts.
|
||||
|
||||
|
||||
2.0.3
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.2:
|
||||
|
||||
1. Fixed "using JNI after critical get" errors that occurred on Android
|
||||
platforms when passing invalid arguments to certain methods in the TurboJPEG
|
||||
Java API.
|
||||
|
||||
2. Fixed a regression in the SIMD feature detection code, introduced by
|
||||
the AVX2 SIMD extensions (2.0 beta1[1]), that was known to cause an illegal
|
||||
instruction exception, in rare cases, on CPUs that lack support for CPUID leaf
|
||||
07H (or on which the maximum CPUID leaf has been limited by way of a BIOS
|
||||
setting.)
|
||||
|
||||
3. The 4:4:0 (h1v2) fancy (smooth) chroma upsampling algorithm in the
|
||||
decompressor now uses a similar bias pattern to that of the 4:2:2 (h2v1) fancy
|
||||
chroma upsampling algorithm, rounding up or down the upsampled result for
|
||||
alternate pixels rather than always rounding down. This ensures that,
|
||||
regardless of whether a 4:2:2 JPEG image is rotated or transposed prior to
|
||||
decompression (in the frequency domain) or after decompression (in the spatial
|
||||
domain), the final image will be similar.
|
||||
|
||||
4. Fixed an integer overflow and subsequent segfault that occurred when
|
||||
attempting to compress or decompress images with more than 1 billion pixels
|
||||
using the TurboJPEG API.
|
||||
|
||||
5. Fixed a regression introduced by 2.0 beta1[15] whereby attempting to
|
||||
generate a progressive JPEG image on an SSE2-capable CPU using a scan script
|
||||
containing one or more scans with lengths divisible by 16 would result in an
|
||||
error ("Missing Huffman code table entry") and an invalid JPEG image.
|
||||
|
||||
6. Fixed an issue whereby `tjDecodeYUV()` and `tjDecodeYUVPlanes()` would throw
|
||||
an error ("Invalid progressive parameters") or a warning ("Inconsistent
|
||||
progression sequence") if passed a TurboJPEG instance that was previously used
|
||||
to decompress a progressive JPEG image.
|
||||
|
||||
|
||||
2.0.2
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.1:
|
||||
|
||||
1. Fixed a regression introduced by 2.0.1[5] that prevented a runtime search
|
||||
path (rpath) from being embedded in the libjpeg-turbo shared libraries and
|
||||
executables for macOS and iOS. This caused a fatal error of the form
|
||||
"dyld: Library not loaded" when attempting to use one of the executables,
|
||||
unless `DYLD_LIBRARY_PATH` was explicitly set to the location of the
|
||||
libjpeg-turbo shared libraries.
|
||||
|
||||
2. Fixed an integer overflow and subsequent segfault (CVE-2018-20330) that
|
||||
occurred when attempting to load a BMP file with more than 1 billion pixels
|
||||
using the `tjLoadImage()` function.
|
||||
|
||||
3. Fixed a buffer overrun (CVE-2018-19664) that occurred when attempting to
|
||||
decompress a specially-crafted malformed JPEG image to a 256-color BMP using
|
||||
djpeg.
|
||||
|
||||
4. Fixed a floating point exception that occurred when attempting to
|
||||
decompress a specially-crafted malformed JPEG image with a specified image
|
||||
width or height of 0 using the C version of TJBench.
|
||||
|
||||
5. The TurboJPEG API will now decompress 4:4:4 JPEG images with 2x1, 1x2, 3x1,
|
||||
or 1x3 luminance and chrominance sampling factors. This is a non-standard way
|
||||
of specifying 1x subsampling (normally 4:4:4 JPEGs have 1x1 luminance and
|
||||
chrominance sampling factors), but the JPEG format and the libjpeg API both
|
||||
allow it.
|
||||
|
||||
6. Fixed a regression introduced by 2.0 beta1[7] that caused djpeg to generate
|
||||
incorrect PPM images when used with the `-colors` option.
|
||||
|
||||
7. Fixed an issue whereby a static build of libjpeg-turbo (a build in which
|
||||
`ENABLE_SHARED` is `0`) could not be installed using the Visual Studio IDE.
|
||||
|
||||
8. Fixed a severe performance issue in the Loongson MMI SIMD extensions that
|
||||
occurred when compressing RGB images whose image rows were not 64-bit-aligned.
|
||||
|
||||
|
||||
2.0.1
|
||||
=====
|
||||
|
||||
### Significant changes relative to 2.0.0:
|
||||
|
||||
1. Fixed a regression introduced with the new CMake-based Un*x build system,
|
||||
whereby jconfig.h could cause compiler warnings of the form
|
||||
`"HAVE_*_H" redefined` if it was included by downstream Autotools-based
|
||||
projects that used `AC_CHECK_HEADERS()` to check for the existence of locale.h,
|
||||
stddef.h, or stdlib.h.
|
||||
|
||||
2. The `jsimd_quantize_float_dspr2()` and `jsimd_convsamp_float_dspr2()`
|
||||
functions in the MIPS DSPr2 SIMD extensions are now disabled at compile time
|
||||
if the soft float ABI is enabled. Those functions use instructions that are
|
||||
incompatible with the soft float ABI.
|
||||
|
||||
3. Fixed a regression in the SIMD feature detection code, introduced by
|
||||
the AVX2 SIMD extensions (2.0 beta1[1]), that caused libjpeg-turbo to crash on
|
||||
Windows 7 if Service Pack 1 was not installed.
|
||||
|
||||
4. Fixed out-of-bounds read in cjpeg that occurred when attempting to compress
|
||||
a specially-crafted malformed color-index (8-bit-per-sample) Targa file in
|
||||
which some of the samples (color indices) exceeded the bounds of the Targa
|
||||
file's color table.
|
||||
|
||||
5. Fixed an issue whereby installing a fully static build of libjpeg-turbo
|
||||
(a build in which `CFLAGS` contains `-static` and `ENABLE_SHARED` is `0`) would
|
||||
fail with "No valid ELF RPATH or RUNPATH entry exists in the file."
|
||||
|
||||
|
||||
2.0.0
|
||||
=====
|
||||
|
||||
@ -30,10 +468,11 @@ would produce a "Bogus message code" error message if the underlying bitmap and
|
||||
PPM readers/writers threw an error that was specific to the readers/writers
|
||||
(as opposed to a general libjpeg API error.)
|
||||
|
||||
4. Fixed an issue whereby a specially-crafted malformed BMP file, one in which
|
||||
the header specified an image width of 1073741824 pixels, would trigger a
|
||||
floating point exception (division by zero) in the `tjLoadImage()` function
|
||||
when attempting to load the BMP file into a 4-component image buffer.
|
||||
4. Fixed an issue (CVE-2018-1152) whereby a specially-crafted malformed BMP
|
||||
file, one in which the header specified an image width of 1073741824 pixels,
|
||||
would trigger a floating point exception (division by zero) in the
|
||||
`tjLoadImage()` function when attempting to load the BMP file into a
|
||||
4-component image buffer.
|
||||
|
||||
5. Fixed an issue whereby certain combinations of calls to
|
||||
`jpeg_skip_scanlines()` and `jpeg_read_scanlines()` could trigger an infinite
|
||||
@ -47,10 +486,10 @@ a 4:2:2 or 4:2:0 JPEG image using the merged (non-fancy) upsampling algorithms
|
||||
7. The new CMake-based build system will now disable the MIPS DSPr2 SIMD
|
||||
extensions if it detects that the compiler does not support DSPr2 instructions.
|
||||
|
||||
8. Fixed out-of-bounds read in cjpeg that occurred when attempting to compress
|
||||
a specially-crafted malformed color-index (8-bit-per-sample) BMP file in which
|
||||
some of the samples (color indices) exceeded the bounds of the BMP file's color
|
||||
table.
|
||||
8. Fixed out-of-bounds read in cjpeg (CVE-2018-14498) that occurred when
|
||||
attempting to compress a specially-crafted malformed color-index
|
||||
(8-bit-per-sample) BMP file in which some of the samples (color indices)
|
||||
exceeded the bounds of the BMP file's color table.
|
||||
|
||||
9. Fixed a signed integer overflow in the progressive Huffman decoder, detected
|
||||
by the Clang and GCC undefined behavior sanitizers, that could be triggered by
|
||||
@ -66,7 +505,7 @@ detect actual security issues, should they arise in the future.
|
||||
|
||||
1. Added AVX2 SIMD implementations of the colorspace conversion, chroma
|
||||
downsampling and upsampling, integer quantization and sample conversion, and
|
||||
slow integer DCT/IDCT algorithms. When using the slow integer DCT/IDCT
|
||||
accurate integer DCT/IDCT algorithms. When using the accurate integer DCT/IDCT
|
||||
algorithms on AVX2-equipped CPUs, the compression of RGB images is
|
||||
approximately 13-36% (avg. 22%) faster (relative to libjpeg-turbo 1.5.x) with
|
||||
64-bit code and 11-21% (avg. 17%) faster with 32-bit code, and the
|
||||
@ -170,16 +609,16 @@ algorithm that caused incorrect dithering in the output image. This algorithm
|
||||
now produces bitwise-identical results to the unmerged algorithms.
|
||||
|
||||
12. The SIMD function symbols for x86[-64]/ELF, MIPS/ELF, macOS/x86[-64] (if
|
||||
libjpeg-turbo is built with YASM), and iOS/ARM[64] builds are now private.
|
||||
libjpeg-turbo is built with YASM), and iOS/Arm[64] builds are now private.
|
||||
This prevents those symbols from being exposed in applications or shared
|
||||
libraries that link statically with libjpeg-turbo.
|
||||
|
||||
13. Added Loongson MMI SIMD implementations of the RGB-to-YCbCr and
|
||||
YCbCr-to-RGB colorspace conversion, 4:2:0 chroma downsampling, 4:2:0 fancy
|
||||
chroma upsampling, integer quantization, and slow integer DCT/IDCT algorithms.
|
||||
When using the slow integer DCT/IDCT, this speeds up the compression of RGB
|
||||
images by approximately 70-100% and the decompression of RGB images by
|
||||
approximately 2-3.5x.
|
||||
chroma upsampling, integer quantization, and accurate integer DCT/IDCT
|
||||
algorithms. When using the accurate integer DCT/IDCT, this speeds up the
|
||||
compression of RGB images by approximately 70-100% and the decompression of RGB
|
||||
images by approximately 2-3.5x.
|
||||
|
||||
14. Fixed a build error when building with older MinGW releases (regression
|
||||
caused by 1.5.1[7].)
|
||||
@ -210,8 +649,8 @@ write scanlines in bottom-up order.) djpeg will now exit gracefully if an
|
||||
output format other than PPM/PGM, GIF, or Targa is selected along with the
|
||||
`-crop` option.
|
||||
|
||||
4. Fixed an issue whereby `jpeg_skip_scanlines()` would segfault if color
|
||||
quantization was enabled.
|
||||
4. Fixed an issue (CVE-2017-15232) whereby `jpeg_skip_scanlines()` would
|
||||
segfault if color quantization was enabled.
|
||||
|
||||
5. TJBench (both C and Java versions) will now display usage information if any
|
||||
command-line argument is unrecognized. This prevents the program from silently
|
||||
@ -229,9 +668,9 @@ end of a single-scan (non-progressive) image, subsequent calls to
|
||||
`jpeg_consume_input()` would return `JPEG_SUSPENDED` rather than
|
||||
`JPEG_REACHED_EOI`.
|
||||
|
||||
9. `jpeg_crop_scanlines()` now works correctly when decompressing grayscale
|
||||
JPEG images that were compressed with a sampling factor other than 1 (for
|
||||
instance, with `cjpeg -grayscale -sample 2x2`).
|
||||
9. `jpeg_crop_scanline()` now works correctly when decompressing grayscale JPEG
|
||||
images that were compressed with a sampling factor other than 1 (for instance,
|
||||
with `cjpeg -grayscale -sample 2x2`).
|
||||
|
||||
|
||||
1.5.2
|
||||
@ -255,7 +694,7 @@ on PowerPC-based AmigaOS 4 and OpenBSD systems.
|
||||
5. Fixed build and runtime errors on Windows that occurred when building
|
||||
libjpeg-turbo with libjpeg v7 API/ABI emulation and the in-memory
|
||||
source/destination managers. Due to an oversight, the `jpeg_skip_scanlines()`
|
||||
and `jpeg_crop_scanlines()` functions were not being included in jpeg7.dll when
|
||||
and `jpeg_crop_scanline()` functions were not being included in jpeg7.dll when
|
||||
libjpeg-turbo was built with `-DWITH_JPEG7=1` and `-DWITH_MEMSRCDST=1`.
|
||||
|
||||
6. Fixed "Bogus virtual array access" error that occurred when using the
|
||||
@ -412,10 +851,10 @@ application was linked against.
|
||||
|
||||
3. Fixed a couple of issues in the PPM reader that would cause buffer overruns
|
||||
in cjpeg if one of the values in a binary PPM/PGM input file exceeded the
|
||||
maximum value defined in the file's header. libjpeg-turbo 1.4.2 already
|
||||
included a similar fix for ASCII PPM/PGM files. Note that these issues were
|
||||
not security bugs, since they were confined to the cjpeg program and did not
|
||||
affect any of the libjpeg-turbo libraries.
|
||||
maximum value defined in the file's header and that maximum value was greater
|
||||
than 255. libjpeg-turbo 1.4.2 already included a similar fix for ASCII PPM/PGM
|
||||
files. Note that these issues were not security bugs, since they were confined
|
||||
to the cjpeg program and did not affect any of the libjpeg-turbo libraries.
|
||||
|
||||
4. Fixed an issue whereby attempting to decompress a JPEG file with a corrupt
|
||||
header using the `tjDecompressToYUV2()` function would cause the function to
|
||||
@ -511,8 +950,8 @@ benchmarking or regression testing, SIMD-accelerated Huffman encoding can be
|
||||
disabled by setting the `JSIMD_NOHUFFENC` environment variable to `1`.
|
||||
|
||||
13. Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used
|
||||
compression algorithms (including the slow integer forward DCT and h2v2 & h2v1
|
||||
downsampling algorithms, which are not accelerated in the 32-bit NEON
|
||||
compression algorithms (including the accurate integer forward DCT and h2v2 &
|
||||
h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON
|
||||
implementation.) This speeds up the compression of full-color JPEGs by about
|
||||
75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on
|
||||
Cortex-A53 and Cortex-A57 cores.
|
||||
@ -643,8 +1082,8 @@ platforms other than Windows or Linux. Oops.
|
||||
|
||||
7. Fixed an extremely rare bug in the Huffman encoder that caused 64-bit
|
||||
builds of libjpeg-turbo to incorrectly encode a few specific test images when
|
||||
quality=98, an optimized Huffman table, and the slow integer forward DCT were
|
||||
used.
|
||||
quality=98, an optimized Huffman table, and the accurate integer forward DCT
|
||||
were used.
|
||||
|
||||
8. The Windows (CMake) build system now supports building only static or only
|
||||
shared libraries. This is accomplished by adding either `-DENABLE_STATIC=0` or
|
||||
@ -803,8 +1242,8 @@ floating point inverse DCT (using code borrowed from libjpeg v8a and later.)
|
||||
The accuracy of this implementation now matches the accuracy of the SSE/SSE2
|
||||
implementation. Note, however, that the floating point DCT/IDCT algorithms are
|
||||
mainly a legacy feature. They generally do not produce significantly better
|
||||
accuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit
|
||||
slower.
|
||||
accuracy than the accurate integer DCT/IDCT algorithms, and they are quite a
|
||||
bit slower.
|
||||
|
||||
8. Added a new output colorspace (`JCS_RGB565`) to the libjpeg API that allows
|
||||
for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not
|
||||
@ -838,13 +1277,13 @@ and IDCT algorithms (both are used during JPEG decompression.) For unknown
|
||||
reasons (probably related to clang), this code cannot currently be compiled for
|
||||
iOS.
|
||||
|
||||
15. Fixed an extremely rare bug that could cause the Huffman encoder's local
|
||||
buffer to overrun when a very high-frequency MCU is compressed using quality
|
||||
100 and no subsampling, and when the JPEG output buffer is being dynamically
|
||||
resized by the destination manager. This issue was so rare that, even with a
|
||||
test program specifically designed to make the bug occur (by injecting random
|
||||
high-frequency YUV data into the compressor), it was reproducible only once in
|
||||
about every 25 million iterations.
|
||||
15. Fixed an extremely rare bug (CVE-2014-9092) that could cause the Huffman
|
||||
encoder's local buffer to overrun when a very high-frequency MCU is compressed
|
||||
using quality 100 and no subsampling, and when the JPEG output buffer is being
|
||||
dynamically resized by the destination manager. This issue was so rare that,
|
||||
even with a test program specifically designed to make the bug occur (by
|
||||
injecting random high-frequency YUV data into the compressor), it was
|
||||
reproducible only once in about every 25 million iterations.
|
||||
|
||||
16. Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG
|
||||
compression functions was called repeatedly with the same
|
||||
@ -879,8 +1318,9 @@ entropy coding (by passing arguments of `-progressive -arithmetic` to cjpeg or
|
||||
jpegtran, for instance) would result in an error, `Requested feature was
|
||||
omitted at compile time`.
|
||||
|
||||
4. Fixed a couple of issues whereby malformed JPEG images would cause
|
||||
libjpeg-turbo to use uninitialized memory during decompression.
|
||||
4. Fixed a couple of issues (CVE-2013-6629 and CVE-2013-6630) whereby malformed
|
||||
JPEG images would cause libjpeg-turbo to use uninitialized memory during
|
||||
decompression.
|
||||
|
||||
5. Fixed an error (`Buffer passed to JPEG library is too small`) that occurred
|
||||
when calling the TurboJPEG YUV encoding function with a very small (< 5x5)
|
||||
@ -1019,9 +1459,9 @@ correct behavior of the colorspace extensions when merged upsampling is used.
|
||||
upper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64
|
||||
calling conventions.
|
||||
|
||||
4. Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG
|
||||
images (specifically, images in which the component count was erroneously set
|
||||
to a large value) would cause libjpeg-turbo to segfault.
|
||||
4. Fixed a regression (CVE-2012-2806) caused by 1.2.0[6] whereby decompressing
|
||||
corrupt JPEG images (specifically, images in which the component count was
|
||||
erroneously set to a large value) would cause libjpeg-turbo to segfault.
|
||||
|
||||
5. Worked around a severe performance issue with "Bobcat" (AMD Embedded APU)
|
||||
processors. The `MASKMOVDQU` instruction, which was used by the libjpeg-turbo
|
||||
@ -1213,8 +1653,8 @@ cases.
|
||||
|
||||
2. Despite the above, the fast integer forward DCT still degrades somewhat for
|
||||
JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
|
||||
use the slow integer forward DCT when generating JPEG images of quality 96 or
|
||||
greater. This reduces compression performance by as much as 15% for these
|
||||
use the accurate integer forward DCT when generating JPEG images of quality 96
|
||||
or greater. This reduces compression performance by as much as 15% for these
|
||||
high-quality images but is necessary to ensure that the images are perceptually
|
||||
lossless. It also ensures that the library can avoid the performance pitfall
|
||||
created by [1].
|
||||
|
37
src/3rdparty/libjpeg/src/README.ijg
vendored
37
src/3rdparty/libjpeg/src/README.ijg
vendored
@ -128,7 +128,7 @@ with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
@ -159,19 +159,6 @@ commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
The IJG distribution formerly included code to read and write GIF files.
|
||||
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
||||
support has been removed altogether, and the GIF writer has been simplified
|
||||
to produce "uncompressed GIFs". This technique does not use the LZW
|
||||
algorithm; the resulting GIF files are larger than usual, but are readable
|
||||
by all standard GIF decoders.
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of
|
||||
CompuServe Incorporated."
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
@ -223,12 +210,12 @@ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
|
||||
A PDF file of the older JFIF 1.02 specification is available at
|
||||
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
|
||||
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
|
||||
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
|
||||
(Compression tag 7). Copies of this Note can be obtained from
|
||||
The TIFF 6.0 file format specification can be obtained from
|
||||
http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
|
||||
scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
|
||||
problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
|
||||
tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
|
||||
#2 (Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
@ -243,14 +230,8 @@ The most recent released version can always be found there in
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
|
||||
and other news.answers archive sites, including the official news.answers
|
||||
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
|
||||
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
|
||||
with body
|
||||
send usenet/news.answers/jpeg-faq/part1
|
||||
send usenet/news.answers/jpeg-faq/part2
|
||||
general information about JPEG. It is available at
|
||||
http://www.faqs.org/faqs/jpeg-faq.
|
||||
|
||||
|
||||
FILE FORMAT COMPATIBILITY
|
||||
|
81
src/3rdparty/libjpeg/src/README.md
vendored
81
src/3rdparty/libjpeg/src/README.md
vendored
@ -1,14 +1,14 @@
|
||||
Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
|
||||
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
|
||||
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
|
||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
||||
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
|
||||
baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and
|
||||
MIPS systems, as well as progressive JPEG compression on x86, x86-64, and Arm
|
||||
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
|
||||
all else being equal. On other types of systems, libjpeg-turbo can still
|
||||
outperform libjpeg by a significant amount, by virtue of its highly-optimized
|
||||
Huffman coding routines. In many cases, the performance of libjpeg-turbo
|
||||
rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
@ -135,25 +135,24 @@ without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (see below.)
|
||||
|
||||
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
|
||||
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
|
||||
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
|
||||
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
|
||||
The following section describes which libjpeg v7+ features are supported and
|
||||
which aren't.
|
||||
By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
|
||||
can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
|
||||
that programs that are built against libjpeg v7 or v8 can be run with
|
||||
libjpeg-turbo. The following section describes which libjpeg v7+ features are
|
||||
supported and which aren't.
|
||||
|
||||
### Support for libjpeg v7 and v8 Features
|
||||
|
||||
#### Fully supported
|
||||
|
||||
- **libjpeg: IDCT scaling extensions in decompressor**<br>
|
||||
- **libjpeg API: IDCT scaling extensions in decompressor**<br>
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
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
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
- **libjpeg: Arithmetic coding**
|
||||
- **libjpeg API: Arithmetic coding**
|
||||
|
||||
- **libjpeg: In-memory source and destination managers**<br>
|
||||
- **libjpeg API: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
@ -180,19 +179,19 @@ which aren't.
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
|
||||
means of quality improvement. Readers are invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg: DCT scaling in compressor**<br>
|
||||
- **libjpeg API: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
- **libjpeg: SmartScale**<br>
|
||||
- **libjpeg API: SmartScale**<br>
|
||||
`cinfo.block_size` is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
@ -205,7 +204,7 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
||||
- **libjpeg API: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
@ -247,15 +246,14 @@ don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
|
||||
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
|
||||
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
|
||||
building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||
libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
|
||||
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
@ -289,12 +287,13 @@ following reasons:
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
point IDCT in line with the accuracy of the accurate integer IDCT. The
|
||||
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
|
||||
not produce significantly more accuracy than the accurate integer algorithms
|
||||
(to put numbers on this, the typical difference in PNSR between the two
|
||||
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
|
||||
the upper range of the quality scale is typically more like a 1.0 dB
|
||||
difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
@ -331,7 +330,7 @@ in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
||||
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
@ -342,5 +341,17 @@ The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
It is therefore strongly advised that you use the accurate integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
|
||||
|
||||
Memory Debugger Pitfalls
|
||||
========================
|
||||
|
||||
Valgrind and Memory Sanitizer (MSan) can generate false positives
|
||||
(specifically, incorrect reports of uninitialized memory accesses) when used
|
||||
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
|
||||
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
|
||||
to `cmake` when configuring the build or by setting the environment variable
|
||||
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
|
||||
MSan, or other memory debuggers.
|
||||
|
31
src/3rdparty/libjpeg/src/change.log
vendored
31
src/3rdparty/libjpeg/src/change.log
vendored
@ -6,6 +6,25 @@ reference. Please see ChangeLog.md for information specific to libjpeg-turbo.
|
||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 9d 12-Jan-2020
|
||||
-----------------------
|
||||
|
||||
Restore GIF read and write support from libjpeg version 6a.
|
||||
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
|
||||
|
||||
Add jpegtran -drop option; add options to the crop extension and wipe
|
||||
to fill the extra area with content from the source image region,
|
||||
instead of gray out.
|
||||
|
||||
|
||||
Version 9c 14-Jan-2018
|
||||
-----------------------
|
||||
|
||||
jpegtran: add an option to the -wipe switch to fill the region
|
||||
with the average of adjacent blocks, instead of gray out.
|
||||
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
|
||||
|
||||
|
||||
Version 9b 17-Jan-2016
|
||||
-----------------------
|
||||
|
||||
@ -13,6 +32,13 @@ Document 'f' specifier for jpegtran -crop specification.
|
||||
Thank to Michele Martone for suggestion.
|
||||
|
||||
|
||||
Version 9a 19-Jan-2014
|
||||
-----------------------
|
||||
|
||||
Add jpegtran -wipe option and extension for -crop.
|
||||
Thank to Andrew Senior, David Clunie, and Josef Schmid for suggestion.
|
||||
|
||||
|
||||
Version 9 13-Jan-2013
|
||||
----------------------
|
||||
|
||||
@ -138,11 +164,6 @@ Huffman tables being used.
|
||||
|
||||
Huffman tables are checked for validity much more carefully than before.
|
||||
|
||||
To avoid the Unisys LZW patent, djpeg's GIF output capability has been
|
||||
changed to produce "uncompressed GIFs", and cjpeg's GIF input capability
|
||||
has been removed altogether. We're not happy about it either, but there
|
||||
seems to be no good alternative.
|
||||
|
||||
The configure script now supports building libjpeg as a shared library
|
||||
on many flavors of Unix (all the ones that GNU libtool knows how to
|
||||
build shared libraries for). Use "./configure --enable-shared" to
|
||||
|
18
src/3rdparty/libjpeg/src/jccolext.c
vendored
18
src/3rdparty/libjpeg/src/jccolext.c
vendored
@ -48,9 +48,9 @@ rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
r = inptr[RGB_RED];
|
||||
g = inptr[RGB_GREEN];
|
||||
b = inptr[RGB_BLUE];
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
@ -100,9 +100,9 @@ rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
r = inptr[RGB_RED];
|
||||
g = inptr[RGB_GREEN];
|
||||
b = inptr[RGB_BLUE];
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
@ -135,9 +135,9 @@ rgb_rgb_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);
|
||||
outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
outptr0[col] = inptr[RGB_RED];
|
||||
outptr1[col] = inptr[RGB_GREEN];
|
||||
outptr2[col] = inptr[RGB_BLUE];
|
||||
inptr += RGB_PIXELSIZE;
|
||||
}
|
||||
}
|
||||
|
12
src/3rdparty/libjpeg/src/jccolor.c
vendored
12
src/3rdparty/libjpeg/src/jccolor.c
vendored
@ -392,11 +392,11 @@ cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr3 = output_buf[3][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
|
||||
g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
|
||||
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
|
||||
r = MAXJSAMPLE - inptr[0];
|
||||
g = MAXJSAMPLE - inptr[1];
|
||||
b = MAXJSAMPLE - inptr[2];
|
||||
/* K passes through as-is */
|
||||
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
||||
outptr3[col] = inptr[3];
|
||||
inptr += 4;
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
@ -438,7 +438,7 @@ grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
|
||||
outptr[col] = inptr[0];
|
||||
inptr += instride;
|
||||
}
|
||||
}
|
||||
@ -497,7 +497,7 @@ null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
inptr = *input_buf;
|
||||
outptr = output_buf[ci][output_row];
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
|
||||
outptr[col] = inptr[ci];
|
||||
inptr += nc;
|
||||
}
|
||||
}
|
||||
|
37
src/3rdparty/libjpeg/src/jcdctmgr.c
vendored
37
src/3rdparty/libjpeg/src/jcdctmgr.c
vendored
@ -381,19 +381,19 @@ convsamp(JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
#else
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -533,20 +533,19 @@ convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
#else
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = (FAST_FLOAT)
|
||||
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
403
src/3rdparty/libjpeg/src/jchuff.c
vendored
403
src/3rdparty/libjpeg/src/jchuff.c
vendored
@ -4,8 +4,10 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2014-2016, 2018-2021, D. R. Commander.
|
||||
* Copyright (C) 2015, Matthieu Darbois.
|
||||
* Copyright (C) 2018, Matthias Räncker.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -34,23 +36,28 @@
|
||||
* memory footprint by 64k, which is important for some mobile applications
|
||||
* that create many isolated instances of libjpeg-turbo (web browsers, for
|
||||
* instance.) This may improve performance on some mobile platforms as well.
|
||||
* This feature is enabled by default only on ARM processors, because some x86
|
||||
* This feature is enabled by default only on Arm processors, because some x86
|
||||
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
|
||||
* shown to have a significant performance impact even on the x86 chips that
|
||||
* have a fast implementation of it. When building for ARMv6, you can
|
||||
* have a fast implementation of it. When building for Armv6, you can
|
||||
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#if !defined __thumb__ || defined __thumb2__
|
||||
#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \
|
||||
defined(_M_ARM) || defined(_M_ARM64)
|
||||
#if !defined(__thumb__) || defined(__thumb2__)
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_CLZ_INTRINSIC
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define JPEG_NBITS_NONZERO(x) (32 - _CountLeadingZeros(x))
|
||||
#else
|
||||
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
|
||||
#endif
|
||||
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
|
||||
#else
|
||||
#include "jpeg_nbits_table.h"
|
||||
@ -65,32 +72,43 @@
|
||||
* but must not be updated permanently until we complete the MCU.
|
||||
*/
|
||||
|
||||
#if defined(__x86_64__) && defined(__ILP32__)
|
||||
typedef unsigned long long bit_buf_type;
|
||||
#else
|
||||
typedef size_t bit_buf_type;
|
||||
#endif
|
||||
|
||||
/* NOTE: The more optimal Huffman encoding algorithm is only used by the
|
||||
* intrinsics implementation of the Arm Neon SIMD extensions, which is why we
|
||||
* retain the old Huffman encoder behavior when using the GAS implementation.
|
||||
*/
|
||||
#if defined(WITH_SIMD) && !(defined(__arm__) || defined(__aarch64__) || \
|
||||
defined(_M_ARM) || defined(_M_ARM64))
|
||||
typedef unsigned long long simd_bit_buf_type;
|
||||
#else
|
||||
typedef bit_buf_type simd_bit_buf_type;
|
||||
#endif
|
||||
|
||||
#if (defined(SIZEOF_SIZE_T) && SIZEOF_SIZE_T == 8) || defined(_WIN64) || \
|
||||
(defined(__x86_64__) && defined(__ILP32__))
|
||||
#define BIT_BUF_SIZE 64
|
||||
#elif (defined(SIZEOF_SIZE_T) && SIZEOF_SIZE_T == 4) || defined(_WIN32)
|
||||
#define BIT_BUF_SIZE 32
|
||||
#else
|
||||
#error Cannot determine word size
|
||||
#endif
|
||||
#define SIMD_BIT_BUF_SIZE (sizeof(simd_bit_buf_type) * 8)
|
||||
|
||||
typedef struct {
|
||||
size_t put_buffer; /* current bit-accumulation buffer */
|
||||
int put_bits; /* # of bits now in it */
|
||||
union {
|
||||
bit_buf_type c;
|
||||
simd_bit_buf_type simd;
|
||||
} put_buffer; /* current bit accumulation buffer */
|
||||
int free_bits; /* # of bits available in it */
|
||||
/* (Neon GAS: # of bits now in it) */
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
|
||||
/* This macro is to work around compilers with missing or broken
|
||||
* structure assignment. You'll need to fix this code if you have
|
||||
* such a compiler and you change MAX_COMPS_IN_SCAN.
|
||||
*/
|
||||
|
||||
#ifndef NO_STRUCT_ASSIGN
|
||||
#define ASSIGN_STATE(dest, src) ((dest) = (src))
|
||||
#else
|
||||
#if MAX_COMPS_IN_SCAN == 4
|
||||
#define ASSIGN_STATE(dest, src) \
|
||||
((dest).put_buffer = (src).put_buffer, \
|
||||
(dest).put_bits = (src).put_bits, \
|
||||
(dest).last_dc_val[0] = (src).last_dc_val[0], \
|
||||
(dest).last_dc_val[1] = (src).last_dc_val[1], \
|
||||
(dest).last_dc_val[2] = (src).last_dc_val[2], \
|
||||
(dest).last_dc_val[3] = (src).last_dc_val[3])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_entropy_encoder pub; /* public fields */
|
||||
|
||||
@ -123,6 +141,7 @@ typedef struct {
|
||||
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
|
||||
savable_state cur; /* Current bit buffer & DC state */
|
||||
j_compress_ptr cinfo; /* dump_buffer needs access to this */
|
||||
int simd;
|
||||
} working_state;
|
||||
|
||||
|
||||
@ -201,8 +220,17 @@ start_pass_huff(j_compress_ptr cinfo, boolean gather_statistics)
|
||||
}
|
||||
|
||||
/* Initialize bit buffer to empty */
|
||||
entropy->saved.put_buffer = 0;
|
||||
entropy->saved.put_bits = 0;
|
||||
if (entropy->simd) {
|
||||
entropy->saved.put_buffer.simd = 0;
|
||||
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
|
||||
entropy->saved.free_bits = 0;
|
||||
#else
|
||||
entropy->saved.free_bits = SIMD_BIT_BUF_SIZE;
|
||||
#endif
|
||||
} else {
|
||||
entropy->saved.put_buffer.c = 0;
|
||||
entropy->saved.free_bits = BIT_BUF_SIZE;
|
||||
}
|
||||
|
||||
/* Initialize restart stuff */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
@ -287,6 +315,7 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
* this lets us detect duplicate VAL entries here, and later
|
||||
* allows emit_bits to detect any attempt to emit such symbols.
|
||||
*/
|
||||
MEMZERO(dtbl->ehufco, sizeof(dtbl->ehufco));
|
||||
MEMZERO(dtbl->ehufsi, sizeof(dtbl->ehufsi));
|
||||
|
||||
/* This is also a convenient place to check for out-of-range
|
||||
@ -334,90 +363,94 @@ dump_buffer(working_state *state)
|
||||
|
||||
/* Outputting bits to the file */
|
||||
|
||||
/* These macros perform the same task as the emit_bits() function in the
|
||||
* original libjpeg code. In addition to reducing overhead by explicitly
|
||||
* inlining the code, additional performance is achieved by taking into
|
||||
* account the size of the bit buffer and waiting until it is almost full
|
||||
* before emptying it. This mostly benefits 64-bit platforms, since 6
|
||||
* bytes can be stored in a 64-bit bit buffer before it has to be emptied.
|
||||
/* Output byte b and, speculatively, an additional 0 byte. 0xFF must be
|
||||
* encoded as 0xFF 0x00, so the output buffer pointer is advanced by 2 if the
|
||||
* byte is 0xFF. Otherwise, the output buffer pointer is advanced by 1, and
|
||||
* the speculative 0 byte will be overwritten by the next byte.
|
||||
*/
|
||||
|
||||
#define EMIT_BYTE() { \
|
||||
JOCTET c; \
|
||||
put_bits -= 8; \
|
||||
c = (JOCTET)GETJOCTET(put_buffer >> put_bits); \
|
||||
*buffer++ = c; \
|
||||
if (c == 0xFF) /* need to stuff a zero byte? */ \
|
||||
*buffer++ = 0; \
|
||||
#define EMIT_BYTE(b) { \
|
||||
buffer[0] = (JOCTET)(b); \
|
||||
buffer[1] = 0; \
|
||||
buffer -= -2 + ((JOCTET)(b) < 0xFF); \
|
||||
}
|
||||
|
||||
#define PUT_BITS(code, size) { \
|
||||
put_bits += size; \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
/* Output the entire bit buffer. If there are no 0xFF bytes in it, then write
|
||||
* directly to the output buffer. Otherwise, use the EMIT_BYTE() macro to
|
||||
* encode 0xFF as 0xFF 0x00.
|
||||
*/
|
||||
#if BIT_BUF_SIZE == 64
|
||||
|
||||
#define CHECKBUF15() { \
|
||||
if (put_bits > 15) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
#define FLUSH() { \
|
||||
if (put_buffer & 0x8080808080808080 & ~(put_buffer + 0x0101010101010101)) { \
|
||||
EMIT_BYTE(put_buffer >> 56) \
|
||||
EMIT_BYTE(put_buffer >> 48) \
|
||||
EMIT_BYTE(put_buffer >> 40) \
|
||||
EMIT_BYTE(put_buffer >> 32) \
|
||||
EMIT_BYTE(put_buffer >> 24) \
|
||||
EMIT_BYTE(put_buffer >> 16) \
|
||||
EMIT_BYTE(put_buffer >> 8) \
|
||||
EMIT_BYTE(put_buffer ) \
|
||||
} else { \
|
||||
buffer[0] = (JOCTET)(put_buffer >> 56); \
|
||||
buffer[1] = (JOCTET)(put_buffer >> 48); \
|
||||
buffer[2] = (JOCTET)(put_buffer >> 40); \
|
||||
buffer[3] = (JOCTET)(put_buffer >> 32); \
|
||||
buffer[4] = (JOCTET)(put_buffer >> 24); \
|
||||
buffer[5] = (JOCTET)(put_buffer >> 16); \
|
||||
buffer[6] = (JOCTET)(put_buffer >> 8); \
|
||||
buffer[7] = (JOCTET)(put_buffer); \
|
||||
buffer += 8; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECKBUF31() { \
|
||||
if (put_bits > 31) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECKBUF47() { \
|
||||
if (put_bits > 47) { \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
EMIT_BYTE() \
|
||||
} \
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T)
|
||||
#error Cannot determine word size
|
||||
#endif
|
||||
|
||||
#if SIZEOF_SIZE_T == 8 || defined(_WIN64)
|
||||
|
||||
#define EMIT_BITS(code, size) { \
|
||||
CHECKBUF47() \
|
||||
PUT_BITS(code, size) \
|
||||
}
|
||||
|
||||
#define EMIT_CODE(code, size) { \
|
||||
temp2 &= (((JLONG)1) << nbits) - 1; \
|
||||
CHECKBUF31() \
|
||||
PUT_BITS(code, size) \
|
||||
PUT_BITS(temp2, nbits) \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define EMIT_BITS(code, size) { \
|
||||
PUT_BITS(code, size) \
|
||||
CHECKBUF15() \
|
||||
}
|
||||
|
||||
#define EMIT_CODE(code, size) { \
|
||||
temp2 &= (((JLONG)1) << nbits) - 1; \
|
||||
PUT_BITS(code, size) \
|
||||
CHECKBUF15() \
|
||||
PUT_BITS(temp2, nbits) \
|
||||
CHECKBUF15() \
|
||||
#define FLUSH() { \
|
||||
if (put_buffer & 0x80808080 & ~(put_buffer + 0x01010101)) { \
|
||||
EMIT_BYTE(put_buffer >> 24) \
|
||||
EMIT_BYTE(put_buffer >> 16) \
|
||||
EMIT_BYTE(put_buffer >> 8) \
|
||||
EMIT_BYTE(put_buffer ) \
|
||||
} else { \
|
||||
buffer[0] = (JOCTET)(put_buffer >> 24); \
|
||||
buffer[1] = (JOCTET)(put_buffer >> 16); \
|
||||
buffer[2] = (JOCTET)(put_buffer >> 8); \
|
||||
buffer[3] = (JOCTET)(put_buffer); \
|
||||
buffer += 4; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Fill the bit buffer to capacity with the leading bits from code, then output
|
||||
* the bit buffer and put the remaining bits from code into the bit buffer.
|
||||
*/
|
||||
#define PUT_AND_FLUSH(code, size) { \
|
||||
put_buffer = (put_buffer << (size + free_bits)) | (code >> -free_bits); \
|
||||
FLUSH() \
|
||||
free_bits += BIT_BUF_SIZE; \
|
||||
put_buffer = code; \
|
||||
}
|
||||
|
||||
/* Insert code into the bit buffer and output the bit buffer if needed.
|
||||
* NOTE: We can't flush with free_bits == 0, since the left shift in
|
||||
* PUT_AND_FLUSH() would have undefined behavior.
|
||||
*/
|
||||
#define PUT_BITS(code, size) { \
|
||||
free_bits -= size; \
|
||||
if (free_bits < 0) \
|
||||
PUT_AND_FLUSH(code, size) \
|
||||
else \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
|
||||
#define PUT_CODE(code, size) { \
|
||||
temp &= (((JLONG)1) << nbits) - 1; \
|
||||
temp |= code << nbits; \
|
||||
nbits += size; \
|
||||
PUT_BITS(temp, nbits) \
|
||||
}
|
||||
|
||||
|
||||
/* Although it is exceedingly rare, it is possible for a Huffman-encoded
|
||||
* coefficient block to be larger than the 128-byte unencoded block. For each
|
||||
@ -428,7 +461,7 @@ dump_buffer(working_state *state)
|
||||
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
|
||||
* larger than 200 bytes.
|
||||
*/
|
||||
#define BUFSIZE (DCTSIZE2 * 4)
|
||||
#define BUFSIZE (DCTSIZE2 * 8)
|
||||
|
||||
#define LOAD_BUFFER() { \
|
||||
if (state->free_in_buffer < BUFSIZE) { \
|
||||
@ -440,6 +473,7 @@ dump_buffer(working_state *state)
|
||||
|
||||
#define STORE_BUFFER() { \
|
||||
if (localbuf) { \
|
||||
size_t bytes, bytestocopy; \
|
||||
bytes = buffer - _buffer; \
|
||||
buffer = _buffer; \
|
||||
while (bytes > 0) { \
|
||||
@ -462,20 +496,46 @@ dump_buffer(working_state *state)
|
||||
LOCAL(boolean)
|
||||
flush_bits(working_state *state)
|
||||
{
|
||||
JOCTET _buffer[BUFSIZE], *buffer;
|
||||
size_t put_buffer; int put_bits;
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
JOCTET _buffer[BUFSIZE], *buffer, temp;
|
||||
simd_bit_buf_type put_buffer; int put_bits;
|
||||
int localbuf = 0;
|
||||
|
||||
if (state->simd) {
|
||||
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
|
||||
put_bits = state->cur.free_bits;
|
||||
#else
|
||||
put_bits = SIMD_BIT_BUF_SIZE - state->cur.free_bits;
|
||||
#endif
|
||||
put_buffer = state->cur.put_buffer.simd;
|
||||
} else {
|
||||
put_bits = BIT_BUF_SIZE - state->cur.free_bits;
|
||||
put_buffer = state->cur.put_buffer.c;
|
||||
}
|
||||
|
||||
put_buffer = state->cur.put_buffer;
|
||||
put_bits = state->cur.put_bits;
|
||||
LOAD_BUFFER()
|
||||
|
||||
/* fill any partial byte with ones */
|
||||
PUT_BITS(0x7F, 7)
|
||||
while (put_bits >= 8) EMIT_BYTE()
|
||||
while (put_bits >= 8) {
|
||||
put_bits -= 8;
|
||||
temp = (JOCTET)(put_buffer >> put_bits);
|
||||
EMIT_BYTE(temp)
|
||||
}
|
||||
if (put_bits) {
|
||||
/* fill partial byte with ones */
|
||||
temp = (JOCTET)((put_buffer << (8 - put_bits)) | (0xFF >> put_bits));
|
||||
EMIT_BYTE(temp)
|
||||
}
|
||||
|
||||
state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
|
||||
state->cur.put_bits = 0;
|
||||
if (state->simd) { /* and reset bit buffer to empty */
|
||||
state->cur.put_buffer.simd = 0;
|
||||
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
|
||||
state->cur.free_bits = 0;
|
||||
#else
|
||||
state->cur.free_bits = SIMD_BIT_BUF_SIZE;
|
||||
#endif
|
||||
} else {
|
||||
state->cur.put_buffer.c = 0;
|
||||
state->cur.free_bits = BIT_BUF_SIZE;
|
||||
}
|
||||
STORE_BUFFER()
|
||||
|
||||
return TRUE;
|
||||
@ -489,7 +549,7 @@ encode_one_block_simd(working_state *state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
JOCTET _buffer[BUFSIZE], *buffer;
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
int localbuf = 0;
|
||||
|
||||
LOAD_BUFFER()
|
||||
|
||||
@ -505,53 +565,41 @@ LOCAL(boolean)
|
||||
encode_one_block(working_state *state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
int temp, temp2, temp3;
|
||||
int nbits;
|
||||
int r, code, size;
|
||||
int temp, nbits, free_bits;
|
||||
bit_buf_type put_buffer;
|
||||
JOCTET _buffer[BUFSIZE], *buffer;
|
||||
size_t put_buffer; int put_bits;
|
||||
int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
int localbuf = 0;
|
||||
|
||||
put_buffer = state->cur.put_buffer;
|
||||
put_bits = state->cur.put_bits;
|
||||
free_bits = state->cur.free_bits;
|
||||
put_buffer = state->cur.put_buffer.c;
|
||||
LOAD_BUFFER()
|
||||
|
||||
/* Encode the DC coefficient difference per section F.1.2.1 */
|
||||
|
||||
temp = temp2 = block[0] - last_dc_val;
|
||||
temp = block[0] - last_dc_val;
|
||||
|
||||
/* This is a well-known technique for obtaining the absolute value without a
|
||||
* branch. It is derived from an assembly language technique presented in
|
||||
* "How to Optimize for the Pentium Processors", Copyright (c) 1996, 1997 by
|
||||
* Agner Fog.
|
||||
* Agner Fog. This code assumes we are on a two's complement machine.
|
||||
*/
|
||||
temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);
|
||||
temp ^= temp3;
|
||||
temp -= temp3;
|
||||
|
||||
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
||||
/* This code assumes we are on a two's complement machine */
|
||||
temp2 += temp3;
|
||||
nbits = temp >> (CHAR_BIT * sizeof(int) - 1);
|
||||
temp += nbits;
|
||||
nbits ^= temp;
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
nbits = JPEG_NBITS(temp);
|
||||
nbits = JPEG_NBITS(nbits);
|
||||
|
||||
/* Emit the Huffman-coded symbol for the number of bits */
|
||||
code = dctbl->ehufco[nbits];
|
||||
size = dctbl->ehufsi[nbits];
|
||||
EMIT_BITS(code, size)
|
||||
|
||||
/* Mask off any extra bits in code */
|
||||
temp2 &= (((JLONG)1) << nbits) - 1;
|
||||
|
||||
/* Emit that number of bits of the value, if positive, */
|
||||
/* or the complement of its magnitude, if negative. */
|
||||
EMIT_BITS(temp2, nbits)
|
||||
/* Emit the Huffman-coded symbol for the number of bits.
|
||||
* Emit that number of bits of the value, if positive,
|
||||
* or the complement of its magnitude, if negative.
|
||||
*/
|
||||
PUT_CODE(dctbl->ehufco[nbits], dctbl->ehufsi[nbits])
|
||||
|
||||
/* Encode the AC coefficients per section F.1.2.2 */
|
||||
|
||||
r = 0; /* r = run length of zeros */
|
||||
{
|
||||
int r = 0; /* r = run length of zeros */
|
||||
|
||||
/* Manually unroll the k loop to eliminate the counter variable. This
|
||||
* improves performance greatly on systems with a limited number of
|
||||
@ -559,51 +607,46 @@ encode_one_block(working_state *state, JCOEFPTR block, int last_dc_val,
|
||||
*/
|
||||
#define kloop(jpeg_natural_order_of_k) { \
|
||||
if ((temp = block[jpeg_natural_order_of_k]) == 0) { \
|
||||
r++; \
|
||||
r += 16; \
|
||||
} else { \
|
||||
temp2 = temp; \
|
||||
/* Branch-less absolute value, bitwise complement, etc., same as above */ \
|
||||
temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); \
|
||||
temp ^= temp3; \
|
||||
temp -= temp3; \
|
||||
temp2 += temp3; \
|
||||
nbits = JPEG_NBITS_NONZERO(temp); \
|
||||
nbits = temp >> (CHAR_BIT * sizeof(int) - 1); \
|
||||
temp += nbits; \
|
||||
nbits ^= temp; \
|
||||
nbits = JPEG_NBITS_NONZERO(nbits); \
|
||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
|
||||
while (r > 15) { \
|
||||
EMIT_BITS(code_0xf0, size_0xf0) \
|
||||
r -= 16; \
|
||||
while (r >= 16 * 16) { \
|
||||
r -= 16 * 16; \
|
||||
PUT_BITS(actbl->ehufco[0xf0], actbl->ehufsi[0xf0]) \
|
||||
} \
|
||||
/* Emit Huffman symbol for run length / number of bits */ \
|
||||
temp3 = (r << 4) + nbits; \
|
||||
code = actbl->ehufco[temp3]; \
|
||||
size = actbl->ehufsi[temp3]; \
|
||||
EMIT_CODE(code, size) \
|
||||
r += nbits; \
|
||||
PUT_CODE(actbl->ehufco[r], actbl->ehufsi[r]) \
|
||||
r = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* One iteration for each value in jpeg_natural_order[] */
|
||||
kloop(1); kloop(8); kloop(16); kloop(9); kloop(2); kloop(3);
|
||||
kloop(10); kloop(17); kloop(24); kloop(32); kloop(25); kloop(18);
|
||||
kloop(11); kloop(4); kloop(5); kloop(12); kloop(19); kloop(26);
|
||||
kloop(33); kloop(40); kloop(48); kloop(41); kloop(34); kloop(27);
|
||||
kloop(20); kloop(13); kloop(6); kloop(7); kloop(14); kloop(21);
|
||||
kloop(28); kloop(35); kloop(42); kloop(49); kloop(56); kloop(57);
|
||||
kloop(50); kloop(43); kloop(36); kloop(29); kloop(22); kloop(15);
|
||||
kloop(23); kloop(30); kloop(37); kloop(44); kloop(51); kloop(58);
|
||||
kloop(59); kloop(52); kloop(45); kloop(38); kloop(31); kloop(39);
|
||||
kloop(46); kloop(53); kloop(60); kloop(61); kloop(54); kloop(47);
|
||||
kloop(55); kloop(62); kloop(63);
|
||||
/* One iteration for each value in jpeg_natural_order[] */
|
||||
kloop(1); kloop(8); kloop(16); kloop(9); kloop(2); kloop(3);
|
||||
kloop(10); kloop(17); kloop(24); kloop(32); kloop(25); kloop(18);
|
||||
kloop(11); kloop(4); kloop(5); kloop(12); kloop(19); kloop(26);
|
||||
kloop(33); kloop(40); kloop(48); kloop(41); kloop(34); kloop(27);
|
||||
kloop(20); kloop(13); kloop(6); kloop(7); kloop(14); kloop(21);
|
||||
kloop(28); kloop(35); kloop(42); kloop(49); kloop(56); kloop(57);
|
||||
kloop(50); kloop(43); kloop(36); kloop(29); kloop(22); kloop(15);
|
||||
kloop(23); kloop(30); kloop(37); kloop(44); kloop(51); kloop(58);
|
||||
kloop(59); kloop(52); kloop(45); kloop(38); kloop(31); kloop(39);
|
||||
kloop(46); kloop(53); kloop(60); kloop(61); kloop(54); kloop(47);
|
||||
kloop(55); kloop(62); kloop(63);
|
||||
|
||||
/* If the last coef(s) were zero, emit an end-of-block code */
|
||||
if (r > 0) {
|
||||
code = actbl->ehufco[0];
|
||||
size = actbl->ehufsi[0];
|
||||
EMIT_BITS(code, size)
|
||||
/* If the last coef(s) were zero, emit an end-of-block code */
|
||||
if (r > 0) {
|
||||
PUT_BITS(actbl->ehufco[0], actbl->ehufsi[0])
|
||||
}
|
||||
}
|
||||
|
||||
state->cur.put_buffer = put_buffer;
|
||||
state->cur.put_bits = put_bits;
|
||||
state->cur.put_buffer.c = put_buffer;
|
||||
state->cur.free_bits = free_bits;
|
||||
STORE_BUFFER()
|
||||
|
||||
return TRUE;
|
||||
@ -650,8 +693,9 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Load up working state */
|
||||
state.next_output_byte = cinfo->dest->next_output_byte;
|
||||
state.free_in_buffer = cinfo->dest->free_in_buffer;
|
||||
ASSIGN_STATE(state.cur, entropy->saved);
|
||||
state.cur = entropy->saved;
|
||||
state.cinfo = cinfo;
|
||||
state.simd = entropy->simd;
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
@ -690,7 +734,7 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Completed MCU, so update state */
|
||||
cinfo->dest->next_output_byte = state.next_output_byte;
|
||||
cinfo->dest->free_in_buffer = state.free_in_buffer;
|
||||
ASSIGN_STATE(entropy->saved, state.cur);
|
||||
entropy->saved = state.cur;
|
||||
|
||||
/* Update restart-interval state too */
|
||||
if (cinfo->restart_interval) {
|
||||
@ -719,8 +763,9 @@ finish_pass_huff(j_compress_ptr cinfo)
|
||||
/* Load up working state ... flush_bits needs it */
|
||||
state.next_output_byte = cinfo->dest->next_output_byte;
|
||||
state.free_in_buffer = cinfo->dest->free_in_buffer;
|
||||
ASSIGN_STATE(state.cur, entropy->saved);
|
||||
state.cur = entropy->saved;
|
||||
state.cinfo = cinfo;
|
||||
state.simd = entropy->simd;
|
||||
|
||||
/* Flush out the last data */
|
||||
if (!flush_bits(&state))
|
||||
@ -729,7 +774,7 @@ finish_pass_huff(j_compress_ptr cinfo)
|
||||
/* Update state */
|
||||
cinfo->dest->next_output_byte = state.next_output_byte;
|
||||
cinfo->dest->free_in_buffer = state.free_in_buffer;
|
||||
ASSIGN_STATE(entropy->saved, state.cur);
|
||||
entropy->saved = state.cur;
|
||||
}
|
||||
|
||||
|
||||
|
5
src/3rdparty/libjpeg/src/jcinit.c
vendored
5
src/3rdparty/libjpeg/src/jcinit.c
vendored
@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcinit.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -19,6 +21,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/*
|
||||
|
2
src/3rdparty/libjpeg/src/jcmaster.c
vendored
2
src/3rdparty/libjpeg/src/jcmaster.c
vendored
@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
|
||||
*/
|
||||
master->pass_type = output_pass;
|
||||
master->pass_number++;
|
||||
/*FALLTHROUGH*/
|
||||
#endif
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case output_pass:
|
||||
/* Do a data-output pass. */
|
||||
/* We need not repeat per-scan setup if prior optimization pass did it. */
|
||||
|
23
src/3rdparty/libjpeg/src/jconfig.h
vendored
Normal file
23
src/3rdparty/libjpeg/src/jconfig.h
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Definitions for building in Qt source, ref. src/jconfig.h.in
|
||||
|
||||
#define JPEG_LIB_VERSION 80
|
||||
|
||||
#define LIBJPEG_TURBO_VERSION 2.1.1
|
||||
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER 2001001
|
||||
|
||||
#define C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
#define D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
#define MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
#define BITS_IN_JSAMPLE 8
|
||||
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR 1
|
||||
|
||||
#define HAVE_UNSIGNED_SHORT 1
|
31
src/3rdparty/libjpeg/src/jconfig.h.in
vendored
31
src/3rdparty/libjpeg/src/jconfig.h.in
vendored
@ -10,16 +10,16 @@
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
@ -33,38 +33,33 @@
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#cmakedefine HAVE_STDDEF_H
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you need to include <sys/types.h> to get size_t. */
|
||||
#cmakedefine NEED_SYS_TYPES_H
|
||||
#cmakedefine NEED_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
|
||||
memset/memcpy in <string.h>. */
|
||||
#cmakedefine NEED_BSD_STRINGS
|
||||
#cmakedefine NEED_BSD_STRINGS 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned char'. */
|
||||
#cmakedefine HAVE_UNSIGNED_CHAR
|
||||
#cmakedefine HAVE_UNSIGNED_CHAR 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned short'. */
|
||||
#cmakedefine HAVE_UNSIGNED_SHORT
|
||||
#cmakedefine HAVE_UNSIGNED_SHORT 1
|
||||
|
||||
/* Compiler does not support pointers to undefined structures. */
|
||||
#cmakedefine INCOMPLETE_TYPES_BROKEN
|
||||
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
|
||||
|
||||
/* Define if your (broken) compiler shifts signed values as if they were
|
||||
unsigned. */
|
||||
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#cmakedefine __CHAR_UNSIGNED__
|
||||
#endif
|
||||
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
@ -8,10 +8,12 @@
|
||||
|
||||
#define PACKAGE_NAME "libjpeg-turbo"
|
||||
|
||||
#define VERSION "2.0.0"
|
||||
#define VERSION "2.1.1"
|
||||
|
||||
#if SIZE_MAX == 0xffffffff
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#elif SIZE_MAX == 0xffffffffffffffff
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#endif
|
||||
|
||||
#define FALLTHROUGH
|
13
src/3rdparty/libjpeg/src/jconfigint.h.in
vendored
13
src/3rdparty/libjpeg/src/jconfigint.h.in
vendored
@ -7,6 +7,9 @@
|
||||
/* How to obtain function inlining. */
|
||||
#define INLINE @INLINE@
|
||||
|
||||
/* How to obtain thread-local storage */
|
||||
#define THREAD_LOCAL @THREAD_LOCAL@
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
||||
|
||||
@ -29,3 +32,13 @@
|
||||
#define HAVE_BITSCANFORWARD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__has_attribute)
|
||||
#if __has_attribute(fallthrough)
|
||||
#define FALLTHROUGH __attribute__((fallthrough));
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
35
src/3rdparty/libjpeg/src/jcphuff.c
vendored
35
src/3rdparty/libjpeg/src/jcphuff.c
vendored
@ -4,8 +4,10 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2011, 2015, 2018, D. R. Commander.
|
||||
* Copyright (C) 2011, 2015, 2018, 2021, D. R. Commander.
|
||||
* Copyright (C) 2016, 2018, Matthieu Darbois.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
* Copyright (C) 2021, Alex Richardson.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -43,23 +45,28 @@
|
||||
* memory footprint by 64k, which is important for some mobile applications
|
||||
* that create many isolated instances of libjpeg-turbo (web browsers, for
|
||||
* instance.) This may improve performance on some mobile platforms as well.
|
||||
* This feature is enabled by default only on ARM processors, because some x86
|
||||
* This feature is enabled by default only on Arm processors, because some x86
|
||||
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
|
||||
* shown to have a significant performance impact even on the x86 chips that
|
||||
* have a fast implementation of it. When building for ARMv6, you can
|
||||
* have a fast implementation of it. When building for Armv6, you can
|
||||
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#if !defined __thumb__ || defined __thumb2__
|
||||
#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \
|
||||
defined(_M_ARM) || defined(_M_ARM64)
|
||||
#if !defined(__thumb__) || defined(__thumb2__)
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_CLZ_INTRINSIC
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define JPEG_NBITS_NONZERO(x) (32 - _CountLeadingZeros(x))
|
||||
#else
|
||||
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
|
||||
#endif
|
||||
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
|
||||
#else
|
||||
#include "jpeg_nbits_table.h"
|
||||
@ -169,24 +176,26 @@ INLINE
|
||||
METHODDEF(int)
|
||||
count_zeroes(size_t *x)
|
||||
{
|
||||
int result;
|
||||
#if defined(HAVE_BUILTIN_CTZL)
|
||||
int result;
|
||||
result = __builtin_ctzl(*x);
|
||||
*x >>= result;
|
||||
#elif defined(HAVE_BITSCANFORWARD64)
|
||||
unsigned long result;
|
||||
_BitScanForward64(&result, *x);
|
||||
*x >>= result;
|
||||
#elif defined(HAVE_BITSCANFORWARD)
|
||||
unsigned long result;
|
||||
_BitScanForward(&result, *x);
|
||||
*x >>= result;
|
||||
#else
|
||||
result = 0;
|
||||
int result = 0;
|
||||
while ((*x & 1) == 0) {
|
||||
++result;
|
||||
*x >>= 1;
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
|
||||
@ -672,7 +681,7 @@ encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
emit_restart(entropy, entropy->next_restart_num);
|
||||
|
||||
#ifdef WITH_SIMD
|
||||
cvalue = values = (JCOEF *)PAD((size_t)values_unaligned, 16);
|
||||
cvalue = values = (JCOEF *)PAD((JUINTPTR)values_unaligned, 16);
|
||||
#else
|
||||
/* Not using SIMD, so alignment is not needed */
|
||||
cvalue = values = values_unaligned;
|
||||
@ -860,7 +869,7 @@ encode_mcu_AC_refine_prepare(const JCOEF *block,
|
||||
|
||||
#define ENCODE_COEFS_AC_REFINE(label) { \
|
||||
while (zerobits) { \
|
||||
int idx = count_zeroes(&zerobits); \
|
||||
idx = count_zeroes(&zerobits); \
|
||||
r += idx; \
|
||||
cabsvalue += idx; \
|
||||
signbits >>= idx; \
|
||||
@ -917,7 +926,7 @@ METHODDEF(boolean)
|
||||
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
||||
register int temp, r;
|
||||
register int temp, r, idx;
|
||||
char *BR_buffer;
|
||||
unsigned int BR;
|
||||
int Sl = cinfo->Se - cinfo->Ss + 1;
|
||||
@ -937,7 +946,7 @@ encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
emit_restart(entropy, entropy->next_restart_num);
|
||||
|
||||
#ifdef WITH_SIMD
|
||||
cabsvalue = absvalues = (JCOEF *)PAD((size_t)absvalues_unaligned, 16);
|
||||
cabsvalue = absvalues = (JCOEF *)PAD((JUINTPTR)absvalues_unaligned, 16);
|
||||
#else
|
||||
/* Not using SIMD, so alignment is not needed */
|
||||
cabsvalue = absvalues = absvalues_unaligned;
|
||||
@ -968,7 +977,7 @@ encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
if (zerobits) {
|
||||
int diff = ((absvalues + DCTSIZE2 / 2) - cabsvalue);
|
||||
int idx = count_zeroes(&zerobits);
|
||||
idx = count_zeroes(&zerobits);
|
||||
signbits >>= idx;
|
||||
idx += diff;
|
||||
r += idx;
|
||||
|
63
src/3rdparty/libjpeg/src/jcsample.c
vendored
63
src/3rdparty/libjpeg/src/jcsample.c
vendored
@ -6,7 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2019, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -103,7 +103,7 @@ expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
|
||||
if (numcols > 0) {
|
||||
for (row = 0; row < num_rows; row++) {
|
||||
ptr = image_data[row] + input_cols;
|
||||
pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
|
||||
pixval = ptr[-1];
|
||||
for (count = numcols; count > 0; count--)
|
||||
*ptr++ = pixval;
|
||||
}
|
||||
@ -174,7 +174,7 @@ int_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
for (v = 0; v < v_expand; v++) {
|
||||
inptr = input_data[inrow + v] + outcol_h;
|
||||
for (h = 0; h < h_expand; h++) {
|
||||
outvalue += (JLONG)GETJSAMPLE(*inptr++);
|
||||
outvalue += (JLONG)(*inptr++);
|
||||
}
|
||||
}
|
||||
*outptr++ = (JSAMPLE)((outvalue + numpix2) / numpix);
|
||||
@ -237,8 +237,7 @@ h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
inptr = input_data[outrow];
|
||||
bias = 0; /* bias = 0,1,0,1,... for successive samples */
|
||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||
*outptr++ =
|
||||
(JSAMPLE)((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + bias) >> 1);
|
||||
*outptr++ = (JSAMPLE)((inptr[0] + inptr[1] + bias) >> 1);
|
||||
bias ^= 1; /* 0=>1, 1=>0 */
|
||||
inptr += 2;
|
||||
}
|
||||
@ -277,8 +276,7 @@ h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
bias = 1; /* bias = 1,2,1,2,... for successive samples */
|
||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||
*outptr++ =
|
||||
(JSAMPLE)((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + bias) >> 2);
|
||||
(JSAMPLE)((inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1] + bias) >> 2);
|
||||
bias ^= 3; /* 1=>2, 2=>1 */
|
||||
inptr0 += 2; inptr1 += 2;
|
||||
}
|
||||
@ -337,33 +335,25 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
below_ptr = input_data[inrow + 2];
|
||||
|
||||
/* Special case for first column: pretend column -1 is same as column 0 */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
|
||||
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
|
||||
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
|
||||
inptr0[0] + inptr0[2] + inptr1[0] + inptr1[2];
|
||||
neighsum += neighsum;
|
||||
neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
|
||||
neighsum += above_ptr[0] + above_ptr[2] + below_ptr[0] + below_ptr[2];
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
|
||||
|
||||
for (colctr = output_cols - 2; colctr > 0; colctr--) {
|
||||
/* sum of pixels directly mapped to this output element */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
|
||||
/* sum of edge-neighbor pixels */
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
|
||||
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
|
||||
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
|
||||
inptr0[-1] + inptr0[2] + inptr1[-1] + inptr1[2];
|
||||
/* The edge-neighbors count twice as much as corner-neighbors */
|
||||
neighsum += neighsum;
|
||||
/* Add in the corner-neighbors */
|
||||
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
|
||||
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
|
||||
neighsum += above_ptr[-1] + above_ptr[2] + below_ptr[-1] + below_ptr[2];
|
||||
/* form final output scaled up by 2^16 */
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
/* round, descale and output it */
|
||||
@ -372,15 +362,11 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
}
|
||||
|
||||
/* Special case for last column */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
|
||||
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
|
||||
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
|
||||
inptr0[-1] + inptr0[1] + inptr1[-1] + inptr1[1];
|
||||
neighsum += neighsum;
|
||||
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
|
||||
neighsum += above_ptr[-1] + above_ptr[1] + below_ptr[-1] + below_ptr[1];
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
|
||||
@ -429,21 +415,18 @@ fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
below_ptr = input_data[outrow + 1];
|
||||
|
||||
/* Special case for first column */
|
||||
colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
|
||||
GETJSAMPLE(*inptr);
|
||||
membersum = GETJSAMPLE(*inptr++);
|
||||
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
|
||||
GETJSAMPLE(*inptr);
|
||||
colsum = (*above_ptr++) + (*below_ptr++) + inptr[0];
|
||||
membersum = *inptr++;
|
||||
nextcolsum = above_ptr[0] + below_ptr[0] + inptr[0];
|
||||
neighsum = colsum + (colsum - membersum) + nextcolsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
lastcolsum = colsum; colsum = nextcolsum;
|
||||
|
||||
for (colctr = output_cols - 2; colctr > 0; colctr--) {
|
||||
membersum = GETJSAMPLE(*inptr++);
|
||||
membersum = *inptr++;
|
||||
above_ptr++; below_ptr++;
|
||||
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
|
||||
GETJSAMPLE(*inptr);
|
||||
nextcolsum = above_ptr[0] + below_ptr[0] + inptr[0];
|
||||
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
@ -451,7 +434,7 @@ fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
}
|
||||
|
||||
/* Special case for last column */
|
||||
membersum = GETJSAMPLE(*inptr);
|
||||
membersum = *inptr;
|
||||
neighsum = lastcolsum + (colsum - membersum) + colsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
|
5
src/3rdparty/libjpeg/src/jctrans.c
vendored
5
src/3rdparty/libjpeg/src/jctrans.c
vendored
@ -4,8 +4,8 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||
* Modified 2000-2009 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -17,6 +17,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
3
src/3rdparty/libjpeg/src/jdapimin.c
vendored
3
src/3rdparty/libjpeg/src/jdapimin.c
vendored
@ -23,6 +23,7 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdmaster.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -308,7 +309,7 @@ jpeg_consume_input(j_decompress_ptr cinfo)
|
||||
/* Initialize application's data source module */
|
||||
(*cinfo->src->init_source) (cinfo);
|
||||
cinfo->global_state = DSTATE_INHEADER;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case DSTATE_INHEADER:
|
||||
retcode = (*cinfo->inputctl->consume_input) (cinfo);
|
||||
if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
|
||||
|
53
src/3rdparty/libjpeg/src/jdapistd.c
vendored
53
src/3rdparty/libjpeg/src/jdapistd.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2015-2018, D. R. Commander.
|
||||
* Copyright (C) 2010, 2015-2020, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -21,6 +21,8 @@
|
||||
#include "jinclude.h"
|
||||
#include "jdmainct.h"
|
||||
#include "jdcoefct.h"
|
||||
#include "jdmaster.h"
|
||||
#include "jdmerge.h"
|
||||
#include "jdsample.h"
|
||||
#include "jmemsys.h"
|
||||
|
||||
@ -316,6 +318,10 @@ LOCAL(void)
|
||||
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION n;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
JSAMPLE dummy_sample[1] = { 0 };
|
||||
JSAMPROW dummy_row = dummy_sample;
|
||||
JSAMPARRAY scanlines = NULL;
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows) = NULL;
|
||||
@ -325,6 +331,10 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
|
||||
color_convert = cinfo->cconvert->color_convert;
|
||||
cinfo->cconvert->color_convert = noop_convert;
|
||||
/* This just prevents UBSan from complaining about adding 0 to a NULL
|
||||
* pointer. The pointer isn't actually used.
|
||||
*/
|
||||
scanlines = &dummy_row;
|
||||
}
|
||||
|
||||
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
|
||||
@ -332,8 +342,13 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
scanlines = &upsample->spare_row;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_lines; n++)
|
||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
jpeg_read_scanlines(cinfo, scanlines, 1);
|
||||
|
||||
if (color_convert)
|
||||
cinfo->cconvert->color_convert = color_convert;
|
||||
@ -353,6 +368,12 @@ increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
|
||||
{
|
||||
JDIMENSION rows_left;
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
|
||||
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
|
||||
read_and_discard_scanlines(cinfo, rows);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Increment the counter to the next row group after the skipped rows. */
|
||||
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
|
||||
@ -382,21 +403,27 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
JDIMENSION i, x;
|
||||
int y;
|
||||
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
|
||||
JDIMENSION lines_to_skip, lines_to_read;
|
||||
|
||||
/* Two-pass color quantization is not supported. */
|
||||
if (cinfo->quantize_colors && cinfo->two_pass_quantize)
|
||||
ERREXIT(cinfo, JERR_NOTIMPL);
|
||||
|
||||
if (cinfo->global_state != DSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Do not skip past the bottom of the image. */
|
||||
if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
|
||||
num_lines = cinfo->output_height - cinfo->output_scanline;
|
||||
cinfo->output_scanline = cinfo->output_height;
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
cinfo->inputctl->eoi_reached = TRUE;
|
||||
return cinfo->output_height - cinfo->output_scanline;
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
if (num_lines == 0)
|
||||
@ -445,8 +472,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skipping is much simpler when context rows are not required. */
|
||||
@ -458,8 +487,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample) {
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,7 +525,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
@ -506,6 +538,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
* decoded coefficients. This is ~5% faster for large subsets, but
|
||||
* it's tough to tell a difference for smaller images.
|
||||
*/
|
||||
if (!cinfo->entropy->insufficient_data)
|
||||
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
|
||||
(*cinfo->entropy->decode_mcu) (cinfo, NULL);
|
||||
}
|
||||
}
|
||||
@ -535,7 +569,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
|
||||
* output_scanline.
|
||||
*/
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
if (!master->using_merged_upsample)
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
|
||||
/* Always skip the requested number of lines. */
|
||||
return num_lines;
|
||||
|
15
src/3rdparty/libjpeg/src/jdarith.c
vendored
15
src/3rdparty/libjpeg/src/jdarith.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2015 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2018, D. R. Commander.
|
||||
* Copyright (C) 2015-2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -80,7 +80,7 @@ get_byte(j_decompress_ptr cinfo)
|
||||
if (!(*src->fill_input_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
src->bytes_in_buffer--;
|
||||
return GETJOCTET(*src->next_input_byte++);
|
||||
return *src->next_input_byte++;
|
||||
}
|
||||
|
||||
|
||||
@ -665,8 +665,16 @@ bad:
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
|
||||
int *coef_bit_ptr = &cinfo->coef_bits[cindex][0];
|
||||
int *prev_coef_bit_ptr =
|
||||
&cinfo->coef_bits[cindex + cinfo->num_components][0];
|
||||
if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
|
||||
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
|
||||
for (coefi = MIN(cinfo->Ss, 1); coefi <= MAX(cinfo->Se, 9); coefi++) {
|
||||
if (cinfo->input_scan_number > 1)
|
||||
prev_coef_bit_ptr[coefi] = coef_bit_ptr[coefi];
|
||||
else
|
||||
prev_coef_bit_ptr[coefi] = 0;
|
||||
}
|
||||
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
|
||||
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
|
||||
if (cinfo->Ah != expected)
|
||||
@ -727,6 +735,7 @@ bad:
|
||||
entropy->c = 0;
|
||||
entropy->a = 0;
|
||||
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
|
||||
entropy->pub.insufficient_data = FALSE;
|
||||
|
||||
/* Initialize restart counter */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
@ -763,7 +772,7 @@ jinit_arith_decoder(j_decompress_ptr cinfo)
|
||||
int *coef_bit_ptr, ci;
|
||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
cinfo->num_components * DCTSIZE2 *
|
||||
cinfo->num_components * 2 * DCTSIZE2 *
|
||||
sizeof(int));
|
||||
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
|
3
src/3rdparty/libjpeg/src/jdatadst.c
vendored
3
src/3rdparty/libjpeg/src/jdatadst.c
vendored
@ -143,8 +143,7 @@ empty_mem_output_buffer(j_compress_ptr cinfo)
|
||||
|
||||
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
||||
|
||||
if (dest->newbuffer != NULL)
|
||||
free(dest->newbuffer);
|
||||
free(dest->newbuffer);
|
||||
|
||||
dest->newbuffer = nextbuffer;
|
||||
|
||||
|
290
src/3rdparty/libjpeg/src/jdcoefct.c
vendored
290
src/3rdparty/libjpeg/src/jdcoefct.c
vendored
@ -5,8 +5,8 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2010, 2015-2016, 2019-2020, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -102,6 +102,8 @@ decompress_onepass(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
|
||||
jzero_far((void *)coef->MCU_buffer[0],
|
||||
(size_t)(cinfo->blocks_in_MCU * sizeof(JBLOCK)));
|
||||
if (!cinfo->entropy->insufficient_data)
|
||||
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
|
||||
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
@ -227,6 +229,8 @@ consume_data(j_decompress_ptr cinfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!cinfo->entropy->insufficient_data)
|
||||
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
|
||||
/* Try to fetch the MCU. */
|
||||
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
@ -326,19 +330,22 @@ decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
|
||||
/*
|
||||
* This code applies interblock smoothing as described by section K.8
|
||||
* of the JPEG standard: the first 5 AC coefficients are estimated from
|
||||
* the DC values of a DCT block and its 8 neighboring blocks.
|
||||
* This code applies interblock smoothing; the first 9 AC coefficients are
|
||||
* estimated from the DC values of a DCT block and its 24 neighboring blocks.
|
||||
* We apply smoothing only for progressive JPEG decoding, and only if
|
||||
* the coefficients it can estimate are not yet known to full precision.
|
||||
*/
|
||||
|
||||
/* Natural-order array positions of the first 5 zigzag-order coefficients */
|
||||
/* Natural-order array positions of the first 9 zigzag-order coefficients */
|
||||
#define Q01_POS 1
|
||||
#define Q10_POS 8
|
||||
#define Q20_POS 16
|
||||
#define Q11_POS 9
|
||||
#define Q02_POS 2
|
||||
#define Q03_POS 3
|
||||
#define Q12_POS 10
|
||||
#define Q21_POS 17
|
||||
#define Q30_POS 24
|
||||
|
||||
/*
|
||||
* Determine whether block smoothing is applicable and safe.
|
||||
@ -356,8 +363,8 @@ smoothing_ok(j_decompress_ptr cinfo)
|
||||
int ci, coefi;
|
||||
jpeg_component_info *compptr;
|
||||
JQUANT_TBL *qtable;
|
||||
int *coef_bits;
|
||||
int *coef_bits_latch;
|
||||
int *coef_bits, *prev_coef_bits;
|
||||
int *coef_bits_latch, *prev_coef_bits_latch;
|
||||
|
||||
if (!cinfo->progressive_mode || cinfo->coef_bits == NULL)
|
||||
return FALSE;
|
||||
@ -366,34 +373,47 @@ smoothing_ok(j_decompress_ptr cinfo)
|
||||
if (coef->coef_bits_latch == NULL)
|
||||
coef->coef_bits_latch = (int *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
cinfo->num_components *
|
||||
cinfo->num_components * 2 *
|
||||
(SAVED_COEFS * sizeof(int)));
|
||||
coef_bits_latch = coef->coef_bits_latch;
|
||||
prev_coef_bits_latch =
|
||||
&coef->coef_bits_latch[cinfo->num_components * SAVED_COEFS];
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* All components' quantization values must already be latched. */
|
||||
if ((qtable = compptr->quant_table) == NULL)
|
||||
return FALSE;
|
||||
/* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
|
||||
/* Verify DC & first 9 AC quantizers are nonzero to avoid zero-divide. */
|
||||
if (qtable->quantval[0] == 0 ||
|
||||
qtable->quantval[Q01_POS] == 0 ||
|
||||
qtable->quantval[Q10_POS] == 0 ||
|
||||
qtable->quantval[Q20_POS] == 0 ||
|
||||
qtable->quantval[Q11_POS] == 0 ||
|
||||
qtable->quantval[Q02_POS] == 0)
|
||||
qtable->quantval[Q02_POS] == 0 ||
|
||||
qtable->quantval[Q03_POS] == 0 ||
|
||||
qtable->quantval[Q12_POS] == 0 ||
|
||||
qtable->quantval[Q21_POS] == 0 ||
|
||||
qtable->quantval[Q30_POS] == 0)
|
||||
return FALSE;
|
||||
/* DC values must be at least partly known for all components. */
|
||||
coef_bits = cinfo->coef_bits[ci];
|
||||
prev_coef_bits = cinfo->coef_bits[ci + cinfo->num_components];
|
||||
if (coef_bits[0] < 0)
|
||||
return FALSE;
|
||||
coef_bits_latch[0] = coef_bits[0];
|
||||
/* Block smoothing is helpful if some AC coefficients remain inaccurate. */
|
||||
for (coefi = 1; coefi <= 5; coefi++) {
|
||||
for (coefi = 1; coefi < SAVED_COEFS; coefi++) {
|
||||
if (cinfo->input_scan_number > 1)
|
||||
prev_coef_bits_latch[coefi] = prev_coef_bits[coefi];
|
||||
else
|
||||
prev_coef_bits_latch[coefi] = -1;
|
||||
coef_bits_latch[coefi] = coef_bits[coefi];
|
||||
if (coef_bits[coefi] != 0)
|
||||
smoothing_useful = TRUE;
|
||||
}
|
||||
coef_bits_latch += SAVED_COEFS;
|
||||
prev_coef_bits_latch += SAVED_COEFS;
|
||||
}
|
||||
|
||||
return smoothing_useful;
|
||||
@ -412,17 +432,20 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
JDIMENSION block_num, last_block_column;
|
||||
int ci, block_row, block_rows, access_rows;
|
||||
JBLOCKARRAY buffer;
|
||||
JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
|
||||
JBLOCKROW buffer_ptr, prev_prev_block_row, prev_block_row;
|
||||
JBLOCKROW next_block_row, next_next_block_row;
|
||||
JSAMPARRAY output_ptr;
|
||||
JDIMENSION output_col;
|
||||
jpeg_component_info *compptr;
|
||||
inverse_DCT_method_ptr inverse_DCT;
|
||||
boolean first_row, last_row;
|
||||
boolean change_dc;
|
||||
JCOEF *workspace;
|
||||
int *coef_bits;
|
||||
JQUANT_TBL *quanttbl;
|
||||
JLONG Q00, Q01, Q02, Q10, Q11, Q20, num;
|
||||
int DC1, DC2, DC3, DC4, DC5, DC6, DC7, DC8, DC9;
|
||||
JLONG Q00, Q01, Q02, Q03 = 0, Q10, Q11, Q12 = 0, Q20, Q21 = 0, Q30 = 0, num;
|
||||
int DC01, DC02, DC03, DC04, DC05, DC06, DC07, DC08, DC09, DC10, DC11, DC12,
|
||||
DC13, DC14, DC15, DC16, DC17, DC18, DC19, DC20, DC21, DC22, DC23, DC24,
|
||||
DC25;
|
||||
int Al, pred;
|
||||
|
||||
/* Keep a local variable to avoid looking it up more than once */
|
||||
@ -434,10 +457,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
if (cinfo->input_scan_number == cinfo->output_scan_number) {
|
||||
/* If input is working on current scan, we ordinarily want it to
|
||||
* have completed the current row. But if input scan is DC,
|
||||
* we want it to keep one row ahead so that next block row's DC
|
||||
* we want it to keep two rows ahead so that next two block rows' DC
|
||||
* values are up to date.
|
||||
*/
|
||||
JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
|
||||
JDIMENSION delta = (cinfo->Ss == 0) ? 2 : 0;
|
||||
if (cinfo->input_iMCU_row > cinfo->output_iMCU_row + delta)
|
||||
break;
|
||||
}
|
||||
@ -452,34 +475,53 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
if (!compptr->component_needed)
|
||||
continue;
|
||||
/* Count non-dummy DCT block rows in this iMCU row. */
|
||||
if (cinfo->output_iMCU_row < last_iMCU_row) {
|
||||
if (cinfo->output_iMCU_row < last_iMCU_row - 1) {
|
||||
block_rows = compptr->v_samp_factor;
|
||||
access_rows = block_rows * 3; /* this and next two iMCU rows */
|
||||
} else if (cinfo->output_iMCU_row < last_iMCU_row) {
|
||||
block_rows = compptr->v_samp_factor;
|
||||
access_rows = block_rows * 2; /* this and next iMCU row */
|
||||
last_row = FALSE;
|
||||
} else {
|
||||
/* NB: can't use last_row_height here; it is input-side-dependent! */
|
||||
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
|
||||
if (block_rows == 0) block_rows = compptr->v_samp_factor;
|
||||
access_rows = block_rows; /* this iMCU row only */
|
||||
last_row = TRUE;
|
||||
}
|
||||
/* Align the virtual buffer for this component. */
|
||||
if (cinfo->output_iMCU_row > 0) {
|
||||
access_rows += compptr->v_samp_factor; /* prior iMCU row too */
|
||||
if (cinfo->output_iMCU_row > 1) {
|
||||
access_rows += 2 * compptr->v_samp_factor; /* prior two iMCU rows too */
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
(cinfo->output_iMCU_row - 2) * compptr->v_samp_factor,
|
||||
(JDIMENSION)access_rows, FALSE);
|
||||
buffer += 2 * compptr->v_samp_factor; /* point to current iMCU row */
|
||||
} else if (cinfo->output_iMCU_row > 0) {
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
(cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
|
||||
(JDIMENSION)access_rows, FALSE);
|
||||
buffer += compptr->v_samp_factor; /* point to current iMCU row */
|
||||
first_row = FALSE;
|
||||
} else {
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
(JDIMENSION)0, (JDIMENSION)access_rows, FALSE);
|
||||
first_row = TRUE;
|
||||
}
|
||||
/* Fetch component-dependent info */
|
||||
coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
|
||||
/* Fetch component-dependent info.
|
||||
* If the current scan is incomplete, then we use the component-dependent
|
||||
* info from the previous scan.
|
||||
*/
|
||||
if (cinfo->output_iMCU_row > cinfo->master->last_good_iMCU_row)
|
||||
coef_bits =
|
||||
coef->coef_bits_latch + ((ci + cinfo->num_components) * SAVED_COEFS);
|
||||
else
|
||||
coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
|
||||
|
||||
/* We only do DC interpolation if no AC coefficient data is available. */
|
||||
change_dc =
|
||||
coef_bits[1] == -1 && coef_bits[2] == -1 && coef_bits[3] == -1 &&
|
||||
coef_bits[4] == -1 && coef_bits[5] == -1 && coef_bits[6] == -1 &&
|
||||
coef_bits[7] == -1 && coef_bits[8] == -1 && coef_bits[9] == -1;
|
||||
|
||||
quanttbl = compptr->quant_table;
|
||||
Q00 = quanttbl->quantval[0];
|
||||
Q01 = quanttbl->quantval[Q01_POS];
|
||||
@ -487,25 +529,51 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
Q20 = quanttbl->quantval[Q20_POS];
|
||||
Q11 = quanttbl->quantval[Q11_POS];
|
||||
Q02 = quanttbl->quantval[Q02_POS];
|
||||
if (change_dc) {
|
||||
Q03 = quanttbl->quantval[Q03_POS];
|
||||
Q12 = quanttbl->quantval[Q12_POS];
|
||||
Q21 = quanttbl->quantval[Q21_POS];
|
||||
Q30 = quanttbl->quantval[Q30_POS];
|
||||
}
|
||||
inverse_DCT = cinfo->idct->inverse_DCT[ci];
|
||||
output_ptr = output_buf[ci];
|
||||
/* Loop over all DCT blocks to be processed. */
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
|
||||
if (first_row && block_row == 0)
|
||||
|
||||
if (block_row > 0 || cinfo->output_iMCU_row > 0)
|
||||
prev_block_row =
|
||||
buffer[block_row - 1] + cinfo->master->first_MCU_col[ci];
|
||||
else
|
||||
prev_block_row = buffer_ptr;
|
||||
|
||||
if (block_row > 1 || cinfo->output_iMCU_row > 1)
|
||||
prev_prev_block_row =
|
||||
buffer[block_row - 2] + cinfo->master->first_MCU_col[ci];
|
||||
else
|
||||
prev_prev_block_row = prev_block_row;
|
||||
|
||||
if (block_row < block_rows - 1 || cinfo->output_iMCU_row < last_iMCU_row)
|
||||
next_block_row =
|
||||
buffer[block_row + 1] + cinfo->master->first_MCU_col[ci];
|
||||
else
|
||||
prev_block_row = buffer[block_row - 1];
|
||||
if (last_row && block_row == block_rows - 1)
|
||||
next_block_row = buffer_ptr;
|
||||
|
||||
if (block_row < block_rows - 2 ||
|
||||
cinfo->output_iMCU_row < last_iMCU_row - 1)
|
||||
next_next_block_row =
|
||||
buffer[block_row + 2] + cinfo->master->first_MCU_col[ci];
|
||||
else
|
||||
next_block_row = buffer[block_row + 1];
|
||||
next_next_block_row = next_block_row;
|
||||
|
||||
/* We fetch the surrounding DC values using a sliding-register approach.
|
||||
* Initialize all nine here so as to do the right thing on narrow pics.
|
||||
* Initialize all 25 here so as to do the right thing on narrow pics.
|
||||
*/
|
||||
DC1 = DC2 = DC3 = (int)prev_block_row[0][0];
|
||||
DC4 = DC5 = DC6 = (int)buffer_ptr[0][0];
|
||||
DC7 = DC8 = DC9 = (int)next_block_row[0][0];
|
||||
DC01 = DC02 = DC03 = DC04 = DC05 = (int)prev_prev_block_row[0][0];
|
||||
DC06 = DC07 = DC08 = DC09 = DC10 = (int)prev_block_row[0][0];
|
||||
DC11 = DC12 = DC13 = DC14 = DC15 = (int)buffer_ptr[0][0];
|
||||
DC16 = DC17 = DC18 = DC19 = DC20 = (int)next_block_row[0][0];
|
||||
DC21 = DC22 = DC23 = DC24 = DC25 = (int)next_next_block_row[0][0];
|
||||
output_col = 0;
|
||||
last_block_column = compptr->width_in_blocks - 1;
|
||||
for (block_num = cinfo->master->first_MCU_col[ci];
|
||||
@ -513,18 +581,39 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
/* Fetch current DCT block into workspace so we can modify it. */
|
||||
jcopy_block_row(buffer_ptr, (JBLOCKROW)workspace, (JDIMENSION)1);
|
||||
/* Update DC values */
|
||||
if (block_num < last_block_column) {
|
||||
DC3 = (int)prev_block_row[1][0];
|
||||
DC6 = (int)buffer_ptr[1][0];
|
||||
DC9 = (int)next_block_row[1][0];
|
||||
if (block_num == cinfo->master->first_MCU_col[ci] &&
|
||||
block_num < last_block_column) {
|
||||
DC04 = (int)prev_prev_block_row[1][0];
|
||||
DC09 = (int)prev_block_row[1][0];
|
||||
DC14 = (int)buffer_ptr[1][0];
|
||||
DC19 = (int)next_block_row[1][0];
|
||||
DC24 = (int)next_next_block_row[1][0];
|
||||
}
|
||||
/* Compute coefficient estimates per K.8.
|
||||
* An estimate is applied only if coefficient is still zero,
|
||||
* and is not known to be fully accurate.
|
||||
if (block_num + 1 < last_block_column) {
|
||||
DC05 = (int)prev_prev_block_row[2][0];
|
||||
DC10 = (int)prev_block_row[2][0];
|
||||
DC15 = (int)buffer_ptr[2][0];
|
||||
DC20 = (int)next_block_row[2][0];
|
||||
DC25 = (int)next_next_block_row[2][0];
|
||||
}
|
||||
/* If DC interpolation is enabled, compute coefficient estimates using
|
||||
* a Gaussian-like kernel, keeping the averages of the DC values.
|
||||
*
|
||||
* If DC interpolation is disabled, compute coefficient estimates using
|
||||
* an algorithm similar to the one described in Section K.8 of the JPEG
|
||||
* standard, except applied to a 5x5 window rather than a 3x3 window.
|
||||
*
|
||||
* An estimate is applied only if the coefficient is still zero and is
|
||||
* not known to be fully accurate.
|
||||
*/
|
||||
/* AC01 */
|
||||
if ((Al = coef_bits[1]) != 0 && workspace[1] == 0) {
|
||||
num = 36 * Q00 * (DC4 - DC6);
|
||||
num = Q00 * (change_dc ?
|
||||
(-DC01 - DC02 + DC04 + DC05 - 3 * DC06 + 13 * DC07 -
|
||||
13 * DC09 + 3 * DC10 - 3 * DC11 + 38 * DC12 - 38 * DC14 +
|
||||
3 * DC15 - 3 * DC16 + 13 * DC17 - 13 * DC19 + 3 * DC20 -
|
||||
DC21 - DC22 + DC24 + DC25) :
|
||||
(-7 * DC11 + 50 * DC12 - 50 * DC14 + 7 * DC15));
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q01 << 7) + num) / (Q01 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
@ -539,7 +628,12 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
}
|
||||
/* AC10 */
|
||||
if ((Al = coef_bits[2]) != 0 && workspace[8] == 0) {
|
||||
num = 36 * Q00 * (DC2 - DC8);
|
||||
num = Q00 * (change_dc ?
|
||||
(-DC01 - 3 * DC02 - 3 * DC03 - 3 * DC04 - DC05 - DC06 +
|
||||
13 * DC07 + 38 * DC08 + 13 * DC09 - DC10 + DC16 -
|
||||
13 * DC17 - 38 * DC18 - 13 * DC19 + DC20 + DC21 +
|
||||
3 * DC22 + 3 * DC23 + 3 * DC24 + DC25) :
|
||||
(-7 * DC03 + 50 * DC08 - 50 * DC18 + 7 * DC23));
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q10 << 7) + num) / (Q10 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
@ -554,7 +648,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
}
|
||||
/* AC20 */
|
||||
if ((Al = coef_bits[3]) != 0 && workspace[16] == 0) {
|
||||
num = 9 * Q00 * (DC2 + DC8 - 2 * DC5);
|
||||
num = Q00 * (change_dc ?
|
||||
(DC03 + 2 * DC07 + 7 * DC08 + 2 * DC09 - 5 * DC12 - 14 * DC13 -
|
||||
5 * DC14 + 2 * DC17 + 7 * DC18 + 2 * DC19 + DC23) :
|
||||
(-DC03 + 13 * DC08 - 24 * DC13 + 13 * DC18 - DC23));
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q20 << 7) + num) / (Q20 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
@ -569,7 +666,11 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
}
|
||||
/* AC11 */
|
||||
if ((Al = coef_bits[4]) != 0 && workspace[9] == 0) {
|
||||
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
|
||||
num = Q00 * (change_dc ?
|
||||
(-DC01 + DC05 + 9 * DC07 - 9 * DC09 - 9 * DC17 +
|
||||
9 * DC19 + DC21 - DC25) :
|
||||
(DC10 + DC16 - 10 * DC17 + 10 * DC19 - DC02 - DC20 + DC22 -
|
||||
DC24 + DC04 - DC06 + 10 * DC07 - 10 * DC09));
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q11 << 7) + num) / (Q11 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
@ -584,7 +685,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
}
|
||||
/* AC02 */
|
||||
if ((Al = coef_bits[5]) != 0 && workspace[2] == 0) {
|
||||
num = 9 * Q00 * (DC4 + DC6 - 2 * DC5);
|
||||
num = Q00 * (change_dc ?
|
||||
(2 * DC07 - 5 * DC08 + 2 * DC09 + DC11 + 7 * DC12 - 14 * DC13 +
|
||||
7 * DC14 + DC15 + 2 * DC17 - 5 * DC18 + 2 * DC19) :
|
||||
(-DC11 + 13 * DC12 - 24 * DC13 + 13 * DC14 - DC15));
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q02 << 7) + num) / (Q02 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
@ -597,14 +701,96 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
}
|
||||
workspace[2] = (JCOEF)pred;
|
||||
}
|
||||
if (change_dc) {
|
||||
/* AC03 */
|
||||
if ((Al = coef_bits[6]) != 0 && workspace[3] == 0) {
|
||||
num = Q00 * (DC07 - DC09 + 2 * DC12 - 2 * DC14 + DC17 - DC19);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q03 << 7) + num) / (Q03 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q03 << 7) - num) / (Q03 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[3] = (JCOEF)pred;
|
||||
}
|
||||
/* AC12 */
|
||||
if ((Al = coef_bits[7]) != 0 && workspace[10] == 0) {
|
||||
num = Q00 * (DC07 - 3 * DC08 + DC09 - DC17 + 3 * DC18 - DC19);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q12 << 7) + num) / (Q12 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q12 << 7) - num) / (Q12 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[10] = (JCOEF)pred;
|
||||
}
|
||||
/* AC21 */
|
||||
if ((Al = coef_bits[8]) != 0 && workspace[17] == 0) {
|
||||
num = Q00 * (DC07 - DC09 - 3 * DC12 + 3 * DC14 + DC17 - DC19);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q21 << 7) + num) / (Q21 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q21 << 7) - num) / (Q21 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[17] = (JCOEF)pred;
|
||||
}
|
||||
/* AC30 */
|
||||
if ((Al = coef_bits[9]) != 0 && workspace[24] == 0) {
|
||||
num = Q00 * (DC07 + 2 * DC08 + DC09 - DC17 - 2 * DC18 - DC19);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q30 << 7) + num) / (Q30 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q30 << 7) - num) / (Q30 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[24] = (JCOEF)pred;
|
||||
}
|
||||
/* coef_bits[0] is non-negative. Otherwise this function would not
|
||||
* be called.
|
||||
*/
|
||||
num = Q00 *
|
||||
(-2 * DC01 - 6 * DC02 - 8 * DC03 - 6 * DC04 - 2 * DC05 -
|
||||
6 * DC06 + 6 * DC07 + 42 * DC08 + 6 * DC09 - 6 * DC10 -
|
||||
8 * DC11 + 42 * DC12 + 152 * DC13 + 42 * DC14 - 8 * DC15 -
|
||||
6 * DC16 + 6 * DC17 + 42 * DC18 + 6 * DC19 - 6 * DC20 -
|
||||
2 * DC21 - 6 * DC22 - 8 * DC23 - 6 * DC24 - 2 * DC25);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q00 << 7) + num) / (Q00 << 8));
|
||||
} else {
|
||||
pred = (int)(((Q00 << 7) - num) / (Q00 << 8));
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[0] = (JCOEF)pred;
|
||||
} /* change_dc */
|
||||
|
||||
/* OK, do the IDCT */
|
||||
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)workspace, output_ptr,
|
||||
output_col);
|
||||
/* Advance for next column */
|
||||
DC1 = DC2; DC2 = DC3;
|
||||
DC4 = DC5; DC5 = DC6;
|
||||
DC7 = DC8; DC8 = DC9;
|
||||
buffer_ptr++, prev_block_row++, next_block_row++;
|
||||
DC01 = DC02; DC02 = DC03; DC03 = DC04; DC04 = DC05;
|
||||
DC06 = DC07; DC07 = DC08; DC08 = DC09; DC09 = DC10;
|
||||
DC11 = DC12; DC12 = DC13; DC13 = DC14; DC14 = DC15;
|
||||
DC16 = DC17; DC17 = DC18; DC18 = DC19; DC19 = DC20;
|
||||
DC21 = DC22; DC22 = DC23; DC23 = DC24; DC24 = DC25;
|
||||
buffer_ptr++, prev_block_row++, next_block_row++,
|
||||
prev_prev_block_row++, next_next_block_row++;
|
||||
output_col += compptr->_DCT_scaled_size;
|
||||
}
|
||||
output_ptr += compptr->_DCT_scaled_size;
|
||||
@ -653,7 +839,7 @@ jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
/* If block smoothing could be used, need a bigger window */
|
||||
if (cinfo->progressive_mode)
|
||||
access_rows *= 3;
|
||||
access_rows *= 5;
|
||||
#endif
|
||||
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
|
||||
|
3
src/3rdparty/libjpeg/src/jdcoefct.h
vendored
3
src/3rdparty/libjpeg/src/jdcoefct.h
vendored
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2020, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
@ -51,7 +52,7 @@ typedef struct {
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
/* When doing block smoothing, we latch coefficient Al values here */
|
||||
int *coef_bits_latch;
|
||||
#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
|
||||
#define SAVED_COEFS 10 /* we save coef_bits[0..9] */
|
||||
#endif
|
||||
} my_coef_controller;
|
||||
|
||||
|
96
src/3rdparty/libjpeg/src/jdcol565.c
vendored
96
src/3rdparty/libjpeg/src/jdcol565.c
vendored
@ -45,9 +45,9 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr = *output_buf++;
|
||||
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
@ -58,18 +58,18 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
b = range_limit[y + Cbbtab[cb]];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
@ -80,9 +80,9 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
y = *inptr0;
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
@ -125,9 +125,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
@ -139,9 +139,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
@ -150,9 +150,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
y = *inptr0++;
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
@ -165,9 +165,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
y = *inptr0;
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
@ -202,32 +202,32 @@ rgb_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
r = *inptr0++;
|
||||
g = *inptr1++;
|
||||
b = *inptr2++;
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
r = *inptr0++;
|
||||
g = *inptr1++;
|
||||
b = *inptr2++;
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
r = *inptr0++;
|
||||
g = *inptr1++;
|
||||
b = *inptr2++;
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
r = GETJSAMPLE(*inptr0);
|
||||
g = GETJSAMPLE(*inptr1);
|
||||
b = GETJSAMPLE(*inptr2);
|
||||
r = *inptr0;
|
||||
g = *inptr1;
|
||||
b = *inptr2;
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
@ -259,24 +259,24 @@ rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
r = range_limit[DITHER_565_R(*inptr0++, d0)];
|
||||
g = range_limit[DITHER_565_G(*inptr1++, d0)];
|
||||
b = range_limit[DITHER_565_B(*inptr2++, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
r = range_limit[DITHER_565_R(*inptr0++, d0)];
|
||||
g = range_limit[DITHER_565_G(*inptr1++, d0)];
|
||||
b = range_limit[DITHER_565_B(*inptr2++, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
r = range_limit[DITHER_565_R(*inptr0++, d0)];
|
||||
g = range_limit[DITHER_565_G(*inptr1++, d0)];
|
||||
b = range_limit[DITHER_565_B(*inptr2++, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
@ -284,9 +284,9 @@ rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2), d0)];
|
||||
r = range_limit[DITHER_565_R(*inptr0, d0)];
|
||||
g = range_limit[DITHER_565_G(*inptr1, d0)];
|
||||
b = range_limit[DITHER_565_B(*inptr2, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
|
8
src/3rdparty/libjpeg/src/jdcolext.c
vendored
8
src/3rdparty/libjpeg/src/jdcolext.c
vendored
@ -53,9 +53,9 @@ ycc_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
y = GETJSAMPLE(inptr0[col]);
|
||||
cb = GETJSAMPLE(inptr1[col]);
|
||||
cr = GETJSAMPLE(inptr2[col]);
|
||||
y = inptr0[col];
|
||||
cb = inptr1[col];
|
||||
cr = inptr2[col];
|
||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
||||
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
|
||||
outptr[RGB_GREEN] = range_limit[y +
|
||||
@ -93,7 +93,6 @@ gray_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
inptr = input_buf[0][input_row++];
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
/* We can dispense with GETJSAMPLE() here */
|
||||
outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
|
||||
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
|
||||
/* alpha channel value */
|
||||
@ -128,7 +127,6 @@ rgb_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
/* We can dispense with GETJSAMPLE() here */
|
||||
outptr[RGB_RED] = inptr0[col];
|
||||
outptr[RGB_GREEN] = inptr1[col];
|
||||
outptr[RGB_BLUE] = inptr2[col];
|
||||
|
25
src/3rdparty/libjpeg/src/jdcolor.c
vendored
25
src/3rdparty/libjpeg/src/jdcolor.c
vendored
@ -341,9 +341,9 @@ rgb_gray_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr0[col]);
|
||||
g = GETJSAMPLE(inptr1[col]);
|
||||
b = GETJSAMPLE(inptr2[col]);
|
||||
r = inptr0[col];
|
||||
g = inptr1[col];
|
||||
b = inptr2[col];
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
@ -550,9 +550,9 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
y = GETJSAMPLE(inptr0[col]);
|
||||
cb = GETJSAMPLE(inptr1[col]);
|
||||
cr = GETJSAMPLE(inptr2[col]);
|
||||
y = inptr0[col];
|
||||
cb = inptr1[col];
|
||||
cr = inptr2[col];
|
||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
||||
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
|
||||
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
|
||||
@ -560,7 +560,7 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
SCALEBITS)))];
|
||||
outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
|
||||
/* K passes through unchanged */
|
||||
outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
|
||||
outptr[3] = inptr3[col];
|
||||
outptr += 4;
|
||||
}
|
||||
}
|
||||
@ -571,11 +571,10 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
#define PACK_SHORT_565_LE(r, g, b) \
|
||||
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) \
|
||||
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
@ -592,7 +591,7 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
* sufficient for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
|
65
src/3rdparty/libjpeg/src/jdhuff.c
vendored
65
src/3rdparty/libjpeg/src/jdhuff.c
vendored
@ -4,7 +4,8 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
|
||||
* Copyright (C) 2018, Matthias Räncker.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -39,24 +40,6 @@ typedef struct {
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
|
||||
/* This macro is to work around compilers with missing or broken
|
||||
* structure assignment. You'll need to fix this code if you have
|
||||
* such a compiler and you change MAX_COMPS_IN_SCAN.
|
||||
*/
|
||||
|
||||
#ifndef NO_STRUCT_ASSIGN
|
||||
#define ASSIGN_STATE(dest, src) ((dest) = (src))
|
||||
#else
|
||||
#if MAX_COMPS_IN_SCAN == 4
|
||||
#define ASSIGN_STATE(dest, src) \
|
||||
((dest).last_dc_val[0] = (src).last_dc_val[0], \
|
||||
(dest).last_dc_val[1] = (src).last_dc_val[1], \
|
||||
(dest).last_dc_val[2] = (src).last_dc_val[2], \
|
||||
(dest).last_dc_val[3] = (src).last_dc_val[3])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_entropy_decoder pub; /* public fields */
|
||||
|
||||
@ -325,7 +308,7 @@ jpeg_fill_bit_buffer(bitread_working_state *state,
|
||||
bytes_in_buffer = cinfo->src->bytes_in_buffer;
|
||||
}
|
||||
bytes_in_buffer--;
|
||||
c = GETJOCTET(*next_input_byte++);
|
||||
c = *next_input_byte++;
|
||||
|
||||
/* If it's 0xFF, check and discard stuffed zero byte */
|
||||
if (c == 0xFF) {
|
||||
@ -342,7 +325,7 @@ jpeg_fill_bit_buffer(bitread_working_state *state,
|
||||
bytes_in_buffer = cinfo->src->bytes_in_buffer;
|
||||
}
|
||||
bytes_in_buffer--;
|
||||
c = GETJOCTET(*next_input_byte++);
|
||||
c = *next_input_byte++;
|
||||
} while (c == 0xFF);
|
||||
|
||||
if (c == 0) {
|
||||
@ -405,8 +388,8 @@ no_more_bytes:
|
||||
|
||||
#define GET_BYTE { \
|
||||
register int c0, c1; \
|
||||
c0 = GETJOCTET(*buffer++); \
|
||||
c1 = GETJOCTET(*buffer); \
|
||||
c0 = *buffer++; \
|
||||
c1 = *buffer; \
|
||||
/* Pre-execute most common case */ \
|
||||
get_buffer = (get_buffer << 8) | c0; \
|
||||
bits_left += 8; \
|
||||
@ -423,7 +406,7 @@ no_more_bytes:
|
||||
} \
|
||||
}
|
||||
|
||||
#if SIZEOF_SIZE_T == 8 || defined(_WIN64)
|
||||
#if SIZEOF_SIZE_T == 8 || defined(_WIN64) || (defined(__x86_64__) && defined(__ILP32__))
|
||||
|
||||
/* Pre-fetch 48 bytes, because the holding register is 64-bit */
|
||||
#define FILL_BIT_BUFFER_FAST \
|
||||
@ -557,6 +540,12 @@ process_restart(j_decompress_ptr cinfo)
|
||||
}
|
||||
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(undefined_behavior_sanitizer)
|
||||
__attribute__((no_sanitize("signed-integer-overflow"),
|
||||
no_sanitize("unsigned-integer-overflow")))
|
||||
#endif
|
||||
#endif
|
||||
LOCAL(boolean)
|
||||
decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
@ -568,7 +557,7 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
/* Load up working state */
|
||||
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
|
||||
ASSIGN_STATE(state, entropy->saved);
|
||||
state = entropy->saved;
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
|
||||
@ -589,6 +578,14 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
if (entropy->dc_needed[blkn]) {
|
||||
/* Convert DC difference to actual value, update last_dc_val */
|
||||
int ci = cinfo->MCU_membership[blkn];
|
||||
/* Certain malformed JPEG images produce repeated DC coefficient
|
||||
* differences of 2047 or -2047, which causes state.last_dc_val[ci] to
|
||||
* grow until it overflows or underflows a 32-bit signed integer. This
|
||||
* behavior is, to the best of our understanding, innocuous, and it is
|
||||
* unclear how to work around it without potentially affecting
|
||||
* performance. Thus, we (hopefully temporarily) suppress UBSan integer
|
||||
* overflow errors for this function and decode_mcu_fast().
|
||||
*/
|
||||
s += state.last_dc_val[ci];
|
||||
state.last_dc_val[ci] = s;
|
||||
if (block) {
|
||||
@ -649,11 +646,17 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
/* Completed MCU, so update state */
|
||||
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
||||
ASSIGN_STATE(entropy->saved, state);
|
||||
entropy->saved = state;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(undefined_behavior_sanitizer)
|
||||
__attribute__((no_sanitize("signed-integer-overflow"),
|
||||
no_sanitize("unsigned-integer-overflow")))
|
||||
#endif
|
||||
#endif
|
||||
LOCAL(boolean)
|
||||
decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
@ -667,7 +670,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Load up working state */
|
||||
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
|
||||
buffer = (JOCTET *)br_state.next_input_byte;
|
||||
ASSIGN_STATE(state, entropy->saved);
|
||||
state = entropy->saved;
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
|
||||
@ -684,6 +687,9 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
if (entropy->dc_needed[blkn]) {
|
||||
int ci = cinfo->MCU_membership[blkn];
|
||||
/* Refer to the comment in decode_mcu_slow() regarding the supression of
|
||||
* a UBSan integer overflow error in this line of code.
|
||||
*/
|
||||
s += state.last_dc_val[ci];
|
||||
state.last_dc_val[ci] = s;
|
||||
if (block)
|
||||
@ -736,7 +742,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
|
||||
br_state.next_input_byte = buffer;
|
||||
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
||||
ASSIGN_STATE(entropy->saved, state);
|
||||
entropy->saved = state;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -791,7 +797,8 @@ use_slow:
|
||||
}
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
entropy->restarts_to_go--;
|
||||
if (cinfo->restart_interval)
|
||||
entropy->restarts_to_go--;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
13
src/3rdparty/libjpeg/src/jdhuff.h
vendored
13
src/3rdparty/libjpeg/src/jdhuff.h
vendored
@ -4,7 +4,8 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010-2011, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2010-2011, 2015-2016, 2021, D. R. Commander.
|
||||
* Copyright (C) 2018, Matthias Räncker.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -78,6 +79,11 @@ EXTERN(void) jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC,
|
||||
typedef size_t bit_buf_type; /* type of bit-extraction buffer */
|
||||
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
|
||||
|
||||
#elif defined(__x86_64__) && defined(__ILP32__)
|
||||
|
||||
typedef unsigned long long bit_buf_type; /* type of bit-extraction buffer */
|
||||
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
|
||||
|
||||
#else
|
||||
|
||||
typedef unsigned long bit_buf_type; /* type of bit-extraction buffer */
|
||||
@ -228,7 +234,10 @@ slowlabel: \
|
||||
s |= GET_BITS(1); \
|
||||
nb++; \
|
||||
} \
|
||||
s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
|
||||
if (nb > 16) \
|
||||
s = 0; \
|
||||
else \
|
||||
s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
|
||||
}
|
||||
|
||||
/* Out-of-line case for Huffman code fetching */
|
||||
|
5
src/3rdparty/libjpeg/src/jdmainct.c
vendored
5
src/3rdparty/libjpeg/src/jdmainct.c
vendored
@ -18,6 +18,7 @@
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jdmainct.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -360,7 +361,7 @@ process_data_context_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
if (*out_row_ctr >= out_rows_avail)
|
||||
return; /* Postprocessor exactly filled output buf */
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case CTX_PREPARE_FOR_IMCU:
|
||||
/* Prepare to process first M-1 row groups of this iMCU row */
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
@ -371,7 +372,7 @@ process_data_context_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
||||
if (main_ptr->iMCU_row_ctr == cinfo->total_iMCU_rows)
|
||||
set_bottom_pointers(cinfo);
|
||||
main_ptr->context_state = CTX_PROCESS_IMCU;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case CTX_PROCESS_IMCU:
|
||||
/* Call postprocessor using previously set pointers */
|
||||
(*cinfo->post->post_process_data) (cinfo,
|
||||
|
67
src/3rdparty/libjpeg/src/jdmarker.c
vendored
67
src/3rdparty/libjpeg/src/jdmarker.c
vendored
@ -151,7 +151,7 @@ typedef my_marker_reader *my_marker_ptr;
|
||||
#define INPUT_BYTE(cinfo, V, action) \
|
||||
MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
|
||||
bytes_in_buffer--; \
|
||||
V = GETJOCTET(*next_input_byte++); )
|
||||
V = *next_input_byte++; )
|
||||
|
||||
/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
|
||||
* V should be declared unsigned int or perhaps JLONG.
|
||||
@ -159,10 +159,10 @@ typedef my_marker_reader *my_marker_ptr;
|
||||
#define INPUT_2BYTES(cinfo, V, action) \
|
||||
MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
|
||||
bytes_in_buffer--; \
|
||||
V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
|
||||
V = ((unsigned int)(*next_input_byte++)) << 8; \
|
||||
MAKE_BYTE_AVAIL(cinfo, action); \
|
||||
bytes_in_buffer--; \
|
||||
V += GETJOCTET(*next_input_byte++); )
|
||||
V += *next_input_byte++; )
|
||||
|
||||
|
||||
/*
|
||||
@ -608,18 +608,18 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||
JLONG totallen = (JLONG)datalen + remaining;
|
||||
|
||||
if (datalen >= APP0_DATA_LEN &&
|
||||
GETJOCTET(data[0]) == 0x4A &&
|
||||
GETJOCTET(data[1]) == 0x46 &&
|
||||
GETJOCTET(data[2]) == 0x49 &&
|
||||
GETJOCTET(data[3]) == 0x46 &&
|
||||
GETJOCTET(data[4]) == 0) {
|
||||
data[0] == 0x4A &&
|
||||
data[1] == 0x46 &&
|
||||
data[2] == 0x49 &&
|
||||
data[3] == 0x46 &&
|
||||
data[4] == 0) {
|
||||
/* Found JFIF APP0 marker: save info */
|
||||
cinfo->saw_JFIF_marker = TRUE;
|
||||
cinfo->JFIF_major_version = GETJOCTET(data[5]);
|
||||
cinfo->JFIF_minor_version = GETJOCTET(data[6]);
|
||||
cinfo->density_unit = GETJOCTET(data[7]);
|
||||
cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
|
||||
cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
|
||||
cinfo->JFIF_major_version = data[5];
|
||||
cinfo->JFIF_minor_version = data[6];
|
||||
cinfo->density_unit = data[7];
|
||||
cinfo->X_density = (data[8] << 8) + data[9];
|
||||
cinfo->Y_density = (data[10] << 8) + data[11];
|
||||
/* Check version.
|
||||
* Major version must be 1, anything else signals an incompatible change.
|
||||
* (We used to treat this as an error, but now it's a nonfatal warning,
|
||||
@ -634,24 +634,22 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||
cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
|
||||
cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
|
||||
/* Validate thumbnail dimensions and issue appropriate messages */
|
||||
if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
|
||||
TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
|
||||
GETJOCTET(data[12]), GETJOCTET(data[13]));
|
||||
if (data[12] | data[13])
|
||||
TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, data[12], data[13]);
|
||||
totallen -= APP0_DATA_LEN;
|
||||
if (totallen !=
|
||||
((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG)3))
|
||||
if (totallen != ((JLONG)data[12] * (JLONG)data[13] * (JLONG)3))
|
||||
TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int)totallen);
|
||||
} else if (datalen >= 6 &&
|
||||
GETJOCTET(data[0]) == 0x4A &&
|
||||
GETJOCTET(data[1]) == 0x46 &&
|
||||
GETJOCTET(data[2]) == 0x58 &&
|
||||
GETJOCTET(data[3]) == 0x58 &&
|
||||
GETJOCTET(data[4]) == 0) {
|
||||
data[0] == 0x4A &&
|
||||
data[1] == 0x46 &&
|
||||
data[2] == 0x58 &&
|
||||
data[3] == 0x58 &&
|
||||
data[4] == 0) {
|
||||
/* Found JFIF "JFXX" extension APP0 marker */
|
||||
/* The library doesn't actually do anything with these,
|
||||
* but we try to produce a helpful trace message.
|
||||
*/
|
||||
switch (GETJOCTET(data[5])) {
|
||||
switch (data[5]) {
|
||||
case 0x10:
|
||||
TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int)totallen);
|
||||
break;
|
||||
@ -662,8 +660,7 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||
TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int)totallen);
|
||||
break;
|
||||
default:
|
||||
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
|
||||
GETJOCTET(data[5]), (int)totallen);
|
||||
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, data[5], (int)totallen);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -684,16 +681,16 @@ examine_app14(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||
unsigned int version, flags0, flags1, transform;
|
||||
|
||||
if (datalen >= APP14_DATA_LEN &&
|
||||
GETJOCTET(data[0]) == 0x41 &&
|
||||
GETJOCTET(data[1]) == 0x64 &&
|
||||
GETJOCTET(data[2]) == 0x6F &&
|
||||
GETJOCTET(data[3]) == 0x62 &&
|
||||
GETJOCTET(data[4]) == 0x65) {
|
||||
data[0] == 0x41 &&
|
||||
data[1] == 0x64 &&
|
||||
data[2] == 0x6F &&
|
||||
data[3] == 0x62 &&
|
||||
data[4] == 0x65) {
|
||||
/* Found Adobe APP14 marker */
|
||||
version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
|
||||
flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
|
||||
flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
|
||||
transform = GETJOCTET(data[11]);
|
||||
version = (data[5] << 8) + data[6];
|
||||
flags0 = (data[7] << 8) + data[8];
|
||||
flags1 = (data[9] << 8) + data[10];
|
||||
transform = data[11];
|
||||
TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
|
||||
cinfo->saw_Adobe_marker = TRUE;
|
||||
cinfo->Adobe_transform = (UINT8)transform;
|
||||
|
15
src/3rdparty/libjpeg/src/jdmaster.c
vendored
15
src/3rdparty/libjpeg/src/jdmaster.c
vendored
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2016, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2016, 2019, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
@ -22,7 +22,6 @@
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "jdmaster.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/*
|
||||
@ -70,17 +69,6 @@ use_merged_upsample(j_decompress_ptr cinfo)
|
||||
cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
|
||||
cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)
|
||||
return FALSE;
|
||||
#ifdef WITH_SIMD
|
||||
/* If YCbCr-to-RGB color conversion is SIMD-accelerated but merged upsampling
|
||||
isn't, then disabling merged upsampling is likely to be faster when
|
||||
decompressing YCbCr JPEG images. */
|
||||
if (!jsimd_can_h2v2_merged_upsample() && !jsimd_can_h2v1_merged_upsample() &&
|
||||
jsimd_can_ycc_rgb() && cinfo->jpeg_color_space == JCS_YCbCr &&
|
||||
(cinfo->out_color_space == JCS_RGB ||
|
||||
(cinfo->out_color_space >= JCS_EXT_RGB &&
|
||||
cinfo->out_color_space <= JCS_EXT_ARGB)))
|
||||
return FALSE;
|
||||
#endif
|
||||
/* ??? also need to test for upsample-time rescaling, when & if supported */
|
||||
return TRUE; /* by golly, it'll work... */
|
||||
#else
|
||||
@ -580,6 +568,7 @@ master_selection(j_decompress_ptr cinfo)
|
||||
*/
|
||||
cinfo->master->first_iMCU_col = 0;
|
||||
cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1;
|
||||
cinfo->master->last_good_iMCU_row = 0;
|
||||
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
/* If jpeg_start_decompress will read the whole file, initialize
|
||||
|
59
src/3rdparty/libjpeg/src/jdmerge.c
vendored
59
src/3rdparty/libjpeg/src/jdmerge.c
vendored
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -40,41 +40,13 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdmerge.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_upsampler pub; /* public fields */
|
||||
|
||||
/* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
|
||||
/* Private state for YCC->RGB conversion */
|
||||
int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
|
||||
/* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
* We need a "spare" row buffer to hold the second output row if the
|
||||
* application provides just a one-row buffer; we also use the spare
|
||||
* to discard the dummy last row if the image height is odd.
|
||||
*/
|
||||
JSAMPROW spare_row;
|
||||
boolean spare_full; /* T if spare buffer is occupied */
|
||||
|
||||
JDIMENSION out_row_width; /* samples per output row */
|
||||
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
} my_upsampler;
|
||||
|
||||
typedef my_upsampler *my_upsample_ptr;
|
||||
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
|
||||
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
|
||||
@ -189,7 +161,7 @@ typedef my_upsampler *my_upsample_ptr;
|
||||
LOCAL(void)
|
||||
build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
int i;
|
||||
JLONG x;
|
||||
SHIFT_TEMPS
|
||||
@ -232,7 +204,7 @@ build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
METHODDEF(void)
|
||||
start_pass_merged_upsample(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Mark the spare buffer empty */
|
||||
upsample->spare_full = FALSE;
|
||||
@ -254,7 +226,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 2:1 vertical sampling case: may need a spare row. */
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
JSAMPROW work_ptrs[2];
|
||||
JDIMENSION num_rows; /* number of rows returned to caller */
|
||||
|
||||
@ -305,7 +277,7 @@ merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||
/* 1:1 vertical sampling case: much easier, never need a spare row. */
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
|
||||
/* Just do the upsampling. */
|
||||
(*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
|
||||
@ -420,17 +392,14 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
#define PACK_SHORT_565_LE(r, g, b) \
|
||||
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) \
|
||||
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
|
||||
((INT16 *)(addr))[0] = (INT16)(pixels); \
|
||||
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
|
||||
@ -448,7 +417,7 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
* sufficient for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
@ -568,11 +537,11 @@ h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
GLOBAL(void)
|
||||
jinit_merged_upsampler(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_upsample_ptr upsample;
|
||||
my_merged_upsample_ptr upsample;
|
||||
|
||||
upsample = (my_upsample_ptr)
|
||||
upsample = (my_merged_upsample_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_upsampler));
|
||||
sizeof(my_merged_upsampler));
|
||||
cinfo->upsample = (struct jpeg_upsampler *)upsample;
|
||||
upsample->pub.start_pass = start_pass_merged_upsample;
|
||||
upsample->pub.need_context_rows = FALSE;
|
||||
|
47
src/3rdparty/libjpeg/src/jdmerge.h
vendored
Normal file
47
src/3rdparty/libjpeg/src/jdmerge.h
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* jdmerge.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_upsampler pub; /* public fields */
|
||||
|
||||
/* Pointer to routine to do actual upsampling/conversion of one row group */
|
||||
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
||||
|
||||
/* Private state for YCC->RGB conversion */
|
||||
int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
|
||||
/* For 2:1 vertical sampling, we produce two output rows at a time.
|
||||
* We need a "spare" row buffer to hold the second output row if the
|
||||
* application provides just a one-row buffer; we also use the spare
|
||||
* to discard the dummy last row if the image height is odd.
|
||||
*/
|
||||
JSAMPROW spare_row;
|
||||
boolean spare_full; /* T if spare buffer is occupied */
|
||||
|
||||
JDIMENSION out_row_width; /* samples per output row */
|
||||
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
||||
} my_merged_upsampler;
|
||||
|
||||
typedef my_merged_upsampler *my_merged_upsample_ptr;
|
||||
|
||||
#endif /* UPSAMPLE_MERGING_SUPPORTED */
|
78
src/3rdparty/libjpeg/src/jdmrg565.c
vendored
78
src/3rdparty/libjpeg/src/jdmrg565.c
vendored
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2014-2015, 2018, D. R. Commander.
|
||||
* Copyright (C) 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -19,7 +19,7 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@ -43,20 +43,20 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
@ -68,12 +68,12 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
y = *inptr0;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
@ -90,7 +90,7 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@ -115,21 +115,21 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
@ -142,12 +142,12 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
y = *inptr0;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
@ -163,7 +163,7 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
@ -189,20 +189,20 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
@ -211,13 +211,13 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
@ -229,20 +229,20 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
y = *inptr00;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr0 = (INT16)rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
y = *inptr01;
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
@ -259,7 +259,7 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
@ -287,21 +287,21 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
@ -311,14 +311,14 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
d1 = DITHER_ROTATE(d1);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
@ -331,20 +331,20 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
y = *inptr00;
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr0 = (INT16)rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
y = *inptr01;
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
|
40
src/3rdparty/libjpeg/src/jdmrgext.c
vendored
40
src/3rdparty/libjpeg/src/jdmrgext.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2011, 2015, D. R. Commander.
|
||||
* Copyright (C) 2011, 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -25,7 +25,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
@ -46,13 +46,13 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -60,7 +60,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
y = *inptr0++;
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -71,12 +71,12 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
}
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
y = *inptr0;
|
||||
outptr[RGB_RED] = range_limit[y + cred];
|
||||
outptr[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -97,7 +97,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
@ -120,13 +120,13 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cb = *inptr1++;
|
||||
cr = *inptr2++;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -134,7 +134,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr0[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr0 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
y = *inptr00++;
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -142,7 +142,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr0[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr0 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -150,7 +150,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
outptr1[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr1 += RGB_PIXELSIZE;
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
y = *inptr01++;
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
@ -161,19 +161,19 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
}
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cb = *inptr1;
|
||||
cr = *inptr2;
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
y = *inptr00;
|
||||
outptr0[RGB_RED] = range_limit[y + cred];
|
||||
outptr0[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr0[RGB_BLUE] = range_limit[y + cblue];
|
||||
#ifdef RGB_ALPHA
|
||||
outptr0[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
y = *inptr01;
|
||||
outptr1[RGB_RED] = range_limit[y + cred];
|
||||
outptr1[RGB_GREEN] = range_limit[y + cgreen];
|
||||
outptr1[RGB_BLUE] = range_limit[y + cblue];
|
||||
|
48
src/3rdparty/libjpeg/src/jdphuff.c
vendored
48
src/3rdparty/libjpeg/src/jdphuff.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2018-2021, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -41,25 +41,6 @@ typedef struct {
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
|
||||
/* This macro is to work around compilers with missing or broken
|
||||
* structure assignment. You'll need to fix this code if you have
|
||||
* such a compiler and you change MAX_COMPS_IN_SCAN.
|
||||
*/
|
||||
|
||||
#ifndef NO_STRUCT_ASSIGN
|
||||
#define ASSIGN_STATE(dest, src) ((dest) = (src))
|
||||
#else
|
||||
#if MAX_COMPS_IN_SCAN == 4
|
||||
#define ASSIGN_STATE(dest, src) \
|
||||
((dest).EOBRUN = (src).EOBRUN, \
|
||||
(dest).last_dc_val[0] = (src).last_dc_val[0], \
|
||||
(dest).last_dc_val[1] = (src).last_dc_val[1], \
|
||||
(dest).last_dc_val[2] = (src).last_dc_val[2], \
|
||||
(dest).last_dc_val[3] = (src).last_dc_val[3])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_entropy_decoder pub; /* public fields */
|
||||
|
||||
@ -102,7 +83,7 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo)
|
||||
boolean is_DC_band, bad;
|
||||
int ci, coefi, tbl;
|
||||
d_derived_tbl **pdtbl;
|
||||
int *coef_bit_ptr;
|
||||
int *coef_bit_ptr, *prev_coef_bit_ptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
is_DC_band = (cinfo->Ss == 0);
|
||||
@ -143,8 +124,15 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo)
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
int cindex = cinfo->cur_comp_info[ci]->component_index;
|
||||
coef_bit_ptr = &cinfo->coef_bits[cindex][0];
|
||||
prev_coef_bit_ptr = &cinfo->coef_bits[cindex + cinfo->num_components][0];
|
||||
if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
|
||||
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
|
||||
for (coefi = MIN(cinfo->Ss, 1); coefi <= MAX(cinfo->Se, 9); coefi++) {
|
||||
if (cinfo->input_scan_number > 1)
|
||||
prev_coef_bit_ptr[coefi] = coef_bit_ptr[coefi];
|
||||
else
|
||||
prev_coef_bit_ptr[coefi] = 0;
|
||||
}
|
||||
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
|
||||
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
|
||||
if (cinfo->Ah != expected)
|
||||
@ -323,7 +311,7 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
/* Load up working state */
|
||||
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
|
||||
ASSIGN_STATE(state, entropy->saved);
|
||||
state = entropy->saved;
|
||||
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
@ -356,11 +344,12 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
/* Completed MCU, so update state */
|
||||
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
||||
ASSIGN_STATE(entropy->saved, state);
|
||||
entropy->saved = state;
|
||||
}
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
entropy->restarts_to_go--;
|
||||
if (cinfo->restart_interval)
|
||||
entropy->restarts_to_go--;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -444,7 +433,8 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
}
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
entropy->restarts_to_go--;
|
||||
if (cinfo->restart_interval)
|
||||
entropy->restarts_to_go--;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -495,7 +485,8 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
entropy->restarts_to_go--;
|
||||
if (cinfo->restart_interval)
|
||||
entropy->restarts_to_go--;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -638,7 +629,8 @@ decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
}
|
||||
|
||||
/* Account for restart interval (no-op if not using restarts) */
|
||||
entropy->restarts_to_go--;
|
||||
if (cinfo->restart_interval)
|
||||
entropy->restarts_to_go--;
|
||||
|
||||
return TRUE;
|
||||
|
||||
@ -676,7 +668,7 @@ jinit_phuff_decoder(j_decompress_ptr cinfo)
|
||||
/* Create progression status table */
|
||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
cinfo->num_components * DCTSIZE2 *
|
||||
cinfo->num_components * 2 * DCTSIZE2 *
|
||||
sizeof(int));
|
||||
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
|
50
src/3rdparty/libjpeg/src/jdsample.c
vendored
50
src/3rdparty/libjpeg/src/jdsample.c
vendored
@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2019-2020, Arm Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -176,7 +177,7 @@ int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
outptr = output_data[outrow];
|
||||
outend = outptr + cinfo->output_width;
|
||||
while (outptr < outend) {
|
||||
invalue = *inptr++; /* don't need GETJSAMPLE() here */
|
||||
invalue = *inptr++;
|
||||
for (h = h_expand; h > 0; h--) {
|
||||
*outptr++ = invalue;
|
||||
}
|
||||
@ -212,7 +213,7 @@ h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
outptr = output_data[inrow];
|
||||
outend = outptr + cinfo->output_width;
|
||||
while (outptr < outend) {
|
||||
invalue = *inptr++; /* don't need GETJSAMPLE() here */
|
||||
invalue = *inptr++;
|
||||
*outptr++ = invalue;
|
||||
*outptr++ = invalue;
|
||||
}
|
||||
@ -241,7 +242,7 @@ h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
outptr = output_data[outrow];
|
||||
outend = outptr + cinfo->output_width;
|
||||
while (outptr < outend) {
|
||||
invalue = *inptr++; /* don't need GETJSAMPLE() here */
|
||||
invalue = *inptr++;
|
||||
*outptr++ = invalue;
|
||||
*outptr++ = invalue;
|
||||
}
|
||||
@ -282,20 +283,20 @@ h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
inptr = input_data[inrow];
|
||||
outptr = output_data[inrow];
|
||||
/* Special case for first column */
|
||||
invalue = GETJSAMPLE(*inptr++);
|
||||
invalue = *inptr++;
|
||||
*outptr++ = (JSAMPLE)invalue;
|
||||
*outptr++ = (JSAMPLE)((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
|
||||
*outptr++ = (JSAMPLE)((invalue * 3 + inptr[0] + 2) >> 2);
|
||||
|
||||
for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
|
||||
/* General case: 3/4 * nearer pixel + 1/4 * further pixel */
|
||||
invalue = GETJSAMPLE(*inptr++) * 3;
|
||||
*outptr++ = (JSAMPLE)((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
|
||||
*outptr++ = (JSAMPLE)((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
|
||||
invalue = (*inptr++) * 3;
|
||||
*outptr++ = (JSAMPLE)((invalue + inptr[-2] + 1) >> 2);
|
||||
*outptr++ = (JSAMPLE)((invalue + inptr[0] + 2) >> 2);
|
||||
}
|
||||
|
||||
/* Special case for last column */
|
||||
invalue = GETJSAMPLE(*inptr);
|
||||
*outptr++ = (JSAMPLE)((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
|
||||
invalue = *inptr;
|
||||
*outptr++ = (JSAMPLE)((invalue * 3 + inptr[-1] + 1) >> 2);
|
||||
*outptr++ = (JSAMPLE)invalue;
|
||||
}
|
||||
}
|
||||
@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr0, inptr1, outptr;
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
int thiscolsum;
|
||||
int thiscolsum, bias;
|
||||
#else
|
||||
JLONG thiscolsum;
|
||||
JLONG thiscolsum, bias;
|
||||
#endif
|
||||
JDIMENSION colctr;
|
||||
int inrow, outrow, v;
|
||||
@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
for (v = 0; v < 2; v++) {
|
||||
/* inptr0 points to nearest input row, inptr1 points to next nearest */
|
||||
inptr0 = input_data[inrow];
|
||||
if (v == 0) /* next nearest is row above */
|
||||
if (v == 0) { /* next nearest is row above */
|
||||
inptr1 = input_data[inrow - 1];
|
||||
else /* next nearest is row below */
|
||||
bias = 1;
|
||||
} else { /* next nearest is row below */
|
||||
inptr1 = input_data[inrow + 1];
|
||||
bias = 2;
|
||||
}
|
||||
outptr = output_data[outrow++];
|
||||
|
||||
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
|
||||
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
|
||||
thiscolsum = (*inptr0++) * 3 + (*inptr1++);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
|
||||
}
|
||||
}
|
||||
inrow++;
|
||||
@ -377,8 +381,8 @@ h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
outptr = output_data[outrow++];
|
||||
|
||||
/* Special case for first column */
|
||||
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||
nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||
thiscolsum = (*inptr0++) * 3 + (*inptr1++);
|
||||
nextcolsum = (*inptr0++) * 3 + (*inptr1++);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum * 4 + 8) >> 4);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum * 3 + nextcolsum + 7) >> 4);
|
||||
lastcolsum = thiscolsum; thiscolsum = nextcolsum;
|
||||
@ -386,7 +390,7 @@ h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
|
||||
/* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
|
||||
/* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
|
||||
nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||
nextcolsum = (*inptr0++) * 3 + (*inptr1++);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum * 3 + lastcolsum + 8) >> 4);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum * 3 + nextcolsum + 7) >> 4);
|
||||
lastcolsum = thiscolsum; thiscolsum = nextcolsum;
|
||||
@ -473,7 +477,13 @@ jinit_upsampler(j_decompress_ptr cinfo)
|
||||
} else if (h_in_group == h_out_group &&
|
||||
v_in_group * 2 == v_out_group && do_fancy) {
|
||||
/* Non-fancy upsampling is handled by the generic method */
|
||||
upsample->methods[ci] = h1v2_fancy_upsample;
|
||||
#if defined(__arm__) || defined(__aarch64__) || \
|
||||
defined(_M_ARM) || defined(_M_ARM64)
|
||||
if (jsimd_can_h1v2_fancy_upsample())
|
||||
upsample->methods[ci] = jsimd_h1v2_fancy_upsample;
|
||||
else
|
||||
#endif
|
||||
upsample->methods[ci] = h1v2_fancy_upsample;
|
||||
upsample->pub.need_context_rows = TRUE;
|
||||
} else if (h_in_group * 2 == h_out_group &&
|
||||
v_in_group * 2 == v_out_group) {
|
||||
|
5
src/3rdparty/libjpeg/src/jdtrans.c
vendored
5
src/3rdparty/libjpeg/src/jdtrans.c
vendored
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -16,6 +16,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
13
src/3rdparty/libjpeg/src/jerror.h
vendored
13
src/3rdparty/libjpeg/src/jerror.h
vendored
@ -207,6 +207,10 @@ JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
|
||||
#endif
|
||||
#endif
|
||||
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
|
||||
#if JPEG_LIB_VERSION < 70
|
||||
JMESSAGE(JERR_BAD_DROP_SAMPLING,
|
||||
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
|
||||
#endif
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
@ -252,6 +256,15 @@ JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
|
||||
(cinfo)->err->msg_parm.i[2] = (p3), \
|
||||
(cinfo)->err->msg_parm.i[3] = (p4), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(cinfo)->err->msg_parm.i[2] = (p3), \
|
||||
(cinfo)->err->msg_parm.i[3] = (p4), \
|
||||
(cinfo)->err->msg_parm.i[4] = (p5), \
|
||||
(cinfo)->err->msg_parm.i[5] = (p6), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXITS(cinfo, code, str) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
|
||||
|
6
src/3rdparty/libjpeg/src/jfdctint.c
vendored
6
src/3rdparty/libjpeg/src/jfdctint.c
vendored
@ -1,14 +1,14 @@
|
||||
/*
|
||||
* jfdctint.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a slow-but-accurate integer implementation of the
|
||||
* This file contains a slower but more accurate integer implementation of the
|
||||
* forward DCT (Discrete Cosine Transform).
|
||||
*
|
||||
* A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
|
||||
|
14
src/3rdparty/libjpeg/src/jidctint.c
vendored
14
src/3rdparty/libjpeg/src/jidctint.c
vendored
@ -1,15 +1,15 @@
|
||||
/*
|
||||
* jidctint.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modification developed 2002-2009 by Guido Vollbeding.
|
||||
* Modification developed 2002-2018 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* Copyright (C) 2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a slow-but-accurate integer implementation of the
|
||||
* This file contains a slower but more accurate integer implementation of the
|
||||
* inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
|
||||
* must also perform dequantization of the input coefficients.
|
||||
*
|
||||
@ -417,7 +417,7 @@ jpeg_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
|
||||
/*
|
||||
* Perform dequantization and inverse DCT on one block of coefficients,
|
||||
* producing a 7x7 output block.
|
||||
* producing a reduced-size 7x7 output block.
|
||||
*
|
||||
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
||||
* cK represents sqrt(2) * cos(K*pi/14).
|
||||
@ -1258,7 +1258,7 @@ jpeg_idct_10x10(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
|
||||
/*
|
||||
* Perform dequantization and inverse DCT on one block of coefficients,
|
||||
* producing a 11x11 output block.
|
||||
* producing an 11x11 output block.
|
||||
*
|
||||
* Optimized algorithm with 24 multiplications in the 1-D kernel.
|
||||
* cK represents sqrt(2) * cos(K*pi/22).
|
||||
@ -2398,7 +2398,7 @@ jpeg_idct_16x16(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
|
||||
tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);
|
||||
/* Add fudge factor here for final descale. */
|
||||
tmp0 += 1 << (CONST_BITS - PASS1_BITS - 1);
|
||||
tmp0 += ONE << (CONST_BITS - PASS1_BITS - 1);
|
||||
|
||||
z1 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
|
||||
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
|
||||
|
2
src/3rdparty/libjpeg/src/jidctred.c
vendored
2
src/3rdparty/libjpeg/src/jidctred.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jidctred.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
|
6
src/3rdparty/libjpeg/src/jmemmgr.c
vendored
6
src/3rdparty/libjpeg/src/jmemmgr.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2016, D. R. Commander.
|
||||
* Copyright (C) 2016, 2021, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -1032,7 +1032,7 @@ free_pool(j_common_ptr cinfo, int pool_id)
|
||||
large_pool_ptr next_lhdr_ptr = lhdr_ptr->next;
|
||||
space_freed = lhdr_ptr->bytes_used +
|
||||
lhdr_ptr->bytes_left +
|
||||
sizeof(large_pool_hdr);
|
||||
sizeof(large_pool_hdr) + ALIGN_SIZE - 1;
|
||||
jpeg_free_large(cinfo, (void *)lhdr_ptr, space_freed);
|
||||
mem->total_space_allocated -= space_freed;
|
||||
lhdr_ptr = next_lhdr_ptr;
|
||||
@ -1045,7 +1045,7 @@ free_pool(j_common_ptr cinfo, int pool_id)
|
||||
while (shdr_ptr != NULL) {
|
||||
small_pool_ptr next_shdr_ptr = shdr_ptr->next;
|
||||
space_freed = shdr_ptr->bytes_used + shdr_ptr->bytes_left +
|
||||
sizeof(small_pool_hdr);
|
||||
sizeof(small_pool_hdr) + ALIGN_SIZE - 1;
|
||||
jpeg_free_small(cinfo, (void *)shdr_ptr, space_freed);
|
||||
mem->total_space_allocated -= space_freed;
|
||||
shdr_ptr = next_shdr_ptr;
|
||||
|
43
src/3rdparty/libjpeg/src/jmorecfg.h
vendored
43
src/3rdparty/libjpeg/src/jmorecfg.h
vendored
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -43,25 +43,11 @@
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
/* JSAMPLE should be the smallest type that will hold the values 0..255.
|
||||
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
|
||||
typedef unsigned char JSAMPLE;
|
||||
#define GETJSAMPLE(value) ((int)(value))
|
||||
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JSAMPLE;
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
#define GETJSAMPLE(value) ((int)(value))
|
||||
#else
|
||||
#define GETJSAMPLE(value) ((int)(value) & 0xFF)
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
#define MAXJSAMPLE 255
|
||||
#define CENTERJSAMPLE 128
|
||||
|
||||
@ -97,22 +83,9 @@ typedef short JCOEF;
|
||||
* managers, this is also the data type passed to fread/fwrite.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
|
||||
typedef unsigned char JOCTET;
|
||||
#define GETJOCTET(value) (value)
|
||||
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
|
||||
typedef char JOCTET;
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
#define GETJOCTET(value) (value)
|
||||
#else
|
||||
#define GETJOCTET(value) ((value) & 0xFF)
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
|
||||
/* These typedefs are used for various table entries and so forth.
|
||||
* They must be at least as wide as specified; but making them too big
|
||||
@ -123,15 +96,7 @@ typedef char JOCTET;
|
||||
|
||||
/* UINT8 must hold at least the values 0..255. */
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
typedef unsigned char UINT8;
|
||||
#else /* not HAVE_UNSIGNED_CHAR */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
typedef char UINT8;
|
||||
#else /* not __CHAR_UNSIGNED__ */
|
||||
typedef short UINT8;
|
||||
#endif /* __CHAR_UNSIGNED__ */
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
/* UINT16 must hold at least the values 0..65535. */
|
||||
|
||||
@ -273,9 +238,9 @@ typedef int boolean;
|
||||
|
||||
/* Capability options common to encoder and decoder: */
|
||||
|
||||
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
|
||||
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
|
||||
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
|
||||
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
|
||||
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
|
||||
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
|
||||
|
||||
/* Encoder capability options: */
|
||||
|
||||
|
3
src/3rdparty/libjpeg/src/jpegcomp.h
vendored
3
src/3rdparty/libjpeg/src/jpegcomp.h
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jpegcomp.h
|
||||
*
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* Copyright (C) 2010, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -19,6 +19,7 @@
|
||||
#define _min_DCT_v_scaled_size min_DCT_v_scaled_size
|
||||
#define _jpeg_width jpeg_width
|
||||
#define _jpeg_height jpeg_height
|
||||
#define JERR_ARITH_NOTIMPL JERR_NOT_COMPILED
|
||||
#else
|
||||
#define _DCT_scaled_size DCT_scaled_size
|
||||
#define _DCT_h_scaled_size DCT_scaled_size
|
||||
|
18
src/3rdparty/libjpeg/src/jpegint.h
vendored
18
src/3rdparty/libjpeg/src/jpegint.h
vendored
@ -5,8 +5,9 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2021, Alex Richardson.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -47,6 +48,18 @@ typedef enum { /* Operating modes for buffer controllers */
|
||||
/* JLONG must hold at least signed 32-bit values. */
|
||||
typedef long JLONG;
|
||||
|
||||
/* JUINTPTR must hold pointer values. */
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
/*
|
||||
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
|
||||
* Fortunately, that is sufficient to support the few architectures for which
|
||||
* sizeof(void *) != sizeof(size_t). The only other options would require C99
|
||||
* or Clang-specific builtins.
|
||||
*/
|
||||
typedef __UINTPTR_TYPE__ JUINTPTR;
|
||||
#else
|
||||
typedef size_t JUINTPTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Left shift macro that handles a negative operand without causing any
|
||||
@ -158,6 +171,9 @@ struct jpeg_decomp_master {
|
||||
JDIMENSION first_MCU_col[MAX_COMPONENTS];
|
||||
JDIMENSION last_MCU_col[MAX_COMPONENTS];
|
||||
boolean jinit_upsampler_no_alloc;
|
||||
|
||||
/* Last iMCU row that was successfully decoded */
|
||||
JDIMENSION last_good_iMCU_row;
|
||||
};
|
||||
|
||||
/* Input control module */
|
||||
|
8
src/3rdparty/libjpeg/src/jpeglib.h
vendored
8
src/3rdparty/libjpeg/src/jpeglib.h
vendored
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -244,9 +244,9 @@ typedef enum {
|
||||
/* DCT/IDCT algorithm options. */
|
||||
|
||||
typedef enum {
|
||||
JDCT_ISLOW, /* slow but accurate integer algorithm */
|
||||
JDCT_IFAST, /* faster, less accurate integer method */
|
||||
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
|
||||
JDCT_ISLOW, /* accurate integer method */
|
||||
JDCT_IFAST, /* less accurate integer method [legacy feature] */
|
||||
JDCT_FLOAT /* floating-point method [legacy feature] */
|
||||
} J_DCT_METHOD;
|
||||
|
||||
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
|
||||
|
29
src/3rdparty/libjpeg/src/jquant1.c
vendored
29
src/3rdparty/libjpeg/src/jquant1.c
vendored
@ -154,7 +154,7 @@ typedef struct {
|
||||
*/
|
||||
boolean is_padded; /* is the colorindex padded for odither? */
|
||||
|
||||
int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */
|
||||
int Ncolors[MAX_Q_COMPS]; /* # of values allocated to each component */
|
||||
|
||||
/* Variables for ordered dithering */
|
||||
int row_index; /* cur row's vertical index in dither matrix */
|
||||
@ -479,7 +479,7 @@ color_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
for (col = width; col > 0; col--) {
|
||||
pixcode = 0;
|
||||
for (ci = 0; ci < nc; ci++) {
|
||||
pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
|
||||
pixcode += colorindex[ci][*ptrin++];
|
||||
}
|
||||
*ptrout++ = (JSAMPLE)pixcode;
|
||||
}
|
||||
@ -506,9 +506,9 @@ color_quantize3(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
ptrin = input_buf[row];
|
||||
ptrout = output_buf[row];
|
||||
for (col = width; col > 0; col--) {
|
||||
pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
|
||||
pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
|
||||
pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
|
||||
pixcode = colorindex0[*ptrin++];
|
||||
pixcode += colorindex1[*ptrin++];
|
||||
pixcode += colorindex2[*ptrin++];
|
||||
*ptrout++ = (JSAMPLE)pixcode;
|
||||
}
|
||||
}
|
||||
@ -552,7 +552,7 @@ quantize_ord_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
* required amount of padding.
|
||||
*/
|
||||
*output_ptr +=
|
||||
colorindex_ci[GETJSAMPLE(*input_ptr) + dither[col_index]];
|
||||
colorindex_ci[*input_ptr + dither[col_index]];
|
||||
input_ptr += nc;
|
||||
output_ptr++;
|
||||
col_index = (col_index + 1) & ODITHER_MASK;
|
||||
@ -595,12 +595,9 @@ quantize3_ord_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
col_index = 0;
|
||||
|
||||
for (col = width; col > 0; col--) {
|
||||
pixcode =
|
||||
GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + dither0[col_index]]);
|
||||
pixcode +=
|
||||
GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + dither1[col_index]]);
|
||||
pixcode +=
|
||||
GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + dither2[col_index]]);
|
||||
pixcode = colorindex0[(*input_ptr++) + dither0[col_index]];
|
||||
pixcode += colorindex1[(*input_ptr++) + dither1[col_index]];
|
||||
pixcode += colorindex2[(*input_ptr++) + dither2[col_index]];
|
||||
*output_ptr++ = (JSAMPLE)pixcode;
|
||||
col_index = (col_index + 1) & ODITHER_MASK;
|
||||
}
|
||||
@ -677,15 +674,15 @@ quantize_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
* The maximum error is +- MAXJSAMPLE; this sets the required size
|
||||
* of the range_limit array.
|
||||
*/
|
||||
cur += GETJSAMPLE(*input_ptr);
|
||||
cur = GETJSAMPLE(range_limit[cur]);
|
||||
cur += *input_ptr;
|
||||
cur = range_limit[cur];
|
||||
/* Select output value, accumulate into output code for this pixel */
|
||||
pixcode = GETJSAMPLE(colorindex_ci[cur]);
|
||||
pixcode = colorindex_ci[cur];
|
||||
*output_ptr += (JSAMPLE)pixcode;
|
||||
/* Compute actual representation error at this pixel */
|
||||
/* Note: we can do this even though we don't have the final */
|
||||
/* pixel code, because the colormap is orthogonal. */
|
||||
cur -= GETJSAMPLE(colormap_ci[pixcode]);
|
||||
cur -= colormap_ci[pixcode];
|
||||
/* Compute error fractions to be propagated to adjacent pixels.
|
||||
* Add these into the running sums, and simultaneously shift the
|
||||
* next-line error sums left by 1 column.
|
||||
|
52
src/3rdparty/libjpeg/src/jquant2.c
vendored
52
src/3rdparty/libjpeg/src/jquant2.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2009, 2014-2015, 2020, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@ -215,9 +215,9 @@ prescan_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
ptr = input_buf[row];
|
||||
for (col = width; col > 0; col--) {
|
||||
/* get pixel value and index into the histogram */
|
||||
histp = &histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
|
||||
[GETJSAMPLE(ptr[1]) >> C1_SHIFT]
|
||||
[GETJSAMPLE(ptr[2]) >> C2_SHIFT];
|
||||
histp = &histogram[ptr[0] >> C0_SHIFT]
|
||||
[ptr[1] >> C1_SHIFT]
|
||||
[ptr[2] >> C2_SHIFT];
|
||||
/* increment, check for overflow and undo increment if so. */
|
||||
if (++(*histp) <= 0)
|
||||
(*histp)--;
|
||||
@ -665,7 +665,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
|
||||
|
||||
for (i = 0; i < numcolors; i++) {
|
||||
/* We compute the squared-c0-distance term, then add in the other two. */
|
||||
x = GETJSAMPLE(cinfo->colormap[0][i]);
|
||||
x = cinfo->colormap[0][i];
|
||||
if (x < minc0) {
|
||||
tdist = (x - minc0) * C0_SCALE;
|
||||
min_dist = tdist * tdist;
|
||||
@ -688,7 +688,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
|
||||
}
|
||||
}
|
||||
|
||||
x = GETJSAMPLE(cinfo->colormap[1][i]);
|
||||
x = cinfo->colormap[1][i];
|
||||
if (x < minc1) {
|
||||
tdist = (x - minc1) * C1_SCALE;
|
||||
min_dist += tdist * tdist;
|
||||
@ -710,7 +710,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
|
||||
}
|
||||
}
|
||||
|
||||
x = GETJSAMPLE(cinfo->colormap[2][i]);
|
||||
x = cinfo->colormap[2][i];
|
||||
if (x < minc2) {
|
||||
tdist = (x - minc2) * C2_SCALE;
|
||||
min_dist += tdist * tdist;
|
||||
@ -788,13 +788,13 @@ find_best_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
|
||||
#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)
|
||||
|
||||
for (i = 0; i < numcolors; i++) {
|
||||
icolor = GETJSAMPLE(colorlist[i]);
|
||||
icolor = colorlist[i];
|
||||
/* Compute (square of) distance from minc0/c1/c2 to this color */
|
||||
inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
|
||||
inc0 = (minc0 - cinfo->colormap[0][icolor]) * C0_SCALE;
|
||||
dist0 = inc0 * inc0;
|
||||
inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
|
||||
inc1 = (minc1 - cinfo->colormap[1][icolor]) * C1_SCALE;
|
||||
dist0 += inc1 * inc1;
|
||||
inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
|
||||
inc2 = (minc2 - cinfo->colormap[2][icolor]) * C2_SCALE;
|
||||
dist0 += inc2 * inc2;
|
||||
/* Form the initial difference increments */
|
||||
inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
|
||||
@ -879,7 +879,7 @@ fill_inverse_cmap(j_decompress_ptr cinfo, int c0, int c1, int c2)
|
||||
for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
|
||||
cachep = &histogram[c0 + ic0][c1 + ic1][c2];
|
||||
for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
|
||||
*cachep++ = (histcell)(GETJSAMPLE(*cptr++) + 1);
|
||||
*cachep++ = (histcell)((*cptr++) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -909,9 +909,9 @@ pass2_no_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
outptr = output_buf[row];
|
||||
for (col = width; col > 0; col--) {
|
||||
/* get pixel value and index into the cache */
|
||||
c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
|
||||
c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
|
||||
c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
|
||||
c0 = (*inptr++) >> C0_SHIFT;
|
||||
c1 = (*inptr++) >> C1_SHIFT;
|
||||
c2 = (*inptr++) >> C2_SHIFT;
|
||||
cachep = &histogram[c0][c1][c2];
|
||||
/* If we have not seen this color before, find nearest colormap entry */
|
||||
/* and update the cache */
|
||||
@ -996,12 +996,12 @@ pass2_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
* The maximum error is +- MAXJSAMPLE (or less with error limiting);
|
||||
* this sets the required size of the range_limit array.
|
||||
*/
|
||||
cur0 += GETJSAMPLE(inptr[0]);
|
||||
cur1 += GETJSAMPLE(inptr[1]);
|
||||
cur2 += GETJSAMPLE(inptr[2]);
|
||||
cur0 = GETJSAMPLE(range_limit[cur0]);
|
||||
cur1 = GETJSAMPLE(range_limit[cur1]);
|
||||
cur2 = GETJSAMPLE(range_limit[cur2]);
|
||||
cur0 += inptr[0];
|
||||
cur1 += inptr[1];
|
||||
cur2 += inptr[2];
|
||||
cur0 = range_limit[cur0];
|
||||
cur1 = range_limit[cur1];
|
||||
cur2 = range_limit[cur2];
|
||||
/* Index into the cache with adjusted pixel value */
|
||||
cachep =
|
||||
&histogram[cur0 >> C0_SHIFT][cur1 >> C1_SHIFT][cur2 >> C2_SHIFT];
|
||||
@ -1015,9 +1015,9 @@ pass2_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
register int pixcode = *cachep - 1;
|
||||
*outptr = (JSAMPLE)pixcode;
|
||||
/* Compute representation error for this pixel */
|
||||
cur0 -= GETJSAMPLE(colormap0[pixcode]);
|
||||
cur1 -= GETJSAMPLE(colormap1[pixcode]);
|
||||
cur2 -= GETJSAMPLE(colormap2[pixcode]);
|
||||
cur0 -= colormap0[pixcode];
|
||||
cur1 -= colormap1[pixcode];
|
||||
cur2 -= colormap2[pixcode];
|
||||
}
|
||||
/* Compute error fractions to be propagated to adjacent pixels.
|
||||
* Add these into the running sums, and simultaneously shift the
|
||||
@ -1145,7 +1145,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan)
|
||||
int i;
|
||||
|
||||
/* Only F-S dithering or no dithering is supported. */
|
||||
/* If user asks for ordered dither, give him F-S. */
|
||||
/* If user asks for ordered dither, give them F-S. */
|
||||
if (cinfo->dither_mode != JDITHER_NONE)
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
|
||||
@ -1263,7 +1263,7 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo)
|
||||
cquantize->sv_colormap = NULL;
|
||||
|
||||
/* Only F-S dithering or no dithering is supported. */
|
||||
/* If user asks for ordered dither, give him F-S. */
|
||||
/* If user asks for ordered dither, give them F-S. */
|
||||
if (cinfo->dither_mode != JDITHER_NONE)
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
|
||||
|
6
src/3rdparty/libjpeg/src/jsimd.h
vendored
6
src/3rdparty/libjpeg/src/jsimd.h
vendored
@ -4,6 +4,7 @@
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011, 2014, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@ -75,6 +76,7 @@ EXTERN(void) jsimd_int_upsample(j_decompress_ptr cinfo,
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
|
||||
EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
|
||||
EXTERN(int) jsimd_can_h1v2_fancy_upsample(void);
|
||||
|
||||
EXTERN(void) jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr,
|
||||
@ -84,6 +86,10 @@ EXTERN(void) jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr);
|
||||
EXTERN(void) jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr);
|
||||
|
||||
EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
|
||||
EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user