Optimization of intra block size in video coding based on minimal activity directions and strengths
In video coding, selecting an optimal intra block size based on minimal activity directions and strengths. The method is directed to simplifying the procedure of choosing the best subdivision of a texture block into intra blocks.
1. A method of choosing a best subdivision of a texture block into intra blocks in high efficiency video coding, the method comprising:
considering a texture block B having size L×L and weight W and starting from a pixel with coordinates (x, y);
constructing four sub-blocks B j , j ∈ [0,4] of size
L
2
×
L
2
starting from pixels with coordinates (x,y),
(
x
+
L
2
,
y
)
,
(
x
,
y
+
L
2
)
,
and
(
x
+
L
2
,
y
+
L
2
)
,
respectively;
constructing a spatial area S including the texture block B and spatial areas S j including the sub-blocks B j ;
calculating minimal activity direction angles φ({tilde over (B)},W) and φ({tilde over (B)} j ,W),
wherein α({tilde over (B)},W)=cos(φ({tilde over (B)},W)), β({tilde over (B)},W)=sin(φ({tilde over (B)},W));
calculating functions of minimal activity direction strengths:
C 1 ( {tilde over (B)},W ); C 2 ( {tilde over (B)},W );
C 1 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j ,W ); and
C 2 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j ,W ); and
selecting a best block B size as a single L×L block, when the minimal activity direction strengths for all j ∈ [0,4] are:
C 1 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j ,W )<λ 1 +μ 1 ·C 1 ( {tilde over (B)},W ), and
C 2 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j ,W )<λ 2 +μ 2 ·C 2 ( {tilde over (B)},W );
wherein λ 1 , μ 1 , λ 2 , μ 2 are pre-defined coding parameters;
otherwise, selecting four
L
2
×
L
2
sub-blocks B j .
2. The method of claim 1 , wherein a minimal activity direction angle φ(S, W) is calculated as a solution of a minimization problem:
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
·
(
cos
(
φ
)
·
D
X
(
x
,
y
)
+
sin
(
φ
)
·
D
Y
(
x
,
y
)
)
2
⟶
α
,
β
min
;
wherein
α=cos(φ) and β=sin(φ); α 2 +β 2 =1;
D x (x, y) and D y (x, y) are measures of function P(x, y) variations in the neighborhood of the (x, y) point:
D x ( x,y )=( P ( x + 1, y )− P ( x− 1, y ))/2; and
D y ( x, y )=( P ( x, y+ 1)− P ( x, y− 1))/2.
3. The method of claim 2 , wherein the minimal activity direction strengths are calculated as follows:
C
1
(
B
,
W
)
=
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
·
(
-
β
·
D
X
(
x
,
y
)
+
α
·
D
Y
(
x
,
y
)
)
2
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
,
C
2
(
β
,
W
)
=
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
·
(
-
β
·
D
X
(
x
,
y
)
+
α
·
D
Y
(
x
,
y
)
)
2
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
·
(
α
·
D
X
(
x
,
y
)
+
β
·
D
Y
(
x
,
y
)
)
2
.
4. The method of claim 1 , wherein S coincides with B, and S j coincides with B j .
5. The method of claim 1 , wherein the pre-defined parameters λ 1 , μ 1 , λ 2 , μ 2 are selected according to desired speed and quality of encoding.
6. A video codec comprising a control circuit configured and arranged to carry out a function of optimally dividing a texture block into a plurality of intra blocks by:
considering a texture block B having size L×L and weight W and starting from a pixel with coordinates (x, y);
constructing four sub-blocks B j , j ∈ [0,4] of size
L
2
×
L
2
starting from pixels with coordinates (x, y),
(
x
+
L
2
,
y
)
,
(
x
,
y
+
L
2
)
,
and
(
x
+
L
2
,
y
+
L
2
)
,
respectively;
constructing a spatial area S including the texture block B and spatial areas S j including the sub-blocks B j ;
calculating minimal activity direction angles φ({tilde over (B)},W) and φ({tilde over (B)} j ,W),
wherein α({tilde over (B)},W)=cos(φ({tilde over (B)},W)), β({tilde over (B)},W)=sin(φ({tilde over (B)},W));
calculating functions of minimal activity direction strengths:
C 1 ( {tilde over (B)},W ); C 2 ( {tilde over (B)},W );
C 1 (α( {tilde over (B)},W ), β( {tilde over (B)}, W ), {tilde over (B)} j ,W ); and
C 2 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j ,W );
where j ∈ [0,4]; and
selecting a best size block B as a single L×L block, when the minimal activity direction strengths for all j ∈ [0,4] are:
C 1 (α( {tilde over (B)},W ),β( {tilde over (B)},W )<λ 1 +μ 1 ·C 1 ( {tilde over (B)},W ), and
C 2 (α( {tilde over (B)},W ),β( {tilde over (B)},W ), {tilde over (B)} j , W )<λ 2 +μ 2 ·C 2 ( {tilde over (B)}, W );
wherein λ 1 , μ 1 , λ 2 , μ 2 are pre-defined coding parameters;
otherwise, selecting the best size by dividing block B into four
L
2
×
L
2
sub-blocks B j .
7. The video codec of claim 6 , wherein the minimal activity direction angle φ(S, W) is calculated as a solution of a minimization problem:
∑
(
x
,
y
)
∈
S
W
(
x
,
y
)
·
(
cos
(
φ
)
·
D
X
(
x
,
y
)
+
sin
(
φ
)
·
D
Y
(
x
,
y
)
)
2
⟶
α
,
β
min
;
wherein
α=cos(φ) and β=sin(φ); α 2 +β 2 =1;
D x (x, y) and D y (x, y) are measures of function P(x, y) variations in the neighborhood of the (x, y) point:
D x ( x, y )=( P ( x+ 1, y )− P ( x− 1, y ))/2; and
D y ( x, y )=( P ( x, y+ 1)− P ( x, y− 1))/2.
8. The video codec of claim 6 , wherein the pre-defined parameters λ 1 , μ 1 , λ 2 , μ 2 are selected according to a desired speed of the video codec and to desired quality of encoding.