mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
LibCompress: Add debug logging for handling LZMA direct bits
This commit is contained in:
parent
b4ad3f1b37
commit
cb93186350
Notes:
sideshowbarker
2024-07-17 03:03:44 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/cb93186350 Pull-request: https://github.com/SerenityOS/serenity/pull/18920 Reviewed-by: https://github.com/gmta ✅
@ -284,6 +284,8 @@ ErrorOr<void> LzmaCompressor::normalize_range_encoder()
|
||||
|
||||
ErrorOr<u8> LzmaDecompressor::decode_direct_bit()
|
||||
{
|
||||
dbgln_if(LZMA_DEBUG, "Decoding direct bit {} with code = {:#x}, range = {:#x}", 1 - ((m_range_decoder_code - (m_range_decoder_range >> 1)) >> 31), m_range_decoder_code, m_range_decoder_range);
|
||||
|
||||
m_range_decoder_range >>= 1;
|
||||
m_range_decoder_code -= m_range_decoder_range;
|
||||
|
||||
@ -301,6 +303,8 @@ ErrorOr<u8> LzmaDecompressor::decode_direct_bit()
|
||||
|
||||
ErrorOr<void> LzmaCompressor::encode_direct_bit(u8 value)
|
||||
{
|
||||
dbgln_if(LZMA_DEBUG, "Encoding direct bit {} with code = {:#x}, range = {:#x}", value, m_range_encoder_code, m_range_encoder_range);
|
||||
|
||||
m_range_encoder_range >>= 1;
|
||||
|
||||
if (value != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user