]> wimlib.net Git - wimlib/blobdiff - include/wimlib/lzx.h
Share most e8 processing code between LZX compressor and decompressor
[wimlib] / include / wimlib / lzx.h
index 1332645f10274b3e22d17c184a25e9ec64f47c27..7104dc14ea91389ca3aff9385ae6dccf59788d4a 100644 (file)
@@ -95,7 +95,7 @@
 extern const u8 lzx_extra_bits[LZX_MAX_POSITION_SLOTS];
 #endif
 
-/* Given the number of a LZX position slot, return the number of extra bits that
+/* Given the number of an LZX position slot, return the number of extra bits that
  * are needed to encode the match offset. */
 static inline unsigned
 lzx_get_num_extra_bits(unsigned position_slot)
@@ -134,7 +134,7 @@ lzx_get_position_slot_raw(unsigned formatted_offset)
        }
 }
 
-extern bool lzx_window_size_valid(u32 window_size);
+extern bool lzx_window_size_valid(size_t window_size);
 extern unsigned lzx_get_num_main_syms(u32 window_size);
 
 #define LZX_NUM_RECENT_OFFSETS 3
@@ -148,6 +148,8 @@ struct lzx_lru_queue {
  * as (n + LZX_OFFSET_OFFSET).  */
 #define LZX_OFFSET_OFFSET      (LZX_NUM_RECENT_OFFSETS - 1)
 
+/* Initialize the LZX least-recently-used match offset queue at the beginning of
+ * a new window for either decompression or compression.  */
 static inline void
 lzx_lru_queue_init(struct lzx_lru_queue *queue)
 {
@@ -155,4 +157,10 @@ lzx_lru_queue_init(struct lzx_lru_queue *queue)
                queue->R[i] = 1;
 }
 
+extern void
+lzx_do_e8_preprocessing(u8 *data, s32 size);
+
+extern void
+lzx_undo_e8_preprocessing(u8 *data, s32 size);
+
 #endif /* _WIMLIB_LZX_H */