Added bitmask options for encode and associative option for decode