Lines Matching defs:weights
189 /// Initialize a Huffman decoding table using the table of weights provided
190 /// Weights follow the definition provided in the Zstandard specification
192 const u8 *const weights,
235 /// Decompress two interleaved bitstreams (e.g. compressed Huffman weights)
698 static void fse_decode_hufweights(ostream_t *weights, istream_t *const in,
872 // "This is a single byte value (0-255), which describes how to decode the list of weights."
875 u8 weights[HUF_MAX_SYMBS];
876 memset(weights, 0, sizeof(weights));
893 // weights to a byte with the first weight taking the top four bits
895 // operations could be used to read the weights: Weight[0] =
898 weights[i] = weight_src[i / 2] >> 4;
900 weights[i] = weight_src[i / 2] & 0xf;
904 // The weights are FSE encoded, decode them before we can construct the
907 ostream_t weight_stream = IO_make_ostream(weights, HUF_MAX_SYMBS);
911 // Construct the table using the decoded weights
912 HUF_init_dtable_usingweights(dtable, weights, num_symbs);
915 static void fse_decode_hufweights(ostream_t *weights, istream_t *const in,
923 // weights, maximum accuracy is 7 bits."
926 // Decode the weights
927 *num_symbs = FSE_decompress_interleaved2(&dtable, weights, in);
1964 const u8 *const weights,
1975 // Weights are in the same range as bit count
1976 if (weights[i] > HUF_MAX_BITS) {
1979 weight_sum += weights[i] > 0 ? (u64)1 << (weights[i] - 1) : 0;
1985 // If the left over isn't a power of 2, the weights are invalid
1996 bits[i] = weights[i] > 0 ? (max_bits + 1 - weights[i]) : 0;
2296 // Initialize the decoding table using the determined weights