Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VVCSoftware_VTM
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jvet
VVCSoftware_VTM
Commits
205d6763
Commit
205d6763
authored
6 years ago
by
Jani Lainema
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup MTS related functionality + rename variables to follow naming conventions
parent
7c746266
No related branches found
No related tags found
1 merge request
!125
Cleanup MTS related functionality
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/Lib/CommonLib/TrQuant.cpp
+27
-27
27 additions, 27 deletions
source/Lib/CommonLib/TrQuant.cpp
source/Lib/CommonLib/TrQuant.h
+1
-2
1 addition, 2 deletions
source/Lib/CommonLib/TrQuant.h
with
28 additions
and
29 deletions
source/Lib/CommonLib/TrQuant.cpp
+
27
−
27
View file @
205d6763
...
...
@@ -301,17 +301,17 @@ void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTy
}
}
void
TrQuant
::
xT
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CPelBuf
&
resi
,
CoeffBuf
&
dstCoeff
,
const
int
iW
idth
,
const
int
iH
eight
)
void
TrQuant
::
xT
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CPelBuf
&
resi
,
CoeffBuf
&
dstCoeff
,
const
int
w
idth
,
const
int
h
eight
)
{
const
unsigned
maxLog2TrDynamicRange
=
tu
.
cs
->
sps
->
getMaxLog2TrDynamicRange
(
toChannelType
(
compID
)
);
const
unsigned
bitDepth
=
tu
.
cs
->
sps
->
getBitDepth
(
toChannelType
(
compID
)
);
const
int
TRANSFORM_MATRIX_SHIFT
=
g_transformMatrixShift
[
TRANSFORM_FORWARD
];
const
int
shift_1st
=
((
g_aucLog2
[
iW
idth
])
+
bitDepth
+
TRANSFORM_MATRIX_SHIFT
)
-
maxLog2TrDynamicRange
+
COM16_C806_TRANS_PREC
;
const
int
shift_2nd
=
(
g_aucLog2
[
iH
eight
])
+
TRANSFORM_MATRIX_SHIFT
+
COM16_C806_TRANS_PREC
;
const
uint32_t
transformWidthIndex
=
g_aucLog2
[
iW
idth
]
-
1
;
// nLog2WidthMinus1, since transform start from 2-point
const
uint32_t
transformHeightIndex
=
g_aucLog2
[
iH
eight
]
-
1
;
// nLog2HeightMinus1, since transform start from 2-point
const
int
iS
kipWidth
=
iW
idth
>
JVET_C0024_ZERO_OUT_TH
?
iW
idth
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
int
iS
kipHeight
=
iH
eight
>
JVET_C0024_ZERO_OUT_TH
?
iH
eight
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
int
shift_1st
=
((
g_aucLog2
[
w
idth
])
+
bitDepth
+
TRANSFORM_MATRIX_SHIFT
)
-
maxLog2TrDynamicRange
+
COM16_C806_TRANS_PREC
;
const
int
shift_2nd
=
(
g_aucLog2
[
h
eight
])
+
TRANSFORM_MATRIX_SHIFT
+
COM16_C806_TRANS_PREC
;
const
uint32_t
transformWidthIndex
=
g_aucLog2
[
w
idth
]
-
1
;
// nLog2WidthMinus1, since transform start from 2-point
const
uint32_t
transformHeightIndex
=
g_aucLog2
[
h
eight
]
-
1
;
// nLog2HeightMinus1, since transform start from 2-point
const
int
s
kipWidth
=
w
idth
>
JVET_C0024_ZERO_OUT_TH
?
w
idth
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
int
s
kipHeight
=
h
eight
>
JVET_C0024_ZERO_OUT_TH
?
h
eight
-
JVET_C0024_ZERO_OUT_TH
:
0
;
CHECK
(
shift_1st
<
0
,
"Negative shift"
);
CHECK
(
shift_2nd
<
0
,
"Negative shift"
);
...
...
@@ -324,7 +324,7 @@ void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPel
#if RExt__DECODER_DEBUG_TOOL_STATISTICS
if
(
trTypeHor
!=
DCT2
)
{
CodingStatistics
::
IncrementStatisticTool
(
CodingStatisticsClassType
{
STATS__TOOL_EMT
,
uint32_t
(
iW
idth
),
uint32_t
(
iH
eight
),
compID
}
);
CodingStatistics
::
IncrementStatisticTool
(
CodingStatisticsClassType
{
STATS__TOOL_EMT
,
uint32_t
(
w
idth
),
uint32_t
(
h
eight
),
compID
}
);
}
#endif
...
...
@@ -333,24 +333,24 @@ void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPel
const
Pel
*
resiBuf
=
resi
.
buf
;
const
int
resiStride
=
resi
.
stride
;
for
(
int
y
=
0
;
y
<
iH
eight
;
y
++
)
for
(
int
y
=
0
;
y
<
h
eight
;
y
++
)
{
for
(
int
x
=
0
;
x
<
iW
idth
;
x
++
)
for
(
int
x
=
0
;
x
<
w
idth
;
x
++
)
{
block
[(
y
*
iW
idth
)
+
x
]
=
resiBuf
[(
y
*
resiStride
)
+
x
];
block
[(
y
*
w
idth
)
+
x
]
=
resiBuf
[(
y
*
resiStride
)
+
x
];
}
}
TCoeff
*
tmp
=
(
TCoeff
*
)
alloca
(
iW
idth
*
iH
eight
*
sizeof
(
TCoeff
)
);
TCoeff
*
tmp
=
(
TCoeff
*
)
alloca
(
w
idth
*
h
eight
*
sizeof
(
TCoeff
)
);
fastFwdTrans
[
trTypeHor
][
transformWidthIndex
](
block
,
tmp
,
shift_1st
,
iH
eight
,
0
,
iS
kipWidth
);
fastFwdTrans
[
trTypeVer
][
transformHeightIndex
](
tmp
,
dstCoeff
.
buf
,
shift_2nd
,
iW
idth
,
iS
kipWidth
,
iS
kipHeight
);
fastFwdTrans
[
trTypeHor
][
transformWidthIndex
](
block
,
tmp
,
shift_1st
,
h
eight
,
0
,
s
kipWidth
);
fastFwdTrans
[
trTypeVer
][
transformHeightIndex
](
tmp
,
dstCoeff
.
buf
,
shift_2nd
,
w
idth
,
s
kipWidth
,
s
kipHeight
);
}
void
TrQuant
::
xIT
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CCoeffBuf
&
pCoeff
,
PelBuf
&
pResidual
)
{
const
int
iW
idth
=
pCoeff
.
width
;
const
int
iH
eight
=
pCoeff
.
height
;
const
int
w
idth
=
pCoeff
.
width
;
const
int
h
eight
=
pCoeff
.
height
;
const
unsigned
maxLog2TrDynamicRange
=
tu
.
cs
->
sps
->
getMaxLog2TrDynamicRange
(
toChannelType
(
compID
)
);
const
unsigned
bitDepth
=
tu
.
cs
->
sps
->
getBitDepth
(
toChannelType
(
compID
)
);
const
int
TRANSFORM_MATRIX_SHIFT
=
g_transformMatrixShift
[
TRANSFORM_INVERSE
];
...
...
@@ -358,10 +358,10 @@ void TrQuant::xIT( const TransformUnit &tu, const ComponentID &compID, const CCo
const
TCoeff
clipMaximum
=
(
1
<<
maxLog2TrDynamicRange
)
-
1
;
const
int
shift_1st
=
TRANSFORM_MATRIX_SHIFT
+
1
+
COM16_C806_TRANS_PREC
;
// 1 has been added to shift_1st at the expense of shift_2nd
const
int
shift_2nd
=
(
TRANSFORM_MATRIX_SHIFT
+
maxLog2TrDynamicRange
-
1
)
-
bitDepth
+
COM16_C806_TRANS_PREC
;
const
uint32_t
transformWidthIndex
=
g_aucLog2
[
iW
idth
]
-
1
;
// nLog2WidthMinus1, since transform start from 2-point
const
uint32_t
transformHeightIndex
=
g_aucLog2
[
iH
eight
]
-
1
;
// nLog2HeightMinus1, since transform start from 2-point
const
int
iS
kipWidth
=
iW
idth
>
JVET_C0024_ZERO_OUT_TH
?
iW
idth
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
int
iS
kipHeight
=
iH
eight
>
JVET_C0024_ZERO_OUT_TH
?
iH
eight
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
uint32_t
transformWidthIndex
=
g_aucLog2
[
w
idth
]
-
1
;
// nLog2WidthMinus1, since transform start from 2-point
const
uint32_t
transformHeightIndex
=
g_aucLog2
[
h
eight
]
-
1
;
// nLog2HeightMinus1, since transform start from 2-point
const
int
s
kipWidth
=
w
idth
>
JVET_C0024_ZERO_OUT_TH
?
w
idth
-
JVET_C0024_ZERO_OUT_TH
:
0
;
const
int
s
kipHeight
=
h
eight
>
JVET_C0024_ZERO_OUT_TH
?
h
eight
-
JVET_C0024_ZERO_OUT_TH
:
0
;
CHECK
(
shift_1st
<
0
,
"Negative shift"
);
CHECK
(
shift_2nd
<
0
,
"Negative shift"
);
...
...
@@ -371,20 +371,20 @@ void TrQuant::xIT( const TransformUnit &tu, const ComponentID &compID, const CCo
getTrTypes
(
tu
,
compID
,
trTypeHor
,
trTypeVer
);
TCoeff
*
tmp
=
(
TCoeff
*
)
alloca
(
iW
idth
*
iH
eight
*
sizeof
(
TCoeff
)
);
TCoeff
*
block
=
(
TCoeff
*
)
alloca
(
iW
idth
*
iH
eight
*
sizeof
(
TCoeff
)
);
TCoeff
*
tmp
=
(
TCoeff
*
)
alloca
(
w
idth
*
h
eight
*
sizeof
(
TCoeff
)
);
TCoeff
*
block
=
(
TCoeff
*
)
alloca
(
w
idth
*
h
eight
*
sizeof
(
TCoeff
)
);
fastInvTrans
[
trTypeVer
][
transformHeightIndex
](
pCoeff
.
buf
,
tmp
,
shift_1st
,
iW
idth
,
iS
kipWidth
,
iS
kipHeight
,
clipMinimum
,
clipMaximum
);
fastInvTrans
[
trTypeHor
][
transformWidthIndex
]
(
tmp
,
block
,
shift_2nd
,
iH
eight
,
0
,
iS
kipWidth
,
clipMinimum
,
clipMaximum
);
fastInvTrans
[
trTypeVer
][
transformHeightIndex
](
pCoeff
.
buf
,
tmp
,
shift_1st
,
w
idth
,
s
kipWidth
,
s
kipHeight
,
clipMinimum
,
clipMaximum
);
fastInvTrans
[
trTypeHor
][
transformWidthIndex
]
(
tmp
,
block
,
shift_2nd
,
h
eight
,
0
,
s
kipWidth
,
clipMinimum
,
clipMaximum
);
Pel
*
resiBuf
=
pResidual
.
buf
;
int
resiStride
=
pResidual
.
stride
;
for
(
int
y
=
0
;
y
<
iH
eight
;
y
++
)
for
(
int
y
=
0
;
y
<
h
eight
;
y
++
)
{
for
(
int
x
=
0
;
x
<
iW
idth
;
x
++
)
for
(
int
x
=
0
;
x
<
w
idth
;
x
++
)
{
resiBuf
[(
y
*
resiStride
)
+
x
]
=
Pel
(
block
[(
y
*
iW
idth
)
+
x
]
);
resiBuf
[(
y
*
resiStride
)
+
x
]
=
Pel
(
block
[(
y
*
w
idth
)
+
x
]
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/TrQuant.h
+
1
−
2
View file @
205d6763
...
...
@@ -125,8 +125,7 @@ private:
// forward Transform
void
xT
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CPelBuf
&
resi
,
CoeffBuf
&
dstCoeff
,
const
int
iWidth
,
const
int
iHeight
);
void
xT
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CPelBuf
&
resi
,
CoeffBuf
&
dstCoeff
,
const
int
width
,
const
int
height
);
// skipping Transform
void
xTransformSkip
(
const
TransformUnit
&
tu
,
const
ComponentID
&
compID
,
const
CPelBuf
&
resi
,
TCoeff
*
psCoeff
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment