]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Merge branch 'dev' into fracFse 1150/head
authorYann Collet <cyan@fb.com>
Thu, 24 May 2018 21:09:49 +0000 (14:09 -0700)
committerYann Collet <cyan@fb.com>
Thu, 24 May 2018 21:09:49 +0000 (14:09 -0700)
1  2 
lib/common/fse.h

index cd810c7d5f2dd7927ced081d8fa61a1e71ee44b9,e88a5ef5a6d92e2e3b899b0e15477ff74e1abd10..8d70336955a8417e020643bb3ae05567c80f866f
@@@ -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);