A method of processing an image includes selecting, for each of a
plurality of picture element values in at least a portion of the image,
one among a plurality of offset values. For each of the plurality of
picture element values, an index value is obtained based on (A) the
selected offset value and (B) a portion of the picture element value. For
each of the plurality of picture element values, an entry is retrieved
from a lookup table according to the corresponding index value.