minor adjusting of weights
This commit is contained in:
parent
1a26ec6e8d
commit
09d0fa29ee
@ -51,7 +51,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
|||||||
optPtr->litSum = 0;
|
optPtr->litSum = 0;
|
||||||
{ unsigned lit;
|
{ unsigned lit;
|
||||||
for (lit=0; lit<=MaxLit; lit++) {
|
for (lit=0; lit<=MaxLit; lit++) {
|
||||||
U32 const scaleLog = 12; /* scale to 4K */
|
U32 const scaleLog = 11; /* scale to 2K */
|
||||||
U32 const bitCost = HUF_getNbBits(optPtr->symbolCosts->hufCTable, lit);
|
U32 const bitCost = HUF_getNbBits(optPtr->symbolCosts->hufCTable, lit);
|
||||||
assert(bitCost < scaleLog);
|
assert(bitCost < scaleLog);
|
||||||
optPtr->litFreq[lit] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
optPtr->litFreq[lit] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
||||||
@ -63,7 +63,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
|||||||
FSE_initCState(&llstate, optPtr->symbolCosts->litlengthCTable);
|
FSE_initCState(&llstate, optPtr->symbolCosts->litlengthCTable);
|
||||||
optPtr->litLengthSum = 0;
|
optPtr->litLengthSum = 0;
|
||||||
for (ll=0; ll<=MaxLL; ll++) {
|
for (ll=0; ll<=MaxLL; ll++) {
|
||||||
U32 const scaleLog = 11; /* scale to 2K */
|
U32 const scaleLog = 10; /* scale to 1K */
|
||||||
U32 const bitCost = FSE_getMaxNbBits(llstate.symbolTT, ll);
|
U32 const bitCost = FSE_getMaxNbBits(llstate.symbolTT, ll);
|
||||||
assert(bitCost < scaleLog);
|
assert(bitCost < scaleLog);
|
||||||
optPtr->litLengthFreq[ll] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
optPtr->litLengthFreq[ll] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
||||||
@ -75,7 +75,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
|||||||
FSE_initCState(&mlstate, optPtr->symbolCosts->matchlengthCTable);
|
FSE_initCState(&mlstate, optPtr->symbolCosts->matchlengthCTable);
|
||||||
optPtr->matchLengthSum = 0;
|
optPtr->matchLengthSum = 0;
|
||||||
for (ml=0; ml<=MaxML; ml++) {
|
for (ml=0; ml<=MaxML; ml++) {
|
||||||
U32 const scaleLog = 11; /* scale to 2K */
|
U32 const scaleLog = 10;
|
||||||
U32 const bitCost = FSE_getMaxNbBits(mlstate.symbolTT, ml);
|
U32 const bitCost = FSE_getMaxNbBits(mlstate.symbolTT, ml);
|
||||||
assert(bitCost < scaleLog);
|
assert(bitCost < scaleLog);
|
||||||
optPtr->matchLengthFreq[ml] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
optPtr->matchLengthFreq[ml] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
||||||
@ -87,7 +87,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
|||||||
FSE_initCState(&ofstate, optPtr->symbolCosts->offcodeCTable);
|
FSE_initCState(&ofstate, optPtr->symbolCosts->offcodeCTable);
|
||||||
optPtr->offCodeSum = 0;
|
optPtr->offCodeSum = 0;
|
||||||
for (of=0; of<=MaxOff; of++) {
|
for (of=0; of<=MaxOff; of++) {
|
||||||
U32 const scaleLog = 11; /* scale to 2K */
|
U32 const scaleLog = 10;
|
||||||
U32 const bitCost = FSE_getMaxNbBits(ofstate.symbolTT, of);
|
U32 const bitCost = FSE_getMaxNbBits(ofstate.symbolTT, of);
|
||||||
assert(bitCost < scaleLog);
|
assert(bitCost < scaleLog);
|
||||||
optPtr->offCodeFreq[of] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
optPtr->offCodeFreq[of] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user