Closed Quake4 closed 1 month ago
The code should calculate the largest possible absolute value there, not the largest possible value. For example, for a signed 16-bit int, the largest possible absolute value is 32768, which is 1 << 15. Indeed, if I wanted to calculate the maximum possible value for an unsigned int, it would have been (1 << 16) - 1, but that is not the case here.
So, I don't think the code is wrong.
Wrong start max value by bits count (max_abs_sample_value). Must be: (1 << bps) - 1
https://github.com/xiph/flac/commit/cfe3afca9b3f27f0877203570705e072f0981b2e