Decoding method, encoding method, device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510543284.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2026-10-27
AI Technical Summary
[0030]由以上技术方案可见,本申请实施例中,通过对于CU中任一PU,确定该PU的预测类型,在依据该PU的预测类型确定该PU采用IBC预测模式的情况下,可以确定该PU的BV,并依据该PU的BV,在搜索区域中获取该PU的匹配块,进而,依据该PU的匹配块对该PU进行重建,通过采用更细颗粒度的IBC预测,提高了IBC预测性能,进而,可以提高编解码性能。
Smart Images

Figure CN122994499A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of encoding and decoding technology, and in particular to a decoding method, encoding method, apparatus, electronic device and storage medium. Background Technology
[0002] Intra-Block Copy Prediction (IBC) searches for matching blocks in the reconstructed region of the current frame to remove spatial non-local redundancy. IBC generally includes two processes: motion estimation and motion compensation. Motion estimation involves the encoder searching for matching blocks based on the current block and transmitting a BV (Block Vector) or BVD (Block Vector Difference) in the bitstream, representing the relative displacement between the current block and its matching block. Motion compensation generates a predicted block based on the matching block. Summary of the Invention
[0003] In view of the above, this application provides a decoding method, an encoding method, an apparatus, an electronic device, and a storage medium.
[0004] Specifically, this application is implemented through the following technical solution:
[0005] According to a first aspect of the embodiments of this application, a decoding method is provided, comprising:
[0006] For any prediction unit (PU) in the current coding unit (CU), determine the prediction type of that PU;
[0007] If the prediction type of the PU determines that the PU adopts the intra-block copy prediction (IBC) prediction mode, then the block vector (BV) of the PU is determined.
[0008] Based on the BV of the PU, obtain the matching block of the PU in the search area;
[0009] The PU is reconstructed based on its matching block.
[0010] According to a second aspect of the embodiments of this application, an encoding method is provided, comprising:
[0011] For any prediction unit (PU) in the current coding unit (CU), determine the prediction type of that PU;
[0012] If the prediction type of the PU determines that the PU adopts the intra-block copy prediction (IBC) prediction mode, then search for matching blocks of the PU in the search area.
[0013] Based on the matching block of the PU, determine the BV of the PU, and encode the BV of the PU; and,
[0014] The PU is reconstructed based on its matching block.
[0015] According to a third aspect of the embodiments of this application, a decoding apparatus is provided, comprising:
[0016] The first determining unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU).
[0017] The second determining unit is used to determine the block vector (BV) of the PU when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU.
[0018] The acquisition unit is used to acquire the matching block of the PU in the search area based on the BV of the PU;
[0019] The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
[0020] According to a fourth aspect of the embodiments of this application, an encoding apparatus is provided, comprising:
[0021] The determination unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU).
[0022] The search unit is used to search for matching blocks of the PU in the search area when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU.
[0023] An encoding unit is configured to determine the BV of the PU based on the matching block of the PU, and to encode the BV of the PU; and,
[0024] The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
[0025] According to a fifth aspect of the embodiments of this application, a decoding end device is provided, the decoding end device comprising: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor;
[0026] The processor is used to execute machine-executable instructions to implement the decoding method provided in the first aspect.
[0027] According to a sixth aspect of the embodiments of this application, an encoding end device is provided, the encoding end device comprising: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor;
[0028] The processor is used to execute machine-executable instructions to implement the encoding method provided in the second aspect.
[0029] According to a seventh aspect of the embodiments of this application, a machine-readable storage medium is provided, wherein a plurality of computer instructions are stored on the machine-readable storage medium, and when the computer instructions are executed by a processor, they implement the decoding method provided in the first aspect, or, when the computer instructions are executed by a processor, they implement the encoding method provided in the second aspect.
[0030] As can be seen from the above technical solutions, in the embodiments of this application, by determining the prediction type of any PU in the CU, and determining that the PU adopts the IBC prediction mode based on the prediction type of the PU, the BV of the PU can be determined, and the matching block of the PU can be obtained in the search area based on the BV of the PU. Then, the PU is reconstructed based on the matching block of the PU. By adopting a finer-grained IBC prediction, the IBC prediction performance is improved, thereby improving the encoding and decoding performance. Attached Figure Description
[0031] Figure 1 This is an exemplary block diagram illustrating a video decoding system according to an exemplary embodiment of this application;
[0032] Figure 2 This is an exemplary block diagram illustrating a video encoder according to an exemplary embodiment of this application;
[0033] Figure 3 This is an exemplary block diagram illustrating a video decoder according to an exemplary embodiment of this application;
[0034] Figure 4 This is a flowchart illustrating a decoding method according to an exemplary embodiment of this application;
[0035] Figure 5A This is a schematic diagram illustrating a row-by-row reconstruction of PUs according to an exemplary embodiment of this application;
[0036] Figure 5B This is a schematic diagram illustrating a per-PU column reconstruction according to an exemplary embodiment of this application;
[0037] Figure 6A This is a schematic diagram illustrating a first BV prediction mode according to an exemplary embodiment of this application;
[0038] Figure 6B This is a schematic diagram illustrating a second BV prediction mode according to an exemplary embodiment of this application;
[0039] Figure 6C This is a schematic diagram illustrating a third BV prediction mode according to an exemplary embodiment of this application;
[0040] Figure 6D This is a schematic diagram illustrating a fourth BV prediction mode according to an exemplary embodiment of this application;
[0041] Figure 7 This is a schematic diagram illustrating a search area according to an exemplary embodiment of this application;
[0042] Figure 8A This is a schematic diagram of the hardware structure of a decoding device according to an exemplary embodiment of this application;
[0043] Figure 8B This is a schematic diagram of the hardware structure of an encoding end device shown in an exemplary embodiment of this application. Detailed Implementation
[0044] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, a brief introduction to the relevant technologies is given below.
[0045] Figure 1 An exemplary block diagram of a video decoding system provided in this application. Figure 1 As shown, the video decoding system includes an encoding end 10 and a decoding end 20. The encoding end 10 generates encoded video data. Therefore, the encoding end 10 can be referred to as a video encoding device. The decoding end 20 can decode the encoded video data generated by the encoding end 10.
[0046] Decoder 20 may receive encoded video data from encoder 10 via link 30. Link 30 may include one or more media or devices capable of moving encoded video data from encoder 10 to decoder 20.
[0047] In one instance, link 30 may include one or more communication media that enable encoding end 10 to transmit encoded video data directly to decoding end 20 in real time.
[0048] In another example, encoded data can be output from output interface 140 to storage device 40. Similarly, encoded data can be accessed from storage device 40 via input interface 240.
[0049] In another example, storage device 40 may correspond to a file server or another intermediate storage device capable of holding the encoded video generated by encoding end 10. Decoding end 20 may access the stored video data from storage device 40 via streaming or downloading. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to decoding end 20. Decoding end 20 may access the encoded video data via any standard data connection (including Internet connection). The transmission of encoded video data from storage device 40 may be streaming, downloading, or a combination of both.
[0050] exist Figure 1In one example, encoding end 10 includes video source 120, video encoder 100, and output interface 140. In some examples, output interface 140 may include a modem / demodulator and / or transmitter. Video source 120 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video feed interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of these sources of video data.
[0051] The video encoder 100 encodes video data from the video source 120. In some instances, the encoder 10 transmits the encoded video data directly to the decoder 20 via the output interface 140. In other instances, the encoded video data may also be stored on the storage device 40 for later access by the decoder 20 for decoding and / or playback.
[0052] exist Figure 1 In one example, the decoding end 20 includes an input interface 240, a video decoder 200, and a display device 220. In some examples, the input interface 240 includes a receiver and / or a modem. The input interface 240 may receive encoded video data via link 30 and / or from storage device 40. The display device 220 may be integrated with the decoding end 20 or may be external to the decoding end 20. Generally, the display device 220 displays the decoded video data.
[0053] Figure 2 This application provides an exemplary block diagram of a video encoder. The video encoder 100 is used to output video to a post-processing entity 41. The post-processing entity 41 represents an instance of a video entity capable of processing encoded video data from the video encoder 100. In some cases, the post-processing entity 41 may be an instance of a network entity. In some video encoding systems, the post-processing entity 41 and the video encoder 100 may be parts of a separate device, while in other cases, the functionality described relative to the post-processing entity 41 may be performed by the same device including the video encoder 100. In one instance, the post-processing entity 41 is... Figure 1 An example of storage device 40.
[0054] exist Figure 2In this example, the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded picture buffer (DPB) 107, a summer 112, a transform 101, a quantizer 102, and an entropy encoder 103. The prediction processing unit 108 includes an inter-frame predictor 110 and an intra-frame predictor 109. For image patch reconstruction, the video encoder 100 also includes an inverse quantizer 104, an inverse transform 105, and a summer 111. The filter unit 106 implicitly represents one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although in Figure 2 The filter unit 106 is shown as an in-loop filter, but in other implementations, it can be implemented as a post-loop filter. In one example, the video encoder 100 may also include a video data memory and a segmentation unit (not shown).
[0055] The video data storage device can store video data to be encoded by components of the video encoder 100. The video data stored in the video data storage device can be obtained from the video source 120. The DPB 107 can be a reference image storage device that stores reference video data for encoding the video data by the video encoder 100 in intra-frame and inter-frame decoding modes.
[0056] like Figure 2 As shown, the video encoder 100 receives video data and stores it in a video data memory. A segmentation unit divides the video data into several image blocks, and these image blocks can be further divided into smaller blocks, such as image block segmentation based on a quadtree or binary tree structure. This segmentation may also include segmentation into slices, tiles, or other larger units. The video encoder 100 typically describes the components of image blocks within a video slice to be encoded. A slice can be divided into multiple image blocks (and may be divided into a set of image blocks called tiles). The prediction processing unit 108 can select one of several possible decoding modes for the current image block, such as one of several intra-frame decoding modes or one of several inter-frame decoding modes. The prediction processing unit 108 can provide the resulting intra-frame and inter-frame decoded blocks to a summer 112 to generate residual blocks, and to a summer 111 to reconstruct the encoded blocks used as a reference image.
[0057] The intra-predictor 109 within the prediction processing unit 108 can perform intra-predictive coding of the current image block relative to one or more adjacent blocks in the same frame or stripe as the current block to be coded, in order to remove spatial redundancy. The inter-predictor 110 within the prediction processing unit 108 can perform inter-predictive coding of the current image block relative to one or more prediction blocks in one or more reference images, in order to remove temporal redundancy.
[0058] Inter-frame predictor 110 is used to predict motion information (e.g., motion vectors) of one or more sub-blocks in the current image patch based on a determined inter-frame prediction mode, and to obtain or generate a prediction block for the current image patch using the motion information (e.g., motion vectors) of one or more sub-blocks in the current image patch. Inter-frame predictor 110 can locate the prediction block pointed to by the motion vector in one of a list of reference images. Inter-frame predictor 110 can also generate syntax elements associated with the image patch and video strip for use by video decoder 200 when decoding image patches of the video strip. Alternatively, in one example, inter-frame predictor 110 performs a motion compensation process using the motion information of each sub-block to generate a prediction block for each sub-block, thereby obtaining a prediction block for the current image patch; it should be understood that here, inter-frame predictor 110 performs both motion estimation and motion compensation processes.
[0059] Specifically, after selecting an inter-frame prediction mode for the current image block, the inter-frame predictor 110 can provide information indicating the selected inter-frame prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 can encode the information indicating the selected inter-frame prediction mode.
[0060] Intra-predictor 109 can perform intra-prediction on the current image block. Specifically, intra-predictor 109 can determine the intra-prediction mode to be used to encode the current block. For example, intra-predictor 109 can use rate-distortion analysis to calculate the rate-distortion values of various intra-prediction modes to be tested, and select the intra-prediction mode with the best rate-distortion characteristics from the tested modes. In any case, after selecting an intra-prediction mode for the image block, intra-predictor 109 can provide information indicating the selected intra-prediction mode of the current image block to entropy encoder 103, so that entropy encoder 103 can encode the information indicating the selected intra-prediction mode.
[0061] After the prediction processing unit 108 generates a prediction block for the current image patch via inter-frame prediction and intra-frame prediction, the video encoder 100 forms a residual image patch by subtracting the prediction block from the current image patch to be encoded. The summer 112 represents one or more components performing this subtraction operation. The residual video data in the residual patch may be contained in one or more transform units (TUs) and applied to the transformer 101. The transformer 101 transforms the residual video data into residual transform coefficients using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform. The transformer 101 can transform the residual video data from the pixel value domain to the transform domain, such as the frequency domain.
[0062] Transformer 101 can send the resulting transform coefficients to quantizer 102. Quantizer 102 quantizes the transform coefficients to further reduce the bit rate. In some instances, quantizer 102 can then perform a scan of a matrix containing the quantized transform coefficients. Alternatively, entropy encoder 103 can perform the scan.
[0063] After quantization, the entropy encoder 103 entropy-encodes the quantized transform coefficients. For example, the entropy encoder 103 may perform context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probabilistic interval segmented entropy (PIPE) coding, or another entropy coding method or technique. After entropy encoding by the entropy encoder 103, the encoded bitstream can be transmitted to the video decoder 200, or archived for later transmission or retrieval by the video decoder 200. The entropy encoder 103 may also entropy-encode the syntax elements of the current image block to be encoded.
[0064] Inverse quantizer 104 and inverse transform 105 apply inverse quantization and inverse transform, respectively, to reconstruct the residual block in the pixel domain, for example, as a reference block for later use as a reference image. Summer 111 adds the reconstructed residual block to the prediction block generated by inter-frame predictor 110 or intra-frame predictor 109 to produce a reconstructed image block. Filter unit 106 can be applied to the reconstructed image block to reduce distortion, such as block artifacts. The reconstructed image block is then stored as a reference block in decoded image buffer 107, which can be used by inter-frame predictor 110 as a reference block for inter-frame prediction of blocks in subsequent video frames or images.
[0065] It should be understood that other structural variations of the video encoder 100 can be used to encode the video stream. For example, for certain image blocks or image frames, the video encoder 100 can directly quantize the residual signal without processing by the transformer 101, and correspondingly, without processing by the inverse transformer 105; or, for certain image blocks or image frames, the video encoder 100 does not generate residual data, and correspondingly, without processing by the transformer 101, quantizer 102, inverse quantizer 104, and inverse transformer 105; or, the video encoder 100 can directly store the reconstructed image block as a reference block without processing by the filter unit 106; or, the quantizer 102 and inverse quantizer 104 in the video encoder 100 can be combined together.
[0066] Figure 3 An exemplary block diagram of a video decoder provided in this application. Figure 3 In one example, the video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse transform 205, a summer 211, a filter unit 206, and a DPB 207. The prediction processing unit 208 may include an inter-frame predictor 210 and an intra-frame predictor 209. In some instances, the video decoder 200 may perform substantially the same functions as those derived from... Figure 2 The video encoder 100 describes the encoding process as the inverse of the decoding process.
[0067] During decoding, video decoder 200 receives from video encoder 100 an encoded video stream representing image blocks and associated syntax elements of encoded video stripes. Video decoder 200 may receive video data from network entity 42, and optionally, may also store the video data in a video data memory (not shown). The video data memory may store video data to be decoded by components of video decoder 200, such as the encoded video stream. The video data stored in the video data memory may be obtained, for example, from storage device 40, from a local video source such as a camera, via wired or wireless network communication of video data, or by accessing a physical data storage medium. The video data memory may serve as a decoded image buffer (CPB) for storing encoded video data from the encoded video stream. Therefore, although in Figure 3 The video data storage device is not shown, but the video data storage device and DPB 207 can be the same storage device or separate storage devices. The video data storage device and DPB 207 can be formed from any of a variety of storage devices.
[0068] Network entity 42 may be a server, a MAME, a video editor / cutter, or other means for implementing one or more of the techniques described above. Network entity 42 may or may not include a video encoder, such as video encoder 100. Before sending the encoded video stream to video decoder 200, network entity 42 may implement parts of the techniques described in this application. In some video decoding systems, network entity 42 and video decoder 200 may be part of a separate device, while in other cases, the functionality described relative to network entity 42 may be performed by the same means including video decoder 200. In some cases, network entity 42 may be... Figure 1 An example of storage device 40.
[0069] The entropy decoder 203 of the video decoder 200 performs entropy decoding on the bitstream to produce quantized coefficients and some syntax elements. The entropy decoder 203 forwards the syntax elements to the prediction processing unit 208. The video decoder 200 can receive syntax elements at the video strip level and / or the image block level.
[0070] When a video strip is decoded into an intra-decoded (I) strip, the intra-predictor 209 of the prediction processing unit 208 can generate a prediction block for the current video strip's image blocks based on the signaled intra-prediction mode and data from previously decoded blocks in the current frame or image. When a video strip is decoded into an inter-decoded (i.e., B or P) strip, the inter-predictor 210 of the prediction processing unit 208 can determine an inter-prediction mode for decoding the current image blocks of the current video strip based on syntax elements received from the entropy decoder 203, and decode the current image blocks based on the determined inter-prediction mode (e.g., perform inter-prediction). Specifically, the inter-frame predictor 210 can determine whether to use a new inter-frame prediction mode to predict the current image block of the current video strip. If the syntax element indicates that a new inter-frame prediction mode should be used to predict the current image block, the motion information of the current image block or its sub-blocks in the current video strip is predicted based on the new inter-frame prediction mode (e.g., a new inter-frame prediction mode specified by the syntax element or a default new inter-frame prediction mode). The motion information is then used in the motion compensation process to obtain or generate a predicted block of the current image block or its sub-blocks. The motion information may include reference image information and motion vectors, where the reference image information may include, but is not limited to, unidirectional / bidirectional prediction information, a reference image list number, and a reference image index corresponding to the reference image list. For inter-frame prediction, a predicted block can be generated from one of the reference images in the reference image list. The video decoder 200 can construct a reference image list, i.e., list 0 and list 1, based on the reference images stored in the DPB 207. The reference frame index of the current image may be contained in one or more of reference frame lists 0 and 1. In some instances, the video encoder 100 may signal whether a new inter-frame prediction mode should be used to decode a specific syntax element of a specific block, or it may signal whether a new inter-frame prediction mode should be used, and which specific new inter-frame prediction mode should be used to decode a specific syntax element of a specific block. It should be understood that the inter-frame predictor 210 here performs the motion compensation process.
[0071] Dequantizer 204 dequantizes, or dequantizes, the quantized transform coefficients provided in the bitstream and decoded by entropy decoder 203. The dequantization process may include determining the degree of quantization to be applied using quantization parameters calculated by video encoder 100 for each image block in the video strip, and similarly determining the degree of inverse quantization to be applied. Inverse transform 205 applies an inverse transform to the transform coefficients, such as an inverse DCT, inverse integer transform, or a conceptually similar inverse transform process, to produce residual blocks in the pixel domain.
[0072] After the inter-frame predictor 210 generates a predicted block for the current image block or a sub-block of the current image block, the video decoder 200 obtains the reconstructed block, i.e., the decoded image block, by summing the residual block from the inverse transform 205 with the corresponding predicted block generated by the inter-frame predictor 210. The summer 211 represents the component that performs this summation operation. Loop filters (in or after the decoding loop) can also be used, if needed, to smooth pixel transitions or otherwise improve video quality. The filter unit 206 can represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although in Figure 3 The filter unit 206 is shown as an in-loop filter, but in other implementations, it may be implemented as a post-loop filter. In one example, the filter unit 206 is adapted to reconstruct blocks to reduce block distortion, and the result is output as a decoded video stream. Furthermore, decoded image blocks in a given frame or image can be stored in a decoded image buffer 207, which stores reference images for subsequent motion compensation. The DPB 207 may be part of a memory that can also store decoded video for later display on a display device (e.g., a display device). Figure 1 It may be displayed on a display device 220, or may be separate from such memory.
[0073] It should be understood that other structural variations of the video decoder 200 can be used to decode the encoded video stream. For example, the video decoder 200 may generate an output video stream without processing by the filter unit 206; or, for certain image blocks or frames, the entropy decoder 203 of the video decoder 200 may not decode the quantized coefficients, and accordingly, processing by the inverse quantizer 204 and the inverse transformer 205 is not required.
[0074] The following is a brief explanation of some of the terms used in the embodiments of this application.
[0075] 1. Intra Prediction: Intra prediction uses reconstructed pixels around the current block for prediction, aiming to remove spatial redundancy. Intra prediction modes are generally divided into special modes and angle modes. Special modes include DC mode, Planar mode, and Bilinear mode. Angle modes, for each pixel in the current block, find its corresponding reference pixel based on the angle direction to generate the prediction block.
[0076] 2. Quantization and Dequantization: Quantization refers to the process of mapping continuous values (or a large number of discrete values) of a signal to a finite number of discrete amplitudes, achieving a many-to-one mapping of signal values. In video coding, the transform coefficients of the residual signal often have a large dynamic range after transformation. Therefore, quantizing the transform coefficients can effectively reduce the signal value space and achieve better compression. However, due to the many-to-one mapping mechanism, the quantization process inevitably introduces distortion, which is the root cause of distortion in video coding. Dequantization is the reverse process of quantization; it maps the quantized coefficients to a reconstructed signal in the input signal space, and the reconstructed signal is an approximation of the input signal.
[0077] 3. Residual: In the video encoding process, spatial and temporal redundancy needs to be removed through the prediction process. The encoder obtains the predicted value through prediction, and the original pixel is subtracted from the predicted value to obtain the residual. The residual is transformed and quantized to obtain coefficients. Then, the coefficients and other information (including block partitioning information, mode information, transform parameters, quantization parameters, etc.) are entropy encoded to obtain the bitstream.
[0078] 4. Coefficient Coding: This involves encoding the quantized coefficients, including determining the range of the encoded coefficients, the encoding order, and the encoding method. The encoding methods include binarization, context modeling, and entropy coding.
[0079] The range of encoded coefficients refers to encoding only coefficients within this range; coefficients outside the range are not encoded (default is zero). The encoding order refers to arranging all coefficients to be encoded into a one-dimensional array according to this order, and then encoding them one by one. Binarization involves representing each coefficient as a binary symbol string, and then writing each bit of the binary symbol string (a 0 / 1 binary number, called a bin) into the bitstream through an entropy encoder. The context model estimates the probability of each bin taking the value 0 or 1 to assist the entropy encoder in better compressing the binary symbol string.
[0080] To make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0081] Please see Figure 4 This is a flowchart illustrating a decoding method provided in an embodiment of this application. The decoding method can be applied to a decoding device, such as... Figure 3 The video decoder shown is as follows: Figure 4 As shown, the decoding method may include the following steps:
[0082] Step S400: For any PU in the current CU, determine the prediction type of that PU.
[0083] In this embodiment of the application, considering that the granularity of CU-level IBC prediction is not fine enough and the prediction performance is poor for specific scenes (such as complex texture blocks), a finer-grained IBC prediction method can be adopted to improve the performance of IBC prediction.
[0084] For example, a CU can be divided into multiple PUs, and IBC prediction can be performed on each PU separately.
[0085] Accordingly, for any PU in the current CU, the prediction type of that PU can be determined.
[0086] For example, the prediction type may include a prediction model.
[0087] For example, the prediction model may include IBC prediction mode or other intra-frame prediction modes, such as angle prediction mode, DC prediction mode, Bilinear prediction mode, Plane prediction mode, Paeth prediction mode, Palette prediction mode or string matching prediction mode.
[0088] For example, the decoding device can determine the prediction type of each PU in the CU by parsing the bitstream.
[0089] Step S410: If the prediction type of the PU determines that the PU adopts the IBC prediction mode, determine the BV of the PU.
[0090] In this embodiment of the application, for any PU in the current CU, if the PU adopts the IBC prediction mode based on the prediction type of the PU, the BV of the PU can be determined.
[0091] Step S420: Based on the BV of the PU, obtain the matching block of the PU in the search area.
[0092] In this embodiment, the BV of the PU indicates the displacement between the PU and the mating block. For example, (Δx, Δy); where Δx is the horizontal displacement between the PU and the mating block; and Δy is the vertical displacement between the PU and the mating block.
[0093] For example, Δx < 0 indicates that the matching block is on the left side of the PU; Δy < 0 indicates that the matching block is on the top side of the PU.
[0094] Accordingly, once the BV of the PU is determined, the matching block of the PU can be obtained in the search area based on the BV of the PU.
[0095] Step S430: Reconstruct the PU based on the matching block of the PU.
[0096] In this embodiment of the application, when the matching block of the PU is determined, the PU can be reconstructed based on the matching block of the PU.
[0097] For example, the transform coefficients of the PU can be obtained by decoding the bitstream, and the residual block of the PU can be obtained by inverse quantization and inverse transform processing. Then, the reconstruction block of the PU can be obtained based on the residual block and the matching block of the PU, thus realizing the reconstruction of the PU.
[0098] In one example, for any CU, each PU within that CU can be rebuilt one by one in a preset rebuild order.
[0099] For example, the preset rebuild order may include rebuilding row by PU, or rebuilding column by PU, etc.
[0100] An exemplary diagram of row-by-row reconstruction of PUs can be shown as follows: Figure 5A As shown, a schematic diagram of PU column-by-column reconstruction can be obtained as follows: Figure 5B As shown.
[0101] It can be seen that, in Figure 4 In the method flow shown, for any PU in the CU, the prediction type of the PU is determined. If the prediction type of the PU determines that the PU adopts the IBC prediction mode, the BV of the PU can be determined. Based on the BV of the PU, the matching block of the PU is obtained in the search area. Then, the PU is reconstructed based on the matching block of the PU. By adopting a finer-grained IBC prediction, the IBC prediction performance is improved, thereby improving the encoding and decoding performance.
[0102] In some embodiments, determining the BV of the PU may include:
[0103] Based on the position of the PU in the current CU, determine the BV encoding method of the PU;
[0104] If the BV encoding method of the PU is encoded BV, the BV of the PU obtained by decoding from the bitstream will be determined as the BV of the PU.
[0105] When the BV encoding method of the PU is BVD encoding, the BV of the PU is determined based on the BVD of the PU obtained from the decoded bitstream and the BV of the reference PU.
[0106] For example, to improve the flexibility and efficiency of encoding, different BV encoding methods are allowed for different PU locations in the CU.
[0107] For example, BV encoding methods may include encoding BV (which may be called direct encoding BV) or encoding BVD, such as encoding the difference (BVD) between the BV of a PU and the BV of an adjacent PU.
[0108] For example, the BV encoding method of the PU can be determined based on the position of the PU in the current CU.
[0109] Accordingly, for a PU whose BV encoding method is BV encoding, the BV of the PU obtained by decoding from the bitstream can be determined as the BV of the PU.
[0110] For a PU whose BV encoding method is BVD encoding, the BV of the PU can be determined based on the BVD of the PU obtained from decoding the bitstream and the BV of the reference PU.
[0111] For example, for any PU, the reference PU is the PU that needs to be referenced when determining the BV of the PU.
[0112] For example, the BVD of a PU can be the difference between the BV of that PU and the BV of a reference PU.
[0113] In one example, determining the BV encoding method of the PU based on its position in the current CU can include:
[0114] Based on the current CU's BV prediction mode and the PU's position in the current CU, the PU's BV encoding method is determined.
[0115] For example, a variety of different BV prediction modes can be provided for the CU. Under different BV prediction modes, the BV encoding method used by each PU in the same CU can be different.
[0116] For example, the BV encoding method of the PU can be determined based on the BV prediction mode of the current CU and the position of the PU in the current CU.
[0117] For example, when the BV prediction mode of the CU is different, the BV encoding method of the PU at the same location can be different.
[0118] In one example, if the BV encoding method of the PU is BVD encoding, it may also include:
[0119] Based on the current CU's BV prediction mode and the PU's position in the current CU, determine the PU's reference PU;
[0120] The reference PU of the PU includes the adjacent PU of the PU, and the adjacent PU includes the PU on the left or the PU on the top.
[0121] The BVD of this PU is the difference between the BV of this PU and the BV of the reference PU.
[0122] For example, for a PU whose BV encoding method is BVD encoding, the reference PU can also be determined based on the BV prediction mode of the current CU and the position of the PU in the current CU.
[0123] For example, for a PU with BV encoding mode BVD, the reference PU of the PU at the same position can be different when the BV prediction mode of the CU is different.
[0124] For example, a reference PU for a PU may include an adjacent PU.
[0125] For example, a reference PU for a PU may include the PU to the left or the PU to the top of that PU.
[0126] For example, the BVD of the PU is the difference between the BV of the PU and the BV of the reference PU.
[0127] For example, the BV prediction mode may include, but is not limited to, a first BV prediction mode, a second BV prediction mode, a third BV prediction mode, or a fourth BV prediction mode.
[0128] For the first BV prediction mode (also known as the non-prediction mode), the BV encoding method of each PU in the CU is BV encoding, and its schematic diagram can be seen as follows. Figure 6A As shown.
[0129] For the second BV prediction mode (also known as the horizontal prediction mode), the BV encoding method for the PU in the first row of the first column of the CU can be coded BV. The BV of the PUs in the CU that are not in the first column can be referenced from the BV of the PUs to its left, that is, the BV of the current PU is predicted by using the BV of the PUs to its left. The BV encoding method for the PUs is coded BVD.
[0130] For example, in the second BV prediction mode, the BV of a PU in the first column (excluding the first row) of the CU can be referenced to the BV of its adjacent PU above it. That is, the BV of the current PU is predicted using the BV of the adjacent PU above it. The BV encoding method of the PU is BVD encoding, and its schematic diagram can be shown as follows. Figure 6B As shown in the figure (the figure takes a CU with 2 rows of PU as an example, but it can also be applied to cases where the number of rows of PU is greater than 2, and the same applies below).
[0131] It should be noted that, for the second BV prediction mode, the BV encoding method of the PU in the first column of the CU that is not in the first row can also be BV encoding.
[0132] For the third BV prediction mode (also known as the vertical prediction mode), the BV of a PU (PU) in a non-first row of the CU can be referenced from the BV of its adjacent PU above it. That is, the BV of the current PU is predicted using the BV of its adjacent PU above it. The BV encoding method for the PU is BVD encoding. The BV encoding method for the PU in the first row of the CU is BV encoding, as illustrated in the diagram below. Figure 6C As shown.
[0133] For the fourth BV prediction mode (also known as the hybrid prediction mode), the BV encoding method for the PU in the first row and first column of the CU can be coded BV. The BV of the PU in the first row but not the first column of the CU can be predicted by referring to the BV of the PU adjacent to its left, i.e., using the BV of the PU adjacent to its left to predict the BV of the current PU. The BV encoding method for the PU is coded BVD. The BV of the PU in the non-first row of the CU can be predicted by referring to the BV of the PU adjacent to its upper left, i.e., using the BV of the PU adjacent to its upper left to predict the BV of the current PU. The BV encoding method for the PU is coded BVD. A schematic diagram can be seen as follows: Figure 6D As shown.
[0134] Accordingly, if the current CU’s BV prediction mode is the first BV prediction mode, it can be determined that the PU’s BV encoding method is encoded BV.
[0135] If the BV prediction mode of the current CU is the second BV prediction mode, and the PU is not in the first column of the current CU, then the BV encoding method of the PU can be determined as the difference between the BV of the PU and the BV of the PU to the left of the PU, BVD; if the PU is in the second row and first column of the current CU, then the BV encoding method of the PU can be determined as the difference between the BV of the PU and the BV of the PU to the top of the PU, BVD.
[0136] If the BV prediction mode of the current CU is the third BV prediction mode, and the PU is the first PU in the current CU, then the BV encoding method of the PU is determined to be encoded BV; if the PU is not the first PU in the current CU, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU above it (BVD).
[0137] When the BV prediction mode of the current CU is the fourth BV prediction mode, if the PU is the PU in the first row but not the first column in the current CU, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the left of the PU, BVD; if the PU is the PU in the current CU but not the first row, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the top of the PU, BVD.
[0138] In the CU, the BV encoding method of PU in the first row and first column is BV encoding.
[0139] In some implementations, for the first column PU of the second BV prediction mode, the first row PU of the third BV prediction mode, and the first row and first column PU of the fourth BV prediction mode, the BV encoding method can be adaptively selected to encode BV or encode BVD.
[0140] For example, if the current CU's BV prediction mode is the second BV prediction mode, and the PU is the PU of the first column of the current CU (which can be called the first column PU of the second BV prediction mode), or if the CU's BV prediction mode is the third BV prediction mode, and the PU is the PU of the first row of the current CU (which can be called the first row PU of the third BV prediction mode), or if the current CU's BV prediction mode is the fourth BV prediction mode, and the PU is the PU of the first row and first column of the current CU (which can be called the first row and first column PU of the fourth BV prediction mode), then it is not necessary to follow the... Figures 6B to 6D The method shown selects BV encoding, but it can adaptively select either BV encoding or BVD encoding.
[0141] It should be noted that if the current CU's BV prediction mode is the second BV prediction mode, and the PU is not the PU in the first column of the current CU, it can be calculated according to... Figure 6B The method shown selects the BV encoding mode; if the current CU's BV prediction mode is the third BV prediction mode, and the PU is not the PU in the first row of the current CU, it can be done according to... Figure 6C The method shown selects the BV encoding mode; if the current CU's BV prediction mode is the fourth BV prediction mode, and the PU is not the PU in the first row and first column of the current CU, it can be done according to... Figure 6D The BV encoding method is selected as shown.
[0142] For example, the above adaptive selection of encoding BV or encoding BVD can be: determining the BV encoding method of the PU based on the prediction mode of the nearest PU in the left-side adjacent CU of the current CU, or the prediction mode of the nearest PU in the upper-side adjacent CU of the current CU.
[0143] In one example, if the current CU's BV prediction mode is the second BV prediction mode and the PU is the PU of the first column of the current CU, or if the CU's BV prediction mode is the third BV prediction mode and the PU is the PU of the first row of the current CU, or if the current CU's BV prediction mode is the fourth BV prediction mode and the PU is the PU of the first row and first column of the current CU:
[0144] If the first target PU in the CU to the left of the current CU adopts the IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts the non-IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the first target PU, BVD.
[0145] If the first target PU in the left adjacent CU of the current CU adopts a non-IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts an IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the second target PU, BVD.
[0146] If the first target PU in the CU to the left of the current CU adopts the IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts the IBC prediction mode, then the encoding method of the PU is the difference between the BV of the PU and the mean BV, BVD; or, based on the BV prediction mode of the current CU and the position of the PU in the current CU, the encoding method of the PU is the difference between the BV of the PU and the BV of the first target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the BV of the second target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the mean BV.
[0147] If the first target PU in the CU to the left of the current CU adopts a non-IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts a non-IBC prediction mode, then the encoding method of the PU is BV encoding.
[0148] Wherein, the first target PU is the PU closest to the current CU in the left adjacent CU, the second target PU is the PU closest to the current CU in the upper adjacent CU, and the above mean BV is the average of the BV of the first target PU and the BV of the second target PU.
[0149] For example, in order to reduce the bit consumption of BV encoding, for the first column PU of the second BV prediction mode, the first row PU of the third BV prediction mode, and the first row and first column PU of the fourth BV prediction mode, the BV encoding method of the PU can be determined to be BVD encoding when the nearest PU in the left adjacent CU (which can be called the first target PU) and / or the nearest PU in the upper adjacent CU (which can be called the second target PU) adopts the IBC prediction mode. Based on the BV of the first target PU and / or the BV of the second target PU, the BV of the PU is predicted.
[0150] For example, if the first target PU in the CU to the left of the current CU adopts the IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts the non-IBC prediction mode, then the BV encoding method of the PU can be determined to be BVD encoding, and the BV of the PU can be predicted based on the BV of the first target PU.
[0151] For example, the encoding method of the PU can be the difference BVD between the BV encoding the PU and the BV of the first target PU.
[0152] If the first target PU in the CU to the left of the current CU adopts a non-IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts an IBC prediction mode, then the BV encoding method of the PU can be determined to be BVD encoding, and the BV of the PU can be predicted based on the BV of the second target PU.
[0153] For example, the encoding method of the PU can be the difference BVD between the BV of the encoding PU and the BV of the second target PU.
[0154] If the first target PU in the CU to the left of the current CU adopts the IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts the IBC prediction mode, then the BV encoding method of the PU can be determined to be BVD encoding, and the BV of the PU can be predicted based on the BV of the first target PU and / or the BV of the second target PU.
[0155] As an example, the PU is encoded as the difference between the PU's BV and the mean BV, BVD.
[0156] As another example, the BV of the target PU can be predicted by using either the BV of the first target PU or the BV of the second target PU, depending on the BV prediction pattern of the current CU and the position of the PU in the current CU.
[0157] For example, if the BV prediction mode of the current CU is the second BV prediction mode, and the PU is the PU in the first row and first column of the current CU, the distance between the first target PU and the second target PU is the same. The BV of the PU can be predicted based on the average BV of the first target PU and the second target PU. That is, the BV encoding method of the PU is to encode the difference between the BV of the PU and the average BV, BVD.
[0158] For example, if the BV prediction mode of the current CU is the second BV prediction mode or the fourth BV prediction mode, and the PU is the PU in the second row and first column of the current CU, the distance between the first target PU and the PU is less than the distance between the second target PU and the PU. The BV of the PU can be predicted based on the BV of the first target PU. That is, the BV encoding method of the PU can be the difference between the BV of the PU and the BV of the first target PU, BVD.
[0159] For example, if the current CU's BV prediction mode is the third BV prediction mode, and the PU is the PU in the first row but not the first column of the current CU, the distance between the first target PU and the PU is greater than the distance between the second target PU and the PU. The BV of the PU can be predicted based on the BV of the second target PU. That is, the BV encoding method of the PU can be the difference between the BV of the PU and the BV of the second target PU, BVD.
[0160] If the first target PU in the CU to the left of the current CU adopts a non-IBC prediction mode, and the second target PU in the CU to the top of the current CU adopts a non-IBC prediction mode, then the encoding method of the PU can be BV encoding.
[0161] In some embodiments, when the BV encoding method of the PU is BV encoding, the BV uses fixed-length code encoding, and the code length of the fixed-length code is determined based on the position of the current CU in the image and the position of the PU in the current CU.
[0162] For example, when the BV encoding method is BV encoding, fixed-length code encoding of BV is allowed.
[0163] For example, the code length of the fixed-length code is determined based on the current position of the CU in the image, and the position of the PU in the current CU.
[0164] As the CU moves closer to the left edge of the image, the effective search area shrinks, and therefore the code length of the fixed-length code also shortens accordingly.
[0165] As the CU moves closer to the right edge of the image, the effective area increases, and correspondingly, the code length of the fixed-length code also increases.
[0166] In some embodiments, different prediction types are allowed for different PUs within the same CU;
[0167] Among them, different prediction types include at least one of the following differences:
[0168] Prediction pattern, sub-block division method, and search area.
[0169] For example, in order to further improve the flexibility of prediction and enhance the encoding and decoding performance, different prediction types are allowed for different PUs in the same CU. That is, different PUs in the same CU can use the same prediction type or different prediction types.
[0170] For example, the prediction type may include prediction pattern, sub-block partitioning method, and one or more of the search area.
[0171] Different prediction types can include different prediction modes, different sub-block division methods, and different search regions.
[0172] As can be seen, in the embodiments of this application, prediction can be performed on sub-blocks smaller than PU during the predictive coding process.
[0173] That is, a 4x4 PU can be divided into smaller sub-blocks, such as 4x2, 4x1, 2x4, 2x2, 2x1, 1x4 or 1x2 sub-blocks, and prediction can be performed on each sub-block.
[0174] For example, different sub-blocks within the same PU may have the same prediction pattern.
[0175] In one example, determining the block vector BV of the PU as described above may include:
[0176] When the PU is divided into multiple sub-blocks, the BV of each sub-block of the PU is determined separately.
[0177] That is, when the PU is divided into multiple sub-blocks, the BV of each sub-block is allowed to be different. The decoding end can determine the BV of each sub-block of the PU separately during the BV determination process.
[0178] In some embodiments, determining the prediction type of the PU may include:
[0179] The prediction type of the PU is determined based on the element corresponding to the PU in the preset prediction type matrix;
[0180] or,
[0181] Based on the value of BV, determine the prediction type of the PU;
[0182] or,
[0183] The prediction type of the PU is determined based on the value or parity of its location information; wherein, the location information includes row number, column number, and part or all of the location index.
[0184] or,
[0185] The prediction type of the PU is determined based on the reconstructed pixel information around the PU.
[0186] For example, in order to reduce the consumption of coding bits while supporting different prediction types for different PUs in the same CU, the prediction type of each PU in the same CU can be determined in a pre-agreed manner, without the need to add information to the bitstream to indicate the coding type of each PU respectively.
[0187] In one example, the prediction type of a PU can be determined based on the element corresponding to that PU in a preset prediction type matrix.
[0188] For example, a prediction type matrix can be constructed, in which each PU in the same CU corresponds to one element of the prediction type matrix, and the prediction type of the PU is represented by the value of each element in the prediction type matrix.
[0189] Accordingly, for any CU, the encoding device can encode the prediction type matrix corresponding to the CU into the bitstream.
[0190] The decoding device can decode the prediction type matrix from the bitstream and represent the prediction type of each PU in the CU based on the value of each element in the prediction type matrix.
[0191] For example, suppose there are 4 prediction types: 0 represents regular IBC, 1 represents IBC with sub-blocks, 2 represents DC prediction mode, and 3 represents IBC that searches for matching blocks in the "specified pixel block buffer". Then each element of the prediction type matrix can be represented by 2 bits, and the number of elements in the prediction type matrix is the same as the number of PUs in the CU.
[0192] In another example, the prediction type of the PU can be determined based on the value of BV.
[0193] For example, considering real-world scenarios, for a PU using the IBC mode, since BV is used to identify the position of the PU's matching block in the search area, the value of BV is usually limited to a certain range due to the positional constraints of the search area.
[0194] For example, the value of BV can be represented by (bv_x, bv_y), where bv_x is the value of BV in the horizontal direction and bv_y is the value of BV in the vertical direction.
[0195] For example, for a 4*4 PU, when the PU adopts the IBC mode, the value range of BV is "bv_x≤-4 or bv_y≤-4".
[0196] Based on this, values outside the range of BV can be used to identify other prediction types besides the IBC pattern.
[0197] For example, different prediction types can be represented using ("bv_x>-4 and bv_y>-4").
[0198] For example, bv_x = -3 and bv_y = -3 indicates the use of angle prediction mode, and bv_x = -2 and bv_y = -3 indicates the use of DC prediction mode.
[0199] It should be noted that in some embodiments, for the two components bv_x and bv_y of BV, it is permissible to set one of the components to a default value (without encoding) and only encode the other component. In this case, the range of values for BV only includes constraints on one component.
[0200] For example, bv_y can be set to 0 (no encoding required), and only bv_x can be encoded. Then the range of BV values is bv_x≤-4, and bv_x>-4 can be used to represent different prediction types.
[0201] In another example, the prediction type of a PU can be determined based on the value of its location information or the parity of that value.
[0202] For example, location information may include row number, column number, and part or all of the location index.
[0203] For example, the PU in the first row of the CU can use the first prediction type, and the PU in the second row can use the second prediction type.
[0204] For example, in CU, PUs in odd-numbered rows and odd-numbered columns use the first prediction type, PUs in odd-numbered rows and even-numbered columns use the second prediction type, PUs in even-numbered rows and odd-numbered columns use the third prediction type, and PUs in even-numbered rows and even-numbered columns use the fourth prediction type.
[0205] For example, in CU, odd-numbered position indices use the first prediction type, while even-numbered position indices use the second prediction type.
[0206] In another example, the prediction type of a PU can be determined based on the reconstructed pixel information surrounding that PU.
[0207] For example, the prediction type can be derived based on the pixel information surrounding the PU.
[0208] For example, based on the reconstructed pixel information around the PU, the texture complexity of the current PU is estimated, and the complexity is divided into several levels, with each level corresponding to a prediction type.
[0209] In some embodiments, for any PU, the search area may include:
[0210] The left pixel region, top pixel region, top left pixel region, top right pixel region, bottom left pixel region, and part or all of the specified pixel block buffer of the PU;
[0211] The specified pixel block buffer is used to store reconstructed pixel blocks that meet specific conditions.
[0212] For example, in order to improve the prediction performance of the IBC prediction mode, the search area of a PU using the IBC prediction mode may include not only the surrounding reconstructed pixel area, but also a buffer (which may be called a specified pixel block buffer) for storing reconstructed pixel blocks that meet specific conditions.
[0213] For example, meeting the specific conditions mentioned above may include the number of times the references (i.e., the number of times the reconstructed pixel block is identified as a matching block) reaches a preset number.
[0214] For example, during the reconstruction of any video frame, the number of times each reconstructed pixel block in the video frame is referenced can be recorded, and reconstructed pixel blocks whose reference count reaches a preset number can be added to a specified pixel block buffer.
[0215] Accordingly, for any PU, in the process of determining the matching block of the PU, the search area may include the specified pixel block buffer, that is, the matching block of the PU can be selected from the reconstructed pixel blocks included in the specified pixel block buffer.
[0216] In some embodiments, if the search area of the PU contains invalid regions, the invalid regions are filled in the following manner:
[0217] Fill with default values; or,
[0218] The padding value is determined based on the pixel value of the nearest pixel in the valid region to the invalid region; or,
[0219] Determine the fill value based on the reference pixel of the previous row of the current CU.
[0220] For example, considering that the search area is usually a rectangular area of a preset agreed size, such as a 64*8 rectangular area located to the left of the current CU within the current image.
[0221] Therefore, for CUs near the left edge of the image, the search area may contain invalid regions. For example, the 64*8 rectangular region mentioned above extends beyond the left edge of the image; this part is an invalid region, as illustrated in the diagram below. Figure 7 As shown.
[0222] To ensure that the effective search area is large enough to improve the prediction performance of the IBC prediction model, invalid areas in the search area of the PU can be filled.
[0223] In one example, a default value can be used to fill invalid areas in the search area.
[0224] For example, the default value can be 0, or the default value can be 1 << (bitdepth-1), which means shifting 1 left by (bitdepth-1) bits, where bitdepth is the image bit depth.
[0225] In another example, the padding value can be determined based on the pixel value of the nearest pixel in the valid region to the invalid region.
[0226] by Figure 7 Taking the filled area shown as an example, the pixel value of the leftmost column in the valid area can be determined as the pixel value of each column in the invalid area, and then copied to each column in the invalid area.
[0227] In yet another example, the fill value can be determined based on the reference pixel in the previous row of the current CU.
[0228] For example, when the current CU is not at the upper boundary of the image, the filling value of the invalid area can be determined based on the reference pixels of the previous row of the current CU. Thus, in the hardware implementation, only the left part of the current CU and the reconstructed pixels of the previous row need to be stored, saving storage resources.
[0229] Furthermore, by determining the padding value based on the reference pixel of the previous row of the current CU, the search area is equivalent to including the left and upper regions of the current CU. For any PU in the current CU, if the matching block is in an invalid region where the padding value is used, it is equivalent to the PU using the vertical prediction mode, which can achieve the performance of hybrid IBC prediction, thereby optimizing the encoding and decoding performance.
[0230] As an example, the pixel value of the leftmost reference pixel in the reference pixels of the current CU row can be determined as the padding value.
[0231] As another example, the average value of the leftmost preset number of reference pixels in the reference pixels of the current CU can be determined as the fill value; wherein the preset number is less than or equal to the total number of reference pixels in the current CU.
[0232] For example, assuming the total number of reference pixels in the current CU row is 128, you can start from the leftmost side, select some or all of the 128 reference pixels, and determine the average value of the selected reference pixels as the fill value.
[0233] As another example, the pixel values of the leftmost N reference pixels in the previous row of the current CU can be used as the padding values for each row of the invalid region; where N is equal to the width of the invalid region.
[0234] For example, assuming the width of the invalid region is 16, the leftmost 16 pixels of the reference pixels in the current CU row can be used as the fill values for each row of the invalid region, and then filled into each row of the invalid region.
[0235] In some embodiments, the search area of the PU includes the reconstructed pixel area in the current CU.
[0236] For example, since the CU is reconstructed using a PU-by-PU reconstruction method, the reconstructed PUs within the same CU can be used as references during the PU reconstruction process to expand the selectable range of the search area and improve encoding and decoding performance.
[0237] Accordingly, the search area of the PU can include the reconstructed pixel area in the current CU.
[0238] For example, for any CU, during the reconstruction of the first PU in the CU, the search area of the PU can include a rectangular area of a preset size (e.g., 64*8) on the left side of the CU; when the reconstruction of the first column of PU in the CU is completed, during the reconstruction of the second column of PU in the CU, the search area of the PU can include the PU of the first column of the CU, as well as a rectangular area of the remaining size on the left side of the CU (64*8 excluding the size of the first column of PU).
[0239] In one example, the search area of the PU is a rectangular region containing the reconstructed pixels in the current CU.
[0240] For example, considering that the location information of the search area needs to be maintained separately in the memory area, and that the location information of the non-rectangular area needs to be recorded more than that of the rectangular area, in order to reduce the amount of information recorded in memory, the search area of the PU can be a rectangular area containing the reconstructed pixels in the current CU (i.e., the entire search area is a rectangular area).
[0241] by Figure 6A or Figure 6BAs shown, during the reconstruction of PU6, the search area for PU can include a rectangular area composed of PU0, PU1, PU4 and PU5.
[0242] This application also provides an encoding method, which can be applied to an encoding terminal device, and the encoding method may include the following steps:
[0243] Step T100: For any PU in the current CU, determine the prediction type of that PU.
[0244] In this embodiment of the application, the encoding end device can determine the prediction type of each PU in the CU based on the frame type and the RDO (Rate-Distortion Optimization) principle.
[0245] Step T110: If the prediction type of the PU determines that the PU adopts the IBC prediction mode, search for the matching block of the PU in the search area.
[0246] In this embodiment of the application, for any PU in the current CU, the encoding end device can search for the matching block of the PU in the search area if it determines that the PU adopts the IBC prediction mode.
[0247] For example, the encoding device can determine the matching block of the current PU based on the sum of the absolute differences between the pixel values of the current PU and the candidate block.
[0248] Step T120: Determine the BV of the PU based on the matching block of the PU, and encode the BV of the PU.
[0249] Step T130: Reconstruct the PU based on the matching block of the PU.
[0250] In this embodiment of the application, when the encoding device determines the matching block of the PU, it can determine the BV of the PU based on the matching block of the PU and encode the BV of the PU.
[0251] For example, the encoding method by which the encoding end device encodes the BV of the PU may include encoding BV or encoding BVD.
[0252] In one example, the encoding device can determine the BV encoding method of the PU by its position in the current CU. The specific implementation can be found in the relevant description in the above embodiments of the decoding end, and will not be repeated here.
[0253] On the other hand, the encoding device can reconstruct the PU based on the matching block of the PU.
[0254] For example, the specific implementation process of the encoding end and the specific implementation process of the decoding end can be referred to each other, and their specific implementation will not be described in detail in this application embodiment.
[0255] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below with reference to specific examples.
[0256] In this embodiment, at the encoding end, for each PU in the CU, the prediction type of each PU can be determined. For a PU using the IBC prediction mode, a matching block is searched in its search area. On the one hand, the BV of the PU is determined based on the searched matching block. The BV encoding method of the PU can be determined based on the position of the PU in the current CU, and the BV of the PU is encoded based on the determined BV encoding method. On the other hand, the PU can be reconstructed based on the searched matching block.
[0257] At the decoding end, for each PU in the CU, the prediction type of each PU can be determined. For PUs using the IBC prediction mode, the BV encoding method of the PU can be determined based on the current position of the PU in the CU. Then, the BV or BVD is decoded based on the determined BV encoding method to determine the BV of the PU. Based on the BV of the PU, the matching block of the PU is obtained in the search area. Based on the matching block of the PU, the PU is then reconstructed.
[0258] Accordingly, in this embodiment, the encoding method and decoding method flow can be as follows:
[0259] I. Encoding Method
[0260] For example, the encoding method flow may include:
[0261] 1) For each PU in the CU, determine the prediction type for that PU.
[0262] 2) If the prediction type of the PU determines that the PU adopts the IBC prediction mode, search for the matching block of the PU in the search area.
[0263] 3) Determine the BV of the PU based on the matching block of the PU.
[0264] 4) Based on the position of the PU in the current CU, determine the BV encoding method of the PU, and encode the BV of the PU according to the BV encoding method of the PU.
[0265] For example, BV encoding methods may include encoding BV, or encoding BVD.
[0266] For example, the BVD of a PU is the difference between the BV of the PU and the BV of a reference PU.
[0267] 5) Reconstruct the PU based on its matching block.
[0268] For example, for any CU, the CU can be reconstructed PU by PU in the manner described above.
[0269] II. Decoding Method
[0270] For example, the decoding method flow may include:
[0271] 1) For each PU in the current CU, determine the prediction type for that PU.
[0272] 2) If the prediction type of the PU determines that the PU adopts the IBC prediction mode, the BV encoding method of the PU is determined according to the position of the PU in the current CU.
[0273] For example, BV encoding methods may include encoding BV, or encoding BVD.
[0274] For example, the BVD of a PU is the difference between the BV of the PU and the BV of a reference PU.
[0275] 3) Decode the BV or BVD of the PU from the bitstream according to the BV encoding method of the PU to determine the BV of the PU.
[0276] 4) Based on the BV of the PU, obtain the matching block of the PU in the search area, and reconstruct the PU according to the matching block of the PU.
[0277] In one example, for multiple PUs in a CU, a hybrid prediction approach is supported, meaning that different prediction types are allowed for different PUs in the same CU.
[0278] For example, the prediction type may include a prediction model, a sub-block partitioning method, and one or more search regions.
[0279] Taking a 4*4 PU as an example:
[0280] 1) Different prediction modes may include: IBC prediction mode or other intra-frame prediction modes.
[0281] For example, other intra-frame prediction modes may include, but are not limited to: angle prediction mode, DC prediction mode, Bilinear prediction mode, Plane prediction mode, Paeth prediction mode, Palette prediction mode, or string matching prediction mode, etc.
[0282] 2) Different sub-block division methods may include: dividing the PU into sub-blocks according to a size smaller than the PU.
[0283] For example, the size of the sub-block can include 4x2, 4x1, 2x4, 2x2, 2x1, 1x4, or 1x2.
[0284] For example, all sub-blocks of the same PU have the same prediction pattern.
[0285] 3) Different search areas may include: the left, top, upper left, upper right, and lower left pixel areas of the current PU, or a set of historically reconstructed pixel blocks (i.e., the reconstructed pixel blocks stored in the specified pixel block buffer mentioned above).
[0286] For example, for any video frame, during the reconstruction of the video frame, the number of times each reconstructed pixel block in the video frame is referenced can be recorded, and reconstructed pixel blocks whose reference count reaches a preset number can be added to a specified pixel block buffer.
[0287] Accordingly, for any PU, in the process of determining the matching block of the PU, the search area may include the specified pixel block buffer, that is, the matching block of the PU can be selected from the reconstructed pixel blocks included in the specified pixel block buffer.
[0288] In one example, when the search area is a fixed-size rectangular region to the left of the current CU, the search area may contain invalid regions for CUs near the left boundary of the image. A schematic diagram can be shown below. Figure 7 As shown.
[0289] For example, if the search area contains invalid regions, the invalid regions in the search area can be filled with pixel values.
[0290] For example, methods for filling invalid regions in the search area with pixel values may include:
[0291] 1) Fill in the default value.
[0292] For example, the default value can be 0, or 1 << (bitdepth-1).
[0293] 2) Fill in the pixel values of the nearest valid region.
[0294] by Figure 7 Taking the scenario shown as an example, the pixel values of the leftmost column of the valid area can be copied to each column of the invalid area.
[0295] 3) Determine the fill value based on the reference pixel of the previous row of the current CU.
[0296] For example, a specific implementation of determining the fill value based on the reference pixels of the previous row of the current CU may include:
[0297] 3.1) Fill in the pixel value of the leftmost pixel in the reference pixel row above the current CU;
[0298] 3.2) Fill in the average pixel value of the leftmost of the reference pixels in the previous row of the current CU;
[0299] 3.3) Copy the pixel values of the leftmost N pixels of the reference pixel in the previous row of the current CU to each row of the invalid region; where N is equal to the width of the invalid region.
[0300] In one example, the BV encoding method can be determined based on the BV prediction mode of the current CU and the position of the PU in the current CU.
[0301] by Figures 6A to 6D As shown, the BV prediction mode of CU may include a first BV prediction mode, a second BV prediction mode, a third BV prediction mode, or a fourth BV prediction mode.
[0302] 1) For PUs at certain locations (see...) Figures 6B to 6D The BV encoding method is the difference between the BV of the PU and the BV of the adjacent PU (in the ">" and "V" positions).
[0303] For example, for different BV prediction modes and different PU locations, the selection of adjacent PUs is different; it can be the adjacent PU on the left or the adjacent PU on the top.
[0304] 2) For certain PU positions (see “O” position in the above figure), the BV encoding method is BV encoding.
[0305] For example, when the BV encoding method is BV encoding, a fixed-length code can be used to encode BV.
[0306] For example, the code length of the BV encoding can depend on the number of valid search locations. As the CU moves closer to the left edge of the image, the valid search area shrinks, and the code length of the fixed-length code decreases accordingly.
[0307] 3) For the third BV prediction model (see...) Figure 6C In the first row, all four PUs can use fixed-length codes to encode BV.
[0308] During the reconstruction process per PU, the PU on the right can refer to the reconstruction value of the PU on the left. Therefore, the search area of the PU further to the right is larger, and the corresponding code length will also be longer.
[0309] In one example, during the process of rebuilding a CU per PU, intra-block referencing is allowed, that is, referencing a PU that has been rebuilt within the same CU is allowed.
[0310] For example, for PUs within the same CU, the reconstruction sequence may include rebuilding row by row or column by column, as illustrated in the diagrams below. Figure 5A or Figure 5B As shown.
[0311] For example, with Figure 5B Taking the PU-by-PU column reconstruction example shown, during the PU-by-PU column reconstruction process, for PU6, the reconstructed PUs within the block that it is allowed to reference may include:
[0312] 1) PU6 is allowed to reference PU0, PU4, PU1, PU5, and PU2;
[0313] 2) PU6 is allowed to reference PU0, PU4, PU1, and PU5, but PU6 is not allowed to reference PU2, in order to ensure that the search area is a rectangular area.
[0314] The method provided in this application has been described above. The apparatus provided in this application is described below:
[0315] Based on the same concept as the above method, this application also proposes a decoding device, which is applied to a decoding end. The device includes: a memory configured to store video data; and a decoder configured to implement the decoding method in the above embodiment, i.e., the processing flow of the decoding end.
[0316] Based on the same application concept as the above method, this application also proposes an encoding device, which is applied to the encoding end. The device includes: a memory configured to store video data; and an encoder configured to implement the encoding method in the above embodiment, i.e., the processing flow of the encoding end.
[0317] Based on the same concept as the above method, the decoding device (also known as a video decoder) provided in this application embodiment, from a hardware perspective, its hardware architecture diagram can be found in [reference needed]. Figure 8A As shown, it includes: a processor 811 and a machine-readable storage medium 812, the machine-readable storage medium 812 storing machine-executable instructions that can be executed by the processor 811; the processor 811 is used to execute the machine-executable instructions to implement the decoding method in the above embodiments of this application.
[0318] Based on the same concept as the above method, the encoding end device (also known as a video encoder) provided in this application embodiment, from a hardware perspective, its hardware architecture diagram can be found in [reference needed]. Figure 8BAs shown, it includes: a processor 821 and a machine-readable storage medium 822, the machine-readable storage medium 822 storing machine-executable instructions that can be executed by the processor 821; the processor 821 is used to execute the machine-executable instructions to implement the encoding method in the above embodiments of this application.
[0319] Based on the same concept as the methods described above, this application provides an electronic device. It includes a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor executes the machine-executable instructions to implement the decoding or encoding methods in the above embodiments of this application.
[0320] Based on the same application concept as the above methods, this application also provides a machine-readable storage medium storing a plurality of computer instructions. When the computer instructions are executed by a processor, they can implement the methods disclosed in the above examples of this application, such as the decoding method or encoding method in the above embodiments.
[0321] Based on the same application concept as the above method, this application embodiment also provides a computer application that, when executed by a processor, can implement the decoding method or encoding method disclosed in the above examples of this application.
[0322] Based on the same concept as the above method, this application also proposes a decoding device that can be applied to a decoding end (also called a video decoder). The decoding device includes:
[0323] The first determining unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU).
[0324] The second determining unit is used to determine the block vector (BV) of the PU when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU.
[0325] The acquisition unit is used to acquire the matching block of the PU in the search area based on the BV of the PU;
[0326] The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
[0327] In some embodiments, the second determining unit determines the block vector BV of the PU, including:
[0328] Based on the position of the PU in the current CU, determine the BV encoding method of the PU;
[0329] If the BV encoding method of the PU is encoded BV, the BV of the PU obtained by decoding from the bitstream will be determined as the BV of the PU.
[0330] When the BV encoding method of the PU is the code block vector difference (BVD), the BV of the PU is determined based on the BVD of the PU obtained from the code stream decoding and the BV of the reference PU.
[0331] In some embodiments, the second determining unit determines the BV encoding method of the PU based on its position in the current CU, including:
[0332] Based on the BV prediction mode of the current CU and the position of the PU in the current CU, the BV encoding method of the PU is determined.
[0333] In some embodiments, when the BV encoding method of the PU is BVD encoding, the method further includes:
[0334] Based on the BV prediction mode of the current CU and the position of the PU in the current CU, a reference PU is determined for the PU;
[0335] The reference PU of the PU includes the adjacent PU of the PU, and the adjacent PU includes the left adjacent PU or the upper adjacent PU;
[0336] The BVD of this PU is the difference between the BV of this PU and the BV of the reference PU.
[0337] In some embodiments, the second determining unit determines the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU, including:
[0338] If the BV prediction mode of the current CU is the first BV prediction mode, then the BV encoding method of the PU is determined to be encoded BV.
[0339] If the BV prediction mode of the current CU is the second BV prediction mode, and the PU is a PU that is not in the first column of the current CU, then the BV encoding method of the PU is determined to be the difference BVD between the BV of the PU and the BV of the PU to the left of the PU.
[0340] If the BV prediction mode of the current CU is the third BV prediction mode, and the PU is not the first row of the current CU, then the BV encoding method of the PU is determined to be the difference BVD between the BV of the PU and the BV of the PU above it.
[0341] When the BV prediction mode of the current CU is the fourth BV prediction mode, if the PU is a PU in the first row but not the first column of the current CU, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the left of the PU, BVD; if the PU is a PU in the current CU but not the first row, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the top of the PU, BVD.
[0342] In some embodiments, the second determining unit determines the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU, further comprising:
[0343] When the BV prediction mode of the current CU is the second BV prediction mode, if the PU is the PU in the first row and first column of the current CU, then the BV encoding method of the PU is determined to be encoded BV; if the PU is the PU in the second row and first column of the current CU, then the BV encoding method of the PU is determined to be the difference BVD between the BV of the PU and the BV of the PU above it.
[0344] If the BV prediction mode of the current CU is the third BV prediction mode, and the PU is the PU in the first row of the current CU, then the BV encoding method of the PU is determined to be encoded BV.
[0345] If the BV prediction mode of the current CU is the fourth BV prediction mode, and the PU is the PU in the first row and first column of the current CU, then the BV encoding method of the PU is determined to be encoded BV.
[0346] In some embodiments, the second determining unit determines the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU, further comprising:
[0347] When the BV prediction mode of the current CU is the second BV prediction mode and the PU is the PU of the first column of the current CU; or when the BV prediction mode of the CU is the third BV prediction mode and the PU is the PU of the first row of the current CU; or when the BV prediction mode of the current CU is the fourth BV prediction mode and the PU is the PU of the first row and first column of the current CU:
[0348] If the first target PU in the left adjacent CU of the current CU adopts the IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts the non-IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the first target PU, BVD.
[0349] If the first target PU in the left adjacent CU of the current CU adopts a non-IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts an IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the second target PU, BVD.
[0350] If the first target PU in the left adjacent CU of the current CU adopts the IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts the IBC prediction mode, then the encoding method of the PU is the difference between the BV of the PU and the mean BV, BVD; or, based on the BV prediction mode of the current CU and the position of the PU in the current CU, the encoding method of the PU is the difference between the BV of the PU and the BV of the first target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the BV of the second target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the mean BV.
[0351] If the first target PU in the left adjacent CU of the current CU adopts a non-IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts a non-IBC prediction mode, then the encoding method of the PU is BV encoding.
[0352] Wherein, the first target PU is the PU closest to the current CU in the left adjacent CU, the second target PU is the PU closest to the current CU in the upper adjacent CU, and the mean BV is the average of the BV of the first target PU and the BV of the second target PU.
[0353] In some embodiments, when the BV encoding method of the PU is BV encoding, the BV uses fixed-length code encoding, and the code length of the fixed-length code is determined based on the position of the current CU in the image and the position of the PU in the current CU.
[0354] In some embodiments, different prediction types are allowed for different PUs within the same CU;
[0355] Among them, different prediction types include at least one of the following differences:
[0356] Prediction pattern, sub-block division method, and search area.
[0357] In some embodiments, the second determining unit determines the block vector BV of the PU, including:
[0358] When the PU is divided into multiple sub-blocks, determine the BV of each sub-block of the PU separately;
[0359] In this case, the prediction modes of each sub-block within the same PU are the same.
[0360] In some embodiments, the first determining unit determines the prediction type of the PU, including:
[0361] The prediction type of the PU is determined based on the element corresponding to the PU in the preset prediction type matrix;
[0362] or,
[0363] Based on the value of BV, determine the prediction type of the PU;
[0364] or,
[0365] The prediction type of the PU is determined based on the value or parity of its location information; wherein the location information includes row number, column number, and part or all of the location index.
[0366] or,
[0367] The prediction type of the PU is determined based on the reconstructed pixel information around the PU.
[0368] In some embodiments, for any PU, the search area includes at least one of the following areas:
[0369] The PU includes the left pixel region, the top pixel region, the top left pixel region, the top right pixel region, the bottom left pixel region, and a specified pixel block buffer.
[0370] The specified pixel block buffer is used to store reconstructed pixel blocks that meet specific conditions.
[0371] In some embodiments, if the search area of the PU contains invalid regions, the invalid regions are filled in the following manner:
[0372] Fill with default values; or,
[0373] The padding value is determined based on the pixel value of the nearest pixel in the valid region to the invalid region; or,
[0374] The fill value is determined based on the reference pixel of the previous row of the current CU.
[0375] In some embodiments, the first determining unit determines the fill value based on the pixel value of the pixel closest to the invalid region in the valid region, including:
[0376] The pixel value of the leftmost column of pixels in the valid region is determined as the pixel value of each column of pixels in the invalid region.
[0377] In some embodiments, the first determining unit determines the fill value based on the reference pixels of the previous row of the current CU, including:
[0378] The leftmost reference pixel value in the reference pixels of the current CU's previous row is determined as the fill value; or,
[0379] The fill value is determined by the average of the leftmost preset number of reference pixels in the previous row of the current CU; wherein the preset number is less than or equal to the total number of reference pixels in the previous row of the current CU; or,
[0380] The pixel values of the leftmost N reference pixels in the previous row of the current CU are determined as the fill values for each row of the invalid region; where N is equal to the width of the invalid region.
[0381] In some embodiments, the search area of the PU includes the reconstructed pixel area in the current CU.
[0382] In some embodiments, the search area of the PU is a rectangular region containing the reconstructed pixels in the current CU.
[0383] In some embodiments, for any CU, each PU within the CU is rebuilt one by one in a preset reconstruction order;
[0384] The preset reconstruction sequence includes rebuilding row by row for each PU, or rebuilding column by column for each PU.
[0385] Based on the same concept as the above method, this application also proposes an encoding device applied at an encoding end (also called a video encoder), the device comprising:
[0386] The determination unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU).
[0387] The search unit is used to search for matching blocks of the PU in the search area when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU.
[0388] An encoding unit is configured to determine the BV of the PU based on the matching block of the PU, and to encode the BV of the PU; and,
[0389] The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
[0390] For example, the specific implementation process of the encoding method by each unit in the encoding device can be found in the above method embodiments and the relevant description of the specific implementation of the decoding method by each unit in the decoding device. The embodiments of this application will not be repeated here.
Claims
1. A decoding method, characterized in that, include: For any prediction unit (PU) in the current coding unit (CU), determine the prediction type of that PU; If the prediction type of the PU determines that the PU adopts the intra-block copy prediction (IBC) prediction mode, then the block vector (BV) of the PU is determined. Based on the BV of the PU, obtain the matching block of the PU in the search area; The PU is reconstructed based on its matching block.
2. The method according to claim 1, characterized in that, Determining the block vector BV of the PU includes: Based on the position of the PU in the current CU, determine the BV encoding method of the PU; If the BV encoding method of the PU is encoded BV, the BV of the PU obtained by decoding from the bitstream will be determined as the BV of the PU. When the BV encoding method of the PU is the code block vector difference (BVD), the BV of the PU is determined based on the BVD of the PU obtained from the code stream decoding and the BV of the reference PU.
3. The method according to claim 2, characterized in that, The step of determining the BV encoding method of the PU based on its position in the current CU includes: Based on the BV prediction mode of the current CU and the position of the PU in the current CU, the BV encoding method of the PU is determined.
4. The method according to claim 3, characterized in that, When the BV encoding method of the PU is BVD encoding, the method further includes: Based on the BV prediction mode of the current CU and the position of the PU in the current CU, a reference PU is determined for the PU; The reference PU of the PU includes the adjacent PU of the PU, and the adjacent PU includes the left adjacent PU or the upper adjacent PU; The BVD of this PU is the difference between the BV of this PU and the BV of the reference PU.
5. The method according to claim 3, characterized in that, The step of determining the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU includes: If the BV prediction mode of the current CU is the first BV prediction mode, then the BV encoding method of the PU is determined to be encoded BV. If the BV prediction mode of the current CU is the second BV prediction mode, and the PU is a PU that is not in the first column of the current CU, then the BV encoding method of the PU is determined to be the difference BVD between the BV of the PU and the BV of the PU to the left of the PU. If the BV prediction mode of the current CU is the third BV prediction mode, and the PU is not the first row of the current CU, then the BV encoding method of the PU is determined to be the difference BVD between the BV of the PU and the BV of the PU above it. When the BV prediction mode of the current CU is the fourth BV prediction mode, if the PU is a PU in the first row but not the first column in the current CU, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the left of the PU (BVD); if the PU is a PU in the current CU but not the first row, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU to the top of the PU (BVD). The step of determining the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU further includes: When the BV prediction mode of the current CU is the second BV prediction mode, if the PU is the PU in the first row and first column of the current CU, then the BV encoding method of the PU is determined to be encoded BV; if the PU is the PU in the second row and first column of the current CU, then the BV encoding method of the PU is determined to be the difference between the BV of the PU and the BV of the PU above it (BVD). If the BV prediction mode of the current CU is the third BV prediction mode, and the PU is the PU in the first row of the current CU, then the BV encoding method of the PU is determined to be encoded BV. If the BV prediction mode of the current CU is the fourth BV prediction mode, and the PU is the PU in the first row and first column of the current CU, then the BV encoding method of the PU is determined to be encoded BV. Alternatively, determining the BV encoding method of the PU based on the BV prediction mode of the current CU and the position of the PU in the current CU further includes: When the BV prediction mode of the current CU is the second BV prediction mode and the PU is the PU of the first column of the current CU, or when the BV prediction mode of the CU is the third BV prediction mode and the PU is the PU of the first row of the current CU, or when the BV prediction mode of the current CU is the fourth BV prediction mode and the PU is the PU of the first row and first column of the current CU: If the first target PU in the left adjacent CU of the current CU adopts the IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts the non-IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the first target PU, BVD. If the first target PU in the left adjacent CU of the current CU adopts a non-IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts an IBC prediction mode, then the encoding method of the PU is the difference between the BV of the encoding PU and the BV of the second target PU, BVD. If the first target PU in the left adjacent CU of the current CU adopts the IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts the IBC prediction mode, then the encoding method of the PU is the difference between the BV of the PU and the mean BV, BVD; or, based on the BV prediction mode of the current CU and the position of the PU in the current CU, the encoding method of the PU is the difference between the BV of the PU and the BV of the first target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the BV of the second target PU, BVD; or, the encoding method of the PU is the difference between the BV of the PU and the mean BV. If the first target PU in the left adjacent CU of the current CU adopts a non-IBC prediction mode, and the second target PU in the upper adjacent CU of the current CU adopts a non-IBC prediction mode, then the encoding method of the PU is BV encoding. Wherein, the first target PU is the PU closest to the current CU in the left adjacent CU, the second target PU is the PU closest to the current CU in the upper adjacent CU, and the mean BV is the average of the BV of the first target PU and the BV of the second target PU.
6. The method according to claim 2, characterized in that, When the BV encoding method of the PU is BV encoding, the BV uses fixed-length code encoding, and the code length of the fixed-length code is determined based on the position of the current CU in the image and the position of the PU in the current CU.
7. The method according to claim 1, characterized in that, Different prediction types are allowed for different PUs within the same CU; Among them, different prediction types include at least one of the following differences: Prediction pattern, sub-block division method, and search area.
8. The method according to claim 7, characterized in that, Determining the block vector BV of the PU includes: When the PU is divided into multiple sub-blocks, determine the BV of each sub-block of the PU separately; In this case, the prediction modes of each sub-block within the same PU are the same.
9. The method according to claim 1, characterized in that, Determining the prediction type for the PU includes: The prediction type of the PU is determined based on the element corresponding to the PU in the preset prediction type matrix; or, Based on the value of BV, determine the prediction type of the PU; or, The prediction type of the PU is determined based on the value or parity of its location information; wherein the location information includes row number, column number, and part or all of the location index. or, The prediction type of the PU is determined based on the reconstructed pixel information around the PU.
10. The method according to claim 1, characterized in that, For any PU, the search area includes at least one of the following areas: The PU includes the left pixel region, the top pixel region, the top left pixel region, the top right pixel region, the bottom left pixel region, and a specified pixel block buffer. The specified pixel block buffer is used to store reconstructed pixel blocks that meet specific conditions.
11. The method according to claim 1, characterized in that, If the search area of the PU contains invalid regions, the invalid regions are filled in the following manner: Fill with default values; or, The padding value is determined based on the pixel value of the nearest pixel in the valid region to the invalid region; or, The fill value is determined based on the reference pixel of the previous row of the current CU.
12. The method according to claim 11, characterized in that, The step of determining the fill value based on the pixel value of the pixel closest to the invalid region in the valid region includes: The pixel value of the leftmost column of pixels in the valid region is determined as the pixel value of each column of pixels in the invalid region.
13. The method according to claim 11, characterized in that, Determining the fill value based on the reference pixels of the previous row of the current CU includes: The leftmost reference pixel value in the reference pixels of the current CU's previous row is determined as the fill value; or, The fill value is determined by the average of the leftmost preset number of reference pixels in the previous row of the current CU; wherein the preset number is less than or equal to the total number of reference pixels in the previous row of the current CU; or, The pixel values of the leftmost N reference pixels in the previous row of the current CU are determined as the fill values for each row of the invalid region; where N is equal to the width of the invalid region.
14. The method according to claim 1, characterized in that, The search area of the PU includes the reconstructed pixel area in the current CU; wherein, the search area of the PU is a rectangular area containing the reconstructed pixels in the current CU.
15. The method according to claim 1, characterized in that, For any CU, each PU within that CU is rebuilt one by one according to a preset reconstruction order; The preset reconstruction sequence includes rebuilding row by row for each PU, or rebuilding column by column for each PU.
16. An encoding method, characterized in that, include: For any prediction unit (PU) in the current coding unit (CU), determine the prediction type of that PU; If the prediction type of the PU determines that the PU adopts the intra-block copy prediction (IBC) prediction mode, then search for matching blocks of the PU in the search area. Based on the matching block of the PU, determine the BV of the PU, and encode the BV of the PU; and, The PU is reconstructed based on its matching block.
17. A decoding device, characterized in that, include: The first determining unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU). The second determining unit is used to determine the block vector (BV) of the PU when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU. The acquisition unit is used to acquire the matching block of the PU in the search area based on the BV of the PU; The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
18. An encoding device, characterized in that, include: The determination unit is used to determine the prediction type of any prediction unit (PU) in the current coding unit (CU). The search unit is used to search for matching blocks of the PU in the search area when it is determined that the PU adopts the intra-block copy prediction (IBC) prediction mode based on the prediction type of the PU. An encoding unit is configured to determine the BV of the PU based on the matching block of the PU, and to encode the BV of the PU; and, The reconstruction unit is used to reconstruct the PU based on the matching block of the PU.
19. A decoding terminal device, characterized in that, The decoding device includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor. The processor is configured to execute machine-executable instructions to implement the method according to any one of claims 1-15.
20. An encoding terminal device, characterized in that, The encoding end device includes: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; The processor is configured to execute machine-executable instructions to implement the method of claim 16.
21. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores a plurality of computer instructions, which, when executed by a processor, implement the method of any one of claims 1-15, or, when executed by a processor, implement the method of claim 16.