Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Satoru KUMA
MPEG129-m52280
Commits
887827fd
Commit
887827fd
authored
Apr 08, 2019
by
David Flynn
Browse files
refactor: rename pcc::PCCBox3<T> to pcc:Box3<T>
This is part of a series attempting to remove unhelpful typedefs.
parent
30dab101
Changes
4
Hide whitespace changes
Inline
Side-by-side
tmc3/PCCMath.h
View file @
887827fd
...
...
@@ -281,7 +281,7 @@ private:
};
template
<
typename
T
>
struct
PCC
Box3
{
struct
Box3
{
Vec3
<
T
>
min
;
Vec3
<
T
>
max
;
bool
contains
(
const
Vec3
<
T
>
point
)
const
...
...
@@ -291,7 +291,7 @@ struct PCCBox3 {
||
point
.
y
()
>
max
.
y
()
||
point
.
z
()
<
min
.
z
()
||
point
.
z
()
>
max
.
z
());
}
PCC
Box3
merge
(
const
PCC
Box3
&
box
)
Box3
merge
(
const
Box3
&
box
)
{
min
.
x
()
=
std
::
min
(
min
.
x
(),
box
.
min
.
x
());
min
.
y
()
=
std
::
min
(
min
.
y
(),
box
.
min
.
y
());
...
...
@@ -302,7 +302,7 @@ struct PCCBox3 {
return
box
;
}
bool
intersects
(
const
PCC
Box3
&
box
)
const
bool
intersects
(
const
Box3
&
box
)
const
{
return
max
.
x
()
>=
box
.
min
.
x
()
&&
min
.
x
()
<=
box
.
max
.
x
()
&&
max
.
y
()
>=
box
.
min
.
y
()
&&
min
.
y
()
<=
box
.
max
.
y
()
...
...
@@ -317,13 +317,13 @@ struct PCCBox3 {
return
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
PCC
Box3
&
box
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Box3
&
box
)
{
os
<<
box
.
min
[
0
]
<<
" "
<<
box
.
min
[
1
]
<<
" "
<<
box
.
min
[
2
]
<<
" "
<<
box
.
max
[
0
]
<<
" "
<<
box
.
max
[
1
]
<<
" "
<<
box
.
max
[
2
]
<<
std
::
endl
;
return
os
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
PCC
Box3
&
box
)
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
Box3
&
box
)
{
is
>>
box
.
min
[
0
]
>>
box
.
min
[
1
]
>>
box
.
min
[
2
]
>>
box
.
max
[
0
]
>>
box
.
max
[
1
]
>>
box
.
max
[
2
];
...
...
@@ -335,7 +335,7 @@ struct PCCBox3 {
typedef
DEPRECATED_MSVC
Vec3
<
double
>
PCCVector3D
DEPRECATED
;
typedef
DEPRECATED_MSVC
Vec3
<
double
>
PCCPoint3D
DEPRECATED
;
typedef
PCC
Box3
<
double
>
PCCBox3D
;
typedef
Box3
<
double
>
PCCBox3D
;
typedef
DEPRECATED_MSVC
Vec3
<
uint8_t
>
PCCColor3B
DEPRECATED
;
template
<
typename
T
>
...
...
tmc3/PCCPointSetProcessing.h
View file @
887827fd
...
...
@@ -59,7 +59,7 @@ inline void
quantizePositionsUniq
(
const
float
scaleFactor
,
const
Vec3
<
int
>
offset
,
const
PCC
Box3
<
int
>
clamp
,
const
Box3
<
int
>
clamp
,
const
PCCPointSet3
&
src
,
PCCPointSet3
*
dst
)
{
...
...
@@ -108,7 +108,7 @@ inline void
quantizePositions
(
const
float
scaleFactor
,
const
Vec3
<
int
>
offset
,
const
PCC
Box3
<
int
>
clamp
,
const
Box3
<
int
>
clamp
,
const
PCCPointSet3
&
src
,
PCCPointSet3
*
dst
)
{
...
...
tmc3/encoder.cpp
View file @
887827fd
...
...
@@ -114,7 +114,7 @@ PCCTMC3Encoder3::compress(
PartitionSet
partitions
;
do
{
PCCPointSet3
quantizedInputCloud
;
PCC
Box3
<
int32_t
>
clampBox
{{
0
,
0
,
0
},
{
INT32_MAX
,
INT32_MAX
,
INT32_MAX
}};
Box3
<
int32_t
>
clampBox
{{
0
,
0
,
0
},
{
INT32_MAX
,
INT32_MAX
,
INT32_MAX
}};
quantizePositions
(
_sps
->
seq_source_geom_scale_factor
,
_sps
->
seq_bounding_box_xyz0
,
clampBox
,
inputPointCloud
,
&
quantizedInputCloud
);
...
...
@@ -410,12 +410,12 @@ PCCTMC3Encoder3::quantization(const PCCPointSet3& inputPointCloud)
// Clamp all points to [clampBox.min, clampBox.max] after translation
// and quantisation.
PCC
Box3
<
int32_t
>
clampBox
{{
0
,
0
,
0
},
{
INT32_MAX
,
INT32_MAX
,
INT32_MAX
}};
Box3
<
int32_t
>
clampBox
{{
0
,
0
,
0
},
{
INT32_MAX
,
INT32_MAX
,
INT32_MAX
}};
if
(
_sps
->
seq_bounding_box_whd
!=
Vec3
<
int
>
{
0
})
{
// todo(df): this is icky (not to mention rounding issues)
// NB: the sps seq_bounding_box_* uses unscaled co-ordinates => convert
// NB: minus 1 to convert to max x/y/z position
clampBox
=
PCC
Box3
<
int32_t
>
{{
0
,
0
,
0
},
_sps
->
seq_bounding_box_whd
};
clampBox
=
Box3
<
int32_t
>
{{
0
,
0
,
0
},
_sps
->
seq_bounding_box_whd
};
for
(
int
k
=
0
;
k
<
3
;
k
++
)
clampBox
.
max
[
k
]
=
int
(
ceil
(
clampBox
.
max
[
k
]
*
_sps
->
seq_source_geom_scale_factor
))
-
1
;
...
...
tmc3/partitioning.cpp
View file @
887827fd
...
...
@@ -44,7 +44,7 @@ namespace pcc {
template
<
typename
T
>
static
int
longestAxis
(
const
PCC
Box3
<
T
>&
curBox
)
longestAxis
(
const
Box3
<
T
>&
curBox
)
{
int
edgeAxis
=
0
;
...
...
@@ -62,7 +62,7 @@ longestAxis(const PCCBox3<T>& curBox)
template
<
typename
T
>
static
int
shortestAxis
(
const
PCC
Box3
<
T
>&
curBox
)
shortestAxis
(
const
Box3
<
T
>&
curBox
)
{
int
edgeAxis
=
0
;
...
...
@@ -148,7 +148,7 @@ partitionByOctreeDepth(const PCCPointSet3& cloud, int depOctree)
// noting that there is a correspondence between point position
// and octree node, calculate the position mask and shift required
// to determine the node address for a point.
PCC
Box3
<
double
>
bbox
=
cloud
.
computeBoundingBox
();
Box3
<
double
>
bbox
=
cloud
.
computeBoundingBox
();
int
maxBb
=
(
int
)
std
::
max
({
bbox
.
max
[
0
],
bbox
.
max
[
1
],
bbox
.
max
[
2
]});
int
cloudSizeLog2
=
ceillog2
(
maxBb
+
1
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment