Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VVCSoftware_BMS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jvet
VVCSoftware_BMS
Commits
cff4f429
Commit
cff4f429
authored
Aug 23, 2018
by
jamesxxiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicated code of SAD calculation
parent
2c9f0c00
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
25 deletions
+17
-25
source/Lib/CommonLib/Buffer.cpp
source/Lib/CommonLib/Buffer.cpp
+0
-20
source/Lib/CommonLib/Buffer.h
source/Lib/CommonLib/Buffer.h
+0
-1
source/Lib/CommonLib/InterPrediction.cpp
source/Lib/CommonLib/InterPrediction.cpp
+2
-4
source/Lib/CommonLib/RdCost.cpp
source/Lib/CommonLib/RdCost.cpp
+11
-0
source/Lib/CommonLib/RdCost.h
source/Lib/CommonLib/RdCost.h
+4
-0
No files found.
source/Lib/CommonLib/Buffer.cpp
View file @
cff4f429
...
...
@@ -91,25 +91,6 @@ void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Str
pGradX0
+=
gradStride
;
pGradX1
+=
gradStride
;
pGradY0
+=
gradStride
;
pGradY1
+=
gradStride
;
}
}
Distortion
calcHighBDSADCore
(
const
Pel
*
src0
,
int
src0Stride
,
const
Pel
*
src1
,
int
src1Stride
,
int
width
,
int
height
,
int
bitDepth
)
{
const
uint32_t
distortionShift
=
DISTORTION_PRECISION_ADJUSTMENT
(
bitDepth
-
8
);
Distortion
sum
=
0
;
for
(
int
rows
=
0
;
rows
<
height
;
rows
++
)
{
for
(
int
cols
=
0
;
cols
<
width
;
cols
++
)
{
sum
+=
abs
(
src0
[
cols
]
-
src1
[
cols
]);
}
src0
+=
src0Stride
;
src1
+=
src1Stride
;
}
return
(
sum
>>
distortionShift
);
}
#endif
template
<
typename
T
>
...
...
@@ -148,7 +129,6 @@ PelBufferOps::PelBufferOps()
addAvg8
=
addAvgCore
<
Pel
>
;
#if JVET_K0485_BIO
addBIOAvg4
=
addBIOAvgCore
;
calcHighBDSAD
=
calcHighBDSADCore
;
#endif
reco4
=
reconstructCore
<
Pel
>
;
...
...
source/Lib/CommonLib/Buffer.h
View file @
cff4f429
...
...
@@ -70,7 +70,6 @@ struct PelBufferOps
void
(
*
linTf8
)
(
const
Pel
*
src0
,
int
src0Stride
,
Pel
*
dst
,
int
dstStride
,
int
width
,
int
height
,
int
scale
,
int
shift
,
int
offset
,
const
ClpRng
&
clpRng
,
bool
bClip
);
#if JVET_K0485_BIO
void
(
*
addBIOAvg4
)
(
const
Pel
*
src0
,
int
src0Stride
,
const
Pel
*
src1
,
int
src1Stride
,
Pel
*
dst
,
int
dstStride
,
const
Pel
*
pGradX0
,
const
Pel
*
pGradX1
,
const
Pel
*
pGradY0
,
const
Pel
*
pGradY1
,
int
gradStride
,
int
width
,
int
height
,
int
tmpx
,
int
tmpy
,
int
shift
,
int
offset
,
const
ClpRng
&
clpRng
);
Distortion
(
*
calcHighBDSAD
)
(
const
Pel
*
src0
,
int
src0Stride
,
const
Pel
*
src1
,
int
src1Stride
,
int
width
,
int
height
,
int
bitDepth
);
#endif
};
...
...
source/Lib/CommonLib/InterPrediction.cpp
View file @
cff4f429
...
...
@@ -1514,9 +1514,6 @@ bool InterPrediction::xCalcBiPredSubBlkDist(const PredictionUnit &pu, const Pel*
m_bioSubBlkDistThres
>>=
distortionShift
;
DistParam
cDistParam
;
cDistParam
.
applyWeight
=
false
;
cDistParam
.
useMR
=
false
;
Distortion
dist
=
0
;
for
(
int
yu
=
0
,
blkIdx
=
0
;
yu
<
yUnit
;
yu
++
)
{
...
...
@@ -1525,7 +1522,8 @@ bool InterPrediction::xCalcBiPredSubBlkDist(const PredictionUnit &pu, const Pel*
const
Pel
*
pPred0
=
pYuvSrc0
+
((
yu
*
src0Stride
+
xu
)
<<
2
);
const
Pel
*
pPred1
=
pYuvSrc1
+
((
yu
*
src1Stride
+
xu
)
<<
2
);
m_bioPredSubBlkDist
[
blkIdx
]
=
g_pelBufOP
.
calcHighBDSAD
(
pPred0
,
src0Stride
,
pPred1
,
src1Stride
,
(
1
<<
2
),
(
1
<<
2
),
clipbd
);
m_pcRdCost
->
setDistParam
(
cDistParam
,
pPred0
,
pPred1
,
src0Stride
,
src1Stride
,
clipbd
,
COMPONENT_Y
,
(
1
<<
2
),
(
1
<<
2
),
0
,
1
,
false
,
true
);
m_bioPredSubBlkDist
[
blkIdx
]
=
cDistParam
.
distFunc
(
cDistParam
);
dist
+=
m_bioPredSubBlkDist
[
blkIdx
];
}
}
...
...
source/Lib/CommonLib/RdCost.cpp
View file @
cff4f429
...
...
@@ -326,7 +326,11 @@ void RdCost::setDistParam( DistParam &rcDP, const CPelBuf &org, const CPelBuf &c
rcDP
.
maximumDistortionForEarlyExit
=
std
::
numeric_limits
<
Distortion
>::
max
();
}
#if JVET_K0485_BIO
void
RdCost
::
setDistParam
(
DistParam
&
rcDP
,
const
Pel
*
pOrg
,
const
Pel
*
piRefY
,
int
iOrgStride
,
int
iRefStride
,
int
bitDepth
,
ComponentID
compID
,
int
width
,
int
height
,
int
subShiftMode
,
int
step
,
bool
useHadamard
,
bool
bio
)
#else
void
RdCost
::
setDistParam
(
DistParam
&
rcDP
,
const
Pel
*
pOrg
,
const
Pel
*
piRefY
,
int
iOrgStride
,
int
iRefStride
,
int
bitDepth
,
ComponentID
compID
,
int
width
,
int
height
,
int
subShiftMode
,
int
step
,
bool
useHadamard
)
#endif
{
rcDP
.
bitDepth
=
bitDepth
;
rcDP
.
compID
=
compID
;
...
...
@@ -347,6 +351,13 @@ void RdCost::setDistParam( DistParam &rcDP, const Pel* pOrg, const Pel* piRefY,
CHECK
(
useHadamard
||
rcDP
.
useMR
||
subShiftMode
>
0
,
"only used in xDirectMCCost with these default parameters (so far...)"
);
#if JVET_K0485_BIO
if
(
bio
)
{
rcDP
.
distFunc
=
xGetSAD
;
return
;
}
#endif
if
(
width
==
12
)
{
rcDP
.
distFunc
=
m_afpDistortFunc
[
DF_SAD12
];
...
...
source/Lib/CommonLib/RdCost.h
View file @
cff4f429
...
...
@@ -152,7 +152,11 @@ public:
void
setDistParam
(
DistParam
&
rcDP
,
const
CPelBuf
&
org
,
const
Pel
*
piRefY
,
int
iRefStride
,
int
bitDepth
,
ComponentID
compID
,
int
subShiftMode
=
0
,
int
step
=
1
,
bool
useHadamard
=
false
);
void
setDistParam
(
DistParam
&
rcDP
,
const
CPelBuf
&
org
,
const
CPelBuf
&
cur
,
int
bitDepth
,
ComponentID
compID
,
bool
useHadamard
=
false
);
#if JVET_K0485_BIO
void
setDistParam
(
DistParam
&
rcDP
,
const
Pel
*
pOrg
,
const
Pel
*
piRefY
,
int
iOrgStride
,
int
iRefStride
,
int
bitDepth
,
ComponentID
compID
,
int
width
,
int
height
,
int
subShiftMode
=
0
,
int
step
=
1
,
bool
useHadamard
=
false
,
bool
bio
=
false
);
#else
void
setDistParam
(
DistParam
&
rcDP
,
const
Pel
*
pOrg
,
const
Pel
*
piRefY
,
int
iOrgStride
,
int
iRefStride
,
int
bitDepth
,
ComponentID
compID
,
int
width
,
int
height
,
int
subShiftMode
=
0
,
int
step
=
1
,
bool
useHadamard
=
false
);
#endif
double
getMotionLambda
(
bool
bIsTransquantBypass
)
{
return
m_dLambdaMotionSAD
[(
bIsTransquantBypass
&&
m_costMode
==
COST_MIXED_LOSSLESS_LOSSY_CODING
)
?
1
:
0
];
}
void
selectMotionLambda
(
bool
bIsTransquantBypass
)
{
m_motionLambda
=
getMotionLambda
(
bIsTransquantBypass
);
}
...
...
Write
Preview
Markdown
is supported
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