See header for documentation. */
| 417 | |
| 418 | /* See header for documentation. */ |
| 419 | unsigned int get_ise_sequence_bitcount( |
| 420 | unsigned int character_count, |
| 421 | quant_method quant_level |
| 422 | ) { |
| 423 | // Cope with out-of bounds values - input might be invalid |
| 424 | if (static_cast<size_t>(quant_level) >= ise_sizes.size()) |
| 425 | { |
| 426 | // Arbitrary large number that's more than an ASTC block can hold |
| 427 | return 1024; |
| 428 | } |
| 429 | |
| 430 | auto& entry = ise_sizes[quant_level]; |
| 431 | unsigned int divisor = (entry.divisor << 1) + 1; |
| 432 | return (entry.scale * character_count + divisor - 1) / divisor; |
| 433 | } |
| 434 | |
| 435 | /** |
| 436 | * @brief Write up to 8 bits at an arbitrary bit offset. |
no outgoing calls
no test coverage detected