Class RANSDecodingSymbol
java.lang.Object
htsjdk.samtools.cram.compression.rans.RANSDecodingSymbol
Holds the start and frequency for a single symbol in the rANS decoding table.
The reverse-lookup table mapping cumulative frequency to symbol is held separately
in the decoder's
reverseLookup arrays.
Decoding a symbol is a two-step process:
advanceSymbolStep(long, int)— updates the rANS state using the symbol's rangeUtils.RANSDecodeRenormalizeNx16(long, byte[], int[])orUtils.RANSDecodeRenormalize4x8(long, byte[], int[])— renormalizes by reading bytes from the compressed stream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongadvanceSymbolStep(long r, int scaleBits) Advance the rANS state by one decoded symbol.voidset(int start, int freq) Set the decoding parameters for this symbol.
-
Constructor Details
-
RANSDecodingSymbol
public RANSDecodingSymbol()
-
-
Method Details
-
set
public void set(int start, int freq) Set the decoding parameters for this symbol.- Parameters:
start- the cumulative frequency of all preceding symbolsfreq- the frequency of this symbol
-
advanceSymbolStep
public long advanceSymbolStep(long r, int scaleBits) Advance the rANS state by one decoded symbol. Does not renormalize — the caller must call the appropriateUtils.RANSDecodeRenormalize*method after this.- Parameters:
r- the current rANS statescaleBits- the frequency scale (log2 of total frequency sum)- Returns:
- the updated rANS state (before renormalization)
-