<s>
libjpeg	B-Language
is	O
a	O
free	O
library	B-Library
with	O
functions	O
for	O
handling	O
the	O
JPEG	O
image	O
data	O
format	O
.	O
</s>
<s>
It	O
implements	O
a	O
JPEG	O
codec	B-General_Concept
(	O
encoding	O
and	O
decoding	O
)	O
alongside	O
various	O
utilities	O
for	O
handling	O
JPEG	O
data	O
.	O
</s>
<s>
It	O
is	O
written	O
in	O
C	B-Language
and	O
distributed	O
as	O
free	B-Application
software	I-Application
together	O
with	O
its	O
source	O
code	O
under	O
the	O
terms	O
of	O
a	O
custom	O
permissive	B-License
(	O
BSD-like	O
)	O
free	B-Application
software	I-Application
license	O
,	O
which	O
demands	O
attribution	O
.	O
</s>
<s>
The	O
original	O
variant	O
is	O
maintained	O
and	O
published	O
by	O
the	O
Independent	B-Language
JPEG	I-Language
Group	I-Language
(	O
IJG	O
)	O
.	O
</s>
<s>
Meanwhile	O
,	O
there	O
are	O
several	O
forks	B-Application
with	O
additional	O
features	O
.	O
</s>
<s>
The	O
following	O
utility	O
programs	O
are	O
shipped	O
together	O
with	O
libjpeg	B-Language
:	O
</s>
<s>
jpegtran	B-Language
for	O
transformation	O
of	O
existing	O
JPEG	O
files	O
.	O
</s>
<s>
The	O
command-line	B-Application
program	I-Application
jpegtran	B-Language
provides	O
several	O
features	O
for	O
reformatting	O
and	O
recoding	O
the	O
representation	O
of	O
the	O
DCT	B-General_Concept
coefficients	O
,	O
for	O
transformation	O
of	O
actual	O
image	O
data	O
and	O
for	O
discarding	O
auxiliary	O
data	O
in	O
JPEG	O
files	O
,	O
respectively	O
.	O
</s>
<s>
optimisation	O
of	O
the	O
Huffman	B-General_Concept
coding	I-General_Concept
layer	O
of	O
a	O
JPEG	O
file	O
to	O
increase	O
compression	O
,	O
</s>
<s>
conversion	O
between	O
Huffman	B-General_Concept
and	O
arithmetic	B-Algorithm
coding	I-Algorithm
in	O
the	O
entropy	B-Algorithm
coding	I-Algorithm
layer	O
.	O
</s>
<s>
These	O
transformations	O
are	O
each	O
completely	O
lossless	B-Algorithm
and	O
reversible	O
.	O
</s>
<s>
These	O
are	O
lossless	B-Algorithm
and	O
reversible	O
only	O
regarding	O
the	O
image	O
data	O
that	O
is	O
kept	O
.	O
</s>
<s>
Reencoding	O
with	O
repeated	O
lossy	O
quantisation	O
of	O
the	O
image	O
data	O
(	O
generation	B-General_Concept
loss	I-General_Concept
)	O
does	O
not	O
take	O
place	O
.	O
</s>
<s>
There	O
is	O
an	O
associated	O
Windows	O
application	O
,	O
,	O
which	O
provides	O
a	O
user	O
interface	O
to	O
jpegtran	B-Language
.	O
</s>
<s>
For	O
Unix-like	B-Operating_System
systems	I-Operating_System
like	O
Linux	B-Application
there	O
is	O
the	O
free	O
with	O
similar	O
functionality	O
.	O
</s>
<s>
More	O
programs	O
supporting	O
JPEG	O
lossless	B-Algorithm
transformation	O
functions	O
based	O
on	O
the	O
IJG	O
code	O
are	O
given	O
on	O
the	O
.	O
</s>
<s>
The	O
JPEG	O
implementation	O
of	O
the	O
Independent	B-Language
JPEG	I-Language
Group	I-Language
(	O
IJG	O
)	O
was	O
first	O
publicly	O
released	O
on	O
7	O
October	O
1991	O
and	O
has	O
been	O
considerably	O
developed	O
since	O
that	O
time	O
.	O
</s>
<s>
The	O
open-source	B-Application
implementation	O
of	O
the	O
IJG	O
was	O
one	O
of	O
the	O
major	O
open-source	B-Application
packages	O
and	O
was	O
key	O
to	O
the	O
success	O
of	O
the	O
JPEG	O
standard	O
.	O
</s>
<s>
The	O
version	O
6	O
from	O
2	O
August	O
1995	O
came	O
with	O
support	O
for	O
progressive	O
JPEG	O
and	O
for	O
the	O
first	O
time	O
with	O
the	O
utility	O
program	O
jpegtran	B-Language
.	O
</s>
<s>
From	O
version	O
6b	O
of	O
libjpeg	B-Language
of	O
27	O
March	O
1998	O
,	O
Miyasaka	O
Masaru	O
forked	O
a	O
branch	O
named	O
libjpeg/SIMD	O
,	O
which	O
included	O
x86	O
SIMD	B-Device
optimisations	O
.	O
</s>
<s>
On	O
that	O
basis	O
the	O
libjpeg-turbo	O
project	O
was	O
created	O
in	O
2010	O
.	O
</s>
<s>
On	O
4	O
March	O
2014	O
,	O
the	O
first	O
version	O
of	O
the	O
filesize-optimising	O
fork	B-Application
mozjpeg	O
was	O
published	O
.	O
</s>
<s>
For	O
this	O
version	O
Josh	O
Aas	O
from	O
Mozilla	B-Operating_System
Research	I-Operating_System
reworked	O
the	O
Perl	B-Language
script	O
jpegcrush	O
from	O
x264	B-Language
's	O
main	O
developer	O
Loren	O
Merritt	O
and	O
integrated	O
it	O
into	O
the	O
code	O
base	O
of	O
libjpeg-turbo	O
.	O
</s>
<s>
On	O
10	O
July	O
2014	O
,	O
Mozilla	B-Operating_System
released	O
version	O
2.0	O
,	O
which	O
mainly	O
added	O
trellis	B-General_Concept
quantisation	I-General_Concept
and	O
is	O
now	O
able	O
to	O
reduce	O
the	O
size	O
of	O
baseline	O
JPEGs	O
also	O
.	O
</s>
<s>
Facebook	B-Application
,	O
Inc	O
.	O
donated	O
for	O
the	O
development	O
of	O
the	O
next	O
version	O
,	O
and	O
CloudFlare	B-Application
assigned	O
a	O
developer	O
for	O
the	O
improvement	O
of	O
mozjpeg	O
.	O
</s>
<s>
In	O
2019	O
,	O
libjpeg-turbo	O
became	O
the	O
ISO	O
and	O
ITU	O
endorsed	O
reference	O
implementation	O
for	O
the	O
JPEG	O
format	O
.	O
</s>
<s>
After	O
11	O
years	O
and	O
a	O
change	O
in	O
leadership	O
,	O
the	O
IJG	O
under	O
Guido	O
Vollbeding	O
released	O
new	O
versions	O
of	O
libjpeg	B-Language
(	O
7	O
through	O
9	O
)	O
,	O
of	O
which	O
each	O
broke	O
ABI	B-Operating_System
compatibility	O
with	O
previous	O
versions	O
.	O
</s>
<s>
In	O
version	O
7	O
,	O
support	O
for	O
arithmetic	B-Algorithm
coding	I-Algorithm
was	O
introduced	O
,	O
which	O
earlier	O
has	O
been	O
rejected	O
because	O
of	O
the	O
patent	O
situation	O
,	O
as	O
well	O
as	O
the	O
crop	O
feature	O
in	O
jpegtran	B-Language
(	O
-crop	O
)	O
.	O
</s>
<s>
Well-known	O
forks	B-Application
are	O
libjpeg-turbo	O
,	O
which	O
optimises	O
for	O
speed	O
of	O
execution	O
,	O
and	O
mozjpeg	O
,	O
which	O
optimises	O
for	O
smaller	O
file	O
sizes	O
.	O
</s>
<s>
There	O
is	O
also	O
a	O
similarly	O
named	O
library	B-Library
from	O
the	O
ISO	O
,	O
which	O
aims	O
to	O
be	O
a	O
complete	O
implementation	O
of	O
JPEG	O
,	O
JPEG	O
XT	O
and	O
JPEG-LS	O
standards	O
.	O
</s>
<s>
libjpeg-turbo	O
is	O
a	O
fork	B-Application
of	O
libjpeg	B-Language
that	O
uses	O
SIMD	B-Device
instructions	B-General_Concept
to	O
accelerate	O
baseline	O
JPEG	O
encoding	O
and	O
decoding	O
.	O
</s>
<s>
Many	O
projects	O
are	O
now	O
using	O
libjpeg-turbo	O
instead	O
of	O
libjpeg	B-Language
,	O
including	O
popular	O
Linux	B-Application
distributions	O
(	O
Fedora	O
,	O
Debian	O
,	O
Mageia	O
,	O
openSUSE	B-Operating_System
,	O
...	O
)	O
,	O
Mozilla	B-Operating_System
,	O
and	O
Chrome	B-Application
.	O
</s>
<s>
Apart	O
from	O
performance	O
,	O
some	O
projects	O
have	O
chosen	O
to	O
use	O
libjpeg-turbo	O
because	O
it	O
allows	O
them	O
to	O
retain	O
backward	O
ABI	B-Operating_System
compatibility	O
with	O
the	O
older	O
libjpeg	B-Language
v6b	O
release	O
.	O
</s>
<s>
libjpeg	B-Language
v7	O
,	O
v8	O
and	O
v9	O
broke	O
ABI	B-Operating_System
compatibility	O
with	O
prior	O
releases	O
.	O
</s>
<s>
libjpeg-turbo	O
implements	O
the	O
standard-compliant	O
arithmetic	B-Algorithm
coding	I-Algorithm
and	O
lossless	B-Algorithm
crop	O
features	O
seen	O
in	O
libjpeg	B-Language
v7	O
.	O
</s>
<s>
It	O
can	O
also	O
be	O
configured	O
to	O
be	O
compatible	O
with	O
the	O
libjpeg	B-Language
v7	O
or	O
v8	O
ABI	B-Operating_System
,	O
but	O
it	O
does	O
implement	O
DCT	B-General_Concept
scaling	O
and	O
the	O
proprietary	O
SmartScale	O
,	O
which	O
builds	O
on	O
DCT	B-General_Concept
scaling	O
.	O
</s>
<s>
libjpeg-turbo	O
chooses	O
not	O
to	O
support	O
SmartScale	O
,	O
because	O
it	O
is	O
not	O
an	O
ITU-T	O
standard	O
and	O
because	O
their	O
own	O
research	O
finds	O
it	O
(	O
and	O
DCT	B-General_Concept
scaling	O
)	O
ineffective	O
.	O
</s>
<s>
By	O
extension	O
,	O
since	O
the	O
only	O
major	O
new	O
feature	O
in	O
libjpeg	B-Language
v9	O
is	O
specific	O
to	O
the	O
SmartScale	O
format	O
,	O
the	O
libjpeg-turbo	O
Project	O
has	O
chosen	O
to	O
forgo	O
emulating	O
libjpeg	B-Language
v9	O
.	O
</s>
<s>
Since	O
2019	O
,	O
libjpeg-turbo	O
is	O
one	O
of	O
the	O
two	O
JPEG	O
reference	O
implementations	O
,	O
available	O
as	O
ISO/IEC	O
10918-7	O
and	O
ITU-T	O
T.873	O
.	O
</s>
<s>
The	O
other	O
reference	O
implementation	O
is	O
ISO	O
libjpeg	B-Language
which	O
also	O
includes	O
support	O
for	O
JPEG	O
XT	O
and	O
JPEG	O
LS	O
.	O
</s>
<s>
mozjpeg	O
is	O
a	O
fork	B-Application
from	O
libjpeg-turbo	O
done	O
by	O
Josh	O
Aas	O
and	O
others	O
from	O
Mozilla	B-Operating_System
Research	I-Operating_System
.	O
</s>
<s>
The	O
techniques	O
mozjpeg	O
uses	O
to	O
achieve	O
high	O
compression	O
include	O
optimising	O
Huffman	B-General_Concept
trees	I-General_Concept
,	O
using	O
progressive	O
coding	O
to	O
optimally	O
split	O
the	O
spectrum	O
of	O
DCT	B-General_Concept
coefficients	O
into	O
separate	O
scans	O
,	O
and	O
through	O
the	O
use	O
of	O
trellis	B-General_Concept
quantisation	I-General_Concept
.	O
</s>
<s>
Besides	O
libjpeg-turbo	O
,	O
mozjpeg	O
also	O
builds	O
upon	O
jpegcrush	O
,	O
a	O
Perl	B-Language
script	O
by	O
Loren	O
Merritt	O
.	O
</s>
<s>
ISO/IEC	O
Joint	O
Photography	O
Experts	O
Group	O
maintains	O
a	O
reference	O
software	O
implementation	O
for	O
base	O
JPEG	O
(	O
ISO/IEC	O
10918-1	O
and	O
18477-1	O
)	O
and	O
JPEG	O
XT	O
extensions	O
(	O
ISO/IEC	O
18477	O
Parts	O
2	O
and	O
6-9	O
)	O
,	O
as	O
well	O
as	O
lossless	B-Algorithm
JPEG-LS	O
(	O
ISO/IEC	O
14495	O
)	O
.	O
</s>
<s>
Though	O
also	O
named	O
libjpeg	B-Language
,	O
it	O
is	O
not	O
related	O
to	O
the	O
source	O
code	O
provided	O
by	O
Independent	B-Language
JPEG	I-Language
Group	I-Language
(	O
IJG	O
)	O
and	O
does	O
not	O
support	O
proprietary	O
extensions	O
introduced	O
by	O
IJG	O
since	O
2007	O
.	O
</s>
