MCPcopy Create free account
hub / github.com/Tencent/libpag / writeUint32List

Method writeUint32List

src/codec/utils/EncodeStream.cpp:257–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void EncodeStream::writeUint32List(const uint32_t* values, uint32_t count) {
258 if (count == 0) {
259 writeUBits(0, LENGTH_FOR_STORE_NUM_BITS);
260 return;
261 }
262 uint8_t bitLength = 1;
263 for (uint32_t i = 0; i < count; i++) {
264 auto length = GetBitLength(values[i]);
265 if (bitLength < length) {
266 bitLength = length;
267 }
268 }
269 writeUBits(static_cast<uint32_t>(bitLength - 1), LENGTH_FOR_STORE_NUM_BITS);
270 for (uint32_t i = 0; i < count; i++) {
271 writeUBits(values[i], bitLength);
272 }
273}
274
275void EncodeStream::writeFloatList(const float* values, uint32_t count, float precision) {
276 if (count == 0) {

Callers 3

writeValueListMethod · 0.80
writeValueListMethod · 0.80
writeValueListMethod · 0.80

Calls 1

GetBitLengthFunction · 0.85

Tested by

no test coverage detected