Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Remy Foray
VVCSoftware_VTM
Commits
ee4baa04
Commit
ee4baa04
authored
Apr 15, 2019
by
Xin Zhao
Browse files
Cleanup of JVET-N0363 integration: rename variable from sad to minSadHad
parent
b7cb8c29
Changes
1
Show whitespace changes
Inline
Side-by-side
source/Lib/EncoderLib/IntraSearch.cpp
View file @
ee4baa04
...
...
@@ -443,7 +443,11 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
for
(
int
modeIdx
=
0
;
modeIdx
<
numModesAvailable
;
modeIdx
++
)
{
uint32_t
uiMode
=
modeIdx
;
#if JVET_N0363_INTRA_COST_MOD
Distortion
minSadHad
=
0
;
#else
Distortion
uiSad
=
0
;
#endif
// Skip checking extended Angular modes in the first round of SATD
if
(
uiMode
>
DC_IDX
&&
(
uiMode
&
1
)
)
...
...
@@ -467,7 +471,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#if JVET_N0363_INTRA_COST_MOD
// Use the min between SAD and HAD as the cost criterion
// SAD is scaled by 2 to align with the scaling of HAD
uiS
ad
+=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
minSadH
ad
+=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
#else
// use Hadamard transform here
uiSad
+=
distParam
.
distFunc
(
distParam
);
...
...
@@ -480,16 +484,26 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
uint64_t
fracModeBits
=
xFracModeBitsIntra
(
pu
,
uiMode
,
CHANNEL_TYPE_LUMA
);
#if JVET_N0363_INTRA_COST_MOD
double
cost
=
(
double
)
minSadHad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#else
double
cost
=
(
double
)
uiSad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#endif
DTRACE
(
g_trace_ctx
,
D_INTRA_COST
,
"IntraHAD: %u, %llu, %f (%d)
\n
"
,
uiSad
,
fracModeBits
,
cost
,
uiMode
);
updateCandList
(
uiMode
,
cost
,
uiRdModeList
,
CandCostList
,
extendRefList
,
0
,
numModesForFullRD
+
extraModes
);
#if JVET_N0363_INTRA_COST_MOD
updateCandList
(
uiMode
,
(
double
)
minSadHad
,
uiHadModeList
,
CandHadList
,
*
nullList
,
-
1
,
3
+
extraModes
);
#else
updateCandList
(
uiMode
,
(
double
)
uiSad
,
uiHadModeList
,
CandHadList
,
*
nullList
,
-
1
,
3
+
extraModes
);
#endif
}
}
// NSSTFlag
...
...
@@ -528,7 +542,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#if JVET_N0363_INTRA_COST_MOD
// Use the min between SAD and SATD as the cost criterion
// SAD is scaled by 2 to align with the scaling of HAD
Distortion
s
ad
=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
Distortion
minSadH
ad
=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
#else
// use Hadamard transform here
Distortion
sad
=
distParam
.
distFunc
(
distParam
);
...
...
@@ -541,14 +555,25 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
uint64_t
fracModeBits
=
xFracModeBitsIntra
(
pu
,
mode
,
CHANNEL_TYPE_LUMA
);
#if JVET_N0363_INTRA_COST_MOD
double
cost
=
(
double
)
minSadHad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#else
double
cost
=
(
double
)
sad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#endif
updateCandList
(
mode
,
cost
,
uiRdModeList
,
CandCostList
,
extendRefList
,
0
,
numModesForFullRD
);
#if JVET_N0363_INTRA_COST_MOD
updateCandList
(
mode
,
(
double
)
minSadHad
,
uiHadModeList
,
CandHadList
,
*
nullList
,
-
1
,
3
);
#else
updateCandList
(
mode
,
(
double
)
sad
,
uiHadModeList
,
CandHadList
,
*
nullList
,
-
1
,
3
);
#endif
bSatdChecked
[
mode
]
=
true
;
}
...
...
@@ -597,7 +622,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
#if JVET_N0363_INTRA_COST_MOD
// Use the min between SAD and SATD as the cost criterion
// SAD is scaled by 2 to align with the scaling of HAD
Distortion
s
ad
=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
Distortion
minSadH
ad
=
std
::
min
(
distParamSad
.
distFunc
(
distParamSad
)
*
2
,
distParamHad
.
distFunc
(
distParamHad
));
#else
// use Hadamard transform here
Distortion
sad
=
distParam
.
distFunc
(
distParam
);
...
...
@@ -610,7 +635,11 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
uint64_t
fracModeBits
=
xFracModeBitsIntra
(
pu
,
mode
,
CHANNEL_TYPE_LUMA
);
#if JVET_N0363_INTRA_COST_MOD
double
cost
=
(
double
)
minSadHad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#else
double
cost
=
(
double
)
sad
+
(
double
)
fracModeBits
*
sqrtLambdaForFirstPass
;
#endif
updateCandList
(
mode
,
cost
,
uiRdModeList
,
CandCostList
,
extendRefList
,
multiRefIdx
,
numModesForFullRD
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment