Class Bzip2MTFAndRLE2StageEncoder
- java.lang.Object
-
- io.netty.handler.codec.compression.Bzip2MTFAndRLE2StageEncoder
-
final class Bzip2MTFAndRLE2StageEncoder extends java.lang.ObjectAn encoder for the Bzip2 Move To Front Transform and Run-Length Encoding[2] stages.
Although conceptually these two stages are separate, it is computationally efficient to perform them in one pass.
-
-
Field Summary
Fields Modifier and Type Field Description private intalphabetSizeThe encoded alphabet size.private int[]bwtBlockThe Burrows-Wheeler transformed block.private intbwtLengthActual length of the data in thebwtBlockarray.private boolean[]bwtValuesPresentAt each position,trueif the byte value with that index is present within the block, otherwisefalse.private char[]mtfBlockThe output of the Move To Front Transform and Run-Length Encoding[2] stages.private intmtfLengthThe actual number of values contained in themtfBlockarray.private int[]mtfSymbolFrequenciesThe global frequencies of values within themtfBlockarray.
-
Constructor Summary
Constructors Constructor Description Bzip2MTFAndRLE2StageEncoder(int[] bwtBlock, int bwtLength, boolean[] bwtValuesPresent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidencode()Performs the Move To Front transform and Run Length Encoding[1] stages.(package private) intmtfAlphabetSize()(package private) char[]mtfBlock()(package private) intmtfLength()(package private) int[]mtfSymbolFrequencies()
-
-
-
Field Detail
-
bwtBlock
private final int[] bwtBlock
The Burrows-Wheeler transformed block.
-
bwtLength
private final int bwtLength
Actual length of the data in thebwtBlockarray.
-
bwtValuesPresent
private final boolean[] bwtValuesPresent
At each position,trueif the byte value with that index is present within the block, otherwisefalse.
-
mtfBlock
private final char[] mtfBlock
The output of the Move To Front Transform and Run-Length Encoding[2] stages.
-
mtfLength
private int mtfLength
The actual number of values contained in themtfBlockarray.
-
mtfSymbolFrequencies
private final int[] mtfSymbolFrequencies
The global frequencies of values within themtfBlockarray.
-
alphabetSize
private int alphabetSize
The encoded alphabet size.
-
-
Constructor Detail
-
Bzip2MTFAndRLE2StageEncoder
Bzip2MTFAndRLE2StageEncoder(int[] bwtBlock, int bwtLength, boolean[] bwtValuesPresent)- Parameters:
bwtBlock- The Burrows Wheeler Transformed block databwtLength- The actual length of the BWT databwtValuesPresent- The values that are present within the BWT data. For each index,trueif that value is present within the data, otherwisefalse
-
-
Method Detail
-
encode
void encode()
Performs the Move To Front transform and Run Length Encoding[1] stages.
-
mtfBlock
char[] mtfBlock()
- Returns:
- The encoded MTF block
-
mtfLength
int mtfLength()
- Returns:
- The actual length of the MTF block
-
mtfAlphabetSize
int mtfAlphabetSize()
- Returns:
- The size of the MTF block's alphabet
-
mtfSymbolFrequencies
int[] mtfSymbolFrequencies()
- Returns:
- The frequencies of the MTF block's symbols
-
-