# Survey on Data Hiding Based on Block Truncation Coding
## 2 Absolute Moment Block Truncation Coding  
BTC is a lossy compression method for grayscale images that divides the original image into blocks and then uses quantization to reduce the number of grayscale levels using the mean and standard deviation. This method can also be applied to video compression. BTC was first proposed by [PERSON] and [PERSON] [21]. Another variation of BTC is Absolute Moment Block Truncation Coding, or AMBTC, in which, instead of using standard deviations, absolute moments are preserved with the mean. AMBTC is simpler to calculate than BTC and usually has a lower mean squared error. AMBTC was proposed by [PERSON] and [PERSON] [23]. For \(k^{2}\) pixels per block, it is compressed at a ratio of \((k^{2}\times 8):(k^{2}+2\times 8)\) when a pixel is 8 bits, where 2 denotes two quantization levels. Increasing the block size improves the compression rate, while the quality of the image allowed is bad. A block of AMBTC is composed of two quantization levels and a bitmap for each block after compression. The distortion of AMBTC is the difference between the compressed pixels and the original pixels, but the difference is not high. If the block size is \(4\times 4\), the compression ratio (CR) (=original image size/compressed image size) is 4, so the bitrate of the block is 2 bits per pixel. The merit of it is simple computation and fast image compression. In AMBTC, a grayscale image is divided into non-overlapping(\(k\times k\))-sized blocks, where \(k\) will be \((4\times 4)\), \((8\times 8)\), and so on. For each block, the mean pixel value \(\bar{x}\) is computed by  
\[\bar{x}=\frac{1}{k\times k}\sum_{i=1}^{k^{2}}x_{i} \tag{1}\]  
where \(x_{i}\) is the value of the \(i\)th pixel of the block of size \(k\times k\). Every pixel in the block is quantized into the bitmap \(b_{i}\) (0 or 1). That is, if the corresponding pixel \(x_{i}\) is greater than or equal to the mean (\(\bar{x}\)), it will be replaced with '1', otherwise '0'. The pixels in each block are divided into two groups: '1' and '0'. The symbols \(t\) and \(k^{2}-t\) represent the number of pixels of '1' and the number of pixels of '0', respectively. The two quantization levels are calculated by Equation (2). \[\mu_{1}=\left\lfloor\frac{1}{t}\sum_{x_{i}\geq\bar{x}}x_{i}\right\rfloor\text {and }\mu_{0}=\left\lfloor\frac{1}{(k\times k)-t}\sum_{x_{i}<x}x_{i}\right\rfloor, \tag{2}\]  
where \(\mu_{0}\) and \(\mu_{1}\) are also used to reconstruct AMBTC, and \(\mu_{0}\) and \(\mu_{1}\) denote the quantization levels. \(\lfloor\cdot\rfloor\) is the floor function that takes real number \(x\) and gives as output the greatest integer less than or equal to \(x\). For example, it is used like \(\lfloor x\rfloor\). \(\mu_{1}\) and \(\mu_{0}\) are, respectively, the higher and lower means. Each pixel in a bitmap is created by using the original pixels and the mean of a block. That is, if each pixel is larger than the mean, it is assigned to '1' and otherwise, '0' (see Equation (3)). \[b_{i}= \begin{cases}1,\ \ \text{if }x_{i}\geq\bar{x},\\ 0,\ \ \text{if }x_{i}<\bar{x}.\end{cases}  \tag{3}\]  
The basic unit of compression is trio (\(\mu_{0}\), \(\mu_{1}\), \(BM\)), and is composed of two quantization levels \(\mu_{0}\), \(\mu_{1}\) and a bitmap (BM). To reconstruct the image, decoding is performed using Equation (4). \[g_{i}= \begin{cases}\mu_{0},\ \ \text{if }b_{i}=0,\\ \mu_{1},\ \ \text{if }b_{i}=1.\end{cases}  \tag{4}\]  
Finally, a block of the image is compressed into two quantization levels (\(\mu_{0}\), \(\mu_{1}\)) and a bitmap \(BM\), i.e., trio (\(\mu_{0}\), \(\mu_{1}\), \(BM\)). A bitmap \(BM\) contains the bit-planes that represent the pixels, and the values \(\mu_{0}\) and \(\mu_{1}\) are used to decode the AMBTC compressed image. For the case \(k=4\), e.g., we deal with an image by \((4\times 4)\) block-wise operation. Sixteen pixels in a block are represented as a trio (\(\mu_{0}\), \(\mu_{1}\), \(BM\)) of \(8+8+16=32\) bits, and thus the CR is (\(16\times 8\))/\(32=4\). Consider the example of a \(512\times 512\)-pixel image.