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
5ed41242
Commit
5ed41242
authored
Jan 04, 2019
by
David Flynn
Browse files
geom: refactor repeated bitCodingOrder to global kOccBitCodingOrder
parent
4fe5be82
Changes
4
Hide whitespace changes
Inline
Side-by-side
tmc3/geometry_octree_decoder.cpp
View file @
5ed41242
...
...
@@ -171,17 +171,16 @@ GeometryOctreeDecoder::decodeOccupancyNeighZ(
int
mappedOccAdjGt0
,
int
mappedOccAdjGt1
)
{
static
const
int8_t
bitCodingOrder
[
8
]{
1
,
7
,
5
,
3
,
2
,
4
,
6
,
0
};
int
minOccupied
=
2
;
int
numOccupiedAcc
=
0
;
int
occupancy
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
int
bit
=
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
ctxIdxMapIdx
=
3
*
(
bitAdjGt0
+
bitAdjGt1
)
+
bitIsPredicted
+
bitPrediction
;
...
...
@@ -195,7 +194,7 @@ GeometryOctreeDecoder::decodeOccupancyNeighZ(
}
ctxIdxMap
.
evolve
(
bit
,
&
ctxIdxMap
[
i
][
numOccupiedAcc
]);
numOccupiedAcc
+=
bit
;
occupancy
|=
bit
<<
b
itCodingOrder
[
i
];
occupancy
|=
bit
<<
kOccB
itCodingOrder
[
i
];
}
return
occupancy
;
...
...
@@ -212,8 +211,6 @@ GeometryOctreeDecoder::decodeOccupancyNeighNZ(
int
mappedOccAdjGt0
,
int
mappedOccAdjGt1
)
{
static
const
int8_t
bitCodingOrder
[
8
]{
1
,
7
,
5
,
3
,
2
,
4
,
6
,
0
};
int
neighPattern7
=
kNeighPattern10to7
[
neighPattern10
];
int
neighPattern5
=
kNeighPattern7to5
[
neighPattern7
];
...
...
@@ -237,10 +234,10 @@ GeometryOctreeDecoder::decodeOccupancyNeighNZ(
// NB: if firt 7 bits are 0, then the last is implicitly 1.
int
bit
=
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
ctxIdxMapIdx
=
3
*
(
bitAdjGt0
+
bitAdjGt1
)
+
bitIsPredicted
+
bitPrediction
;
...
...
@@ -253,7 +250,7 @@ GeometryOctreeDecoder::decodeOccupancyNeighNZ(
ctxIdxMap
.
evolve
(
bit
,
&
ctxIdxMap
[
i
][
idx
]);
partialOccupancy
|=
bit
<<
i
;
occupancy
|=
bit
<<
b
itCodingOrder
[
i
];
occupancy
|=
bit
<<
kOccB
itCodingOrder
[
i
];
}
return
occupancy
;
...
...
tmc3/geometry_octree_encoder.cpp
View file @
5ed41242
...
...
@@ -176,16 +176,15 @@ GeometryOctreeEncoder::encodeOccupancyNeighZ(
int
mappedOccAdjGt0
,
int
mappedOccAdjGt1
)
{
static
const
int8_t
bitCodingOrder
[
8
]{
1
,
7
,
5
,
3
,
2
,
4
,
6
,
0
};
int
minOccupied
=
2
;
int
numOccupiedAcc
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
int
bit
=
(
mappedOccupancy
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
b
itCodingOrder
[
i
])
&
1
;
int
bit
=
(
mappedOccupancy
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
ctxIdxMapIdx
=
3
*
(
bitAdjGt0
+
bitAdjGt1
)
+
bitIsPredicted
+
bitPrediction
;
...
...
@@ -216,8 +215,6 @@ GeometryOctreeEncoder::encodeOccupancyNeighNZ(
int
mappedOccAdjGt0
,
int
mappedOccAdjGt1
)
{
static
const
int8_t
bitCodingOrder
[
8
]{
1
,
7
,
5
,
3
,
2
,
4
,
6
,
0
};
int
neighPattern7
=
kNeighPattern10to7
[
neighPattern10
];
int
neighPattern5
=
kNeighPattern7to5
[
neighPattern7
];
...
...
@@ -237,11 +234,11 @@ GeometryOctreeEncoder::encodeOccupancyNeighNZ(
break
;
}
int
bit
=
(
mappedOccupancy
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
b
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
b
itCodingOrder
[
i
])
&
1
;
int
bit
=
(
mappedOccupancy
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitIsPredicted
=
(
mappedOccIsPredicted
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitPrediction
=
(
mappedOccPrediction
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt0
=
(
mappedOccAdjGt0
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
bitAdjGt1
=
(
mappedOccAdjGt1
>>
kOccB
itCodingOrder
[
i
])
&
1
;
int
ctxIdxMapIdx
=
3
*
(
bitAdjGt0
+
bitAdjGt1
)
+
bitIsPredicted
+
bitPrediction
;
...
...
tmc3/tables.cpp
View file @
5ed41242
...
...
@@ -257,6 +257,10 @@ const uint8_t pcc::kOccMapRotateZ090[256] = {
//============================================================================
const
int8_t
pcc
::
kOccBitCodingOrder
[
8
]
=
{
1
,
7
,
5
,
3
,
2
,
4
,
6
,
0
};
//============================================================================
// Generated from (L*p+s)/(L+1), L=min(200, max(5, 1/p, 1/(1-p))
const
uint8_t
pcc
::
kCtxMapOctreeOccupancyDelta
[
16
]
=
{
0
,
1
,
1
,
2
,
4
,
7
,
9
,
11
,
14
,
16
,
19
,
23
,
22
,
18
,
13
,
6
};
...
...
tmc3/tables.h
View file @
5ed41242
...
...
@@ -82,6 +82,9 @@ extern const uint8_t kOccMapRotateZ270[256];
extern
const
uint8_t
kOccMapRotateZ180
[
256
];
extern
const
uint8_t
kOccMapRotateZ090
[
256
];
// Geometry occupancy bit scan order for entropy coding
extern
const
int8_t
kOccBitCodingOrder
[
8
];
// Geometry occupancy context map update table, represented as deltas to
// current map entry value.
extern
const
uint8_t
kCtxMapOctreeOccupancyDelta
[
16
];
...
...
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