Game Development Reference
In-Depth Information
Fig. 4.15
Illustration of
chroma sub-pixel
interpolation
a
0
,
i
=
(
−
A
−
3
,
i
+
4
×
A
−
2
,
i
−
10
×
A
−
1
,
i
+
57
×
A
0
,
i
+
19
×
A
1
,
i
−
7
×
A
2
,
i
+
×
A
3
,
i
−
A
4
,
i
+
((
<<
−
)>>
)) >>
(
−
3
1
BitDepth
8
1
BitDepth
)
(4.42a)
8
b
0
,
i
=
(
−
A
+
4
×
A
−
11
×
A
+
40
×
A
0
,
i
+
40
×
A
1
,
i
−
11
×
A
2
,
i
−
3
,
i
−
2
,
i
−
1
,
i
+
4
×
A
3
,
i
−
A
4
,
i
+
((
1
<<
BitDepth
−
8
)>>
1
)) >> (
BitDepth
)
(4.42b)
−
8
c
0
,
i
=
(
−
A
+
3
×
A
−
7
×
A
+
19
×
A
0
,
i
+
57
×
A
1
,
i
−
10
×
A
2
,
i
−
3
,
i
−
2
,
i
−
1
,
i
+
4
×
A
3
,
i
−
A
4
,
i
+
((
1
<<
BitDepth
−
8
)>>
1
)) >> (
BitDepth
)
(4.42c)
−
8
For chroma interpolation, Fig.
4.15
gives an example of the chroma sub-pixel.
The capital letters indicate the chroma integer pixel point. Let
a
x
,
y
(
d
x
,
d
y
)
indicates
63 sub-pixels in the square of four integer pixels.
indicates the sub-pixel
position.
A
x
,
y
indicates the chroma pixel point at the picture coordinate
(
d
x
,
d
y
)
(
x
,
y
)
.The
sub-pixel
a
x
,
y
(
d
x
,
d
y
)
is calculated as follows,
C
[d
y
][0]
×
A
x
,
y
−
1
+
C
[d
y
][1]
×
A
x
,
y
+
C
[d
y
][2]
×
A
x
,
y
+
1
+
C
[d
y
][3]
×
A
x
,
y
+
2
+
32
⊨
⊩
>>
6
,
if d
x
=
0
;
C
[d
x
][0]
×
A
x
−
1
,
y
+
C
[d
x
][1]
×
A
x
,
y
+
C
[d
x
][2]
×
A
x
+
1
,
y
+
C
[d
x
][3]
×
A
x
+
2
,
y
+
32
>>
6
,
else if d
y
=
0
;
a
x
,
y
(
d
x
,
d
y
)
=
⊛
⊝
⊞
⊠
C
[d
y
][0]
×
a
x
,
y
−
1
(
d
x
,
0
)
+
C
[d
y
][1]
×
a
x
,
y
(
d
x
,
0
)
+
C
[d
y
][2]
×
a
x
,
y
+
1
(
d
x
,
0
)
>> (
20
−
BitDepth
) ,
otherwise
.
+
C
[d
y
][3]
×
a
x
,
y
+
2
(
d
x
,
0
)
+
(
1
<< (
19
−
BitDepth
))
(4.43)