<s>
QuickTime	B-Algorithm
Graphics	I-Algorithm
is	O
a	O
lossy	B-Algorithm
video	O
compression	O
and	O
decompression	O
algorithm	O
(	O
codec	B-General_Concept
)	O
developed	O
by	O
Apple	O
Inc	O
.	O
and	O
first	O
released	O
as	O
part	O
of	O
QuickTime	O
1.x	O
in	O
the	O
early	O
1990s	O
.	O
</s>
<s>
The	O
codec	B-General_Concept
is	O
also	O
known	O
by	O
the	O
name	O
Apple	B-Algorithm
Graphics	I-Algorithm
and	O
its	O
FourCC	B-Application
SMC	O
.	O
</s>
<s>
The	O
codec	B-General_Concept
operates	O
on	O
8-bit	O
palettized	B-Data_Structure
RGB	O
data	O
.	O
</s>
<s>
The	O
bit-stream	O
format	O
of	O
QuickTime	B-Algorithm
Graphics	I-Algorithm
has	O
been	O
reverse-engineered	O
and	O
a	O
decoder	O
has	O
been	O
implemented	O
in	O
the	O
projects	O
XAnim	O
and	O
libavcodec	B-Language
.	O
</s>
<s>
The	O
input	O
video	O
that	O
the	O
codec	B-General_Concept
operates	O
on	O
is	O
in	O
an	O
8-bit	O
palettized	B-Data_Structure
RGB	O
colorspace	O
.	O
</s>
<s>
Compression	O
is	O
achieved	O
by	O
conditional	O
replenishment	O
and	O
by	O
reducing	O
the	O
palette	B-Data_Structure
from	O
256	O
colors	O
to	O
a	O
per-4	O
×4	O
block	O
adaptive	O
palette	B-Data_Structure
of	O
1-16	O
colors	O
.	O
</s>
<s>
Because	O
Apple	B-Algorithm
Video	I-Algorithm
operates	O
in	O
the	O
image	O
domain	O
without	O
motion	O
compensation	O
,	O
decoding	O
is	O
much	O
faster	O
than	O
MPEG-style	O
codecs	B-General_Concept
which	O
use	O
motion	O
compensation	O
and	O
perform	O
coding	O
in	O
a	O
transform	O
domain	O
.	O
</s>
<s>
As	O
a	O
tradeoff	O
,	O
the	O
compression	O
performance	O
of	O
Apple	B-Algorithm
Graphics	I-Algorithm
is	O
lower	O
.	O
</s>
<s>
The	O
decoding	O
complexity	O
is	O
approximately	O
50%	O
that	O
of	O
the	O
QuickTime	B-Algorithm
Animation	I-Algorithm
codec	B-General_Concept
.	O
</s>
<s>
Each	O
block	O
can	O
be	O
coded	O
in	O
one	O
of	O
the	O
following	O
coding	O
modes	O
:	O
skip	O
mode	O
,	O
single	O
color	O
,	O
2-	O
,	O
4-	O
,	O
and	O
8	O
color	O
palette	B-Data_Structure
modes	O
,	O
two	O
repeat	O
modes	O
,	O
and	O
PCM	B-Algorithm
.	O
</s>
<s>
Runs	O
of	O
skip	O
blocks	O
are	O
coded	O
in	O
a	O
run-length	B-Algorithm
encoding	I-Algorithm
scheme	O
,	O
enabling	O
a	O
high	O
compression	O
ratio	O
in	O
static	O
areas	O
of	O
the	O
picture	O
.	O
</s>
<s>
This	O
mode	O
can	O
also	O
be	O
considered	O
as	O
a	O
1-color	O
palette	B-Data_Structure
mode	O
.	O
</s>
<s>
In	O
the	O
palette	B-Data_Structure
modes	O
,	O
each	O
4×4	O
block	O
is	O
coded	O
with	O
a	O
2	O
,	O
4	O
,	O
or	O
8-color	O
palette	B-Data_Structure
.	O
</s>
<s>
To	O
select	O
one	O
of	O
the	O
colors	O
from	O
the	O
palette	B-Data_Structure
,	O
1	O
,	O
2	O
,	O
or	O
3	O
bits	O
per	O
pixel	O
are	O
used	O
,	O
respectively	O
.	O
</s>
<s>
The	O
palette	B-Data_Structure
can	O
be	O
written	O
to	O
the	O
bitstream	O
either	O
explicitly	O
or	O
as	O
a	O
reference	O
to	O
an	O
entry	O
in	O
the	O
palette	B-Data_Structure
cache	O
.	O
</s>
<s>
The	O
palette	B-Data_Structure
cache	O
is	O
a	O
set	O
of	O
three	O
circular	O
buffers	O
which	O
store	O
the	O
256	O
most	O
recently	O
used	O
palettes	B-Data_Structure
,	O
one	O
each	O
for	O
of	O
the	O
2	O
,	O
4	O
,	O
and	O
8-color	O
modes	O
.	O
</s>
<s>
Interpreted	O
as	O
vector	B-Algorithm
quantization	I-Algorithm
,	O
three-dimensional	O
vectors	O
with	O
components	O
red	O
,	O
green	O
,	O
and	O
blue	O
are	O
quantized	B-Algorithm
using	O
a	O
forward	O
adaptive	O
codebook	O
with	O
between	O
1	O
and	O
8	O
entries	O
.	O
</s>
<s>
This	O
mode	O
is	O
lossless	O
and	O
equivalent	O
to	O
raw	O
PCM	B-Algorithm
without	O
any	O
compression	O
.	O
</s>
