An Efficient Mode Decision Algorithm for H.264/AVC Encoding Optimization IEEE TRANSACTION ON MULTIMEDIA

Download Report

Transcript An Efficient Mode Decision Algorithm for H.264/AVC Encoding Optimization IEEE TRANSACTION ON MULTIMEDIA

An Efficient Mode Decision
Algorithm for H.264/AVC Encoding
Optimization
IEEE TRANSACTION ON MULTIMEDIA
Hanli Wang, Student Member, IEEE,
Sam Kwong, Senior Member, IEEE, and
Chi-Wah Kok, Senior Member, IEEE
1
Outline





Introduction
Proposed Early Termination of Motion
Estimation and Mode Decision
Proposed Algorithm for H.264 Mode
Decision
Experimental Results
Conclusion
2
Introduction


The computational complexity in H.264 is
increased due to mode decision where
variable block size ME is employed
In this paper, we propose a more efficient
and robust algorithm than *Variable Block
size Best Motion Detection (VBBMD) to early
terminate ME and mode decision.
*L.Yang, K. Yu, J. Li, and S. Li, “An effective variable block-size
early termination algorithm for H.264 video coding,” IEEE
Trans. Circuits Syst. Video Technol., vol 15, no. 6, pp. 784-788,
3
Jun. 2005.
Proposed Early Termination of Motion
Estimation and Mode Decision


In video coding, it’s common that all
DCT coefficients in a block are
quantized to zeros.
ME can be early terminated if an allzero block is detected.
4
Proposed Early Termination of Motion
Estimation and Mode Decision

4x4 DCT



C(n)=
, for n=0, C(n)=1, otherwise
denotes to round x to the nearest
integer
Quantization


f is
5
A. Sufficient Condition to Detect All-Zero
Blocks


From(2), the sufficient condition for
to be quantized to zero is
From(1)



indicates each element of
is
multiplied by the element in the same
position in matrix
6
A. Sufficient Condition to Detect All-Zero
Blocks

The case of u=v=1 is firstly analyzed.
A 4x4 block is divided into four regions

The sum of absolute difference

The sum of absolute difference SAD for a 4x4 block

,
, for each region
7
A. Sufficient Condition to Detect All-Zero
Blocks


Considering (4)-(7)
Form(3)(4), the sufficient condition to
detect zero quantized DCT coefficient
at (u,v) is
. Thus
8
A. Sufficient Condition to Detect All-Zero
Blocks

According to the three categories in Table I, three
threshold are derived as

If
, then all the DCT coefficients in the
ith category will be quantized to zeros.

The sufficient condition to detect all-zero block
9
A. Sufficient Condition to Detect All-Zero
Blocks



False rejection rate (FRR)
 The smaller FRR is, the more efficiency all-zero DCT
blocks can be detected.
False acceptance rate (FAR)
 The smaller FAR is, the less the video quality
degrades.
[10] Y.H. Moon, G. Y. Kim, and J. H. Kim, “An improved early
detection algorithm for all-zero blocks in H.264 video coding,” IEEE
Trans. Circuits Syst. Video Technol., vol. 15, no. 8, pp. 1053-1057,
Aug. 2005.
10
B. Early Termination of Motion Estimation
and Mode Decision

Early Motion Estimation Termination



We can early terminate ME if all the 4x4 blocks
within current block are determined as all-zero
blocks under the condition(13).
In the assumption on spatial-temporal
homogeneity, we may not get the best motion
vector…
Early Mode Decision Termination


If EMET is true for all the partitioned blocks in a
MB, we can consider this MB is an all-zero MB and
skip checking the other modes.
The additional overhead of calculation (10)–(13)…
=>we can early stop checking EMET if one of the
4x4 blocks does not satisfy the condition in (13).
11
Proposed Algorithm for H.264 Mode
Decision

We have executed a number of
experiments and observed that




M16 : the best mode of SKIP and
16x16


1. SKIP and 16x16 have a large proportion
in MB partitions.
2. 8x8 occupies a large proportion in subMB partitions.
3. INTRA4 and INTRA16 have a very small
proportion in inter coding.
: RD cost of M16
: RD cost of 8x8
12
A. Temporal-Spatial Checking

M(n,x,y) : a MB which is in the nth frame with top
left pixel in (x,y)
The temporal set is defined as

The spatial set is defined as


If( nonboundary MBs in
and
were encoded as
SKIP or 16x16)
=> skip 8x4, 4x8, 4x4, INTRA4 and INTRA16
If(
)
=> skip 16x8 and 8x16


Additional computation : few comparison operations
13
B. Thresholds Based Prediction
We define two thresholds
and
 If(
)
=> skip 8x4, 4x8, 4x4, INTRA4, and
INTRA16
 If(
)
=> skip 16x8 and 8x16
 From our exhaustive experiments, we
found good results can be achieved
when
and
are set to 50 and
14
200 respectively.

C. Monotonic Error Surface Based
Prediction
: RD cost of 4x4
 If(
)
=> skip 16x8 and 8x16
 If(
)
=> only check 16x8 and 8x16 and
skip all the other unchecked modes

15
D. Overall Algorithm
Set all modes
active. Select
M16 and record
C16
True
Done
EMDT
C16
False,
record
C8
EMDT
Done True C8
false
True
TSC and
C16<C8
Done
True
false
false
EMDT 16x8
True
false
Done
True
8x16
inactive
false
C8-C16>Th16
Set 16x8
and 8x16
to inactive
false
C16>C8
and C8>C4
True
false
True
True
True
True
Set
8x4,4x8,4x4,
I4, and I16
to inactive
C16-C8>Th8
16x8
inactive
Record C4 and
EMDT C4
C16<C8
false
and C8<C4
false
false
Done
TSC
EMDT 8x16
True
True
false
Set
8x4,4x8,I4,
and I16 to
inactive
Done
false
8x4
inactive
Set 16x8
and 8x16
to inactive
True false
16
D. Overall Algorithm
True
false
EMDT 8x4
True
Done
false
4x8
inactive
True
false
EMDT 4x8
false
True
Done
Check I4 and I16 if they are active.
Select the best mode
17
Experimental Results







H.264 reference software : JM9.5
ME with ¼ pixel resolution
Number of reference frames : 1
Motion search range : 16
Without B-frames
The period of I-frames : 10
Five
values : 24, 28, 32, 36, and 40
18
Experimental Results
19
Experimental Results
20
Experimental Results




With B-frames
The period of I-frames : 4
GOP structure is IBBP
The other encoding parameters are the
same.
21
Experimental Results
22
Experimental Results
23
Conclusion



A theoretical analysis is carried out to study the
sufficient condition to detect all-zero blocks in H.264.
The proposed algorithm also introduces TSC, TBP, and
MESBP methods to further skip examining redundant
modes.
In the future, we will consider other fast mode
decision techniques such as [3],[4],[7] to further
optimize the proposed algorithm.

24