## 3 The Proposed Method
### AMED Prediction and Recoding  
#### 3.1.1 Block-Level Pixel Prediction  
To enhance the embedding capacity by leveraging pixel correlation, we employ direct pixel prediction on plaintext images. Initially, the carrier image \(\mathbf{I}\) with dimensions \(M\times N\) is partitioned into pixel blocks of size \(B\times B\), where \(B\geq 3\), resulting in \(BM\times BN\) blocks. The block sizes \(BM\) and \(BN\) are determined by the following equation:  
\[\left\{\begin{array}{l}BM{=}M\div B\\ BN{=}N\div B\end{array}\right. \tag{5}\]  
To predict all pixels after block segmentation, we extend the pixel blocks as follows, so that edge pixels of the blocks also have reference pixels:  
1. When the pixel block contains the image pixel \(x(1,1)\), the block is not expanded.
2. When the pixel block does not contain the image pixel \(x(1,1)\) but contains the pixel \(x(1,j_{0})\) with \(j_{0}>1\), we add a column of random pixels to the left side of the pixel block, expanding it to a pixel block of size \(B\times(B+1)\).
3. When the pixel block does not contain the image pixel \(x(1,1)\) but contains the pixel \(x(i_{0},1)\) with \(i_{0}>1\), we add a row of random pixels on top of the pixel block, expanding it to a pixel block of size \((B+1)\times B\).
4. Other cases: We add a column and a row of random pixels to the left and above the remaining pixel block, respectively, expanding it to a pixel block of size \((B+1)\times(B+1)\).  
The target pixel \(x(i,j)\) in the \(z\)-th pixel chunk is predicted using the AMED predictor to obtain the predicted value \(px(i,j)\), as shown in Equation (6). Initially, the adaptive parameters \(p_{1}\), \(p_{2}\), and \(p_{3}\) are determined, with their experimental values set to \(p_{1}=0\), \(p_{2}=0\), and \(p_{3}=0\). These adaptive parameters remain constant when predicting pixels within the same pixel chunk.  
\[px(i,j)=\left\{\begin{array}{l}\max(x(i-1,j),x(i,j-1))+p_{1}\\ \min(x(i-1,j),x(i,j-1))+p_{2}\\ x(i-1,j)+x(i,j-1)-x(i-1,j-1)+p_{3}\end{array}\right.,\,ifx(i-1,j-1)\leq\min(x(i -1,j),x(i,j-1)) \tag{6}\]  
Figure 3: Algorithm framework diagram.  
The pixel value \(x(i,j)\) is converted into an eight-bit binary string:  
\[x^{k}(i,j)=\left\lfloor\frac{\text{mod}\left(x(i,j),2^{9-k}\right)}{2^{8-k}} \right\rfloor,k=1,2,\cdots,8 \tag{7}\]  
Here, \(x_{k}(i,j)\) represents the value in the \(k\)-th bit plane, progressing from the highest bit, with \(x_{k}(i,j)\in 0,1\). Similarly, transforming the predicted pixel value yields \(px_{k}(i,j)\), where \(k=1\), \(2\),..., \(8\). We compare \(x_{k}(i,j)\) to \(px_{k}(i,j)\) bit by bit, starting from the most significant bit (MSB), to determine the number of consecutive identical bits and assign this as the label value \(w(i,j)\) until a discrepancy is detected. The label value \(w(i,j)\) ranges from 0 to 8, inclusive, where \(w(i,j)=0\) indicates \(x_{k}(i,j)\
eq px_{k}(i,j)\), \(w(i,j)=8\) indicates \(x(i,j)=px(i,j)\). For instance, considering the target pixel \(x(i,j)=162\) and the predicted value \(px(i,j)=167\). Comparing them reveals that the first five bits are identical, while the sixth bit differs, leading to a labeled value of \(w\) equal to 5. This process is illustrated in Figure 4:  
AMED prediction is applied to all pixels within the pixel block, excluding those in the initial row and column, resulting in a total of \((B-1)^{2}\) tagged values and forming the tag map for the pixel block.