Methods and apparatus for transforming data into a format which may be efficiently
stored in a non-volatile memory are disclosed. According to one aspect of the present
invention, a method for storing information of a first data format in a memory
system includes generating statistics associated with the first data format, and
transforming the information from the first data format to a second data format
using the statistics. Once the information is transformed into the second data
format, the information is stored into a memory. Storing the information in the
second data format in the memory includes storing an identifier that identifies
a transformation used to transform the information to the second data format. In
one embodiment, costs associated with storing the information in the second data
format are less than or equal to costs associated with storing the information
in the first data format.