Commit a9b60add authored by Satoru KUMA's avatar Satoru KUMA
Browse files

MPEG129/m52280

parent 717395ef
......@@ -108,13 +108,13 @@ decodeGeometryTrisoup(
// Decode segind from bitstream.
symbolCount = arithmeticDecoder->decodeExpGolomb(0, ctxBypass, ctxTemp);
AdaptiveMAryModel multiSymbolSegindModel0(256);
//AdaptiveMAryModel multiSymbolSegindModel0(256);
AdaptiveBitModel ctxTempSeg;
std::vector<bool> segind;
for (uint32_t i = 0; i < symbolCount; i++) {
const uint8_t c = arithmeticDecoder->decode(multiSymbolSegindModel0);
for (int b = 7; b >= 0; b--) {
segind.push_back(!!(c & (1 << b)));
}
bool c = !!(arithmeticDecoder->decode(ctxTempSeg));
segind.push_back(c);
}
// Decode vertices from bitstream.
......
......@@ -64,23 +64,20 @@ encodeGeometryTrisoup(
determineTrisoupVertices(nodes, segind, vertices, pointCloud, blockWidth);
// Encode segind to bitstream.
AdaptiveMAryModel multiSymbolSegindModel0(256);
symbolCount = (segind.size() + 7) / 8;
segind.resize(8 * symbolCount, false);
//AdaptiveMAryModel multiSymbolSegindModel0(256);
AdaptiveBitModel ctxTempSeg;
symbolCount = segind.size();
//segind.resize(8 * symbolCount, false);
// todo(df): consider a more appropriate signalling method
AdaptiveBitModel ctxTemp;
StaticBitModel ctxBypass;
arithmeticEncoder->encodeExpGolomb(symbolCount, 0, ctxBypass, ctxTemp);
int uniqueIndex = 0;
//int uniqueIndex = 0;
for (uint32_t i = 0; i < symbolCount; i++) {
uint8_t c = 0;
for (int b = 7; b >= 0; b--) {
uint8_t bit = uint8_t(segind[uniqueIndex++]);
c |= bit << b;
}
arithmeticEncoder->encode(uint32_t(c), multiSymbolSegindModel0);
arithmeticEncoder->encode((int)segind[i], ctxTempSeg);
}
// Encode vertices to bitstream.
......
Markdown is supported
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