1.
Coding costs
(Jmode)
for MODE_INTER with PART_2Nx2N is
computed and
Jmode is set to
minimum CU coding cost J.
2.
Check if motion vector difference
ofMODE_INTER with PART_2Nx2N is equal to
(0, 0) and MODE_INTER with PART_2Nx2N
contains no non-zero transform coefficients
(Early_SKIP condition). If both
are true, proceed to 17
with setting the best interim coding mode
as MODE_SKIP. Otherwise, proceed to 3.
3.
Check if MODE_INTER with PART_2Nx2N contains no non-zero
transform coefficients (CBF_Fast condition). If the
condition is true, proceed to 17 with setting the best
interim coding mode as MODE_INTER with PART_2Nx2N. Otherwise,
proceed to 4.
4.
Jmode for
MODE_SKIP is evaluated and J
is set equal to Jmode if
Jmode <
J.
5.
Check if the current CU depth is maximum and the current CU
size is not 8x8 when inter_4x4_enabled_flag is zero. If
the conditions are true, proceed to
6. Otherwise, proceed to
7.
6.
Jmode for
MODE_INTER with PART_NxN is evaluated and J is set
equal to Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_NxN contains no
non-zero transform coefficients (CBF_Fast
condition). If the condition is
true, proceed to 17 with setting
the best interim coding mode as MODE_INTER with
PART_NxN. Otherwise, proceed to
7.
7.
Jmode for
MODE_INTER with PART_Nx2N is evaluated and J is set
equal to Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_Nx2N contains no non-zero transform
coefficients (CBF_Fast condition).
If the condition is true,
proceed to 17
with setting the best interim coding mode as MODE_INTER with
PART_Nx2N. Otherwise, proceed to 8.
8.
Jmode
for MODE_INTER with PART_2NxN
is evaluated and J is set equal to
Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_2NxN contains no
non-zero transform coefficients (CBF_Fast
condition). If the condition is
true, proceed
to 17 with setting the best interim
coding mode as MODE_INTER with PART_2NxN. Otherwise, proceed to
9.
9.
Invoke a process to determine AMP mode evaluation procedure
specified in 4.6.2.3. Output of this
process is assigned to TestAMP_Hor and TestAMP_Ver. TestAMP_Hor
specifies whether horizontal AMP modes are tested with specific ME
or tested with merge mode or not tested. TestAMP_Ver specifies
whether vertical AMP modes are tested
with specific ME or tested with merge mode or not
tested.
10.
If TestAMP_Hor indicates that horizontal AMP modes are
tested, MODE_INTER with PART_2NxnU is evaluated with procedure
suggested by TestAMP_Hor and J is set equal to the resulting
coding cost Jmode if
Jmode <
J. After that, check
if MODE_INTER with
PART_2NxnU
contains no non-zero transform coefficients
(CBF_Fast condition). If the
condition is true,
proceed to 17
with setting the best interim coding mode as MODE_INTER with
PART_2NxnU. Otherwise,
MODE_INTER with PART_2NxnD is evaluated with procedure
suggested by TestAMP_Hor and J is set equal to the resulting
coding cost Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_2NxnD contains no non-zero transform
coefficients (CBF_Fast condition).
If the condition is true, proceed
to 17 with setting the best interim
coding mode as MODE_INTER with PART_2NxnD. Otherwise, proceed to
11.
11.
If TestAMP_Ver indicates that vertical AMP modes are tested,
MODE_INTER with PART_nLx2N is evaluated with procedure suggested by
TestAMP_Ver and J is set equal to the resulting coding cost
Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_nLx2N contains no non-zero transform
coefficients (CBF_Fast condition).
If the condition is true, proceed
to 17 with setting the best
interim coding mode as MODE_INTER with PART_nLx2N. Otherwise,
MODE_INTER with PART_nRx2N is evaluated with procedure suggested by
TestAMP_Ver and J is set equal to the resulting coding cost
Jmode if
Jmode <
J. After that, check
if MODE_INTER with PART_nRx2N contains no
non-zero transform coefficients (CBF_Fast condition).
If the condition is true, proceed to
17 with setting
the best interim coding mode as
MODE_INTER
with PART_nRx2N. Otherwise, proceed to
12.
12.
MODE_INTRA with PART_2Nx2N is evaluated by invoking the
process specified in 4.6.1, only when at
least one or more non-zero transform coefficients can be found by
using the best interim coding mode.
J is set equal to the resulting coding
cost Jmode if
Jmode <
J.
13.
Check if the current CU depth is maximum, If the
condition is true, proceed to
14. Otherwise, proceed to
15.
14.
MODE_INTRA with PART_NxN is evaluated by invoking the process
specified in 4.6.1, only when the current
CU size is larger than minimum TU size. The resulting
coding cost
Jmode is set to
J if
Jmode <
J.
15.
Check if the current CU size is greater than or
equal to the minimum PCM mode size specified by the
log2_min_pcm_coding_block_size_minus3
value of SPS parameter. If the
condition is true, proceed to
16. Otherwise, proceed to
17.
16.
Check if any of the following conditions are true.
If the condition is true,
PCM mode is evaluated and J is set equal to the
resulting coding cost Jmode
if Jmode
<
J.
–
Bit cost of J is greater than that of the
PCM sample data of the input image
block.
–
J is greater than bit cost of the
PCM sample data of the input image block
multiplied by
λmode.
17.
Update bit cost Bmode
by adding bits for CU split flag and re-compute minimum
coding cost J.
18.
Check if
the best
interim coding mode is
MODE_SKIP (Early_CU
condition). If
the condition is true, do
not proceed to the recursive mode
decision at next CU
level.
Otherwise, go to next CU level of recursive
mode decision if the
current CU depth is not maximum.
![HEVC帧内/帧间/PCM模式选择过程 HEVC帧内/帧间/PCM模式选择过程](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)