Commit e9dd9ce0 authored by David Flynn's avatar David Flynn
Browse files

geom/m44750: occupancy context maps with on-the-fly update

Bitwise geometry occupancy coding uses a mapping table to select entropy
contexts.  This commit employs a dynamic mapping which is updated after
each coding operation, replacing the previous static mapping tables.

NB: the proposed version used a context with a halving period
(max_count) of 64 symbols.  However, this conflicts with another
adoption (512 symbols), and a wholesale replacement of the arithmetic
codec and context model.  To resolve the conflict, the existing halving
period (128) is used.
parent fc813708
......@@ -11,6 +11,7 @@ categories:
# - preserve lossless geometry property
- geometryCodec: 1
- mergeDuplicatedPoints: 0
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- positionQuantizationScale: 1
......
......@@ -10,6 +10,7 @@ categories:
# geometry parameters (octree)
- geometryCodec: 1
- mergeDuplicatedPoints: 1
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- positionQuantizationScale:
r01: '$eval{ $rp = 5; $gp = ${src-geometry-precision}; $p_min = max(gp - 9, 7); $start = min(1, $gp - ($p_min + 6)); $step = max(1, (min($gp - 1, $p_min + 7) - $p_min) / 5); $y = $start + round($rp * $step); $div = 1 << (abs($y) + 1); ((1 - 2*signbit($y)) % $div) / $div }'
......
......@@ -14,6 +14,7 @@ categories:
# geometry parameters (octree)
- geometryCodec: 1
- neighbourAvailBoundaryLog2: 9
- ctxOccupancyReductionFactor: 3
####
# attribute coding (common options -- relies on option ordering)
......
......@@ -14,6 +14,7 @@ categories:
# geometry parameters (octree)
- geometryCodec: 1
- neighbourAvailBoundaryLog2: 9
- ctxOccupancyReductionFactor: 3
####
# attribute coding (common options -- relies on option ordering)
......
......@@ -11,6 +11,7 @@ categories:
# - preserve lossless geometry property
- geometryCodec: 1
- mergeDuplicatedPoints: 0
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- positionQuantizationScale: 1
......
......@@ -10,6 +10,7 @@ categories:
# geometry parameters (octree)
- geometryCodec: 1
- mergeDuplicatedPoints: 1
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- positionQuantizationScale:
r01: '$eval{ $rp = 5; $gp = ${src-geometry-precision}; $p_min = max(gp - 9, 7); $start = min(1, $gp - ($p_min + 6)); $step = max(1, (min($gp - 1, $p_min + 7) - $p_min) / 5); $y = $start + round($rp * $step); $div = 1 << (abs($y) + 1); ((1 - 2*signbit($y)) % $div) / $div }'
......
......@@ -10,6 +10,7 @@ categories:
##
# geometry parameters (trisoup)
- geometryCodec: 2
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- inferredDirectCodingMode: 0
- triSoupDepth: ${test-depth}
......
......@@ -10,6 +10,7 @@ categories:
##
# geometry parameters (trisoup)
- geometryCodec: 2
- ctxOccupancyReductionFactor: 3
- neighbourAvailBoundaryLog2: 9
- inferredDirectCodingMode: 0
- triSoupDepth: ${test-depth}
......
......@@ -323,6 +323,10 @@ ParseParameters(int argc, char* argv[], Parameters& params)
params.encoder.gps.inferred_direct_coding_mode_enabled_flag, true,
"Permits early termination of the geometry octree for isolated points")
("ctxOccupancyReductionFactor",
params.encoder.gps.geom_occupancy_ctx_reduction_factor, 3,
"Adjusts the number of contexts used in occupancy coding")
// (trisoup) geometry parameters
("triSoupDepth", // log2(maxBB+1), where maxBB+1 is analogous to image width
params.encoder.gps.trisoup_depth, 10,
......
......@@ -198,4 +198,29 @@ updateGeometryNeighState(
//============================================================================
CtxMapOctreeOccupancy::CtxMapOctreeOccupancy()
{
map.reset(new CtxIdxMap);
b[0] = map->b0;
b[1] = map->b1;
b[2] = map->b2;
b[3] = map->b3;
b[4] = map->b4;
b[5] = map->b5;
b[6] = map->b6;
b[7] = map->b7;
using namespace std;
fill(begin(map->b0), end(map->b0), 127);
fill(begin(map->b1), end(map->b1), 127);
fill(begin(map->b2), end(map->b2), 127);
fill(begin(map->b3), end(map->b3), 127);
fill(begin(map->b4), end(map->b4), 127);
fill(begin(map->b5), end(map->b5), 127);
fill(begin(map->b6), end(map->b6), 127);
fill(begin(map->b7), end(map->b7), 127);
}
//============================================================================
} // namespace pcc
......@@ -42,6 +42,7 @@
#include "PCCPointSet.h"
#include "hls.h"
#include "ringbuf.h"
#include "tables.h"
namespace pcc {
......@@ -130,32 +131,63 @@ isDirectModeEligible(
//---------------------------------------------------------------------------
struct CtxModelOctreeOccupancy {
o3dgc::Adaptive_Bit_Model_Fast b0[10];
o3dgc::Adaptive_Bit_Model_Fast b1[2 * 10];
o3dgc::Adaptive_Bit_Model_Fast b2[4 * 10];
o3dgc::Adaptive_Bit_Model_Fast b3[8 * 10];
o3dgc::Adaptive_Bit_Model_Fast b4[75];
o3dgc::Adaptive_Bit_Model_Fast b5[112];
o3dgc::Adaptive_Bit_Model_Fast b6[117];
o3dgc::Adaptive_Bit_Model_Fast b7[127];
o3dgc::Adaptive_Bit_Model* operator[](int bit_pos)
o3dgc::Adaptive_Bit_Model_Fast contexts[256];
int ctxFactorShift;
CtxModelOctreeOccupancy(int ctxFactorShift) : ctxFactorShift(ctxFactorShift)
{}
o3dgc::Adaptive_Bit_Model& operator[](int idx)
{
assert(unsigned(bit_pos) < 8);
switch (bit_pos) {
case 0: return b0;
case 1: return b1;
case 2: return b2;
case 3: return b3;
case 4: return b4;
case 5: return b5;
case 6: return b6;
case 7: return b7;
default: return nullptr;
}
return contexts[idx >> ctxFactorShift];
}
};
//---------------------------------------------------------------------------
// Encapsulates the derivation of ctxIdx for occupancy coding.
class CtxMapOctreeOccupancy {
public:
struct CtxIdxMap {
uint8_t b0[10];
uint8_t b1[20];
uint8_t b2[39];
uint8_t b3[76];
uint8_t b4[149];
uint8_t b5[294];
uint8_t b6[391];
uint8_t b7[520];
};
CtxMapOctreeOccupancy();
const uint8_t* operator[](int bit) const { return b[bit]; }
uint8_t* operator[](int bit) { return b[bit]; }
// return *ctxIdx and update *ctxIdx according to bit
static uint8_t evolve(bool bit, uint8_t* ctxIdx);
private:
std::unique_ptr<CtxIdxMap> map;
uint8_t* b[8];
};
//----------------------------------------------------------------------------
inline uint8_t
CtxMapOctreeOccupancy::evolve(bool bit, uint8_t* ctxIdx)
{
uint8_t retval = *ctxIdx;
if (bit)
*ctxIdx = kCtxMapOctreeOccupancyEvolutionOn1[*ctxIdx];
else
*ctxIdx = kCtxMapOctreeOccupancyEvolutionOn0[*ctxIdx];
return retval;
}
//---------------------------------------------------------------------------
} // namespace pcc
......@@ -85,6 +85,7 @@ private:
// For bitwise occupancy coding
CtxModelOctreeOccupancy _ctxOccupancy;
CtxMapOctreeOccupancy _ctxIdxMap;
// For bytewise occupancy coding
DualLutCoder<true> _bytewiseOccupancyCoder[10];
......@@ -96,6 +97,7 @@ GeometryOctreeDecoder::GeometryOctreeDecoder(
const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticDecoder)
: _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag)
, _arithmeticDecoder(arithmeticDecoder)
, _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor)
{
if (!_useBitwiseOccupancyCoder) {
for (int i = 0; i < 10; i++)
......@@ -146,9 +148,10 @@ GeometryOctreeDecoder::decodeOccupancyNeighZ()
// NB: There must be at least two occupied child nodes
// -- avoid coding the occupancy bit if it is implied.
if (numOccupiedAcc >= minOccupied + i - 7) {
int idx = numOccupiedAcc;
bit = _arithmeticDecoder->decode(_ctxOccupancy[i][idx]);
int ctxIdx = _ctxIdxMap[i][numOccupiedAcc];
bit = _arithmeticDecoder->decode(_ctxOccupancy[ctxIdx]);
}
_ctxIdxMap.evolve(bit, &_ctxIdxMap[i][numOccupiedAcc]);
numOccupiedAcc += bit;
occupancy |= bit << occupancyCodingOrder[i];
}
......@@ -173,30 +176,26 @@ GeometryOctreeDecoder::decodeOccupancyNeighNZ(int neighPattern10)
// NB: it is impossible for pattern to be 0 (handled in Z case).
// NB: offsets are added since ctxIdxMap is shared between Z and NZ cases.
for (int i = 0; i < 8; i++) {
int idx, bit;
if (i < 4) {
idx = (neighPattern10 << i) + partialOccupancy;
} else if (i == 4) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy;
idx = kOccMapBit4CtxIdx[idx] + i;
} else if (i == 5) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy;
idx = kOccMapBit5CtxIdx[idx] + i;
int idx;
if (i < 6) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy + i + 1;
} else if (i == 6) {
idx = ((neighPattern7 - 1) << i) + partialOccupancy;
idx = kOccMapBit6CtxIdx[idx] + i;
idx = ((neighPattern7 - 1) << i) + partialOccupancy + i + 1;
} else if (i == 7) {
idx = ((neighPattern5 - 1) << i) + partialOccupancy;
idx = kOccMapBit7CtxIdx[idx] + i;
bit = 1;
idx = ((neighPattern5 - 1) << i) + partialOccupancy + i + 1;
} else {
// work around clang -Wsometimes-uninitialized fault
break;
}
// NB: if firt 7 bits are 0, then the last is implicitly 1.
if (i < 7 || partialOccupancy)
bit = _arithmeticDecoder->decode(_ctxOccupancy[i][idx]);
int bit = 1;
if (i < 7 || partialOccupancy) {
int ctxIdx = _ctxIdxMap[i][idx];
bit = _arithmeticDecoder->decode(_ctxOccupancy[ctxIdx]);
}
_ctxIdxMap.evolve(bit, &_ctxIdxMap[i][idx]);
partialOccupancy |= bit << i;
occupancy |= bit << occupancyCodingOrder[i];
}
......
......@@ -86,6 +86,7 @@ private:
// For bitwise occupancy coding
CtxModelOctreeOccupancy _ctxOccupancy;
CtxMapOctreeOccupancy _ctxIdxMap;
// For bytewise occupancy coding
DualLutCoder<true> _bytewiseOccupancyCoder[10];
......@@ -97,6 +98,7 @@ GeometryOctreeEncoder::GeometryOctreeEncoder(
const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticEncoder)
: _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag)
, _arithmeticEncoder(arithmeticEncoder)
, _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor)
{
if (!_useBitwiseOccupancyCoder) {
for (int i = 0; i < 10; i++)
......@@ -142,16 +144,17 @@ GeometryOctreeEncoder::encodeOccupancyNeighZ(int mappedOccupancy)
int numOccupiedAcc = 0;
for (int i = 0; i < 8; i++) {
int occupancyBit = (mappedOccupancy >> occupancyCodingOrder[i]) & 1;
int idx = numOccupiedAcc;
int ctxIdx = _ctxIdxMap.evolve(occupancyBit, &_ctxIdxMap[i][idx]);
// NB: There must be at least minOccupied child nodes
// -- avoid coding the occupancyBit if it is implied.
if (numOccupiedAcc < minOccupied + i - 7) {
assert(i >= 6);
break;
if (numOccupiedAcc >= minOccupied + i - 7) {
_arithmeticEncoder->encode(occupancyBit, _ctxOccupancy[ctxIdx]);
}
int occupancyBit = (mappedOccupancy >> occupancyCodingOrder[i]) & 1;
int idx = numOccupiedAcc;
_arithmeticEncoder->encode(occupancyBit, _ctxOccupancy[i][idx]);
numOccupiedAcc += occupancyBit;
}
}
......@@ -175,29 +178,23 @@ GeometryOctreeEncoder::encodeOccupancyNeighNZ(
int occupancyBit = (mappedOccupancy >> occupancyCodingOrder[i]) & 1;
int idx;
if (i < 4)
idx = (neighPattern10 << i) + partialOccupancy;
else if (i == 4) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy;
idx = kOccMapBit4CtxIdx[idx] + i;
} else if (i == 5) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy;
idx = kOccMapBit5CtxIdx[idx] + i;
if (i < 6) {
idx = ((neighPattern10 - 1) << i) + partialOccupancy + i + 1;
} else if (i == 6) {
idx = ((neighPattern7 - 1) << i) + partialOccupancy;
idx = kOccMapBit6CtxIdx[idx] + i;
idx = ((neighPattern7 - 1) << i) + partialOccupancy + i + 1;
} else if (i == 7) {
// NB: if firt 7 bits are 0, then the last is implicitly 1.
if (!partialOccupancy)
break;
idx = ((neighPattern5 - 1) << i) + partialOccupancy;
idx = kOccMapBit7CtxIdx[idx] + i;
idx = ((neighPattern5 - 1) << i) + partialOccupancy + i + 1;
} else {
// work around clang -Wsometimes-uninitialized fault
break;
}
_arithmeticEncoder->encode(occupancyBit, _ctxOccupancy[i][idx]);
int ctxIdx = _ctxIdxMap.evolve(occupancyBit, &_ctxIdxMap[i][idx]);
// NB: if firt 7 bits are 0, then the last is implicitly 1.
if (i < 7 || partialOccupancy)
_arithmeticEncoder->encode(occupancyBit, _ctxOccupancy[ctxIdx]);
partialOccupancy |= occupancyBit << i;
}
}
......
......@@ -207,6 +207,10 @@ struct GeometryParameterSet {
// Selects between bitwise and bytewise occupancy coding
bool bitwise_occupancy_coding_flag;
// Experimental knob to control the number of contexts used
// for occupancy coding.
int geom_occupancy_ctx_reduction_factor;
// depth of voxels (reconstructed points) in trisoup geometry
int trisoup_depth;
......
......@@ -193,6 +193,7 @@ write(const GeometryParameterSet& gps)
bs.write(gps.neighbour_context_restriction_flag);
bs.write(gps.inferred_direct_coding_mode_enabled_flag);
bs.write(gps.bitwise_occupancy_coding_flag);
bs.writeUe(gps.geom_occupancy_ctx_reduction_factor);
bs.writeUe(gps.neighbour_avail_boundary_log2);
if (gps.geom_codec_type == GeometryCodecType::kTriSoup) {
......@@ -224,6 +225,7 @@ parseGps(const PayloadBuffer& buf)
bs.read(&gps.neighbour_context_restriction_flag);
bs.read(&gps.inferred_direct_coding_mode_enabled_flag);
bs.read(&gps.bitwise_occupancy_coding_flag);
bs.readUe(&gps.geom_occupancy_ctx_reduction_factor);
bs.readUe(&gps.neighbour_avail_boundary_log2);
if (gps.geom_codec_type == GeometryCodecType::kTriSoup) {
......
......@@ -247,96 +247,48 @@ const uint8_t pcc::kOccMapRotateZ090[256] = {
50, 54, 58, 62, 114, 118, 122, 126, 178, 182, 186, 190, 242, 246, 250, 254,
51, 55, 59, 63, 115, 119, 123, 127, 179, 183, 187, 191, 243, 247, 251, 255};
const uint8_t pcc::kOccMapBit4CtxIdx[16 * 9] = {
1, 3, 3, 3, 3, 4, 5, 6, 7, 6, 8, 4, 3, 9, 10, 11, 12, 13,
14, 15, 13, 16, 13, 17, 5, 18, 19, 18, 20, 21, 22, 16, 23, 20, 4, 4,
5, 4, 9, 24, 4, 4, 25, 26, 4, 9, 13, 25, 27, 28, 29, 19, 24, 30,
17, 31, 26, 32, 33, 34, 9, 23, 35, 36, 37, 13, 38, 3, 33, 39, 40, 9,
13, 41, 18, 6, 7, 9, 29, 20, 11, 9, 8, 24, 4, 24, 6, 22, 15, 34,
18, 23, 33, 42, 43, 23, 44, 28, 43, 16, 39, 11, 12, 45, 33, 41, 46, 45,
47, 48, 49, 50, 51, 11, 32, 30, 41, 2, 41, 52, 17, 53, 27, 54, 42, 55,
36, 48, 56, 57, 54, 49, 58, 59, 60, 37, 61, 62, 63, 64, 65, 66, 67, 68};
const uint8_t pcc::kOccMapBit5CtxIdx[32 * 9] = {
1, 3, 3, 4, 5, 6, 7, 8, 9, 10, 4, 11, 9, 12, 13, 14, 15,
16, 15, 17, 18, 7, 19, 20, 21, 8, 19, 22, 22, 23, 24, 25, 26, 6,
27, 28, 5, 29, 30, 14, 31, 21, 32, 33, 34, 15, 11, 35, 36, 8, 6,
37, 38, 7, 29, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 5, 27, 11,
37, 11, 49, 7, 10, 20, 18, 50, 51, 52, 17, 47, 53, 17, 54, 55, 56,
19, 57, 36, 40, 50, 54, 58, 36, 59, 60, 61, 62, 35, 16, 63, 27, 15,
4, 16, 15, 12, 33, 64, 4, 15, 10, 65, 47, 66, 67, 15, 12, 36, 68,
65, 19, 47, 69, 44, 70, 57, 71, 33, 61, 64, 15, 72, 31, 30, 13, 28,
73, 26, 42, 74, 3, 17, 5, 15, 75, 76, 77, 78, 61, 79, 25, 80, 81,
82, 83, 84, 80, 84, 85, 26, 47, 35, 5, 12, 68, 55, 42, 70, 38, 41,
38, 7, 7, 54, 86, 19, 43, 14, 69, 87, 22, 59, 79, 62, 86, 88, 56,
45, 77, 25, 89, 25, 57, 37, 29, 15, 17, 40, 88, 55, 5, 90, 33, 32,
64, 33, 42, 39, 41, 7, 87, 35, 19, 91, 23, 88, 92, 31, 43, 35, 61,
59, 93, 67, 25, 73, 88, 94, 95, 59, 24, 2, 70, 46, 96, 97, 44, 24,
48, 57, 62, 57, 57, 98, 60, 77, 99, 79, 100, 2, 101, 100, 2, 60, 79,
79, 85, 62, 62, 60, 60, 89, 89, 102, 57, 100, 61, 103, 100, 89, 103, 75,
61, 101, 93, 25, 104, 105, 105, 106, 78, 25, 60, 85, 85, 76, 81, 102};
//============================================================================
const uint8_t pcc::kOccMapBit6CtxIdx[64 * 6] = {
1, 3, 4, 5, 4, 6, 7, 8, 9, 10, 11, 12, 13, 12, 14, 12, 15,
16, 7, 17, 18, 19, 20, 21, 8, 18, 22, 23, 24, 20, 20, 25, 26, 27,
28, 29, 8, 29, 30, 31, 10, 28, 32, 33, 34, 24, 21, 35, 34, 36, 37,
38, 39, 33, 40, 41, 39, 21, 33, 42, 43, 19, 44, 45, 23, 34, 6, 15,
7, 46, 47, 18, 48, 18, 10, 49, 50, 51, 14, 18, 52, 24, 53, 33, 54,
55, 56, 25, 57, 24, 40, 25, 58, 59, 60, 61, 10, 62, 34, 63, 46, 46,
20, 64, 65, 49, 47, 66, 52, 8, 7, 63, 12, 67, 56, 31, 57, 68, 2,
60, 33, 69, 2, 70, 21, 71, 72, 73, 74, 11, 36, 8, 62, 75, 76, 39,
34, 47, 56, 77, 54, 21, 66, 63, 36, 29, 30, 78, 17, 21, 31, 58, 37,
63, 19, 79, 38, 70, 71, 68, 47, 49, 44, 56, 37, 56, 72, 2, 39, 31,
64, 31, 31, 80, 55, 68, 22, 81, 44, 58, 38, 70, 59, 40, 69, 82, 83,
23, 23, 19, 84, 85, 68, 14, 6, 11, 48, 15, 14, 62, 10, 3, 86, 48,
6, 4, 10, 4, 49, 18, 49, 47, 7, 63, 86, 46, 51, 10, 35, 39, 87,
34, 18, 7, 88, 35, 32, 89, 54, 52, 90, 69, 89, 60, 78, 64, 35, 35,
20, 69, 30, 69, 78, 91, 22, 92, 82, 40, 31, 60, 70, 80, 54, 78, 64,
60, 55, 93, 65, 4, 94, 7, 8, 10, 49, 95, 29, 48, 11, 75, 96, 6,
82, 44, 21, 30, 20, 2, 20, 2, 44, 22, 82, 82, 91, 90, 31, 60, 2,
82, 63, 89, 30, 22, 31, 31, 91, 97, 30, 23, 89, 40, 44, 80, 25, 72,
98, 2, 25, 99, 55, 100, 72, 101, 99, 102, 80, 103, 23, 103, 104, 21, 44,
82, 22, 30, 82, 60, 21, 22, 58, 70, 69, 33, 70, 69, 38, 69, 60, 80,
82, 19, 40, 74, 105, 70, 104, 55, 82, 98, 83, 99, 38, 69, 70, 92, 58,
2, 68, 99, 69, 60, 98, 103, 70, 60, 25, 59, 106, 23, 55, 72, 68, 99,
85, 107, 25, 83, 108, 109, 104, 59, 41, 110};
// transition tables L= 10; 256 ctx
const uint8_t pcc::kCtxMapOctreeOccupancyEvolutionOn0[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 136, 137, 138, 138, 139,
140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 152,
153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 163, 164, 165,
166, 167, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 175, 176, 177,
178, 178, 179, 180, 181, 181, 182, 183, 183, 184, 185, 185, 186, 187, 187,
188, 189, 189, 190, 191, 191, 192, 192, 193, 194, 194, 195, 195, 196, 196,
197, 197, 198, 198, 199, 199, 199, 200, 200, 201, 201, 201, 202, 202, 202,
203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205,
205};
const uint8_t pcc::kOccMapBit7CtxIdx[128 * 4] = {
1, 2, 3, 4, 5, 6, 3, 7, 8, 6, 9, 10, 9, 10, 11,
4, 4, 7, 12, 13, 14, 15, 16, 17, 18, 19, 12, 17, 20, 16,
13, 21, 18, 22, 18, 23, 14, 24, 14, 16, 18, 22, 23, 20, 25,
26, 14, 27, 28, 20, 13, 15, 29, 24, 30, 21, 31, 32, 17, 33,
34, 35, 36, 35, 37, 34, 3, 38, 18, 39, 8, 39, 10, 14, 40,
41, 40, 10, 3, 12, 18, 31, 42, 43, 39, 14, 44, 33, 14, 45,
37, 46, 18, 44, 7, 21, 20, 23, 28, 47, 48, 49, 50, 51, 39,
20, 52, 27, 42, 34, 6, 53, 44, 49, 53, 35, 17, 51, 53, 54,
55, 51, 53, 56, 18, 33, 7, 33, 116, 50, 37, 5, 34, 42, 7,
20, 4, 28, 5, 57, 11, 8, 10, 10, 57, 10, 50, 18, 50, 57,
48, 53, 28, 13, 58, 30, 117, 38, 57, 43, 36, 44, 53, 59, 24,
60, 45, 60, 20, 61, 62, 63, 43, 64, 65, 63, 28, 22, 24, 30,
55, 47, 51, 66, 16, 67, 33, 68, 49, 69, 66, 68, 39, 7, 70,
67, 14, 41, 14, 71, 28, 72, 16, 56, 10, 48, 24, 73, 14, 22,
20, 16, 14, 28, 14, 44, 58, 24, 18, 74, 5, 12, 75, 15, 76,
47, 51, 77, 70, 78, 55, 79, 27, 67, 80, 81, 32, 82, 67, 82,
67, 64, 80, 68, 71, 80, 67, 68, 76, 83, 60, 84, 47, 85, 68,
86, 118, 48, 48, 10, 87, 23, 23, 22, 52, 31, 41, 72, 25, 23,
44, 28, 21, 30, 49, 43, 17, 33, 83, 88, 30, 74, 32, 60, 35,
77, 77, 89, 38, 21, 90, 90, 49, 35, 43, 65, 16, 46, 85, 54,
32, 88, 80, 62, 30, 51, 66, 65, 65, 60, 78, 78, 67, 74, 68,
68, 74, 86, 91, 86, 67, 53, 21, 30, 49, 49, 30, 59, 51, 17,
47, 33, 24, 27, 17, 45, 68, 67, 67, 88, 71, 54, 68, 78, 65,
80, 59, 74, 67, 35, 54, 56, 60, 17, 59, 64, 65, 56, 59, 80,
35, 43, 62, 85, 33, 24, 64, 59, 92, 74, 84, 82, 93, 84, 94,
95, 93, 89, 94, 96, 78, 62, 89, 97, 119, 61, 21, 51, 43, 65,
47, 54, 49, 59, 98, 67, 30, 99, 30, 69, 46, 85, 64, 71, 64,
60, 88, 60, 64, 74, 64, 74, 54, 74, 56, 60, 69, 56, 33, 66,
54, 68, 35, 68, 59, 100, 71, 78, 88, 68, 71, 83, 71, 60, 85,
80, 101, 82, 60, 82, 80, 102, 60, 63, 103, 84, 104, 105, 30, 66,
51, 60, 54, 80, 54, 62, 54, 88, 67, 74, 56, 100, 65, 60, 65,
62, 85, 74, 88, 83, 60, 84, 56, 82, 103, 89, 56, 77, 60, 84,
71, 74, 88, 106, 101, 63, 60, 107, 101, 68, 80, 108, 100, 77, 60,
105, 102, 109, 77, 109, 109, 110, 91, 111, 91, 112, 63, 113, 106, 94,
91, 114};
const uint8_t pcc::kCtxMapOctreeOccupancyEvolutionOn1[256] = {
49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51,
51, 51, 52, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 57,
57, 58, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 64, 65, 66,
66, 67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 75, 75, 76,
77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88,
89, 90, 90, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 100, 101,
101, 102, 103, 104, 105, 106, 107, 107, 108, 109, 110, 111, 112, 113, 114,
115, 115, 116, 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141,
142, 143, 144, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
156, 157, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
198, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211,
212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 224, 225,
226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
241, 242, 243, 244, 245, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
255};
//============================================================================
......
......@@ -81,10 +81,9 @@ extern const uint8_t kOccMapRotateZ270[256];
extern const uint8_t kOccMapRotateZ180[256];
extern const uint8_t kOccMapRotateZ090[256];
extern const uint8_t kOccMapBit4CtxIdx[16 * 9];
extern const uint8_t kOccMapBit5CtxIdx[32 * 9];
extern const uint8_t kOccMapBit6CtxIdx[64 * 6];
extern const uint8_t kOccMapBit7CtxIdx[128 * 4];
// todo(df): ...
extern const uint8_t kCtxMapOctreeOccupancyEvolutionOn0[256];
extern const uint8_t kCtxMapOctreeOccupancyEvolutionOn1[256];
// LUT initialisation table
extern const uint8_t kDualLutOccupancyCoderInit[10][32];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment