A method and apparatus for storing bitplanes of coefficients in a reduced
size memory is disclosed. In one embodiment, a method for encoding
coefficients comprises applying one or more wavelet transforms to
generate multiple coefficients and storing N bitplanes of each of the
multiple coefficients in a first memory having multiple rows. Each of the
multiple coefficients has a bit length greater than N bits, and each
storage location in each of the rows stores a bit of either a more
significant bitplane of the coefficients or a less significant bitplane
of the coefficients. The storing of N bitplanes includes storing an
indication for each row of the rows to indicate a location in each row at
which bits of more significant bitplanes have started to be stored and
after which bits of the multiple coefficients of the less significant
bitplanes are no longer stored.