Video codec methods, apparatus, devices, systems, and storage media

The multi-model intra-block copy illumination compensation mode addresses poor prediction and efficiency issues in current video codecs by selecting optimal linear model parameters for each block, enhancing prediction accuracy and encoding efficiency.

JP2026512076A5Pending Publication Date: 2026-04-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2023-04-07
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Current video codec methods using intra-block copy illumination compensation modes suffer from poor illumination compensation effects, inaccurate prediction, and low codec efficiency.

Method used

Implement a multi-model intra-block copy illumination compensation mode that determines multiple groups of linear model parameters for improved prediction, allowing selection of the most suitable model for each block based on specific conditions.

Benefits of technology

Enhances prediction accuracy and codec performance by effectively handling illumination changes, reducing residual information, and improving encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

This application provides a video codec method, apparatus, device, system, and storage medium, which, when coding the current block, determines the prediction mode of the current block, and if the prediction mode of the current block is a multi-model intra-block copy illumination compensation mode, determines the reference block of the current block, determines N groups of linear model parameters, where N is a positive integer greater than 1, selects the linear model parameters of a target group from the N groups of linear model parameters, further linearly modifies the reference block using the linear model parameters of the target group, obtains the prediction block of the current block, improves the illumination compensation effect, and improves prediction accuracy and codec performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video codec technology, and in particular to video codec methods, devices, apparatuses, systems, and storage media.

Background Art

[0002] Digital video technology can be incorporated into various video devices, such as digital televisions, smartphones, computers, e-book readers, or video players. With the development of video technology, the amount of data contained in video data has become relatively large. To facilitate the transmission of video data, video devices perform video compression technology to transmit or store video data more efficiently.

[0003] Since video has temporal or spatial redundancy, the redundancy of video can be removed or reduced by prediction, thereby improving the compression efficiency. Currently, in order to improve the prediction effect, an intra-block copy illumination compensation mode has been proposed. However, in some cases, when prediction is performed using the current intra-block copy illumination compensation mode, there are problems such as poor illumination compensation effect, inaccurate prediction, and low codec efficiency.

Summary of the Invention

[0006] In a second aspect, embodiments of the present application provide a video encoding method, which is: The steps include determining the prediction mode for the current block, If the prediction mode of the current block is a multi-model intra-block copy illumination compensation mode, the steps are to determine the reference block of the current block and determine the linear model parameters of N groups, wherein N is a positive integer greater than 1, The process includes the steps of selecting linear model parameters for a target group from the linear model parameters of the N groups, linearly transforming the reference block using the linear model parameters of the target group, and obtaining a predicted block for the current block.

[0007] In a third aspect, the present application provides a video decoding device for performing the method in the first aspect or each embodiment thereof. Specifically, the device comprises a functional unit for performing the method in the first aspect or each embodiment thereof.

[0008] In a fourth aspect, the present application provides a video encoding apparatus for performing the method in the second aspect or each embodiment thereof. Specifically, the apparatus comprises a functional unit for performing the method in the second aspect or each embodiment thereof.

[0009] A fifth aspect provides a video decoder comprising a processor and memory. The memory is used to store computer programs, and the processor is used to call and execute the computer programs stored in the memory in order to perform the methods of the first aspect or each embodiment described above.

[0010] The sixth aspect provides a video encoder comprising a processor and memory. The memory is used to store computer programs, and the processor is used to call and execute the computer programs stored in the memory in order to perform the methods of the second aspect or each embodiment thereof.

[0011] The seventh aspect provides a video codec system including a video encoder and a video decoder. The video decoder is used to carry out the method in the first aspect or each embodiment described above, and the video encoder is used to carry out the method in the second aspect or each embodiment described above.

[0012] The eighth aspect provides a chip for implementing the method in any of the first to second aspects or each embodiment thereof. Specifically, the chip includes a processor used to call and execute a computer program from memory so that the device to which the chip is attached performs the method in any of the first to second aspects or each embodiment thereof.

[0013] The ninth aspect provides a computer-readable storage medium used to store a computer program that causes a computer to execute any of the methods in the first to second aspects or in each of their embodiments.

[0014] In the tenth aspect, a computer program product is provided that includes computer program instructions for causing a computer to execute any of the methods in the first to second aspects or in each of their embodiments.

[0015] In the eleventh embodiment, a computer program is provided that, when executed on a computer, causes the computer to perform any of the methods in the first to second embodiments or in each of those embodiments.

[0016] In the twelfth aspect, a bitstream generated based on the method of the second aspect is provided.

[0017] Based on the above technical proposal, we propose a multi-model intrablock copy illumination compensation mode, thereby increasing the number of intrablock copy illumination compensation modes. Thus, the codec can choose whether to perform predictive compensation using a single-model intrablock copy illumination compensation mode (i.e., having only one group of model parameters) or a multi-model intrablock copy illumination compensation mode (i.e., including multiple groups of model parameters) depending on the specific situation of the current block. When the multi-model intrablock copy illumination compensation mode is selected and predictive compensation is performed for the current block, N groups of linear model parameters are determined, and from these N groups of linear model parameters... Linear model parameters of the target group Select this, and furthermore, this Linear model parameters of the target group This method linearly modifies the reference block of the current block and obtains the predicted block of the current block to improve lighting compensation effects, thereby improving prediction accuracy and codec performance. [Brief explanation of the drawing]

[0018] [Figure 1] This is a schematic block diagram of a video codec system according to an embodiment of the present invention. [Figure 2] This is a schematic block diagram of a video encoder according to an embodiment of the present invention. [Figure 3] This is a schematic block diagram of a video decoder according to an embodiment of the present invention. [Figure 4A] This is a schematic diagram of images with different brightness levels. [Figure 4B] This is a schematic diagram of images with different brightness levels. [Figure 5] It is a schematic diagram of the principle of the illumination compensation model. [Figure 6] It is a schematic diagram of sample selection. [Figure 7] It is a schematic diagram of the principle of IBC. [Figure 8] It is a schematic diagram of images under different illuminations. [Figure 9] It is a schematic diagram of IBC-LIC. [Figure 10] It is a schematic diagram of one application scenario. [Figure 11] It is a diagram showing a flowchart of a video decoding method according to an embodiment of the present application. [Figure 12] It is a schematic diagram of a template. [Figure 13] It is a schematic diagram of an extended template. [Figure 14] It is a schematic diagram of an extended template. [Figure 15] It is a diagram showing a flowchart of a video encoding method according to an embodiment of the present application. [Figure 16] It is a schematic block diagram of a video decoding device according to an embodiment of the present application. [Figure 17] It is a schematic block diagram of a video encoding device according to an embodiment of the present application. [Figure 18] It is a schematic block diagram of an electronic device according to an embodiment of the present application. [Figure 19] It is a schematic block diagram of a video codec system according to an embodiment of the present application.

Embodiments for Carrying Out the Invention

[0019] This invention can be applied to the fields of image codecs, video codecs, hardware video codecs, dedicated circuit video codecs, real-time video codecs, and the like. For example, the solution of this invention can be combined with audio video coding standards (AVS), such as 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. Alternatively, the present invention's solution can be used in conjunction with other proprietary or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262, or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), and includes Scalable Video Codec (SVC) and Multiview Video Codec (MVC) extensions. It should be understood that the present invention's technology is not limited to any specific codec standard or technology.

[0020] To facilitate understanding, we will first describe the video codec system according to the embodiment of the present invention with reference to Figure 1.

[0021] Figure 1 is a schematic block diagram of a video codec system according to an embodiment of the present application. Note that Figure 1 is merely an example, and the video codec system of the embodiment of the present application includes, but is not limited to, what is shown in Figure 1. As shown in Figure 1, the video codec system 100 includes an encoding device 110 and a decoding device 120. Here, the encoding device is used to encode (which can be understood as compressing) video data to generate a bitstream and transmit that bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding device to obtain decoded video data.

[0022] The encoding device 110 in the embodiments of the present application can be understood as a device having video encoding capabilities, and the decoding device 120 can be understood as a device having video decoding capabilities. That is, the embodiments of the present application include a broader range of devices than the encoding device 110 and the decoding device 120, including, for example, smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and the like.

[0023] In some embodiments, the encoding device 110 can transmit encoded video data (e.g., a bitstream) to the decoding device 120 via channel 130. Channel 130 may include one or more media and / or devices that can transmit the encoded video data from the encoding device 110 to the decoding device 120.

[0024] In one example, channel 130 includes one or more communication media that enable the encoding device 110 to directly transmit encoded video data to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to the decoding device 120. Here, the communication media includes a wireless communication medium, such as a radio frequency spectrum, and optionally, the communication media may further include a wired communication medium, such as one or more physical transmission lines.

[0025] In another example, channel 130 includes a storage medium that can store video data encoded by the encoding device 110. The storage medium includes several types of locally accessible data storage media, such as optical discs, DVDs, and flash memory. In this example, the decoding device 120 can retrieve the encoded video data from the storage medium.

[0026] In another example, channel 13 may include a storage server capable of storing video data encoded by the encoding device 110. In this example, the decoder 120 can download the encoded video data stored from the storage server. Optionally, the storage server can store the encoded video data and transmit it to the decoder 120, for example, a web server (e.g., for a website), a File Transfer Protocol (FTP) server, etc.

[0027] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113, where the output interface 113 may include a modulator / demodulator (modem) and / or transmitter.

[0028] In some embodiments, the encoding device 110 includes a video encoder 112 and output In addition to interface 113, a video source 111 may also be included.

[0029] The 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, where the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data.

[0030] The video encoder 112 encodes video data from the video source 111 to generate a bitstream. The video data may include one or more pictures or sequences of pictures. The bitstream contains encoding information for the pictures or sequences of pictures in bitstream format. 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. An SPS may include parameters that apply to one or more sequences. A PPS may include parameters that apply to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order within the bitstream.

[0031] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored in a storage medium or storage server for later reading by the decoding device 120.

[0032] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.

[0033] In some embodiments, the decoding device 120 may further include a display device 123 in addition to the input interface 121 and the video decoder 122.

[0034] Here, the input interface 121 includes a receiver and / or modem. The input interface 121 can receive encoded video data via channel 130.

[0035] The video decoder 122 is used to decode the encoded video data, obtain the decoded video data, and transmit the decoded video data to the display device 123.

[0036] The display device 123 displays the decoded video data. The display device 123 may be integrated with the decoding device 120 or may be located outside the decoding device 120. The display device 123 may include various types of display devices, such as liquid crystal displays (LCDs), plasma displays, organic light-emitting diode (OLED) displays, or other types of display devices.

[0037] Furthermore, Figure 1 is merely an example, and the technical proposal of the embodiment of the present application is not limited to Figure 1. For example, the technology of the present application can also be applied to one-sided video encoding or one-sided video decoding.

[0038] The following describes a video encoding framework according to an embodiment of the present application.

[0039] Figure 2 is a schematic block diagram of a video encoder according to an embodiment of the present invention. It should be understood that the video encoder 200 may be used to perform lossy compression on an image, or it may be used to perform lossless compression on an image. This lossless compression may be visually lossless compression or mathematically lossless compression.

[0040] The video encoder 200 is applicable to image data in luminance-chromaticity (YCbCr, YUV) format. For example, the YUV ratio may be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chromaticity, Cr (V) represents red chromaticity, and U and V are represented as chromaticity (Chroma) to describe color and saturation. For example, in color formats, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chromaticity components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chromaticity components (YYYYCbCrCbCr), and 4:4:4 means that integer pixel representation (YYYYCbCrCbCrCbCr).

[0041] For example, the video encoder 200 reads video data and, for each frame image in the video data, divides the frame image into several coding tree units (CTUs), which in some examples may be called "tree blocks," "largest coding units" (LCUs), or "coding tree blocks" (CTBs). Each CTU may be associated with a pixel block of equal size in the image. Each pixel may correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU may be associated with one luminance sampling block and two chrominance sampling blocks. The size of one CTU may be, for example, 128×128, 64×64, 32×32, etc. A single CTU may be further divided into several coding units (CUs) for coding, and the CUs may be rectangular or square blocks. A CU can be further partitioned into a prediction unit (PU) and a transform unit (TU), which allows for greater flexibility in processing by separating coding, prediction, and transformation. In one example, a CTU is partitioned into CUs using a quadtree scheme, and each CU is partitioned into TUs and PUs using a quadtree scheme.

[0042] Video encoders and video decoders can support a variety of PU sizes. Assuming a particular CU size is 2N×2N, video encoders and video decoders can support 2N×2N or N×N PU sizes for intra-prediction, and symmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-prediction. For inter-prediction, video encoders and video decoders can further support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N.

[0043] In some embodiments, 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 filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. The video encoder 200 may also include more functional components, fewer functional components, or different functional components.

[0044] Optionally, in this application, the current block may be called the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be called the prediction image block or image prediction block, and the reconstructed image block may also be called the reconstructed block or image reconstructed image block.

[0045] In some embodiments, the prediction unit 210 includes an inter-prediction unit 211 and an intra-prediction unit 212. Because there is a strong correlation between adjacent pixels within a single frame of video, the intra-prediction method is used in video codec technology to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in video, the inter-prediction method is used in video codec technology to eliminate temporal redundancy between adjacent frames, thereby improving encoding efficiency.

[0046] The interprediction unit 211 may be used for interprediction, which may include motion estimation and motion compensation, and may refer to image information from different frames. Interprediction is used to use motion information to find reference blocks from reference frames, generate prediction blocks based on the reference blocks, and remove temporal redundancy. The frames used by interprediction may be P frames and / or B frames, where P frames refer to forward prediction frames and B frames refer to bidirectional prediction frames. Interprediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks. Motion information includes a list of reference frames in which the reference frames exist, the reference frame index, and a motion vector. The motion vector may be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, an interpolation filter must be used within the reference frame to create the necessary fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks within the reference frame obtained based on the motion vector are called reference blocks. Some techniques directly use a reference block as a prediction block, while others generate prediction blocks by reprocessing based on the reference block. Reprocessing based on a reference block to generate prediction blocks can also be understood as first using a reference block as a prediction block, and then processing that prediction block to generate new prediction blocks.

[0047] The intra-prediction unit 212 predicts pixel information within the current block of an image in order to eliminate spatial redundancy by referring only to information from the same frame image. The frame used for intra-prediction may be an I-frame.

[0048] Intra prediction has multiple prediction modes. Taking the International Digital Video Coding Standard H-Series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC is extended to 33 angular prediction modes and 2 non-angular prediction modes. The intra prediction modes used in HEVC are Planar mode, DC, and 33 angular modes, for a total of 35 prediction modes. prediction The modes include Planar, DC, and 65 different angle modes, for a total of 67 different prediction modes.

[0049] Furthermore, with the increase in angle modes, intra-prediction will become more accurate, better matching the demands of high-definition and super high-definition digital video development.

[0050] The residual unit 220 can generate residual blocks of the CU based on the pixel blocks of the CU and the prediction blocks of the PU of the CU. For example, the residual unit 220 can generate residual blocks 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.

[0051] The conversion / quantization unit 230 can quantize the conversion coefficients. The conversion / quantization unit 230 can quantize the conversion coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. The video encoder 200 can adjust the degree of quantization applied to the conversion coefficients associated with the CU by adjusting the QP value associated with the CU.

[0052] The inverse transform / quantization unit 240 can reconstruct residual blocks from quantized transform coefficients by applying inverse quantization and inverse transform, respectively, to the quantized transform coefficients.

[0053] The reconstruction unit 250 can generate reconstructed image blocks associated with the TU by adding the samples of the reconstructed residual blocks to the corresponding samples of one or more prediction blocks generated by the prediction unit 210. By reconstructing the sampling blocks of each TU in the CU in this manner, the video encoder 200 can reconstruct the pixel blocks of the CU.

[0054] The loop filter unit 260 is used to process inversely transformed and inversely quantized pixels, correct distortion information, and provide a better reference for subsequent encoded pixels. For example, it can perform a deblocking filter operation to reduce the blocking effect of pixel blocks associated with the CU.

[0055] In some embodiments, the loop filter unit 260 includes a deblocking filter unit and a sampling adaptive compensation / adaptive loop filter (SAO / ALF) unit, where the deblocking filter unit is used to remove blocking effects and the SAO / ALF unit is used to remove ringing effects.

[0056] The decoded image buffer 270 can store the reconstructed pixel blocks. The inter-prediction unit 211 can perform inter-prediction on other PUs in other images using the reference image containing the reconstructed pixel blocks. Furthermore, the intra-prediction unit 212 can perform intra-prediction on other PUs in the same image as the CU using the reconstructed pixel blocks in the decoded image buffer 270.

[0057] The entropy coding unit 280 can receive quantized transformation coefficients from the transformation / quantization unit 230. The entropy coding unit 280 can perform one or more entropy coding operations on the quantized transformation coefficients to generate entropy-coded data.

[0058] Figure 3 is a schematic block diagram of a video decoder according to an embodiment of the present invention.

[0059] As shown in Figure 3, the video decoder 300 may include an entropy decoding unit 310, a prediction unit 320, an inverse quantization / conversion unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded image buffer 360. The video decoder 300 may also include more functional components, fewer functional components, or different functional components.

[0060] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can analyze the bitstream and extract syntax elements from it. As part of the bitstream analysis, the entropy decoding unit 310 can analyze the entropy-decoded syntax elements within the bitstream. The prediction unit 320, the inverse quantization / conversion unit 330, the reconstruction unit 340, and the loop filter unit 350 can decode the video data according to the syntax elements extracted from the bitstream, i.e., generate the decoded video data.

[0061] In some embodiments, the prediction unit 320 includes an intra-prediction unit 322 and an inter-prediction unit 321.

[0062] The intra-prediction unit 322 can perform intra-prediction to generate prediction blocks for the PU. The intra-prediction unit 322 can generate prediction blocks for the PU based on spatially adjacent pixel blocks of the PU using the intra-prediction mode. The intra-prediction unit 322 can further determine the intra-prediction mode for the PU according to one or more syntax elements analyzed from the bitstream.

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

[0064] The inverse quantization / conversion unit 330 can inverse quantize (i.e., dequantize) the conversion coefficients associated with the TU. The inverse quantization / conversion unit 330 can determine the degree of quantization using the QP value associated with the CU of the TU.

[0065] After inverse quantization of the conversion coefficients, the inverse quantization / conversion unit 330 can apply one or more inverse transformations to the inverse quantization conversion coefficients to generate residual blocks associated with the TU.

[0066] The reconstruction unit 340 reconstructs the pixel blocks of the CU using the residual blocks associated with the TU of the CU and the predicted blocks of the PU of the CU. For example, the reconstruction unit 340 can reconstruct the pixel blocks of the CU by adding the sampling of the residual blocks to the corresponding sampling of the predicted blocks and obtain a reconstructed image block.

[0067] The loop filter unit 350 can perform a deblocking filter operation to reduce the blocking effect of pixel blocks associated with the CU.

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

[0069] The basic process of the video codec is as follows: On the encoding side, an image of one frame is divided into blocks, and for the current block, the prediction unit 210 generates a predicted block for the current block using intra-prediction or inter-prediction. The residual unit 220 can calculate a residual block, i.e., the difference between the predicted block and the original block of the current block, based on the predicted block and the original block of the current block. This residual block is also called residual information. This residual block can be processed by a transformation / quantization unit 230 to remove information that is not sensitive to the human eye and eliminate visual redundancy. Optionally, the residual block before transformation / quantization by the transformation / quantization unit 230 may be called a time-domain residual block, and the time-domain residual block after transformation / quantization by the transformation / quantization unit 230 may be called a frequency residual block or frequency-domain residual block. The entropy coding unit 280 receives the quantized coefficient of change output from the transformation / quantization unit 230 and can entropy code this quantized coefficient of change to output a bitstream. For example, the entropy coding unit 280 can remove character redundancy based on the target context model and the probabilistic information of the binary bitstream.

[0070] On the decoding side, the entropy decoding unit 310 analyzes the bitstream to obtain prediction information and quantization coefficient matrix for the current block. Based on the prediction information, the prediction unit 320 generates a predicted block for the current block using intra-prediction or inter-prediction. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the bitstream to inverse quantize the quantization coefficient matrix and perform an inverse transform to obtain the residual block. The reconstruction unit 340 adds the predicted block and the residual block to obtain the reconstructed block. The reconstructed block constitutes a reconstructed image, and the loop filter unit 350 performs a loop filter on the reconstructed image based on the image or block to obtain the decoded image. On the encoding side, it is also necessary to perform the same operations as on the decoding side to obtain the decoded image. This decoded image may also be called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-prediction for subsequent frames.

[0071] Furthermore, block partition information determined on the encoding side, as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, are included in the bitstream as needed. The decoding side analyzes the bitstream and, based on existing information, determines the same block partition information, prediction, transformation, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding side, thereby ensuring that the decoded image obtained on the decoding side is the same as the decoded image obtained on the decoding side.

[0072] The above describes the basic process of a video codec in a block-based hybrid coding framework. As technology advances, some modules or steps of this framework or process may be optimized. This application applies to, but is not limited to, the basic process of a video codec in this block-based hybrid coding framework.

[0073] The Japan Video Encoding Standards Organization (JVET) has already established a group to research encoding models that surpass H.266 / VVC, and has named this model, or platform test software, the Enhanced Compression Model (ECM). Based on VTM10.0, ECM has begun to adopt more efficient compression algorithms in updates, and currently achieves encoding performance approximately 13% better than VVC. ECM not only expands the encoding unit size for specific resolutions but also integrates many intra-prediction and inter-prediction techniques.

[0074] The present invention provides an improved ECM reference software to achieve higher coding efficiency.

[0075] In the embodiments of this application, the current block may be the current coding unit (CU) or the current prediction unit (PU), etc. Due to the need for parallel processing, the image may be partitioned into slices, etc., and slices within the same image can be processed in parallel, that is, there is no data dependency between them. On the other hand, "frame" is a commonly used term, and it can generally be understood that one frame is one image. In this application, the frame may be replaced with an image or a slice, etc.

[0076] In real-world nature videos, changes in illumination are common in the video content, such as a decrease in illumination over time, occlusion due to dark clouds, or changes in camera flash intensity. The difference between this video content and the preceding and succeeding frames lies primarily in the strength of the DC component of the image, with little change in the texture information within the content. However, due to the influence of relatively large DC component values, motion search and motion compensation in interpretation techniques cannot effectively predict this content, and it tends to incorporate a relatively large amount of residual information. Local illumination compensation (LIC) technique effectively removes this DC redundancy information, accurately predicts brightness changes, and performs corresponding compensation, thereby reducing residual information and improving encoding efficiency. Hereafter, local illumination compensation technique will be abbreviated as illumination compensation.

[0077] Currently, the latest video codec standard, H.266 / VVC, is already complete. The International Video Coding Collaborative Expert Group (JVET) proposed exploring video codec standards that surpass the encoding performance of VVC, and established the exploration experiment EE2 with the aim of going beyond VVC. The platform reference software used in the exploration experiment is based on VTM11.0, and the new algorithm has been integrated into it. At the same time, the branch has been changed to ECM, and several expert study groups have been established for ECM. The latest ECM reference software version 8.0 already has encoding performance that is about 19% better than VVC. However, the current latest standard, VVC, has only improved encoding performance by about 27% compared to the previous generation video codec standard, H.265 / HEVC. In the near future, it is possible that a window for the exploration and research of next-generation video codec standards based on ECM will open up.

[0078] In the early stages of the ECM proposal, coding tools not present in VVC were integrated into the reference software. These coding tools provided efficient coding performance and processing power for different coding scenarios in ECM, including LICs. Below, we will briefly describe LICs in current ECM.

[0079] Illumination compensation is an intercoding technique in which, during the intercoding process, the current coding unit obtains a corresponding reference block based on MV (motion vector information). This reference block is typically obtained from a different coding frame; in other words, the reference coding unit does not belong to the current image. Images from different frames vary to varying degrees in some specific scenarios, and illumination compensation is very effective in handling some of these variations. As shown in Figures 4A and 4B, the texture information of the two parts on the left and right is essentially the same; the difference lies in their brightness changes. The image on the right is illuminated by a camera flash and is very bright, while the image on the left is illuminated by normal natural light. Comparing the two images in the figure above reveals a difference, and this difference places a significant burden on video coding. Assuming the left block is the reference coding unit for the right block, the texture information of both is the same, so the difference in texture details is very small, but the overall residual is very large. This is because the pixels in the right image are offset as a whole due to the effect of the flash, and this offset is included in the residuals of both images. If we directly convert and quantize the residuals in this part and write them to the bitstream, the overhead for this part will be enormous.

[0080] Existing ECM reference software employs lighting compensation techniques, for example, to eliminate the effects of flash and lighting changes through linear fitting, thereby improving overall predictive effectiveness. The main components of these lighting compensation techniques are as follows:

[0081] The correlation between the reconstructed samples in the adjacent parts of the reference coding unit and the current coding unit is used to fit the correlation of changes between predicted samples and reference samples within the coding unit. This is possible because reconstructed samples adjacent to the upper and left sides of the current coding unit are available, and similarly, reconstructed samples adjacent to the reference coding unit in the reference image are also available. By modeling the reconstructed samples of the current frame and the reconstructed samples of the reference image, a corresponding fitting model can be obtained.

[0082] In the modeling process, the illumination compensation of the ECM employs a linear fitting method, and the model is simplified so that it can fit the illumination changes between the current frame and the reference image by configuring scaling parameter a and offset parameter b.

[0083] JPEG2024207434000001.jpg38167

[0084] Both a and b in the formula need to be calculated using the image information of the current frame and the image information of the reference frame.

[0085] JPEG2024207434000002.jpg45167

[0086] As shown in Figure 5, in the digital video codec process, the current frame's encoded block is corrected for illumination differences using an illumination compensation model, and the compensated predicted block is obtained.

[0087] Specifically, to calculate the scaling parameter a and offset parameter b mentioned above, as shown in Figure 6, it is necessary to use the adjacent reconstructed pixels of the corresponding reconstructed block in the reference frame and the adjacent reconstructed pixels of the encoded block in the current frame, and to model and find a solution based on the correlation between the adjacent reconstructed pixels of the encoded unit in the current frame and the reconstructed pixels at the corresponding positions in the reference frame.

[0088] As shown in Figure 6, each Reconstructed pixel is the nearest reconstructed sample pixel of the CU, and Reference e C U is the corresponding reconfigured CU in the reference frame, and Curren t C U is the CU awaiting encoding in the current encoded frame. The corresponding Reconstructed pixels in both frames are modeled to obtain a linear relationship, the scaling parameter a and offset parameter b are obtained, and this linear relationship is further referenced. e C Apply to U and Curren t C Obtain the prediction block for U. The specific modeling process is as follows:

[0089] The illumination compensation model is a linear model in ECM, and its model parameters include a scaling coefficient a and an offset parameter b, both of which are determined by the least squares method (Least Square Error). The number of reconstructed samples to select is set according to the width and height of the current coding unit. If there is a case where the width and height of the current coding unit are equal to 4, then 4 reconstructed samples are taken from the adjacent reconstructed samples above and to the left of the coding unit. For example, if the width of the current coding unit is 16 and the height is 4, then 4 reconstructed samples are taken from the adjacent reconstructed samples on the left, and 4 samples are taken from the adjacent reconstructed samples above with a step size of 3. If there is no case where the width and height of the current coding unit are equal to 4, then pixel samples are taken from the adjacent reconstructed samples above and to the left, with the number of samples being the logarithm of the smaller side length (base 2).

[0090] The model parameters are calculated after obtaining the upper and left reconstructed samples. Assuming that the reconstructed sample of the reference frame is denoted as x, the reconstructed sample of the current frame as y, the sum of the reconstructed samples of the reference frame as sumX, the sum of the reconstructed samples of the current frame as sumY, the sum of the squares of the reconstructed samples of the reference frame as sumXX, and the sum of the products of the reconstructed samples of the reference frame and the current frame as sumXY, the parameter calculation is as shown in equation (3): a=(sumXY-sumXsumY) / (sumXX-sumXsumX) b = sumY - a*sumX (3) In the formula, sumXsumY is the value obtained by multiplying sumX by sumY.

[0091] Several shift operations in the calculation process of the ECM reference software are all simplification processes, and their explanations are omitted here. After obtaining the linear model parameters, the final predicted block is obtained by linearly modifying the motion-compensated predicted block.

[0092] If the reconstruction samples used to calculate the linear model parameters described above belong to the interpretation block, an interpolation operation is required.

[0093] Illumination compensation techniques in ECM can be applied to normal inter-prediction, merge-prediction, and sub-block modes, where normal inter-prediction is inter mode, merge-prediction is merge mode, and sub-block mode is affine mode. At the same time, illumination compensation techniques are applied only to single-frame prediction mode and are prohibited from use in multi-frame bidirectional reference mode.

[0094] Furthermore, illumination compensation techniques in ECM have a coupling relationship with the techniques employed, and in current coding units, illumination compensation techniques are not used simultaneously with techniques such as bidirectional optical flow (BDOF) or symmetric motion vector difference (SMVD).

[0095] While the lighting compensation techniques described above are applied to inter-prediction, intra-prediction has a similar technique called intra-block copy (IBC). As its name suggests, intra-block copy searches for and copies a block within the current frame that matches or is similar to the current encoded block, and then uses it as a predicted block for the current encoded block. This is an intra-prediction technique specifically designed for encoding screen content.

[0096] For example, as shown in Figure 7, if there is an inverted triangle graphics texture within the encoding block on the right, encoding the current encoding block using conventional intra-prediction techniques would require a large amount of bit consumption to encode the residual information. On the other hand, by employing intra-block copy techniques, a search is performed within a defined range in the current frame to find a similar or identical location in the upper left corner. Distortion cost calculation or hash value matching determines the found reconstructed block, which is then copied as the predicted block for the current encoding block. Such prediction techniques prove to be far more efficient than conventional intra-encoding techniques. In some cases, an identical predicted block can be found, eliminating the need to encode residual information and significantly saving bit overhead.

[0097] In Figure 7, the solid line with the arrow represents the block vector information BV of the current coded block. On the decoding side, the current coded block finds the matched reconstructed block as the predicted block of the current coded block through the BV.

[0098] Similar to interpretation, IBC has two modes: one is AMVP (advanced motion vector prediction) mode, and the other is skip / merge mode, or merge mode.

[0099] In AMVP mode, the IBC needs to transmit an index indicating which block vector prediction (BVP) to use and encode the block vector difference (BVD).

[0100] In skip / merge mode, the IBC needs to transmit an index that indicates which block vector (BV) information to use specifically.

[0101] Similar to interpretation, in some application scenarios, color differences may exist even if all the texture information within the encoded block is the same. In natural sequences, the most common scenario is changes in lighting; for example, if a camera is fixed and filming a building, the video content of the building filmed in the morning will be the same as the video content of the building filmed in the afternoon. However, because the illuminance changes, interpretation cannot fully represent the video content even if it uses the decoded reconstructed frame as the reference content, and the average value of the entire video content will differ due to the difference in lighting, resulting in a large consumption of residual bitstream required for encoding. Lighting compensation techniques effectively solve this problem by constructing a linear model that transforms the reference content and the current content, and adapts to different illuminance changes without changing the texture content.

[0102] Similarly, the same problem exists in screen content encoding. Even if the content of the encoded blocks is the same, color deviations and other issues can lead to low encoding efficiency in intra-block copy techniques, and in some cases, it may even be impossible to find similar encoded blocks. For example, as shown in Figure 8, even if the texture of the image content is the same, large color differences can reduce the efficiency of block copy techniques or even prevent matching to these reconstructed image contents.

[0103] On the other hand, the IBC-LIC technique is similar to the interLIC technique, establishing a linear relationship between the reference block and the coded block, thereby transforming the reference block into the predicted block for the current coded unit, and this process is the same as the interLIC part described above. In some embodiments, in AMVP mode, the IBC requires a flag bit to indicate whether or not the LIC technique is used, and in merge mode, the LIC technique is enabled and disabled by an inheritance method.

[0104] As an example, Figure 9 shows the encoding status of the current image region after enabling the IBC-LIC technique. As shown in Figure 9, more and more encoded blocks from the second subgraph copy the contents of the previously reconstructed subgraph using the IBC-LIC technique.

[0105] IBC-LIC technology can certainly provide excellent performance in screen content encoding application scenarios, its computation process is the same as interLIC technology, its complexity is within acceptable limits at both the software and hardware levels, and it offers very high cost-effectiveness.

[0106] However, the fact that IBC-LIC continues to use interLIC while simultaneously modeling using reference and reconstructed samples from the upper and left template regions as input does not always suit screen content encoding scenarios well. Typically, in natural sequences, changes in lighting should be uniform across the content within the current frame, whereas in screen content scenarios, the content is a pixel-level change and therefore sharper. For example, in some PowerPoint application scenarios, color changes are very rapid and dramatic, with some shapes being red and others turning green upon switching to the next shape. If the current encoding unit contains both of these colors, and the texture of the referenced reconstructed block is the same but the color changes are different, then the parameters calculated using the template cannot adequately reflect the relationship between the changes between the different colors, and the model parameters in this case become closer to a compromise fit. In a specific example, taking Figure 10 as an example, assuming that the right side is a blue circular pattern and the left side is an orange circular pattern, the shapes of the blue circular pattern on the right and the orange circular pattern on the left are very similar, and the degree of some color gradations is also very similar, so performing color correction after copying the edge shape is a very effective way to save bitrate. However, the area covered by the template usually has multiple colors, and different colors also exist in the prediction blocks, which can lead to inaccuracies in model fitting, and consequently, when prediction is made using the intra-block copy illumination compensation mode, the prediction becomes inaccurate and the codec efficiency decreases.

[0107] To solve the above technical problems, the embodiment of the present invention proposes a multi-model intrablock copy illumination compensation mode, thereby increasing the modes of intrablock copy illumination compensation. Thus, the codec can select whether to perform predictive compensation using a single-model intrablock copy illumination compensation mode (i.e., having only one group of model parameters) or a multi-model intrablock copy illumination compensation mode (i.e., including multiple groups of model parameters) depending on the specific situation of the current block. When the multi-model intrablock copy illumination compensation mode is selected and predictive compensation is performed for the current block, multiple groups of linear model parameters are determined, and a target is selected from these multiple groups of linear model parameters. group Select the linear model parameters, and furthermore, this Linear model parameters of the target group This method linearly modifies the reference block of the current block, obtains the predicted block of the current block, improves prediction accuracy, and enhances codec performance.

[0108] The video decoding method provided in the embodiment of this application will be described below, using the decoding side as an example, as shown in Figure 11.

[0109] Figure 11 is a flowchart showing a video decoding method provided in one embodiment of the present application, and the embodiment of the present application is applied to the video decoder shown in Figures 1 and 3. As shown in Figure 11, the method of the embodiment of the present application includes the following steps.

[0110] S101, determine the prediction mode for the current block.

[0111] In the embodiments of this application, for the sake of convenience of explanation, an intrablock copy illumination compensation mode having only one group of model parameters is referred to as a single-model intrablock copy illumination compensation mode, for example, as the IBC-LIC-S mode, where the IBC-LIC-S mode is the currently existing IBC-LIC mode. An intrablock copy illumination compensation mode including multiple groups of model parameters is referred to as a multi-model intrablock copy illumination compensation mode, for example, as the IBC-LIC-M mode.

[0112] In the embodiments of this application, a multi-model intra-block copy illumination compensation mode is proposed to improve the effectiveness of intra-block copy illumination compensation. This multi-model intra-block copy illumination compensation mode can be understood as an intra-block copy illumination compensation mode that includes multiple groups of linear model parameters. For example, using intra-copy technology, a reference block (or initial predicted block) of the current block is determined, then an optimal group of linear model parameters is selected from multiple groups of linear model parameters, linear modification (i.e., illumination compensation) is performed on the reference block of the current block, and a predicted block of the current block is obtained to improve the effectiveness and prediction accuracy of illumination compensation, and ultimately improve the decoding effect of the image.

[0113] In the embodiments of this application, for the sake of convenience of explanation, an intrablock copy illumination compensation mode having only one group of model parameters is referred to as a single-model intrablock copy illumination compensation mode, for example, as an IBC-LIC-S mode.

[0114] The embodiments of this application are not limited to a specific method for determining the prediction mode of the current block.

[0115] In some embodiments, the decoding side defaults to multi-model intra-block copy illumination compensation mode as the prediction mode for the current block.

[0116] In some embodiments, the decoding side constructs a list of candidate prediction modes, which include single-model intra-block copy illumination compensation modes and multi-model intra-block copy illumination compensation modes. The decoding side then determines the cost of each candidate prediction mode in the list predicting the template of the current block, and determines the candidate prediction mode with the lowest cost as the prediction mode for the current block.

[0117] In some embodiments, the decryption side decrypts the bitstream, obtains first information, which is used to indicate the prediction type of the current block, and further determines the prediction mode of the current block based on that first information.

[0118] In the embodiments of this application, the specific form of representation of the first information is not limited.

[0119] In one example, the first piece of information may be represented as modeType.

[0120] For example, if modeType=MODE_INTRA, it indicates that the prediction type for the current block is intra prediction.

[0121] Additionally, for example, if modeType=MODE_INTER, it indicates that the prediction type for the current block is interpretation.

[0122] Furthermore, for example, if modeType=MODE_IBC, it indicates that the prediction type for the current block is an intra-block copy prediction.

[0123] In some embodiments, where embodiments of the present application further include sequence-level flag bits, the decoding side first decodes the bitstream and obtains a third flag, which is a sequence-level flag bit and is used to indicate whether or not local illumination compensation is permitted for the current sequence. If the third flag indicates that local illumination compensation is permitted for the current sequence, the decoding side decodes the bitstream and obtains the first flag. Otherwise, the decoding side skips the step of decoding the bitstream and obtaining the first information.

[0124] In the embodiments of this application, the specific representation format of the third flag is not limited.

[0125] In one example, the third flag may be represented as sps_ibc_lic_enable_flag. Setting different values ​​for the third flag sps_ibc_lic_enable_flag indicates whether or not the use of local illumination compensation techniques is permitted for the current sequence.

[0126] For example, if the value of the third flag sps_ibc_lic_enable_flag is 0, it indicates that the use of local illumination compensation techniques is not permitted for the current sequence.

[0127] Additionally, for example, if the value of the third flag sps_ibc_lic_enable_flag is 1, it indicates that local illumination compensation technology is permitted for the current sequence.

[0128] In the embodiments of the present invention, the specific method by which the decoding side determines the prediction mode of the current block based on the first information is not limited.

[0129] In some embodiments, if the decoding side determines, based on the first information, that the prediction type of the current block is intra-prediction or inter-prediction, it continues decoding the bitstream and determines a specific intra-prediction mode or inter-prediction mode for the current block. At this point, the decoding side may determine that the prediction mode of the current block is not the multi-model intra-block copy illumination compensation mode.

[0130] In some embodiments, if the decoding side determines, based on the first information, that the prediction type of the current block is intra-block copy prediction, the decoding side can default to a multi-model intra-block copy illumination compensation mode for the prediction mode of the current block.

[0131] In some embodiments, if the decoder determines, based on the first information, that the prediction type of the current block is intra-block copy prediction, the decoder continues decoding the bitstream and obtains a first flag, which is used to indicate whether the current block uses merge mode, and further determines the prediction mode of the current block based on this first flag.

[0132] In the embodiments of this application, the specific representation format of the first flag is not limited.

[0133] In one example, the first flag may be represented as merge_flag. Setting a different value for the first flag, merge_flag, indicates whether the current block will use merge mode for prediction.

[0134] For example, if the value of the first flag, merge_flag, is 0, it indicates that the current block will not use merge mode for prediction.

[0135] Additionally, for example, if the value of the first flag, merge_flag, is 1, it indicates that the current block will use merge mode for prediction.

[0136] In the embodiments of the present invention, the specific method by which the decoding side determines the prediction mode of the current block based on the first flag is not limited.

[0137] In one possible embodiment, if the first flag indicates that the current block does not use merge mode, the decoding side defaults to setting the prediction mode for the current block to multi-model intra-block copy illumination compensation mode.

[0138] In one possible embodiment, if the first flag indicates that the current block does not use merge mode, the decoder may use single-model intra-block copy illumination compensation mode and multi-model intra-block copy illumination compensation mode to predict the template region of the current block, respectively, and select the mode with the lowest cost as the prediction mode for the current block.

[0139] In one possible embodiment, if the first flag indicates that the current block does not use merge mode, the decoder continues decoding the bitstream and obtains second information, which is used to indicate whether the current block uses intra-block copy illumination compensation mode, and further determines the prediction mode of the current block based on the second information.

[0140] In the embodiments of this application, the specific representation format of the second information is not limited.

[0141] In some embodiments, the second piece of information may be represented as cu_ibc_lic_flag. Setting different values ​​for the second piece of information, cu_ibc_lic_flag, indicates whether the current block uses intra-block copy illumination compensation mode.

[0142] For example, if the value of the second piece of information, cu_ibc_lic_flag, is 0, it indicates that the current block will not use intra-block copy illumination compensation mode for prediction.

[0143] Furthermore, for example, if the value of the second piece of information, cu_ibc_lic_flag, is 1, it indicates that the current block will use the intra-block copy illumination compensation mode for prediction.

[0144] In some embodiments, the decoding side has limitations on the size of blocks for which it uses the intrablock copy illumination compensation mode. For example, it does not use the intrablock copy illumination compensation mode for some block sizes, while it does use it for some block sizes. Based on this, before decoding the second information, the decoding side first determines whether the size of the current block satisfies a first predetermined size. If the size of the current block satisfies the first predetermined size, it decodes the bitstream and obtains the second information.

[0145] In the embodiments of this application, the specific indicators for determining the current block size are not limited.

[0146] For example, the size of the current block may be determined using the width and height of the current block. For instance, if the width of the current block is greater than threshold 1 and the height is greater than threshold 2, it is determined that the size of the current block satisfies the first predetermined size, thereby decoding the bitstream and obtaining the second information. Here, the values ​​of threshold 1 and threshold 2 may be 4, 8, 16, 32, 128, 256, etc., and threshold 1 may be equal to threshold 2.

[0147] For example, the size of the current block may be determined using the product of the width and height of the current block, i.e., the area of ​​the current block. For instance, if the area of ​​the current block is greater than or equal to threshold 3 and less than threshold 5, it is determined that the size of the current block satisfies the first predetermined size, thereby decoding the bitstream and obtaining the second information. Here, the value of threshold 3 may be 16, 32, etc., and the value of threshold 5 may be 256, 1024, etc.

[0148] For example, the size of the current block may be determined using the number of pixel points contained in the current block. For instance, if the number of pixel points in the current block is greater than or equal to a threshold of 4, it is determined that the size of the current block satisfies a first predetermined size, thereby decoding the bitstream and obtaining second information. Here, the value of the threshold of 4 may be 16, 32, 128, 256, 1024, etc.

[0149] In the embodiments of the present invention, the specific method by which the decoding side determines the prediction mode of the current block based on the second information is not limited.

[0150] Method 1, if the second piece of information indicates that the current block does not use the intra-block copy illumination compensation mode, the decoding side continues decoding the bitstream, determines the prediction mode for the current block, and determines that the prediction mode for the current block is not the multi-model intra-block copy illumination compensation mode.

[0151] Method 2: If the second piece of information indicates that the current block should use the intra-block copy illumination compensation mode, the decoding side defaults to setting the prediction mode for the current block to the multi-model intra-block copy illumination compensation mode.

[0152] Method 3: If the second piece of information indicates that the current block should use the intrablock copy illumination compensation mode, the decoding side can use the single-model intrablock copy illumination compensation mode and the multi-model intrablock copy illumination compensation mode to predict the template region of the current block, respectively, and select the mode with the lowest cost as the prediction mode for the current block.

[0153] Method 4: If the second piece of information indicates that the current block uses the intra-block copy illumination compensation mode, the decoder continues decoding the bitstream and obtains index information, which is used to indicate the mode index of the intra-block copy illumination compensation mode used by the current block. Furthermore, based on this index information, the predicted mode of the current block is determined.

[0154] In the embodiments of this application, the specific representation format of the index information is not limited.

[0155] In some embodiments, index information may be represented as cu_ibc_lic_index. By setting different values ​​for this index information cu_ibc_lic_index, the mode index of the intra-block copy illumination compensation mode used by the current block is indicated.

[0156] For example, if the index information cu_ibc_lic_index has a value of the first number, it indicates that the prediction mode for the current block is the single-model intra-block copy illumination compensation mode.

[0157] Furthermore, for example, if the value of the index flag cu_ibc_lic_index is the second digit, it is determined that the prediction mode for the current block is the multi-model intra-block copy illumination compensation mode.

[0158] In the embodiments of this application, the specific values ​​of the first and second numerical values ​​are not limited.

[0159] For example, the first value is 0.

[0160] Also, for example, the second value is 1.

[0161] In one example of method 4, the decoding side determines the prediction mode of the current block by decoding the syntax elements shown in Table 1: [Table 1]

[0162] Here, sps_ibc_lic_enable_flag is a third flag indicating whether local illumination compensation is allowed for the current sequence. modeType is the first piece of information indicating the prediction type of the current block, and modeType==MODE_IBC indicates that the prediction type of the current block is intra-block copy prediction. merge_flag is the first flag indicating whether the current block uses merge mode for prediction. cbWidth is the width of the current block, and cbHeight is the height of the current block. cu_ibc_lic_flag is the second piece of information indicating whether the current block uses intra-block copy illumination compensation mode, and cu_ibc_lic_index is an index flag indicating the mode index of the intra-block copy illumination compensation mode used by the current block.

[0163] As shown in Table 1 above, in this example, the decoder first decodes sps_ibc_lic_enable_flag. If sps_ibc_lic_enable_flag indicates that local illumination compensation is permitted for the current sequence, it continues decoding merge_flag. If merge_flag indicates that the current block does not use merge mode, it determines whether the current block's cbWidth*cbHeight is greater than 32, where 32 is a predetermined value and can be changed depending on the actual situation. If the decoder determines that the current block's cbWidth*cbHeight > 32, it continues decoding cu_ibc_lic_flag. If cu_ibc_lic_flag indicates that the current block uses intra-block copy illumination compensation mode, it continues decoding cu_ibc_lic_index to obtain whether the current block's prediction mode is single-model intra-block copy illumination compensation mode or multi-model intra-block copy illumination compensation mode.

[0164] For example, the above cu_ibc_lic_index may be decoded using a context-based method or an equal-probability method.

[0165] Method 5: If the second information indicates that the current block should use the intrablock copy illumination compensation mode, and the size of the current block is greater than or equal to the second predetermined size, the multi-model intrablock copy illumination compensation mode is determined as the predicted mode for the current block.

[0166] In this method 5, the multi-model intra-block copy illumination compensation mode is used by default for relatively large current blocks. That is, when the syntax element analysis on the decoding side is performed, if cu_ibc_lic_flag is true and the size of the current block is greater than the second predetermined size, it indicates that the current block uses the multi-model intra-block copy illumination compensation mode; otherwise, it indicates that the current block does not use illumination compensation techniques and there is no need to analyze the index.

[0167] In the embodiments of this application, the specific indicators for determining the current block size are not limited.

[0168] For example, the size of the current block may be determined using the width and height of the current block. For instance, if the width of the current block is greater than threshold 1 and the height is greater than threshold 2, then the size of the current block is determined to be greater than a second predetermined size. Here, the values ​​of threshold 1 and threshold 2 may be 4, 8, 16, 32, 128, 256, etc., and threshold 1 may be equal to threshold 2.

[0169] For example, the size of the current block may be determined using the product of the width and height of the current block, i.e., the area of ​​the current block. For instance, if the area of ​​the current block is greater than or equal to threshold 3, it is determined that the size of the current block is greater than a second predetermined size. Here, the value of threshold 3 may be 16, 32, 128, 256, etc.

[0170] For example, the size of the current block may be determined using the number of pixel points contained in the current block. For instance, if the number of pixel points contained in the current block is greater than or equal to a threshold of 4, the size of the current block is determined to be greater than a second predetermined size. Here, the value of the threshold of 4 may be 16, 32, 128, 256, 1024, etc.

[0171] In the above embodiment, the second piece of information only indicates whether the current block uses the intrablock copy illumination compensation mode, and does not indicate the mode index of the intrablock copy illumination compensation mode; rather, the mode index of the intrablock copy illumination compensation mode is indicated by the index information.

[0172] In some embodiments, the second information may indicate not only whether the current block uses the intrablock copy illumination compensation mode, but also the mode index of the intrablock copy illumination compensation mode, in which case the decoding side can directly determine the prediction mode of the current block based on the value of the second information.

[0173] For example, in this embodiment, the second information can be represented using cu_ibc_lic_mode. Of course, the second information can also be represented using syntax elements, and is not limited to this in the embodiments of the present application.

[0174] For example, if the value of the second piece of information, cu_ibc_lic_mode, is the first numerical value, it is determined that the prediction mode of the current block is not the intra-block copy illumination compensation mode. Furthermore, for example, if the value of the second piece of information, cu_ibc_lic_mode, is the second numerical value, it is determined that the prediction mode of the current block is the single-model intra-block copy illumination compensation mode. Furthermore, for example, if the value of the second piece of information, cu_ibc_lic_mode, is the third numerical value, it is determined that the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode.

[0175] In the embodiments of this application, the specific values ​​of the first, second, and third numerical values ​​are not limited.

[0176] In one example, the first number is 0, the second number is 1, and the third number is 2.

[0177] In this embodiment, the specific value of the second information cu_ibc_lic_mode can be used to determine whether the current block uses an intrablock copy illumination compensation mode, and the mode index of the intrablock copy illumination compensation mode used by the current block.

[0178] For example, the decryption side decrypts the bitstream and obtains the second piece of information, cu_ibc_lic_mode. If the value of the second piece of information, cu_ibc_lic_mode, is the first digit, it is determined that the current block does not use intra-block copy illumination compensation mode. If the value of the second piece of information, cu_ibc_lic_mode, is the second digit, it is determined that the prediction mode of the current block is single-model intra-block copy illumination compensation mode. If the value of the second piece of information, cu_ibc_lic_mode, is the third digit, it is determined that the prediction mode of the current block is multi-model intra-block copy illumination compensation mode.

[0179] In this example, the decoding side determines the prediction mode of the current block by decoding the syntax elements shown in Table 2: [Table 2]

[0180] As shown in Table 2 above, in this example, the decoding side first decodes sps_ibc_lic_enable_flag. If sps_ibc_lic_enable_flag indicates that local illumination compensation is permitted for the current sequence, it continues decoding merge_flag. If merge_flag indicates that the current block does not use merge mode, it determines whether the current block's cbWidth*cbHeight is greater than 32, where 32 is a predetermined value and can be changed depending on the actual situation. If the decoding side determines that the current block's cbWidth*cbHeight > 32, it continues decoding cu_ibc_lic_mode. If cu_ibc_lic_mode is 0, it indicates that the current block does not use intra-block copy illumination compensation mode. If cu_ibc_lic_mode is 1, it indicates that the current block uses single-model intra-block copy illumination compensation mode. If cu_ibc_lic_mode is 2, it indicates that the current block uses multi-model intra-block copy illumination compensation mode.

[0181] In some embodiments, the intrablock copy illumination compensation mode is a set of tools and a mutex, in which case the conditions for analyzing the second information may be determined based on existing decoding tool coupling relationships in the standard. In this case, the decoding side further includes the step of decoding the bitstream and obtaining a third information before decoding the second information, which is used to indicate whether the current block uses a first tool for decoding, and if the first tool is the intrablock copy illumination compensation technique and a mutex, and the third information indicates that the current block does not use a first tool for decoding, then the bitstream is decoded and the second information is obtained.

[0182] In embodiments of the present invention, if the current block allows the use of other intrablock copy type prediction techniques and cannot be used simultaneously with intrablock copy illumination compensation techniques, it is possible to determine whether or not to analyze the second information of the current block by first analyzing the block-level usage flag bit (i.e., third information) of the first tool. If the block-level usage flag bit (i.e., third information) of the first tool is true, there is no need to analyze the second information of the current block; otherwise, the second information of the current block is analyzed.

[0183] As an example, we update the syntax element table using RRIBC as the first tool. RRIBC is a Reconstruction-reordered IBC, a technique that reorganizes the reconstructed sample and then searches for matching blocks. The reorganization operation includes, but is not limited to, horizontal and vertical inversion. At this time, the decoding side decodes the syntax elements as shown in Table 3 to obtain the prediction mode of the current block: [Table 3]

[0184] As shown in Table 3, cu_rribc_flip_type is the operation type of the first tool RRIBC. If cu_rribc_flip_type is 0, it indicates that the current block does not use RRIBC technology; otherwise, it indicates that the current block uses RRIBC technology.

[0185] As shown in Table 3, the decoding side decodes cu_rribc_flip_type. If cu_rribc_flip_type=0, i.e., indicating that the current block does not use RRIBC technology, the decoding side continues decoding the second information cu_ibc_lic_flag. If cu_rribc_flip_type=1, i.e., indicating that the current block uses RRIBC technology, the decoding side skips decoding the second information cu_ibc_lic_flag and determines that the current block does not use intra-block copy illumination compensation technology.

[0186] For example, the second piece of information in Table 3 above may be represented using cu_ibc_lic_mode in Table 2, thereby removing the index information cu_ibc_lic_index in Table 3.

[0187] The above describes the specific process by which the decryptionist determines the prediction mode of the current block when the first flag indicates that the current block does not use merge mode.

[0188] In some embodiments, if the first flag indicates that the current block uses merge mode, the decryptor can determine the prediction mode of the current block in at least one of the following ways:

[0189] Method 1: If the first flag indicates that the current block uses merge mode, the prediction mode of the referenced block is determined as the prediction mode of the current block.

[0190] In this method 1, if the decryption side determines that the current block uses merge mode, it obtains the prediction mode of the current block using inheritance. Specifically, the decryption side determines the reference block of the current block and determines the prediction mode of this reference block as the prediction mode of the current block.

[0191] For example, if the prediction mode of a reference block is the single-model intra-block copy illumination compensation mode, then the prediction mode of the current block is also determined to be the single-model intra-block copy illumination compensation mode.

[0192] Furthermore, for example, if the prediction mode of a reference block is the multi-model intra-block copy illumination compensation mode, then it is determined that the prediction mode of the current block is also the multi-model intra-block copy illumination compensation mode.

[0193] In this method 1, the encoding side does not need to transmit prediction mode information for the current block in the bitstream.

[0194] Method 2: If the first flag indicates that the current block uses merge mode, the single-model intra-block copy illumination compensation mode is determined as the predictive mode for the current block.

[0195] In this method 2, if the current block uses merge mode, both sides of the codec default to determining single-model intra-block copy illumination compensation mode as the prediction mode for the current block.

[0196] In this method 2, the encoding side does not need to transmit prediction mode information for the current block within the bitstream.

[0197] Method 3: If the first flag indicates that the current block uses merge mode, the multi-model intra-block copy illumination compensation mode is determined as the prediction mode for the current block.

[0198] In this method 3, if the current block uses merge mode, both sides of the codec default to determining the multi-model intra-block copy illumination compensation mode as the prediction mode for the current block.

[0199] In this method 3, the encoding side does not need to transmit prediction mode information for the current block within the bitstream.

[0200] Method 4: If the first flag indicates that the current block uses merge mode, the bitstream is decoded to obtain the fourth information, which is used to indicate the prediction mode of the current block, and the prediction mode of the current block is obtained based on the fourth information.

[0201] In this method 4, when the current block uses merge mode, the current block does not determine whether to use IBC-LIC by inheriting surrounding information; instead, the encoding side can transmit the status of its use to the decoding side in the form of a flag bit and an index by calculating the rate distortion cost. The decoding side analyzes the flag bit for the use of the technique in merge mode and determines whether to use the IBC-LIC technique for the current encoding unit. For example, the encoding side calculates the rate distortion cost when each candidate prediction mode predicts the current block, determines the candidate prediction mode with the minimum cost as the prediction mode for the current block, and at the same time writes fourth information to the bitstream according to this candidate prediction mode with the minimum cost, and uses this fourth information to indicate the prediction mode for the current block.

[0202] For example, if the encoding side determines that the current block does not use IBC-LIC, it sets the second piece of information in the table above, cu_ibc_lic_flag, to false. Alternatively, if the encoding side determines that the current block uses IBC-LIC, it can set the second piece of information in the table above, cu_ibc_lic_flag, to true and determine cu_ibc_lic_index based on the specific IBC-LIC mode index of the current block. For example, if the prediction mode of the current block is single-model intra-block copy illumination compensation mode, cu_ibc_lic_index is set to 0 and encoded into the stream; if the prediction mode of the current block is multi-model intra-block copy illumination compensation mode, cu_ibc_lic_index is set to 1 and encoded into the stream.

[0203] For example, if the encoding side determines that the current block does not use IBC-LIC, it can set the second piece of information in the table above, cu_ibc_lic_mode, to false, for example, to 0. Alternatively, if the encoding side determines that the current block uses IBC-LIC, it can set the second piece of information in the table above, cu_ibc_lic_mode, to true and determine the specific value of cu_ibc_lic_mode based on the specific IBC-LIC mode index of the current block. For example, if the prediction mode of the current block is single-model intra-block copy illumination compensation mode, cu_ibc_lic_mode is set to 1 and encoded into the stream; if the prediction mode of the current block is multi-model intra-block copy illumination compensation mode, cu_ibc_lic_mode is set to 2 and encoded into the stream.

[0204] The above describes the specific process by which the decryption side determines the prediction mode of the current block.

[0205] After determining the prediction mode of the current block based on the above steps, the decryption side performs the following step S102.

[0206] S102, if the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, determine the reference block of the current block and determine the linear model parameters of group N.

[0207] N is a positive integer greater than 1.

[0208] Based on the steps above, the decoding side determines the prediction mode of the current block. If the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, the decoding side must determine the N-group linear model parameters and simultaneously determine the reference block of the current block. Next, one group of linear model parameters is selected from these N-group linear model parameters to target group By selecting it as a linear model parameter and linearly modifying the reference block of the current block, we can obtain a prediction block with superior illumination compensation effects, thereby improving prediction accuracy and decoding performance.

[0209] The following describes the specific process for determining the referenced block of the current block.

[0210] In some embodiments, the reference block of the current block is also called the prediction block of the current block, or the initial prediction block of the current block, or the first prediction block of the current block, and so on. That is, in embodiments of the present application, the reference block of the current block can be understood as a prediction block that has not been illuminated.

[0211] In some embodiments, during intra-prediction, the decoding side determines the reference block of the current block in the current image (i.e., the current frame).

[0212] For example, in Figure 7, the solid line with the arrow represents the block vector information (BV) of the current block. On the decoding side, the current block finds the matched reconstructed block as the reference block of the current block through the BV.

[0213] Similar to interpretation, IBC has two modes: one is AMVP (advanced motion vector prediction) mode, and the other is skip / merge mode, or merge mode.

[0214] In one example, in AMVP mode, the decryptor builds an MVP candidate list, decrypts the bitstream, obtains an index, selects an MVP from the MVP candidate list based on this index, determines the starting point for motion estimation based on this selected MVP, searches near this starting point, and obtains the reference block for the current block.

[0215] In one example, in skip / merge mode, the decryption side constructs an mMVP candidate list, decrypts the bitstream, obtains an index, selects an MVP from the MVP candidate list based on this index, sets this selected MVP as the current MV, and then determines the reference block of the current block in the current image based on the MV.

[0216] In some embodiments, the decryptor may also use other existing methods to determine the reference block of the current block.

[0217] The following describes the specific process by which the decoding side determines the linear model parameters of the N groups.

[0218] In the embodiments of the present invention, when the decoding side determines that the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, it is necessary to determine multiple groups of linear model parameters, and then select one group from these multiple groups of linear model parameters to linearly modify the reference block of the current block and obtain the predicted value of the current block.

[0219] In the embodiments of this application, the specific parameters included in each set of linear model parameters are not limited and may include, for example, parameters related to any linear modification.

[0220] In one example, each set of linear model parameters in the N-group linear model parameters includes a scaling parameter a and an offset parameter b. Note that the parameters included in each set of N-group linear model parameters are not exactly the same.

[0221] For illustrative purposes, Table 4 shows the linear model parameters for group N in the embodiment of the present application. [Table 4]

[0222] In Table 4 above, (ai,bi) are the linear model parameters of the i-th group, where ai is the scaling parameter in the linear model parameters of the i-th group, and bi is the offset parameter in the linear model parameters of the i-th group.

[0223] The decoding side can determine the N groups of linear model parameters shown in Table 4, then select one group of linear model parameters from the N groups of linear model parameters shown in Table 4, linearly modify the reference block of the current block to achieve illumination compensation, obtain the reference block after illumination compensation, and further determine the reference block after illumination compensation as the predicted block of the current block.

[0224] In the embodiments of this application, the specific method by which the decoding side determines the linear model parameters of the N group is not limited.

[0225] In some embodiments, the encoding side can write the determined N-group linear model parameters to a bitstream, and the decoding side can obtain the N-group linear model parameters by decoding the bitstream.

[0226] In some embodiments, the linear model parameters of group N are predetermined values ​​or empirical values.

[0227] In some embodiments, the decoding side determines the linear model parameters of the N groups by the following step S102-A.

[0228] S102-A, the linear model parameters for group N are determined based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0229] In this embodiment, the decoding side determines the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block, and further determines the N-group linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0230] For example, the reconfigured region surrounding a referenced block includes the reconfigured region adjacent to the referenced block and / or the reconfigured region not adjacent to the referenced block. Correspondingly, the reconfigured region surrounding the current block includes the reconfigured region adjacent to the current block and / or the reconfigured region not adjacent to the current block.

[0231] In the embodiments of the present invention, the decoding side can determine N different linear model parameters based on the feature information of the reconstructed region surrounding the reference block and the feature information of the reconstructed region surrounding the current block. These N different linear model parameters can realize illumination compensation with different effects, and the decoding side can further improve the illumination compensation effect and prediction effect by selecting one group of linear model parameters for the target illumination compensation effect from these N groups of linear model parameters with different illumination compensation effects, depending on the actual situation, and performing illumination compensation on the reference block of the current block, thereby improving the illumination compensation effect and prediction effect, and further improving the decoding performance.

[0232] In the embodiments of the present invention, the specific method by which the decoding side determines the N-group linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block is not limited.

[0233] In some embodiments, the decoding side first determines a group of linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block. Exemplarily, the process of determining a group of linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block can be carried out by referring to the method shown in equation (3) above. Next, this group of linear model parameters is adjusted to obtain a group of N linear model parameters.

[0234] In some embodiments, the decoding side partitions the reconstructed area surrounding the reference block into N sub-regions, for example, based on characteristic information such as color information, luminance information, and bit depth of the reconstructed area surrounding the reference block, and partitions the reconstructed area surrounding the reference block into N first sub-regions. Correspondingly, according to the N first sub-regions of the reference block, the reconstructed area surrounding the current block is also partitioned into N second sub-regions, where one first sub-region corresponds to one second sub-region. This allows a group of linear model parameters to be determined based on each of the N first sub-regions and the corresponding second sub-region. For example, a group of linear model parameters 1 can be determined based on the first sub-region 1 and the second sub-region 1, a group of linear model parameters 2 can be determined based on the first sub-region 2 and the second sub-region 2, and so on, sequentially to determine N groups of linear model parameters. For example, the process of determining a group of linear model parameters 1 based on the first sub-region 1 and the second sub-region 1 can be carried out by referring to the method shown in equation (3) above.

[0235] In some embodiments, step S102-A above is followed by steps S102-A1 to S102-A3 as follows: S102-A1, a step of determining a first sample set from the reconstructed surrounding region of a reference block, and determining a second sample set from the reconstructed surrounding region of the current block, S102-A2, a step of partitioning the first sample set and the second sample set into N sample sets, wherein any one of the N sample sets includes at least one first sample and at least one second sample, S102-A3 includes the step of determining the linear model parameters of the i-th group sample set from among the N-group sample sets, based on the first and second samples included in the i-th group sample set, wherein i is a positive integer less than or equal to N.

[0236] In the embodiments of this application, for the sake of explanation, a sample (i.e., a reconstructed pixel point) contained in the reconstructed region surrounding the reference block is referred to as the first sample, and a sample (i.e., a reconstructed pixel point) contained in the reconstructed region surrounding the current block is referred to as the second sample.

[0237] In this embodiment, the decoding side determines the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block, then determines a first sample set from the reconstructed surrounding region of the reference block and a second sample set from the reconstructed surrounding region of the current block, where the first sample set includes at least one first sample and the second sample set includes at least one second sample.

[0238] In the embodiments of the present invention, the specific method by which the decoding side determines a first sample set from the reconstructed region surrounding the reference block and a second sample set from the reconstructed region surrounding the current block is not limited.

[0239] For example, the decoding side collects at least one first sample from the reconstructed region surrounding the reference block according to a predetermined collection step size to constitute a first sample set, and collects at least one second sample from the reconstructed region surrounding the current block according to a predetermined collection step size to constitute a second sample set.

[0240] Furthermore, for example, the decoding side determines all first samples contained in the reconstructed region surrounding the reference block as the first sample set, and all second samples contained in the reconstructed region surrounding the current block as the second sample set.

[0241] In some embodiments, the reconfigured region surrounding a reference block includes the template region of the reference block, and the reconfigured region surrounding the current block includes the template region of the current block, in which case the above S102-A1 becomes the following S102-A1 1 This includes the following steps.

[0242] S102-A11: Determine the first sample set from the template area of ​​the reference block, and determine the second sample set from the template area of ​​the current block.

[0243] In this embodiment, if the reconstructed region surrounding the reference block includes the template region of the reference block, and the reconstructed region surrounding the current block includes the template region of the current block, the decoding side can directly determine the first sample set from the template region of the reference block and the second sample set from the template region of the current block.

[0244] Specific embodiments in which the decryption side determines a first sample set from the template region of the reference block and a second sample set from the template region of the current block include, but are not limited to, the following:

[0245] Method 1: Set the number of first and second sample selections based on the current block width and height.

[0246] For example, if the width and height of the current block are equal to a predetermined value of 1 (e.g., 4), then a predetermined value of 1 (e.g., 4) of second samples are obtained from the upper and left templates of the current block, forming a second sample set, which contains 8 second samples. Similarly, a predetermined value of 1 (e.g., 4) of first samples are obtained from the upper and left templates of the reference block, forming a first sample set, which contains 8 first samples.

[0247] Furthermore, for example, if the width of the current block is a predetermined value of 2 (e.g., 16) and the height is a predetermined value of 3 (e.g., 4), then four second samples are obtained from the left template of the current block, and five (e.g., 4) second samples are obtained from the upper template of the current block with a predetermined step size of four (e.g., 3), forming a second sample set, which contains eight second samples. Four first samples are obtained from the left template of the reference block, and five (e.g., 4) first samples are obtained from the upper template of the reference block with a predetermined step size of four (e.g., 3), forming a first sample set, which contains eight first samples.

[0248] Furthermore, for example, if there are no cases where the width and height of the current block are both equal to a predetermined value of 1 (e.g., 4), a second sample set is constructed by obtaining a logarithm of the smaller side length with a base of 2 from the reconstructed samples contained in the upper and left templates of the current block. A first sample set is constructed by obtaining a logarithm of the smaller side length with a base of 2 from the reconstructed samples contained in the upper and left templates of the reference block.

[0249] For example, the upper template above contains one row of sample data (i.e., a row of pixels), and the left template contains one column of sample data (i.e., a column of pixels).

[0250] Method 2: The decoding side performs sampling in the template area of ​​the reference block according to the first sampling step size to obtain the first sample set, and then performs sampling in the template area of ​​the current block according to the first sampling step size to obtain the second sample set, where the first sampling step size is smaller than a predetermined sampling step size.

[0251] In this method 2, the decoding side can increase the number of samples involved in the calculation of linear model parameters by reducing the sampling step size, thereby improving the accuracy of the calculation of linear model parameters.

[0252] For example, the decoding side performs sampling in the template area of ​​the reference block according to the first sampling step size to obtain the first sample set, and then performs sampling in the template area of ​​the current block according to the first sampling step size to obtain the second sample set, wherein this first sampling step size is smaller than a predetermined sampling step size.

[0253] For example, the first sampling step size is less than 3.

[0254] Method 3: The decoding side determines all samples contained in the template area of ​​the reference block as the first sample set, and all samples contained in the template area of ​​the current block as the second sample set.

[0255] In method 3, all samples contained in the template region of the reference block are determined as the first sample set, and all samples contained in the template region of the current block are determined as the second sample set. This increases the number of samples involved in the calculation of linear model parameters and improves the accuracy of the calculation of linear model parameters.

[0256] In the embodiments of this application, the specific sizes of the template regions of the reference block and the current block are not limited.

[0257] In some embodiments, as shown in Figure 12, the template region of the referenced block includes the upper template region of the referenced block and / or the left template region of the referenced block, and the template region of the current block includes the upper template region of the current block and / or the left template region of the current block.

[0258] In some embodiments, the template region can be expanded to increase the number of samples involved in the calculation of linear model parameters.

[0259] In one example, the upper template is extended so that, for example, as shown in Figure 13, the left template area of ​​the reference block includes the left template area and the lower left template area of ​​the reference block, and the left template area of ​​the current block includes the left template area and the lower left template area of ​​the current block.

[0260] In one example, the left-hand template is extended so that, for example, as shown in Figure 14, the number of sample rows in the upper template area of ​​the reference block is greater than or equal to a predetermined number of rows, and the number of sample rows in the upper template area of ​​the current block is greater than or equal to a predetermined number of rows.

[0261] Thus, in the embodiments of the present invention, when selecting samples, a first sample set can be determined from the upper and / or left-side templates of the reference block shown in Figures 13 and 14, and a second sample set can be determined from the upper and / or left-side templates of the current block shown in Figures 13 and 14, thereby increasing the number of samples in the first and second sample sets.

[0262] In some embodiments, the decryption side may increase the number of rows in the upper template to achieve template extension. For example, the number of sample rows in the upper template area of ​​a reference block is greater than or equal to a predetermined number, and the number of sample rows in the upper template area of ​​the current block is greater than or equal to a predetermined number. Exemplaryly, this predetermined number of rows may be 2, 3, 4, 5, etc.

[0263] In some embodiments, the decoding side may increase the number of columns in the left template to achieve template expansion. For example, the number of sample columns in the left template area of ​​a reference block is greater than or equal to a predetermined number of columns, and the number of sample columns in the left template area of ​​the current block is greater than or equal to a predetermined number of columns. Exemplaryly, this predetermined number of columns may be 2, 3, 4, 5, etc.

[0264] The decoding side, using the steps described above, determines a first sample set from the reconstructed region surrounding the reference block, determines a second sample set from the reconstructed region surrounding the current block, and then executes the steps in S102-A2 above.

[0265] In the embodiments of this application, the specific method by which the decoding side partitions the first sample set and the second sample set into N sample sets is not limited.

[0266] In some embodiments, the decoding side partitions the first sample set and the second sample set into N groups of sample sets based on feature information such as color information, luminance information, and bit depth of each first sample and second sample in the first sample set and the second sample set, and each set of sample sets in these N groups of sample sets includes at least one first sample and at least one second sample. For example, among the first sample set and the second sample set, the first samples and second samples with similar feature information such as color information and luminance information are partitioned into one group of sample sets.

[0267] In some embodiments, the above S102-A2 includes the following steps: S102-A21: Classifying the first samples included in the first sample set into N types of first samples; S102-A22: Classifying the second samples included in the second sample set into N types of second samples; S102-A23: Obtaining N groups of sample sets based on the N types of first samples and the N types of second samples.

[0268] In this embodiment, the decoding side first classifies the first samples included in the first sample set into N types of first samples, and at the same time, classifies the second samples included in the second sample set into N types of second samples. Here, each type of first sample among the N types of first samples includes at least one first sample, and each type of second sample among the N types of second samples includes at least one second sample.

[0269] In the embodiments of the present application, the specific method for the decoding side to classify the first samples included in the first sample set into N types of first samples is not limited.

[0270] In some embodiments, the decoding side classifies the first samples based on the feature information of each first sample in the first sample set and obtains N types of first samples.

[0271] In some embodiments, the above S102-A21 is replaced by the following steps S102-A21-a1 and S102-A21-a2. S102-A21-a1, a step to determine the first sample mean of the first sample set, S102-A21-a2 includes the step of classifying the first sample set into N types of first samples based on the mean value of the first sample.

[0272] In this example, the decoding side classifies the first sample included in the first sample set based on the sample mean value.

[0273] Specifically, the decoding side first determines the sample mean of the first sample set based on the reconstructed value of each first sample in the first sample set, and for the sake of explanation, this sample mean is referred to as the first sample mean. Next, based on this first sample mean, the first samples included in the first sample set are classified into N types of first samples.

[0274] For example, the first sample in the first sample set that is equal to or greater than the first sample mean is classified as the first type of first sample, and the first sample in the first sample set that is equal to or less than the first sample mean is classified as the second type of first sample.

[0275] Furthermore, for example, a first sample in the first sample set whose difference from the first sample mean is between threshold c and threshold d is classified as a first sample of type 1. A first sample in the first sample set whose difference from the first sample mean is less than threshold c is classified as a first sample of type 2. A first sample in the first sample set whose difference from the first sample mean is greater than threshold d is classified as a first sample of type 3.

[0276] In some embodiments, step S102-A21 includes the following steps: S102-A21-b, classify the first sample set into N types of first samples based on the bit depth of the first sample in the first sample set.

[0277] In this embodiment, the decoding side classifies the first sample set into N types of first samples based on the bit depth of each first sample in the first sample set.

[0278] In one example, depending on the size of the bit depth, each first sample in the first sample set is classified into two, three, or four types of first samples, and the bit depth of each first sample within each type of first sample is approximate.

[0279] In another example, the decoding side determines the first bit depth mean of the first sample set and classifies the first sample set into N types of first samples based on the first bit depth mean.

[0280] For example, the first sample in the first sample set whose bit depth is greater than or equal to the first average bit depth is classified as the first type of first sample, and the first sample in the first sample set whose bit depth is less than or equal to the first average bit depth is classified as the second type of first sample.

[0281] Furthermore, for example, the first sample in the first sample set whose difference between the bit depth and the mean first bit depth is between threshold e and threshold f is classified as a first sample of type 1. The first sample in the first sample set whose difference between the bit depth and the mean first bit depth is less than threshold e is classified as a first sample of type 2. The first sample in the first sample set whose difference between the bit depth and the mean first bit depth is greater than threshold f is classified as a first sample of type 3.

[0282] Based on the steps described above, the decoding side classifies the first sample in the first sample set into N types of first samples, and then classifies the second sample in the second sample set into N types of second samples.

[0283] In the embodiments of the present invention, the specific method by which the decoding side classifies the second samples included in the second sample set into N types of second samples is not limited.

[0284] In some embodiments, the decoding side can classify the second samples included in the second sample set into N types of second samples using a method similar to the method used to classify the N types of first samples.

[0285] In some embodiments, the decoding side classifies the second samples included in the second sample set into N types of second samples by the following steps, i.e., steps S102-A22 above include the following steps: S102-A221, for the j-th type of first sample out of N types of first samples, the second sample corresponding to the j-th type of first sample in the second sample set is determined as the j-th type of second sample, where j is a positive integer less than or equal to N.

[0286] Based on the steps described above, the decoding side classifies the first sample in the first sample set into N types of first samples. For the j-th type of first sample among the N types of first samples, the decoding side determines the second sample in the second sample set that corresponds to the j-th type of first sample, where j is a positive integer less than or equal to N.

[0287] For example, the decoding side classifies the first sample in the first sample set that is equal to or greater than the mean of the first sample as a first sample of type 1, and correspondingly classifies the second sample in the second sample set that is located at the position corresponding to the first sample of type 1 as a second sample of type 1. The decoding side classifies the first sample in the first sample set that is less than the mean of the first sample as a first sample of type 2, and correspondingly classifies the second sample in the second sample set that is located at the position corresponding to the first sample of type 2 as a second sample of type 2.

[0288] As can be seen from the above, on the decoding side, the N types of first samples obtained by classifying the first sample set and the N types of second samples obtained by classifying the second sample set correspond one-to-one. For example, the first type of first sample corresponds to the first type of second sample, and the second type of first sample corresponds to the second type of second sample. Therefore, the decoding side determines the j-th type of first sample in the N types of first samples and the j-th type of second sample in the N types of second samples as the j-th set of sample sets, and thus the N types of first samples and the N types of second samples constitute N groups of sample sets.

[0289] Based on the above steps, the decoding side divides the first sample set and the second sample set into N groups of sample sets, and then executes the step of S102-A3.

[0290] In the embodiment of the present application, the decoding side determines a group of linear model parameters based on each set of sample sets among the N groups of sample sets, and further obtains N groups of linear model parameters.

[0291] In the embodiment of the present application, the specific processes for determining the linear model parameters of each group based on each set of sample sets among the N groups of sample sets are the same. For the convenience of explanation, here, an example of determining the linear model parameters of the i-th group based on the i-th group of sample sets will be described.

[0292] In the embodiment of the present application, in S102-A3, the specific method for determining the linear model parameters of the i-th group based on the first sample and the second sample included in the i-th group of sample sets is not limited.

[0293] In one example, we determine the linear relationship between the first and second samples in the i-th sample set, and then determine the linear model parameters for the i-th sample set. Since both the first and second samples in the i-th sample set are known, we can determine the scaling coefficient a and offset parameter b corresponding to the i-th sample set by solving a linear equation, and thereby obtain the linear model parameters for the i-th sample set.

[0294] In one example, the first sample in the i-th group sample set is added to obtain the first aggregate value, the second sample in the i-th group sample set is added to obtain the second aggregate value, the sum of squares of the first sample in the i-th group sample set is determined to obtain the third aggregate value, the first and second samples in the i-th group sample set are multiplied and then added to obtain the fourth aggregate value, and the linear model parameters for the i-th group are determined based on the first, second, third, and fourth aggregate values.

[0295] In this example, the first sample xi in the i-th group sample set is added to obtain the first aggregate value sumXi, the second sample yi in the i-th group sample set is added to obtain the second aggregate value sumYi, the sum of squares of the first sample xi in the i-th group sample set is obtained to obtain the third aggregate value sumXiXi, the first sample xi and the second sample yi in the i-th group sample set are multiplied and then added to obtain the fourth aggregate value sumXiYi, and the linear model parameters for the i-th group are determined based on the first, second, third, and fourth aggregate values.

[0296] In the embodiments of this application, the specific method by which the decoding side determines the linear model parameters of group i based on the first aggregate value, second aggregate value, third aggregate value, and fourth aggregate value is not limited.

[0297] In some examples, the i-th group of linear model parameters includes a scaling coefficient ai and an offset parameter bi.

[0298] For example, the decoding side determines the linear model parameters of the i-th group using the following equation (4): ai=(sumXiYi-sumXisumYi) / (sumXiXi-sumXisumXi) bi=sumYi-ai*sumXi ( 4 )

[0299] The above describes the process of determining the linear model parameters for group i based on the sample set of group i. The decoding side can then refer to the above method to determine the linear model parameters for group N based on the sample sets of group N.

[0300] The decoding side determines the linear model parameters for group N based on the steps described above, and then performs the following step S103.

[0301] S103, select the linear model parameters of the target group from the linear model parameters of the N group, linearly modify the reference block using the linear model parameters of the target group, and obtain the predicted block for the current block.

[0302] In the embodiments of the present invention, if the decoding side determines that the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, the decoding side determines the reference block of the current block and determines N groups of linear model parameters. Next, the decoding side selects one target from these N groups of linear model parameters. group Select linear model parameters and achieve this goal group Linear model parameters are used to linearly modify the reference block of the current block, improving the illumination compensation effect on the reference block, and further enhancing the prediction effect and decoding performance.

[0303] In the embodiments of this application, the specific method by which the decoding side selects the linear model parameters of the target group from the linear model parameters of the N group is not limited.

[0304] In some embodiments, the encoding and decoding sides determine the linear model parameters of the N groups in the same manner, and the encoding side can write the index of the linear model parameters of the selected target group to the bitstream. Thus, after determining the linear model parameters of the N groups based on the above steps, the decoding side decodes the bitstream to obtain the index of the linear model parameters of the target group, and then, based on this index, determines the linear model parameters of the target group from the linear model parameters of the N groups determined as shown in Table 4 above.

[0305] In some embodiments, the decoding side uses the following steps to select the linear model parameters of the target group from the linear model parameters of the N groups: S103-A1, determine the second sample mean of the reference block, S103-A2, based on the second sample mean, select the linear model parameters for the target group from the linear model parameters of the N groups.

[0306] The method in this embodiment corresponds to the methods S102-A21-a1 and S102-A21-a2 described above.

[0307] As can be seen from S102-A21-a1 and S102-A21-a2 above, when the decoding side determines the linear model parameters of the N groups, it classifies the first samples included in the first sample set into N types of first samples based on the first sample mean, and classifies the second samples included in the second sample set into N types of second samples based on the positional information of the N types of first samples, thereby obtaining the N groups of sample sets. Finally, the linear model parameters of the N groups are determined based on these N groups of sample sets. Based on this, the decoding side determines the target from these N groups of linear model parameters. groupWhen selecting linear model parameters, the sample mean of the reference block for the current block, i.e., the average of the reconstructed pixel values ​​contained in the reference block, is determined and recorded as the second sample mean. In this way, based on this second sample mean, the linear model parameters for the target group can be selected from the linear model parameters of the N group.

[0308] In the embodiments of this application, the specific method by which the decoding side selects the linear model parameters of the target group from the linear model parameters of the N group based on the mean value of the second sample is not limited.

[0309] In one possible embodiment, the decoding side compares the second sample mean with the sample values ​​in the N-group sample sets corresponding to the linear model parameters of the N-groups, selects the linear model parameters of the group corresponding to the group of samples that is closest to the second sample mean, and determines them as the linear model parameters of the target group. For example, the second sample mean is closest (i.e., the smallest distance) to the first and second samples in the k-th set of samples among the N-group sample sets, and thus the linear model parameters of the group corresponding to the k-th set of samples among the N-group linear model parameters are determined as the linear model parameters of the target group.

[0310] In one possible embodiment, the decoding side selects the linear model parameters for the target group from the linear model parameters of the N groups based on the second sample mean and the first sample mean.

[0311] As can be seen from S102-A21-a1 and S102-A21-a2 above, in some embodiments, when the decoding side partitions the first sample set and the second sample set into N sample sets, it classifies the first samples in the first sample set that are equal to or greater than the mean value of the first sample as the first type of first sample, and the first samples in the first sample set that are equal to or less than the mean value of the first sample as the second type of first sample. Furthermore, it determines the linear model parameters of the N groups based on the N sample sets. Based on this, the decoding side can select the linear model parameters of the target group from the linear model parameters of the N groups based on the sizes of the mean values ​​of the second and first samples.

[0312] For example, if the mean of the second sample is greater than or equal to the mean of the first sample, the linear model parameters of one group corresponding to the first sample of the first type among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0313] Furthermore, for example, if the mean of the second sample is less than or equal to the mean of the first sample, the linear model parameters of one group corresponding to the second type of first sample among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0314] In some embodiments, the decoding side uses the following steps to select the linear model parameters of the target group from the linear model parameters of the N groups: S103-B1, determine the second bit depth average value of the reference block, S103-B2 selects the target group's linear model parameters from the N group's linear model parameters based on the second bit depth mean value.

[0315] The method in this embodiment is as described above in S102-A21- b Correspond to the method.

[0316] The above S102-A21- bAs can be seen, when the decoding side determines the linear model parameters of the N groups, it classifies the first samples in the first sample set into N types of first samples based on the first bit depth mean, and classifies the second samples in the second sample set into N types of second samples based on the positional information of the N types of first samples, thereby obtaining the N groups of sample sets. Finally, it determines the linear model parameters of the N groups based on these N groups of sample sets. Based on this, the decoding side uses these N groups of linear model parameters to determine the target group When selecting linear model parameters, the average bit depth of the reference block of the current block, i.e., the average bit depth of the reconstructed pixel values ​​contained in the reference block, is determined and recorded as the second average bit depth. In this way, based on this second average bit depth, the linear model parameters of the target group can be selected from the N group of linear model parameters.

[0317] In the embodiments of this application, the specific method by which the decoding side selects the linear model parameters of the target group from the N group of linear model parameters based on the second bit depth average value is not limited.

[0318] In one possible embodiment, the decoding side compares the second bit depth mean with the bit depths of the samples in the N sample sets corresponding to the N linear model parameters, selects the group of linear model parameters corresponding to the group of samples closest to the second bit depth mean, and determines it as the linear model parameters for the target group. For example, the second bit depth mean is closest to the bit depths of the first and second samples in the k-th set of samples in the N sample sets, thereby determining the group of linear model parameters corresponding to the k-th set of samples in the N linear model parameters as the linear model parameters for the target group.

[0319] In one possible embodiment, the decoding side selects the linear model parameters of the target group from the N-group linear model parameters based on the second-bit depth mean and the first-bit depth mean.

[0320] The above S102-A21- b As can be seen, in some embodiments, when the decoding side partitions the first sample set and the second sample set into N sample sets, it classifies the first sample in the first sample set whose bit depth is equal to or greater than the first average bit depth as a first type of first sample, and the first sample in the first sample set whose bit depth is less than or equal to the first average bit depth as a second type of first sample. Furthermore, it determines the linear model parameters of the N groups based on the N sample sets. Based on this, the decoding side can select the linear model parameters of the target group from the linear model parameters of the N groups based on the sizes of the second average bit depth and the first average bit depth.

[0321] For example, if the second bit depth mean is greater than or equal to the first bit depth mean, then the linear model parameters of one group corresponding to the first sample of the first type among the N groups of linear model parameters are determined as the linear model parameters of the target group. Furthermore, for example, if the second bit depth mean is less than or equal to the first bit depth mean, the linear model parameters of one group corresponding to the second type of first sample among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0322] Based on the steps described above, the decoding side determines the linear model parameters of the target group from the linear model parameters of the N group, and then uses these linear model parameters of the target group to linearly transform the reference block of the current block.

[0323] For example, goal group If the linear model parameters include a scaling parameter a1 and an offset parameter b1, the decoding side linearly modifies the reference block based on these scaling and offset parameters to obtain the predicted block.

[0324] JPEG2024207434000007.jpg53167

[0325] In several embodiments, the present invention proposes a video decoding method applied to the intra-prediction portion on the decoding side. After integrating embodiments of the present invention into the latest ECM8.0, the test results under general test conditions AI are shown in Table 5: [Table 5]

[0326] [Table 6]

[0327] Note that negative numbers represent performance gains, meaning that for equivalent quality, the number of bits decreases.

[0328] Since this invention operates on screen content encoding scenarios, general screen content encoding test conditions were used during testing, meaning that this technology was not enabled in all classes from A1 to E. Therefore, there were no changes in encoding performance or variations in encoding time in these classes.

[0329] Here, Class F and class TGM are sequence classes dedicated to screen content encoding. Simulation results show that the decoding method proposed in the embodiment of this application shows a 0.17% improvement in encoding performance compared to class F, while simultaneously maintaining no change in codec time.

[0330] The video decoding method provided in the embodiment of the present invention proposes a multi-model intrablock copy illumination compensation mode, thereby increasing the modes of intrablock copy illumination compensation. Thus, the decoding side can select whether to perform predictive compensation using a single-model intrablock copy illumination compensation mode (i.e., having only one group of model parameters) or a multi-model intrablock copy illumination compensation mode (i.e., including multiple groups of model parameters) depending on the specific situation of the current block. When the multi-model intrablock copy illumination compensation mode is selected and predictive compensation is performed for the current block, N groups of linear model parameters are determined, and from these N groups of linear model parameters, a target is selected. group Select the linear model parameters, and furthermore, this Linear model parameters of the target group This method linearly modifies the reference block of the current block and obtains the predicted block of the current block to improve illumination compensation, thereby improving prediction accuracy and decoding performance.

[0331] The above explanation described the video decoding method of this application using the decoding side as an example; however, the following explanation will use the encoding side as an example.

[0332] Figure 15 is a flowchart showing a video encoding method provided in one embodiment of the present application, and the embodiment of the present application is applied to the video encoder shown in Figures 1 and 2. As shown in Figure 15, the method of the embodiment of the present application includes the following steps.

[0333] S201 determines the prediction mode for the current block.

[0334] In the embodiments of this application, for the sake of convenience of explanation, an intrablock copy illumination compensation mode having only one group of model parameters is referred to as a single-model intrablock copy illumination compensation mode, for example, as the IBC-LIC-S mode, where the IBC-LIC-S mode is the currently existing IBC-LIC mode. An intrablock copy illumination compensation mode including multiple groups of model parameters is referred to as a multi-model intrablock copy illumination compensation mode, for example, as the IBC-LIC-M mode.

[0335] In the embodiments of this application, a multi-model intra-block copy illumination compensation mode is proposed to improve the effectiveness of intra-block copy illumination compensation. This multi-model intra-block copy illumination compensation mode can be understood as an intra-block copy illumination compensation mode that includes multiple groups of linear model parameters. For example, using intra-copy technology, a reference block (or initial predicted block) of the current block is determined, then an optimal group of linear model parameters is selected from multiple groups of linear model parameters, a linear modification (i.e., illumination compensation) is performed on the reference block of the current block, and a predicted block of the current block is obtained to improve the effectiveness and prediction accuracy of illumination compensation, and further improve the image encoding effect.

[0336] In the embodiments of this application, for the sake of convenience of explanation, an intrablock copy illumination compensation mode having only one group of model parameters is referred to as a single-model intrablock copy illumination compensation mode, for example, as an IBC-LIC-S mode.

[0337] The embodiments of this application are not limited to a specific method for determining the prediction mode of the current block.

[0338] In some embodiments, the encoding side defaults to setting the prediction mode for the current block to multi-model intra-block copy illumination compensation mode.

[0339] In some embodiments, S201 above is, S201-A1 is a step of determining a list of candidate prediction modes corresponding to the current block, wherein the candidate prediction modes include a multi-model intra-block copy illumination compensation mode. S201-A2, a step of determining the cost of predicting the current block using each candidate prediction mode in the candidate prediction mode list, S201-A3 includes the step of determining the prediction mode of the current block based on cost.

[0340] In some embodiments, before determining a list of candidate prediction modes corresponding to the current block, the encoding method further includes determining a third flag to indicate whether local illumination compensation is permitted for the current sequence, and if the third flag is used to indicate that local illumination compensation is permitted for the current sequence, adding a multi-model intra-block copy illumination compensation mode to the list of candidate prediction modes corresponding to the current block.

[0341] In the embodiments of this application, the specific representation format of the third flag is not limited.

[0342] In one example, the third flag may be represented as sps_ibc_lic_enable_flag. Setting different values ​​for the third flag sps_ibc_lic_enable_flag indicates whether or not the use of local illumination compensation techniques is permitted for the current sequence.

[0343] For example, if the value of the third flag sps_ibc_lic_enable_flag is 0, it indicates that the use of local illumination compensation techniques is not permitted for the current sequence.

[0344] Additionally, for example, if the value of the third flag sps_ibc_lic_enable_flag is 1, it indicates that local illumination compensation technology is permitted for the current sequence.

[0345] In some embodiments, the encoder writes a third flag to the bitstream to indicate whether local illumination compensation is permitted for the current sequence.

[0346] In some embodiments, the encoding side has limitations on the size of blocks for which the intrablock copy illumination compensation mode is used, for example, not using the intrablock copy illumination compensation mode for some block sizes and using it for some block sizes. Based on this, the encoding side determines whether the size of the current block meets a first predetermined size before determining the candidate prediction mode list corresponding to the current block, and if the size of the current block meets the first predetermined size, adds the multi-model intrablock copy illumination compensation mode to the candidate prediction mode list corresponding to the current block.

[0347] In the embodiments of this application, the specific indicators for determining the current block size are not limited.

[0348] For example, the size of the current block may be determined using the width and height of the current block. For instance, if the width of the current block is greater than threshold 1 and the height is greater than threshold 2, then it is determined that the size of the current block satisfies a first predetermined size. Here, the values ​​of threshold 1 and threshold 2 may be 4, 8, 16, 32, 128, 256, etc., and threshold 1 may be equal to threshold 2.

[0349] For example, the size of the current block may be determined using the product of the width and height of the current block, i.e., the area of ​​the current block. For instance, if the area of ​​the current block is greater than or equal to threshold 3 and less than threshold 5, it is determined that the size of the current block satisfies the first predetermined size. Here, the value of threshold 3 may be 16, 32, etc., and the value of threshold 5 may be 256, 1024, etc.

[0350] For example, the size of the current block may be determined using the number of pixel points contained in the current block. For instance, if the number of pixel points contained in the current block is greater than or equal to a threshold of 4, it is determined that the size of the current block satisfies a first predetermined size. Here, the value of the threshold of 4 may be 16, 32, 128, 256, 1024, etc.

[0351] In some embodiments, the encoding side determines whether the current block uses a first tool for encoding before determining the candidate prediction mode list corresponding to the current block. If the first tool is an intra-block copy illumination compensation technique and a mutex, and it is determined that the current block does not use the first tool for encoding, the multi-model intra-block copy illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.

[0352] In one example, the encoding side traverses the prediction mode and, if the current prediction mode type is intrablock copy mode, obtains the permission flag bit for using this technique, i.e., the third flag. This flag bit is a sequence-level flag bit that indicates whether the use of intrablock copy local illumination compensation technique is permitted for the current sequence, and may be in the form of, for example, sps_ibc_lic_enable_flag.

[0353] Step 1, if the IBC-LIC permission flag bit (i.e., the third flag) is true and the size of the current block satisfies a first predetermined size, for example, if the area of ​​the current block is greater than threshold 1 and the area of ​​the current block is less than threshold 2, the encoding side attempts a method to predict the IBC-LIC, i.e., performs Step 2 as follows: IBC-LIC permission flag bit (i.e., the third flag) It is false. Alternatively, if the current block size does not meet the first predetermined size, the encoding side does not attempt the IBC-LIC prediction method, i.e., it skips step 2 below and directly performs step 3.

[0354] Step 2: Obtain reconstruction sample information for the upper and left template regions of the current block, and reconstruction sample information for the upper and left template regions of the reference block.

[0355] First, the encoding side traverses various prediction modes in IBC AMVP mode and calculates the corresponding rate distortion cost value.

[0356] Round 1: The encoding side attempts the IBC-LIC-S mode, and the number of samples obtained is the same as described above, depending on the width and height of the current block. The obtained reconstructed samples are modeled using the linear model calculation method described above, and the scaling coefficient a and offset parameter b are calculated. A linear transformation is performed on the prediction block, with transformation parameters of scaling a and compensation b, to obtain the final prediction block of the current block. The residual of the current block is obtained by subtracting this prediction block from the original sample corresponding to the current block, and the rate distortion cost value is calculated by operations such as transformation and quantization, and is denoted as cost1. Round 2: The encoding side attempts the IBC-LIC-M mode, and the number of samples obtained is the same as described above, depending on the width and height of the current block. The samples from two template regions are classified based on the mean value of the template region adjacent to the reference block, where samples with a sample value greater than the mean value of the template region adjacent to the reference block are classified as Type 1, and correspondingly, the samples from the template region adjacent to the prediction block at the corresponding position are also classified as Type 1. Conversely, samples with a sample value less than or equal to the mean value of the template region adjacent to the reference block are classified as Type 2, and similarly, the samples from the template region adjacent to the prediction block at the corresponding position are also classified as Type 2. For the Type 1 and Type 2 samples, the Type 1 linear model parameters are calculated using the model calculation method described above, and the scaling coefficient a1 and offset parameter b1 for the Type 1 model parameters and the scaling coefficient a2 and offset parameter b2 for the Type 2 model parameters are obtained. Based on the relationship between the sample values ​​in the reference block and the sample mean of the template region, either the first or second model is selected. Here, samples where the sample value in the reference block is greater than the sample mean of the template region are linearly transformed using the parameters of the first model, while samples where the sample value in the reference block is less than or equal to the sample mean of the template region are linearly transformed using the parameters of the second model. After obtaining the predicted block, the rate distortion cost value is calculated by comparing it with the original image block and denoted as cost2. The minimum cost value is compared with cost1 and cost2, and the minimum cost value is explicitly stated as costAmvpIbcLic. Information on the current lighting compensation mode, including the lighting compensation mode index, is saved, with the mode index corresponding to cost1 set to 0 and the mode index corresponding to cost2 set to 1.

[0357] Next, the encoding side constructs list information in IBC merge mode and traverses each candidate mode to calculate the corresponding rate distortion cost value.

[0358] The current block traverses the candidate BVs in the merge list. If IBC-LIC is enabled in the inherited information, the current block obtains a reference block based on that BV information. Simultaneously, it obtains adjacent template region samples of the current block and the reference block based on the inherited IBC-LIC mode and calculates the linear model parameters. The reference block is transformed based on the linear model parameters, and the final predicted block is obtained in the same steps as above. The residual of the current block is obtained by differentiating this predicted block with the original samples corresponding to the current block. The rate-distortion cost value is calculated by operations such as transformation and quantization, and is denoted as costIdx1. The other candidate BVs in the merge list are traversed, and the rate-distortion cost values, costIdx2, costIdx3, costIdx4, etc., are calculated in the same way.

[0359] The cost values ​​such as costIdx1 and costIdx2 are compared, and the smallest cost value is recorded as costMergeIbc.

[0360] Step 3, the encoding side continuously traverses other interpretation techniques, calculates and obtains the rate distortion cost value corresponding to each technique, and selects the prediction mode corresponding to the minimum cost value as the optimal prediction mode for the current block.

[0361] In some embodiments, if costAmvpIbcLic is minimal, the current block must use intrablock copy illumination compensation technology and write the coding unit-level use flag for illumination compensation technology to the bitstream as true, and furthermore, the intrablock copy illumination compensation mode index must also be written to the bitstream.

[0362] In some embodiments, if costMergeIbc is minimal, the current block uses the merge mode intrablock copy technique to write the merge flag of the IBC to the bitstream as true, and at the same time, write the merge index to the bitstream as well.

[0363] In some embodiments, if the current block allows the use of illumination compensation technology and costLic is not the minimum, the current block must not use illumination compensation technology and must write the illumination compensation technology coding unit-level use flag to the bitstream as false. Otherwise, other optimal prediction mode information, etc., is written to the bitstream, and since it is not strongly related to this technology, its explanation is omitted here.

[0364] In some embodiments, the encoding side determines the prediction type of the current block and writes first information to the code stream to indicate the prediction type of the current block.

[0365] In the embodiments of this application, the specific form of representation of the first information is not limited.

[0366] In one example, the first piece of information may be represented as modeType.

[0367] For example, if modeType=MODE_INTRA, it indicates that the prediction type for the current block is intra prediction.

[0368] Additionally, for example, if modeType=MODE_INTER, it indicates that the prediction type for the current block is interpretation.

[0369] Furthermore, for example, if modeType=MODE_IBC, it indicates that the prediction type for the current block is an intra-block copy prediction.

[0370] In some embodiments, if the first information indicates that the prediction type of the current block is an intra-block copy prediction, a first flag is written to the bitstream, and the first flag is used to indicate whether the current block uses merge mode.

[0371] In the embodiments of this application, the specific representation format of the first flag is not limited.

[0372] In one example, the first flag may be represented as merge_flag. Setting a different value for the first flag, merge_flag, indicates whether the current block will use merge mode for prediction.

[0373] For example, if the value of the first flag, merge_flag, is 0, it indicates that the current block will not use merge mode for prediction.

[0374] Additionally, for example, if the value of the first flag, merge_flag, is 1, it indicates that the current block will use merge mode for prediction.

[0375] In some embodiments, if the current block does not use the merge mode, second information is written to the bitstream, and the second information is used to indicate whether the current block uses the intrablock copy illumination compensation mode.

[0376] In some embodiments, the second piece of information may be represented as cu_ibc_lic_flag. Setting different values ​​for the second piece of information, cu_ibc_lic_flag, indicates whether the current block uses intra-block copy illumination compensation mode.

[0377] For example, if the value of the second piece of information, cu_ibc_lic_flag, is 0, it indicates that the current block will not use intra-block copy illumination compensation mode for prediction.

[0378] Furthermore, for example, if the value of the second piece of information, cu_ibc_lic_flag, is 1, it indicates that the current block will use the intra-block copy illumination compensation mode for prediction.

[0379] In some embodiments, when the current block uses the intrablock copy illumination compensation mode, index information is written to the bitstream, and the index information is used to indicate the mode index of the intrablock copy illumination compensation mode used by the current block.

[0380] In the embodiments of this application, the specific representation format of the index information is not limited.

[0381] In some embodiments, index information may be represented as cu_ibc_lic_index. By setting different values ​​for this index information cu_ibc_lic_index, the mode index of the intra-block copy illumination compensation mode used by the current block is indicated.

[0382] For example, if the prediction mode for the current block is the single-model intra-block copy illumination compensation mode, the value of the index information cu_ibc_lic_index is the first number.

[0383] Furthermore, for example, if the prediction mode for the current block is the multi-model intra-block copy illumination compensation mode, the value of the index flag cu_ibc_lic_index is the second numeric value.

[0384] In the embodiments of this application, the specific values ​​of the first and second numerical values ​​are not limited.

[0385] For example, the first value is 0.

[0386] Also, for example, the second value is 1.

[0387] For example, the above cu_ibc_lic_index may be encoded using a context-based method or an equal-probability method.

[0388] TheIf the information indicates that the current block should use the intrablock copy illumination compensation mode, and the size of the current block is greater than or equal to the second predetermined size, then the multi-model intrablock copy illumination compensation mode is determined as the predictive mode for the current block.

[0389] ratio For relatively large current blocks, the multi-model intra-block copy illumination compensation mode is used by default. That is, when the syntax element analysis on the encoding side is performed, if cu_ibc_lic_flag is true and the size of the current block is greater than a second predetermined size, it indicates that the current block will use the multi-model intra-block copy illumination compensation mode; otherwise, it indicates that the current block does not use illumination compensation techniques and there is no need to analyze the index.

[0390] In the embodiments of this application, the specific indicators for determining the current block size are not limited.

[0391] For example, the size of the current block may be determined using the width and height of the current block. For instance, if the width of the current block is greater than threshold 1 and the height is greater than threshold 2, then the size of the current block is determined to be greater than a second predetermined size. Here, the values ​​of threshold 1 and threshold 2 may be 4, 8, 16, 32, 128, 256, etc., and threshold 1 may be equal to threshold 2.

[0392] For example, the size of the current block may be determined using the product of the width and height of the current block, i.e., the area of ​​the current block. For instance, if the area of ​​the current block is greater than or equal to threshold 3, it is determined that the size of the current block is greater than a second predetermined size. Here, the value of threshold 3 may be 16, 32, 128, 256, etc.

[0393] For example, the size of the current block may be determined using the number of pixel points contained in the current block. For instance, if the number of pixel points contained in the current block is greater than or equal to a threshold of 4, the size of the current block is determined to be greater than a second predetermined size. Here, the value of the threshold of 4 may be 16, 32, 128, 256, 1024, etc.

[0394] In some embodiments, if the second information indicates that the current block uses the intrablock copy illumination compensation mode and the size of the current block is greater than or equal to a second predetermined size, the multi-model intrablock copy illumination compensation mode is determined as the predictive mode for the current block.

[0395] In the above embodiment, the second piece of information only indicates whether the current block uses the intrablock copy illumination compensation mode, and does not indicate the mode index of the intrablock copy illumination compensation mode; rather, the mode index of the intrablock copy illumination compensation mode is indicated by the index information.

[0396] In some embodiments, the second information may indicate not only whether the current block uses an intrablock copy illumination compensation mode, but also the mode index of the intrablock copy illumination compensation mode.

[0397] For example, in this embodiment, the second information can be represented using cu_ibc_lic_mode. Of course, the second information can also be represented using syntax elements, and is not limited to this in the embodiments of the present application.

[0398] For example, if the prediction mode of the current block is not the intrablock copy illumination compensation mode, the value of the second information cu_ibc_lic_mode is determined to be the first numerical value. Furthermore, for example, if the prediction mode of the current block is the single-model intra-block copy illumination compensation mode, the value of the second information cu_ibc_lic_mode is determined to be the second numerical value. Furthermore, for example, if the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, the value of the second information cu_ibc_lic_mode is determined to be the third numerical value.

[0399] In the embodiments of this application, the specific values ​​of the first, second, and third numerical values ​​are not limited.

[0400] In one example, the first number is 0, the second number is 1, and the third number is 2.

[0401] In some embodiments, if the current block uses merge mode, the encoding side can determine the prediction mode of the current block in at least the following manner:

[0402] Method 1: If the current block uses merge mode, the prediction mode of the referenced block is determined as the prediction mode of the current block.

[0403] Method 2: If the current block uses merge mode, the single-model intra-block copy illumination compensation mode is determined as the prediction mode for the current block.

[0404] Method 3: If the current block is using merge mode, the multi-model intra-block copy illumination compensation mode is determined as the prediction mode for the current block.

[0405] Method 4: When the current block uses merge mode, the prediction mode is not inherited. Instead, the rate distortion cost of each candidate prediction mode predicting the current block is calculated, and the candidate prediction mode with the minimum cost is determined as the prediction mode for the current block. In one example, fourth information is written to the bitstream, and this fourth information indicates the prediction mode for the current block.

[0406] The above describes the specific process by which the encoding side determines the prediction mode for the current block.

[0407] After determining the prediction mode of the current block based on the above steps, the encoding side performs step S202 as follows:

[0408] S202, if the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, determine the reference block of the current block and determine the linear model parameters of the N group.

[0409] N is a positive integer greater than 1.

[0410] Based on the steps above, the encoding side determines the prediction mode of the current block. If the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, the encoding side must determine the N-group linear model parameters and simultaneously determine the reference block of the current block. Next, one group of linear model parameters is selected from these N-group linear model parameters to target group By selecting it as a linear model parameter and linearly modifying the reference block of the current block, we can obtain a prediction block with superior illumination compensation effects, thereby improving prediction accuracy and coding performance.

[0411] The following describes the specific process for determining the referenced block of the current block.

[0412] In some embodiments, the reference block of the current block is also called the prediction block of the current block, or the initial prediction block of the current block, or the first prediction block of the current block, and so on. That is, in embodiments of the present application, the reference block of the current block can be understood as a prediction block that has not been illuminated.

[0413] In some embodiments, during intra-prediction, the encoding side determines the reference block of the current block in the current image (i.e., the current frame).

[0414] For example, in Figure 7, the solid line with the arrow represents the block vector information (BV) of the current block. On the encoding side, the current block finds the matched reconstructed block as the reference block of the current block through the BV.

[0415] Similar to interpretation, IBC has two modes: one is AMVP (advanced motion vector prediction) mode, and the other is skip / merge mode, or merge mode.

[0416] In one example, in AMVP mode, the encoding side constructs a list of MVP candidates, determines the best MVP from it, then determines the starting point for motion estimation based on this selected MVP, and then searches near this starting point to obtain the reference block for the current block.

[0417] In one example, in skip / merge mode, the encoding side constructs a list of MVP candidates, determines the best MVP from it, sets this selected MVP as the current MV, and then determines the reference block of the current block within the current image based on the MV.

[0418] In some embodiments, the encoding side may also use other existing methods to determine the reference block of the current block.

[0419] The following describes the specific process by which the encoding side determines the linear model parameters of the N group.

[0420] In the embodiments of the present invention, when the encoding side determines that the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, it is necessary to determine multiple groups of linear model parameters, and then select one group from these multiple groups of linear model parameters to linearly modify the reference block of the current block and obtain the predicted value of the current block.

[0421] In the embodiments of this application, the specific parameters included in each set of linear model parameters are not limited and may include, for example, parameters related to any linear modification.

[0422] In one example, each set of linear model parameters in the N-group linear model parameters includes a scaling parameter a and an offset parameter b. Note that the parameters included in each set of N-group linear model parameters are not exactly the same.

[0423] For illustrative purposes, Table 4 shows the linear model parameters for group N in the embodiment of the present application.

[0424] The encoding side can determine the N groups of linear model parameters shown in Table 4, select one group of linear model parameters from the N groups of linear model parameters shown in Table 4, linearly modify the reference block of the current block to achieve illumination compensation, obtain the reference block after illumination compensation, and further determine the reference block after illumination compensation as the predicted block of the current block.

[0425] In the embodiments of this application, the specific method by which the encoding side determines the linear model parameters of the N group is not limited.

[0426] In some embodiments, the linear model parameters of group N are predetermined values ​​or empirical values.

[0427] In some examples, the encoding side determines the linear model parameters of the N groups by the following S202-A step: S202-A determines the linear model parameters for group N based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0428] In this embodiment, the encoding side determines the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block, and further determines the N-group linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0429] For example, the reconfigured region surrounding a referenced block includes the reconfigured region adjacent to the referenced block and / or the reconfigured region not adjacent to the referenced block. Correspondingly, the reconfigured region surrounding the current block includes the reconfigured region adjacent to the current block and / or the reconfigured region not adjacent to the current block.

[0430] In the embodiments of the present invention, the encoding side can determine N different linear model parameters based on the feature information of the reconstructed region surrounding the reference block and the feature information of the reconstructed region surrounding the current block. These N different linear model parameters can realize illumination compensation with different effects, and furthermore, depending on the actual situation, the encoding side can select one group of linear model parameters for the target illumination compensation effect from these N groups of linear model parameters with different illumination compensation effects, and perform illumination compensation on the reference block of the current block, thereby improving the illumination compensation effect and prediction effect, and further improving the encoding performance.

[0431] In the embodiments of the present invention, the specific method by which the encoding side determines the N-group linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block is not limited.

[0432] In some embodiments, the encoding side first determines a set of linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block. Exemplarily, the process of determining a set of linear model parameters based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block can be carried out by referring to the method shown in equation (3) above. Next, this set of linear model parameters is adjusted to obtain N sets of linear model parameters.

[0433] In some embodiments, the encoding side partitions the reconstructed region surrounding a reference block into N sub-regions, for example, based on characteristic information such as color information, luminance information, and bit depth of the reconstructed region surrounding the reference block, and then partitions the reconstructed region surrounding the reference block into N first sub-regions. Correspondingly, according to the N first sub-regions of the reference block, the reconstructed region surrounding the current block is also partitioned into N second sub-regions, where one first sub-region corresponds to one second sub-region. This allows a group of linear model parameters to be determined based on each of the N first sub-regions and the corresponding second sub-region. For example, a group of linear model parameters 1 can be determined based on the first sub-region 1 and the second sub-region 1, a group of linear model parameters 2 can be determined based on the first sub-region 2 and the second sub-region 2, and so on, until N groups of linear model parameters are determined. For example, the process of determining a group of linear model parameters 1 based on the first sub-region 1 and the second sub-region 1 can be carried out by referring to the method shown in equation (3) above.

[0434] In some embodiments, step S202-A above is followed by steps S202-A1 to S202-A3 as follows: S202-A1, a step of determining a first sample set from the reconstructed surrounding region of a reference block, and determining a second sample set from the reconstructed surrounding region of the current block, S202-A2, a step of partitioning the first sample set and the second sample set into N sample sets, wherein any one of the N sample sets includes at least one first sample and at least one second sample, S202-A3, for the i-th group of sample sets out of N groups of sample sets, the step of determining the linear model parameters for the i-th group based on the first and second samples included in the i-th group sample set, wherein i is a positive integer less than or equal to N.

[0435] In the embodiments of this application, for the sake of explanation, a sample (i.e., a reconstructed pixel point) contained in the reconstructed region surrounding the reference block is referred to as the first sample, and a sample (i.e., a reconstructed pixel point) contained in the reconstructed region surrounding the current block is referred to as the second sample.

[0436] In this embodiment, the encoding side determines the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block, then determines a first sample set from the reconstructed surrounding region of the reference block and a second sample set from the reconstructed surrounding region of the current block, where the first sample set includes at least one first sample and the second sample set includes at least one second sample.

[0437] In the embodiments of the present invention, the specific method by which the encoding side determines a first sample set from the reconstructed region surrounding a reference block and a second sample set from the reconstructed region surrounding the current block is not limited.

[0438] For example, the encoding side collects at least one first sample from the reconstructed region surrounding the reference block according to a predetermined collection step size to constitute a first sample set, and collects at least one second sample from the reconstructed region surrounding the current block according to a predetermined collection step size to constitute a second sample set.

[0439] Furthermore, for example, the encoding side determines all first samples contained in the reconstructed surrounding region of the reference block as the first sample set, and all second samples contained in the reconstructed surrounding region of the current block as the second sample set.

[0440] In some embodiments, the reconfigured region surrounding a reference block includes the template region of the reference block, and the reconfigured region surrounding the current block includes the template region of the current block, in which case S202-A1 includes the following steps of S202-A11: S202-A11: Determine the first sample set from the template area of ​​the reference block, and determine the second sample set from the template area of ​​the current block.

[0441] In this embodiment, if the reconstructed region surrounding the reference block includes the template region of the reference block, and the reconstructed region surrounding the current block includes the template region of the current block, the encoding side can directly determine the first sample set from the template region of the reference block and determine the second sample set from the template region of the current block.

[0442] Specific embodiments in which the encoding side determines a first sample set from the template region of a reference block and a second sample set from the template region of the current block include, but are not limited to, the following:

[0443] Method 1: Set the number of first and second sample selections based on the current block width and height.

[0444] For example, if the width and height of the current block are equal to a predetermined value of 1 (e.g., 4), then a predetermined value of 1 (e.g., 4) of second samples are obtained from the upper template and left module of the current block, respectively, to form a second sample set, which contains 8 second samples. Then, a predetermined value of 1 (e.g., 4) of first samples are obtained from the upper template and left module of the reference block, respectively, to form a first sample set, which contains 8 first samples.

[0445] Furthermore, for example, if the width of the current block is a predetermined value of 2 (e.g., 16) and the height is a predetermined value of 3 (e.g., 4), then four second samples are obtained from the left template of the current block, and five (e.g., 4) second samples are obtained from the upper template of the current block with a predetermined step size of four (e.g., 3), forming a second sample set, which contains eight second samples. Four first samples are obtained from the left template of the reference block, and five (e.g., 4) first samples are obtained from the upper template of the reference block with a predetermined step size of four (e.g., 3), forming a first sample set, which contains eight first samples.

[0446] Furthermore, for example, if there are no cases where the width and height of the current block are both equal to a predetermined value of 1 (e.g., 4), a second sample set is constructed by obtaining a logarithm of the smaller side length with a base of 2 from the reconstructed samples contained in the upper and left templates of the current block. A first sample set is constructed by obtaining a logarithm of the smaller side length with a base of 2 from the reconstructed samples contained in the upper and left templates of the reference block.

[0447] For example, the upper template above includes one sample row, and the left template includes one sample column.

[0448] Method 2: The encoding side performs sampling in the template area of ​​the reference block according to the first sampling step size to obtain the first sample set, and then performs sampling in the template area of ​​the current block according to the first sampling step size to obtain the second sample set, where the first sampling step size is smaller than a predetermined sampling step size.

[0449] In this method 2, the encoding side can increase the number of samples involved in the calculation of linear model parameters by reducing the sampling step size, thereby improving the accuracy of the calculation of linear model parameters.

[0450] For example, the encoding side performs sampling in the template area of ​​the reference block according to the first sampling step size to obtain the first sample set, and then performs sampling in the template area of ​​the current block according to the first sampling step size to obtain the second sample set, where this first sampling step size is smaller than a predetermined sampling step size.

[0451] For example, the first sampling step size is less than 3.

[0452] Method 3: The encoding side determines all samples contained in the template area of ​​the reference block as the first sample set, and all samples contained in the template area of ​​the current block as the second sample set.

[0453] In method 3, all samples contained in the template region of the reference block are determined as the first sample set, and all samples contained in the template region of the current block are determined as the second sample set. This increases the number of samples involved in the calculation of linear model parameters and improves the accuracy of the calculation of linear model parameters.

[0454] In the embodiments of this application, the specific sizes of the template regions of the reference block and the current block are not limited.

[0455] In some embodiments, as shown in Figure 12, the template region of the referenced block includes the upper template region of the referenced block and / or the left template region of the referenced block, and the template region of the current block includes the upper template region of the current block and / or the left template region of the current block.

[0456] In some embodiments, the template region can be expanded to increase the number of samples involved in the calculation of linear model parameters.

[0457] In one example, the upper template is extended so that, for example, as shown in Figure 13, the left template area of ​​the reference block includes the left template area and the lower left template area of ​​the reference block, and the left template area of ​​the current block includes the left template area and the lower left template area of ​​the current block.

[0458] In one example, the left-hand template is extended so that, for example, as shown in Figure 14, the number of sample rows in the upper template area of ​​the reference block is greater than or equal to a predetermined number of rows, and the number of sample rows in the upper template area of ​​the current block is greater than or equal to a predetermined number of rows.

[0459] Thus, in the embodiments of the present invention, when selecting samples, a first sample set can be determined from the upper and / or left-side templates of the reference block shown in Figures 13 and 14, and a second sample set can be determined from the upper and / or left-side templates of the current block shown in Figures 13 and 14, thereby increasing the number of samples in the first and second sample sets.

[0460] In some embodiments, the encoding side may increase the number of rows in the upper template to enable template extension. For example, the number of sample rows in the upper template area of ​​a reference block is greater than or equal to a predetermined number, and the number of sample rows in the upper template area of ​​the current block is greater than or equal to a predetermined number. Exemplaryly, this predetermined number of rows may be 2, 3, 4, 5, etc.

[0461] In some embodiments, the encoding side may increase the number of columns in the left template to achieve template extension. For example, the number of sample columns in the left template area of ​​a reference block is greater than or equal to a predetermined number of columns, and the number of sample columns in the left template area of ​​the current block is greater than or equal to a predetermined number of columns. Exemplaryly, this predetermined number of columns may be 2, 3, 4, 5, etc.

[0462] The encoding side, using the steps described above, determines a first sample set from the reconstructed region surrounding the reference block, determines a second sample set from the reconstructed region surrounding the current block, and then executes the steps in S202-A2 above.

[0463] In the embodiments of this application, the specific method by which the encoding side partitions the first sample set and the second sample set into N groups of sample sets is not limited.

[0464] In some embodiments, the encoding side partitions the first and second sample sets into N groups of sample sets based on the color information, luminance information, and feature information such as bit depth of each first and second sample in the first and second sample sets, and each of these N groups of sample sets contains at least one first sample and at least one second sample. For example, first and second samples from the first and second sample sets that have similar feature information such as color information and luminance information are partitioned into one group of sample sets.

[0465] In some embodiments, the above S202-A2 is, S202-A21, a step of classifying the first sample included in the first sample set into N types of first samples, S202-A22, a step of classifying the second sample included in the second sample set into N types of second samples, S202-A23 includes the step of obtaining N sample sets based on N types of first samples and N types of second samples.

[0466] In this embodiment, the encoding side first classifies the first samples contained in the first sample set into N types of first samples, and simultaneously classifies the second samples contained in the second sample set into N types of second samples. Here, each type of first sample among the N types of first samples contains at least one first sample, and each type of second sample among the N types of second samples contains at least one second sample.

[0467] In the embodiments of the present invention, the specific method by which the encoding side classifies the first samples included in the first sample set into N types of first samples is not limited.

[0468] In some embodiments, the encoding side classifies the first samples based on the feature information of each first sample in the first sample set, and obtains N types of first samples.

[0469] In some embodiments, the above S202-A21 is performed using the following steps: S202-A21-a1 and S202-A21-a2. S202-A21-a1, a step to determine the first sample mean of the first sample set, S202-A21-a2 includes the step of classifying a first sample set into N types of first samples based on the mean value of the first sample.

[0470] In this example, the encoding side classifies the first sample included in the first sample set based on the sample mean value.

[0471] Specifically, the encoding side first determines the sample mean of the first sample set based on the reconstructed value of each first sample in the first sample set, and for the sake of explanation, this sample mean is referred to as the first sample mean. Next, based on this first sample mean, the first samples included in the first sample set are classified into N types of first samples.

[0472] For example, the first sample in the first sample set that is equal to or greater than the first sample mean is classified as the first type of first sample, and the first sample in the first sample set that is equal to or less than the first sample mean is classified as the second type of first sample.

[0473] Furthermore, for example, a first sample in the first sample set whose difference from the first sample mean is between threshold c and threshold d is classified as a first sample of type 1. A first sample in the first sample set whose difference from the first sample mean is less than threshold c is classified as a first sample of type 2. A first sample in the first sample set whose difference from the first sample mean is greater than threshold d is classified as a first sample of type 3.

[0474] In some embodiments, step S202-A21 includes the following steps: S202-A21-b, classify the first sample set into N types of first samples based on the bit depth of the first sample in the first sample set.

[0475] In this embodiment, the encoding side classifies the first sample set into N types of first samples based on the bit depth of each first sample in the first sample set.

[0476] In one example, depending on the size of the bit depth, each first sample in the first sample set is classified into two, three, or four types of first samples, and the bit depth of each first sample within each type of first sample is approximate.

[0477] In another example, the encoding side determines the first bit depth mean of the first sample set and classifies the first sample set into N types of first samples based on the first bit depth mean.

[0478] For example, the first sample in the first sample set whose bit depth is greater than or equal to the first average bit depth is classified as the first type of first sample, and the first sample in the first sample set whose bit depth is less than or equal to the first average bit depth is classified as the second type of first sample.

[0479] Furthermore, for example, the first sample in the first sample set whose difference between the bit depth and the mean first bit depth is between threshold e and threshold f is classified as a first sample of type 1. The first sample in the first sample set whose difference between the bit depth and the mean first bit depth is less than threshold e is classified as a first sample of type 2. The first sample in the first sample set whose difference between the bit depth and the mean first bit depth is greater than threshold f is classified as a first sample of type 3.

[0480] Based on the steps described above, the encoding side classifies the first sample in the first sample set into N types of first samples, and then classifies the second sample in the second sample set into N types of second samples.

[0481] In the embodiments of the present invention, the specific method by which the encoding side classifies the second samples included in the second sample set into N types of second samples is not limited.

[0482] In some embodiments, the encoding side can classify the second samples included in the second sample set into N types of second samples using a method similar to the method used to classify the first N types of first samples.

[0483] In some embodiments, the encoding side classifies the second samples included in the second sample set into N types of second samples by the following steps, i.e., S202-A22 above includes the following steps: S202-A221, for the j-th type of first sample out of N types of first samples, the second sample corresponding to the j-th type of first sample in the second sample set is determined as the j-th type of second sample, where j is a positive integer less than or equal to N.

[0484] Based on the steps described above, the encoding side classifies the first sample in the first sample set into N types of first samples. For the j-th type of first sample among the N types of first samples, the encoding side determines the second sample in the second sample set corresponding to that j-th type of first sample as the j-th type of second sample, where j is a positive integer less than or equal to N.

[0485] For example, the encoding side classifies the first sample in the first sample set that is equal to or greater than the mean of the first sample as a first sample of type 1, and correspondingly classifies the second sample in the second sample set that is located at the position corresponding to the first sample of type 1 as a second sample of type 1. The encoding side classifies the first sample in the first sample set that is less than the mean of the first sample as a first sample of type 2, and correspondingly classifies the second sample in the second sample set that is located at the position corresponding to the first sample of type 2 as a second sample of type 2.

[0486] As can be seen from the above, the encoding side classifies the first set of samples to obtain N types of first samples, and classifies the second set of samples to obtain N types of second samples, and these correspond one-to-one. For example, a first sample of type 1 corresponds to a second sample of type 1, and a first sample of type 2 corresponds to a second sample of type 2. Therefore, the encoding side determines the j-th first sample in the N types of first samples and the j-th second sample in the N types of second samples as the j-th set of samples, and in this way, the N types of first samples and the N types of second samples constitute the N-group sample set.

[0487] Based on the steps described above, the encoding side partitions the first sample set and the second sample set into N sample sets, and then executes the steps in S202-A3 described above.

[0488] In the embodiment of the present invention, the encoding side determines one set of linear model parameters based on each set of samples from the N sets of samples, and further obtains the N sets of linear model parameters.

[0489] In the embodiments of this application, the specific process for determining the linear model parameters for each set of samples from the N sample sets is consistent. For the sake of explanation, here we will describe an example in which the linear model parameters for the i-th group are determined based on the i-th group's sample set.

[0490] In the embodiments of the present application, the specific method for determining the linear model parameters of group i based on the first and second samples included in the sample set of group i in S202-A3 is not limited.

[0491] In one example, we determine the linear relationship between the first and second samples in the i-th sample set, and then determine the linear model parameters for the i-th sample set. Since both the first and second samples in the i-th sample set are known, we can determine the scaling coefficient a and offset parameter b corresponding to the i-th sample set by solving a linear equation, and thereby obtain the linear model parameters for the i-th sample set.

[0492] In one example, the first sample in the i-th group sample set is added to obtain the first aggregate value, the second sample in the i-th group sample set is added to obtain the second aggregate value, the sum of squares of the first sample in the i-th group sample set is determined to obtain the third aggregate value, the first and second samples in the i-th group sample set are multiplied and then added to obtain the fourth aggregate value, and the linear model parameters for the i-th group are determined based on the first, second, third, and fourth aggregate values.

[0493] In this example, the first sample xi in the i-th group sample set is added to obtain the first aggregate value sumXi, the second sample yi in the i-th group sample set is added to obtain the second aggregate value sumYi, the sum of squares of the first sample xi in the i-th group sample set is obtained to obtain the third aggregate value sumXiXi, the first sample xi and the second sample yi in the i-th group sample set are multiplied and then added to obtain the fourth aggregate value sumXiYi, and the linear model parameters for the i-th group are determined based on the first, second, third, and fourth aggregate values.

[0494] In the embodiments of this application, the specific method by which the encoding side determines the linear model parameters of group i based on the first aggregate value, second aggregate value, third aggregate value, and fourth aggregate value is not limited.

[0495] In some examples, the i-th group of linear model parameters includes a scaling coefficient ai and an offset parameter bi.

[0496] For example, the encoding side is ,formula (4) The linear model parameters of group i are determined.

[0497] The above describes the process of determining the linear model parameters for group i based on the sample set of group i. The encoding side can then refer to the above method to determine the linear model parameters for group N based on the sample set of group N.

[0498] In some embodiments, the encoding side can write the determined N-group linear model parameters to a bitstream, and the decoding side can obtain the N-group linear model parameters by decoding the bitstream.

[0499] The encoding side determines the linear model parameters of group N based on the steps above, and then performs the following step S203.

[0500] S203 selects the linear model parameters of the target group from the linear model parameters of the N group, linearly modifies the reference block using the linear model parameters of the target group, and obtains the predicted block for the current block.

[0501] In the embodiments of the present invention, if the coding side determines that the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, the coding side determines the reference block of the current block and determines N groups of linear model parameters. Next, the coding side selects one target from these N groups of linear model parameters. group Select linear model parameters and achieve this goal group Linear model parameters are used to linearly modify the reference block of the current block, improving the illumination compensation effect on the reference block and further enhancing the prediction effect and coding performance.

[0502] In the embodiments of this application, the specific method by which the encoding side selects the linear model parameters of the target group from the linear model parameters of the N group is not limited.

[0503] In some embodiments, the coding side uses the following steps to select the linear model parameters of the target group from the linear model parameters of the N group: S203-A1, determine the second sample mean of the reference block, S203-A2, based on the second sample mean, select the linear model parameters for the target group from the linear model parameters of group N.

[0504] The method in this embodiment corresponds to the methods S202-A21-a1 and S202-A21-a2 described above.

[0505] As can be seen from S202-A21-a1 and S202-A21-a2 above, when the encoding side determines the linear model parameters of N groups, it classifies the first samples in the first sample set into N types of first samples based on the first sample mean, and classifies the second samples in the second sample set into N types of second samples based on the positional information of the N types of first samples, thereby obtaining a sample set of N groups. Finally, the linear model parameters of N groups are determined based on these sample sets of N groups. Based on this, the encoding side determines the target from these linear model parameters of N groups. group When selecting linear model parameters, the sample mean of the reference block for the current block, i.e., the average of the reconstructed pixel values ​​contained in the reference block, is determined and recorded as the second sample mean. In this way, based on this second sample mean, the linear model parameters for the target group can be selected from the linear model parameters of the N group.

[0506] In the embodiments of this application, the specific method by which the encoding side selects the linear model parameters of the target group from the linear model parameters of the N group based on the mean value of the second sample is not limited.

[0507] In one possible embodiment, the encoding side compares the second sample mean with the sample values ​​in the N-group sample sets corresponding to the linear model parameters of the N-groups, selects the group of linear model parameters corresponding to the group of samples closest to the second sample mean, and determines them as the linear model parameters of the target group. For example, the second sample mean is closest (i.e., the shortest distance) to the first and second samples in the k-th set of samples among the N-group sample sets, thereby determining the group of linear model parameters corresponding to the k-th set of samples among the N-group linear model parameters as the linear model parameters of the target group.

[0508] In one possible embodiment, the encoding side selects the linear model parameters for the target group from the linear model parameters of the N group based on the second sample mean and the first sample mean.

[0509] As can be seen from S202-A21-a1 and S202-A21-a2 above, in some embodiments, when the encoding side partitions the first sample set and the second sample set into N sample sets, it classifies the first sample in the first sample set that is equal to or greater than the mean of the first sample as a first type first sample, and the first sample in the first sample set that is equal to or less than the mean of the first sample as a second type first sample. Furthermore, it determines the linear model parameters of the N groups based on the N sample sets. Based on this, the encoding side can select the linear model parameters of the target group from the linear model parameters of the N groups based on the sizes of the mean of the second sample and the mean of the first sample.

[0510] For example, if the mean of the second sample is greater than or equal to the mean of the first sample, the linear model parameters of one group corresponding to the first sample of the first type among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0511] Furthermore, for example, if the mean of the second sample is less than or equal to the mean of the first sample, the linear model parameters of one group corresponding to the second type of first sample among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0512] In some embodiments, the coding side uses the following steps to select the linear model parameters of the target group from the linear model parameters of the N group: S203-B1, determine the second bit depth average value of the reference block, S203-B2 selects the target group's linear model parameters from the N group's linear model parameters based on the second bit depth mean value.

[0513] The method in this embodiment is as described above in S202-A21- b Correspond to the method.

[0514] The above S202-A21- b As can be seen, when the encoding side determines the linear model parameters of N groups, it classifies the first samples in the first sample set into N types of first samples based on the first bit depth mean, and classifies the second samples in the second sample set into N types of second samples based on the positional information of the N types of first samples, thereby obtaining the N groups of sample sets. Finally, it determines the linear model parameters of N groups based on these N groups of sample sets. Based on this, the encoding side determines the target from these N groups of linear model parameters. group When selecting linear model parameters, the bit-depth mean of the reference block of the current block, i.e., the bit-depth mean of the reconstructed pixel values ​​contained in the reference block, is determined and recorded as the second bit-depth mean. In this way, based on this second bit-depth mean, the linear model parameters of the target group can be selected from the N group of linear model parameters.

[0515] In the embodiments of the present invention, the specific method by which the encoding side selects the linear model parameters of the target group from the N group of linear model parameters based on the second bit depth average value is not limited.

[0516] In one possible embodiment, the encoding side compares the second bit depth mean with the bit depths of the samples in the N sample sets corresponding to the N linear model parameters, selects the group of linear model parameters corresponding to the group of samples closest to the second bit depth mean, and determines them as the linear model parameters of the target group. For example, the second bit depth mean is closest to the bit depths of the first and second samples in the k-th set of samples from the N sample sets, thereby determining the group of linear model parameters corresponding to the k-th set of samples from the N linear model parameters as the linear model parameters of the target group.

[0517] In one possible embodiment, the encoding side selects the linear model parameters of the target group from the N group of linear model parameters based on the second bit depth mean and the first bit depth mean.

[0518] The above S202-A21- b As can be seen, in some embodiments, when the encoding side partitions the first sample set and the second sample set into N sample sets, it classifies the first sample in the first sample set whose bit depth is equal to or greater than the first average bit depth as a first type of first sample, and the first sample in the first sample set whose bit depth is less than or equal to the first average bit depth as a second type of first sample. Furthermore, it determines the linear model parameters of the N groups based on the N sample sets. Based on this, the encoding side can select the linear model parameters of the target group from the linear model parameters of the N groups based on the sizes of the second average bit depth and the first average bit depth.

[0519] For example, if the second bit depth mean is greater than or equal to the first bit depth mean, then the linear model parameters of one group corresponding to the first sample of the first type among the N groups of linear model parameters are determined as the linear model parameters of the target group. Furthermore, for example, if the second bit depth mean is less than or equal to the first bit depth mean, the linear model parameters of one group corresponding to the second type of first sample among the N groups of linear model parameters are determined as the linear model parameters of the target group.

[0520] Based on the steps above, the encoding side determines the linear model parameters of the target group from the linear model parameters of the N group, and then uses these linear model parameters of the target group to linearly transform the reference block of the current block.

[0521] for example, Linear model parameters of the target groupIf the reference block contains a scaling parameter a1 and an offset parameter b1, the encoding side linearly modifies the reference block based on these scaling and offset parameters to obtain the predicted block.

[0522] For example, the encoding side linearly modifies the reference block of the current block based on equation (5) above.

[0523] The video coding method provided in the embodiment of the present invention proposes a multi-model intrablock copy illumination compensation mode, thereby increasing the modes of intrablock copy illumination compensation. Thus, the coding side can select whether to perform predictive compensation using a single-model intrablock copy illumination compensation mode (i.e., having only one group of model parameters) or a multi-model intrablock copy illumination compensation mode (i.e., including multiple groups of model parameters) depending on the specific situation of the current block. When the multi-model intrablock copy illumination compensation mode is selected and predictive compensation is performed for the current block, N groups of linear model parameters are determined, and from these N groups of linear model parameters, a target is selected. group Select the linear model parameters, and furthermore, this Linear model parameters of the target group This method linearly modifies the reference block of the current block and obtains the predicted block of the current block to improve illumination compensation, thereby improving prediction accuracy and coding performance.

[0524] Figures 11 to 15 are merely illustrative examples of the present application and should not be interpreted as limiting the present application.

[0525] Although preferred embodiments of the present application have been described in detail above with reference to the drawings, the present application is not limited to the specific details of the above embodiments. Within the scope of the technical idea of ​​the present application, various simple modifications can be made to the technical solution of the present application, and all of these simple modifications fall within the scope of protection of the present application. For example, each specific technical feature described in the above-described embodiments may be combined in any appropriate manner as long as they do not contradict each other, and in order to avoid unnecessary duplication, the present application does not separately describe various possible combination methods. Furthermore, for example, any combination can be made between various different embodiments of the present application, and as long as it does not contradict the spirit of the present application, it should be considered as being disclosed in the present application as well.

[0526] Furthermore, in the various embodiments of the present invention, the magnitude of the number of each process does not indicate the order of execution, and the execution order of each process should be determined by its function and internal logic, and it should be understood that the implementation processes of the embodiments of the present invention should not be limited in any way. In the embodiments of the present invention, the term "and / or" is merely used to describe the relationship between related objects, and indicates that three types of relationships may exist. Specifically, A and / or B can represent three cases: when A exists alone, when A and B exist simultaneously, and when B exists alone. In the present invention, the character " / " generally indicates that the preceding and succeeding related objects are in an "or" relationship.

[0527] The above describes in detail embodiments of the method of the present application with reference to Figures 11 to 15, and the following describes in detail embodiments of the apparatus of the present application with reference to Figures 16 to 17.

[0528] Figure 16 shows a video of one embodiment of the present invention. decrypt This is a schematic block diagram of the chemical device, and the video decrypt The chemical device is as described above. De Applies to the code.

[0529] As shown in Figure 16, video decrypt The chemical device 10 is A mode determination unit 11 for determining the prediction mode of the current block, When the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, a parameter determination unit 12 for determining the reference block of the current block and determining N group linear model parameters, wherein N is a positive integer greater than 1, The system includes a modification unit 13 for selecting linear model parameters of a target group from the linear model parameters of the N groups, linearly transforming the reference block using the linear model parameters of the target group, and obtaining a predicted block for the current block.

[0530] In some embodiments, the parameter determination unit 12 is specifically used to determine the linear model parameters of the N groups based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0531] In some embodiments, the parameter determination unit 12 specifically determines a first sample set from the reconstructed surrounding region of the reference block, determines a second sample set from the reconstructed surrounding region of the current block, partitions the first and second sample sets into N groups of sample sets, each of the N groups of sample sets comprising at least one first sample and at least one second sample, and is used to determine the i-th linear model parameter for the i-th group of sample sets based on the first and second samples included in the i-th group of sample sets, where i is a positive integer less than or equal to N.

[0532] In some embodiments, the reconfigured region surrounding the reference block includes the template region of the reference block, and the reconfigured region surrounding the current block includes the template region of the current block, and the parameter determination unit 12 is specifically used to determine the first sample set from the template region of the reference block and the second sample set from the template region of the current block.

[0533] In some embodiments, the parameter determination unit 12 is specifically used to perform sampling in the template region of the reference block according to a first sampling step size to obtain the first sample set, and when the first sampling step size is smaller than a predetermined sampling step size, it is used to perform sampling in the template region of the current block according to the first sampling step size to obtain the second sample set.

[0534] In some embodiments, the parameter determination unit 12 is specifically used to determine all samples contained in the template region of the reference block as the first sample set, and all samples contained in the template region of the current block as the second sample set.

[0535] In some embodiments, the template region of the reference block includes the upper template region of the reference block and / or the left template region of the reference block, and the template region of the current block includes the upper template region of the current block and / or the left template region of the current block.

[0536] In some embodiments, the upper template region of the reference block includes the upper template region and the upper right template region of the reference block, and the upper template region of the current block includes the upper template region and the upper right template region of the current block.

[0537] In some embodiments, the left template region of the reference block includes the left template region and the lower left template region of the reference block, and the left template region of the current block includes the left template region and the lower left template region of the current block.

[0538] In some embodiments, the number of sample rows included in the upper template area of ​​the reference block is greater than or equal to a predetermined number of rows, and the number of sample rows included in the upper template area of ​​the current block is greater than or equal to the predetermined number of rows.

[0539] In some embodiments, the number of sample columns included in the left template area of ​​the reference block is greater than or equal to a predetermined number of columns, and the number of sample columns included in the left template area of ​​the current block is greater than or equal to the predetermined number of columns.

[0540] In some embodiments, the parameter determination unit 12 is specifically used to classify the first samples included in the first sample set into N types of first samples, classify the second samples included in the second sample set into N types of second samples, and obtain the N-group sample set based on the N types of first samples and the N types of second samples.

[0541] In some embodiments, the parameter determination unit 12 is specifically used to determine the first sample mean of the first sample set and to classify the first sample set into the N types of first samples based on the first sample mean.

[0542] In some embodiments, the parameter determination unit 12 is specifically used to classify first samples from the first sample set that are equal to or greater than the first sample mean into a first type of first sample, and to classify first samples from the first sample set that are equal to or less than the first sample mean into a second type of first sample.

[0543] In some embodiments, the parameter determination unit 12 is specifically used to classify the first sample set into N types of first samples based on the bit depth of the first sample in the first sample set.

[0544] In some embodiments, the parameter determination unit 12 is specifically used to determine the first bit depth mean of the first sample set and to classify the first sample set into the N types of first samples based on the first bit depth mean.

[0545] In some embodiments, the parameter determination unit 12 is specifically used to classify first samples from the first sample set whose bit depth is equal to or greater than the first average bit depth as a first type of first sample, and to classify first samples from the first sample set whose bit depth is less than or equal to the first average bit depth as a second type of first sample.

[0546] In some embodiments, the parameter determination unit 12 is specifically used to determine, for the j-th type of first sample among the N types of first samples, the second sample corresponding to the j-th type of first sample in the second sample set is the j-th type of second sample, where j is a positive integer less than or equal to N.

[0547] In some embodiments, the parameter determination unit 12 is specifically used to determine the first sample of type j and the second sample of type j as the sample set of j.

[0548] In some embodiments, the parameter determination unit 12 is used to determine the linear model parameters of the i group based on the first, second, third, and fourth aggregate values. Specifically, it is used to add the first sample in the i group sample set to obtain a first aggregate value, add the second sample in the i group sample set to obtain a second aggregate value, determine the sum of squares of the first sample in the i group sample set to obtain a third aggregate value, multiply the first and second samples in the i group sample set and then add them to obtain a fourth aggregate value.

[0549] In some embodiments, the modification unit 13 is specifically used to determine the second sample mean of the reference block and, based on the second sample mean, to select the linear model parameters of the target group from the linear model parameters of the N group.

[0550] In some embodiments, the modification unit 13 is specifically used to select the linear model parameters of the target group from the linear model parameters of the N group based on the second sample mean and the first sample mean.

[0551] In some embodiments, the modification unit 13 is used to determine, specifically, when the second sample mean is greater than or equal to the first sample mean, one group of linear model parameters from the N groups of linear model parameters corresponding to the first sample of the first type as the linear model parameters of the target group, and when the second sample mean is less than or equal to the first sample mean, one group of linear model parameters from the N groups of linear model parameters corresponding to the first sample of the second type as the linear model parameters of the target group.

[0552] In some embodiments, the modification unit 13 is specifically used to determine the second bit depth mean of the reference block and, based on the second bit depth mean, to select the linear model parameters of the target group from the linear model parameters of the N group.

[0553] In some embodiments, the modification unit 13 is specifically used to select the linear model parameters of the target group from the linear model parameters of the N group based on the second bit depth mean and the first bit depth mean.

[0554] In some embodiments, the modification unit 13 is specifically used to determine, when the second bit depth mean is greater than or equal to the first bit depth mean, one group of linear model parameters from the N group of linear model parameters corresponding to the first sample of the first type, as the linear model parameters of the target group, and when the second bit depth mean is less than or equal to the first bit depth mean, one group of linear model parameters from the N group of linear model parameters corresponding to the first sample of the second type, as the linear model parameters of the target group.

[0555] In some embodiments, the mode determination unit 11 specifically decodes the bitstream, obtains first information which is used to indicate the prediction type of the current block, and determines the prediction mode of the current block based on the first information.

[0556] In some embodiments, the mode determination unit 11 specifically decodes the bitstream and obtains a first flag, which is used to indicate whether the current block uses merge mode, and is used to determine the prediction mode of the current block based on the first flag.

[0557] In some embodiments, the mode determination unit 11 specifically decodes the bitstream and obtains second information, which is used to indicate whether the current block uses intrablock copy illumination compensation mode, and is used to determine the prediction mode of the current block based on the second information.

[0558] In some embodiments, the mode determination unit 11 specifically decodes the bitstream and obtains index information when the second information indicates that the current block uses the intrablock copy illumination compensation mode, the index information is used to indicate the mode index of the intrablock copy illumination compensation mode used by the current block, and is used to determine the predicted mode of the current block based on the index information.

[0559] In some embodiments, the mode determination unit 11 is used to determine that the predicted mode of the current block is the single-model intra-block copy illumination compensation mode when the value of the index information is a first number, and to determine that the predicted mode of the current block is the multi-model intra-block copy illumination compensation mode when the value of the index flag is a second number.

[0560] In some embodiments, the mode determination unit 11 is specifically used to determine the multi-model intra-block copy illumination compensation mode as the predictive mode for the current block if the second information indicates that the current block uses the intra-block copy illumination compensation mode and the size of the current block is greater than or equal to a second predetermined size.

[0561] In some embodiments, the second information is further used to indicate the mode index of the intrablock copy illumination compensation mode, and the mode determination unit 11 is specifically used to determine the predicted mode of the current block based on the value of the second information.

[0562] In some embodiments, the mode determination unit 11 is used to determine that the predicted mode of the current block is not the intrablock copy illumination compensation mode if the value of the second information is a first numerical value, to determine that the predicted mode of the current block is the single-model intrablock copy illumination compensation mode if the value of the second information is a second numerical value, and to determine that the predicted mode of the current block is the multi-model intrablock copy illumination compensation mode if the value of the second information is a third numerical value.

[0563] In some embodiments, the mode determination unit 11 is used to determine whether the size of the current block satisfies a first predetermined size before decoding the bitstream and obtaining the second information, and if the size of the current block satisfies the first predetermined size, it decodes the bitstream and obtains the second information.

[0564] In some embodiments, the mode determination unit 11 decodes the bitstream to obtain third information before decoding the bitstream to obtain second information, the third information being used to indicate whether the current block uses a first tool for decoding, the first tool being an intrablock copy illumination compensation technique and a mutex, and if the third information indicates that the current block does not use a first tool for decoding, the bitstream is decoded and the second information is obtained.

[0565] In some embodiments, the mode determination unit 11 is specifically used to determine the prediction mode of the reference block as the prediction mode of the current block when the first flag indicates that the current block uses the merge mode.

[0566] In some embodiments, the mode determination unit 11 is used to determine the single-model intra-block copy illumination compensation mode as the predictive mode for the current block if the first flag indicates that the current block will use the merge mode.

[0567] In some embodiments, the mode determination unit 11 specifically decodes the bitstream and obtains fourth information if the first flag indicates that the current block uses the merge mode, the fourth information is used to indicate the prediction mode of the current block, and is used to obtain the prediction mode of the current block based on the fourth information.

[0568] In some embodiments, the mode determination unit 11 decodes the bitstream and obtains a third flag before decoding the bitstream and obtaining a first flag, the third flag being used to indicate whether local illumination compensation is permitted for the current sequence, and if the third flag indicates that local illumination compensation is permitted for the current sequence, the bitstream is decoded and the first flag is obtained.

[0569] The embodiments of the apparatus and the embodiments of the method may correspond to each other, and similar descriptions may refer to the embodiments of the method. To avoid redundancy, such descriptions are omitted here. Specifically, the apparatus 10 shown in Figure 16 can perform the decoding-side decoding method of the embodiments of the present application, and the above-mentioned operations and other operations and / or functions of each unit in the apparatus 10 are for realizing the corresponding processes in each method, such as the above-mentioned decoding-side decoding method, respectively, and for the sake of brevity, such descriptions are omitted here.

[0570] Figure 17 is a schematic block diagram of a video encoding device according to one embodiment of the present invention, and this video encoding device is applied to the encoder described above.

[0571] As shown in Figure 17, the video encoding device 20 is Mode for determining the prediction mode of the current block decision Unit 21 and, When the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode, a parameter determination unit 22 for determining the reference block of the current block and determining N group linear model parameters, wherein N is a positive integer greater than 1, The system includes a modification unit 23 for selecting linear model parameters of a target group from the linear model parameters of the N groups, linearly transforming the reference block using the linear model parameters of the target group, and obtaining a predicted block for the current block.

[0572] In some embodiments, the parameter determination unit 22 is specifically used to determine the linear model parameters of the N groups based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

[0573] In some embodiments, the parameter determination unit 22 specifically determines a first sample set from the reconstructed surrounding region of the reference block, determines a second sample set from the reconstructed surrounding region of the current block, partitions the first and second sample sets into N groups of sample sets, each of the N groups of sample sets comprising at least one first sample and at least one second sample, and is used to determine the i-th linear model parameter for the i-th group of sample sets based on the first and second samples included in the i-th group of sample sets, where i is a positive integer less than or equal to N.

[0574] In some embodiments, the reconfigured region surrounding the reference block includes the template region of the reference block, and the reconfigured region surrounding the current block includes the template region of the current block, and the parameter determination unit 22 is specifically used to determine the first sample set from the template region of the reference block and the second sample set from the template region of the current block.

[0575] In some embodiments, the parameter determination unit 22 is specifically used to perform sampling in the template region of the reference block according to a first sampling step size to obtain the first sample set, and when the first sampling step size is smaller than a predetermined sampling step size, it is used to perform sampling in the template region of the current block according to the first sampling step size to obtain the second sample set.

[0576] In some embodiments, the parameter determination unit 22 is specifically used to determine all samples contained in the template region of the reference block as the first sample set, and all samples contained in the template region of the current block as the second sample set.

[0577] In some embodiments, the template region of the reference block includes the upper template region of the reference block and / or the left template region of the reference block, and the template region of the current block includes the upper template region of the current block and / or the left template region of the current block.

[0578] In some embodiments, the upper template region of the reference block includes the upper template region and the upper right template region of the reference block, and the upper template region of the current block includes the upper template region and the upper right template region of the current block.

[0579] In some embodiments, the left template region of the reference block includes the left template region and the lower left template region of the reference block, and the left template region of the current block includes the left template region and the lower left template region of the current block.

[0580] In some embodiments, the number of sample rows included in the upper template area of ​​the reference block is greater than or equal to a predetermined number of rows, and the number of sample rows included in the upper template area of ​​the current block is greater than or equal to the predetermined number of rows.

[0581] In some embodiments, the number of sample columns included in the left template area of ​​the reference block is greater than or equal to a predetermined number of columns, and the number of sample columns included in the left template area of ​​the current block is greater than or equal to the predetermined number of columns.

[0582] In some embodiments, the parameter determination unit 22 is specifically used to classify the first samples included in the first sample set into N types of first samples, classify the second samples included in the second sample set into N types of second samples, and obtain the N-group sample set based on the N types of first samples and the N types of second samples.

[0583] In some embodiments, the parameter determination unit 22 is specifically used to determine the first sample mean of the first sample set and to classify the first sample set into the N types of first samples based on the first sample mean.

[0584] In some embodiments, the parameter determination unit 22 is specifically used to classify first samples from the first sample set that are equal to or greater than the first sample mean into a first type of first sample, and to classify first samples from the first sample set that are equal to or less than the first sample mean into a second type of first sample.

[0585] In some embodiments, the parameter determination unit 22 is specifically used to classify the first sample set into N types of first samples based on the bit depth of the first sample in the first sample set.

[0586] In some embodiments, the parameter determination unit 22 is specifically used to determine the first bit depth mean of the first sample set and to classify the first sample set into the N types of first samples based on the first bit depth mean.

[0587] In some embodiments, the parameter determination unit 22 is specifically used to classify first samples from the first sample set whose bit depth is equal to or greater than the first average bit depth as a first type of first sample, and to classify first samples from the first sample set whose bit depth is less than or equal to the first average bit depth as a second type of first sample.

[0588] In some embodiments, the parameter determination unit 22 is specifically used to determine the second sample of type j, corresponding to the first sample of type j among the N types of first samples, as the second sample of type j, where j is a positive integer less than or equal to N.

[0589] In some embodiments, the parameter determination unit 22 is specifically used to determine the first sample of type j and the second sample of type j as the sample set of the j pair.

[0590] In some embodiments, the parameter determination unit 22 is used to determine the linear model parameters of the i group based on the first, second, third, and fourth aggregate values. Specifically, it is used to add the first sample in the i group sample set to obtain a first aggregate value, add the second sample in the i group sample set to obtain a second aggregate value, determine the sum of squares of the first sample in the i group sample set to obtain a third aggregate value, multiply the first and second samples in the i group sample set and then add them to obtain a fourth aggregate value.

[0591] In some embodiments, the modification unit 23 is specifically used to determine the second sample mean of the reference block and, based on the second sample mean, to select the linear model parameters of the target group from the linear model parameters of the N group.

[0592] In some embodiments, the modification unit 23 is specifically used to select the linear model parameters of the target group from the linear model parameters of the N group based on the second sample mean and the first sample mean.

[0593] In some embodiments, the modification unit 23 is specifically used to determine, when the second sample mean is greater than or equal to the first sample mean, one group of linear model parameters from the N groups of linear model parameters corresponding to the first sample of the first type as the linear model parameters of the target group, and when the second sample mean is less than or equal to the first sample mean, one group of linear model parameters from the N groups of linear model parameters corresponding to the first sample of the second type as the linear model parameters of the target group.

[0594] In some embodiments, the modification unit 23 is specifically used to determine the second bit depth mean of the reference block and, based on the second bit depth mean, to select the linear model parameters of the target group from the linear model parameters of the N group.

[0595] In some embodiments, the modification unit 23 is specifically used to select the linear model parameters of the target group from the linear model parameters of the N group based on the second bit depth mean and the first bit depth mean.

[0596] In some embodiments, the modification unit 23 is specifically used to determine, when the second bit depth mean is greater than or equal to the first bit depth mean, one group of linear model parameters from the N group of linear model parameters corresponding to the first sample of the first type as the linear model parameters of the target group, and when the second bit depth mean is less than or equal to the first bit depth mean, one group of linear model parameters from the N group of linear model parameters corresponding to the first sample of the second type as the linear model parameters of the target group.

[0597] In some embodiments, the mode determination unit 21 specifically determines a list of candidate prediction modes corresponding to the current block, the candidate prediction modes include the multi-model intra-block copy illumination compensation modes, determines the cost of predicting the current block using each candidate prediction mode in the list, and determines the prediction mode for the current block based on the cost.

[0598] In some embodiments, before determining the candidate prediction mode list corresponding to the current block, the mode determination unit 21 further determines whether the size of the current block satisfies a first predetermined size, and if the size of the current block satisfies the first predetermined size, it is used to add the multi-model intra-block copy illumination compensation mode to the candidate prediction mode list corresponding to the current block.

[0599] In some embodiments, before determining the candidate prediction mode list corresponding to the current block, the mode determination unit 21 further determines whether the current block uses a first tool for encoding, and if it is determined that the first tool is an intra-block copy illumination compensation technique and a mutex, and the current block does not use the first tool for encoding, the multi-model intra-block copy illumination compensation mode is used to add the candidate prediction mode list corresponding to the current block.

[0600] In some embodiments, the mode determination unit 21 is further used to determine the prediction type of the current block and write first information to a bitstream, the first information being used to indicate the prediction type of the current block.

[0601] In some embodiments, the mode determination unit 21 is further used to write a first flag to the bitstream if the prediction type of the current block is an intra-block copy prediction, and the first flag is used to indicate whether the current block uses merge mode.

[0602] In some embodiments, the mode determination unit 21 is further used to write second information to the bitstream if the current block does not use the merge mode, the second information being used to indicate whether the current block uses the intrablock copy illumination compensation mode.

[0603] In some embodiments, the mode determination unit 21 is further used to write index information to the bitstream if the current block uses the intrablock copy illumination compensation mode, the index information being used to indicate the mode index of the intrablock copy illumination compensation mode used by the current block.

[0604] In some embodiments, the mode determination unit 21 is further used to determine that the value of the index information is a first number if the predicted mode of the current block is a single-model intra-block copy illumination compensation mode, and to determine that the value of the index flag is a second number if the predicted mode of the current block is a multi-model intra-block copy illumination compensation mode.

[0605] In some embodiments, the mode determination unit 21 is specifically used to determine the multi-model intra-block copy illumination compensation mode as the predictive mode for the current block if the second information indicates that the current block uses the intra-block copy illumination compensation mode and the size of the current block is greater than or equal to a second predetermined size.

[0606] In some embodiments, the second information is further used to indicate the mode index of the intrablock copy illumination compensation mode, and the mode determination unit 21 further determines that the value of the second information is a first number if the predicted mode of the current block is not the intrablock copy illumination compensation mode, determines that the value of the second information is a second number if the predicted mode of the current block is the single-model intrablock copy illumination compensation mode, and determines that the value of the second information is a third number if the predicted mode of the current block is the multi-model intrablock copy illumination compensation mode.

[0607] In some embodiments, the mode determination unit 21 is specifically used to determine the prediction mode of the reference block as the prediction mode of the current block when the current block uses the merge mode.

[0608] In some embodiments, the mode determination unit 21 is specifically used to determine the single-model intra-block copy illumination compensation mode as the predictive mode for the current block when the current block uses the merge mode.

[0609] In some embodiments, before determining the candidate prediction mode list corresponding to the current block, the mode determination unit 21 further determines a third flag, which is used to indicate whether local illumination compensation is permitted for the current sequence, and if the third flag is used to indicate that local illumination compensation is permitted for the current sequence, the multi-model intra-block copy illumination compensation mode is used to add the candidate prediction mode list corresponding to the current block.

[0610] In some embodiments, the mode determination unit 21 is further used to write the third flag to the bitstream, which is used to indicate whether local illumination compensation is permitted for the current sequence.

[0611] The embodiments of the apparatus and the embodiments of the method may correspond to each other, and similar descriptions may refer to the embodiments of the method. To avoid redundancy, such descriptions are omitted here. Specifically, the apparatus 20 shown in Figure 17 may correspond to the corresponding main body that performs the encoding method on the encoding side of the embodiments of the present application, and the above-mentioned operations and other operations and / or functions of each unit within the apparatus 20 are for realizing the corresponding processes in each method, such as the above-mentioned encoding method on the encoding side, and for the sake of brevity, such descriptions are omitted here.

[0612] The apparatus and system of the embodiments of the present application have been described above with reference to the drawings in terms of functional units. It should be understood that these functional units may be implemented in hardware form, by software instructions, or by a combination of hardware and software. Specifically, each step of the embodiment of the method in the embodiments of the present application may be performed by hardware integrated logic circuits and / or software instructions within a processor, and the steps of the method disclosed in relation to the embodiments of the present application may be directly implemented to be performed by a hardware decoding processor or by a combination of hardware and software units within a decoding processor. Optionally, the software units may be located in art-mature storage media such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable read-only memory, and registers. The storage media is located in memory, and the processor reads information from the memory and, with respect to its hardware, performs the steps of the embodiment of the method described above.

[0613] Figure 18 is a schematic block diagram of an electronic device according to an embodiment of the present application.

[0614] As shown in Figure 18, this electronic device 30 is a video encoder or video according to the embodiment of the present application. De It may also be a CODA, and this electronic device 30 is memory 31 It may also be equipped with a processor 32, and this memory 33 stores a computer program 34, computer Professional Mu3 This is used to transmit 4 to the processor 32. In other words, the processor 32 can call and execute the computer program 34 from the memory 33 to realize the method in the embodiment of the present invention.

[0615] For example, this processor 32 performs the above actions in accordance with the instructions in this computer program 34. within the law It is used to perform the following steps.

[0616] In some embodiments of the present invention, this processor 32 is This includes, but is not limited to, general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.

[0617] In some embodiments of the present invention, this memory 33 is This includes, but is not limited to, volatile memory and / or non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), or flash memory. Volatile memory may be random access memory (RAM) functioning as an external buffer. To illustrate with examples, though not limited to them, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM), and direct Rambus random access memory (Direct Rambus RAM, DR RAM).

[0618] In some embodiments of the present application, the computer program 34 may be partitioned into one or more units, which are stored in the memory 33 and executed by the processor 32 to complete the method provided by the present application. The one or more units are a set of computer program instruction segments that can complete a particular function, which are used to describe the execution process of the computer program 34 in the electronic device 30.

[0619] As shown in Figure 18, this electronic device 30 is This processor 32 or memory 33 may be further provided with a transceiver 33 that can be connected to it.

[0620] Here, the processor 32 can control the transceiver 33 to communicate with other devices, specifically by sending information and data to other devices and receiving information and data sent from other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of antennas may be one or more.

[0621] It should be understood that each component within this electronic device 30 is connected via a bus system that includes a power bus, a control bus, and a status signal bus, in addition to the data bus.

[0622] Figure 19 is a schematic block diagram of a video codec system according to an embodiment of the present invention.

[0623] As shown in Figure 19, this video codec system 40 consists of a video encoder 41 and video De A coder 42 may be provided, where the video encoder 41 is used to perform the video encoding method according to the embodiment of the present application, and video De Code 42 is a video relating to an embodiment of the present application. decrypt It is used to carry out the transformation method.

[0624] The present invention further provides a computer storage medium that, when executed by a computer, stores a computer program that causes the computer to perform the method of the above-described embodiment of the method. In other words, embodiments of the present invention further provide a computer program product that, when executed by a computer, includes instructions that cause the computer to perform the method of the above-described embodiment of the method.

[0625] The present invention further provides a bitstream generated according to the above encoding method.

[0626] When implemented using software, it may be implemented in whole or in part as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded into a computer and executed, they generate all or part of the process or function relating to the embodiment of the present application. This computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable device. These computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, these computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, radio, microwave, etc.). These computer-readable storage mediums may be any available medium accessible to a computer, or they may be data storage devices such as servers or data centers that integrate one or more available media. These available media may include magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid state drives (SSDs)).

[0627] A person skilled in the art will recognize that each example unit and algorithmic step described in relation to the embodiments disclosed herein can be implemented by 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 proposed technology. A person skilled in the art may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0628] In some embodiments provided herein, it should be understood that the disclosed systems, apparatus and methods may be implemented in other forms. For example, the apparatus embodiments described above are illustrative only, and for instance, the partitions of this unit are merely partitions of logical functions. In actual implementation, other partitioning methods may be used, such as combining multiple units or components, integrating them into another system, or ignoring or not performing certain features. In other words, the shown or discussed couplings, direct couplings or communication connections between them may also be indirect couplings or communication connections via several interfaces, apparatus or units, and may be in electrical, mechanical, or other forms.

[0629] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units can be selected to achieve the objectives of the scheme of this embodiment, depending on the actual needs. For example, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit.

[0630] The above describes only specific embodiments of the present application; however, the scope of protection of this application is not limited thereto, and any modification or substitution that any person skilled in the art could easily conceive within the technical scope disclosed herein should be included in the scope of protection of this application. Accordingly, the scope of protection of this application should be subject to the scope of protection of the claims.

Claims

1. A video decoding method, The steps include determining the prediction mode for the current block, A step of determining the reference block of the current block and determining the linear model parameters of N groups, wherein N is a positive integer greater than 1, A video decoding method characterized by comprising the steps of selecting linear model parameters for a target group from the linear model parameters of the N group, and determining the predicted block of the current block according to the linear model parameters of the target group.

2. The step of determining the linear model parameters of the N group is: The method according to claim 1, characterized by comprising the step of determining the linear model parameters of the N group based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

3. The step of determining the linear model parameters of the N group based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block is: The steps include determining a first sample set from the reconstructed region surrounding the reference block, and determining a second sample set from the reconstructed region surrounding the current block, The steps of dividing the first sample set and the second sample set into N sample sets, The method according to claim 2, further comprising the step of determining the linear model parameters of the i-th group sample set from the N-th group sample set based on the first and second samples included in the i-th group sample set.

4. The reconstructed region surrounding the reference block includes the template region of the reference block, and the reconstructed region surrounding the current block includes the template region of the current block. The steps of determining a first sample set from the reconstructed region surrounding the reference block and determining a second sample set from the reconstructed region surrounding the current block are as follows: The method according to claim 3, comprising the steps of determining the first sample set from the template region of the reference block and determining the second sample set from the template region of the current block.

5. The steps of determining the first sample set from the template area of ​​the reference block and determining the second sample set from the template area of ​​the current block are as follows: A step of obtaining the first sample set by sampling in the template area of ​​the reference block according to a first sampling step size, wherein the first sampling step size is a step smaller than a predetermined sampling step size, The method according to 4, further comprising the step of performing sampling in the template region of the current block according to the first sampling step size to obtain the second sample set.

6. The method according to 4, wherein the template area of ​​the reference block includes the upper template area of ​​the reference block and / or the left template area of ​​the reference block, and the template area of ​​the current block includes the upper template area of ​​the current block and / or the left template area of ​​the current block.

7. The step of dividing the first sample set and the second sample set into N sample sets is: The steps include classifying the first sample included in the first sample set into N types of first samples, The steps include classifying the second sample included in the second sample set into N types of second samples, The method according to claim 3, comprising the step of obtaining a sample set of N groups based on the N types of first samples and the N types of second samples.

8. The step of partitioning the first sample included in the first sample set into N types of first samples is: The steps include determining the first sample mean of the first sample set, The method according to 7, comprising the step of partitioning the first sample set into N types of first samples based on the first sample mean value.

9. The step of partitioning the first sample set into the N types of first samples based on the first sample mean is: The steps include: partitioning the first sample from the first sample set that is equal to or greater than the mean value of the first sample into a first sample of a first type; The method according to 8, further comprising the step of partitioning the first sample set whose first sample value is less than or equal to the first sample mean into a second type of first sample.

10. The method described above is: The process further includes the steps of adding the first sample from the sample set of group i to obtain a first aggregate value, and adding the second sample from the sample set of group i to obtain a second aggregate value. The method according to feature 3.

11. The above method is The process further includes the step of determining the sum of squares of the first sample in the sample set of group i and obtaining a third aggregate value. The method according to the present invention, characterized by the present invention.

12. The method described above is: The process further includes the step of multiplying the first sample and the second sample in the i-group sample set and then adding them to obtain a fourth aggregate value. The method according to 11, characterized by the features described above.

13. The step of determining the linear model parameters of group i based on the first and second samples included in the sample set of group i is: The method according to 12, comprising the step of determining the linear model parameters of group i based on the first aggregate value, the second aggregate value, the third aggregate value, and the fourth aggregate value.

14. A video encoding method, The steps include determining the prediction mode for the current block, A step of determining the reference block of the current block and determining the linear model parameters of N groups, wherein N is a positive integer greater than 1, A video coding method characterized by comprising the steps of selecting linear model parameters for a target group from the linear model parameters of the N group, and determining a predicted block for the current block according to the linear model parameters of the target group.

15. The step of determining the linear model parameters of the N group is: The method according to 14, characterized by comprising the step of determining the linear model parameters of the N group based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block.

16. The step of determining the linear model parameters of the N group based on the reconstructed surrounding region of the reference block and the reconstructed surrounding region of the current block is: The steps include determining a first sample set from the reconstructed region surrounding the reference block, and determining a second sample set from the reconstructed region surrounding the current block, The steps of dividing the first sample set and the second sample set into N sample sets, The method according to 15, comprising the step of determining the linear model parameters of the i-th group sample set from the N-th group sample set based on the first and second samples included in the i-th group sample set.

17. The reconstructed region surrounding the reference block includes the template region of the reference block, and the reconstructed region surrounding the current block includes the template region of the current block. The steps of determining a first sample set from the reconstructed region surrounding the reference block and determining a second sample set from the reconstructed region surrounding the current block are as follows: The method according to 16, characterized by comprising the steps of determining the first sample set from the template region of the reference block and determining the second sample set from the template region of the current block.

18. The steps of determining the first sample set from the template area of ​​the reference block and determining the second sample set from the template area of ​​the current block are as follows: A step of obtaining the first sample set by sampling in the template area of ​​the reference block according to a first sampling step size, wherein the first sampling step size is a step smaller than a predetermined sampling step size, The method according to 17, comprising the step of performing sampling in the template region of the current block according to the first sampling step size to obtain the second sample set.

19. Equipped with a processor and memory, The aforementioned memory is used to store computer programs. The processor is used to call and execute computer programs stored in the memory in order to perform processing. The aforementioned process is, Determining the prediction mode for the current block, A step of determining the reference block of the current block and determining the linear model parameters of group N, wherein N is a positive integer greater than 1, A video decoder characterized by selecting linear model parameters for a target group from the linear model parameters of the N group, and determining the predicted block of the current block according to the linear model parameters of the target group.

20. A computer-readable storage medium used for storing computer programs and bitstreams. The computer-readable storage medium is characterized in that the computer program causes a computer to execute the method described in any one of claims 14 to 18 to generate the bitstream.