Game Development Reference
In-Depth Information
Fig. 4.8
Prediction direction
offset
(
d
x
,
d
y
)
Pc
[
x
,
y
]
=
(
ia
+
(
x
−
(
L
>>
1
)
−
1
)
×
ib
+
(
y
−
(
L
>>
1
)
−
1
)
×
ic
+
16
)>>
5
(4.34)
where
ia
is equal to
(
row
[
L
]+
col
[
L
]
)<<
4 and
ib
is equal to
(
32
×
ih
×
i
mult
+
(
i
weight
>>
1
))/
i
weight and
ic
is equal to
(
32
×
i
v
×
i
mult
+
(
i
weight
>>
1
))/
i
weight. And
i
mult,
i
weight are computed as:
i
weight
=
1
<<
ib
Shift
[
log
(
L
)
−
2
]
(4.35a)
7
(
L
>>
1
)
−
1
ih
=
(
i
+
1
)
×
(
row [
(
L
>>
1
)
+
1
+
i
]
+
row [
(
L
>>
1
)
−
1
−
i
]
)
i
=
0
(4.35b)
(
L
>>
1
)
−
1
i
v
=
(
i
+
1
)
×
(
col [
(
L
>>
1
)
+
1
+
i
]
+
col [
(
L
>>
1
)
−
1
−
i
]
)
j
=
0
(4.35c)
i
mult
=
ib
mult
[
Log
(
L
)
−
2
]
(4.35d)
ib
mult
[
5
]={
13
;
17
;
5
;
11
;
23
}
(4.35e)
ib
shift
[
5
]={
7
;
10
;
11
;
15
;
19
}
(4.35f)
It should be pointed out that all interpolated prediction sample
Pc
[
x
,
y
]
should
be also clipped in to the sample bit-depth range as luma.