From: Yann Collet Date: Thu, 24 May 2018 21:09:49 +0000 (-0700) Subject: Merge branch 'dev' into fracFse X-Git-Tag: v1.3.5~3^2~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1150%2Fhead;p=thirdparty%2Fzstd.git Merge branch 'dev' into fracFse --- b5ef32fea7bd8cbb031fbd4a6955e9e72f4d2bc8 diff --cc lib/common/fse.h index cd810c7d5,e88a5ef5a..8d7033695 --- a/lib/common/fse.h +++ b/lib/common/fse.h @@@ -588,11 -582,12 +588,12 @@@ MEM_STATIC U32 FSE_getMaxNbBits(const v } /* FSE_bitCost() : - * Approximate symbol cost, - * provide fractional value, using fixed-point format (accuracyLog fractional bits) - * note: assume symbolValue is valid */ + * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits) + * note 1 : assume symbolValue is valid (<= maxSymbolValue) + * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */ - MEM_STATIC U32 FSE_bitCost(const FSE_symbolCompressionTransform* symbolTT, U32 tableLog, U32 symbolValue, U32 accuracyLog) + MEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog) { + const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr; U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16; U32 const threshold = (minNbBits+1) << 16; assert(tableLog < 16);