summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-05-18 18:08:29 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-19 23:40:33 +0200
commitcb931863505652c6432b3afa15f181cbc4cad7c3 (patch)
treea451f7aa7c0221ac82ed289d39d656bf682a2419 /Userland/Libraries
parentb4ad3f1b37bfea3648f12e185719eeea30f3fd60 (diff)
downloadserenity-cb931863505652c6432b3afa15f181cbc4cad7c3.zip
LibCompress: Add debug logging for handling LZMA direct bits
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibCompress/Lzma.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCompress/Lzma.cpp b/Userland/Libraries/LibCompress/Lzma.cpp
index f5b8751f98..e1dc18c847 100644
--- a/Userland/Libraries/LibCompress/Lzma.cpp
+++ b/Userland/Libraries/LibCompress/Lzma.cpp
@@ -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)