(bit uint)
| 16 | func (m *Shift) NBits() uint { return 1 } |
| 17 | |
| 18 | func (m *Shift) adapt(bit uint) { |
| 19 | switch bit { |
| 20 | case 1: |
| 21 | m.P += (MaxP - m.P) >> m.I |
| 22 | case 0: |
| 23 | m.P -= m.P >> m.I |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func (m *Shift) Encode(enc *Encoder, bit uint) { |
| 28 | enc.Encode(bit, m.P) |