@@ -929,9 +929,11 @@ CTFIOSize EncodedBlocks<H, N, W>::decode(D_IT dest, // it
929929 const auto& md = mMetadata[slot];
930930 LOGP(debug, "Slot{} | NStored={} Ndict={} nData={}, MD: messageLength:{} opt:{} min:{} max:{} offs:{} width:{} ", slot, block.getNStored(), block.getNDict(), block.getNData(), md.messageLength, (int)md.opt, md.min, md.max, md.literalsPackingOffset, md.literalsPackingWidth);
931931
932+ constexpr size_t word_size = sizeof(W);
933+
932934 if (ansVersion == ANSVersionCompat) {
933935 if (!block.getNStored()) {
934- return {0, md.getUncompressedSize(), md.getCompressedSize()};
936+ return {0, md.getUncompressedSize(), md.getCompressedSize() * word_size };
935937 }
936938 if (md.opt == Metadata::OptStore::EENCODE) {
937939 return decodeCompatImpl(dest, slot, decoderExt);
@@ -943,7 +945,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decode(D_IT dest, // it
943945 return decodeUnpackImpl(dest, slot);
944946 }
945947 if (!block.getNStored()) {
946- return {0, md.getUncompressedSize(), md.getCompressedSize()};
948+ return {0, md.getUncompressedSize(), md.getCompressedSize() * word_size };
947949 }
948950 if (md.opt == Metadata::OptStore::EENCODE) {
949951 return decodeRansV1Impl(dest, slot, decoderExt);
@@ -991,7 +993,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeCompatImpl(dst_IT dstBegin, int slot, co
991993 } else {
992994 getDecoder().process(block.getData() + block.getNData(), dstBegin, md.messageLength, NDecoderStreams);
993995 }
994- return {0, md.getUncompressedSize(), md.getCompressedSize()};
996+ return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W) };
995997};
996998
997999template <typename H, int N, typename W>
@@ -1045,7 +1047,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeRansV1Impl(dst_IT dstBegin, int slot, co
10451047 } else {
10461048 getDecoder().process(block.getData() + block.getNData(), dstBegin, md.messageLength, md.nStreams);
10471049 }
1048- return {0, md.getUncompressedSize(), md.getCompressedSize()};
1050+ return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W) };
10491051};
10501052
10511053template <typename H, int N, typename W>
@@ -1079,7 +1081,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeUnpackImpl(dst_IT dest, int slot) const
10791081 } else {
10801082 rans::unpack(srcIt, messageLength, dest, packingWidth, offset);
10811083 }
1082- return {0, md.getUncompressedSize(), md.getCompressedSize()};
1084+ return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W) };
10831085};
10841086
10851087template <typename H, int N, typename W>
@@ -1098,7 +1100,7 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeCopyImpl(dst_IT dest, int slot) const
10981100 destPtr_t srcEnd = srcBegin + md.messageLength * sizeof(dest_t);
10991101 std::copy(srcBegin, srcEnd, dest);
11001102
1101- return {0, md.getUncompressedSize(), md.getCompressedSize()};
1103+ return {0, md.getUncompressedSize(), md.getCompressedSize() * sizeof(W) };
11021104};
11031105
11041106///_____________________________________________________________________________
@@ -1268,7 +1270,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::entropyCodeRANSCompat(const input_IT
12681270 dataSize,
12691271 nLiteralWords);
12701272
1271- return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1273+ return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W) };
12721274}
12731275
12741276template <typename H, int N, typename W>
@@ -1349,7 +1351,7 @@ CTFIOSize EncodedBlocks<H, N, W>::encodeRANSV1External(const input_IT srcBegin,
13491351 dataSize,
13501352 literalsSize);
13511353
1352- return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1354+ return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W) };
13531355};
13541356
13551357template <typename H, int N, typename W>
@@ -1458,7 +1460,7 @@ CTFIOSize EncodedBlocks<H, N, W>::encodeRANSV1Inplace(const input_IT srcBegin, c
14581460 dataSize,
14591461 literalsSize);
14601462
1461- return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1463+ return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W) };
14621464}; // namespace ctf
14631465
14641466template <typename H, int N, typename W>
@@ -1491,7 +1493,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::pack(const input_IT srcBegin, const i
14911493 }
14921494
14931495 LOGP(debug, "StoreData {} bytes, offs: {}:{}", packedSize * sizeof(storageBuffer_t), thisBlock->getOffsData(), thisBlock->getOffsData() + packedSize * sizeof(storageBuffer_t));
1494- return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1496+ return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W) };
14951497};
14961498
14971499template <typename H, int N, typename W>
@@ -1513,7 +1515,7 @@ o2::ctf::CTFIOSize EncodedBlocks<H, N, W>::store(const input_IT srcBegin, const
15131515
15141516 *thisMetadata = detail::makeMetadataStore<input_t, storageBuffer_t>(messageLength, opt, nBufferElems);
15151517
1516- return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize()};
1518+ return {0, thisMetadata->getUncompressedSize(), thisMetadata->getCompressedSize() * sizeof(W) };
15171519};
15181520
15191521/// create a special EncodedBlocks containing only dictionaries made from provided vector of frequency tables
0 commit comments