bzip2: move ->origPtr out of struct EState, make a few members smaller

function                                             old     new   delta
BZ2_compressBlock                                    223     228      +5
BZ2_blockSort                                         85      88      +3
generateMTFValues                                    356     357      +1
handle_compress                                      355     349      -6
compressStream                                       538     531      -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 9/-13)              Total: -4 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-02-03 20:50:20 +01:00
parent c9ae8d770b
commit 86be6d5ba9
3 changed files with 27 additions and 27 deletions

View File

@@ -665,6 +665,8 @@ void sendMTFValues(EState* s)
static
void BZ2_compressBlock(EState* s, int is_last_block)
{
int32_t origPtr = origPtr;
if (s->nblock > 0) {
BZ_FINALISE_CRC(s->blockCRC);
s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
@@ -672,7 +674,7 @@ void BZ2_compressBlock(EState* s, int is_last_block)
if (s->blockNo > 1)
s->posZ = s->zbits; // was: s->numZ = 0;
BZ2_blockSort(s);
origPtr = BZ2_blockSort(s);
}
s->zbits = &((uint8_t*)s->arr2)[s->nblock];
@@ -713,7 +715,7 @@ void BZ2_compressBlock(EState* s, int is_last_block)
*/
bsW1_0(s);
bsW(s, 24, s->origPtr);
bsW(s, 24, origPtr);
generateMTFValues(s);
sendMTFValues(s);
}