Merge branch 'dev' into staticDictCost
This commit is contained in:
@@ -88,7 +88,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
||||
optPtr->priceType = zop_predef;
|
||||
|
||||
assert(optPtr->symbolCosts != NULL);
|
||||
if (optPtr->symbolCosts->hufCTable_repeatMode == HUF_repeat_valid) { /* huffman table presumed generated by dictionary */
|
||||
if (optPtr->symbolCosts->huf.repeatMode == HUF_repeat_valid) { /* huffman table presumed generated by dictionary */
|
||||
optPtr->priceType = zop_dynamic;
|
||||
|
||||
assert(optPtr->litFreq != NULL);
|
||||
@@ -96,7 +96,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
||||
{ unsigned lit;
|
||||
for (lit=0; lit<=MaxLit; lit++) {
|
||||
U32 const scaleLog = 11; /* scale to 2K */
|
||||
U32 const bitCost = HUF_getNbBits(optPtr->symbolCosts->hufCTable, lit);
|
||||
U32 const bitCost = HUF_getNbBits(optPtr->symbolCosts->huf.CTable, lit);
|
||||
assert(bitCost <= scaleLog);
|
||||
optPtr->litFreq[lit] = bitCost ? 1 << (scaleLog-bitCost) : 1 /*minimum to calculate cost*/;
|
||||
optPtr->litSum += optPtr->litFreq[lit];
|
||||
@@ -104,7 +104,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
||||
|
||||
{ unsigned ll;
|
||||
FSE_CState_t llstate;
|
||||
FSE_initCState(&llstate, optPtr->symbolCosts->litlengthCTable);
|
||||
FSE_initCState(&llstate, optPtr->symbolCosts->fse.litlengthCTable);
|
||||
optPtr->litLengthSum = 0;
|
||||
for (ll=0; ll<=MaxLL; ll++) {
|
||||
U32 const scaleLog = 10; /* scale to 1K */
|
||||
@@ -116,7 +116,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
||||
|
||||
{ unsigned ml;
|
||||
FSE_CState_t mlstate;
|
||||
FSE_initCState(&mlstate, optPtr->symbolCosts->matchlengthCTable);
|
||||
FSE_initCState(&mlstate, optPtr->symbolCosts->fse.matchlengthCTable);
|
||||
optPtr->matchLengthSum = 0;
|
||||
for (ml=0; ml<=MaxML; ml++) {
|
||||
U32 const scaleLog = 10;
|
||||
@@ -128,7 +128,7 @@ static void ZSTD_rescaleFreqs(optState_t* const optPtr,
|
||||
|
||||
{ unsigned of;
|
||||
FSE_CState_t ofstate;
|
||||
FSE_initCState(&ofstate, optPtr->symbolCosts->offcodeCTable);
|
||||
FSE_initCState(&ofstate, optPtr->symbolCosts->fse.offcodeCTable);
|
||||
optPtr->offCodeSum = 0;
|
||||
for (of=0; of<=MaxOff; of++) {
|
||||
U32 const scaleLog = 10;
|
||||
|
||||
Reference in New Issue
Block a user