Graphics Reference
In-Depth Information
7.4.2.1
Fast Edge Offset Sample Classification
Although the sample classification rules of EO in Table 7.2 seem non-trivial, the
EO sample classification can be implemented in a more efficient way by using the
following function and equations:
sign 3.x/ D .x > 0/ ‹ . C 1/ W .x DD 0/ ‹ .0/ W 1;
(7.21)
edgeIdx D 2 C sign 3.c a/ C sign 3.c b/ ;
(7.22)
edgeIdx 2 category ΠD f 1; 2; 0; 3; 4 g ;
(7.23)
category D edgeIdx 2 category ΠedgeIdx
(7.24)
where, “ c ” is the current sample, and “ a ”and“ b ” are the two neighboring samples,
as shown in Fig. 7.14 and Table 7.2 . As a further speed-up, the data obtained in a
previous step can be reused in the classification of the next sample. For example,
assume that the EO class is 0 (i.e., a 1-D horizontal pattern) and the samples in
the CTB are processed in the raster scan order. The “ sign3 ( c a )” of the current
sample is equal to “ sign3 ( c b )” of the neighboring sample to the left. Likewise,
the “ sign3 ( c b )” of the current sample can be reused by the neighboring sample to
the right. In software implementations, the sign3 ( x ) function can be implemented by
using a bitwise operation or a look-up table to avoid using if-else operation, which
can be time-consuming on certain platforms.
7.4.2.2
Fast Band Offset Sample Classification
The sample range is equally divided into 32 bands in BO. Since 32 is equal to
two to the power of five, the BO sample classification can be implemented as
using the five most significant bits of each sample as the classification result. In
this way, the complexity of BO decreases, especially in hardware that only needs
wire connections without logic gates to obtain the classification result from the
sample value. To reduce the software decoding run time, the BO classification can
be implemented by using bitwise operation or a look-up table to avoid using if-else
operations.
7.4.2.3
Distortion Estimation for Encoder
The rate-distortion optimization process [ 41 ] requires multiple calculation of the
distortion between the original and reconstructed sample values. A straightforward
SAO implementation would add offsets to the samples modified by deblocking
and then calculate the distortion between the resulting and the original samples.
To reduce the memory access and the number of operations, a fast distortion
estimation method [ 9 ] can be implemented as follows. Let k; s.k/; and x.k/ be
Search WWH ::




Custom Search