MAM API
(developer's version)

Class AdaptiveModel

java.lang.Object
  extended by AdaptiveModel
All Implemented Interfaces:
ArithmeticModel

public class AdaptiveModel
extends Object
implements ArithmeticModel

Regular adaptive arithmetic coding model.


Field Summary
(package private)  byte[] chars
           
(package private)  int[] counts
           
(package private)  int currentIndex
           
(package private)  boolean indexOk
           
 
Constructor Summary
AdaptiveModel()
           
 
Method Summary
 int countToSymbol(int cum)
          Return the symbol with the cumulative count
 long highInterval(int symbol)
          Returns the high interval cumulative count of a symbol
 long lowInterval(int symbol)
          Returns the low interval cumulative count of a symbol
private  long previousCount()
          Gets cumulative symbol count of the sybol with the previous index (probabitily other than 0 or for the first symbol) in encoding.
private  void rescaleCounts()
           
 void reset()
          State reset to the initial values
private  int symbolToIndex(int symbol)
           
 long totalCount()
          Returns the total count.
 void updateModel(int symbol)
          Informs the model with last seen symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counts

int[] counts

chars

byte[] chars

currentIndex

int currentIndex

indexOk

boolean indexOk
Constructor Detail

AdaptiveModel

public AdaptiveModel()
Method Detail

lowInterval

public long lowInterval(int symbol)
Description copied from interface: ArithmeticModel
Returns the low interval cumulative count of a symbol

Specified by:
lowInterval in interface ArithmeticModel

previousCount

private long previousCount()
Gets cumulative symbol count of the sybol with the previous index (probabitily other than 0 or for the first symbol) in encoding.


highInterval

public long highInterval(int symbol)
Description copied from interface: ArithmeticModel
Returns the high interval cumulative count of a symbol

Specified by:
highInterval in interface ArithmeticModel

totalCount

public long totalCount()
Description copied from interface: ArithmeticModel
Returns the total count.

Specified by:
totalCount in interface ArithmeticModel

updateModel

public void updateModel(int symbol)
Description copied from interface: ArithmeticModel
Informs the model with last seen symbol. Model and its frequency counts are updated accordingly

Specified by:
updateModel in interface ArithmeticModel

rescaleCounts

private void rescaleCounts()

symbolToIndex

private int symbolToIndex(int symbol)

countToSymbol

public int countToSymbol(int cum)
Description copied from interface: ArithmeticModel
Return the symbol with the cumulative count

Specified by:
countToSymbol in interface ArithmeticModel

reset

public void reset()
Description copied from interface: ArithmeticModel
State reset to the initial values

Specified by:
reset in interface ArithmeticModel

MAM API
(developer's version)

Copyright © 2007 Aija Niissalo, Marko Laakso, Markus Heinonen.