EncodeInt
not ratedEncodes val in the integer bf at position bit_num.
Uses DecodeInt and IntExp.
Uses DecodeInt and IntExp.
function EncodeInt takes integer bf, integer bit_num, boolean val returns integer
if DecodeInt(bf, bit_num) != val then
if val then
return bf + IntExp(2, bit_num)
else
return bf - IntExp(2, bit_num)
endif
endif
return bf
endfunctionNo comments.