Commit d3560c60 authored by chi wang's avatar chi wang Committed by David Flynn
Browse files

geom/m44811: 64-to-6 neighbour reduction table

When restricted neighbour contextualisation is used, this modification
introduces an alternative neighbour reduction table.

NB: the integrated table has been updated to remove the need to add
additional remapping tables.  This is a non-normative change.
parent e9dd9ce0
...@@ -128,6 +128,19 @@ isDirectModeEligible( ...@@ -128,6 +128,19 @@ isDirectModeEligible(
&& (child.numSiblingsPlus1 == 1) && (node.numSiblingsPlus1 <= 2); && (child.numSiblingsPlus1 == 1) && (node.numSiblingsPlus1 <= 2);
} }
//---------------------------------------------------------------------------
// Select the neighbour pattern reduction table according to GPS config.
using NeighPattern64toX = const uint8_t[64];
inline NeighPattern64toX&
neighPattern64toR1(const GeometryParameterSet& gps)
{
if (!gps.neighbour_context_restriction_flag)
return kNeighPattern64to10;
return kNeighPattern64to6;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
struct CtxModelOctreeOccupancy { struct CtxModelOctreeOccupancy {
......
...@@ -75,6 +75,8 @@ private: ...@@ -75,6 +75,8 @@ private:
// selects between the bitwise and bytewise occupancy coders // selects between the bitwise and bytewise occupancy coders
const bool _useBitwiseOccupancyCoder; const bool _useBitwiseOccupancyCoder;
const uint8_t (&_neighPattern64toR1)[64];
o3dgc::Arithmetic_Codec* _arithmeticDecoder; o3dgc::Arithmetic_Codec* _arithmeticDecoder;
o3dgc::Static_Bit_Model _ctxEquiProb; o3dgc::Static_Bit_Model _ctxEquiProb;
o3dgc::Adaptive_Bit_Model _ctxSingleChild; o3dgc::Adaptive_Bit_Model _ctxSingleChild;
...@@ -96,6 +98,7 @@ private: ...@@ -96,6 +98,7 @@ private:
GeometryOctreeDecoder::GeometryOctreeDecoder( GeometryOctreeDecoder::GeometryOctreeDecoder(
const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticDecoder) const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticDecoder)
: _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag) : _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag)
, _neighPattern64toR1(neighPattern64toR1(gps))
, _arithmeticDecoder(arithmeticDecoder) , _arithmeticDecoder(arithmeticDecoder)
, _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor) , _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor)
{ {
...@@ -213,9 +216,9 @@ GeometryOctreeDecoder::decodeOccupancyBitwise(int neighPattern) ...@@ -213,9 +216,9 @@ GeometryOctreeDecoder::decodeOccupancyBitwise(int neighPattern)
} }
// code occupancy using the neighbour configuration context // code occupancy using the neighbour configuration context
// with reduction from 64 states to 10. // with reduction from 64 states to 10 (or 6).
int neighPattern10 = kNeighPattern64to10[neighPattern]; int neighPatternR1 = _neighPattern64toR1[neighPattern];
return decodeOccupancyNeighNZ(neighPattern10); return decodeOccupancyNeighNZ(neighPatternR1);
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -224,9 +227,9 @@ int ...@@ -224,9 +227,9 @@ int
GeometryOctreeDecoder::decodeOccupancyBytewise(int neighPattern) GeometryOctreeDecoder::decodeOccupancyBytewise(int neighPattern)
{ {
// code occupancy using the neighbour configuration context // code occupancy using the neighbour configuration context
// with reduction from 64 states to 10. // with reduction from 64 states to 10 (or 6).
int neighPattern10 = kNeighPattern64to10[neighPattern]; int neighPatternR1 = _neighPattern64toR1[neighPattern];
auto& bytewiseCoder = _bytewiseOccupancyCoder[neighPattern10]; auto& bytewiseCoder = _bytewiseOccupancyCoder[neighPatternR1];
return bytewiseCoder.decode(_arithmeticDecoder); return bytewiseCoder.decode(_arithmeticDecoder);
} }
......
...@@ -76,6 +76,8 @@ private: ...@@ -76,6 +76,8 @@ private:
// selects between the bitwise and bytewise occupancy coders // selects between the bitwise and bytewise occupancy coders
const bool _useBitwiseOccupancyCoder; const bool _useBitwiseOccupancyCoder;
const uint8_t (&_neighPattern64toR1)[64];
o3dgc::Arithmetic_Codec* _arithmeticEncoder; o3dgc::Arithmetic_Codec* _arithmeticEncoder;
o3dgc::Static_Bit_Model _ctxEquiProb; o3dgc::Static_Bit_Model _ctxEquiProb;
o3dgc::Adaptive_Bit_Model _ctxSingleChild; o3dgc::Adaptive_Bit_Model _ctxSingleChild;
...@@ -97,6 +99,7 @@ private: ...@@ -97,6 +99,7 @@ private:
GeometryOctreeEncoder::GeometryOctreeEncoder( GeometryOctreeEncoder::GeometryOctreeEncoder(
const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticEncoder) const GeometryParameterSet& gps, o3dgc::Arithmetic_Codec* arithmeticEncoder)
: _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag) : _useBitwiseOccupancyCoder(gps.bitwise_occupancy_coding_flag)
, _neighPattern64toR1(neighPattern64toR1(gps))
, _arithmeticEncoder(arithmeticEncoder) , _arithmeticEncoder(arithmeticEncoder)
, _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor) , _ctxOccupancy(gps.geom_occupancy_ctx_reduction_factor)
{ {
...@@ -211,9 +214,9 @@ GeometryOctreeEncoder::encodeOccupancyBitwise( ...@@ -211,9 +214,9 @@ GeometryOctreeEncoder::encodeOccupancyBitwise(
} }
// code occupancy using the neighbour configuration context // code occupancy using the neighbour configuration context
// with reduction from 64 states to 10. // with reduction from 64 states to 10 (or 6).
int neighPattern10 = kNeighPattern64to10[neighPattern]; int neighPatternR1 = _neighPattern64toR1[neighPattern];
encodeOccupancyNeighNZ(mappedOccupancy, neighPattern10); encodeOccupancyNeighNZ(mappedOccupancy, neighPatternR1);
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -223,9 +226,9 @@ GeometryOctreeEncoder::encodeOccupancyBytewise( ...@@ -223,9 +226,9 @@ GeometryOctreeEncoder::encodeOccupancyBytewise(
int mappedOccupancy, int neighPattern) int mappedOccupancy, int neighPattern)
{ {
// code occupancy using the neighbour configuration context // code occupancy using the neighbour configuration context
// with reduction from 64 states to 10. // with reduction from 64 states to 10 (or 6).
int neighPattern10 = kNeighPattern64to10[neighPattern]; int neighPatternR1 = _neighPattern64toR1[neighPattern];
auto& bytewiseCoder = _bytewiseOccupancyCoder[neighPattern10]; auto& bytewiseCoder = _bytewiseOccupancyCoder[neighPatternR1];
bytewiseCoder.encode(mappedOccupancy, _arithmeticEncoder); bytewiseCoder.encode(mappedOccupancy, _arithmeticEncoder);
} }
......
...@@ -35,11 +35,19 @@ ...@@ -35,11 +35,19 @@
#include "tables.h" #include "tables.h"
// indicates impossible values in the following table
static const int x = 0;
const uint8_t pcc::kNeighPattern64to10[64] = { const uint8_t pcc::kNeighPattern64to10[64] = {
0, 1, 1, 2, 1, 3, 3, 4, 1, 3, 3, 4, 2, 4, 4, 5, 1, 3, 3, 4, 3, 6, 0, 1, 1, 2, 1, 3, 3, 4, 1, 3, 3, 4, 2, 4, 4, 5, 1, 3, 3, 4, 3, 6,
6, 7, 3, 6, 6, 7, 4, 7, 7, 8, 1, 3, 3, 4, 3, 6, 6, 7, 3, 6, 6, 7, 6, 7, 3, 6, 6, 7, 4, 7, 7, 8, 1, 3, 3, 4, 3, 6, 6, 7, 3, 6, 6, 7,
4, 7, 7, 8, 2, 4, 4, 5, 4, 7, 7, 8, 4, 7, 7, 8, 5, 8, 8, 9}; 4, 7, 7, 8, 2, 4, 4, 5, 4, 7, 7, 8, 4, 7, 7, 8, 5, 8, 8, 9};
const uint8_t pcc::kNeighPattern64to6[64] = {
0, 4, 4, x, 4, 2, 2, x, 4, 2, 2, x, x, x, x, x, 5, 3, 3, x, 3, 1,
1, x, 3, 1, 1, x, x, x, x, x, 5, 3, 3, x, 3, 1, 1, x, 3, 1, 1, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x};
const uint8_t pcc::kNeighPattern10to7[10] = {0, 1, 2, 3, 4, 5, 3, 4, 5, 6}; const uint8_t pcc::kNeighPattern10to7[10] = {0, 1, 2, 3, 4, 5, 3, 4, 5, 6};
const uint8_t pcc::kNeighPattern7to5[7] = {0, 1, 2, 1, 4, 4, 3}; const uint8_t pcc::kNeighPattern7to5[7] = {0, 1, 2, 1, 4, 4, 3};
......
...@@ -41,6 +41,7 @@ namespace pcc { ...@@ -41,6 +41,7 @@ namespace pcc {
// Symmetry reduction of 64 neighbour pattern to 10 // Symmetry reduction of 64 neighbour pattern to 10
extern const uint8_t kNeighPattern64to10[64]; extern const uint8_t kNeighPattern64to10[64];
extern const uint8_t kNeighPattern64to6[64];
extern const uint8_t kNeighPattern10to7[10]; extern const uint8_t kNeighPattern10to7[10];
extern const uint8_t kNeighPattern7to5[7]; extern const uint8_t kNeighPattern7to5[7];
......
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