Game Development Reference
In-Depth Information
Fig. 4.6
Vertical and horizontal prediction
r[ i ]( i
=
M +1
2 M ) will be padded with r
[
M
]
, otherwise they are referred as not
available. For r
[
0
]
, if it is not available, but r
[
1
]
or c
[
1
]
is available, r
[
0
]
is replaced
with r
is used first).
For vertical or horizontal prediction mode, the above or left neighboring samples
are directly used as the prediction sample for the corresponding whole column or
whole row samples. For DC mode, the average of the available neighboring samples
without the corner samples r
[
1
]
or c
[
1
]
(if both r
[
1
]
and c
[
1
]
are available, r
[
1
]
is used as prediction sample for the whole
block (Fig. 4.6 ), and if no neighboring samples are available, a default value is used,
e.g. 128 for 8 bit sample signal.
For angular modes from 3 to 11, only the top neighboring samples are used for
prediction, and for modes from 25 to 32, only left neighboring samples are used for
prediction. For modes from 13 to 23, according the sample is above or below the
prediction line in Fig. 4.4 , top or left neighboring samples are used for prediction. To
get the prediction sample P
[
0
]
and c
[
0
]
[
x
,
y
]
, a 4-tap interpolation is needed, shown as follows,
P
[
x
,
y
]= (
A
× (
32
offset
) +
B
× (
64
offset
)
+
D
× (
32
+
offset
) +
E
×
offset
+
64
)
7
,
(4.24)
where, A, B, DandE are the nearest integer samples around the prediction position for
the current sample
(Fig. 4.7 ). The offset is decided with the direction offset of
the associate mode identified with
(
x
,
y
)
(
d x
,
d y
)
(Fig. 4.8 ), which is computed as follows,
×
,
(y + 1)
d x %d y
for modes 3 to 11
×
,
(x + 1)
d x %d y
for modes 25 to 32
×
/
,
(y + 1)
d x
d y
for modes 13 to 23 and prediction
from the top neighboring samples
=
,
offset
(4.25)
(x + 1)
×
d y %d x
,
for modes 13 to 23 and prediction
from the left neighboring samples
where
for angular prediction modes is shown in Table 4.2 .
For plane prediction mode, the prediction sample P
(
d x
,
d y
)
(
x
,
y
)
is interpolated by using
both the top and the left neighboring samples, as follows,
[
,
]= (
+ (
(
) +
) ×
+ (
(
) +
) ×
+
)
P
x
y
ia
x
M
1
1
ib
y
N
1
1
ic
16
5 (4.26)
Search WWH ::




Custom Search