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
00bac43d
Commit
00bac43d
authored
Apr 08, 2019
by
David Flynn
Browse files
refactor: rename pcc::PCCVector3<T> to pcc::Vec3<T>
This is part of a series attempting to remove unhelpful typedefs.
parent
6980ddc2
Changes
21
Hide whitespace changes
Inline
Side-by-side
tmc3/AttributeEncoder.cpp
View file @
00bac43d
...
...
@@ -479,14 +479,14 @@ AttributeEncoder::encodeReflectancesPred(
//----------------------------------------------------------------------------
PCCVector
3
<
int64_t
>
Vec
3
<
int64_t
>
AttributeEncoder
::
computeColorResiduals
(
const
PCCColor3B
color
,
const
PCCColor3B
predictedColor
,
const
int64_t
qs
,
const
int64_t
qs2
)
{
PCCVector
3
<
int64_t
>
residuals
;
Vec
3
<
int64_t
>
residuals
;
const
int64_t
quantAttValue
=
color
[
0
];
const
int64_t
quantPredAttValue
=
predictedColor
[
0
];
const
int64_t
delta
=
PCCQuantization
(
quantAttValue
-
quantPredAttValue
,
qs
);
...
...
@@ -540,7 +540,7 @@ AttributeEncoder::computeColorPredictionWeights(
// base case: weighted average of n neighbours
predictor
.
predMode
=
0
;
PCCColor3B
attrPred
=
predictor
.
predictColor
(
pointCloud
,
indexesLOD
);
PCCVector
3
<
int64_t
>
attrResidualQuant
=
Vec
3
<
int64_t
>
attrResidualQuant
=
computeColorResiduals
(
attrValue
,
attrPred
,
qs
,
qs2
);
double
best_score
=
attrResidualQuant
[
0
]
+
attrResidualQuant
[
1
]
...
...
tmc3/AttributeEncoder.h
View file @
00bac43d
...
...
@@ -98,7 +98,7 @@ protected:
PCCPointSet3
&
pointCloud
,
PCCResidualsEncoder
&
encoder
);
static
PCCVector
3
<
int64_t
>
computeColorResiduals
(
static
Vec
3
<
int64_t
>
computeColorResiduals
(
const
PCCColor3B
color
,
const
PCCColor3B
predictedColor
,
const
int64_t
qs
,
...
...
tmc3/OctreeNeighMap.cpp
View file @
00bac43d
...
...
@@ -43,12 +43,12 @@ namespace pcc {
void
updateGeometryOccupancyAtlas
(
const
PCCVector
3
<
uint32_t
>&
currentPosition
,
const
Vec
3
<
uint32_t
>&
currentPosition
,
const
int
nodeSizeLog2
,
const
pcc
::
ringbuf
<
PCCOctree3Node
>&
fifo
,
const
pcc
::
ringbuf
<
PCCOctree3Node
>::
iterator
&
fifoCurrLvlEnd
,
MortonMap3D
*
occupancyAtlas
,
PCCVector
3
<
uint32_t
>*
atlasOrigin
)
Vec
3
<
uint32_t
>*
atlasOrigin
)
{
const
uint32_t
mask
=
(
1
<<
occupancyAtlas
->
cubeSizeLog2
())
-
1
;
const
int
shift
=
occupancyAtlas
->
cubeSizeLog2
()
+
nodeSizeLog2
;
...
...
@@ -78,7 +78,7 @@ updateGeometryOccupancyAtlas(
void
updateGeometryOccupancyAtlasOccChild
(
const
PCCVector
3
<
uint32_t
>&
pos
,
const
Vec
3
<
uint32_t
>&
pos
,
int
nodeSizeLog2
,
uint8_t
childOccupancy
,
MortonMap3D
*
occupancyAtlas
)
...
...
@@ -135,7 +135,7 @@ updatePatternFromNeighOccupancy(
GeometryNeighPattern
makeGeometryNeighPattern
(
bool
adjacent_child_contextualization_enabled_flag
,
const
PCCVector
3
<
uint32_t
>&
position
,
const
Vec
3
<
uint32_t
>&
position
,
const
int
nodeSizeLog2
,
const
MortonMap3D
&
occupancyAtlas
)
{
...
...
tmc3/OctreeNeighMap.h
View file @
00bac43d
...
...
@@ -172,22 +172,22 @@ struct GeometryNeighPattern {
// the neighbour pattern and derive external adjacency counts for each child.
GeometryNeighPattern
makeGeometryNeighPattern
(
bool
adjacent_child_contextualization_enabled_flag
,
const
PCCVector
3
<
uint32_t
>&
currentPosition
,
const
Vec
3
<
uint32_t
>&
currentPosition
,
const
int
nodeSizeLog2
,
const
MortonMap3D
&
occupancyAtlas
);
// populate (if necessary) the occupancy atlas with occupancy information
// from @fifo.
void
updateGeometryOccupancyAtlas
(
const
PCCVector
3
<
uint32_t
>&
position
,
const
Vec
3
<
uint32_t
>&
position
,
const
int
nodeSizeLog2
,
const
ringbuf
<
PCCOctree3Node
>&
fifo
,
const
ringbuf
<
PCCOctree3Node
>::
iterator
&
fifoCurrLvlEnd
,
MortonMap3D
*
occupancyAtlas
,
PCCVector
3
<
uint32_t
>*
atlasOrigin
);
Vec
3
<
uint32_t
>*
atlasOrigin
);
void
updateGeometryOccupancyAtlasOccChild
(
const
PCCVector
3
<
uint32_t
>&
pos
,
const
Vec
3
<
uint32_t
>&
pos
,
int
nodeSizeLog2
,
uint8_t
childOccupancy
,
MortonMap3D
*
occupancyAtlas
);
...
...
tmc3/PCCMath.h
View file @
00bac43d
...
...
@@ -49,7 +49,7 @@
namespace
pcc
{
/// Vector dim 3
template
<
typename
T
>
class
PCCVector
3
{
class
Vec
3
{
public:
T
*
begin
()
{
return
&
data
[
0
];
}
const
T
*
begin
()
const
{
return
&
data
[
0
];
}
...
...
@@ -87,54 +87,54 @@ public:
{
return
std
::
max
(
data
[
2
],
std
::
max
(
abs
(
data
[
0
]),
abs
(
data
[
1
])));
}
PCCVector
3
&
operator
=
(
const
PCCVector
3
&
rhs
)
Vec
3
&
operator
=
(
const
Vec
3
&
rhs
)
{
memcpy
(
data
,
rhs
.
data
,
sizeof
(
data
));
return
*
this
;
}
PCCVector
3
&
operator
+=
(
const
PCCVector
3
&
rhs
)
Vec
3
&
operator
+=
(
const
Vec
3
&
rhs
)
{
data
[
0
]
+=
rhs
.
data
[
0
];
data
[
1
]
+=
rhs
.
data
[
1
];
data
[
2
]
+=
rhs
.
data
[
2
];
return
*
this
;
}
PCCVector
3
&
operator
-=
(
const
PCCVector
3
&
rhs
)
Vec
3
&
operator
-=
(
const
Vec
3
&
rhs
)
{
data
[
0
]
-=
rhs
.
data
[
0
];
data
[
1
]
-=
rhs
.
data
[
1
];
data
[
2
]
-=
rhs
.
data
[
2
];
return
*
this
;
}
PCCVector
3
&
operator
-=
(
const
T
a
)
Vec
3
&
operator
-=
(
const
T
a
)
{
data
[
0
]
-=
a
;
data
[
1
]
-=
a
;
data
[
2
]
-=
a
;
return
*
this
;
}
PCCVector
3
&
operator
+=
(
const
T
a
)
Vec
3
&
operator
+=
(
const
T
a
)
{
data
[
0
]
+=
a
;
data
[
1
]
+=
a
;
data
[
2
]
+=
a
;
return
*
this
;
}
PCCVector
3
&
operator
<<=
(
int
val
)
Vec
3
&
operator
<<=
(
int
val
)
{
data
[
0
]
<<=
val
;
data
[
1
]
<<=
val
;
data
[
2
]
<<=
val
;
return
*
this
;
}
PCCVector
3
&
operator
>>=
(
int
val
)
Vec
3
&
operator
>>=
(
int
val
)
{
data
[
0
]
>>=
val
;
data
[
1
]
>>=
val
;
data
[
2
]
>>=
val
;
return
*
this
;
}
PCCVector
3
&
operator
/=
(
const
T
a
)
Vec
3
&
operator
/=
(
const
T
a
)
{
assert
(
a
!=
0
);
data
[
0
]
/=
a
;
...
...
@@ -142,95 +142,83 @@ public:
data
[
2
]
/=
a
;
return
*
this
;
}
PCCVector
3
&
operator
*=
(
const
T
a
)
Vec
3
&
operator
*=
(
const
T
a
)
{
data
[
0
]
*=
a
;
data
[
1
]
*=
a
;
data
[
2
]
*=
a
;
return
*
this
;
}
PCCVector
3
&
operator
=
(
const
T
a
)
Vec
3
&
operator
=
(
const
T
a
)
{
data
[
0
]
=
a
;
data
[
1
]
=
a
;
data
[
2
]
=
a
;
return
*
this
;
}
PCCVector
3
&
operator
=
(
const
T
*
const
rhs
)
Vec
3
&
operator
=
(
const
T
*
const
rhs
)
{
data
[
0
]
=
rhs
[
0
];
data
[
1
]
=
rhs
[
1
];
data
[
2
]
=
rhs
[
2
];
return
*
this
;
}
T
operator
*
(
const
PCCVector
3
&
rhs
)
const
T
operator
*
(
const
Vec
3
&
rhs
)
const
{
return
(
data
[
0
]
*
rhs
.
data
[
0
]
+
data
[
1
]
*
rhs
.
data
[
1
]
+
data
[
2
]
*
rhs
.
data
[
2
]);
}
PCCVector3
operator
-
()
const
Vec3
operator
-
()
const
{
return
Vec3
<
T
>
(
-
data
[
0
],
-
data
[
1
],
-
data
[
2
]);
}
friend
Vec3
operator
+
(
const
Vec3
&
lhs
,
const
Vec3
&
rhs
)
{
return
PCCVector3
<
T
>
(
-
data
[
0
],
-
data
[
1
],
-
data
[
2
]);
}
friend
PCCVector3
operator
+
(
const
PCCVector3
&
lhs
,
const
PCCVector3
&
rhs
)
{
return
PCCVector3
<
T
>
(
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
+
rhs
.
data
[
0
],
lhs
.
data
[
1
]
+
rhs
.
data
[
1
],
lhs
.
data
[
2
]
+
rhs
.
data
[
2
]);
}
friend
PCCVector
3
operator
+
(
const
T
lhs
,
const
PCCVector
3
&
rhs
)
friend
Vec
3
operator
+
(
const
T
lhs
,
const
Vec
3
&
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
+
rhs
.
data
[
0
],
lhs
+
rhs
.
data
[
1
],
lhs
+
rhs
.
data
[
2
]);
return
Vec3
<
T
>
(
lhs
+
rhs
.
data
[
0
],
lhs
+
rhs
.
data
[
1
],
lhs
+
rhs
.
data
[
2
]);
}
friend
PCCVector
3
operator
+
(
const
PCCVector
3
&
lhs
,
const
T
rhs
)
friend
Vec
3
operator
+
(
const
Vec
3
&
lhs
,
const
T
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
+
rhs
,
lhs
.
data
[
1
]
+
rhs
,
lhs
.
data
[
2
]
+
rhs
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
+
rhs
,
lhs
.
data
[
1
]
+
rhs
,
lhs
.
data
[
2
]
+
rhs
);
}
friend
PCCVector
3
operator
-
(
const
PCCVector
3
&
lhs
,
const
PCCVector
3
&
rhs
)
friend
Vec
3
operator
-
(
const
Vec
3
&
lhs
,
const
Vec
3
&
rhs
)
{
return
PCCVector
3
<
T
>
(
return
Vec
3
<
T
>
(
lhs
.
data
[
0
]
-
rhs
.
data
[
0
],
lhs
.
data
[
1
]
-
rhs
.
data
[
1
],
lhs
.
data
[
2
]
-
rhs
.
data
[
2
]);
}
friend
PCCVector
3
operator
-
(
const
T
lhs
,
const
PCCVector
3
&
rhs
)
friend
Vec
3
operator
-
(
const
T
lhs
,
const
Vec
3
&
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
-
rhs
.
data
[
0
],
lhs
-
rhs
.
data
[
1
],
lhs
-
rhs
.
data
[
2
]);
return
Vec3
<
T
>
(
lhs
-
rhs
.
data
[
0
],
lhs
-
rhs
.
data
[
1
],
lhs
-
rhs
.
data
[
2
]);
}
friend
PCCVector
3
operator
-
(
const
PCCVector
3
&
lhs
,
const
T
rhs
)
friend
Vec
3
operator
-
(
const
Vec
3
&
lhs
,
const
T
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
-
rhs
,
lhs
.
data
[
1
]
-
rhs
,
lhs
.
data
[
2
]
-
rhs
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
-
rhs
,
lhs
.
data
[
1
]
-
rhs
,
lhs
.
data
[
2
]
-
rhs
);
}
friend
PCCVector
3
operator
*
(
const
T
lhs
,
const
PCCVector
3
&
rhs
)
friend
Vec
3
operator
*
(
const
T
lhs
,
const
Vec
3
&
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
*
rhs
.
data
[
0
],
lhs
*
rhs
.
data
[
1
],
lhs
*
rhs
.
data
[
2
]);
return
Vec3
<
T
>
(
lhs
*
rhs
.
data
[
0
],
lhs
*
rhs
.
data
[
1
],
lhs
*
rhs
.
data
[
2
]);
}
friend
PCCVector
3
operator
*
(
const
PCCVector
3
&
lhs
,
const
T
rhs
)
friend
Vec
3
operator
*
(
const
Vec
3
&
lhs
,
const
T
rhs
)
{
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
*
rhs
,
lhs
.
data
[
1
]
*
rhs
,
lhs
.
data
[
2
]
*
rhs
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
*
rhs
,
lhs
.
data
[
1
]
*
rhs
,
lhs
.
data
[
2
]
*
rhs
);
}
friend
PCCVector
3
operator
/
(
const
PCCVector
3
&
lhs
,
const
T
rhs
)
friend
Vec
3
operator
/
(
const
Vec
3
&
lhs
,
const
T
rhs
)
{
assert
(
rhs
!=
0
);
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
/
rhs
,
lhs
.
data
[
1
]
/
rhs
,
lhs
.
data
[
2
]
/
rhs
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
/
rhs
,
lhs
.
data
[
1
]
/
rhs
,
lhs
.
data
[
2
]
/
rhs
);
}
friend
PCCVector
3
operator
<<
(
const
PCCVector
3
&
lhs
,
int
val
)
friend
Vec
3
operator
<<
(
const
Vec
3
&
lhs
,
int
val
)
{
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
<<
val
,
lhs
.
data
[
1
]
<<
val
,
lhs
.
data
[
2
]
<<
val
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
<<
val
,
lhs
.
data
[
1
]
<<
val
,
lhs
.
data
[
2
]
<<
val
);
}
friend
PCCVector
3
operator
>>
(
const
PCCVector
3
&
lhs
,
int
val
)
friend
Vec
3
operator
>>
(
const
Vec
3
&
lhs
,
int
val
)
{
return
PCCVector3
<
T
>
(
lhs
.
data
[
0
]
>>
val
,
lhs
.
data
[
1
]
>>
val
,
lhs
.
data
[
2
]
>>
val
);
return
Vec3
<
T
>
(
lhs
.
data
[
0
]
>>
val
,
lhs
.
data
[
1
]
>>
val
,
lhs
.
data
[
2
]
>>
val
);
}
bool
operator
<
(
const
PCCVector
3
&
rhs
)
const
bool
operator
<
(
const
Vec
3
&
rhs
)
const
{
if
(
data
[
0
]
==
rhs
.
data
[
0
])
{
if
(
data
[
1
]
==
rhs
.
data
[
1
])
{
...
...
@@ -240,7 +228,7 @@ public:
}
return
(
data
[
0
]
<
rhs
.
data
[
0
]);
}
bool
operator
>
(
const
PCCVector
3
&
rhs
)
const
bool
operator
>
(
const
Vec
3
&
rhs
)
const
{
if
(
data
[
0
]
==
rhs
.
data
[
0
])
{
if
(
data
[
1
]
==
rhs
.
data
[
1
])
{
...
...
@@ -250,43 +238,43 @@ public:
}
return
(
data
[
0
]
>
rhs
.
data
[
0
]);
}
bool
operator
==
(
const
PCCVector
3
&
rhs
)
const
bool
operator
==
(
const
Vec
3
&
rhs
)
const
{
return
(
data
[
0
]
==
rhs
.
data
[
0
]
&&
data
[
1
]
==
rhs
.
data
[
1
]
&&
data
[
2
]
==
rhs
.
data
[
2
]);
}
bool
operator
!=
(
const
PCCVector
3
&
rhs
)
const
bool
operator
!=
(
const
Vec
3
&
rhs
)
const
{
return
(
data
[
0
]
!=
rhs
.
data
[
0
]
||
data
[
1
]
!=
rhs
.
data
[
1
]
||
data
[
2
]
!=
rhs
.
data
[
2
]);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
PCCVector
3
&
vec
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Vec
3
&
vec
)
{
os
<<
vec
[
0
]
<<
" "
<<
vec
[
1
]
<<
" "
<<
vec
[
2
]
<<
std
::
endl
;
return
os
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
PCCVector
3
&
vec
)
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
Vec
3
&
vec
)
{
is
>>
vec
[
0
]
>>
vec
[
1
]
>>
vec
[
2
];
return
is
;
}
PCCVector
3
(
const
T
a
)
{
data
[
0
]
=
data
[
1
]
=
data
[
2
]
=
a
;
}
PCCVector
3
(
const
T
x
,
const
T
y
,
const
T
z
)
Vec
3
(
const
T
a
)
{
data
[
0
]
=
data
[
1
]
=
data
[
2
]
=
a
;
}
Vec
3
(
const
T
x
,
const
T
y
,
const
T
z
)
{
data
[
0
]
=
x
;
data
[
1
]
=
y
;
data
[
2
]
=
z
;
}
PCCVector3
(
const
PCCVector
3
&
vec
)
Vec3
(
const
Vec
3
&
vec
)
{
data
[
0
]
=
vec
.
data
[
0
];
data
[
1
]
=
vec
.
data
[
1
];
data
[
2
]
=
vec
.
data
[
2
];
}
PCCVector
3
()
=
default
;
~
PCCVector
3
(
void
)
=
default
;
Vec
3
()
=
default
;
~
Vec
3
(
void
)
=
default
;
private:
T
data
[
3
];
...
...
@@ -294,9 +282,9 @@ private:
template
<
typename
T
>
struct
PCCBox3
{
PCCVector
3
<
T
>
min
;
PCCVector
3
<
T
>
max
;
bool
contains
(
const
PCCVector
3
<
T
>
point
)
const
Vec
3
<
T
>
min
;
Vec
3
<
T
>
max
;
bool
contains
(
const
Vec
3
<
T
>
point
)
const
{
return
!
(
point
.
x
()
<
min
.
x
()
||
point
.
x
()
>
max
.
x
()
||
point
.
y
()
<
min
.
y
()
...
...
@@ -321,7 +309,7 @@ struct PCCBox3 {
&&
max
.
z
()
>=
box
.
min
.
z
()
&&
min
.
z
()
<=
box
.
max
.
z
();
}
T
getDist2
(
const
PCCVector
3
<
T
>&
point
)
const
T
getDist2
(
const
Vec
3
<
T
>&
point
)
const
{
const
T
dx
=
std
::
max
(
std
::
max
(
min
[
0
]
-
point
[
0
],
0.0
),
point
[
0
]
-
max
[
0
]);
const
T
dy
=
std
::
max
(
std
::
max
(
min
[
1
]
-
point
[
1
],
0.0
),
point
[
1
]
-
max
[
1
]);
...
...
@@ -343,12 +331,10 @@ struct PCCBox3 {
}
};
typedef
PCCVector
3
<
double
>
PCCVector3D
;
typedef
PCCVector
3
<
double
>
PCCPoint3D
;
typedef
Vec
3
<
double
>
PCCVector3D
;
typedef
Vec
3
<
double
>
PCCPoint3D
;
typedef
PCCBox3
<
double
>
PCCBox3D
;
typedef
PCCVector3
<
uint8_t
>
PCCColor3B
;
template
<
typename
T
>
using
Vec3
=
PCCVector3
<
T
>
;
typedef
Vec3
<
uint8_t
>
PCCColor3B
;
template
<
typename
T
>
T
...
...
@@ -384,7 +370,7 @@ mortonAddr(const int32_t x, const int32_t y, const int32_t z)
template
<
typename
T
>
uint64_t
mortonAddr
(
const
PCCVector
3
<
T
>&
vec
,
int
depth
)
mortonAddr
(
const
Vec
3
<
T
>&
vec
,
int
depth
)
{
int
x
=
int
(
vec
.
x
())
>>
depth
;
int
y
=
int
(
vec
.
y
())
>>
depth
;
...
...
tmc3/PCCPointSetProcessing.h
View file @
00bac43d
...
...
@@ -58,19 +58,19 @@ namespace pcc {
inline
void
quantizePositionsUniq
(
const
float
scaleFactor
,
const
PCCVector
3
<
int
>
offset
,
const
Vec
3
<
int
>
offset
,
const
PCCBox3
<
int
>
clamp
,
const
PCCPointSet3
&
src
,
PCCPointSet3
*
dst
)
{
// Determine the set of unique quantised points
std
::
set
<
PCCVector
3
<
int32_t
>>
uniquePoints
;
std
::
set
<
Vec
3
<
int32_t
>>
uniquePoints
;
int
numSrcPoints
=
src
.
getPointCount
();
for
(
int
i
=
0
;
i
<
numSrcPoints
;
++
i
)
{
const
PCCVector3D
&
point
=
src
[
i
];
PCCVector
3
<
int32_t
>
quantizedPoint
;
Vec
3
<
int32_t
>
quantizedPoint
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
double
k_pos
=
std
::
round
((
point
[
k
]
-
offset
[
k
])
*
scaleFactor
);
quantizedPoint
[
k
]
=
PCCClip
(
int32_t
(
k_pos
),
clamp
.
min
[
k
],
clamp
.
max
[
k
]);
...
...
@@ -107,7 +107,7 @@ quantizePositionsUniq(
inline
void
quantizePositions
(
const
float
scaleFactor
,
const
PCCVector
3
<
int
>
offset
,
const
Vec
3
<
int
>
offset
,
const
PCCBox3
<
int
>
clamp
,
const
PCCPointSet3
&
src
,
PCCPointSet3
*
dst
)
...
...
@@ -353,8 +353,8 @@ inline int
recolour
(
const
PCCPointSet3
&
source
,
float
sourceToTargetScaleFactor
,
PCCVector
3
<
int
>
targetToSourceOffset
,
PCCVector
3
<
int
>
offset
,
Vec
3
<
int
>
targetToSourceOffset
,
Vec
3
<
int
>
offset
,
PCCPointSet3
*
target
)
{
PCCVector3D
combinedOffset
;
...
...
tmc3/PCCTMC3Decoder.h
View file @
00bac43d
...
...
@@ -92,7 +92,7 @@ private:
int
_sliceId
;
// Position of the slice in the translated+scaled co-ordinate system.
PCCVector
3
<
int
>
_sliceOrigin
;
Vec
3
<
int
>
_sliceOrigin
;
// The point cloud currently being decoded
PCCPointSet3
_currentPointCloud
;
...
...
tmc3/PCCTMC3Encoder.h
View file @
00bac43d
...
...
@@ -121,10 +121,10 @@ private:
PCCPointSet3
pointCloud
;
// Position of the slice in the translated+scaled co-ordinate system.
PCCVector
3
<
int
>
_sliceOrigin
;
Vec
3
<
int
>
_sliceOrigin
;
// Size of the current slice
PCCVector
3
<
int
>
_sliceBoxWhd
;
Vec
3
<
int
>
_sliceBoxWhd
;
// The active parameter sets
const
SequenceParameterSet
*
_sps
;
...
...
tmc3/TMC3.cpp
View file @
00bac43d
...
...
@@ -179,13 +179,13 @@ operator<<(std::ostream& out, const PartitionMethod& val)
namespace
df
{
namespace
program_options_lite
{
template
<
typename
T
>
struct
option_detail
<
pcc
::
PCCVector
3
<
T
>>
{
struct
option_detail
<
pcc
::
Vec
3
<
T
>>
{
static
constexpr
bool
is_container
=
true
;
static
constexpr
bool
is_fixed_size
=
true
;
typedef
T
*
output_iterator
;
static
void
clear
(
pcc
::
PCCVector
3
<
T
>&
container
){};
static
output_iterator
make_output_iterator
(
pcc
::
PCCVector
3
<
T
>&
container
)
static
void
clear
(
pcc
::
Vec
3
<
T
>&
container
){};
static
output_iterator
make_output_iterator
(
pcc
::
Vec
3
<
T
>&
container
)
{
return
&
container
[
0
];
}
...
...
tmc3/encoder.cpp
View file @
00bac43d
...
...
@@ -60,7 +60,7 @@ PCCTMC3Encoder3::compress(
fixupParameterSets
(
params
);
// Determine input bounding box (for SPS metadata) if not manually set
if
(
params
->
sps
.
seq_bounding_box_whd
==
PCCVector
3
<
int
>
{
0
})
{
if
(
params
->
sps
.
seq_bounding_box_whd
==
Vec
3
<
int
>
{
0
})
{
const
auto
&
bbox
=
inputPointCloud
.
computeBoundingBox
();
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
params
->
sps
.
seq_bounding_box_xyz0
[
k
]
=
int
(
bbox
.
min
[
k
]);
...
...
@@ -98,7 +98,7 @@ PCCTMC3Encoder3::compress(
// If partitioning is not enabled, encode input as a single "partition"
if
(
params
->
partitionMethod
==
PartitionMethod
::
kNone
)
{
// todo(df): params->gps.geom_box_present_flag = false;
_sliceOrigin
=
PCCVector
3
<
int
>
{
0
};
_sliceOrigin
=
Vec
3
<
int
>
{
0
};
compressPartition
(
inputPointCloud
,
params
,
outputFn
,
reconstructedCloud
);
return
0
;
}
...
...
@@ -406,12 +406,12 @@ void
PCCTMC3Encoder3
::
quantization
(
const
PCCPointSet3
&
inputPointCloud
)
{
// Currently the sequence width/height/depth must be set
assert
(
_sps
->
seq_bounding_box_whd
!=
PCCVector
3
<
int
>
{
0
});
assert
(
_sps
->
seq_bounding_box_whd
!=
Vec
3
<
int
>
{
0
});
// Clamp all points to [clampBox.min, clampBox.max] after translation
// and quantisation.
PCCBox3
<
int32_t
>
clampBox
{{
0
,
0
,
0
},
{
INT32_MAX
,
INT32_MAX
,
INT32_MAX
}};
if
(
_sps
->
seq_bounding_box_whd
!=
PCCVector
3
<
int
>
{
0
})
{
if
(
_sps
->
seq_bounding_box_whd
!=
Vec
3
<
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
...
...
@@ -436,7 +436,7 @@ PCCTMC3Encoder3::quantization(const PCCPointSet3& inputPointCloud)
double
(
_sliceOrigin
[
2
])};
// The new maximum bounds of the offset cloud
PCCVector
3
<
int
>
maxBound
{
0
};
Vec
3
<
int
>
maxBound
{
0
};
const
size_t
pointCount
=
pointCloud
.
getPointCount
();
for
(
size_t
i
=
0
;
i
<
pointCount
;
++
i
)
{
...
...
tmc3/geometry_intra_pred.cpp
View file @
00bac43d
...
...
@@ -62,7 +62,7 @@ static const int LUT_th1[5] = {67, 66, 65, 66, 64};
void
predictGeometryOccupancyIntra
(
const
MortonMap3D
&
occupancyAtlas
,
PCCVector
3
<
uint32_t
>
pos
,
Vec
3
<
uint32_t
>
pos
,
int
nodeSizeLog2
,
int
*
occupancyIsPredicted
,
int
*
occupancyPrediction
)
...
...
tmc3/geometry_intra_pred.h
View file @
00bac43d
...
...
@@ -46,7 +46,7 @@ namespace pcc {
void
predictGeometryOccupancyIntra
(
const
MortonMap3D
&
occupancyAtlas
,
PCCVector
3
<
uint32_t
>
pos
,
Vec
3
<
uint32_t
>
pos
,
int
nodeSizeLog2
,
int
*
occupacyIsPredIntra
,
int
*
occupacyPredIntra
);
...
...
tmc3/geometry_octree.h
View file @
00bac43d
...
...
@@ -54,7 +54,7 @@ const int MAX_NUM_DM_LEAF_POINTS = 2;
struct
PCCOctree3Node
{
// 3D position of the current node's origin (local x,y,z = 0).
PCCVector
3
<
uint32_t
>
pos
;
Vec
3
<
uint32_t
>
pos
;
// Range of point indexes spanned by node
uint32_t
start
;
...
...
tmc3/geometry_octree_decoder.cpp
View file @
00bac43d
...
...
@@ -84,7 +84,7 @@ public:
int
occupancyAdjGt0
,
int
occupancyAdjGt1
);
PCCVector
3
<
uint32_t
>
decodePointPosition
(
int
nodeSizeLog2
);
Vec
3
<
uint32_t
>
decodePointPosition
(
int
nodeSizeLog2
);
template
<
class
OutputIt
>
int
decodeDirectPosition
(
...
...
@@ -338,10 +338,10 @@ GeometryOctreeDecoder::decodeOccupancy(
//-------------------------------------------------------------------------
// Decode a position of a point in a given volume.
PCCVector
3
<
uint32_t
>
Vec
3
<
uint32_t
>
GeometryOctreeDecoder
::
decodePointPosition
(
int
nodeSizeLog2
)
{
PCCVector
3
<
uint32_t
>
delta
{};
Vec
3
<
uint32_t
>
delta
{};
for
(
int
i
=
nodeSizeLog2
;
i
>
0
;
i
--
)
{
delta
<<=
1
;
delta
[
0
]
|=
_arithmeticDecoder
->
decode
(
_ctxEquiProb
);
...
...
@@ -373,7 +373,7 @@ GeometryOctreeDecoder::decodeDirectPosition(
for
(
int
i
=
0
;
i
<
numPoints
;
i
++
)
{
// convert node-relative position to world position
PCCVector
3
<
uint32_t
>
pos
=
node
.
pos
+
decodePointPosition
(
nodeSizeLog2
);
Vec
3
<
uint32_t
>
pos
=
node
.
pos
+
decodePointPosition
(
nodeSizeLog2
);
*
(
outputPoints
++
)
=
{
double
(
pos
[
0
]),
double
(
pos
[
1
]),
double
(
pos
[
2
])};
}
...
...
@@ -419,7 +419,7 @@ decodeGeometryOctree(
// ie, the number of nodes added to the next level of the tree
int
numNodesNextLvl
=
0
;
PCCVector
3
<
uint32_t
>
occupancyAtlasOrigin
(
0xffffffff
);
Vec
3
<
uint32_t
>
occupancyAtlasOrigin
(
0xffffffff
);
MortonMap3D
occupancyAtlas
;
if
(
gps
.
neighbour_avail_boundary_log2
)
{
occupancyAtlas
.
resize
(
gps
.
neighbour_avail_boundary_log2
);
...
...