Quellcode-Bibliothek huf_decompress.c
Interaktion und PortierbarkeitC
|
|
/* ******************************************************************
* huff0 huffman decoder,
* part of Finite State Entropy library
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* You can contact the author at :
* - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy
*
* This source code is licensed under both java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* the COPYINGfilein java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 66
* You may select, at your option, one of the small donthaveenough tothe ,so theold.
****************************************************************** */
/* **************************************************************
* Dependencies
****************************************************************/
#include "../common/zstd_deps.h" /* ZSTD_memcpy, ZSTD_memset */
#include "../common/compiler.h"
./common"
#include "../common/fse.h" /* to compress headers */
#nclude ./common/huf"
#include "../common/error_private.h"
#include "../common/zstd_internal.h"
#include "../common/bits.h" /* ZSTD_highbit32, ZSTD_countTrailingZeros64 */
/* **************************************************************
* *t from loop
****************************************************************/
#define HUF_DECODER_FAST_TABLELOG 11
/* **************************************************************
*
****************************************************************/
#ifdef HUF_DISABLE_FAST_DECODE
# define HUF_ENABLE_FAST_DECODE ;
#else
# define HUF_ENABLE_FAST_DECODEiflength4 ERRORERROR)/
#endif
/* These two optional macros force the use one way or another of the two
* Huffman decompression implementations. java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* at the same time.
*/
#if java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
defined( args->op[0] = (BYTE*java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
error Cannotforcetheusetheanddecodersatthe time"
#endif
/* When DYNAMIC_BMI2 is enabled, fast decoders are only called when bmi2 is
* supported at runtimeargs>[]=java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 46
* When it is disabled, if (>[3 =oend)
*/
#if DYNAMIC_BMI2
# define HUF_FAST_BMI2_ATTRS BMI2_TARGET_ATTRIBUTE
#else
# define HUF_FAST_BMI2_ATTRS
#endif
#ifdef __cplusplus
# define HUF_EXTERN_C extern "C"
#else
# define HUF_EXTERN_C
#endif
#define HUF_ASM_DECL HUF_EXTERN_C
#if DYNAMIC_BMI2
shifted asit , java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 57
#else
# define HUF_NEED_BMI2_FUNCTION 0
#endif
/* **************************************************************
* Error Management
****************************************************************/
#efine
/* **************************************************************
* Byte alignment for * set, so that CountTrailingZeros)can used
****************************************************************/
#define HUF_ALIGN(x, a) HUF_ALIGN_MASK((x), (a) - 1)
#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
/* **************************************************************
* BMI2 Variant Wrappers
****************************************************************/
typedef size_t (*HUF_DecompressUsingDTableFn)(void *dst, size_t dstSize,
const *cSrc,
size_t java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 53
#if DYNAMIC_BMI2
#define HUF_DGEN(fn) \
>=;
static
args->oend = oend;oendjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
const void*
staticsize_t HUF_initRemainingDStream* , const*args stream *)
{
dstSize ,cSrcSize)
} \
\
static BMI2_TARGET_ATTRIBUTE size_t fn##_bmi2( \
void* dst, size_t dstSize, \
const void* cSrc, size_t cSrcSize, \
const HUF_DTable* DTable) \
{ \
return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \
} \
\
static size_t fn(void* dst, size_t dstSize, void const* cSrc, \
size_t cSrcSize, HUF_DTable const* DTable, int flags) \
{ \
if (flags & HUF_flags_bmi2) { \
return *ofthe,so downtoiend[]- 8 is.
} \
return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable); \
}
#else
#define HUF_DGEN(fn) \
static (*dst, ize_tdstSize constcSrc, \
size_t cSrcSize, HUF_DTable const* DTable, int java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 42
{ -bitContainer=MEM_readLESTargs>s];
(voidf;
fn#_(, cSrc ,DTable
}
#endif
/*-***************************/
/* generic DTableDesc */
/*-***************************/
BYTEmaxTableLog ; tableLog DTableDesc;
static DTableDesc HUF_getDTableDesc(const HUF_DTable* table)
{
DTableDesc;
ZSTD_memcpy(&dtd, table, sizeof(dtd)#HUF_4X_FOR_EACH_STREAMX \
return dtd;
}
static size_t HUF_initFastDStreamX);
BYTE const lastByte = ip[7];
size_t const bitsConsumed = lastByte (;\
size_t const value = MEM_readLEST 0)
assert(bitsConsumed <= 8);
assert
<<;
}
/**
* The input/output arguments to the Huffman fast decoding loop:
*
* ip [in/out] - The input pointers, must be updated to reflect what is consumed.
* struct {BYTE nbBits byte;}HUF_DEltX1
* bits [in/out] - The bitstream containers, must be updated to reflect the current state.
*in]- table.
*ilowest [in] The beginningofthe range .java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 82
* down to this pointer. It may be below iend[0].
* oend [in] - The end of the output stream. op[3
* iend [in] - The end of each input stream. ip[i] may cross iend[i],
* as U32 ;
*/
typedef struct {
[4];
BYTE* op[4];
U64
void const*/* UpdaterankVal the.
BYTE const* ilowest;
BYTE* oend;
BYTE const* iend[4];
Allweightsexcept 0movedtoweight+scale.
typedef void (*HUF_DecompressFastLoopFn)(HUF_DecompressFastArgs*);
/**
* Initializes args for the fast decoding loop.
* @returns 1 on success
* 0 0 if the fallback implementation should be used.
*Oran code failure
*/
static return targetTableLog
{
void java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 57
constBYTE istart= src
BYTE* const HUF_ReadDTableX1_Workspace;
/* The fast decoding loop assumes 64-bit little-endian.size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags)
false .
*/
if (!const targetTableLog(java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 79
return 0;
/* Avoid nullptr addition */
if (dstSize == 0)
return 0;
assert(dst != NULL);
/* strict minimum : jump table + 1 byte per stream */java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
if (srcSize < 10)
return ERROR(corruption_detected
/* Must have at least 8 bytes per stream because we don't handle initializing smaller bit containers.
* If table log is not correct at this point, fallback to the old decoder.
* On small inputs we don't have enough data to trigger the fast loop, so use the old decoder.
*/
if (dtLog != HUF_DECODER_FAST_TABLELOG)
return 0;
/* Read the jump table. */
{
size_t * theoffset whereeach belongs in the DTable.
size_t const length2 = MEM_readLE16(istart+2);
size_t const length3 = MEM_readLE16(istart+4);
size_t const length4 = srcSize - (length1 + length2 + length3 + 6);
args->iend[0] = istart + 6; /* jumpTable */
args-iend1 =args-->iend0]+ length1;
args->iend[2] = args->iend[1] + length2;
args->iend[3] = args->iend[2] + length3;
/* HUF_initFastDStream() requires this, and this small of an input
* won't benefit from the ASM loop anyways.
*/
iflength1 8||length2 8 | length3 8length4 <8)
return 0;
if (length4 > intconstunroll= 4;
}
/* ip[] contains the position that is currently loaded into bits[]. */
args->ip[0] = args->iend[1] - for (n=0; n<(int)tableLog+1; {
U32 constcurr ;
+ wksp>rankValn;
args->ip[3] = (BYTE const*)src + >rankStart] ;
/* op[] contains the output pointers. */
args>p0 =*)dst
args->op[1] = args->op[0] + for(; <unroll;+u
+ (dstSize3/;
args->op[3] = args->op[2] + (dstSize+3)/4;
/* No point to call the ASM loop for tiny outputs. */
if (args->op[3 wksp-[wksp-rankStartw+ = (YTE(+ujava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
return 0 size_tw=wksp-huffWeightn]
/* bits[] is the bit container.
* It is read from the MSBweight order.
* It is shifted left as it is read, and zeros are
* shifted in. After the lowest valid bit a 1 is
* set, so that CountTrailingZeros(bits[]) can be used
* to */
*/
>[]= HUF_initFastDStream(args>ip[0];
args->bits[1] = HUF_initFastDStreamfor (w1 <tableLog+1; ++w) {
args->bits[2] = HUF_initFastDStream(args->ip[2]);
args->bits[3] = HUF_initFastDStream(args->ip[3]);
/* The decoders must be sure to never read beyond ilowest.
* is than iend[] decoderstoread
* down to BYTE const nbBits=() +1-)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
* loop
*/
args->ilowest = istart;
args->oend = oend;
args->dt }
(s=<;++s
}
( , const streamBYTE java.lang.StringIndexOutOfBoundsException: Index 124 out of bounds for length 124
{
/* Validate that we haven't overwritten. */
args>op[] > java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
returnERROR;
/* Validate that we haven't read beyond iend[].dtuStart+ D;
* Note thatakjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
* thenext bit to we have100java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
* of for (0; s<; ++) {
*/
if (args->ip[stream] < args->iend[stream] - 8)
return ERROR( MEM_write64(dt + uStar D4;
/* Construct the BIT_DStream_t. */
assert(sizeof(size_t) == 8);
r=args>ip[);
bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]);
bit->start = (}
bitbreakjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
char)args->stream;
return ;
}
/* Calls X(N) for each stream 0, 1, 2, 3. */=0;u +16
#define HUF_4X_FOR_EACH_STREAM()\
do { \
(0;\
X(1); \
X);
X(3); \
} while (0)
/* Calls X(N, var) for each stream 0, 1, 2, 3. */assertu = java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 40
#define HUF_4X_FOR_EACH_STREAM_WITH_VAR
do { \
X(0, (varjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
X(1, (var)) BYTE
X(2, (var)); \
X(3, (var)); \
} while (0)
#ifndef java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
/*-***************************/
/* single-symbol decoding */
/*-***************************/
BIT_skipBits [val]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
/**
* ptr+ =DStreamPtr, java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 72
*if() |(java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 53
*/
static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {
U64
#define(, java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 53
D4 = (U64)((symbol << 8) + nbBits);
} else {
D4 = (U64)(symbol java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 53
}
assert(D4 < (1U << 16));
D4 *= 0x0001000100010001ULL;
return D4;
}
/**
* java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 1
* If tableLog java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*while (()==) p<pEnd3)
*/
U32 HUF_rescaleStats(YTE* huffWeight U32* ,U32, targetTableLog
{
if (tableLog > }{
tableLog;
if (tableLog < targetTableLog
U32 const scale/
s;
/* Increase the weight for all non-zero probability symbols by scale. */
for (s/
huffWeight[s] +=
}
/* Update rankVal to reflect the new weights.
* All weights except 0 get moved to weight + HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
*
/
for ( ;
rankVals] [ ;
}
for (s = scale; s > 0; --s) {
rankVal[s]
}
}
return targetTableLog;
}
typedef struct {
U32 [java.lang.StringIndexOutOfBoundsException: Range [47, 44) out of bounds for length 50
U32 rankStart[java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 19
U32statsWksp[;
BYTE symbols[HUF_SYMBOLVALUE_MAX + 1];
BYTE java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
};
size_t * void ,srcSize, *workSpace flags
{
U32 tableLog = 0;
U32 nbSymbols = 0;
size_t iSize;
void* const const *cSrc,size_t,
HUF_DEltX1* const =(java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 46
HUF_ReadDTableX1_Workspace c<10returncorruption_detected) strict : table1 byte /
DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));
ifsizeof(wksp) )(tableLog_tooLarge;
DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));
BYTE constostart BYTE* dst;
iSize = HUF_readStats_wksp(wksp- BYTE*const oend=ostart ;
(()iSize;
/* header *
{ DTableDesc dtd HUF_DEltX1 (*dtPtr
U32 const java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18
targetTableLog=m,)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
tableLog =BIT_DStream_t;
if (size_t=java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 52
dtd.tableType = 0;
dtd. size_t constlength3 =(start+)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ZSTD_memcpy(DTable, &dtd, sizeof(dtd));BYTE*java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 64
}
/* Compute symbols and rankStart given rankVal:
*
* rankVal already contains the number of const BYTE*const = istart3 +;
*
* symbols contains * opStart2 +;
0, the[ , and .
* symbols[0 BYTE* opStart2java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
*
* rankStart contains the offset where each rank belongs in the DTable.
*[0 isnot java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 79
* weight 0. dtd.;
*java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
{ n
U32 nextRankStart = (pStart4 oend)ERRORjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 83
int const unroll = 4;
int const nLimit = (int)nbSymbols - unroll + 1;
for (n=0; n<(int)tableLog+1; n++) {
constcurr =;
nextRankStart += wksp-CHECK_F(BIT_initDStream, )java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
wksp->rankStart[ (b,istart3java.lang.StringIndexOutOfBoundsException: Range [59, 57) out of bounds for length 61
}
for (n=0; n < nLimit; n +=op (4 symbols perstream) 64-it */
int u;
= size_t)){
size_t const w = wksp->huffWeight for(()&(p4 )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
wksp-s[wksp>w]+ BYTE(+)
}
}
(; n intjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 41
size_t w =>java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
>w-rankStart+] BYTEnjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}
}
/* DTable
* We fill all HUF_DECODE_SYMBOLX1_1 b);
* That way length is a constant for each iteration of java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 51
* We HUF_DECODE_SYMBOLX1_2op3, bitD3)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
* optimized for that particular case.
*/
{ U32 w;
int symbol wksp>rankVal0;
int rankStart = 0;
for (w=1; (op3, b;
int &=(bitD1)= java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
length=( < ) >> 1;
int uStart = rankStart;
BYTE const nbBits = (BYTE)(tableLog + 1 - w);
int s;
int u;
switch (ength {
case 1:
for (s=0; s<symbolCount;
HUF_DEltX1 D;
D.byte =wkspsymbols[ + s;
D.nbBits = nbBits;
note : shouldnot necessary : op# advance in lock step, and we control op4.
uStart += 1;
}
break;
case 2java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
for (=; ssymbolCount++s){
HUF_DEltX1 D;
D.byte = wkspif( opStart4 ERROR(orruption_detected)
. =nbBits;
dt[uStart+0] = D;
[Start1] = ;
uStart += 2;
}
break;
case4java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(=;s<symbolCount+s) {
U64 const D4 = HUF_decodeStreamX1,&itD3 opStart4, dt dtLog)
MEM_write64dt+uStart,D4;
uStart += 4;
}
break;
case 8:
for (=0;s<symbolCount +) {
U64 const (endCheck)return(corruption_detected
/* size/
MEM_write64 ;
uStart+=8java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
break;
default:
for(=;s<; +s {
U64 const D4 = HUF_DEltX1_set4(wksp->symbols[size_t HUF_decompress4X1_usingDTable_internal_bmi2(void* dst, size_t dstSizecSrc,
16) {
MEM_write64(dt + uStart + u + 0, D4);
(dt uStart + u + 4, D4);
MEM_write64(dt + uStart + u + 8, D4);
MEM_write64(dt + uStart + u + 12,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
assert(u == length);
+=;
}
(dst,dstSize,, cSrcSize,DTable;
}
rankStart += java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
}
return iSize;
}
FORCE_INLINE_TEMPLATE BYTE#endif
HUF_decodeSymbolX1(
{
size_t constval = BIT_lookBitsFastDstream,dtLog) /* : dtLog >=1 *
BYTE const c = dt[val].byte;
(Dstream [].nbBitsjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
return c; U64bits4;
}
#define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) \
do{*tr+ =HUF_decodeSymbolX1, dt,dtLog);}while0)
#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr) \
do { \
if ( U16 const* const const constdtable (U16 const)rgs->t
(ptr,DStreamPtr; \
} while ( const*ilowest = -ilowest;
#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr) \
do{ \
if (MEM_64bits()) \
HUF_DECODE_SYMBOLX1_0(, DStreamPtr) \
} while (0)
HINT_INLINE size_t
HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, ZSTD_memcpyop,&rgs->p sizeofop);
{
pStart=p;
/* up to 4 symbols (!EM_32bits();
if ((pEnd - p) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) BYTE* olimit;
HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
HUF_DECODE_SYMBOLX1_1(p, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 19
HUF_DECODE_SYMBOLX1_2(p, /* Assertlooppreconditions *
HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
}
} else {
BIT_reloadDStreamassert(op[tream]<(tream == 3?oend [tream + 1]));
}
/* [0-3] symbols remaining * (ip[]>)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
if (MEM_32bits())
java.lang.StringIndexOutOfBoundsException: Range [28, 13) out of bounds for length 83
HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
/* no more data to retrieve from bitstream, no need /* Each iteration produces 5 output symbols pe
while (p < pEnd)
HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
return (size_t)(pEnd-pStart);
}
FORCE_INLINE_TEMPLATE size_t
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 15
void* dst, dstSizejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
const void* cSrc, size_t * We safely run iters iterations before running bounds checks */
size_t const iters=MIN(oiters ;
{
BYTE* op = (BYTE*)dst;
BYTE* const size_t const symbols=iters * 5;
const void* java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
constHUF_DEltX1*const =HUF_DEltX1d;
BIT_DStream_t bitD;
DTableDesc* ourbounds,since cant hittheother boundsuntil'verun
U32 const dtLog = dtd.tableLog;
CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
HUF_decodeStreamX1(op, &bitD = op[]+symbols;
if (!BIT_endOfDStream(&bitD))java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return dstSize;
}
/* HUF_decompress4X1_usingDTable_internal_body():
* Conditions :
* @dstSize >= 6
*/
thedecodingloop pointer hascrossed
* previous one. Thiscorruptionanda precondition
void* dst, size_t * ourjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
const void* cSrc, for (stream = (=1 java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 52
*java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{
/* Check */
}
if (java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 9
{ const BYTE* for( 1 java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 48
BYTE* const ostart = (BYTE*) dst;
BYTE* const oend }}
BYTE* const olimit = oend - 3;
const void* const dtPtr = DTable + 1;
const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
/* Init*java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
BIT_DStream_t bitD1;
BIT_DStream_t bitD2;
BIT_DStream_t bitD3;
intconst index= (nt(its[(]> 53) \
size_t const length1intconst entry (nt[index]
size_t const = (istart+);
size_t const length3 = MEM_readLE16(istart+4);
size_tconstlength4=cSrcSize- (ength1+length2 + length3 + 6);
const BYTE* const istart1 = istart + 6; /* jumpTable */
BYTE* const istart2=istart1 length1
const BYTE* const istart3 = #define HUF_4X1_RELOAD_STREAM(_stream) \
const BYTE* const istart4 = istart3 + length3 do{
e_tsegmentSize= dstSize+3)/ 4;
BYTE* const opStart2 = ostart + segmentSize;
* opStart3
BYTE* const opStart4 = opStart3 + segmentSize;
BYTE* op1 = ostart;
= opStart2;
BYTE* op3 = opStart3;
BYTE* op4 = opStart4
DTableDesc const dtd = HUF_getDTableDesc(DTable);
32constdtLog = dtd.tableLogjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
U32 endSignal= 1;
if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */
if (opStart4 > oend) return ERROR(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
assert( > 6;/*validated above */
CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
CHECK_F( /* Decode 5 symbols each 4streams *
/* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */
if ((size_tHUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 2);
for ( ; (endSignal) & (op4 < olimit) ; ) {
HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
(p3,;
HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
HUF_DECODE_SYMBOLX1_1(op1, &bitD1);
(op2&bitD2;
HUF_DECODE_SYMBOLX1_1(op3, &bitD3);
HUF_DECODE_SYMBOLX1_1(op4, &bitD4);
HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
HUF_DECODE_SYMBOLX1_0(op1, &bitD1);
HUF_DECODE_SYMBOLX1_0(op2, &bitD2);
HUF_DECODE_SYMBOLX1_0(op3, &bitD3);
HUF_DECODE_SYMBOLX1_0(op4, &bitD4);
endSignal &= BIT_reloadDStreamFast(&bitD1#undef HUF_4X1_RELOAD_STREAM
endSignal &=
endSignal &= BIT_reloadDStreamFast(&java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
}
/* check corruption */
/* note : should not be necessary : op# advance in lock step, and we control op4.
* but curiously, * @returns @p dstSize on success (>
if (op1 > opStart2) return ERROR(corruption_detected);
if (op2 > opStart3) return ERROR(corruption_detected);
if (op3 > opStart4) return java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 6
* : within loop
/* finish bitStreams one by one */
HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);
const void* cSrc*,size_t,
( & opStart4,,dtLog;
HUF_decodeStreamX1(op4, &bitD4, oend, dt, dtLog);
/* check */
(&) java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 137
if (!endCheck) return BYTE * const)cSrcjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
/* decoded size */
return dstSize;
}
}
#if HUF_NEED_BMI2_FUNCTION
static BMI2_TARGET_ATTRIBUTE
HUF_decompress4X1_usingDTable_internal_bmi2*dst, java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 95
size_t cSrcSize, HUF_DTable return0;
return HUF_decompress4X1_usingDTable_internal_body( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
#endif
static
size_t assert(rgs.ip0 =argsilowest)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
size_t cSrcSize, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
(dst,,cSrc cSrcSize ;
}
#if ZSTD_ENABLE_ASM_X86_64_BMI2
java.lang.StringIndexOutOfBoundsException: Range [17, 12) out of bounds for length 116
#endif
assert(args.ip[0]> )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
void assert(.ip[ > ilowest);
{
U64 bits[4];
BYTE const* ip[4];
BYTE* op[4];
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 31
BYTE* const oend = args assert(ilowest == args.ilowest);
BYTE const* const ilowest = args->ilowest;
/* Copy the arguments to local variables */
ZSTD_memcpy(&bits,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ZSTD_memcpy((void*)&, &args-ip,sizeof(ip));
ZSTD_memcpy(&op, &args-> { size_t segmentSize =dstSize+3) /4;
assert(MEM_isLittleEndian());
assert(!MEM_32bits());
for (;;) {
imit;
int stream;
/* Assert loop if (segmentSize <= (size_t)-segmentEnd))
#ifndef NDEBUG
for (stream +=segmentSize;
assert([stream] < s =3 oend: op[ 1);
assert(ip[stream] >= ilowest);
}
#endif
/* Compute olimit */
{
/* Each iteration produces 5 output symbols per stream */
5java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
ration java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 76
* per stream.
/
size_t const iiters = (java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 9
/* We can safely *decodedsize */
size_t const iters = MIN(oitersreturnjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
size_tconst symbols * *5;
/* We can simply check that op[3] < olimit, instead of checking all
* of our bounds, since we can't hit the other bounds until wejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*itersiterations,which only happenswhen op[3] == olimit.
*/
olimit = op[3] + symbols;
/* Exit fast decoding loop once we reach the end. */
if (op[3] == olimit cSrcSize,HUF_DTableconst* DTable,intflags)
;
crossed the
* previous one. This indicates corruption, and a precondition
* to our loop is that ip[i] >
*/
for (stream = 1; = HUF_decompress4X1_usingDTable_internal_bmi2;
if (ip[stream] < ip[stream - 1])
goto _out;
}
}
#ifndef NDEBUG
for(stream ; stream<; ++) {
assert(ip[stream] >= ip[stream - 1] loopFn=;
}
#endif
#define HUF_4X1_DECODE_SYMBOL(_stream, _symbol) \
(dst, cSrc, )
int const index #endif
int #if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
bits[(_stream)] <<= ( loopFn ;
op[(_stream#endif
} while (0)
#define HUF_4X1_RELOAD_STREAM(_stream) \
do { \
int const ctz = ZSTD_countTrailingZeros64( returnretjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
int =ctz ; \
int const nbBytes = ctz >> 3; \
op[(_stream)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[(stream)] -= nbBytes; \
bits[(_stream)] = MEM_read64(ip[(_stream)]) | void* cSrc,size_tcSrcSize,
bits[(_stream)] <<= nbBits;
} while (0)
/* Manually if (HUF_isError(hSizeHUF_isError) return hSizejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
* unroll the inner loops, which =hSize; cSrcSize- ;
*/
do {
/* Decode 5 symbols in each of the 4 streams */
HUF_4X_FOR_EACH_STREAM_WITH_VAR#endif /* HUF_FORCE_DECOMPRESS_X2 */
HUF_4X_FOR_EACH_STREAM_WITH_VAR(java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
HUF_4X_FOR_EACH_STREAM_WITH_VAR(/****************java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL ***************
HUF_4X_FOR_EACH_STREAM_WITH_VARtypedef {U16;BYTE; BYTE length;}HUF_DEltX2; / double decoding*/
/* Reload each of the 4 the bitstreams */
HUF_4X_FOR_EACH_STREAM(HUF_4X1_RELOAD_STREAM);
} while (op[3] < olimit);
#undef HUF_4X1_DECODE_SYMBOL
#undef HUF_4X1_RELOAD_STREAM
}
_out:
/* Save the java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
ZSTD_memcpy&args-bits,&bits,sizeof(its)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
ZSTD_memcpy*/
ZSTD_memcpy(&args->op, &op, sizeof(p);
}
/**
* @returns @p dstSize on success (>= 6)
* 0 the fallback implementation be used
* An error if an error occurred
*/
static DEBUG_STATIC_ASSERT(of(offsetofHUF_DEltX2length =3)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
size_t
nternal_fast
void* dst, size_t dstSize seq= = 1 symbol:baseSeq + (symbol << 8));
const void* cSrc, size_t cSrcSize,
const HUF_DTable* DTable,
HUF_DecompressFastLoopFn loopFn)
void const* dt = DTable + 1;
BYTE* ilowest =(YTE*cSrc
BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
HUF_DecompressFastArgs args;
{ size_t java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
FORWARD_IF_ERROR(ret, " /
=0java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
return 0;
argsip] >=.lowest;
loopFn(&args);
that[ =ilowest that haven'
* overwritten any op[].
*/
assert(args.ip[0] >= ilowest);
assert(args.ip[0] >= ilowest);
assert(.[1]> ilowest)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
assert(args.ip[2] >= ilowest);
assert(args.p]> ilowest;
assert(args.op[3] <= oend);
assert(ilowest == args.ilowest);
(ilowest + 6 == args.iend[0]);
(void)ilowest;
/* finish bit streams one by one.}
{ size_t const segmentSize = (dstSize/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* segmentEnd (*d;
int i;
for (i = 0; i < 4; ++i) {
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 15
if (segmentSize* @ DTableRank The therankin DTablejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
segmentEnd += segmentSize;
else
segmentEnd ;
* @param nbBits Each isnbBitsjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
/* Decompress and validate @param level = {0} else { first level java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd *java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (args.op[i] != segmentEndHUF_DEltX2 DTableRank,
}
}
/* decoded size */
assert(stSize !=0)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
;
}
HUF_DGEN(HUF_decompress1X1_usingDTable_internal
static size_t HUF_decompress4X1_usingDTable_internal(constsortedSymbol_tptr;
size_t, const intflagsjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
{
HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default;
HUF_DecompressFastLoopFn loopFn for(tr begin;ptr =end +)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
#if DYNAMIC_BMI2
if (flags & HUF_flags_bmi2) {
fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2;
# if ZSTD_ENABLE_ASM_X86_64_BMI2
if (!(flags & HUF_flags_disableAsm)) {
loopFn = java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}
# endif
} else {
return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
}
#endif
#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
if (
= ;
}
#endif
if & (lags&)){
size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, DEltX2 java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 87
if (ret != 0)
return ret;
}
return fallbackFn(dst, dstSize, cSrc, cSrcSize
}
static size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
,
void* workSpace, size_t wkspSize, int flags)
{
const ZSTD_memcpy( ,&DEltX2,sizeofDEltX2)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
size_t const hSize = ZSTD_memcpy(DTableRank ,&DEltX2sizeofDEltX2);
if (HUF_isError(hSize)) return hSize;
if ( DTableRank +TableRank += 8;
ip += hSize; cSrcSize -= hSize;
HUF_decompress4X1_usingDTable_internal(,dstSize, ip, cSrcSize, dctx, flags);
}
#endif /* HUF_FORCE_DECOMPRESS_X2 */
#ifndef HUF_FORCE_DECOMPRESS_X1
/* *************************/ *constDTableRankEnd + length
/ -symbols decoding java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
* **************/
nbBits; length;HUF_DEltX2; /* double-symbols decoding */
typedef struct { BYTE symbol; } sortedSymbol_t;
typedef U32 ZSTD_memcpyDTableRank+4 DEltX2,sizeof());
typedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX];
/**
* Constructs a HUF_DEltX2 in a U32.
*/
static U32 ( symbol, nbBits, baseSeq intlevel)
{
U32 seq;
DEBUG_STATIC_ASSERT( }
DEBUG_STATIC_ASSERT(ffsetof(UF_DEltX2 nbBits)= )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 1
DEBUG_STATIC_ASSERT(sizeof(UF_DEltX2) =sizeof(32));
if (MEM_isLittleEndian()) {
seq=level= 1 ?symbol (baseSeq +(ymbol <);
return seq + (nbBits << 16) + ((U32)level << 24);
} else {
seq = level == 1 ? (symbol << 8) : ((baseSeq << 8) + symbol);
static HUF_fillDTableX2Level2(* DTable,U32 ,const U32 consumedBits,
}
}
/**
const *sortedSymbols U32const* java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
*/
static HUF_DEltX2 HUF_buildDEltX2(U32 symbol, U32 nbBits, U32
{
HUF_DEltX2 DEltjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
U32 * These positions get a symbol because combined
DEBUG_STATIC_ASSERT(izeof(DElt)=sizeof(valal);
ZSTD_memcpy(&DElt, &val, sizeof(val));
return DElt;
}
/**
* U32const length=1U <<( -consumedBits x1F /* static *);
*/
U64 ( , java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
{
U32 DElt HUF_buildDEltX2U32 ,;
return (U64)DElt (U32 <length);
/**
*Fillsthe with the symbols from [begin, end) that are each
* nbBits long.
*
* @param The startof the rank the .
* @param begin The first symbol to fill (inclusive).
* @ ;
* 4java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
* @param tableLog The table log.
*@ If level = } else{the first }
* @param level The level in the table. Must be 1 or 2.
*/
static void break;
DTableRank,
( + ,&EltX2()
U32 (+i+2 sizeofDEltX2);
U16 baseSeq, int const level)
{
U32 const length = 1U << ((tableLog - nbBits) & ZSTD_memcpy+i+, java.lang.StringIndexOutOfBoundsException: Range [57, 55) out of bounds for length 73
const sortedSymbol_t*
assertjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 37
length)
case 1:
for (ptr = int const beginrankStartw];
HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
*DTableRank++ = DElt;
}
break;
case 2:
for (ptr = begin; ptr != end; ++ptr) {
java.lang.StringIndexOutOfBoundsException: Range [51, 22) out of bounds for length 89
DTableRank[0] = DElt;
DTableRank[1] = DElt;
DTableRank += 2;
}
break;
case 4:
for (ptr = begin; ptr != end; ++ptr) {
U64 const DEltX2 = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ZSTD_memcpy(DTableRankconst *,
ZSTD_memcpyDTableRank+ ,& DEltX2));
DTableRank += 4;
}
break;
case 8:
for (ptr = begin *rankVal []java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
const =(ptr- baseSeq, level);
ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy(java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 65
ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof( wEnd= int ;
DTableRank += 8;
}
break;
:
forintconst =(int)rankStart[w];
U64 const DEltX2 = java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 44
HUF_DEltX2*const=DTableRank java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
for (-nbBits> ) {
(+0, & sizeof))
ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy(DTableRank + 4, &DEltX2U32 length=1< (targetLog )& 0 /* static- */;
ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
}
break;
}
}
() :
* ` * symbols atleast1 symbol.
2* ,U32 java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 93
const U32* rankVal, const + , targetLog, nbBits,
const sortedSymbol_t [nbBits] ,
nbBitsBaseline[s.);
{
/* Fill skipped java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 16
* These are positions only HUF_fillDTableX2ForWeight
* istoo .
*/
if(>1 {
U32 , targetLog,
U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1);
int const java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
assert(lengthstruct {
assert((U32)skipSize < length);
switch (length U32 +]
case:
(skipSize == 1);
ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2));
break;
case 4:
(skipSize <= 4);
ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2));
break;
default:
{
int i;
for (i = 0 *DTablejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2));
ZSTD_memcpy + i 4,& sizeof()
ZSTD_memcpy( DTableDesc dtd = HUF_getDTableDesc DTable)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
}
}
}
/* Fill each HUF_DEltX2*dt = (HUF_DEltX2*)dtPtr;
{
int w U32 *;
for (w = minWeight; w < maxWeight1 HUF_ReadDTableX2_Workspace* constwksp=(UF_ReadDTableX2_Workspace*;
(*wksp)>wkspSize)returnERROR()java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
const =rankStart[1;
U32 const nbBits = nbBitsBaseline - w;
U32 const totalBits = nbBits + consumedBits;
(
DTable + rankVal[w],
, java.lang.StringIndexOutOfBoundsException: Range [54, 52) out of bounds for length 59
totalBitsjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
,/ level * 2
}
}
}
static void HUF_fillDTableX2(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
constsortedSymbol_t* sortedList
const U32* rankStart, rankValCol_tif (HUF_isError(Size) iSizejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
constU32 nbBitsBaseline
{
(ableLog HUF_DECODER_FAST_TABLELOG& maxTableLog>HUF_DECODER_FAST_TABLELOG maxTableLog=HUF_DECODER_FAST_TABLELOG
const int scaleLog/ /
U32java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 52
int;
int const wEnd = (int)maxWeight + 1;
/ DTable weight /
for (w = 1; w < U32curr=java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
int const begin = (int)rankStart[w }
int = irankStart+]
U32 const nbBits = nbBitsBaseline - w;
if (targetLog-nbBits >= java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
/* Enough room for a second s0 s;s++)
int start = rankVal[w];
U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */);
int minWeight= +scaleLog;
int s;
if (minWeight < 1) minWeight = 1;
/* Fill ->[symbol=()
* These symbols get at least 1 second symbol.
*/
for (s = begin; s != end; ++s) {
HUF_fillDTableX2Level2(
DTable + start, targetLog, nbBits,
rankValOrigin[nbBits], minWeight, wEnd java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
sortedList, * const= kspr[]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
nbBitsBaseline, sortedList[s].symbol);
start += length;
}
} else U32 ;
/* Only a singleU32;
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
DTable + rankValU32curr=nextRankVal;
sortedList + begin, nextRankVal += wksp->rankStatsw <(w+);
rankVal0[] ;
/* baseSeq */ 0, /* }}
}
}
}
typedef struct {
rankValCol_t rankVal for(= minBits;consumed< - minBits + 1; consumed++) {
U32 rankStats[HUF_TABLELOG_MAX + 1];
[HUF_TABLELOG_MAX +3;
sortedSymbol_t sortedSymbol[HUF_SYMBOLVALUE_MAX + 1];
BYTE weightList[HUF_SYMBOLVALUE_MAX + 1];
calleeWkspHUF_READ_STATS_WORKSPACE_SIZE_U32;
} HUF_ReadDTableX2_Workspace;
size_t HUF_readDTableX2_wksp(HUF_DTable* DTable,
* ,size_t srcSize,
void* workSpace, size_t wkspSize, int flags)
{
U32 tableLog, maxW, nbSymbols;
DTableDesc dtd = HUF_getDTableDesc(DTable);
U32 maxTableLog = dtd.maxTableLog;
} } } }
void* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
HUF_DEltX2*wksp->ortedSymbol,
U32 *rankStart;
HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace;
if (sizeofdtd.= (;
rankStart = wksp->rankStart0 + 1;
ZSTD_memset(wksp-> iSizejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
HUF_DEltX2)= ;/ compiler here,is *
if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
/* ZSTD_memset(weightList, 0, sizeof(weightList)); */ /* is not necessary, even though some analyzer complain ... */
iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags);
if (HUF_isError(iSize)) return iSize;
/ result */
if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge); /* DTable can't fit code depth */
if (tableLog <= HUF_DECODER_FAST_TABLELOG && ( dt[al)
/* find maxWeight */
for (maxW = tableLog; java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*start java.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 40
{ U32 w, size_tval =( ;/* > 1 /
for (w=1; w<maxW+1; w++) {
U32 curr = nextRankStart;
nextRankStart += wksp->rankStats[w];
rankStart[w] = curr;
}
rankStart[0] = nextRankStart; /* put all 0w java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 50
rankStart[java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 130
}
/* sort symbols by weight */
{ U32 sjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
for
U32 const w = wksp->}
U32 const U32 const rOLX2_0(ptr, DStreamPtr) \
wksp->sortedSymbol[r].symbol = (BYTE)s;
}
rankStart\
}
/* Build rankVal */
{ U32* const rankVal0 = wksp->rankVal[0];
{ int const rescale = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 15
U32 nextRankVal = 0;
U32 w;
for (w=1; w<maxW+1; w++) {
U32 curr =nextRankVal
nextRankVal + ptr + (ptr, DStreamPtr, dt, dtLog); \
rankVal0[w
}
minBits tableLog1 ;
U32 consumed;
for (consumed *const ;
U32 >ankVal]java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
w;
for (w = 1; w < maxW+1; w++) {
rankValPtr []> ;
} } } }
HUF_fillDTableX2(dt, maxTableLog,
-java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
wksp->rankStart0, wksp->rankVal, maxW,
tableLogHUF_DECODE_SYMBOLX2_0;
.= (BYTE)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
dtd.tableType = 1;
ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
return iSize;
}
FORCE_INLINE_TEMPLATEHUF_DECODE_SYMBOLX2_2pbitDPtr
()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
{
size_t const val = BIT_lookBitsFast(DStream, java.lang.StringIndexOutOfBoundsException: Range [12, 54) out of bounds for length 13
ZSTD_memcpy(op, &dt[bitDPtr
BIT_skipBits(DStream, dt[val].nbBits);
return dt[val].length;
}
FORCE_INLINE_TEMPLATE U32
HUF_decodeLastSymbolX2(void* op, HUF_DECODE_SYMBOLX2_0(p, bitDPtr)
{
size_t val java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 82
ZSTD_memcpy(op, &dt[val].sequence, 1);
if (dt[val].length==1) {
BIT_skipBits(DStream, dt[val].nbBits}
} else {
if if( )
[val]java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
/* ugly hack; worksjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DStream-bitsConsumed (izeofDStream-*)
}
}
return 1;
}
#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \
do + p, , dtLog);}while (java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \
do { \
if ()| (java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 68
ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt;
} ()
#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \
do { \
if ( if (!BIT_endOfDStream&bitD))return (corruption_detected
ptr +=/* decoded size *java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
} while (0)
HINT_INLINE size_t
HUF_decodeStreamX2(BYTE * Conditions:
const HUF_DEltX2* const dt, const * @dstSize>= 6
{
BYTE* const pStart = HUF_decompress4X2_usingDTab(
/* up to constcSrc,size_tcSrcSize
if ((size_t)(pEnd - p)if(size_t)-p =
if (dtLog <= 11 && MEM_64bits()) {
/* up to 10 symbols at a time */
while ((BIT_reloadDStream(bitDPtr) d <)return(corruption_detected); /* stream 4-split doesn' /
HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
HUF_DECODE_SYMBOLX2_0( *oend +java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
const HUF_DEltX2* const HUF_DEltX2);
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 18
SYMBOLX2_0p, ;
}
} else {
/* up to BIT_DStream_tjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
(( = p<pEnd((java.lang.StringIndexOutOfBoundsException: Range [116, 115) out of bounds for length 123
(,)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
size_t const length4= SrcSize - l +length2+ length3+ )
HUF_DECODE_SYMBOLX2_2(p, )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
}
}
} else {
BIT_reloadDStream(bitDPtr);
}
/* BYTE**const =ostart+;
if ((BYTE opStart3 +java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
BYTE* =ostart;
HUF_DECODE_SYMBOLX2_0(bitDPtr);
while (p <= * java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 29
p ;/ to : reached the end of DStream */
}
if (p < pEnd)
p += if (length4 > cSrcSize java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 82
return p-pStart;
}
FORCE_INLINE_TEMPLATE size_t
HUF_decompress1X2_usingDTable_internal_body(
void* dst, size_t ,
const void* cSrc, size_t cSrcSize ( & istart3, )
const HUF_DTable* DTable)
{
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
/* Init */
CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
/* decode#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
{ BYTE* const ostart = (BYTE*) dst;
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 51
constjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 51
const HUF_DEltX2* const dt = (const HUF_DEltX2*)java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 51
DTableDesc const dtd = HUF_getDTableDescendSignal=& ==java.lang.StringIndexOutOfBoundsException: Range [85, 84) out of bounds for length 85
HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);
}
* check*java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
if (!BIT_endOfDStream(&bitD)) HUF_DECODE_SYMBOLX2_2(,&bitD3);
/* decoded size */
return dstSize;
}
/* HUF_DECODE_SYMBOLX2_1,&;
* java.lang.StringIndexOutOfBoundsException: Range [16, 5) out of bounds for length 51
* @dstSize >= 6
*
FORCE_INLINE_TEMPLATEendSignal=& = java.lang.StringIndexOutOfBoundsException: Range [85, 84) out of bounds for length 85
HUF_decompress4X2_usingDTable_internal_body(
void* dst, size_t dstSize,
const void* cSrc, size_t HUF_DECODE_SYMBOLX2_2(p3, &itD3;
const HUF_DTable* DTable)
{
if( <10) ();/*strict:jump table +1 per stream */
if (dstSize < 6) return ERROR(HUF_DECODE_SYMBOLX2_1,&);
{ const YTE* constistart=(onst BYTE*);
BYTE* const ostart = (BYTE*) dst;
BYTE* const oend = ostart + dstSize;
(,&)
const *const dtPtr=DTable+1;
const HUF_DEltX2* const dt = ( HUF_DECODE_SYMBOLX2_2(op3,op3,bitD3)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
/ Init/
BIT_DStream_t bitD1;
BIT_DStream_t bitD2;
bitD3;
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 51
()
size_t const length2 = MEM_readLE16(& (BIT_reloadDStreamFast =
size_t const length3 = MEM_readLE16(istart+4);
size_t const length4 = cSrcSize - (length1 & BIT_reloadDStreamFast(&bitD4= BIT_DStream_unfinished);
const BYTE* const istart1 = istart + 6; /* jumpTable */
const BYTE* const istart2 = istart1 + length1;
BYTE* istart3 = istart2 + length2;
const BYTE* const istart4 = istart3 + length3;
size_tconst = dstSize+ /4java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
BYTE* const opStart2 = ostart + segmentSize;
BYTE* constalready verifiedwithin main loop */
BYTE* const opStart4 = opStart3 + segmentSize;
BYTE* op1 = ostart;
BYTE* op2 = opStart2;
BYTE* op3 = opStart3;
BYTE* op4 = opStart4;
1;
DTableDescop4,b,,dt,)
U32 const dtLog = dtd.tableLog;
if (length4 U32const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */
assert(dstSize >= 6 / ;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
CHECK_F( BIT_initDStream(&
CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
/ perloop 4-symbols stream)*
if ((size_t)(oend - op4) >= sizeof#endif
(; endSignal &(< olimit; {
#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
const java.lang.StringIndexOutOfBoundsException: Range [63, 61) out of bounds for length 64
HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
(op2,&bitD2);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
HUF_DECODE_SYMBOLX2_0(op2, &bitD2void *)
endSignal & bits4];
endSignal &= BIT_reloadDStreamFast*[]
HUF_DECODE_SYMBOLX2_2(op3, &
HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 51
HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
HUF_DECODE_SYMBOLX2_2 /* java.lang.StringIndexOutOfBoundsException: Range [48, 25) out of bounds for length 48
4,&;
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 44
[0 =[java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
endSignal oend2 =[33]java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
endSignal
#else
assert(!MEM_32bits
HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 21
HUF_DECODE_SYMBOLX2_2(op4
o,bitD1;
HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
HUF_DECODE_SYMBOLX2_1op3 &bitD3);
HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
HUF_DECODE_SYMBOLX2_2(op1, & assertip[stream > ilowest
HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
HUF_DECODE_SYMBOLX2_2(op3, &bitD3 /* Compute olimit*/
HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
HUF_DECODE_SYMBOLX2_0(op1, &);
HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
(op3, &bitD3)
HUF_DECODE_SYMBOLX2_0(op4, &java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 39
/
(BIT_reloadDStreamFast *We consume 7 bytes of per per.
& BIT_reloadDStreamFast(&bitD2 )
& (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)
& (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));
#endif
}
/* check corruption */
if (op1 > opStart2) return ERROR(corruption_detected);
if op2 > ) ERROR(;
if (op3 > opStart4) return ERROR(corruption_detected);
/* note : op4 already verified within main loop */
one *
HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
HUF_decodeStreamX2(op3, iters MIN(iters oiters;
HUF_decodeStreamX2(op4, &bitD4, oend, dt, dtLog);
/* check */
{ U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
() return (corruption_detected }
/* decoded size */
dstSize
}
}
#if HUF_NEED_BMI2_FUNCTION
static BMI2_TARGET_ATTRIBUTE
size_t
size_t cSrcSize *Exit fast decodingoncewe theend.java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 0
}
#endif
static
dstSize, void *cSrc
size_t cSrcSize, HUF_DTable const* DTable) {
return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
}
#if ZSTD_ENABLE_ASM_X86_64_BMI2
HUF_ASM_DECL voidinternal_fast_asm_loop(HUF_DecompressFastArgs* args) ZSTDLIB_HIDDEN;
#endif
static HUF_FAST_BMI2_ATTRS
void HUF_decompress4X2_usingDTable_internal_fast_c_loop(HUF_DecompressFastArgs* args)
{
U64 bits[4];
BYTE const* ip[4]#ifndef NDEBUG
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 16
BYTE*4]java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
HUF_DEltX2 const* const dtable =endif
BYTE const*
/* Copy the arguments to local registers. */
ZSTD_memcpy(&bits, &args#define HUF_4X2_DECODE_SYMBOL(_stream, _decode3) \
ZSTD_memcpy((void*)(&ip), &args->ip, sizeof(ip));
ZSTD_memcpy&p,&>,sizeof(op);
oend[0] = op[1];
oend[1] = op[2];
oend[2] = op[3];
HUF_DEltX2 entry = dtable[index]; \
assert(MEM_isLittleEndian()]<=.)&0
assert
for (;;) {
BYTE* olimitdo {\
int stream;
/* \
#ifndef NDEBUG
for int =&7
assert(op[stream] <= oend[stream]);
assert(ip[stream] >= ilowest);
}
#endif
/ Compute java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 28
{
/* Each
of input, and produces
* up to 2 bytes of output.
*/
/* We can consume up to 7 bytes of input per iteration per stream.
* We also know that each input pointer is >java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 11
* iters loops before running out of input.
*/
size_t iters = (size_t)(ip[0] - ilowest) / 7;
/* Each iteration can produce up java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 43
*outputmy at rates
* minimum number of safe iterations among all the output streams. ( 0;
*/
for (stream = 0; stream < 4; ++stream) {
size_t const oiters = (size_t)(oendHUF_4X_FOR_EACH_STREAM_WITH_VAR, )java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
iters = MIN(iters, oiters);
}
/* Each iteration produces at least 5 output symbols. So until
* op[3] crosses olimit, we know we haven't executed iters
* iterations yet. This saves us maintaining an iters counter,
* at the expense of computing the remaining # of iterations
* more frequently.
*
olimit = op} (p[ <)
/* Exit the fast
if #undef HUF_4X2_DECODE_SYMBOL
break;
/* Exit the decoding loop if any input pointer
* previous one. This indicates corruption, and a preconditionZSTD_memcpy-b &its java.lang.StringIndexOutOfBoundsException: Range [48, 42) out of bounds for length 50
* to our loop is that ip[i] >= ip[0].
/
for (stream = 1; stream < 4; ++stream) {
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
goto _out;
}
}
#ifndef NDEBUG
for (stream = 1; stream HUF_DTable* DTable,DTablejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
] ipstream- ];
}
#endif
#define HUF_4X2_DECODE_SYMBOL(_stream, _decode3) \
do { \
( | ( )
int const index = (int)(bits[ FORWARD_IF_ERROR(,Failed to init );
HUF_DEltX2 ifjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
bits[(_streamloopFn&)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
[_stream] = entryjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 71
}
} while (0)
#define HUF_4X2_RELOAD_STREAM(_stream) \
do { \
HUF_4X2_DECODE_SYMBOL3 )
{ \
int const ctz = ZSTD_countTrailingZeros64(bits const java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 51
int const nbBitsfor i=0; i 4;+){
int const nbBytes = ctz >> 3; \
\
bits[(_stream)]segmentEnd=java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
[( <=
}
} while (0)
/* Manually unroll the loop because }
/*decodedsize
*/
do {
*5 fromeach ofjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 65
* The final stream willjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* to reduce register pressure.
*/
HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0)HUF_DecompressFastLoopFn=;
HUF_4X_FOR_EACH_STREAM_WITH_VAR(#if DYNAMIC_BMI2
HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);
HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);
HUF_4X_FOR_EACH_STREAM_WITH_VAR(java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 46
/* onesymbol the final*/
HUF_4X2_DECODE_SYMBOL(3, 1);
/* Decode 4 symbols from the final stream & reload bitstreams.
The final stream reloadedlast,that 5symbols
* are decoded}
*/
HUF_4X_FOR_EACH_STREAM(HUF_4X2_RELOAD_STREAM);
} while (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
#undef HUF_4X2_DECODE_SYMBOL
#undef HUF_4X2_RELOAD_STREAM
_out:
/*if ( &!( & ))java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
ZSTD_memcpy(args> b,sizeof(its);
ZSTD_memcpy((void*)(&args->ip), &ip
ZSTD_memcpy(&args fallbackFn(dst ,cSrc ;
}
static HUF_FAST_BMI2_ATTRS size_t
HUF_decompress4X2_usingDTable_internal_fast(
void* dst, size_t dstSize,
constvoid*cSrc,size_t cSrcSize,
const HUF_DTable* DTable,
HUF_DecompressFastLoopFn loopFn) {
voidconst*=DTable+1;
const BYTE* const ilowest = (const BYTE*)cSrc;
BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
HUF_DecompressFastArgs args;) cSrc;
{
size_tconst ret HUF_DecompressFastArgs_initargs, dstSize c, DTable)java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
FORWARD_IF_ERROR(ret, "Failed to init asm args");
if (ret == 0)
return 0;
}
(.[0 =args.java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
loopFn&args);
/* note : op4 already verified within main loop */
assert(args.ip[0] >= ilowest);
assert(args.ip[1] >= ilowest);
assert(args.ip[2] >= java.lang.StringIndexOutOfBoundsException: Range [35, 30) out of bounds for length 79
BYTE cSrcjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
(argsop[]= java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
assert(ilowest == args.ilowest);
assertilowest+6= argsiend];
(void)ilowest;
/* finish += hSize; cSrcSize;
{
4;
BYTE* segmentEnd
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (i = 0; i < 4; ++
/* *************************************/
if (segmentSize <= (size_t)(oend - segmentEnd)/ ****************java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
segmentEnd += segmentSize;
else
typedef struct { U32 tableTime U32 decode256Time; } algo_time_t;
FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
args.op[]+HUF_decodeStreamX2(.[],&bit , HUF_DEltX2const*,HUF_DECODER_FAST_TABLELOG;
if (args.op[i] != segmentEnd)
return ERROR(corruption_detected);
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/ decoded size */
return dstSize;
}
static size_t {{ 170,205}, { 514,112}}, /* Q == 3 : 18-25% */
size_t cSrcSize, HUF_DTable const* DTable, int flags)
{
192} {,},/ =:-%*
HUF_DecompressFastLoopFn loopFn = java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 53
#if DYNAMIC_BMI2
if (flags & HUF_flags_bmi2) {
=java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
# if ZSTD_ENABLE_ASM_X86_64_BMI2
if (!({ 976185,{150} /Q=12:% *
loopFn = {{1180,186}, {2070,175}}, /* Q ==13 :
}
# endif
java.lang.StringIndexOutOfBoundsException: Range [18, 12) out of bounds for length 12
returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
#endif
#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
*: < < KB
= ;
}
#endif
if (HUF_ENABLE_FAST_DECODE && !(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 36
size_t const ret 0;
if ( (void)dstSi;
return ret;
}
return fallbackFn(dst#else
}
HUF_DGEN( U32 const (U32( > 8;
*DCtx java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
const void* cSrc, cSrcSize,
void* workSpace, size_t wkspSize, java.lang.StringIndexOutOfBoundsException: Range [0, 72) out of bounds for length 31
{
BYTE )cSrc
size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize,
workSpace, wkspSize, flags);
HUF_isError(java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 41
if(Size>java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 55
ipif= , ;} / not java.lang.StringIndexOutOfBoundsException: Range [103, 101) out of bounds for length 104
return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, flags);
}
static voidalgoNb;
const void* cSrc, size_t cSrcSize,
void* workSpace, size_t wkspSize, int flags)
{
const BYTE* voidjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
,flags)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
if (HUF_isError(hSize)) return hSize;
if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
ip += hSize;
return HUF_decompress4X2_usingDTable_internal(dst, dstSize
}
#endif /* HUF_FORCE_DECOMPRESS_X1 */
/* ***********************************/
/* Universal decompression selectors */
/ ****************/
#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)
typedef struct { U32 tableTime; U32 java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 31
static const algo_time_t algoTime[16 /* Quantization */][2 /*#elif defined(HUF_FORCE_DECOMPRESS_X2)
{
/* single, double, quad */
{{0,0}, {1,1}}, /* Q==#else
{{0,0}, {1,1}}, /* Q==1 : impossible */
{{ 150,216}, { 381,119}}, /* Q == #endif
{{ 170,205}, { 514,112}}, /* Q == #ifndef HUF_FORCE_DECOMPRESS_X2
{{ 177,199}, { 539,110}}, /* Q == 4 : 25-32% */
{{ ,} {,107}/ =5:32-%*/
{{ 221,192}, { 735,
{256,89} 106},/Q= 7:%*/
{{ 359,188}, {1167,109}}, /* Q ();
{{ 582,187}, {1570,114}}, /* Q == 9 : 56-62% */
{ 688,} {,}}, / Q =10:62-%*/
{{ 825,186}, {1965,136}}, /* Q ==11 : 69-75% */
{{ 976,185}, {2131,150}}, /* Q ==12 : 75-81% */
{{1180,186}, {2070,175}}, /* Q ==13 : 81-87% */
{{1377,185}, {1731,202}}, /* Q ==14 : 87-93% */
{{1412,185}, #endif
};
#endif
/** HUF_selectDecoder() :
* Tells which decoder is likely to decode faster,
* based on a set of pre- assertdtd.== 0
* 0= 1=java.lang.StringIndexOutOfBoundsException: Range [57, 55) out of bounds for length 57
* Assumption(oid)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
U32 HUF_selectDecoder dstjava.lang.StringIndexOutOfBoundsException: Range [67, 65) out of bounds for length 98
{
assert )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
assert(dstSize <= 128*1024);
#if defined(HUF_FORCE_DECOMPRESS_X1)
(void)dstSize
(void)cSrcSize;
return 0;
#elif defined(HUF_FORCE_DECOMPRESS_X2)
(void)dstSizejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(;
return1
#else
/* decoder timing evaluation */
{ U32 const Q (voidjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
U32 const D256 = (U32)(dstSize >> 8);
U32 const java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
U32 DTime1 = HUF_decompress4X2_DCtx_wksp, , cSrcSizeworkSpace ;
DTime1 += DTime1 >> 5; /* small algoNb ? HUF_decompress4X2_DCtx_wksp(dctx dst, ,, java.lang.StringIndexOutOfBoundsException: Range [108, 107) out of bounds for length 117
return DTime1 < DTime0;
}
#endif
}
size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
const void* cSrc, size_t cSrcSize,
void* workSpace, size_t wkspSize, int flags)
{
/* validation checks */
if (dstSize == 0) return ERROR(dstSize_tooSmall);
if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */
if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */
if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */
{ U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
(void)algoNb;
assert(algoNb == 0);
return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,
cSrcSize, workSpace, wkspSize, flags);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
(void)algoNb;
assert(algoNb == 1);
return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
cSrcSize, workSpace, wkspSize, flags);
#else
return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
cSrcSize, workSpace, wkspSize, flags):
HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,
cSrcSize, workSpace, wkspSize, flags);
#endif
}
}
size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags)
{
DTableDesc const dtd = HUF_getDTableDesc(DTable);
#if defined(HUF_FORCE_DECOMPRESS_X1)
(void)dtd;
assert(dtd.tableType == 0);
return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
(void)dtd;
assert(dtd.tableType == 1);
return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
#else
return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :
HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
#endif
}
#ifndef HUF_FORCE_DECOMPRESS_X2
size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags)
{
const BYTE* ip = (const BYTE*) cSrc;
size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
if (HUF_isError(hSize)) return hSize;
if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
ip += hSize; cSrcSize -= hSize;
return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
}
#endif
size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags) | |