minor reordering (DSpeed 665)

This commit is contained in:
Yann Collet
2016-03-23 14:00:09 +01:00
parent afab02098a
commit 2512597576
2 changed files with 9 additions and 10 deletions
+5 -6
View File
@@ -635,6 +635,8 @@ static void ZSTD_decodeSequence(seq_t* seq, seqState_t* seqState, const U32 mls)
U32 const mlBits = ML_bits[mlCode];
U32 const ofBits = ofCode ? ofCode-1 : 0;
size_t allBits = BIT_readBits(&(seqState->DStream), llBits+mlBits+ofBits);
static const U32 LL_base[MaxLL+1] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
@@ -652,18 +654,15 @@ static void ZSTD_decodeSequence(seq_t* seq, seqState_t* seqState, const U32 mls)
0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000, 0x200000, 0x400000,
0x800000, 0x1000000, 0x2000000, 0x4000000, /*fake*/ 1, 1, 1, 1 };
size_t allBits = BIT_readBits(&(seqState->DStream), llBits+mlBits+ofBits);
/* Offset */
/* sequence */
seq->litLength = LL_base[llCode] + BIT_consumeFirstBits(&allBits, llBits);
seq->matchLength = ML_base[mlCode] + BIT_consumeFirstBits(&allBits, mlBits) + mls;
{ size_t const offset = ofCode ? OF_base[ofCode] + BIT_consumeFirstBits(&allBits, ofBits) :
llCode ? seq->offset : seqState->prevOffset;
if (ofCode | !llCode) seqState->prevOffset = seq->offset; /* cmove */
seq->offset = offset;
}
seq->matchLength = ML_base[mlCode] + BIT_consumeFirstBits(&allBits, mlBits) + mls;
seq->litLength = LL_base[llCode] + BIT_consumeFirstBits(&allBits, llBits);
/* ANS state update */
FSE_updateState(&(seqState->stateLL), &(seqState->DStream));
FSE_updateState(&(seqState->stateML), &(seqState->DStream));