| 255 | } |
| 256 | |
| 257 | void 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 | |
| 275 | void EncodeStream::writeFloatList(const float* values, uint32_t count, float precision) { |
| 276 | if (count == 0) { |
no test coverage detected