/* The lowest 7 states indicate that the previous state was a literal. */ #define LIT_STATES 7
/* Indicate that the latest symbol was a literal. */ staticinlinevoid lzma_state_literal(enum lzma_state *state)
{ if (*state <= STATE_SHORTREP_LIT_LIT)
*state = STATE_LIT_LIT; elseif (*state <= STATE_LIT_SHORTREP)
*state -= 3; else
*state -= 6;
}
/* Indicate that the latest symbol was a match. */ staticinlinevoid lzma_state_match(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;
}
/* Indicate that the latest state was a long repeated match. */ staticinlinevoid lzma_state_long_rep(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP;
}
/* Indicate that the latest symbol was a short match. */ staticinlinevoid lzma_state_short_rep(enum lzma_state *state)
{
*state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;
}
/* Test if the previous symbol was a literal. */ staticinlinebool lzma_state_is_literal(enum lzma_state state)
{ return state < LIT_STATES;
}
/* Each literal coder is divided in three sections: *-0x001-0x0FF:Withoutmatchbyte *-0x101-0x1FF:Withmatchbyte;matchbitis0 *-0x201-0x2FF:Withmatchbyte;matchbitis1 * *MatchbyteisusedwhenthepreviousLZMAsymbolwassomethingelsethan *aliteral(thatis,itwassomekindofmatch).
*/ #define LITERAL_CODER_SIZE 0x300
/* Maximum number of literal coders */ #define LITERAL_CODERS_MAX (1 << 4)
/* Minimum length of a match is two bytes. */ #define MATCH_LEN_MIN 2
/* Match distances up to 127 are fully encoded using probabilities. Since *thehighesttwobits(distanceslot)arealwaysencodedusingsixbits, *thedistances0-3don'tneedanyadditionalbitstoencode,sincethe *distanceslotitselfisthesameastheactualdistance.DIST_MODEL_START *indicatesthefirstdistanceslotwhereatleastoneadditionalbitis *needed.
*/ #define DIST_MODEL_START 4
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.