TER.TERdecoder.BPEDecoder
Class ACEntropyDecoder

java.lang.Object
  extended by TER.TERdecoder.BPEDecoder.ACEntropyDecoder

public class ACEntropyDecoder
extends java.lang.Object


Field Summary
(package private)  int channel
           
(package private)  int[] codeIdLength
          Definition in EncodeGaggleAC.codeIdLength
(package private)  int[] currentLayer
           
(package private)  ReadBufferedStream[] encodedStream
           
(package private)  int entropyAC
          Definition in EncodeGaggleAC.entropyAC
(package private)  int gaggle
           
(package private)  int generation
           
(package private)  int[] ids
          Definition in EncodeGaggleAC.ids
(package private)  int[] noCodeId
          Definition in EncodeGaggleAC.noCodeId
(package private)  byte[][][][][] packetStream
           
(package private)  boolean parametersSet
          To know if parameters are set.
(package private)  int segment
           
 
Constructor Summary
ACEntropyDecoder(byte[][][][][] packetStream)
           
 
Method Summary
private  boolean getBit()
          Gets a bit from the encoded bit stream
 int getBits(int length)
          private int getBits(int length) throws Exception{ return encodedStream[generation].getBits(length); }
private  int getFourLengthSymbol()
          Decodes the symbols with length 4
 ReadBufferedStream getLayerParents()
           
 byte getRecommededContext(int stage, int length, boolean impossiblePattern)
          Definition in CodeBlockAC.getRecommededContext(int, int, boolean)
private  int getThreeLengthSymbol()
          Decodes the symbols with length 3
private  int getTwoLengthSymbol()
          Decodes the symbols with length 2
 int getWord(int generation, int stage, int length, boolean impossiblePattern)
          Decodes a word according with the parameters given by the user
 boolean moreBitPlanes(int generation, int bitplane, int[] BP)
           
 void resetIDs()
           
 void setParameters(int channel, int segment, int gaggle, int resolutionLevels, int entropyAC)
           
private  int unMapSymbol(int symbol, byte context)
          Map symbols to words
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encodedStream

ReadBufferedStream[] encodedStream

packetStream

byte[][][][][] packetStream

currentLayer

int[] currentLayer

entropyAC

int entropyAC
Definition in EncodeGaggleAC.entropyAC


parametersSet

boolean parametersSet
To know if parameters are set.

True indicates that they are set otherwise false.


ids

int[] ids
Definition in EncodeGaggleAC.ids


noCodeId

int[] noCodeId
Definition in EncodeGaggleAC.noCodeId


codeIdLength

int[] codeIdLength
Definition in EncodeGaggleAC.codeIdLength


generation

int generation

channel

int channel

segment

int segment

gaggle

int gaggle
Constructor Detail

ACEntropyDecoder

public ACEntropyDecoder(byte[][][][][] packetStream)
Method Detail

setParameters

public void setParameters(int channel,
                          int segment,
                          int gaggle,
                          int resolutionLevels,
                          int entropyAC)
                   throws java.lang.Exception
Throws:
java.lang.Exception

resetIDs

public void resetIDs()

getWord

public int getWord(int generation,
                   int stage,
                   int length,
                   boolean impossiblePattern)
            throws java.lang.Exception
Decodes a word according with the parameters given by the user

Parameters:
stage - indicates if the word corresponds to the significance encoding, the sign encoding or the refinement.
  • 0- significance
  • 1- sign
  • 2- refinement
length - indicates the length of the word to be decoded
impossiblePattern - indicates whether all zeros is a possible pattern
Returns:
an integer that represented the decoded word
Throws:
java.lang.Exception - when something goes wrong (tipically reaching the end of the bit stream) and decoding process must be stoped

getTwoLengthSymbol

private int getTwoLengthSymbol()
                        throws java.lang.Exception
Decodes the symbols with length 2

Returns:
an integer representing the decoded symbol
Throws:
java.lang.Exception - when the bit stream is finished before decoding the symbol

getThreeLengthSymbol

private int getThreeLengthSymbol()
                          throws java.lang.Exception
Decodes the symbols with length 3

Returns:
an integer representing the decoded symbol
Throws:
java.lang.Exception - when the bit stream is finished before decoding the symbol

getFourLengthSymbol

private int getFourLengthSymbol()
                         throws java.lang.Exception
Decodes the symbols with length 4

Returns:
an integer representing the decoded symbol
Throws:
java.lang.Exception - when the bit stream is finished before decoding the symbol

getRecommededContext

public byte getRecommededContext(int stage,
                                 int length,
                                 boolean impossiblePattern)
Definition in CodeBlockAC.getRecommededContext(int, int, boolean)


unMapSymbol

private int unMapSymbol(int symbol,
                        byte context)
Map symbols to words

Parameters:
symbol - indicates the symbol to be mapped
context - indicates the kind of word to be decoded, i.e. the lenght and the encoding pass
Returns:
an integer that represents the decoded word

getBit

private boolean getBit()
                throws java.lang.Exception
Gets a bit from the encoded bit stream

Returns:
a bit
Throws:
java.lang.Exception - when is not possible get a bit from the bit stream

getBits

public int getBits(int length)
            throws java.lang.Exception
private int getBits(int length) throws Exception{ return encodedStream[generation].getBits(length); }

Throws:
java.lang.Exception

moreBitPlanes

public boolean moreBitPlanes(int generation,
                             int bitplane,
                             int[] BP)

getLayerParents

public ReadBufferedStream getLayerParents()


TER - Copyright (C) 2006
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) - UAB (Spain)