43        std::vector<uint32_t>& symbolCountRef = 
m_symbolCount[aContext];
 
   45        if( cumulativeCountRef.empty() || cumulativeCountRef.size() <= aSymbol )
 
   47            std::vector<uint32_t> newCumulativeCount( aSymbol + 
m_arraySizeIncr, 0 );
 
   50            if( cumulativeCountRef.empty() )
 
   52                cumulativeCountRef = newCumulativeCount;
 
   53                cumulativeCountRef[0] = 1;
 
   55                symbolCountRef = newSymbolCount;
 
   56                symbolCountRef[0] = 1;
 
   60                std::copy( cumulativeCountRef.begin(), cumulativeCountRef.end(),
 
   61                            newCumulativeCount.begin() );
 
   62                std::copy( symbolCountRef.begin(), symbolCountRef.end(),
 
   63                            newSymbolCount.begin() );
 
   64                cumulativeCountRef = newCumulativeCount;
 
   65                symbolCountRef = newSymbolCount;
 
   71            size_t len = cumulativeCountRef.size();
 
   72            uint32_t    tempAccum = 0;
 
   73            for( 
int i = (int32_t)len - 1; i >= 0; i-- )
 
   75                symbolCountRef[i] >>= 1;
 
   76                tempAccum += symbolCountRef[i];
 
   77                cumulativeCountRef[i] = tempAccum;
 
   80            cumulativeCountRef[0]++;
 
   83        symbolCountRef[aSymbol]++;
 
   84        for( uint32_t i = 0; i <= aSymbol; i++ )
 
   86            cumulativeCountRef[i]++;
 
 
uint32_t GetSymbolFrequency(uint32_t aContext, uint32_t aSymbol)
Get the number of occurrences of the given symbol in the context.
 
const uint32_t m_arraySizeIncr
the ammount to increase the size of an array when reallocating an array.
 
uint32_t GetSymbolFromFrequency(uint32_t aContext, uint32_t symbolFrequency)
Find the symbol in a histogram that has the specified cumulative frequency.
 
uint32_t GetTotalSymbolFrequency(uint32_t aContext)
Get the total occurrences of all the symbols in this context.
 
std::vector< std::vector< std::uint32_t > > m_cumulativeCount
 
uint32_t GetCumulativeSymbolFrequency(uint32_t aContext, uint32_t aSymbol)
Get the total number of occurrences for all symbols less than the given symbol in the context.
 
std::vector< std::vector< std::uint32_t > > m_symbolCount
 
void AddSymbol(uint32_t aContext, uint32_t aSymbol)
Add an occurrence of the symbol to the specified context.
 
const uint32_t m_maximumSymbolInHistogram
the maximum value that is stored in a histogram
 
const uint32_t m_elephant
Elephant determines the number of symbol occurences that are stored in each histogram.