Decoding method, encoding method, decoder, and encoder

The intra-block copying (IBC-LIC) mode with local illumination compensation solves the bandwidth and traffic pressure problems of video transmission under high video definition and improves decoding performance.

WO2025000289A9PCT designated stage expired Publication Date: 2025-12-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/103395
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Existing digital video compression technologies still face bandwidth and traffic pressures under the demand for high video definition, requiring more efficient encoding and decoding methods to reduce transmission requirements.

Method used

The intra-block copying IBC-LIC mode with local illumination compensation improves decoding performance by determining the prediction mode of the current block and performing illumination compensation.

Benefits of technology

By subdividing the IBC-LIC mode and associating the models, uniform illumination compensation is avoided, which improves the decoding performance of the decoder and reduces the bandwidth and traffic pressure of video transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023103395_26122025_PF_FP_ABST
    Figure CN2023103395_26122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a decoding method, an encoding method, a decoder, and an encoder. The decoding method comprises: determining whether a current block uses an intra block copy based on local illumination compensation (IBC-LIC) mode; if the current block uses the IBC-LIC mode, determining a first prediction mode, used by the current block, of the IBC-LIC mode; and on the basis of a model corresponding to the first prediction mode, performing illumination compensation on a first prediction block obtained by predicting the current block using an IBC mode used by the current block, so as to obtain a second prediction block of the current block. In the present application, the IBC-LIC mode is subdivided into prediction modes, and models are associated with the prediction modes, thereby avoiding the use of a unified model for illumination compensation, and improving the decoding performance of the decoder.
Need to check novelty before this filing date? Find Prior Art

Description

Decoding methods, encoding methods, decoders, and encoders Technical Field

[0001] This application relates to the field of encoding and decoding technology, and more specifically, to decoding methods, encoding methods, decoders, and encoders. Background Technology

[0002] Digital video compression technology mainly compresses massive amounts of digital video data to facilitate transmission and storage.

[0003] With the surge in internet videos and people's increasing demands for video clarity, although existing digital video compression standards can save a lot of video data, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic pressure of digital video transmission.

[0004] Summary of the Invention

[0005] This application provides a decoding method, an encoding method, a decoder, and an encoder, which can improve the decoding performance of the decoder.

[0006] Firstly, this application provides a decoding method, including:

[0007] Determine whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation;

[0008] If the current block uses the IBC-LIC mode, then determine the first prediction mode used by the current block in the IBC-LIC mode;

[0009] Based on the model corresponding to the first prediction mode, illumination compensation is performed on the first prediction block obtained by predicting the current block using the IBC mode used by the current block to obtain the second prediction block of the current block.

[0010] Secondly, this application provides an encoding method, including:

[0011] The model corresponding to at least one mode is traversed to perform illumination compensation on the third prediction block to obtain the first distortion cost set; the third prediction block is the prediction block obtained by using the Intra-Block Copy IBC Advanced Motion Vector Prediction AMVP mode to predict the current block;

[0012] Illumination compensation is performed on the fourth prediction block based on the inheritance model to obtain the second distortion cost set; the fourth prediction block is a reference block in the merging candidate list obtained by predicting the current block based on the IBC merging mode;

[0013] Based on the first distortion cost set and the second distortion cost set, the IBC mode used by the current block is determined.

[0014] Thirdly, this application provides a decoder, including:

[0015] The first determining unit is used to determine whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation;

[0016] The second determining unit is configured to determine, if the current block uses the IBC-LIC mode, the first prediction mode used by the current block in the IBC-LIC mode;

[0017] The compensation unit is used to perform illumination compensation on the first prediction block obtained by predicting the current block using the IBC mode used by the current block, based on the model corresponding to the first prediction mode, to obtain the second prediction block of the current block.

[0018] Fourthly, this application provides an encoder, comprising:

[0019] The first compensation unit is used to traverse the model corresponding to at least one mode to perform illumination compensation on the third prediction block to obtain the first distortion cost set; the third prediction block is a prediction block obtained by using the Intra-Block Copying (IBC) Advanced Motion Vector Prediction (AMVP) mode to predict the current block.

[0020] The second compensation unit is used to perform illumination compensation on the fourth prediction block based on the inherited model to obtain the second distortion cost set; the fourth prediction block is a reference block in the merging candidate list obtained by predicting the current block based on the IBC merging mode;

[0021] The determining unit is configured to determine the IBC mode used by the current block based on the first distortion cost set and the second distortion cost set.

[0022] Fifthly, this application provides a decoder, comprising:

[0023] Processor, adapted to implement computer instructions; and,

[0024] A computer-readable storage medium storing computer instructions adapted for loading by a processor and executing the decoding method in the first aspect or its various implementations mentioned above.

[0025] In one implementation, there are one or more processors and one or more memories.

[0026] In one implementation, the computer-readable storage medium may be integrated with the processor, or the computer-readable storage medium may be disposed separately from the processor.

[0027] Sixthly, this application provides an encoder, comprising:

[0028] Processor, adapted to implement computer instructions; and,

[0029] A computer-readable storage medium storing computer instructions adapted for loading by a processor and executing the encoded methods of the second aspect or its various implementations mentioned above.

[0030] In one implementation, there are one or more processors and one or more memories.

[0031] In one implementation, the computer-readable storage medium may be integrated with the processor, or the computer-readable storage medium may be disposed separately from the processor.

[0032] In a seventh aspect, this application provides a computer-readable storage medium storing computer instructions that, when read and executed by a processor of a computer device, cause the computer device to perform the decoding method or the encoding method described in the first aspect above.

[0033] Eighthly, this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the decoding method described in the first aspect above or the encoding method described in the second aspect above.

[0034] Ninthly, this application provides a bitstream, which is the bitstream described in the first aspect above or the bitstream generated by the second aspect above.

[0035] Based on the above technical solutions, for the decoding method provided in this application, if the current block uses the IBC-LIC mode, it is necessary to further determine the first prediction mode used by the current block in the IBC-LIC mode. Then, based on the model corresponding to the first prediction mode, illumination compensation is performed on the first prediction block obtained by predicting the current block using the IBC mode used by the current block to obtain the second prediction block of the current block. In other words, the IBC-LIC mode is subdivided into prediction modes, and the model is associated with the prediction mode. This avoids using a unified model for illumination compensation and improves the decoding performance of the decoder. Attached Figure Description

[0036] Figure 1 is a schematic block diagram of the video encoding and decoding system provided in this application.

[0037] Figure 2 is a schematic block diagram of the video encoder provided in this application.

[0038] Figure 3 is a schematic structural diagram of the relationship between the coding tree unit and the coding unit provided in this application.

[0039] Figure 4 is a schematic block diagram of the video decoder provided in this application.

[0040] Figure 5 shows examples of images with different brightness but essentially the same texture provided in this application.

[0041] Figure 6 is an example of the modeling relationship between the reference frame and the current frame provided in this application.

[0042] Figure 7 is an example of the CTU and CU partitioning provided in this application.

[0043] Figure 8 is an example of the IBC provided in this application.

[0044] Figure 9 is an example of texture-similar images provided in this application.

[0045] Figure 10 is a schematic flowchart of the decoding method provided in this application.

[0046] Figure 11 is an example of the template area provided in this application.

[0047] Figure 12 is a schematic flowchart of the encoding method provided in this application.

[0048] Figure 13 is a schematic block diagram of the decoder of this application.

[0049] Figure 14 is a schematic block diagram of the encoder of this application.

[0050] Figure 15 is a schematic structural diagram of the electronic device provided in this application. Detailed Implementation

[0051] The solution provided in this application can be applied to the field of digital compression technology.

[0052] Digital video compression technology primarily compresses massive amounts of digital video data to facilitate transmission and storage.

[0053] The solution provided in this application can be applied to the field of digital video coding technology.

[0054] The field of digital video coding technology includes, but is not limited to, at least one of the following: image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding. Furthermore, the solution provided in this application can be integrated with the following standards: Audio Video Coding Standard (AVS), AVS2, or AVS3. For example, it includes, but is not limited to, the H.264 / Audio Video Coding (AVC) standard, the H.265 / High Efficiency Video Coding (HEVC) standard, and the H.266 / Versatile Video Coding (VVC) standard. Additionally, the solution provided in this application can be used for lossy compression or lossless compression of images. This lossless compression can be visually lossless compression or mathematically lossless compression.

[0055] Video codec standards can adopt a block-based hybrid coding framework.

[0056] The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-frame prediction and / or inter-frame prediction. Because there is strong correlation between adjacent pixels within a video frame, intra-frame prediction is used in video coding and decoding to eliminate spatial redundancy between adjacent pixels. Intra-frame prediction only references information from the same frame to predict pixel information within the current block. Because there is strong similarity between adjacent frames in a video, inter-frame prediction is used in video coding and decoding to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency. Inter-frame prediction includes motion estimation and motion compensation. Inter-frame prediction can reference image information from different frames and use motion estimation to search for the motion vector information that best matches the current block. The transform module converts the predicted image block to the frequency domain, redistributing energy. Combined with quantization, information that is insensitive to the human eye can be removed to eliminate visual redundancy. Entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary bitstream.

[0057] The basic process of a video encoder is as follows:

[0058] The encoder first divides a frame of image into blocks; then it predicts the current block in the current image to obtain the predicted block of the current block; next, it subtracts the predicted block from the original block of the current block to obtain the residual block; the residual block is transformed and quantized to obtain the quantization coefficient matrix; then the quantization coefficient matrix is ​​entropy encoded to obtain the output bitstream.

[0059] The basic process of a video decoder is as follows:

[0060] The decoder performs two operations: firstly, it predicts the current block to obtain the prediction block; secondly, it parses the bitstream to obtain the quantization coefficient matrix, and then performs inverse quantization and inverse transform on the quantization coefficient matrix to obtain the residual block. Finally, it adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image, and the decoded image is obtained by performing loop filtering on the reconstructed image or on the blocks.

[0061] It is worth noting that the current block can be the current codec unit (CU) or the current prediction unit (PU), etc.

[0062] Furthermore, the encoder, like the decoder, requires similar operations to obtain the decoded image. The decoded image can serve as a reference frame for inter-prediction in subsequent frames. The block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder need to be written into the bitstream if necessary. The decoder determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoder by parsing and analyzing existing information, thus ensuring that the decoded image obtained by the encoder and the decoder are identical. The decoded image obtained by the encoder is often called the reconstructed image. During prediction, the codec can divide the current block into prediction units; during transform, it can divide the current block into transform units. The division of prediction units and transform units can be different. The above describes the basic flow of a video codec under a block-based hybrid coding framework. With technological advancements, some modules or steps of this framework or process may be optimized, and this application does not specifically limit this.

[0063] It should be noted that the terminology used in the implementation section of this application is only used to explain the specific embodiments of this application and is not intended to limit this application.

[0064] For example, the term "and / or" in this article simply describes the relationship between related objects, indicating that three relationships can exist. For instance, A and / or B can represent: A alone, A and B simultaneously, and B alone. The term "at least one" simply describes the combination relationship of listed objects, indicating that one or more can exist. For instance, at least one of the following: A, B, C can represent the following combinations: A alone, B alone, C alone, A and B simultaneously, A and C simultaneously, B and C simultaneously, and A, B, and C simultaneously. The term "multiple" refers to two or more. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0065] For example, the term "correspondence" can indicate a direct or indirect correspondence between two things, or an association between them, or a relationship of instruction and being instructed, configuration and being configured, etc. The term "instruction" can be direct, indirect, or indicate an association. For example, A instructing B can mean A directly instructs B, for example, B can be obtained through A; it can also mean A indirectly instructs B, for example, A instructs C, B can be obtained through C; or it can mean an association between A and B. The terms "predefined" or "preconfigured" can refer to pre-stored corresponding codes, tables, or other relevant information that can be used for instruction in the device (e.g., including encoders or decoders), or it can refer to something agreed upon by a protocol. "Protocol" can refer to any standard protocol in the field of encoding and decoding, and this application does not limit it. The term "when..." can be interpreted as "if," "when," or "in response to," etc. Similarly, depending on the context, the phrases "if determined" or "if detected (the condition or event of the statement)" can be interpreted as "when determined" or "in response to determined" or "when detected (the condition or event of the statement)" or "in response to detected (the condition or event of the statement)" and similar descriptions. The terms "first," "second," "third," "fourth," "A," "B," etc., are used to distinguish different objects, not to describe a specific order. The terms "includes" and "has," and any variations thereof, are intended to cover non-exclusive inclusion.

[0066] For ease of understanding, the video encoding and decoding system involved in the embodiments of this application will be introduced first with reference to Figure 1.

[0067] Figure 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application.

[0068] As shown in Figure 1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120.

[0069] The encoding device 110 encodes (can be understood as compressing) the video data to generate a bitstream, and transmits the bitstream to the decoding device 120. The decoding device 120 decodes the bitstream generated by the encoding device 110 to obtain the decoded video data.

[0070] Encoding device 110 can be understood as a device with video encoding function, and decoding device 120 can be understood as a device with video decoding function. That is, the embodiments of this application include encoding device 110 and decoding device 120 in a wider range of devices, such as smartphones, desktop computers, mobile computing devices, laptops (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle computers, etc.

[0071] Encoding device 110 can transmit encoded video data (e.g., bitstream) to decoding device 120 via channel 130.

[0072] Channel 130 may include one or more media and / or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120.

[0073] Channel 130 may include one or more communication media that enable encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. Encoding device 110 may modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding device 120. The communication media may include wireless communication media, such as radio frequency spectrum. The communication media may also include wired communication media, such as one or more physical transmission lines.

[0074] Channel 130 may include a storage medium that can store video data encoded by encoding device 110. The storage medium includes various local access data storage media, such as optical discs, DVDs, flash memory, etc. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.

[0075] Channel 130 may include a storage server that stores the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Optionally, the storage server can store and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.

[0076] Encoding device 110 includes video encoder 112 and output interface 113.

[0077] The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter. The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may also be stored on a storage medium or a storage server for later retrieval by the decoding device 120.

[0078] In addition to the video encoder 112 and the input interface 113, the encoding device 110 may also include a video source 111.

[0079] Video source 111 may include at least one of a video capture device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate the video data. Video encoder 112 encodes the video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains encoding information for the pictures or picture sequences in the form of a bitstream. The encoding information may include encoded image data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. The SPS may contain parameters applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the bitstream.

[0080] Decoding device 120 includes input interface 121 and video decoder 122. Input interface 121 may include receiver and / or modem.

[0081] In addition to the input interface 121 and the video decoder 122, the decoding device 120 may also include a display device 123.

[0082] Input interface 121 can receive encoded video data via channel 130. Video decoder 122 decodes the encoded video data to obtain decoded video data and transmits the decoded video data to display device 123. Display device 123 displays the decoded video data. Display device 123 can be integrated with decoding device 120 or external to decoding device 120. Display device 123 can include various display devices, such as liquid crystal display (LCD), plasma display, organic light-emitting diode (OLED) display, or other types of display devices.

[0083] It should be understood that Figure 1 is merely an example of this application and should not be construed as a display of this application. That is to say, the technical solutions of the embodiments of this application are not limited to the system framework shown in Figure 1. For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding.

[0084] The video coding framework involved in the embodiments of this application is described below.

[0085] Figure 2 is a schematic block diagram of the video encoder 200 involved in an embodiment of this application.

[0086] It should be understood that the video encoder 200 can be applied to image data in luminance-chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb(U) represents blue chrominance, Cr(V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr). Of course, it can also be applied to image data in red-green-blue (RGB) format, and this application does not specifically limit this application.

[0087] After reading the video stream, the video encoder 200 divides each frame of the video stream into several coding tree units (CTUs). In some examples, a CTU may be called a "tree block," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU can be, for example, 128×128, 64×64, 32×32, etc. Figure 3 is a schematic structural diagram of the relationship between coding tree units and coding units provided in this application. As shown in Figure 3, a CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular blocks or square blocks. The CU can be further divided into prediction units (PU) and transform units (TU), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a tree (e.g., a quadtree), and the CUs are further divided into TUs and PUs using a tree (e.g., a quadtree).

[0088] The video encoder and video decoder support various PU sizes.

[0089] Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0090] As shown in Figure 2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may contain more, fewer, or different functional components. In this application, the current block may be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be referred to as the predicted image block or the image prediction block, and the reconstructed image block may also be referred to as the reconstruction block or the image reconstruction block.

[0091] Prediction unit 210 includes an inter-prediction unit 211 and an intra-prediction unit 212. Because there is a strong correlation between adjacent pixels in an image within a video, intra-prediction is used in video encoding and decoding to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-prediction is used to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0092] The inter prediction unit 211 can be used for inter prediction, which can include motion estimation and motion compensation. It can reference image information from different frames. Inter prediction uses motion information to find a reference block from the reference frame and generates a prediction block based on the reference block to eliminate temporal redundancy. The reference frame can be a P-frame and / or a B-frame, where P-frame refers to a forward prediction frame and B-frame refers to a bidirectional prediction frame. After finding the reference block using motion information, inter prediction generates a prediction block based on the reference block. Motion information includes the frame list to which the reference frame belongs, the frame index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, then interpolation filtering needs to be used in the reference frame to create the required fractional-pixel blocks. The reference block is the integer-pixel or fractional-pixel block found based on the motion vector. Some techniques directly use the reference block as the prediction block, while others process the reference block further to generate the prediction block. Processing the reference block further to generate the prediction block can also be understood as using the reference block as the prediction block and then processing it to generate a new prediction block.

[0093] The intra prediction unit 212 refers only to information from the same frame of image to predict pixel information within the current code image block, thereby eliminating spatial redundancy. The reference frame used for intra prediction can be an I-frame.

[0094] Intra-prediction employs various prediction modes, utilizing both angular and non-angle prediction modes to predict the image block to be encoded, thus obtaining a prediction block. Based on the prediction block and the image block to be encoded, rate-distortion information is calculated, and the optimal prediction mode for the image block to be encoded is selected. This prediction mode is then written into the bitstream for transmission to the decoder. The decoder parses the prediction mode, predicts the target decoded block, and superimposes it with the temporal residual block obtained from the bitstream to obtain the reconstructed block.

[0095] Taking the H-series international digital video coding standards as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angle prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angle prediction modes. HEVC uses 35 intra-frame prediction modes: Planar, DC, and 33 angular modes. VVC uses 67 intra-frame prediction modes: Planar, DC, and 65 angular modes. These include traditional and non-traditional prediction modes, with non-traditional modes including Matrix-weighted intra-frame prediction (MIP) modes. Traditional prediction modes include: Planar mode (mode number 0), DC mode (mode number 1), and angular prediction modes (mode numbers 2 through 66). It should be noted that as the angle modes increase, the prediction results of intra prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video. The above-mentioned intra prediction mode is only an example of this application and should not be construed as limiting this application.

[0096] The residual unit 220 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 220 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.

[0097] Transform / quantization unit 230 can quantize transform coefficients. Transform / quantization unit 230 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 200 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0098] The inverse transform / quantization unit 240 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.

[0099] The reconstruction unit 250 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing the sampled blocks of each TU of the CU in this way, the video encoder 200 can reconstruct the pixel blocks of the CU.

[0100] The loop filtering unit 260 processes the pixels after inverse transform and inverse quantization to compensate for distortion information and provide a better reference for subsequent encoded pixels. For example, it can perform deblocking filtering to reduce block artifacts in pixel blocks associated with the CU. In some embodiments, the loop filtering unit 260 includes a deblocking filter (DBF) unit and a sample adaptive compensation / adaptive loop filtering (SAO / ALF) unit, wherein the DBF unit is used to remove block artifacts and the SAO / ALF unit is used to remove ringing artifacts.

[0101] The decoded image buffer 270 can store the reconstructed pixel blocks.

[0102] Specifically, the inter prediction unit 211 can use a reference image containing reconstructed pixel blocks in the decoded image buffer 270 to perform inter prediction on PUs in other images. Additionally, the intra prediction unit 212 can use reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU.

[0103] Entropy coding unit 280 can receive quantized transform coefficients from transform / quantization unit 230. Entropy coding unit 280 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0104] Figure 4 is a schematic block diagram of the video decoder involved in the embodiments of this application.

[0105] As shown in Figure 4, the video decoder 300 includes: an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transform unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may contain more, fewer, or different functional components.

[0106] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can parse the bitstream to extract syntax elements. As part of parsing the bitstream, the entropy decoding unit 310 can parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.

[0107] The prediction unit 320 includes: an intra prediction unit 322 and an inter prediction unit 321.

[0108] The intra prediction unit 322 can perform intra prediction to generate prediction blocks for the PU. The intra prediction unit 322 can use an intra prediction mode to generate prediction blocks for the PU based on pixel blocks of spatially adjacent PUs. The intra prediction unit 322 can also determine the intra prediction mode of the PU based on one or more syntax elements parsed from the bitstream.

[0109] The inter prediction unit 321 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter predictive coding, the entropy decoding unit 310 can parse the motion information of the PU. The inter prediction unit 321 can determine one or more reference blocks of the PU based on the motion information of the PU. The inter prediction unit 321 can generate prediction blocks for the PU based on one or more reference blocks of the PU.

[0110] The dequantization / transform unit 330 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transform unit 330 can use the QP value associated with the CU of the TU to determine the degree of quantization. After dequantizing the transform coefficients, the dequantization / transform unit 330 can apply one or more inverse transforms to the dequantized transform coefficients to produce a residual block associated with the TU.

[0111] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 can add the sample of the residual block to the corresponding sample of the prediction block to reconstruct the pixel block of the CU, thereby obtaining the reconstructed image block.

[0112] The loop filter unit 350 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.

[0113] The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0114] Combining Figures 2 and 4, the basic process of video encoding and decoding is as follows:

[0115] At the encoding end, a frame of image is divided into image blocks. For the current block, prediction unit 210 uses intra prediction or inter prediction to predict the prediction block of the current block (i.e., the block to be encoded). Residual unit 220 can calculate the residual block, i.e., the difference between the prediction block and the original block, based on the prediction block and the original block (i.e., the block to be encoded). This residual block can also be called residual information. This residual block can be transformed and quantized by transform / quantization unit 230 to remove information that is not sensitive to the human eye, thereby eliminating visual redundancy. Optionally, the residual block before transformation and quantization by transform / quantization unit 230 can be called a temporal residual block, and the temporal residual block after transformation and quantization by transform / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. Entropy coding unit 280 receives the quantized change coefficients output by change quantization unit 230 and can perform entropy coding on the quantized change coefficients to output a bitstream. For example, entropy coding unit 280 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0116] At the decoding end, the entropy decoding unit 310 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block (i.e., the block to be decoded). Based on the prediction information, the prediction unit 320 uses intra-prediction or inter-prediction to predict the prediction block of the current block (i.e., the block to be decoded). The dequantization / transform unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform dequantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. It is worth noting that the encoding end also needs to use similar operations as the decoder to obtain the decoded image. This decoded image can also be called the reconstructed image, and the reconstructed image can serve as a reference frame for subsequent frames and inter-prediction.

[0117] Furthermore, the block partitioning information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoder determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoder by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder.

[0118] It should be noted that, due to the need for parallel processing, images can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning there is no data dependency between them. The term "frame" can be understood as an image or slice, etc. Furthermore, the above describes the basic flow of a video codec under a block-based encoding and decoding framework. As technology advances, some modules or steps of this framework or flow may be optimized; therefore, this application is not limited to this framework and flow.

[0119] The Joint Video Coding Standards Organization (JVET) has established a group to research a coding model that surpasses the H.266 / VVC model, and has named this model, the platform test software, ECM. Building upon VTM10.0, ECM incorporates newer and more efficient compression algorithms, and currently outperforms VVC by approximately 13% in coding performance. ECM not only increases the coding unit size at specific resolutions but also integrates many intra-prediction and inter-prediction techniques.

[0120] The relevant technologies involved in this application are described below.

[0121] (1) Illumination compensation technology.

[0122] Real-world videos often exhibit variations in lighting intensity, such as decreased light intensity over time, cloud cover, or changes in camera flash intensity. The differences between these video contents and preceding / following frames primarily lie in the strength of the DC component, with minimal impact on texture information. However, due to the significant influence of the DC component, motion search and motion compensation techniques using inter-prediction methods cannot effectively predict these variations, easily incorporating substantial residual information. Local Illuminance Compensation (LIC) effectively removes this redundant DC information, accurately predicts brightness changes, and performs corresponding compensation, resulting in smaller residual information and improved coding efficiency. In the following text, LIC will be referred to simply as illumination compensation.

[0123] The latest video codec standard, H.266 / VVC, has been finalized. The Joint Video Coding Experts Group (JVET) has proposed exploring video codec standards that surpass VVC's coding performance, establishing the exploratory experiment EE2 with the goal of "beyond VVC." The platform reference software used in this experiment is based on VTM 11.0, with new algorithms integrated and the branch redesigned as ECM. Several expert discussion groups have also been established for ECM. The latest ECM reference software version 8.0 already boasts approximately 19% better coding performance than VVC, while VVC, the current latest standard, only offers about 27% better coding performance than the previous generation video codec standard, H.265 / HEVC. It's conceivable that in the near future, ECM may serve as a foundation for exploring and researching the next generation of video codec standards.

[0124] In the early days of ECM, the reference software already integrated encoding tools that VVC did not have. These encoding tools provided efficient encoding performance and processing capabilities for different encoding scenarios of ECM, including LIC. The following is a brief introduction to LIC in the current ECM.

[0125] Illumination compensation is an inter-coding technique. During the encoding process, the current coding unit obtains a corresponding reference block based on the motion vector information (MV). This reference block usually comes from different coding frames, or in other words, the reference coding unit does not belong to the current image. Images in different frames may have significant or minor variations in certain specific scenes, and illumination compensation is very effective in handling some of these variations.

[0126] Figure 5 shows examples of images with different brightness but essentially the same texture provided in this application.

[0127] As shown in Figure 5, the texture information of the left and right parts is basically the same, the difference lies in the brightness variation. The right image is very bright due to the camera flash, while the left image is illuminated by normal natural light. This difference creates a significant burden on video encoding. Assuming the left block uses the right block as a reference coding unit, and their texture information is identical, the difference in texture detail is small, but the overall residual is large. This is because the pixels in the right image were shifted due to the flash, and this shift is included in the residual. Directly transforming and quantizing this residual before writing it into the bitstream incurs a huge overhead.

[0128] The illumination compensation technique in ECM reference software eliminates the effects of factors such as flash or changes in illumination through linear fitting, resulting in better overall prediction performance.

[0129] The main components of illumination compensation technology are as follows:

[0130] The correlation between the reconstructed samples of the reference coding unit and the adjacent parts of the current coding unit is used to fit the correlation between the changes of the predicted samples within the coding unit and the reference samples. This is because the reconstructed samples adjacent to the current coding unit on the top and left sides, if they exist, can be obtained, as can the reconstructed samples adjacent to the reference coding unit in the reference image. Modeling the reconstructed samples of the current frame and the reconstructed samples of the reference image yields the corresponding fitting model.

[0131] During the modeling process, ECM uses linear fitting for illumination compensation. The model is simplified to fit the illumination changes between the current frame and the reference frame using a scaling parameter 'a' and a bias parameter 'b'. The relationship between these changes is represented by the model parameters as follows: Pred′(x,y)=a·Pred(x,y)+b.

[0132] Where Pred(x,y) is the predicted block before illumination compensation, Pred′(x,y) is the predicted block after illumination compensation, a is the scaling parameter in the illumination compensation model, and b is the offset parameter in the illumination compensation model. Both a and b in the formula need to be calculated using the image information of the current frame (also called the current image) and the image information of the reference frame (also called the reference image). This is obtained by modeling the spatially adjacent reconstructed pixels of the current block and the corresponding adjacent pixels of the reconstructed blocks in the reference image. The derivation formula is as follows: Curr_Rec neigh =a·Ref_Rec neigh +b.

[0133] Among them, Curr_Rec neigh For the reconstructed image of the current frame, Ref_Rec neigh As shown in Figure 6, the reconstructed image of the reference frame can be used to correct for illumination differences during the digital video encoding and decoding process, resulting in a compensated prediction block.

[0134] Furthermore, the scaling parameter a and offset parameter b can be calculated using the adjacent reconstructed pixels of the reconstructed block corresponding to the current block in the reference image and the adjacent reconstructed pixels of the coded block in the current image. The correlation between the adjacent reconstructed pixels of the current frame coding unit and the reconstructed pixels at the corresponding positions in the reference image can be modeled and solved.

[0135] Figure 7 is an example of the CTU and CU partitioning provided in this application.

[0136] As shown in Figure 7, by modeling and solving the linear relationship between the nearest reconstructed pixels of the corresponding CU in the current image and the reference image, the scaling parameter a and the offset parameter b are obtained. Then, this linear relationship is applied to the corresponding reconstructed CU in the reference image to obtain the prediction block of the CU to be encoded in the current image.

[0137] The specific modeling process is as follows:

[0138] The illumination compensation model in ECM is a linear model. The model parameters include a scaling factor *a* and an offset parameter *b*, both obtained using the least squares error method. The number of reconstructed samples is determined based on the width and height of the current coding unit. If either the width or height of the current coding unit is equal to 4, then 4 reconstructed samples are taken from the top and left adjacent reconstructed samples of the unit. For example, if the current coding unit is 16 wide and 4 high, then 4 samples are taken from the left adjacent reconstructed samples and 4 samples are taken from the top adjacent reconstructed samples with a stride of 3. If neither the width nor height of the current coding unit is equal to 4, then pixel samples are obtained from the top and left adjacent reconstructed samples, with a logarithm of 2 for the smaller side length.

[0139] After obtaining the reconstructed samples from the top and left sides, the model parameters are calculated. Let the obtained reference frame reconstructed sample be denoted as x, and the current frame reconstructed sample as y; then the sum of the reference frame reconstructed samples is denoted as sumX, and the sum of the current frame reconstructed samples as sumY; the sum of the squares of the reference frame reconstructed samples is denoted as sumXX, and the sum of the products of the reference frame reconstructed samples and the current frame reconstructed samples is denoted as sumXY. The parameter calculations are: a = (sumXY - sumXsumY) / (sumXX – sumXsumX) b = sumY – a * sumX

[0140] Here, sumXsumY represents sumX multiplied by sumY. The calculation process in the ECM reference software involves some shifting operations, which are simplified and will not be elaborated upon here. After obtaining the linear model parameters, the final prediction block is obtained by performing a linear transformation on the motion-compensated prediction block.

[0141] If the reconstructed samples used to calculate the linear model parameters belong to the inter-prediction block, then interpolation is required.

[0142] Illumination compensation techniques in ECM can be applied to normal inter-frame prediction, merge prediction mode, and sub-block mode. Normal inter-frame prediction is referred to as inter mode, merge prediction mode as merge mode, and sub-block mode as affine mode. Furthermore, illumination compensation techniques can be applied only to single-frame prediction modes, but are prohibited from use in multi-frame bidirectional reference modes.

[0143] Furthermore, the illumination compensation technique in ECM is coupled with the adopted techniques. In the current coding unit, the illumination compensation technique is not used simultaneously with bidirectional optical flow (BDOF) and symmetric motion vector difference (SMVD) techniques.

[0144] (2) Application of illumination compensation technology in Intra Block Copy (IBC) technology.

[0145] Typically, illumination compensation techniques are used in inter-frame prediction. However, there's a similar technique in intra-frame prediction called IBC (Intra-Block Frame Prediction). As the name suggests, IBC finds a block within the current image that matches or is close to the current block, copies it, and uses it as the predicted block for the current frame. This is a prediction technique specifically designed for screen content encoding.

[0146] Figure 8 is an example of the IBC provided in this application.

[0147] As shown in Figure 8, the coded block contains an inverted triangular graphic texture. Using traditional intra-frame prediction techniques to encode the current block would require a significant amount of bits to encode residual information. However, with IBC (Intra-Frame Coding), a search is performed within a defined area of ​​the current image to find a similar or identical location in the upper left corner. Through distortion cost calculation or hash value matching, the found reconstructed block is determined and copied as the prediction block for the current block. It can be seen that this prediction technique is much more efficient than traditional intra-frame coding. In some cases, it can even find completely identical prediction blocks, eliminating the need to encode residual information and significantly saving bit overhead. Furthermore, the solid line with arrows represents the block vector information (BV) of the current block. At the decoding end, the matching reconstructed block is found using the BV as the prediction block for the current block.

[0148] Similar to inter-frame prediction, IBC has two modes: Advanced Motion Vector Prediction (AMVP) mode and Skip / Merge mode, also known as merge mode.

[0149] In AMVP mode, IBC needs to transmit an index to indicate which block vector prediction (BVP) and block vector difference (BVD) are used.

[0150] In skip / merge mode, IBC needs to transmit an index to indicate which BV information is being used.

[0151] Similar to inter-frame prediction, in certain application scenarios, even if the texture information within a coded block is identical, color differences may still exist. In natural sequences, the most common scenario is lighting variations. For example, a camera might be fixedly illuminating a building. The video content of the building captured in the morning and afternoon might be the same, but the lighting intensity has changed. Therefore, even if inter-frame prediction uses the decoded reconstructed frame as reference content, it cannot completely represent the video content because the overall mean of the video content differs due to different lighting, resulting in significant residual bitstream consumption for encoding. Illumination compensation technology effectively solves this problem by establishing a linear model to transform the reference content and the current content, adapting to changes in lighting intensity without altering the texture content.

[0152] In short, a similar problem exists in screen content encoding. Even if the encoded blocks are identical, color discrepancies or other issues can lead to low encoding efficiency of IBC technology, or even the inability to find similar encoded blocks. For example, for four sub-images with the same texture but different colors, the significant color differences can reduce the efficiency of block copying technology or even prevent it from matching the reconstructed image content.

[0153] IBC-LIC technology is similar to LIC technology. It establishes a linear relationship between reference blocks and coding blocks, transforming the reference block to serve as the prediction block for the current coding unit. The process is identical to the LIC part described above. In AMVP mode, IBC requires an identifier to indicate whether LIC technology is used, while in merge mode, LIC technology is enabled and disabled through inheritance. For example, given four sub-images with the same texture but different colors, after enabling IBC-LIC technology, starting from the second sub-image, more and more coding blocks will use IBC-LIC technology to copy the content of previously reconstructed sub-images.

[0154] The above analysis shows that IBC-LIC technology can indeed provide very impressive performance in screen content encoding applications. Its calculation process is the same as that of LIC technology, and its complexity is acceptable and cost-effective, both from a software and hardware perspective.

[0155] However, IBC-LIC, which uses the same reference samples from both the upper and left template regions as inputs for modeling as reconstructed samples, may not be well-suited for screen content encoding scenarios. Typically, in natural sequences, illumination changes should affect the content within the current image uniformly. However, in screen content scenarios, content changes at the pixel level, resulting in sharpening. While the upper template region might reflect the linear relationship between the current block and the reference block, the left template region could differ significantly from the current block, potentially negatively impacting the linear model. For example, in some presentation applications, color changes are rapid and drastic; some shapes are red, but the next shape might be green. If the current encoding unit includes two colors, and the reference reconstructed block has the same texture but different color variations, the parameters calculated using the template cannot accurately reflect the relationship between the different colors. In this case, the model parameters resemble a compromise fit.

[0156] Figure 9 is an example of texture-similar images provided in this application.

[0157] As shown in Figure 9, suppose the left sub-image has an orange background and the right sub-image has a blue background. These two are very similar in shape and some color gradients are also quite similar. Therefore, copying the edge shape and then performing color compensation is a very effective method to save bitrate. However, for the coded block located at the edge of the right sub-image, since the area covered by the template of this coded block usually has multiple colors, and the predicted block also has different colors, this will cause the model's fitting effect to be inaccurate, thereby reducing the encoding performance of the encoder and the decoding performance of the decoder.

[0158] For example, when the prediction block located in the lower left corner of the right subimage references the same part of the left subimage, the curve contours and color changes are almost identical, which can save a lot of bits for the coding block. However, because the template region mixes and calculates the linear relationships between white and white, and orange and blue, the calculated linear model parameters are inaccurate, reducing the effectiveness of the linear transformation in the prediction block. Specifically, the blue area in the prediction block is obtained by linearly transforming the orange area in the reference block, but because a large proportion of the linear fitting of white to white is involved in the calculation parameters, the color difference change of orange to blue is insufficient; similarly, the white part should not be changed, but because the linear fitting of orange to blue changes the parameters, the resulting white has a color difference. In the end, the residual of the prediction block is more than expected, the coding efficiency is greatly reduced, and the decoding efficiency of the decoder is increased accordingly. In view of this, this application provides a decoding method, an encoding method, a decoder, and an encoder that can improve decoding performance.

[0159] Figure 10 is a schematic flowchart of the decoding method 400 provided in this application. It should be understood that the decoding method 400 can be executed by a decoder. For example, the decoding method 400 can be executed by the video decoder 122 shown in Figure 1 or the video decoder 300 shown in Figure 4. For ease of description, the following explanation uses a decoder as an example.

[0160] As shown in Figure 10, the decoding method 400 may include some or all of the following:

[0161] S410, the decoder determines whether the current block uses Intra Block CopyLocal Illuminance Compensation (IBC-LIC) mode.

[0162] For example, the IBC-LIC mode can be the IBC-LIC mode in the IBC Advanced Motion Vector Prediction (AMVP) mode or the IBC-LIC mode in the IBC merge mode.

[0163] In other words, the decoder determines whether the current block uses IBC-LIC mode under IBCCAMVP mode or IBC-LIC mode under IBC merge mode.

[0164] It should be noted that the IBC-LIC mode refers to illumination compensation of the predicted block obtained by predicting the current block using IBC using LIC technology. In other alternative embodiments, the IBC-LIC mode may also be referred to as the prediction mode corresponding to IBC and LIC, the compensation mode corresponding to IBC and LIC, or other terms with similar meanings, and this application does not limit it in this way.

[0165] S420, if the current block uses the IBC-LIC mode, the decoder determines the first prediction mode used by the current block in the IBC-LIC mode.

[0166] For example, the first prediction mode is a sub-mode of the IBC-LIC mode.

[0167] For example, the first prediction mode is a certain type of IBC-LIC mode.

[0168] For example, the first prediction mode is the IBC-LIC mode corresponding to a specific model.

[0169] For example, the first prediction mode can be a sub-mode of the IBC-LIC mode under the IBCAMVP mode.

[0170] For example, the first prediction mode can be a sub-mode of the IBC-LIC mode in the IBC merging mode.

[0171] S430, the decoder performs illumination compensation on the first prediction block obtained by predicting the current block using the IBC mode used by the current block, based on the model corresponding to the first prediction mode, to obtain the second prediction block of the current block.

[0172] For example, the IBC mode used by the current block can be IBC AMVP mode or IBC merge mode.

[0173] For example, when the IBC mode used by the current block is IBCAMVP mode, the first prediction mode is a sub-mode of IBC-LIC mode under IBCAMVP mode. In this case, the decoder can perform illumination compensation on the first prediction block obtained by predicting the current block using IBCAMVP mode based on the model corresponding to the first prediction mode, and obtain the second prediction block of the current block.

[0174] For example, when the IBC mode used by the current block is the IBC merging mode, the first prediction mode is a sub-mode of the IBC-LIC mode under the IBC merging mode. In this case, the decoder can perform illumination compensation on the first prediction block obtained by predicting the current block using the IBC merging mode based on the model corresponding to the first prediction mode, and obtain the second prediction block of the current block.

[0175] For example, after the decoder predicts the current block based on the IBC mode used by the current block to obtain a first prediction block, it determines the model parameters of the model corresponding to the first prediction mode based on the format of the model corresponding to the first prediction mode. Then, the decoder can perform illumination compensation on the first prediction block based on the model parameters of the first model to obtain the second prediction block. Optionally, the format of the model corresponding to the first prediction mode includes, but is not limited to, the number of models corresponding to the first prediction mode, the template region used by the model corresponding to the first prediction mode, and the adjustment parameters corresponding to the first prediction mode. Of course, the information included in the above format is only an example of this application.

[0176] It is worth noting that the model parameters of the model corresponding to the first prediction mode are the scaling parameter a and the offset parameter b mentioned above, and their calculation method can refer to the calculation formulas for scaling parameter a and offset parameter b mentioned above. Similarly, when the decoder performs illumination compensation on the first prediction block based on the model corresponding to the first prediction mode, it can apply this linear relationship to the first prediction block to obtain the second prediction block. The specific compensation method can be referred to the relevant content in Figure 6, and will not be elaborated here to avoid repetition.

[0177] In this embodiment, for the decoding method provided by this application, if the current block uses the IBC-LIC mode, it is necessary to further determine the first prediction mode used by the current block in the IBC-LIC mode. Then, based on the model corresponding to the first prediction mode, illumination compensation is performed on the first prediction block obtained by predicting the current block using the IBC mode used by the current block to obtain the second prediction block of the current block. This is equivalent to subdividing the IBC-LIC mode into prediction modes and associating the model with the prediction mode, thereby avoiding the use of a unified model for illumination compensation and improving the decoding performance of the decoder.

[0178] The beneficial effects of the solution provided in this application are explained below based on the test results.

[0179] Table 1 shows the test results after integrating the decoding method provided in this application into the latest ECM8.0.

[0180] Table 1

[0181] As shown in Table 1, Class F and class TGM are dedicated sequence classes for screen content encoding. The SlideShow and SlideEditing sequences in class F represent the application scenarios mentioned earlier. In the table, Y represents luminance (Luma), U represents blue chroma, and V represents red chroma; negative values ​​indicate performance gains. EncT represents the transformation of encoding complexity, and DecT represents the transformation of complexity. Simulation results show that the decoding method provided in this application can improve decoding performance, especially with the most significant gain in class F.

[0182] In some embodiments, S420 may include:

[0183] Decode the bitstream and determine the first index;

[0184] The first index is used to indicate the first prediction mode in at least one mode.

[0185] For example, the at least one mode can be at least one IBC-LIC mode. For instance, the at least one mode can be at least one IBC-LIC mode belonging to the IBCAMVP mode. In other words, the first index can be used to indicate the first prediction mode in at least one IBC-LIC mode belonging to the IBCAMVP mode. In this case, when the IBC mode used by the current block is the IBCAMVP mode, the decoder decodes the bitstream to determine the first index, and based on the model corresponding to the first prediction mode indicated by the first index, performs illumination compensation on the first prediction block obtained by predicting the current block using the IBCAMVP mode to obtain the second prediction block of the current block.

[0186] Of course, in other alternative embodiments, when the IBC mode used by the current block is IBC merging mode, the decoder can also decode the bitstream to determine the first index and determine the prediction mode indicated by the first index as the first prediction mode. This application does not specifically limit this. Furthermore, this application does not specifically limit the parsing method of the first index. For example, a context-based method or an equal-probability method can be used to parse the first index.

[0187] In some embodiments, the first index is used to indicate the first predicted mode among the sorted at least one mode; the method 400 may further include:

[0188] Determine the distortion cost of the at least one mode; wherein the distortion cost of any one of the at least one modes is determined based on the reconstructed samples within the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode, the at least one predicted sample including the predicted sample obtained by predicting the samples within the template region of the current block using the IBC-LIC mode; based on the distortion cost of the at least one mode, sort the at least one mode to obtain the sorted at least one mode.

[0189] For example, the distortion cost can be any cost that can characterize the difference, such as SAD, transform-based SATD, etc.

[0190] For example, the codeword of the first index is related to the position of the first prediction mode in the sorted at least one set of modes. For instance, the codeword of the first index is negatively correlated with the position of the first prediction mode in the sorted at least one set of modes. That is, the earlier the position of the first prediction mode in the sorted at least one set of modes, the smaller the codeword of the first index, thereby reducing the codeword size of the first index. For the encoder, the encoder can sort the modes according to the distortion cost, using shorter codewords for encoding and transmission for modes with lower costs, and longer codewords for transmission for modes with higher costs, thereby improving the encoding efficiency of the encoder and the decoding efficiency of the decoder.

[0191] In some embodiments, the method 400 may further include:

[0192] A first model is determined based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the first predicted block; wherein the at least one mode includes a first mode corresponding to the first model.

[0193] For example, the decoder can determine the model parameters of the first model based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the first predicted block. Optionally, the model parameters of the first model may include the scaling parameter a and the offset parameter b as mentioned above. The calculation method of these parameters can be referred to the calculation formulas for the scaling parameter a and the offset parameter b above, and will not be repeated here to avoid repetition.

[0194] It is worth noting that the position of the template region of the current block relative to the current block and the position of the template region of the first prediction block relative to the first prediction block may be the same or different, and this application does not make specific limitations in this regard.

[0195] In some embodiments, the method 400 may further include:

[0196] The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model; wherein, the at least one mode includes a second mode corresponding to the second model.

[0197] For example, the decoder can adjust the parameters of the first model based on the adjustment value corresponding to the first mode to obtain the model parameters of the second model. Optionally, the model parameters of the first model may include the scaling parameter a and the offset parameter b as mentioned above, and the adjustment parameters include the adjustment amount of the scaling parameter a and / or the adjustment amount of the offset parameter b.

[0198] For example, when the decoder adjusts the scaling parameter 'a' of the first model, it can obtain the scaling parameter 'a' of the second model through any of the following methods: multiplying the scaling parameter 'a' of the first model by the adjustment amount of scaling parameter 'a', subtracting the adjustment amount of scaling parameter 'a' from the scaling parameter 'a' of the first model, or adding the scaling parameter 'a' of the first model to the adjustment amount of scaling parameter 'a'. Similarly, when the decoder adjusts the bias parameter 'b' of the first model, it can obtain the offset parameter 'b' of the second model through any of the following methods: multiplying the offset parameter 'b' of the first model by the adjustment amount of offset parameter 'b', subtracting the adjustment amount of offset parameter 'b' from the offset parameter 'b' of the first model, or adding the offset parameter 'b' of the first model to the adjustment amount of offset parameter 'b'.

[0199] In some embodiments, the method 400 may further include:

[0200] Identify multiple third models;

[0201] Wherein, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples in the template region of the current block and a second sample group obtained by dividing the predicted samples in the template region of the first prediction block; the at least one mode includes a third mode corresponding to the plurality of third models.

[0202] For example, the model parameters of any third model can be determined based on the reconstructed samples in the first sample group and the reconstructed samples in the second sample group. Optionally, the model parameters of any third model may include the scaling parameter a and the offset parameter b as mentioned above. The calculation method can refer to the calculation formulas of scaling parameter a and offset parameter b mentioned above. To avoid repetition, they will not be repeated here.

[0203] In some embodiments, the method 400 may further include:

[0204] Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models;

[0205] Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

[0206] For example, the decoder can adjust the parameters of the plurality of third models based on the adjustment value corresponding to the third mode to obtain the model parameters of a plurality of fourth models. Optionally, the model parameters of any one of the plurality of third models may include the scaling parameter a and the offset parameter b as described above. Optionally, the adjustment parameters include the adjustment amount of the scaling parameter a and / or the adjustment amount of the offset parameter b. Optionally, the adjustment value corresponding to the third mode may include the adjustment value corresponding to each of the plurality of third models; or, the adjustment value corresponding to the third mode may include the adjustment value shared by the plurality of third models.

[0207] The following explanation uses the adjustment values ​​shared by the multiple third models, including the adjustment amount of scaling parameter a and / or the adjustment amount of bias parameter b, as an example.

[0208] For example, when the decoder adjusts the scaling parameter 'a' for each third model, it can obtain the scaling parameter 'a' for the multiple fourth models in any of the following ways: multiplying the scaling parameter 'a' for each third model by the adjustment amount of scaling parameter 'a', subtracting the adjustment amount of scaling parameter 'a' from the scaling parameter 'a' for each third model, or adding the scaling parameter 'a' for each third model to the adjustment amount of scaling parameter 'a'. Similarly, when the decoder adjusts the bias parameter 'b' for each third model, it can obtain the offset parameter 'b' for the multiple fourth models in any of the following ways: multiplying the offset parameter 'b' for each third model by the adjustment amount of offset parameter 'b', subtracting the adjustment amount of offset parameter 'b' from the offset parameter 'b' for each third model, or adding the offset parameter 'b' for each third model to the adjustment amount of offset parameter 'b'.

[0209] In some embodiments, the method 400 may further include:

[0210] Based on the values ​​of the reconstructed samples in the template region of the first prediction block, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups; the reconstructed samples in the template region of the current block that correspond to the second sample group are divided into the first sample group.

[0211] For example, the decoder divides the reconstructed samples in the template region of the first prediction block into multiple sample groups based on the values ​​of the reconstructed samples in the template region of the first prediction block, wherein the second sample group is any one of the multiple sample groups; the reconstructed samples in the template region of the current block whose positions correspond to the second sample group are divided into the first sample group; based on this, the decoder can determine the multiple third models based on each second sample group obtained by dividing the reconstructed samples in the template region of the first prediction block and the first sample group corresponding to each second sample group.

[0212] For example, the decoder may divide the reconstructed samples in the template region of the first prediction block into one or more second sample groups based on at least one predefined numerical range. Alternatively, the decoder may determine at least one numerical range based on the reconstructed samples in the template region of the first prediction block, and then divide the reconstructed samples in the template region of the first prediction block into one or more second sample groups based on the at least one numerical range.

[0213] For example, the predefined at least one numerical range can be implemented by pre-saving the corresponding code, table or other means that can be used to indicate relevant information in the decoder, or the predefined at least one numerical range can be agreed or defined by a standard protocol.

[0214] For example, the at least one numerical range can be at least one absolute value range. Accordingly, the decoder can classify a reconstructed sample in the template region of the first prediction block into the numerical range to which the value of that reconstructed sample belongs.

[0215] For example, the decoder can characterize or determine the range of the at least one numerical value through multiple numerical values.

[0216] For example, the at least one numerical range and the at least one group can be in a one-to-one correspondence, or the at least one numerical range and the at least one group can be in a many-to-one relationship.

[0217] In this embodiment, the decoder divides the reconstructed samples in the template region of the first prediction block into multiple sample groups based on the values ​​of the reconstructed samples in the template region of the first prediction block, and divides the reconstructed samples in the template region of the current block based on the division results of the reconstructed samples in the template region of the first prediction block. This enables the multiple third models to match the distribution of the reconstructed samples in the template region of the first prediction block as closely as possible, improves the illumination compensation effect of the multiple third models, and thus improves the decoding performance of the decoder.

[0218] Of course, the sample group involved in this application can also be understood or equivalently replaced by terms with similar meanings such as set or group.

[0219] In some embodiments, the average value of reconstructed samples in the template region of the first prediction block is determined; based on the average value, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed samples is greater than or equal to the average value, and a sample group in which the value of the reconstructed samples is less than the average value.

[0220] For example, when the plurality of third models are two third models, the decoder can divide the reconstructed samples in the template region of the first prediction block into: a sample group in which the value of the reconstructed sample is greater than or equal to the average value, and a sample group in which the value of the reconstructed sample is less than the average value, based on the average value.

[0221] Of course, in other alternative embodiments, the decoder may also classify reconstructed samples in the template region of the first prediction block with an offset less than or equal to a preset threshold into a single reconstructed sample group, or classify the reconstructed samples in the template region of the first prediction block in other ways. Furthermore, the decoder may first classify the reconstructed samples in the template region of the current block, and then classify the reconstructed samples in the template region of the first prediction block based on the classification results of the reconstructed samples in the template region of the current block. This application does not specifically limit this approach.

[0222] In some embodiments, the template area of ​​the current block includes the upper template area and / or the left template area.

[0223] For example, the template region of the current block may be only the upper template region, or the template region of the current block may be only the left template region, or the template region of the current block may include both the upper template region and the left template region. Taking the decoder determining the first model based on the reconstructed samples in the template region of the current block and the reconstructed samples in the template region of the first prediction block as an example, after the decoder predicts the current block based on the IBC mode used by the current block to obtain the first prediction block, it obtains the upper template region of the first prediction block and the upper template region of the current block, and calculates the model parameters of the first model based on the upper template region of the first prediction block and the upper template region of the current block.

[0224] In this embodiment, it is proposed to add illumination compensation only for the upper template region and only for the left template region. In other words, it proposes a scheme to calculate the linear model parameters and then perform illumination compensation using only the template region samples on one side, which can improve the flexibility and effect of illumination compensation.

[0225] For example, the upper template area includes, but is not limited to, at least one of the following: the template area directly above, the template area to the upper left, and the template area to the upper right.

[0226] For example, taking the upper template area of ​​the current block as an example, the upper template area of ​​the current block can be the template area directly above the current block, or it can be the template area directly above and to the upper left of the current block, or it can be the template area directly above and to the upper right of the current block. The settings can include the template areas to the upper left, directly above, and to the upper right of the current block. Specifically, the template area directly above the current block can refer to the template area above the current block, whose left boundary is aligned with the left boundary of the current block, and whose right boundary is aligned with the right boundary of the current block; the template area to the upper right of the current block can refer to the template area above the current block, whose left boundary is aligned with the right boundary of the current block; and the template area to the upper left of the current block can refer to the template area above the current block, whose right boundary corresponds to the left boundary of the current block.

[0227] For example, the left template area includes, but is not limited to, at least one of the following: the template area on the very left, the template area on the upper left, and the template area on the lower left.

[0228] For example, taking the left template area of ​​the current block as an example, the left template area of ​​the current block can be the template area directly to the left of the current block, or it can be the template area on the directly left and upper left sides of the current block, or it can be the template area on the directly left and lower left sides of the current block. The settings can include the template areas on the directly left, upper left, and lower left sides of the current block. Specifically, the template area on the directly left side of the current block can refer to the template area on the left side of the current block, whose upper boundary is aligned with the upper boundary of the current block, and whose lower boundary is aligned with the lower boundary of the current block; the template area on the upper left side of the current block can refer to the template area on the left side of the current block, whose lower boundary is aligned with the upper boundary of the current block; and the template area on the lower left side of the current block can refer to the template area on the left side of the current block, whose upper boundary corresponds to the lower boundary of the current block.

[0229] In some embodiments, the sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region; wherein, the samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the mode in the at least one mode.

[0230] For example, the difference between the sampling step size used when the template region of the current block includes the upper template region and the left template region, and the sampling step size used when the template region of the current block is either the upper template region or the left template region, is a preset value, which is any value greater than 0. For instance, the difference between the sampling step size used when the template region of the current block includes the upper template region and the left template region, and the sampling step size used when the template region of the current block is either the upper template region or the left template region, is 2 or some other value.

[0231] For example, the sampling step size used when the template region of the current block includes the upper template region and the left template region is a multiple of the sampling step size used when the template region of the current block is either the upper template region or the left template region. For instance, the sampling step size used when the template region of the current block includes the upper template region and the left template region is twice or another multiple of the sampling step size used when the template region of the current block is either the upper template region or the left template region.

[0232] Because calculating model parameters using samples from both the upper and left template regions typically requires more samples than calculating them using only the upper template region, the accuracy of the model calculated using samples from both regions is correspondingly higher. In this embodiment, the number of samples participating in the model calculation is increased by reducing the sampling step size; even all available samples within the template region are selected to calculate the linear model parameters; thus, the model accuracy can be improved when calculating model parameters using only the upper or left template region.

[0233] In some embodiments, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0234] For example, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is N (a positive integer) more than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region. Alternatively, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is a multiple of the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region. For example, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is twice or another multiple of the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0235] For example, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is M (a positive integer) rows more than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region. Alternatively, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is a multiple of the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region. For example, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is twice or another multiple of the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0236] Because calculating model parameters using samples from both the upper and left template regions typically requires more samples than calculating them using only the upper template region, the accuracy of the model calculated using samples from both regions is correspondingly higher. In this embodiment, by expanding the template region area to obtain broader and more spatial information, the model accuracy when calculating model parameters using only the upper template region can be improved.

[0237] In some embodiments, when the template region of the current block is the left template region, the number of sample rows in the left template region is greater than the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the left template region, the number of sample columns in the left template region is greater than the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0238] For example, when the template region of the current block is the left template region, the number of sample rows in the left template region is N (a positive integer) more than the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region. Alternatively, when the template region of the current block is the left template region, the number of sample rows in the left template region is a multiple of the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region. For example, when the template region of the current block is the left template region, the number of sample rows in the left template region is twice or another multiple of the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0239] For example, when the template region of the current block is the left template region, the number of sample columns in the left template region is M (a positive integer) rows more than the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region. Alternatively, when the template region of the current block is the left template region, the number of sample columns in the left template region is a multiple of the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region. For example, when the template region of the current block is the left template region, the number of sample columns in the left template region is twice or another multiple of the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0240] Because calculating model parameters using samples from both the upper and left template regions typically requires more samples than calculating them using only the left template region, the accuracy of the model calculated using samples from both regions is correspondingly higher than that calculated using only the left template region. In this embodiment, by expanding the template region area to obtain broader and more spatial information, the model accuracy when calculating model parameters using only the left template region can be improved.

[0241] Figure 11 is an example of the template region of the current block provided in this application.

[0242] As shown in Figure 11, (a) of Figure 11 shows an example where the template area of ​​the current block includes both the top template area and the left template area; (b) of Figure 11 shows an example where the template area of ​​the current block only includes the top template area; and (c) of Figure 11 shows an example where the template area of ​​the current block only includes the left template area. As shown in Figure 11, for cases where the template area of ​​the current block only includes the top template area or the left template area, the template area can be directly expanded. For example, as shown in Figure 11(b), when the template area of ​​the current block only includes the top template area, the template height can be kept constant while increasing the width of the template area (i.e., adding an expanded upload template area); as shown in Figure 11(c), when the template area of ​​the current block only includes the left template area, the template width can be kept constant while increasing the height of the template area (i.e., adding an expanded left template area).

[0243] Of course, the number of reference rows in the template region can also be increased to increase the number of samples and obtain more spatial information. For example, the upper template region consists of two, three, or four rows of reconstructed samples, while the left template region consists of two, three, or four columns of reconstructed samples. This application expands the template region, and different expansion methods can bring more samples and more spatial information to participate in the calculation of model parameters. Furthermore, in some embodiments, the decoder can also add boundary checks for the selection of the template region of the current block. For example, for unavailable samples, the decoder does not use the template region or uses the partially available samples in the template region to calculate model parameters.

[0244] In some embodiments, S420 may include:

[0245] Decode the bitstream and determine at least one index; wherein the at least one index includes at least one of the following: an index for indicating whether the model corresponding to the first prediction mode is a single model or multiple models, an index for indicating the template region used by the model corresponding to the first prediction mode, an index for indicating whether the model corresponding to the first prediction mode is a model after parameter adjustment, and adjustment parameters corresponding to the first prediction mode; determine the first prediction mode based on the at least one index.

[0246] For example, when the IBC mode used by the current block is IBCAMVP mode, the decoder decodes the bitstream to determine the at least one index, and determines the first prediction mode based on the at least one index; then, based on the model corresponding to the first prediction mode, illumination compensation is performed on the first prediction block obtained by predicting the current block using the IBCAMVP mode to obtain the second prediction block of the current block.

[0247] Of course, in other alternative embodiments, when the IBC mode used by the current block is IBC merging mode, the decoder can also decode the bitstream to determine the at least one index and determine the first prediction mode based on the at least one index. This application does not specifically limit this. Furthermore, this application does not specifically limit the parsing method of the at least one index. For example, a context-based method or an equal-probability method can be used to parse the at least one index.

[0248] In some embodiments, S410 may include:

[0249] If the IBC mode used by the current block is the IBC Advanced Motion Vector Prediction (AMVP) mode, then decode the bitstream and determine the first identifier; if the first identifier indicates that the current block is allowed to use the IBC-LIC mode, then determine that the current block uses the IBC-LIC mode.

[0250] For example, if the IBC mode used by the current block is IBCAMVP mode, the decoder obtains a first identifier by parsing the bitstream. If the first identifier indicates that the current block is allowed to use the IBC-LIC mode, the decoder obtains a first index by decoding the bitstream. The first index is used to indicate the first prediction mode in at least one mode. Based on this, the decoder can perform illumination compensation on the first prediction block obtained by predicting the current block using the IBC mode used by the current block, based on the model corresponding to the first prediction mode, to obtain a second prediction block of the current block.

[0251] In some embodiments, S410 may include:

[0252] If the current block uses the IBC merge mode, then a merge candidate list is constructed; a second index is determined, which is used to indicate the block vector BV from the current block to the first reference block of the current block in the merge candidate list; if the first reference block uses the IBC-LIC mode, then the current block is determined to use the IBC-LIC mode.

[0253] For example, if the current block uses the IBC merge mode, the decoder constructs a merge candidate list; then, it obtains a second index by parsing the bitstream; the second index is used in the merge candidate list to indicate the block vector (BV) from the current block to the first reference block of the current block; if the first reference block uses the IBC-LIC mode, it is determined that the current block uses the IBC-LIC mode. If the first reference block does not use the IBC-LIC mode, it is determined that the current block does not use the IBC-LIC mode.

[0254] Furthermore, for the current block, different color components are decoded independently of each other. For example, if the luma component has already been decoded, and the current color component to be decoded is the chroma component and motion vector information / block vector information needs to be obtained from the luma component, then the IBC-LIC usage identifier of the luma component can be inherited simultaneously.

[0255] In some embodiments, S420 may include:

[0256] The prediction mode used by the first reference block is determined to be the first prediction mode.

[0257] For example, if the IBC mode used by the current block is the IBC merge mode, the decoder constructs a merge candidate list; then, it obtains a second index by parsing the bitstream; the second index is used to indicate the block vector BV from the current block to the first reference block in the merge candidate list; if the first reference block uses the IBC-LIC mode, the decoder determines the prediction mode used by the first reference block as the first prediction mode.

[0258] Of course, in other alternative embodiments, if the IBC mode used by the current block is the IBC merge mode, the decoder can also determine whether the current block uses or does not use the IBC-LIC mode through other means, and when the current block uses the IBC-LIC mode, it can use other methods to determine the first prediction mode. This application does not specifically limit this. For example, for IBC-LIC technology in merge mode, the IBC-LIC mode used by the current block can be determined without inheritance, that is, using a scheme similar to AMVP IBC-LIC or a default prediction mode to determine the first prediction mode. Furthermore, for IBC-LIC technology in merge mode, the use of IBC-LIC can be determined without inheriting surrounding information. Instead, the use status can be calculated using the encoder's distortion cost, and transmitted to the decoder in the form of identifiers and indices. The decoder then parses the identifiers used in merge mode to determine whether the current coding unit uses IBC-LIC technology.

[0259] In some embodiments, prior to S410, the method further includes:

[0260] Obtain a second identifier; wherein the second identifier indicates whether the IBC mode used by the current block is the IBC merge mode.

[0261] For example, if the second identifier indicates that the IBC mode used by the current block is the IBC merging mode, the decoder determines that the IBC mode used by the current block is the IBC merging mode; further, the decoder constructs a merging candidate list; then, it obtains a second index by parsing the bitstream; the second index is used to indicate the block vector (BV) from the current block to the first reference block of the current block in the merging candidate list; if the first reference block uses the IBC-LIC mode, it is determined that the current block uses the IBC-LIC mode; further, the decoder can determine the first prediction mode used by the current block based on the prediction mode used when performing illumination compensation on the first reference block.

[0262] For example, if the second identifier indicates that the IBC mode used by the current block is not the IBC merge mode, the decoder determines that the IBC mode used by the current block is the IBCAMVP mode; further, the decoder obtains the first identifier by parsing the bitstream, and if the first identifier indicates that the current block is allowed to use the IBC-LIC mode, the decoder obtains the first index by decoding the bitstream, and determines the prediction mode indicated by the first index as the prediction mode used by the current block.

[0263] In some embodiments, S430 may include:

[0264] If the first prediction mode corresponds to a single model, then illumination compensation is performed on the prediction samples in the first prediction block based on the single model to obtain the second prediction block.

[0265] For example, if the first prediction mode is the first mode or the second mode mentioned above, that is, the model corresponding to the first prediction mode is the first model or the second model mentioned above, then the decoder performs illumination compensation on the prediction samples in the first prediction block based on the single model to obtain the second prediction block.

[0266] In some embodiments, S430 may include:

[0267] If the first prediction mode corresponds to multiple models, then determine the model used by any one prediction sample in the first prediction block from among the multiple models; perform illumination compensation on the any one prediction sample based on the model used by the any one prediction sample to obtain the second prediction block.

[0268] For example, if the first prediction mode is the third mode mentioned above, that is, the model corresponding to the first prediction mode is one of the multiple third models mentioned above, then the decoder determines the third model used by any one prediction sample in the first prediction block from among the multiple third models; and performs illumination compensation on the any one prediction sample based on the third model used by the any one prediction sample to obtain the second prediction block.

[0269] For example, if the first prediction mode is the fourth mode mentioned above, that is, the model corresponding to the first prediction mode is one of the multiple fourth models mentioned above, then the decoder determines the fourth model used by any one prediction sample in the first prediction block among the multiple fourth models; and performs illumination compensation on the any one prediction sample based on the fourth model used by the any one prediction sample to obtain the second prediction block.

[0270] In some embodiments, the decoder determines the model among the plurality of models that corresponds to the range of values ​​of any one of the predicted samples as the model used for the predicted sample.

[0271] For example, the model corresponding to the interval can refer to the interval after dividing the reconstructed samples within the template region of the current block into which the model is determined. In other words, the decoder can determine the model corresponding to the interval used to determine the model where the value of any one of the multiple models is located as the model used for that one prediction sample.

[0272] In some embodiments, S410 may include:

[0273] If at least one of the following conditions is met, it is determined whether the current block uses the IBC-LIC mode:

[0274] The prediction type used in the current block is IBC mode;

[0275] The current sequence to which the current block belongs is allowed to use the IBC-LIC mode;

[0276] The area of ​​the current block is greater than or equal to a preset first threshold.

[0277] The area of ​​the current block is less than or equal to a preset second threshold;

[0278] The type of the current image to which the current block belongs is a preset type;

[0279] The IBC mode used by the current block is not the type of mode used when the IBC-LIC mode is different.

[0280] For example, the preset type can be an I-frame type.

[0281] In other words, the use of the decoding method provided in this application can be restricted based on the type of the image. For example, the decoding method provided in this application may only be allowed if the current image type is an I-frame, while the decoding method provided in this application may not be allowed if the current image type is a B / P-frame.

[0282] For example, if the prediction type used by the current block is IBC mode, and the current sequence to which the current block belongs is allowed to use the IBC-LIC mode, and the IBC mode used by the current block is not IBC merge mode, and the area of ​​the current block is greater than 32, then the decoder obtains the first identifier by parsing the bitstream. If the first identifier indicates that the current block is allowed to use the IBC-LIC mode, then the decoder determines that the current block uses the IBC-LIC mode.

[0283] In some embodiments, the method 400 may further include:

[0284] Obtain the residual block of the current block;

[0285] Based on the residual block and the second prediction block, the reconstruction block of the current block is determined.

[0286] For example, the decoder decodes the bitstream to obtain the residual block, and adds the residual block and the second prediction block to obtain the reconstructed block.

[0287] The main idea behind this technical proposal is to provide more different models and patterns for IBC-LIC.

[0288] The specific steps are as follows:

[0289] Depending on the template region included in the linear model calculation, there are three modes: using both the upper and left templates simultaneously, using only the upper template, and using only the left template. This mode type is the template region selection mode. Furthermore, it allows the current encoder to classify reconstructed and predicted samples based on sample values, calculating a linear model for each class's sample group (i.e., reconstructed sample group and predicted sample group). Then, the predicted samples for each class undergo a linear transformation according to their respective linear models. This mode is the multi-model IBC-LIC. Additionally, the slope of the calculated linear model can be adjusted to better match the relationship between the predicted block and the original sample block. This mode type is the parameter adjustment mode.

[0290] For ease of description, the types of template area selection modes are labeled as follows:

[0291] IBC-LIC is a mode that uses both the upper and left template regions to compute the linear model, IBC-LIC-T is a mode that uses only the upper template region to compute the linear model, and IBC-LIC-L is a mode that uses only the left template region to compute the linear model.

[0292] The patterns of the multiple models are labeled as follows:

[0293] IBC-LIC-M is a mode where both the upper and left template regions are used for sample classification and linear model calculation; IBC-LIC-MT is a mode where only the upper template region is used for sample classification and linear model calculation; and IBC-LIC-ML is a mode where only the left template region is used for sample classification and linear model calculation.

[0294] The parameter adjustment mode type is marked as follows:

[0295] IBC-LIC-slope indicates that the slope of a linear model is adjusted using a scaling factor or compensation value. This type can be further subdivided into more subtypes, including different patterns determined by different scaling factor or compensation values, different patterns determined by using this technique on a single model or multiple models, and different patterns determined by different template regions. For example, IBC-LIC-slope0 to IBC-LIC-slope3 can be used to represent four types of linear model slope adjustments made to IBC-LIC, and IBC-LIC-slope4 can be used to represent linear model slope adjustments made to IBC-LIC-M, etc.

[0296] The encoding and decoding methods provided in this application are illustrated below from the perspectives of the encoder and decoder, respectively.

[0297] From the perspective of whether or not to calculate the distortion cost of the linear model, the encoding and decoding scheme of this application provides the following two embodiments:

[0298] Example 1:

[0299] At the encoding end, the current coding unit performs IBC matching search, trying various IBC-LIC modes and other IBC prediction modes. It calculates the cost information `costPred` between the predicted block transformed using the linear model corresponding to each IBC-LIC mode and the original image block corresponding to the current coding unit. Furthermore, for each IBC-LIC mode, it calculates the cost information `costTemplate` between the template region sample transformed by the linear model and the corresponding reconstructed image sample (or the original image sample). Based on the size of the `costTemplate`, the lower cost is encoded and transmitted using fewer codewords, and the higher cost is encoded and transmitted using more codewords. Comparing the `costPred` values ​​under different IBC prediction modes, the mode with the lower cost is selected as the optimal mode for the current coding block in the IBC AMVP mode. The current coding unit attempts to use prediction modes in merge mode. First, it constructs a merge mode list and obtains BV information from surrounding reference blocks. This mode list information also includes information on prediction modes such as IBC-LIC, IBC-CIIP, IBC-GPM, and IBC-RR corresponding to the obtained block. If IBC-LIC is enabled in the obtained information, the current coding unit also needs to use IBC-LIC technology to perform linear transformation after obtaining the prediction block based on BV. The IBC-LIC mode index is also obtained through inheritance.

[0300] At the decoding end, if the current decoding unit uses IBC merge mode, it parses the bitstream to obtain the index of the merge mode list, and retrieves the corresponding BV and related information based on the index. If IBC-LIC is enabled, the current decoding unit also uses IBC-LIC technology; if IBC-LIC is disabled, the current decoding unit does not use IBC-LIC technology. If the current decoding unit is in IBC AMVP mode, it parses the bitstream to obtain IBC-LIC-related usage identifiers and mode indexes. On one hand, it calculates the costTemplate for all IBC-LIC-related modes in the template region. The method for calculating the costTemplate is the same as at the encoding end, that is, calculating the cost information costTemplate of the template region sample after linear model transformation and the corresponding reconstructed image sample of the template region, and sorting them according to the size of the costTemplate. On the other hand, it combines the IBC-LIC mode index obtained from the bitstream parsing and the sorted mode information to determine the final IBC-LIC mode used by the current decoding unit. Based on the determined IBC-LIC mode, it selects samples from the corresponding template region to calculate the linear model, and determines whether to modify the linear model parameters based on the IBC-LIC mode. The calculated linear model is applied to the reference block, i.e. the prediction block, and a new prediction block is obtained after linear transformation.

[0301] In this embodiment, when the current encoding unit uses the IBC-LIC mode under the IBC AMVP mode, it calculates the costTemplate for various IBC-LIC modes under the IBC AMVP mode, sorts the various IBC-LIC modes based on the calculated costTemplate size, and then indicates the optimal IBC-LIC mode to the decoder through the bitstream among the sorted IBC-LIC modes. Correspondingly, when the decoder determines that the current decoding unit uses the IBC-LIC mode under the IBC AMVP mode, it can calculate the costTemplate for various IBC-LIC modes under the IBC AMVP mode, sort the various IBC-LIC modes based on the calculated costTemplate size, and determine the optimal IBC-LIC mode used by the current decoding unit through the decoded bitstream among the sorted IBC-LIC modes.

[0302] Example 2:

[0303] At the encoding end, the current coding unit performs IBC matching search, trying various IBC-LIC modes and other IBC prediction modes. It calculates the cost information `costPred` between the predicted block transformed using the linear model corresponding to each IBC-LIC mode and the reconstructed image sample (or the original image sample) corresponding to the current coding unit. Comparing the `costPred` values ​​under different IBC prediction modes, the mode with the lower cost is selected as the optimal mode for the current coding block in the IBC AMVP mode. The current coding unit then tries prediction modes in the merge mode. First, it constructs a merge mode list, obtaining BV information from surrounding reference blocks. This mode list also includes information on the IBC-LIC, IBC-CIIP, IBC-GPM, and IBC-RR prediction modes corresponding to the obtained block. If IBC-LIC is enabled in the obtained information, the current coding unit, after obtaining the predicted block based on the BV, also needs to perform a linear transformation using IBC-LIC technology. The IBC-LIC mode index is also obtained through inheritance.

[0304] At the decoding end, if the current decoding unit uses IBC merge mode, it parses the bitstream to obtain the index of the merge mode list, and retrieves the corresponding BV and related information based on the index. If IBC-LIC is enabled, the current decoding unit also uses IBC-LIC technology; if IBC-LIC is disabled, the current decoding unit does not use IBC-LIC technology. If the current decoding unit is in IBC AMVP mode, it parses the bitstream to obtain IBC-LIC-related usage identifiers and mode indexes. Based on the determined IBC-LIC mode, samples from the corresponding template region are selected to calculate the linear model, and the need to modify the linear model parameters is determined based on the IBC-LIC mode. The calculated linear model is applied to the reference block (i.e., the prediction block), and a new prediction block is obtained after linear transformation.

[0305] In this embodiment, when the current encoding unit uses the IBC-LIC mode under the IBC AMVP mode, the encoder can indicate the IBC-LIC-related usage identifier and mode index to the decoder through the bitstream. Correspondingly, when the decoder determines that the current decoding unit is using the IBC-LIC mode under the IBC AMVP mode, it can determine the optimal IBC-LIC mode used by the current decoding unit by decoding the bitstream.

[0306] It is worth noting that this application does not specifically limit the calculation process of the model corresponding to IBC-LIC in Embodiments 1 and 2 above. For example, its specific implementation can refer to the scheme described above (e.g., the relevant schemes of the first model, the second model, multiple third models, and multiple fourth models), which will not be repeated here. In order to control complexity and facilitate implementation, this application uses only 2 linear models for transformation in a prediction block for the multi-model mode such as IBC-LIC-M. Of course, there can also be 3, 4, or 5 models, and the method is the same as that of 2 linear models, which will not be described in detail here.

[0307] The IBC-LIC-M process is illustrated below using two linear models as examples:

[0308] Based on the mean value of the template region samples in the reference block (i.e., the first prediction block mentioned above), the samples within the template region are divided into two categories: one category has sample values ​​greater than the mean value of the template region samples, and the other category has sample values ​​less than or equal to the mean value of the template region samples. Similarly, the template region samples of the current prediction block (i.e., the current block mentioned above) are also divided into two categories based on the coordinates corresponding to the template region samples in the reference block, forming a combination. Next, the linear model parameters for each of these two categories are calculated, following the same calculation process as described above and the single-model calculation process. For example, for ease of description, the linear model calculated for the category of samples with values ​​greater than the mean value of the template region samples is denoted as Model 1, and vice versa, as Model 2. Then, a linear transformation is performed on the reference block. This means selecting a linear model based on the sample values ​​within the reference block: if the sample value is greater than the mean value of the template region samples, Model 1 is used for the linear transformation; if the sample value is less than or equal to the mean value of the template region samples, Model 2 is used for the linear transformation, resulting in the prediction block of the current coding unit (i.e., the second prediction block mentioned above).

[0309] It is worth noting that the selection of Model 1 is not necessarily greater than the sample mean of the template region; it can also be greater than or equal to, less than or equal to, etc. Conversely, the other Model 2 is less than, greater than, etc. This application does not make specific limitations on this.

[0310] The following example, using Embodiment 1, illustrates the specific implementation of the codec.

[0311] The basic process of an encoder is as follows:

[0312] The encoder iterates through the prediction modes. If the current prediction mode type is IBC mode, it obtains the permission flag of this technology. This flag is a sequence-level flag indicating that the current encoder is allowed to use IBC-LIC mode, and can be in the form of sps_ibc_lic_enable_flag.

[0313] Step 1:

[0314] If the IBC-LIC allow flag is true, and the area of ​​the current coding unit is greater than threshold 1 and less than threshold 2, then the encoder attempts the IBC-LIC prediction method, i.e., executes step 2; if the IBC-LIC allow flag or other conditions such as area do not meet the requirements, then the encoder does not attempt the IBC-LIC prediction method, i.e., the encoder skips step 2 and directly executes step 3.

[0315] Step 2:

[0316] Obtain the reconstructed samples of the upper and left template regions of the current coding unit, as well as the reconstructed samples of the upper and left template regions of the reference block.

[0317] Step 2.1:

[0318] The encoder iterates through various prediction patterns under the IBC AMVP mode and calculates the corresponding rate-distortion cost.

[0319] The calculation of the prediction block may include:

[0320] The encoder attempts various IBC-LIC related modes, determines the template region based on the IBC-LIC mode, and obtains the number of samples in the corresponding mode. If the current mode is a multi-model related mode, the samples are classified according to the sample mean, and linear models are calculated separately. The calculation process can refer to the scheme described above to obtain scaling factors a1 and a2 and offset parameters b1 and b2. If it is not a multi-model related mode, there is no need to classify the samples; only one linear model, a and b, needs to be calculated. If the current mode is a parameter adjustment mode, the model parameters of the linear model are adjusted according to the adjustment values ​​of the scaling parameters and / or the bias parameters in different modes, and new scaling factors a and offset parameters b are recalculated. A linear transformation is performed on the prediction block to obtain the new prediction block for the current coding unit.

[0321] In addition, the calculation of the template region cost includes:

[0322] Based on the calculated linear parameters of each IBC-LIC mode, a linear transformation is performed on the predicted samples in the template region to obtain new predicted samples. The distortion cost is then calculated between these new samples and the reconstructed samples in the corresponding regions to obtain the costTemplate for each IBC-LIC mode. The IBC-LIC modes are then sorted according to the size of the costTemplate. The cost calculation for the template region is used to determine the number of codewords required to transmit each mode. For example, modes with lower costs are allocated fewer codewords for transmission, while those with higher costs are allocated more codewords.

[0323] The calculation of rate-distortion cost may include:

[0324] The residual block of the current coding unit is obtained by subtracting the predicted block after linear transformation of each IBC-LIC mode from the original image of the corresponding region. After transformation and quantization, inverse quantization and inverse transformation, the residual block is superimposed on the predicted block to obtain the reconstructed block. The distortion of the reconstructed block and the original image is calculated, and the index codeword and residual codeword to be encoded in this IBC-LIC mode are considered. The minimum rate distortion cost costAmvp is obtained by traversing each mode.

[0325] Step 2.2:

[0326] The encoding end constructs a list of information under the IBC merge mode, traverses each candidate mode, and calculates the corresponding rate-distortion cost.

[0327] Specifically, the current coding unit iterates through the candidate Block Values ​​(BVs) in the merge list. If IBC-LIC is enabled in the inherited information, the current coding unit obtains a reference block based on that BV information. Simultaneously, it obtains adjacent template region samples of the current coding unit and the reference block based on the inherited IBC-LIC mode, and calculates the linear model parameters. The reference block is transformed according to the linear model parameters, following the same steps as described above, to obtain the final prediction block. The difference between this prediction block and the original sample corresponding to the current coding unit is calculated to obtain the residual of the current coding unit. The rate-distortion cost, denoted as costIdx1, is calculated through transformation quantization and other operations. Other candidate BVs in the merge list are iterated through, and their rate-distortion costs, costIdx2, costIdx3, costIdx4, etc., are calculated using the same method. The costs of costIdx1, costIdx2, etc., are compared, and the minimum cost value is recorded as costMerge.

[0328] Step 3:

[0329] The encoder iterates through other prediction techniques and calculates the rate-distortion cost corresponding to each prediction mode. It then selects the prediction mode with the lowest cost as the optimal prediction mode for the current coding unit.

[0330] Specifically, if costAmvp is minimized, the current coding unit uses the IBC-LIC mode under AMVP mode. The IBC-LIC coding unit-level usage identifier (i.e., the first identifier mentioned above) needs to be set to true and written to the bitstream. Additionally, the IBC-LIC mode index (i.e., the first index mentioned above) also needs to be written to the bitstream. If costMergeIbc is minimized, the current coding unit uses the IBC-LIC mode under merge mode. The IBC merge identifier (i.e., the second identifier mentioned above) is set to true and written to the bitstream, and the merge index is also written to the bitstream. If the current coding unit allows illumination compensation and costLic is not minimized, the current coding unit does not use illumination compensation. The illumination compensation technology coding unit-level usage identifier needs to be set to negative and written to the bitstream. Otherwise, other optimal prediction mode information is written to the bitstream. Since this is not strongly related to this technique, it will not be described in detail here.

[0331] Step 4:

[0332] After traversing all coding units, the bitstream is output after passing through techniques such as loop filtering and entropy coding.

[0333] Accordingly, the basic process of the decoder is as follows:

[0334] The decoder parses or obtains the lic enable flag, which is a sequence-level flag (sps_ibc_lic_enable_flag) indicating that the current decoder allows the use of IBC-LIC technology.

[0335] Step 1:

[0336] Parse the bitstream to obtain the prediction type of the current coding unit. If it is IBC mode, parse the merge usage identifier of the current coding unit. If the merge usage identifier of the current coding unit is not true, and sps_ibc_lic_enable_flag is true, and the area of ​​the current coding unit is greater than threshold 1 and less than threshold 2, then parse the bitstream to obtain the IBC-LIC usage identifier (cu_ibc_lic_flag). If this usage identifier is true, continue to parse the IBC-LIC mode index (cu_ibc_lic_index).

[0337] If the identifier for the current encoding unit's cu_ibc_lic_flag is not used, proceed to step 3.

[0338] If the current merge usage identifier is true, the merge index is parsed and the corresponding IBC-LIC information is obtained based on the parsed merge index. If the inherited IBC-LIC usage identifier is true, step 2 is executed based on the inherited IBC-LIC mode index; otherwise, step 3 is executed.

[0339] Step 2:

[0340] If the current mode is AMVP, then the template region cost is calculated: based on the calculated linear parameters of each IBC-LIC mode, a linear transformation is performed on the predicted samples of the template region to obtain new predicted samples. The distortion cost is then calculated between these new samples and the reconstructed samples of the corresponding regions to obtain the costTemplate corresponding to each IBC-LIC mode. The IBC-LIC modes are sorted according to the size of the costTemplate. Combining the parsed IBC-LIC index and the sorted order of the IBC-LIC modes, the IBC-LIC mode is determined.

[0341] It is worth noting that sorting the IBC-LIC modes according to the size of the costTemplate can also be represented as a sorted list, so that the decoder can find the corresponding IBC-LIC mode in the sorted list based on the index, and then make predictions for the current coding unit. Of course, the concept of a list can be omitted, and this application does not make specific restrictions on this.

[0342] If it is merge mode, the IBC-LIC mode is determined based on the parsed IBC-LIC mode index.

[0343] Prediction block calculation:

[0344] Reconstructed samples of the template regions adjacent to the current coding unit are obtained according to the IBC-LIC mode, and reconstructed samples of the template regions adjacent to the reference coding unit are also obtained.

[0345] In single-model mode, the obtained reconstructed samples are modeled using the linear model calculation method described above, calculating the scaling factor 'a' and the offset parameter 'b'. A linear transformation is then performed on the prediction block, with transformation parameters being the scaling factor 'a' and the compensation factor 'b', resulting in a new prediction block.

[0346] In the multi-model mode, samples from two template regions are classified based on the mean of the samples in adjacent template regions of the reference block. Samples in the template regions adjacent to the reference block with a value greater than the mean are classified into Class 1, and correspondingly, samples in the template regions adjacent to the prediction block at the same location are also classified into Class 1. Conversely, samples in the template regions adjacent to the reference block with a value less than or equal to the mean are classified into Class 2, and similarly, samples in the template regions adjacent to the prediction block at the same location are also classified into Class 2. The linear models for Class 1 and Class 2 samples are calculated using the above model calculation method. The model parameters for Class 1 include scaling parameter a1 and offset parameter b1, and the model parameters for Class 2 include scaling parameter a2 and offset parameter b2. Based on the relationship between the sample values ​​in the reference block and the mean of the sample values ​​in the template region, either a first-type linear model or a second-type linear model is selected. If the sample value in the reference block is greater than the mean of the sample values ​​in the template region, the first-type linear model is used for linear transformation. Conversely, if the sample value in the reference block is less than or equal to the mean of the sample values ​​in the template region, the second-type linear model is used for linear transformation to obtain a new prediction block.

[0347] If it is in parameter adjustment mode, the slope of the linear model is adjusted according to the adjustment value of the scaling parameter and / or the adjustment value of the bias parameter corresponding to the parameter adjustment mode, so as to obtain a new scaling factor a and bias parameter b. Then, a linear transformation is performed on the prediction block to obtain a new prediction block.

[0348] Step 3:

[0349] Continue to analyze the usage identifiers or indexes of the technology, and obtain the final prediction block of the current coding unit based on the analyzed information.

[0350] Step 4:

[0351] The bitstream is parsed to obtain residual information, and temporal residual information is obtained through inverse quantization and inverse transform. The final predicted block is then superimposed with the temporal residual information to obtain the reconstructed sample block.

[0352] Step 5:

[0353] After all the reconstructed sample blocks are processed through techniques such as loop filtering, the final reconstructed image is obtained, which can be used as both video output and as a reference for subsequent decoding.

[0354] It is worth noting that in the above embodiments, IBC-LIC has usage restrictions at the coding unit level. If the product of the width and height of the current coding unit is less than 32 or greater than 256, illumination compensation technology is not allowed. That is, threshold 1 is 32 and threshold 2 is 256. However, this restriction can be modified according to the coupling between various technologies. For example, in this embodiment, coding units with a width-to-height product of less than 32 can not use the IBC-LIC restriction, while no restriction is imposed on large areas.

[0355] The following provides an exemplary description of the grammatical elements involved in this application.

[0356] The following is a parsing table for encoding unit-level syntax elements. Bold text indicates that the syntax element needs to be parsed. For example, cu_ibc_lic_flag is an encoding unit-level syntax element that needs to be parsed.

[0357] Table 2

[0358] Here, `sps_ibc_lic_enable_flag` is the sequence-level illumination compensation enable identifier, `cu_ibc_lic_flag` is the IBC-LIC usage identifier for the current coding unit, and `cu_ibc_lic_index` is the IBC-LIC index for the current coding unit. The following syntax elements have all been parsed from the bitstream to obtain their corresponding values ​​before parsing `cu_ibc_lic_flag` and `cu_ibc_lic_index`. `modeType` is the prediction type used by the current coding unit, which can be `MODE_INTRA` for intra-frame (INTRA) prediction, `MODE_INTER` for inter-frame (INTER) prediction, or `MODE_IBC` for intra-block copy (IBC) prediction. `merge_flag` is the merge usage identifier for the current coding unit. `cbWidth` and `cbHeight` are the width and height of the current coding block, respectively.

[0359] The parsing logic for the syntax elements shown in Table 2 is as follows:

[0360] If the current sequence to which the current block belongs is allowed to use the IBC-LIC mode, and the prediction type used by the current block is IBC mode, and the IBC mode used by the current block is not IBC merge mode, and the area of ​​the current block is greater than 32, then cu_ibc_lic_flag is obtained by parsing the bitstream; if the value of cu_ibc_lic_flag is a first value (e.g., 0), then it is determined that the current block does not use the IBC-LIC mode; if the value of cu_ibc_lic_flag is a second value (e.g., 1), then it is determined that the current block uses the IBC-LIC mode; furthermore, when the value of cu_ibc_lic_flag is a second value (e.g., 1), the decoder parses cu_ibc_lic_index, which indicates the prediction mode used by the current block.

[0361] It is worth noting that the conditions for parsing `cu_ibc_lic_flag` can be determined based on the existing coding tool coupling relationships in the standard. Specifically, if the current coding unit allows the use of other IBC-type prediction techniques, but these techniques cannot be used simultaneously with IBC-LIC, then the decision to parse the IBC-LIC usage identifier of the current coding unit can be made by first parsing the coding unit-level usage identifier of the aforementioned techniques. If the coding unit usage identifier of the aforementioned tools is true, then there is no need to parse the IBC-LIC usage identifier of the current coding unit; otherwise, the IBC-LIC usage identifier of the current coding unit is then parsed.

[0362] For example, if the current sequence to which the current block belongs is allowed to use the IBC-LIC mode, and the prediction type used by the current block is IBC mode, and the IBC mode used by the current block is not IBC merge mode, and the area of ​​the current block is greater than 32, and the IBC mode used by the current block is not a mode of the type used when different from the IBC-LIC mode, then the decoder obtains cu_ibc_lic_flag by parsing the bitstream; if the value of cu_ibc_lic_flag is a first value (e.g., 0), then it is determined that the current block does not use the IBC-LIC mode; if the value of cu_ibc_lic_flag is a second value (e.g., 1), then it is determined that the current block uses the IBC-LIC mode; furthermore, when the value of cu_ibc_lic_flag is a second value (e.g., 1), the decoder parses cu_ibc_lic_index, which indicates the prediction mode used by the current block.

[0363] Taking Reconstruction-reordered IBC (RRIBC) as an example, the syntax element table shown in Table 2 can be updated to the syntax element table shown in Table 3. RRIBC is a technique that reconstructs samples before searching for matching blocks. The reconstructing operation includes, but is not limited to, horizontal flipping and vertical flipping.

[0364] Table 3

[0365] Here, `cu_rribc_flip_type` represents the operation type of the RRIBC technology. If `cu_rribc_flip_type` is 0, it indicates that the current coding unit does not use RRIBC technology; otherwise, it indicates that the current coding unit uses RRIBC technology, and the value of `cu_rribc_flip_type` is the index of the operation type. It should be understood that Table 3 only shows the correlation between RRIBC and IBC-LIC syntax parsing. Similarly, other IBC encoding tools also have similar relationships, which will not be elaborated upon here.

[0366] The parsing logic for the syntax elements shown in Table 3 is as follows:

[0367] If the current sequence to which the current block belongs is allowed to use the IBC-LIC mode, and the prediction type used by the current block is IBC mode, and the IBC mode used by the current block is not IBC merge mode, and the area of ​​the current block is greater than 32, and the IBC mode used by the current block is not an RRIBC type mode, then cu_ibc_lic_flag is obtained by parsing the bitstream; if the value of cu_ibc_lic_flag is the first value (e.g., 0), then it is determined that the current block does not use the IBC-LIC mode; if the value of cu_ibc_lic_flag is the second value (e.g., 1), then it is determined that the current block uses the IBC-LIC mode; furthermore, when the value of cu_ibc_lic_flag is the second value (e.g., 1), the decoder parses cu_ibc_lic_index, which indicates the prediction mode used by the current block.

[0368] The encoding method according to the embodiments of this application will now be described from the perspective of the encoder, with reference to FIG12.

[0369] Figure 12 is a schematic flowchart of the encoding method 500 provided in this application.

[0370] It should be understood that the encoding method 500 can be performed by an encoder. For example, the encoding method 500 can be performed by the video encoder 112 shown in FIG1 or the video encoder 200 shown in FIG2.

[0371] As shown in Figure 12, the encoding method 500 may include:

[0372] S510, traverse the model corresponding to at least one mode to perform illumination compensation on the third prediction block to obtain the first distortion cost set; the third prediction block is the prediction block obtained by using the Intra-Block Copy IBC Advanced Motion Vector Prediction AMVP mode to predict the current block.

[0373] S520, illumination compensation is performed on the fourth prediction block based on the inheritance model to obtain the second distortion cost set; the fourth prediction block is a reference block in the merging candidate list obtained by predicting the current block based on the IBC merging mode;

[0374] S530, based on the first distortion cost set and the second distortion cost set, determine the IBC mode used by the current block.

[0375] In some embodiments, S530 may include:

[0376] If the minimum value in the first set of distortion costs is less than the minimum value in the second set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBCAMVP mode.

[0377] In some embodiments, the method 500 may further include:

[0378] Determine the first identifier;

[0379] The first identifier indicates that the current block is allowed to use the intra-block copying IBC-LIC mode based on local illumination compensation;

[0380] The first identifier is encoded.

[0381] In some embodiments, the method 500 may further include:

[0382] Determine the first index;

[0383] Wherein, the first index is used to indicate the first prediction mode used by the current block in the at least one mode;

[0384] The first index is encoded.

[0385] In some embodiments, the first index is used to indicate the first predicted mode among the sorted at least one mode; the method 500 may further include:

[0386] Determine the distortion cost of the at least one mode;

[0387] The distortion cost of any one of the at least one modes is determined based on the reconstructed samples in the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode. The at least one predicted sample includes the predicted sample obtained by predicting the samples in the template region of the current block using the IBC-LIC mode.

[0388] Based on the distortion cost of the at least one mode, the at least one mode is sorted to obtain the at least one sorted mode.

[0389] In some embodiments, the method 500 may further include:

[0390] Based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the third prediction block, a first model is determined;

[0391] Wherein, the at least one mode includes a first mode corresponding to the first model.

[0392] In some embodiments, the method 500 may further include:

[0393] The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model;

[0394] Wherein, the at least one mode includes a second mode corresponding to the second model.

[0395] In some embodiments, the method 500 may further include:

[0396] Identify multiple third models;

[0397] Wherein, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples in the template region of the current block and a second sample group obtained by dividing the predicted samples in the template region of the third prediction block; the at least one mode includes a third mode corresponding to the plurality of third models.

[0398] In some embodiments, the method 500 may further include:

[0399] Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models;

[0400] Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

[0401] In some embodiments, the method 500 may further include:

[0402] Based on the values ​​of the reconstructed samples in the template region of the third prediction block, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups.

[0403] The reconstructed samples whose positions within the template region of the current block correspond to the second sample group are divided into the first sample group.

[0404] In some embodiments, the average value of reconstructed samples in the template region of the third prediction block is determined; based on the average value, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed samples is greater than or equal to the average value, and a sample group in which the value of the reconstructed samples is less than the average value.

[0405] In some embodiments, the adjustment parameters include the adjustment amount of the scaling parameter and / or the adjustment amount of the bias parameter.

[0406] In some embodiments, the template area of ​​the current block includes the upper template area and / or the left template area.

[0407] In some embodiments, the sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region;

[0408] The samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the pattern in the at least one pattern.

[0409] In some embodiments, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0410] In some embodiments, when the template region of the current block is the left template region, the number of sample rows in the left template region is greater than the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the left template region, the number of sample columns in the left template region is greater than the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0411] In some embodiments, the method 500 may further include:

[0412] Encode at least one of the following indices:

[0413] An index used to indicate whether the model corresponding to the first prediction mode used by the current block is a single model or multiple models; an index used to indicate the template region used by the model corresponding to the first prediction mode; an index used to indicate whether the model corresponding to the first prediction mode is a model after parameter adjustment; and the adjustment parameters corresponding to the first prediction mode.

[0414] In some embodiments, S530 may include:

[0415] If the minimum value in the second set of distortion costs is less than the minimum value in the first set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBC merging mode.

[0416] In some embodiments, the method 500 may further include:

[0417] Build a list of candidate mergers;

[0418] Determine a second index, which indicates the block vector BV from the current block to the first reference block in the merge candidate list;

[0419] The second index is encoded.

[0420] In some embodiments, the method 500 may further include:

[0421] Determine the second identifier;

[0422] The second identifier indicates whether the IBC mode used by the current block is the IBC merge mode;

[0423] The second identifier is encoded.

[0424] In some embodiments, S510 may include:

[0425] If at least one of the following conditions is met, then illumination compensation is performed on the third prediction block based on the model corresponding to the at least one mode to obtain the first distortion cost set:

[0426] The prediction type used in the current block is IBC mode;

[0427] The current sequence to which the current block belongs is allowed to use IBC-LIC mode;

[0428] The area of ​​the current block is greater than or equal to a preset first threshold.

[0429] The area of ​​the current block is less than or equal to a preset second threshold;

[0430] The type of the current image to which the current block belongs is a preset type;

[0431] The IBC mode used by the current block is not the same type of mode used when the IBC-LIC mode is different.

[0432] In some embodiments, S520 may include:

[0433] Construct the merge candidate list;

[0434] Specifically, for the first candidate reference block in the merge candidate list, if the first candidate reference block uses the IBC-LIC mode, then the second distortion cost set includes:

[0435] Based on the model used by the first candidate reference block, illumination compensation is performed on the first candidate reference block to obtain the distortion cost.

[0436] It should be understood that the encoding method can be understood as the reverse process of the decoding method. Therefore, the specific scheme of the encoding method 500 can be found in the relevant content of the decoding method 300. For ease of description, this application will not elaborate further.

[0437] The method embodiments of this application have been described in detail above. The apparatus embodiments of this application will be described in detail below with reference to Figures 11 to 10.

[0438] Figure 8 is a schematic block diagram of the decoder 600 provided in this application.

[0439] As shown in Figure 8, the decoder 600 may include:

[0440] The first determining unit 610 is used to determine whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation;

[0441] The second determining unit 620 is configured to determine the first prediction mode used by the current block in the IBC-LIC mode if the current block uses the IBC-LIC mode;

[0442] The compensation unit 630 is used to perform illumination compensation on the first prediction block obtained by predicting the current block using the IBC mode used by the current block, based on the model corresponding to the first prediction mode, to obtain the second prediction block of the current block.

[0443] In some embodiments, the second determining unit 620 is specifically used for:

[0444] Decode the bitstream and determine the first index;

[0445] The first index is used to indicate the first prediction mode in at least one mode.

[0446] In some embodiments, the first index is used to indicate the first prediction mode among the sorted at least one mode; the second determining unit 620 is further used to:

[0447] Determine the distortion cost of the at least one mode;

[0448] The distortion cost of any one of the at least one modes is determined based on the reconstructed samples in the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode. The at least one predicted sample includes the predicted sample obtained by predicting the samples in the template region of the current block using the IBC-LIC mode.

[0449] Based on the distortion cost of the at least one mode, the at least one mode is sorted to obtain the at least one sorted mode.

[0450] In some embodiments, the second determining unit 620 is further configured to:

[0451] Based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the first predicted block, a first model is determined;

[0452] Wherein, the at least one mode includes a first mode corresponding to the first model.

[0453] In some embodiments, the second determining unit 620 is further configured to:

[0454] The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model;

[0455] Wherein, the at least one mode includes a second mode corresponding to the second model.

[0456] In some embodiments, the second determining unit 620 is further configured to:

[0457] Identify multiple third models;

[0458] Wherein, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples in the template region of the current block and a second sample group obtained by dividing the predicted samples in the template region of the first prediction block; the at least one mode includes a third mode corresponding to the plurality of third models.

[0459] In some embodiments, the second determining unit 620 is further configured to:

[0460] Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models;

[0461] Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

[0462] In some embodiments, the second determining unit 620 is further configured to:

[0463] Based on the values ​​of the reconstructed samples in the template region of the first prediction block, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups.

[0464] The reconstructed samples whose positions within the template region of the current block correspond to the second sample group are divided into the first sample group.

[0465] In some embodiments, the second determining unit 620 is specifically used for:

[0466] Determine the average value of the reconstructed samples in the template region of the first prediction block;

[0467] Based on the average value, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed sample is greater than or equal to the average value, and a sample group in which the value of the reconstructed sample is less than the average value.

[0468] In some embodiments, the adjustment parameters include the adjustment amount of the scaling parameter and / or the adjustment amount of the bias parameter.

[0469] In some embodiments, the template area of ​​the current block includes the upper template area and / or the left template area.

[0470] In some embodiments, the sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region;

[0471] The samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the pattern in the at least one pattern.

[0472] In some embodiments, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0473] In some embodiments, when the template region of the current block is the left template region, the number of sample rows in the left template region is greater than the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the left template region, the number of sample columns in the left template region is greater than the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0474] In some embodiments, the second determining unit 620 is further configured to:

[0475] Decode the bitstream and determine at least one index;

[0476] Wherein, the at least one index includes at least one of the following:

[0477] An index used to indicate whether the model corresponding to the first prediction mode is a single model or multiple models; an index used to indicate the template region used by the model corresponding to the first prediction mode; an index used to indicate whether the model corresponding to the first prediction mode is a model after parameter adjustment; and the adjustment parameters corresponding to the first prediction mode.

[0478] The first prediction pattern is determined based on the at least one index.

[0479] In some embodiments, the first determining unit 610 is specifically used for:

[0480] If the IBC mode used by the current block is the Advanced Motion Vector Prediction (AMVP) mode, then decode the bitstream and determine the first identifier;

[0481] If the first identifier indicates that the current block is allowed to use the IBC-LIC mode, then it is determined that the current block uses the IBC-LIC mode.

[0482] In some embodiments, the first determining unit 610 is specifically used for:

[0483] If the IBC mode used by the current block is IBC merge mode, then a merge candidate list is constructed;

[0484] Determine a second index, which is used to indicate the block vector BV from the current block to the first reference block of the current block in the merge candidate list;

[0485] If the first reference block uses the IBC-LIC mode, then it is determined that the current block uses the IBC-LIC mode.

[0486] In some embodiments, the second determining unit 620 is specifically used for:

[0487] The prediction mode used by the first reference block is determined to be the first prediction mode.

[0488] In some embodiments, before the first determining unit 610 determines whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation, it is further configured to:

[0489] Obtain the second identifier;

[0490] The second identifier indicates whether the IBC mode used by the current block is the IBC merge mode.

[0491] In some embodiments, the compensation unit 630 is specifically used for:

[0492] If the first prediction mode corresponds to a single model, then illumination compensation is performed on the prediction samples in the first prediction block based on the single model to obtain the second prediction block.

[0493] In some embodiments, the compensation unit 630 is specifically used for:

[0494] If the first prediction mode corresponds to multiple models, then determine the model used by any one of the prediction samples in the first prediction block from among the multiple models;

[0495] The second prediction block is obtained by performing illumination compensation on any one of the prediction samples based on the model used for that prediction sample.

[0496] In some embodiments, the compensation unit 630 is specifically used for:

[0497] The model that corresponds to the interval in which the value of any one of the multiple models is located is determined as the model used for that one prediction sample.

[0498] In some embodiments, the first determining unit 610 is specifically used for:

[0499] If at least one of the following conditions is met, it is determined whether the current block uses the IBC-LIC mode:

[0500] The prediction type used in the current block is IBC mode;

[0501] The current sequence to which the current block belongs is allowed to use the IBC-LIC mode;

[0502] The area of ​​the current block is greater than or equal to a preset first threshold.

[0503] The area of ​​the current block is less than or equal to a preset second threshold;

[0504] The type of the current image to which the current block belongs is a preset type;

[0505] The IBC mode used by the current block is not the type of mode used when the IBC-LIC mode is different.

[0506] In some embodiments, the compensation unit 630 is further configured to:

[0507] Obtain the residual block of the current block;

[0508] Based on the residual block and the second prediction block, the reconstruction block of the current block is determined.

[0509] It should be understood that the device embodiments of the decoder and the method embodiments of the decoding method can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details are omitted here. Specifically, the decoder 600 shown in FIG13 can correspond to the corresponding subject in the decoding method 400 of the present application embodiments, and the foregoing and other operations and / or functions of each unit in the decoder 600 are respectively for implementing the corresponding processes in the decoding method 400.

[0510] Figure 14 is a schematic block diagram of the encoder 700 provided in this application.

[0511] As shown in Figure 14, the encoder 700 may include:

[0512] The first compensation unit 710 is used to traverse the model corresponding to at least one mode to perform illumination compensation on the third prediction block and obtain a first distortion cost set; the third prediction block is a prediction block obtained by using the Intra-Block Copy IBC Advanced Motion Vector Prediction AMVP mode to predict the current block.

[0513] The second compensation unit 720 is used to perform illumination compensation on the fourth prediction block based on the inherited model to obtain a second distortion cost set; the fourth prediction block is a reference block in the merging candidate list obtained by predicting the current block based on the IBC merging mode.

[0514] The determining unit 730 is configured to determine the IBC mode used by the current block based on the first distortion cost set and the second distortion cost set.

[0515] In some embodiments, the determining unit 730 is specifically used for:

[0516] If the minimum value in the first set of distortion costs is less than the minimum value in the second set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBCAMVP mode.

[0517] In some embodiments, the determining unit 730 is further configured to:

[0518] Determine the first identifier;

[0519] The first identifier indicates that the current block is allowed to use the intra-block copying IBC-LIC mode based on local illumination compensation;

[0520] The first identifier is encoded.

[0521] In some embodiments, the determining unit 730 is further configured to:

[0522] Determine the first index;

[0523] Wherein, the first index is used to indicate the first prediction mode used by the current block in the at least one mode;

[0524] The first index is encoded.

[0525] In some embodiments, the first index is used to indicate the first prediction mode among the sorted at least one mode; the determining unit 730 is further used to:

[0526] Determine the distortion cost of the at least one mode;

[0527] The distortion cost of any one of the at least one modes is determined based on the reconstructed samples in the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode. The at least one predicted sample includes the predicted sample obtained by predicting the samples in the template region of the current block using the IBC-LIC mode.

[0528] Based on the distortion cost of the at least one mode, the at least one mode is sorted to obtain the at least one sorted mode.

[0529] In some embodiments, the determining unit 730 is further configured to:

[0530] Based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the third prediction block, a first model is determined;

[0531] Wherein, the at least one mode includes a first mode corresponding to the first model.

[0532] In some embodiments, the determining unit 730 is further configured to:

[0533] The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model;

[0534] Wherein, the at least one mode includes a second mode corresponding to the second model.

[0535] In some embodiments, the determining unit 730 is further configured to:

[0536] Identify multiple third models;

[0537] Wherein, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples in the template region of the current block and a second sample group obtained by dividing the predicted samples in the template region of the third prediction block; the at least one mode includes a third mode corresponding to the plurality of third models.

[0538] In some embodiments, the determining unit 730 is further configured to:

[0539] Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models;

[0540] Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

[0541] In some embodiments, the determining unit 730 is further configured to:

[0542] Based on the values ​​of the reconstructed samples in the template region of the third prediction block, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups.

[0543] The reconstructed samples whose positions within the template region of the current block correspond to the second sample group are divided into the first sample group.

[0544] In some embodiments, the determining unit 730 is specifically used for:

[0545] Determine the average value of the reconstructed samples in the template region of the third prediction block;

[0546] Based on the average value, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed sample is greater than or equal to the average value, and a sample group in which the value of the reconstructed sample is less than the average value.

[0547] In some embodiments, the adjustment parameters include the adjustment amount of the scaling parameter and / or the adjustment amount of the bias parameter.

[0548] In some embodiments, the template area of ​​the current block includes the upper template area and / or the left template area.

[0549] In some embodiments, the sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region;

[0550] The samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the pattern in the at least one pattern.

[0551] In some embodiments, when the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

[0552] In some embodiments, when the template region of the current block is the left template region, the number of sample rows in the left template region is greater than the number of sample rows in the left template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the left template region, the number of sample columns in the left template region is greater than the number of sample columns in the left template region when the template region of the current block includes both the upper template region and the left template region.

[0553] In some embodiments, the determining unit 730 is further configured to:

[0554] Encode at least one of the following indices:

[0555] An index used to indicate whether the model corresponding to the first prediction mode used by the current block is a single model or multiple models; an index used to indicate the template region used by the model corresponding to the first prediction mode; an index used to indicate whether the model corresponding to the first prediction mode is a model after parameter adjustment; and the adjustment parameters corresponding to the first prediction mode.

[0556] In some embodiments, the determining unit 730 is specifically used for:

[0557] If the minimum value in the second set of distortion costs is less than the minimum value in the first set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBC merging mode.

[0558] In some embodiments, the determining unit 730 is further configured to:

[0559] Build a list of candidate mergers;

[0560] Determine a second index, which indicates the block vector BV from the current block to the first reference block in the merge candidate list;

[0561] The second index is encoded.

[0562] In some embodiments, the determining unit 730 is further configured to:

[0563] Determine the second identifier;

[0564] The second identifier indicates whether the IBC mode used by the current block is the IBC merge mode;

[0565] The second identifier is encoded.

[0566] In some embodiments, the first compensation unit 710 is specifically used for:

[0567] If at least one of the following conditions is met, then illumination compensation is performed on the third prediction block based on the model corresponding to the at least one mode to obtain the first distortion cost set:

[0568] The prediction type used in the current block is IBC mode;

[0569] The current sequence to which the current block belongs is allowed to use IBC-LIC mode;

[0570] The area of ​​the current block is greater than or equal to a preset first threshold.

[0571] The area of ​​the current block is less than or equal to a preset second threshold;

[0572] The type of the current image to which the current block belongs is a preset type;

[0573] The IBC mode used by the current block is not the same type of mode used when the IBC-LIC mode is different.

[0574] In some embodiments, the second compensation unit 720 is specifically used for:

[0575] Construct the merge candidate list;

[0576] Specifically, for the first candidate reference block in the merge candidate list, if the first candidate reference block uses the IBC-LIC mode, then the second distortion cost set includes:

[0577] Based on the model used by the first candidate reference block, illumination compensation is performed on the first candidate reference block to obtain the distortion cost.

[0578] It should be understood that the device embodiments of the encoder and the method embodiments of the encoding method can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details are omitted here. Specifically, the encoder 700 shown in FIG14 can correspond to the corresponding subject in the encoding method 500 of the present application embodiments, and the foregoing and other operations and / or functions of each unit in the encoder 700 are respectively for implementing the corresponding processes in the encoding method 500 and other methods.

[0579] It should also be understood that the various units in the decoder 600 or encoder 700 involved in the embodiments of this application are based on logical functional division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. Furthermore, these functions can also be implemented with the assistance of one or more other units. For example, some or all of the decoder 600 or encoder 700 can be merged into one or more additional units. As another example, some units(s) in the decoder 600 or encoder 700 can be further divided into multiple functionally smaller units, which can achieve the same operation without affecting the technical effects of the embodiments of this application. Furthermore, the decoder 600 or encoder 700 can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0580] According to another embodiment of this application, the decoder 600 or encoder 700 involved in the embodiments of this application can be constructed and the encoding or decoding methods of the embodiments of this application can be implemented by running a computer program (including program code) capable of performing the steps involved in the corresponding method on a general-purpose computing device including processing elements and storage elements such as a central processing unit (CPU), random access storage medium (RAM), and read-only storage medium (ROM). The computer program can be recorded on, for example, a computer-readable storage medium, loaded into an electronic device through the computer-readable storage medium, and run therein to implement the corresponding methods of the embodiments of this application. In other words, the units mentioned above can be implemented in hardware, in software instructions, or in a combination of hardware and software. Specifically, the steps of the method embodiments in the embodiments of this application can be completed by the integrated logic circuits of the hardware in the processor and / or by the instructions in software. The steps of the method disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software in the decoding processor. Optionally, the software can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps described in the method embodiments above.

[0581] Figure 15 is a schematic structural diagram of the electronic device 800 provided in this application.

[0582] As shown in Figure 15, the electronic device 800 includes at least a processor 810 and a computer-readable storage medium 820. The processor 810 and the computer-readable storage medium 820 can be connected via a bus or other means. The computer-readable storage medium 820 stores a computer program 821, which includes computer instructions. The processor 810 executes the computer instructions stored in the computer-readable storage medium 820. The processor 810 is the computing and control core of the electronic device 800, and is suitable for implementing one or more computer instructions, specifically for loading and executing one or more computer instructions to achieve corresponding method flows or corresponding functions.

[0583] For example, processor 810 may also be referred to as a central processing unit (CPU). Processor 810 may include, but is not limited to: general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, discrete hardware components, etc.

[0584] Exemplarily, the computer-readable storage medium 820 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device; optionally, it may also be at least one computer-readable storage medium located remotely from the aforementioned processor 810. Specifically, the computer-readable storage medium 820 includes, but is not limited to, volatile memory and / or non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0585] For example, the electronic device 800 may be a decoder or decoding framework involved in the embodiments of this application; the computer-readable storage medium 820 stores second computer instructions; the processor 810 loads and executes the second computer instructions stored in the computer-readable storage medium 820 to implement the corresponding steps in the decoding method provided in this application; in other words, the second computer instructions in the computer-readable storage medium 820 are loaded and executed by the processor 810 to implement the corresponding steps, which will not be described again here to avoid repetition.

[0586] For example, the electronic device 800 may be an encoder or encoding framework involved in the embodiments of this application; the computer-readable storage medium 820 stores first computer instructions; the processor 810 loads and executes the first computer instructions stored in the computer-readable storage medium 820 to implement the corresponding steps in the encoding method provided in this application; in other words, the first computer instructions in the computer-readable storage medium 820 are loaded and executed by the processor 810 to implement the corresponding steps, which will not be described again here to avoid repetition.

[0587] According to another aspect of this application, this application also provides an encoding and decoding system, including the encoder and decoder mentioned above.

[0588] According to another aspect of this application, a computer-readable storage medium (Memory) is also provided. This computer-readable storage medium is a memory device in an electronic device 800 for storing programs and data. For example, a computer-readable storage medium 820. It is understood that the computer-readable storage medium 820 here may include both the built-in storage medium in the electronic device 800 and extended storage media supported by the electronic device 800. The computer-readable storage medium provides storage space that stores the operating system of the electronic device 800. Furthermore, this storage space also stores one or more computer instructions suitable for loading and execution by a processor 810. These computer instructions may be one or more computer programs 821 (including program code).

[0589] According to another aspect of this application, this application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. For example, computer program 821. In this case, the data processing device 800 may be a computer, and the processor 810 reads the computer instructions from the computer-readable storage medium 820. The processor 810 executes the computer instructions, causing the computer to perform the encoding or decoding methods provided in the various alternative methods described above. In other words, when implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes of the embodiments of this application are run or the functions of the embodiments of this application are implemented. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0590] According to another aspect of this application, this application also provides a bitstream, which may be a bitstream decoded using the decoding method provided in this application or a bitstream generated using the encoding method provided in this application.

[0591] Those skilled in the art will recognize that the units and process steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0592] Finally, it should be noted that the above content is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A decoding method, characterized in that, include: Determine whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation; If the current block uses the IBC-LIC mode, then determine the first prediction mode used by the current block in the IBC-LIC mode; Based on the model corresponding to the first prediction mode, illumination compensation is performed on the first prediction block obtained by predicting the current block using the IBC mode used by the current block to obtain the second prediction block of the current block.

2. The method according to claim 1, characterized in that, Determining the first prediction mode used by the current block in the IBC-LIC mode includes: Decode the bitstream and determine the first index; The first index is used to indicate the first prediction mode in at least one mode.

3. The method according to claim 2, characterized in that, The first index is used to indicate the first predicted pattern among the sorted at least one pattern; the method further includes: Determine the distortion cost of the at least one mode; The distortion cost of any one of the at least one modes is determined based on the reconstructed samples in the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode. The at least one predicted sample includes the predicted sample obtained by predicting the samples in the template region of the current block using the IBC-LIC mode. Based on the distortion cost of the at least one mode, the at least one mode is sorted to obtain the at least one sorted mode.

4. The method according to claim 2 or 3, characterized in that, The method further includes: Based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the first predicted block, a first model is determined; Wherein, the at least one mode includes a first mode corresponding to the first model.

5. The method according to claim 4, characterized in that, The method further includes: The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model; Wherein, the at least one mode includes a second mode corresponding to the second model.

6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: Identify multiple third models; Wherein, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples in the template region of the current block and a second sample group obtained by dividing the predicted samples in the template region of the first prediction block; the at least one mode includes a third mode corresponding to the plurality of third models.

7. The method according to claim 6, characterized in that, The method further includes: Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models; Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

8. The method according to claim 6 or 7, characterized in that, The method further includes: Based on the values ​​of the reconstructed samples in the template region of the first prediction block, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups. The reconstructed samples whose positions within the template region of the current block correspond to the second sample group are divided into the first sample group.

9. The method according to claim 8, characterized in that, The values ​​of the reconstructed samples in the template region of the first prediction block are used to divide the reconstructed samples in the template region of the first prediction block into the plurality of sample groups, including: Determine the average value of the reconstructed samples in the template region of the first prediction block; Based on the average value, the reconstructed samples in the template region of the first prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed sample is greater than or equal to the average value, and a sample group in which the value of the reconstructed sample is less than the average value.

10. The method according to claim 5 or 7, characterized in that, The adjustment parameters include the adjustment amount of the scaling parameter and / or the adjustment amount of the bias parameter.

11. The method according to any one of claims 3 to 10, characterized in that, The template area of ​​the current block includes the upper template area and / or the left template area.

12. The method according to claim 11, characterized in that, The sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region; The samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the pattern in the at least one pattern.

13. The method according to claim 11, characterized in that, When the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

14. The method according to claim 11, characterized in that, When the template area of ​​the current block is the left template area, the number of sample rows in the left template area is greater than the number of sample rows in the left template area when the template area of ​​the current block includes both the upper template area and the left template area; and / or, when the template area of ​​the current block is the left template area, the number of sample columns in the left template area is greater than the number of sample columns in the left template area when the template area of ​​the current block includes both the upper template area and the left template area.

15. The method according to claim 1, characterized in that, Determining the first prediction mode used by the current block in the IBC-LIC mode includes: Decode the bitstream and determine at least one index; Wherein, the at least one index includes at least one of the following: An index used to indicate whether the model corresponding to the first prediction mode is a single model or multiple models; an index used to indicate the template region used by the model corresponding to the first prediction mode; an index used to indicate whether the model corresponding to the first prediction mode is a model after parameter adjustment; and the adjustment parameters corresponding to the first prediction mode. The first prediction pattern is determined based on the at least one index.

16. The method according to any one of claims 2 to 15, characterized in that, Determining whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation includes: If the IBC mode used by the current block is the Advanced Motion Vector Prediction (AMVP) mode, then decode the bitstream and determine the first identifier; If the first identifier indicates that the current block is allowed to use the IBC-LIC mode, then it is determined that the current block uses the IBC-LIC mode.

17. The method according to claim 1, characterized in that, Determining whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation includes: If the IBC mode used by the current block is IBC merge mode, then a merge candidate list is constructed; Determine a second index, which is used to indicate the block vector BV from the current block to the first reference block of the current block in the merge candidate list; If the first reference block uses the IBC-LIC mode, then it is determined that the current block uses the IBC-LIC mode.

18. The method according to claim 17, characterized in that, Determining the first prediction mode used by the current block in the IBC-LIC mode includes: The prediction mode used by the first reference block is determined to be the first prediction mode.

19. The method according to any one of claims 1 to 18, characterized in that, Before determining whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation, the method further includes: Obtain the second identifier; The second identifier indicates whether the IBC mode used by the current block is the IBC merge mode.

20. The method according to any one of claims 1 to 19, characterized in that, The step of performing illumination compensation on the first predicted block obtained by predicting the current block using the IBC mode based on the model corresponding to the first prediction mode to obtain the second predicted block of the current block includes: If the first prediction mode corresponds to a single model, then illumination compensation is performed on the prediction samples in the first prediction block based on the single model to obtain the second prediction block.

21. The method according to any one of claims 1 to 19, characterized in that, The step of performing illumination compensation on the first predicted block obtained by predicting the current block using the IBC mode based on the model corresponding to the first prediction mode to obtain the second predicted block of the current block includes: If the first prediction mode corresponds to multiple models, then determine the model used by any one of the prediction samples in the first prediction block from among the multiple models; The second prediction block is obtained by performing illumination compensation on any one of the prediction samples based on the model used for that prediction sample.

22. The method according to claim 21, characterized in that, The step of determining the model used for any one prediction sample in the first prediction block among the plurality of models includes: The model that corresponds to the interval in which the value of any one of the multiple models is located is determined as the model used for that one prediction sample.

23. The method according to any one of claims 1 to 22, characterized in that, Determining whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation includes: If at least one of the following conditions is met, it is determined whether the current block uses the IBC-LIC mode: The prediction type used in the current block is IBC mode; The current sequence to which the current block belongs is allowed to use the IBC-LIC mode; The area of ​​the current block is greater than or equal to a preset first threshold. The area of ​​the current block is less than or equal to a preset second threshold; The type of the current image to which the current block belongs is a preset type; The IBC mode used by the current block is not the type of mode used when the IBC-LIC mode is different.

24. The method according to any one of claims 1 to 23, characterized in that, The method further includes: Obtain the residual block of the current block; Based on the residual block and the second prediction block, the reconstruction block of the current block is determined.

25. An encoding method, characterized in that, include: By iterating through the models corresponding to at least one pattern, illumination compensation is performed on the third prediction block to obtain the first set of distortion costs. The third prediction block is a prediction block obtained by predicting the current block using the Intra-Block Copy IBC Advanced Motion Vector Prediction (AMVP) mode. Illumination compensation is performed on the fourth prediction block based on the inheritance model to obtain the second distortion cost set; the fourth prediction block is a reference block in the merging candidate list obtained by predicting the current block based on the IBC merging mode; Based on the first distortion cost set and the second distortion cost set, the IBC mode used by the current block is determined.

26. The method according to claim 25, characterized in that, The step of determining the IBC mode used by the current block based on the first distortion cost set and the second distortion cost set includes: If the minimum value in the first set of distortion costs is less than the minimum value in the second set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBCAMVP mode.

27. The method according to claim 26, characterized in that, The method further includes: Determine the first identifier; The first identifier indicates that the current block is allowed to use the intra-block copying IBC-LIC mode based on local illumination compensation; The first identifier is encoded.

28. The method according to claim 27, characterized in that, The method further includes: Determine the first index; Wherein, the first index is used to indicate the first prediction mode used by the current block in the at least one mode; The first index is encoded.

29. The method according to claim 28, characterized in that, The first index is used to indicate the first predicted pattern among the sorted at least one pattern; the method further includes: Determine the distortion cost of the at least one mode; The distortion cost of any one of the at least one modes is determined based on the reconstructed samples in the template region of the current block and the samples obtained by performing illumination compensation on at least one predicted sample using the model corresponding to the at least one mode. The at least one predicted sample includes the predicted sample obtained by predicting the samples in the template region of the current block using the IBC-LIC mode. Based on the distortion cost of the at least one mode, the at least one mode is sorted to obtain the at least one sorted mode.

30. The method according to any one of claims 25 to 29, characterized in that, The method further includes: Based on the reconstructed samples within the template region of the current block and the reconstructed samples within the template region of the third prediction block, a first model is determined; Wherein, the at least one mode includes a first mode corresponding to the first model.

31. The method according to claim 30, characterized in that, The method further includes: The parameters of the first model are adjusted based on the adjustment value corresponding to the first mode to obtain the second model; Wherein, the at least one mode includes a second mode corresponding to the second model.

32. The method according to any one of claims 25 to 31, characterized in that, The method further includes: Identify multiple third models; Among them, any one of the plurality of third models is determined based on a first sample group obtained by dividing the reconstructed samples within the template region of the current block and a second sample group obtained by dividing the predicted samples within the template region of the third prediction block; The at least one mode includes a third mode corresponding to the plurality of third models.

33. The method according to claim 32, characterized in that, The method further includes: Based on the adjustment value corresponding to the third mode, the parameters of the multiple third models are adjusted to obtain multiple fourth models; Wherein, the at least one mode includes a fourth mode corresponding to the plurality of fourth models.

34. The method according to claim 32 or 33, characterized in that, The method further includes: Based on the values ​​of the reconstructed samples in the template region of the third prediction block, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups, and the second sample group is any one of the plurality of sample groups. The reconstructed samples whose positions within the template region of the current block correspond to the second sample group are divided into the first sample group.

35. The method according to claim 34, characterized in that, The values ​​of the reconstructed samples in the template region of the third prediction block are used to divide the reconstructed samples in the template region of the third prediction block into the multiple sample groups, including: Determine the average value of the reconstructed samples in the template region of the third prediction block; Based on the average value, the reconstructed samples in the template region of the third prediction block are divided into the plurality of sample groups; the plurality of sample groups include: a sample group in which the value of the reconstructed sample is greater than or equal to the average value, and a sample group in which the value of the reconstructed sample is less than the average value.

36. The method according to claim 31 or 33, characterized in that, The adjustment parameters include the adjustment amount of the scaling parameter and / or the adjustment amount of the bias parameter.

37. The method according to any one of claims 29 to 36, characterized in that, The template area of ​​the current block includes the upper template area and / or the left template area.

38. The method according to claim 37, characterized in that, The sampling step size used when the template region of the current block is the upper template region or the left template region is smaller than the sampling step size used when the template region of the current block includes both the upper template region and the left template region; The samples obtained in the template region of the current block according to the sampling step size are used to determine the model corresponding to the pattern in the at least one pattern.

39. The method according to claim 37, characterized in that, When the template region of the current block is the upper template region, the number of sample rows in the upper template region is greater than the number of sample rows in the upper template region when the template region of the current block includes both the upper template region and the left template region; and / or, when the template region of the current block is the upper template region, the number of sample columns in the upper template region is greater than the number of sample columns in the upper template region when the template region of the current block includes both the upper template region and the left template region.

40. The method according to claim 37, characterized in that, When the template area of ​​the current block is the left template area, the number of sample rows in the left template area is greater than the number of sample rows in the left template area when the template area of ​​the current block includes both the upper template area and the left template area; and / or, when the template area of ​​the current block is the left template area, the number of sample columns in the left template area is greater than the number of sample columns in the left template area when the template area of ​​the current block includes both the upper template area and the left template area.

41. The method according to claim 27, characterized in that, The method further includes: Encode at least one of the following indices: An index used to indicate whether the model corresponding to the first prediction mode used by the current block is a single model or multiple models; an index used to indicate the template region used by the model corresponding to the first prediction mode; an index used to indicate whether the model corresponding to the first prediction mode is a model after parameter adjustment; and the adjustment parameters corresponding to the first prediction mode.

42. The method according to claim 25, characterized in that, The step of determining the IBC mode used by the current block based on the first distortion cost set and the second distortion cost set includes: If the minimum value in the second set of distortion costs is less than the minimum value in the first set of distortion costs and the distortion cost of the current block in other prediction modes, then the IBC mode used by the current block is determined to be the IBC merging mode.

43. The method according to claim 42, characterized in that, The method further includes: Build a list of candidate mergers; Determine a second index, which indicates the block vector BV from the current block to the first reference block in the merge candidate list; The second index is encoded.

44. The method according to any one of claims 25 to 43, characterized in that, The method further includes: Determine the second identifier; The second identifier indicates whether the IBC mode used by the current block is the IBC merge mode; The second identifier is encoded.

45. The method according to any one of claims 25 to 44, characterized in that, The model corresponding to at least one mode is traversed to perform illumination compensation on the third prediction block, resulting in a first set of distortion costs, including: If at least one of the following conditions is met, then illumination compensation is performed on the third prediction block based on the model corresponding to the at least one mode to obtain the first distortion cost set: The prediction type used in the current block is IBC mode; The current sequence to which the current block belongs is allowed to use IBC-LIC mode; The area of ​​the current block is greater than or equal to a preset first threshold. The area of ​​the current block is less than or equal to a preset second threshold; The type of the current image to which the current block belongs is a preset type; The IBC mode used by the current block is not the same type of mode used when the IBC-LIC mode is different.

46. ​​The method according to any one of claims 25 to 45, characterized in that, The inheritance-based model performs illumination compensation on the fourth prediction block to obtain a second set of distortion costs, including: Construct the merge candidate list; Specifically, for the first candidate reference block in the merge candidate list, if the first candidate reference block uses the IBC-LIC mode, then the second distortion cost set includes: Based on the model used by the first candidate reference block, illumination compensation is performed on the first candidate reference block to obtain the distortion cost.

47. A decoder, characterized in that, include: The first determining unit is used to determine whether the current block uses the intra-block copying IBC-LIC mode based on local illumination compensation; The second determining unit is configured to determine, if the current block uses the IBC-LIC mode, the first prediction mode used by the current block in the IBC-LIC mode; The compensation unit is used to perform illumination compensation on the first prediction block obtained by predicting the current block using the IBC mode used by the current block, based on the model corresponding to the first prediction mode, to obtain the second prediction block of the current block.

48. An encoder, characterized in that, include: The first compensation unit is used to traverse the model corresponding to at least one mode to perform illumination compensation on the third prediction block and obtain the first distortion cost set. The third prediction block is a prediction block obtained by predicting the current block using the Intra-Block Copy IBC Advanced Motion Vector Prediction (AMVP) mode. The second compensation unit is used to perform illumination compensation on the fourth prediction block based on the inherited model to obtain the second distortion cost set. The fourth prediction block is a reference block in the merge candidate list obtained by predicting the current block based on the IBC merge mode; The determining unit is configured to determine the IBC mode used by the current block based on the first distortion cost set and the second distortion cost set.

49. An electronic device, characterized in that, include: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program that, when executed by the processor, implements the method according to any one of claims 1 to 24 or the method according to any one of claims 25 to 46.

50. A computer-readable storage medium, characterized in that, Used to store a computer program that, when run on a computer, causes the computer to perform the method according to any one of claims 1 to 24 or the method according to any one of claims 25 to 46.

51. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method according to any one of claims 1 to 24 or the method according to any one of claims 25 to 46.

52. A bitstream, characterized in that, The bitstream is a bitstream decoded by the method according to any one of claims 1 to 24, or the bitstream is a bitstream generated by the method according to any one of claims 25 to 46.