for ppmonstr its kinda like this:
Code:
// c = input byte
sum = total;
for( i=0; i<N; i++ ) {
p = rank[i].freq*SCALE/sum;
flag = (c==rank[i].symbol);
rc.Encode( flag, SSE(p) );
if( flag ) break;
sum -= rank[i].freq;
}
if( flag==0 ) // process the lower order
My opinion is that
1. CM is a model which explicitly mixes predictions from different contexts -
implicit mixing like escapes + masking doesn't count (and gives different results anyway).
2. PPM is a model which tries to encode a symbol in one context, then goes to next context if it failed.
3. SR is kinda like PPM, but doesn't keep symbol statistics per each context.