def METHOD_NAME(self, cum_freq, sym_freq):
    r = self.range >> 10
    self.low += r * cum_freq
    if (self.low >> 24) != 0:
        self.carry = 1
    self.low &= 0xffffff
    self.range = r * sym_freq
    while self.range < 0x10000:
        self.range <<= 8;
        self.ac_shift()