aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/rangecoder
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2024-02-14 14:58:36 +0200
committerLasse Collin <lasse.collin@tukaani.org>2024-02-14 18:31:16 +0200
commit0668907ff736e4cd16738c10d39a2bc9e851aefb (patch)
tree0dfe725f1a8c94f69e39946f160afb5aedc249da /src/liblzma/rangecoder
parentScripts: Add lz4 support to xzgrep and xzdiff. (diff)
downloadxz-0668907ff736e4cd16738c10d39a2bc9e851aefb.tar.xz
liblzma: Add comments.
Diffstat (limited to 'src/liblzma/rangecoder')
-rw-r--r--src/liblzma/rangecoder/range_decoder.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/liblzma/rangecoder/range_decoder.h b/src/liblzma/rangecoder/range_decoder.h
index ffec7bf2..ddac1060 100644
--- a/src/liblzma/rangecoder/range_decoder.h
+++ b/src/liblzma/rangecoder/range_decoder.h
@@ -305,8 +305,15 @@ do { \
} while (0)
-// Decode one bit from variable-sized reverse bittree.
-// The loop is done in the code that uses this macro.
+// Decode one bit from variable-sized reverse bittree. The loop is done
+// in the code that uses this macro. This could be changed if the assembly
+// version benefited from having the loop done in assembly but it didn't
+// seem so in early 2024.
+//
+// Also, if the loop was done here, the loop counter would likely be local
+// to the macro so that it wouldn't modify yet another input variable.
+// If a _safe version of a macro with a loop was done then a modifiable
+// input variable couldn't be avoided though.
#define rc_bit_add_if_1(probs, dest, value_to_add_if_1) \
rc_bit(probs[symbol], \
, \