]> pd.if.org Git - zpackage/blobdiff - lzma/lzma/lzma_encoder_optimum_normal.c
use lzma from xz 5.2.4
[zpackage] / lzma / lzma / lzma_encoder_optimum_normal.c
index a360579885dbd5c08fe9b790220a379df2388b72..59f77343ed793bd662c7b17fb0977a267b82df32 100644 (file)
@@ -19,7 +19,7 @@
 ////////////
 
 static uint32_t
-get_literal_price(const lzma_coder *const coder, const uint32_t pos,
+get_literal_price(const lzma_lzma1_encoder *const coder, const uint32_t pos,
                const uint32_t prev_byte, const bool match_mode,
                uint32_t match_byte, uint32_t symbol)
 {
@@ -65,7 +65,7 @@ get_len_price(const lzma_length_encoder *const lencoder,
 
 
 static inline uint32_t
-get_short_rep_price(const lzma_coder *const coder,
+get_short_rep_price(const lzma_lzma1_encoder *const coder,
                const lzma_lzma_state state, const uint32_t pos_state)
 {
        return rc_bit_0_price(coder->is_rep0[state])
@@ -74,7 +74,7 @@ get_short_rep_price(const lzma_coder *const coder,
 
 
 static inline uint32_t
-get_pure_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
+get_pure_rep_price(const lzma_lzma1_encoder *const coder, const uint32_t rep_index,
                const lzma_lzma_state state, uint32_t pos_state)
 {
        uint32_t price;
@@ -99,7 +99,7 @@ get_pure_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
 
 
 static inline uint32_t
-get_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
+get_rep_price(const lzma_lzma1_encoder *const coder, const uint32_t rep_index,
                const uint32_t len, const lzma_lzma_state state,
                const uint32_t pos_state)
 {
@@ -109,7 +109,7 @@ get_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
 
 
 static inline uint32_t
-get_dist_len_price(const lzma_coder *const coder, const uint32_t dist,
+get_dist_len_price(const lzma_lzma1_encoder *const coder, const uint32_t dist,
                const uint32_t len, const uint32_t pos_state)
 {
        const uint32_t dist_state = get_dist_state(len);
@@ -130,7 +130,7 @@ get_dist_len_price(const lzma_coder *const coder, const uint32_t dist,
 
 
 static void
-fill_dist_prices(lzma_coder *coder)
+fill_dist_prices(lzma_lzma1_encoder *coder)
 {
        for (uint32_t dist_state = 0; dist_state < DIST_STATES; ++dist_state) {
 
@@ -185,7 +185,7 @@ fill_dist_prices(lzma_coder *coder)
 
 
 static void
-fill_align_prices(lzma_coder *coder)
+fill_align_prices(lzma_lzma1_encoder *coder)
 {
        for (uint32_t i = 0; i < ALIGN_SIZE; ++i)
                coder->align_prices[i] = rc_bittree_reverse_price(
@@ -221,7 +221,7 @@ make_short_rep(lzma_optimal *optimal)
 
 
 static void
-backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
+backward(lzma_lzma1_encoder *restrict coder, uint32_t *restrict len_res,
                uint32_t *restrict back_res, uint32_t cur)
 {
        coder->opts_end_index = cur;
@@ -269,7 +269,7 @@ backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
 //////////
 
 static inline uint32_t
-helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
+helper1(lzma_lzma1_encoder *restrict coder, lzma_mf *restrict mf,
                uint32_t *restrict back_res, uint32_t *restrict len_res,
                uint32_t position)
 {
@@ -441,7 +441,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
 
 
 static inline uint32_t
-helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
+helper2(lzma_lzma1_encoder *coder, uint32_t *reps, const uint8_t *buf,
                uint32_t len_end, uint32_t position, const uint32_t cur,
                const uint32_t nice_len, const uint32_t buf_avail_full)
 {
@@ -797,7 +797,8 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
 
 
 extern void
-lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
+lzma_lzma_optimum_normal(lzma_lzma1_encoder *restrict coder,
+               lzma_mf *restrict mf,
                uint32_t *restrict back_res, uint32_t *restrict len_res,
                uint32_t position)
 {