  A technique of lossless compression via substring enumeration (CSE) attains
compression ratios as well as popular lossless compressors for one-dimensional
(1D) sources. The CSE utilizes a probabilistic model built from the circular
string of an input source for encoding the source.The CSE is applicable to
two-dimensional (2D) sources such as images by dealing with a line of pixels of
2D source as a symbol of an extended alphabet. At the initial step of the CSE
encoding process, we need to output the number of occurrences of all symbols of
the extended alphabet, so that the time complexity increase exponentially when
the size of source becomes large. To reduce the time complexity, we propose a
new CSE which can encode a 2D source in block-by-block instead of line-by-line.
The proposed CSE utilizes the flat torus of an input 2D source as a
probabilistic model for encoding the source instead of the circular string of
the source. Moreover, we analyze the limit of the average codeword length of
the proposed CSE for general sources.
