public class PktDecoder extends Object implements StdEntropyCoderOptions
| Modifier and Type | Field and Description | 
|---|---|
| private PktHeaderBitReader | binThe wrapper to read bits for the packet heads | 
| private Vector[] | cblksList of code-blocks found in last read packet head (one list
 per subband) | 
| private int | cQuitThe component in which the ncb quit condition was reached | 
| private DecoderSpecs | decSpecReference to decoder specifications | 
| private RandomAccessIO | ehsReference to the stream where to read from | 
| private boolean | ephUsedWhether or not EPH marker are used | 
| private HeaderDecoder | hdReference to the HeaderDecoder | 
| private int | INIT_LBLOCKInitial value of the state variable associated with code-block
 length. | 
| private boolean | isTruncModeTrue if truncation mode is used. | 
| private int[][][][][] | lblockLblock value used to read code size information in each packet head:
 
  1st dim: component index.
  2nd dim: resolution level index.
  3rd dim: subband index.
  4th/5th dim: code-block index (vert. | 
| private int | maxCBMaximum number of codeblocks to read before ncb quit condition is
 reached | 
| private int | ncThe number of components | 
| private int | ncbNumber of codeblocks encountered. | 
| private boolean | ncbQuitFlag indicating whether ncb quit condition has been reached | 
| private int | nlNumber of layers in t he current tile | 
| private Point[][] | numPrecMaximum number of precincts :
 
  1st dim: component index.
  2nd dim: resolution level index.
  | 
| private int | pktIdxIndex of the current packet in the tile. | 
| private boolean | pphFlag indicating whether packed packet header was used for this tile | 
| private ByteArrayInputStream | pphbaisThe packed packet header if it was used | 
| private PrecInfo[][][] | ppinfoArray containing the coordinates, width, height, indexes, ... | 
| private int | rQuitThe resolution in which the ncb quit condition was reached | 
| private boolean | sopUsedWhether or not SOP marker segment are used | 
| private int | sQuitThe subband in which the ncb quit condition was reached | 
| private BitstreamReaderAgent | srcReference to the codestream reader agent | 
| private int | tIdxIndex of the current tile | 
| private int | tQuitThe tile in which the ncb quit condition was reached | 
| private TagTreeDecoder[][][][] | ttInclTag tree used to read inclusion informations in packet's head:
    
  1st dim: component index.
  2nd dim: resolution level index.
  3rd dim: precinct index. 
  4th dim: subband index. | 
| private TagTreeDecoder[][][][] | ttMaxBPTag tree used to read bit-depth information in packet's head:
 
 
  1st dim: component index.
  2nd dim: resolution level index.
  3rd dim: precinct index.
  4th dim: subband index.
  | 
| private int | xQuitThe x position of the last code block before ncb quit reached | 
| private int | yQuitThe y position of the last code block before ncb quit reached | 
FIRST_BYPASS_PASS_IDX, MAX_CB_AREA, MAX_CB_DIM, MIN_CB_DIM, NUM_EMPTY_PASSES_IN_MS_BP, NUM_NON_BYPASS_MS_BP, NUM_PASSES, OPT_BYPASS, OPT_PRED_TERM, OPT_RESET_MQ, OPT_SEG_SYMBOLS, OPT_TERM_PASS, OPT_VERT_STR_CAUSAL, STRIPE_HEIGHT| Constructor and Description | 
|---|
| PktDecoder(DecoderSpecs decSpec,
          HeaderDecoder hd,
          RandomAccessIO ehs,
          BitstreamReaderAgent src,
          boolean isTruncMode,
          int maxCB)Creates an empty PktDecoder object associated with given decoder
 specifications and HeaderDecoder. | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | fillPrecInfo(int c,
            int r,
            int mdl)Retrives precincts and code-blocks coordinates in the given resolution,
 level and component. | 
| int | getNumPrecinct(int c,
              int r)Gets the number of precincts in a given component and resolution level. | 
| int | getPPX(int t,
      int c,
      int r)Returns the precinct partition width for the specified component,
 resolution level and tile. | 
| int | getPPY(int t,
      int c,
      int rl)Returns the precinct partition height for the specified component,
 resolution level and tile. | 
| PrecInfo | getPrecInfo(int c,
           int r,
           int p)Get PrecInfo instance of the specified resolution level, component and
 precinct. | 
| void | readEPHMarker(PktHeaderBitReader bin)Try to read an EPH marker. | 
| boolean | readPktBody(int l,
           int r,
           int c,
           int p,
           CBlkInfo[][][] cbI,
           int[] nb)Reads specificied packet body in order to find offset of each
 code-block's piece of codeword. | 
| boolean | readPktHead(int l,
           int r,
           int c,
           int p,
           CBlkInfo[][][] cbI,
           int[] nb)Read specified packet head and found length of each code-block's piece
 of codewords as well as number of skipped most significant bit-planes. | 
| boolean | readSOPMarker(int[] nBytes,
             int p,
             int c,
             int r)Try to read a SOP marker and check that its sequence number if not out
 of sequence. | 
| CBlkInfo[][][][][] | restart(int nc,
       int[] mdl,
       int nl,
       CBlkInfo[][][][][] cbI,
       boolean pph,
       ByteArrayInputStream pphbais)Re-initialize the PktDecoder instance at the beginning of a new tile. | 
private BitstreamReaderAgent src
private boolean pph
private ByteArrayInputStream pphbais
private DecoderSpecs decSpec
private HeaderDecoder hd
private final int INIT_LBLOCK
private PktHeaderBitReader bin
private RandomAccessIO ehs
private Point[][] numPrec
private int tIdx
private PrecInfo[][][] ppinfo
private int[][][][][] lblock
private TagTreeDecoder[][][][] ttIncl
private TagTreeDecoder[][][][] ttMaxBP
private int nl
private int nc
private boolean sopUsed
private boolean ephUsed
private int pktIdx
private Vector[] cblks
private int ncb
private int maxCB
private boolean ncbQuit
private int tQuit
private int cQuit
private int sQuit
private int rQuit
private int xQuit
private int yQuit
private boolean isTruncMode
public PktDecoder(DecoderSpecs decSpec, HeaderDecoder hd, RandomAccessIO ehs, BitstreamReaderAgent src, boolean isTruncMode, int maxCB)
decSpec - The decoder specifications.hd - The HeaderDecoder instance.ehs - The stream where to read data from.src - The bit stream reader agent.isTruncMode - Whether or not truncation mode is required.maxCB - The maximum number of code-blocks to read before ncbquitpublic CBlkInfo[][][][][] restart(int nc, int[] mdl, int nl, CBlkInfo[][][][][] cbI, boolean pph, ByteArrayInputStream pphbais)
nc - The number of components in this tilemdl - The maximum number of decomposition level in each component
 of this tilenl - The number of layers in  this tilecbI - The code-blocks arraypph - Flag indicating whether packed packet headers was usedpphbais - Stream containing the packed packet headersprivate void fillPrecInfo(int c,
                          int r,
                          int mdl)
c - Component index.r - Resolution level index.mdl - Number of decomposition level in component c.public int getNumPrecinct(int c,
                          int r)
c - Component indexr - Resolution indexpublic boolean readPktHead(int l,
                           int r,
                           int c,
                           int p,
                           CBlkInfo[][][] cbI,
                           int[] nb)
                    throws IOException
l - layer indexr - Resolution level indexc - Component indexp - Precinct indexcbI - CBlkInfo array of relevant component and resolution
 level.nb - The number of bytes to read in each tile before reaching
 output rate (used by truncation mode)IOExceptionpublic boolean readPktBody(int l,
                           int r,
                           int c,
                           int p,
                           CBlkInfo[][][] cbI,
                           int[] nb)
                    throws IOException
l - layer indexr - Resolution level indexc - Component indexp - Precinct indexcbI - CBlkInfo array of relevant component and resolution
 level.nb - The remainding number of bytes to read from the bit stream in
 each tile before reaching the decoding rate (in truncation mode)IOExceptionpublic final int getPPX(int t,
                        int c,
                        int r)
t - the tile indexc - The index of the component (between 0 and C-1)r - The resolution level, from 0 to L.public final int getPPY(int t,
                        int c,
                        int rl)
t - the tile indexc - The index of the component (between 0 and C-1)rl - The resolution level, from 0 to L.public boolean readSOPMarker(int[] nBytes,
                             int p,
                             int c,
                             int r)
                      throws IOException
nBytes - The number of bytes left to read from each tilep - Precinct indexr - Resolution level indexc - Component indexIOExceptionpublic void readEPHMarker(PktHeaderBitReader bin) throws IOException
bin - The packet header reader to read the EPH marker fromIOExceptionpublic PrecInfo getPrecInfo(int c, int r, int p)
c - Component index.r - Resolution level index.p - Precinct index.Copyright © 2017 Open Microscopy Environment