* rocDecode/AV1: Fixed a bug in the calculation of the floor of the base 2 logarithm. (#367)

Ta zmiana jest zawarta w:
jeffqjiangNew authored and GitHub committed 2024-06-10 14:02:10 -04:00
1 rodzic 63d3245176
złożenie ac272886b1
Plik 1 zmieniony
+2 -1
+2 -1
Wyświetl plik
@@ -430,12 +430,13 @@ protected:
* \return the location of the most significant bit in x
*/
inline uint32_t FloorLog2(uint32_t x) {
uint32_t saved_x = x;
uint32_t s = 0;
while (x != 0) {
x = x >> 1;
s++;
}
return x ? s - 1 : 0;
return saved_x ? s - 1 : 0;
}
/*! \brief Function to read variable length unsigned n-bit number appearing directly in the bitstream. 4.10.3. uvlc().