| 108 | } |
| 109 | |
| 110 | int64_t product(const std::vector<int> & values) { |
| 111 | if (values.empty()) { |
| 112 | throw std::runtime_error("MioCodec quantizer levels must not be empty"); |
| 113 | } |
| 114 | int64_t out = 1; |
| 115 | for (const int value : values) { |
| 116 | if (value <= 0) { |
| 117 | throw std::runtime_error("MioCodec quantizer levels must be positive"); |
| 118 | } |
| 119 | out *= value; |
| 120 | } |
| 121 | return out; |
| 122 | } |
| 123 | |
| 124 | std::vector<int64_t> quantizer_basis(const std::vector<int> & levels) { |
| 125 | std::vector<int64_t> basis(levels.size(), 1); |
no test coverage detected