# Sample-Based Gradient Edge and Angular Prediction for VVC Lossless Intra-Coding
## 2 Related Works  
In terms of the performance optimization of lossless coding, scholars in the field of video coding have conducted a series of studies. [PERSON] et al. [7; 8] proposed a Differential Pulse Code Modulation (DPCM) method within the framework of the AVC standard. Firstly, conventional horizontal or vertical predictions were performed on the current Prediction Unit (PU). Then, the residual samples were subtracted from adjacent residual samples to obtain secondary residual samples. This method was also known as Residual DPCM (RDPCM). In RDPCM coding, all samples within the current PU share the same prediction mode. References [9; 10] proposed enhanced sample-based intra-prediction, which allows for selecting different prediction modes for each sample within the current PU. The HEVC standard continued to use the RDPCM method to improve the performance of lossless intra-coding by reprocessing residual samples [11; 12]. [PERSON] et al. [13] proposed cross-residual prediction (CRP), using DPCM for residual samples in both horizontal and vertical directions. References [14; 15] utilized gradient information between adjacent reference samples of the current sample to improve the prediction accuracy of RDPCM. In the VVC standard, RDPCM served as a trigger for developing BDPCM coding tools [16]. [PERSON] et al. [17] extended DPCM to all angular intra-prediction modes and proposed a sample-based angular intra-prediction (SAP) method. SAP-Horizontal and Vertical (SAP-HV) [18] applied SAP only in the horizontal and vertical directions. SAP1 [19] adopted an equidistant prediction method for all angular prediction modes in SAP. In the case of short prediction distances, the equidistant prediction method is more suitable. On the basis of using adjacent reference samples for prediction, [PERSON] et al. [20; 21; 22] introduced median  
Figure 2: The main framework of sample-based lossless intra-coding. edge detection (MED) [23] as the planar mode to enhance the prediction ability of the intra-prediction module for edge regions. References [24; 25] analyzed the gradient information between adjacent reference samples to judge the edges around the current sample. [PERSON] et al. [26; 27] proposed a Sample-based Weighted Prediction (SWP) method with Directional Template Matching (DTM), which weighted the surrounding reference samples to predict the current sample. [PERSON] et al. [28] proposed a Sample-based Edge and Angle Prediction (SEAP) method for lossless intra-coding of screen content. [PERSON] et al. [29] proposed an L-shape-based Iterative Prediction (LIP) method and a Residual Median Edge Detection (RMED) method. LIP divided the current coding unit (CU) into adjacent one-dimensional sub-regions and allowed each sub-region to possess a separate prediction mode. RMED applied MED on residual blocks to remove edge spatial redundancy between residual samples. Considering that the energy of residual values in lossless coding is relatively dispersed, some studies transformed residual samples to concentrate the energy of residual values. During the coding process, distortion should not be introduced. [PERSON] et al. [30] designed reversible transforms for residual samples of different prediction modes. These transforms would not affect the quality of reconstructed videos. [PERSON] et al. [31] performed transform and quantization in lossless coding. On the encoder side, quantized residual values and quantization error information were encoded together. On the decoder side, quantization error information was utilized to eliminate video distortion. [PERSON] [32] proposed an integer-to-integer discrete sine transform, which performed a transform on residual samples without distortion and without increasing the dynamic range of values. The above methods of transforming residual samples can improve the performance of lossless coding to some extent, but the performance gain is relatively limited. In addition, there are different complex types of regions in the image.