freerds: reduce memory allocation for bitmap encoding