bzip2: pass sorting params through EState* pointer

function                                             old     new   delta
mainGtU                                              499     515     +16
sendMTFValues                                       2085    2094      +9
mainSort                                            1116    1119      +3
generateMTFValues                                    357     356      -1
fallbackSort                                        1719    1705     -14
mainQSort3                                          1163    1141     -22
BZ2_blockSort                                        118      85     -33
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/4 up/down: 28/-70)            Total: -42 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-02-03 20:19:51 +01:00
parent 10f516500e
commit c9ae8d770b
3 changed files with 65 additions and 67 deletions

View File

@@ -121,6 +121,7 @@ typedef struct EState {
/* mode this stream is in, and whether inputting */
/* or outputting data */
int32_t mode;
//both smallint?
int32_t state;
/* remembers avail_in when flush/finish requested */
@@ -134,6 +135,9 @@ typedef struct EState {
uint32_t *arr2;
uint32_t *ftab;
uint16_t* quadrant;
int32_t budget;
/* aliases for arr1 and arr2 */
uint32_t *ptr;
uint8_t *block;
@@ -142,6 +146,7 @@ typedef struct EState {
/* guess what */
uint32_t *crc32table;
//move down
/* run-length-encoding of the input */
uint32_t state_in_ch;
@@ -165,6 +170,7 @@ typedef struct EState {
/* misc administratium */
int32_t blockNo;
int32_t blockSize100k;
//smallint?
/* stuff for coding the MTF values */
int32_t nMTF;