In http://mattmahoney.net/dc/dce.html#Section_32 Matt Mahoney states:
The simplest of these is the order 0 coder fpaq0.
in http://mattmahoney.net/dc/dce.html#Section_41 he states:
An order 0 model uses no context.
but in http://mattmahoney.net/dc/fpaq0.cpp the Predictor (model) is defined with a context:
class Predictor {
int cxt; // Context: last 0-8 bits with a leading 1
int ct[512][2]; // 0 and 1 counts in context cxt
public:
Predictor(): cxt(1) {
memset(ct, 0, sizeof(ct));
}
// Assume a stationary order 0 stream of 9-bit symbols
int p() const {
return 4096*(ct[cxt][1]+1)/(ct[cxt][0]+ct[cxt][1]+2);
}
void update(int y) {
if (++ct[cxt][y] > 65534) {
ct[cxt][0] >>= 1;
ct[cxt][1] >>= 1;
}
if ((cxt+=cxt+y) >= 512)
cxt=1;
}
};
Why is that?