mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-02-19 06:31:27 +00:00
Clean up use of MODESWITCH_PENALTY; bump version
This commit is contained in:
parent
de0ff5d3b0
commit
e55c80a475
@ -47,7 +47,7 @@
|
|||||||
#define OPT_FAVOR_RATIO 4
|
#define OPT_FAVOR_RATIO 4
|
||||||
#define OPT_RAW_BACKWARD 8
|
#define OPT_RAW_BACKWARD 8
|
||||||
|
|
||||||
#define TOOL_VERSION "1.0.9"
|
#define TOOL_VERSION "1.1.0"
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ static void lzsa_optimize_forward_v1(lzsa_compressor *pCompressor, const int nSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nFavorRatio && nNumLiterals == 1)
|
if (!nFavorRatio && nNumLiterals == 1)
|
||||||
nCodingChoiceCost += MODESWITCH_PENALTY * 3;
|
nCodingChoiceCost += MODESWITCH_PENALTY;
|
||||||
|
|
||||||
lzsa_arrival *pDestArrival = &arrival[((i + 1) << MATCHES_PER_OFFSET_SHIFT)];
|
lzsa_arrival *pDestArrival = &arrival[((i + 1) << MATCHES_PER_OFFSET_SHIFT)];
|
||||||
if (pDestArrival->from_slot == 0 ||
|
if (pDestArrival->from_slot == 0 ||
|
||||||
@ -224,7 +224,7 @@ static void lzsa_optimize_forward_v1(lzsa_compressor *pCompressor, const int nSt
|
|||||||
int exists = 0;
|
int exists = 0;
|
||||||
|
|
||||||
if (!nFavorRatio && !arrival[(i << MATCHES_PER_OFFSET_SHIFT) + j].num_literals)
|
if (!nFavorRatio && !arrival[(i << MATCHES_PER_OFFSET_SHIFT) + j].num_literals)
|
||||||
nCodingChoiceCost += MODESWITCH_PENALTY * 3;
|
nCodingChoiceCost += MODESWITCH_PENALTY;
|
||||||
|
|
||||||
for (n = 0;
|
for (n = 0;
|
||||||
n < 3 && arrival[((i + k) << MATCHES_PER_OFFSET_SHIFT) + n].from_slot && arrival[((i + k) << MATCHES_PER_OFFSET_SHIFT) + n].cost <= nCodingChoiceCost;
|
n < 3 && arrival[((i + k) << MATCHES_PER_OFFSET_SHIFT) + n].from_slot && arrival[((i + k) << MATCHES_PER_OFFSET_SHIFT) + n].cost <= nCodingChoiceCost;
|
||||||
|
@ -213,7 +213,7 @@ static void lzsa_optimize_forward_v2(lzsa_compressor *pCompressor, const unsigne
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nFavorRatio && nNumLiterals == 1)
|
if (!nFavorRatio && nNumLiterals == 1)
|
||||||
nCodingChoiceCost += MODESWITCH_PENALTY * 3;
|
nCodingChoiceCost += MODESWITCH_PENALTY;
|
||||||
|
|
||||||
int exists = 0;
|
int exists = 0;
|
||||||
for (n = 0;
|
for (n = 0;
|
||||||
@ -284,7 +284,7 @@ static void lzsa_optimize_forward_v2(lzsa_compressor *pCompressor, const unsigne
|
|||||||
int exists = 0;
|
int exists = 0;
|
||||||
|
|
||||||
if (!nFavorRatio && !arrival[(i << MATCHES_PER_OFFSET_SHIFT) + j].num_literals)
|
if (!nFavorRatio && !arrival[(i << MATCHES_PER_OFFSET_SHIFT) + j].num_literals)
|
||||||
nCodingChoiceCost += MODESWITCH_PENALTY*3;
|
nCodingChoiceCost += MODESWITCH_PENALTY;
|
||||||
|
|
||||||
for (n = 0;
|
for (n = 0;
|
||||||
n < NMATCHES_PER_OFFSET && pDestSlots[n].from_slot && pDestSlots[n].cost <= nCodingChoiceCost;
|
n < NMATCHES_PER_OFFSET && pDestSlots[n].from_slot && pDestSlots[n].cost <= nCodingChoiceCost;
|
||||||
|
@ -58,7 +58,7 @@ extern "C" {
|
|||||||
#define LAST_MATCH_OFFSET 4
|
#define LAST_MATCH_OFFSET 4
|
||||||
#define LAST_LITERALS 1
|
#define LAST_LITERALS 1
|
||||||
|
|
||||||
#define MODESWITCH_PENALTY 1
|
#define MODESWITCH_PENALTY 3
|
||||||
|
|
||||||
/** One match */
|
/** One match */
|
||||||
typedef struct _lzsa_match {
|
typedef struct _lzsa_match {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user