@@ -914,8 +914,8 @@ size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* t
914914 else
915915 {
916916 bitCount -= (int )(8 * (iend - 4 - ip ));
917- ip = iend - 4 ;
918- }
917+ ip = iend - 4 ;
918+ }
919919 bitStream = FSE_readLE32 (ip ) >> (bitCount & 31 );
920920 }
921921 }
@@ -967,20 +967,20 @@ void FSE_freeCTable (FSE_CTable* ct)
967967/* provides the minimum logSize to safely represent a distribution */
968968static unsigned FSE_minTableLog (size_t srcSize , unsigned maxSymbolValue )
969969{
970- U32 minBitsSrc = FSE_highbit32 ((U32 )(srcSize - 1 )) + 1 ;
971- U32 minBitsSymbols = FSE_highbit32 (maxSymbolValue ) + 2 ;
972- U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols ;
973- return minBits ;
970+ U32 minBitsSrc = FSE_highbit32 ((U32 )(srcSize - 1 )) + 1 ;
971+ U32 minBitsSymbols = FSE_highbit32 (maxSymbolValue ) + 2 ;
972+ U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols ;
973+ return minBits ;
974974}
975975
976976unsigned FSE_optimalTableLog (unsigned maxTableLog , size_t srcSize , unsigned maxSymbolValue )
977977{
978- U32 maxBitsSrc = FSE_highbit32 ((U32 )(srcSize - 1 )) - 2 ;
978+ U32 maxBitsSrc = FSE_highbit32 ((U32 )(srcSize - 1 )) - 2 ;
979979 U32 tableLog = maxTableLog ;
980- U32 minBits = FSE_minTableLog (srcSize , maxSymbolValue );
980+ U32 minBits = FSE_minTableLog (srcSize , maxSymbolValue );
981981 if (tableLog == 0 ) tableLog = FSE_DEFAULT_TABLELOG ;
982- if (maxBitsSrc < tableLog ) tableLog = maxBitsSrc ; /* Accuracy can be reduced */
983- if (minBits > tableLog ) tableLog = minBits ; /* Need a minimum to safely represent all symbol values */
982+ if (maxBitsSrc < tableLog ) tableLog = maxBitsSrc ; /* Accuracy can be reduced */
983+ if (minBits > tableLog ) tableLog = minBits ; /* Need a minimum to safely represent all symbol values */
984984 if (tableLog < FSE_MIN_TABLELOG ) tableLog = FSE_MIN_TABLELOG ;
985985 if (tableLog > FSE_MAX_TABLELOG ) tableLog = FSE_MAX_TABLELOG ;
986986 return tableLog ;
@@ -1569,8 +1569,8 @@ size_t FSE_readBitsFast(FSE_DStream_t* bitD, U32 nbBits) /* only if nbBits >=
15691569
15701570unsigned FSE_reloadDStream (FSE_DStream_t * bitD )
15711571{
1572- if (bitD -> bitsConsumed > (sizeof (bitD -> bitContainer )* 8 )) /* should never happen */
1573- return FSE_DStream_tooFar ;
1572+ if (bitD -> bitsConsumed > (sizeof (bitD -> bitContainer )* 8 )) /* should never happen */
1573+ return FSE_DStream_tooFar ;
15741574
15751575 if (bitD -> ptr >= bitD -> start + sizeof (bitD -> bitContainer ))
15761576 {
@@ -1834,7 +1834,7 @@ size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* tree, U32
18341834 if (maxSymbolValue > (241 - 128 )) return (size_t )- FSE_ERROR_GENERIC ; /* not implemented (not possible with current format) */
18351835 if (((maxSymbolValue + 1 )/2 ) + 1 > maxDstSize ) return (size_t )- FSE_ERROR_dstSize_tooSmall ; /* not enough space within dst buffer */
18361836 op [0 ] = (BYTE )(128 /*special case*/ + 0 /* Not Compressible */ + (maxSymbolValue - 1 ));
1837- huffWeight [maxSymbolValue ] = 0 ; /* to be sure it doesn't cause issue in final combination */
1837+ huffWeight [maxSymbolValue ] = 0 ; /* to be sure it doesn't cause issue in final combination */
18381838 for (n = 0 ; n < maxSymbolValue ; n += 2 )
18391839 op [(n /2 )+ 1 ] = (BYTE )((huffWeight [n ] << 4 ) + huffWeight [n + 1 ]);
18401840 return ((maxSymbolValue + 1 )/2 ) + 1 ;
@@ -1878,7 +1878,7 @@ static U32 HUF_setMaxHeight(nodeElt* huffNode, U32 lastNonNull, U32 maxNbBits)
18781878 U32 rankLast [HUF_MAX_TABLELOG ];
18791879 U32 currentNbBits = maxNbBits ;
18801880 int pos ;
1881- memset (rankLast , 0xF0 , sizeof (rankLast ));
1881+ memset (rankLast , 0xF0 , sizeof (rankLast ));
18821882 for (pos = n ; pos >= 0 ; pos -- )
18831883 {
18841884 if (huffNode [pos ].nbBits >= currentNbBits ) continue ;
@@ -1917,20 +1917,20 @@ static U32 HUF_setMaxHeight(nodeElt* huffNode, U32 lastNonNull, U32 maxNbBits)
19171917 }
19181918 }
19191919
1920- while (totalCost < 0 ) /* Sometimes, cost correction overshoot */
1921- {
1922- if (rankLast [1 ] == noOne ) /* special case, no weight 1, let's find it back at n */
1923- {
1924- while (huffNode [n ].nbBits == maxNbBits ) n -- ;
1925- huffNode [n + 1 ].nbBits -- ;
1926- rankLast [1 ] = n + 1 ;
1927- totalCost ++ ;
1928- continue ;
1929- }
1930- huffNode [ rankLast [1 ] + 1 ].nbBits -- ;
1931- rankLast [1 ]++ ;
1932- totalCost ++ ;
1933- }
1920+ while (totalCost < 0 ) /* Sometimes, cost correction overshoot */
1921+ {
1922+ if (rankLast [1 ] == noOne ) /* special case, no weight 1, let's find it back at n */
1923+ {
1924+ while (huffNode [n ].nbBits == maxNbBits ) n -- ;
1925+ huffNode [n + 1 ].nbBits -- ;
1926+ rankLast [1 ] = n + 1 ;
1927+ totalCost ++ ;
1928+ continue ;
1929+ }
1930+ huffNode [ rankLast [1 ] + 1 ].nbBits -- ;
1931+ rankLast [1 ]++ ;
1932+ totalCost ++ ;
1933+ }
19341934 }
19351935 }
19361936
@@ -1981,7 +1981,7 @@ size_t HUF_buildCTable (HUF_CElt* tree, const U32* count, U32 maxSymbolValue, U3
19811981 /* safety checks */
19821982 if (maxNbBits == 0 ) maxNbBits = HUF_DEFAULT_TABLELOG ;
19831983 if (maxSymbolValue > HUF_MAX_SYMBOL_VALUE ) return (size_t )- FSE_ERROR_GENERIC ;
1984- memset (huffNode0 , 0 , sizeof (huffNode0 ));
1984+ memset (huffNode0 , 0 , sizeof (huffNode0 ));
19851985
19861986 // sort, decreasing order
19871987 HUF_sort (huffNode , count , maxSymbolValue );
@@ -2066,7 +2066,7 @@ size_t HUF_compress_usingCTable(void* dst, size_t dstSize, const void* src, size
20662066 FSE_CStream_t bitC ;
20672067
20682068 /* init */
2069- if (dstSize < 8 ) return 0 ;
2069+ if (dstSize < 8 ) return 0 ;
20702070 op += 6 ; /* jump Table -- could be optimized by delta / deviation */
20712071 errorCode = FSE_initCStream (& bitC , op , oend - op );
20722072 if (FSE_isError (errorCode )) return 0 ;
0 commit comments