ILLUMINATION COMPENSATION METHOD, ENCODER, DECODER AND STORAGE MEDIUM
Patent Information
- Authority / Receiving Office
- MX · MX
- Patent Type
- Patents
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-08-18
- Publication Date
- 2026-06-12
Smart Images

Figure MX435449B0
Abstract
Description
LIGHTING COMPENSATION METHOD, ENCODER, DECODER AND STORAGE MEDIA TECHNICAL FIELD This description relates to the field of video coding technology, relating to, among others, a lighting compensation method, an encoder, a decoder and a storage medium. BACKGROUND OF THE INVENTION In video coding, in the coding procedure of a current block, in addition to intra-prediction, inter-prediction can also be used. For interprediction, an interprediction procedure can be performed on each coding unit to calculate a prediction block. In the related art, in interprediction, illumination compensation technology is used to eliminate illumination angle changes caused by illumination changes and object movements, shadow changes caused by relative motion of objects before and after, changes of luminance introduced by post-production, etc. There may be similar textures but different luma between the current block (encoding block or decoding block) and a reference block. In this case, lighting compensation technology is used for the current block, and a lighting compensation factor of the current block is determined using some of the reconstructed samples in the left column and top row of the current block and samples at positions corresponding in samples in the left column and the top row of the reference block, to perform illumination compensation. However, for the current block in normal natural video, the bit rate of a bitstream will increase due to flag overhead at the coding unit level when using illumination compensation technology, which, for video or specific illumination image, leads to the high bit encoding overhead of the stream without the need for illumination compensation, which affects the final encoding efficiency. BRIEF DESCRIPTION OF THE INVENTION Implementations of the disclosure provide a lighting compensation method, an encoder, a decoder, and a storage medium. When rp} «nn / eznz / B / YiAi lighting compensation is selected for a frame-level image based on different situations, a frame-level lighting compensation enabled flag is added at the frame level, to represent whether lighting compensation technology is used, to save coding bit overhead and improve coding performance. In a first aspect, the implementations of the disclosure provide a method of lighting compensation. The method is applied to a decoder and includes the following. A bitstream is obtained, and the bitstream is parsed to obtain a lighting compensation enabled flag. A lighting compensation frame-level enabled flag is obtained in the bitstream, when the lighting compensation enabled flag is valid. A lighting compensation use flag is obtained in the bitstream, when the lighting compensation frame-level enabled flag is valid. Index information of a target lighting compensation mode is obtained in the bitstream, when the lighting compensation use flag is valid. Illumination compensation is performed in a current block based on the index information of the target illumination compensation mode. In a second aspect, implementations of the disclosure further provide a method of lighting compensation. The method is applied to an encoder and includes the following. An enabled flag is determined at the illumination compensation frame level based on the luminance information of a current frame. A lighting compensation function is enabled for the current frame and lighting compensation is performed on a current block of the current frame, to obtain a lighting prediction value, when the lighting compensation frame-level enabled flag is valid . The lighting compensation box-level enabled flag is signaled to a bitstream. In a third aspect, implementations of the description provide a decoder. The decoder includes an analysis section, a first acquisition section, and a first lighting compensation section. The analysis section is configured to: obtain a bitstream and analyze the bitstream to obtain an enabled lighting compensation flag. The first get section is configured to: get a frame-level lighting compensation enabled flag in the bitstream, when the lighting compensation enabled flag is valid, get a lighting compensation use flag in the stream of bits, when the frame-level lighting compensation enabled flag is valid, and obtain index information of a target lighting compensation mode in the bitstream, when the lighting compensation use flag is valid. The first lighting compensation section is configured to perform lighting compensation in a current block based on the index information of the target lighting compensation mode. rc} «nn / eznz / B / YiAi In a fourth aspect, implementations of the description provide a decoder. The encoder includes a second determination section, a second prediction section, and a signaling section. The second determination section is configured to determine an enabled flag at the lighting compensation frame level based on the luminance information of a current frame. The second prediction section is configured to: enable a lighting compensation function for the current frame and perform lighting compensation on a current block of the current frame, to obtain a lighting prediction value, when the enabled flag at the level of lighting compensation chart is valid. The signaling section is configured to signal the enabled flag at the lighting compensation frame level to a bit stream. In a fifth aspect, the implementations of the description further provide a decoder. The decoder includes a first memory and a first processor. The first memory stores an executable computer program in the first processor, and upon executing the computer program, the first processor implements the lighting compensation method corresponding to the decoder. In a sixth aspect, implementations of the description further provide an encoder. The encoder includes a second memory and a second processor. The second memory stores an executable computer program on the second processor, and when executing the computer program, the second processor implements the lighting compensation method corresponding to the encoder. The implementations of the description provide a storage medium. The storage medium stores a computer program. When the computer program is executed by a first processor, the lighting compensation method corresponding to the decoder of the claim is implemented. Alternatively, when the computer program is executed by a second processor, the lighting compensation method corresponding to the encoder of the claim is implemented. The implementations of the description provide the lighting compensation method, the encoder, the decoder and the storage medium. The bitstream is obtained, and the bitstream is analyzed to obtain the lighting compensation enabled flag, current motion information, and a current prediction mode. The illumination compensation frame-level enabled flag is obtained in the bitstream, when the illumination compensation enabled flag is valid. The illumination compensation use flag in the bitstream is obtained when the illumination compensation frame-level enabled flag is valid. The target lighting compensation mode index information in the bitstream is obtained when the lighting compensation use flag is valid. Illumination compensation is performed in the current block based on the index information of the target illumination compensation mode. By adopting the above technical solution, in the decoding procedure of the current block, in the case of using lighting compensation technology, the decoder can directly obtain the lighting compensation frame-level enabled flag at the frame level of the bitstream, so the encoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only if the flag enabled at the frame level lighting compensation is valid, a CU level flag in the bitstream can be obtained, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmission bits of the bitstream will be greatly reduced. Therefore, when the illumination compensation is selected for the frame-level image based on different situations, the frame-level illumination compensation enabled flag is added, to represent whether the illumination compensation technology is used. lighting compensation, to save coding bit overhead, and improve coding performance. BRIEF DESCRIPTION OF THE DRAWINGS Figures 1A to 1C are schematic diagrams of component layouts in different color formats provided in implementations of the disclosure. Figure 2 is a schematic diagram of the coding unit partition provided in implementations of the disclosure. Figure 3 is a schematic structural diagram of a video coding network architecture provided in implementations of the disclosure. Figure 4 is a schematic structural diagram of a video coding system provided in implementations of the disclosure. Figure 5 is a schematic structural diagram of a video decoding system provided in implementations of the disclosure. Figure 6 is a schematic diagram of lighting compensation of a current block and a reference block provided in implementations of the disclosure. Figure 7A is the schematic diagram 1 of the arrangement of a current block and a reference block provided in implementations of the description. Figure 7B is the schematic diagram 2 of the arrangement of a current block and a reference block provided in implementations of the description. rp} «nn / eznz / B / YiAi Figure 8 is a flow chart of a lighting compensation method provided in implementations of the disclosure. Figure 9 is the schematic diagram 3 of the arrangement of a current block and a reference block provided in implementations of the description. Figure 10 is the schematic diagram 4 of the arrangement of a current block and a reference block provided in implementations of the description. Figure 11 is the schematic diagram 5 of the arrangement of a current block and a reference block provided in implementations of the description. Figure 12 is a flow chart of a lighting compensation method additionally provided in implementations of the disclosure. Figure 13 is a schematic structural diagram 1 of a decoder provided in implementations of the description. Figure 14 is a schematic structural diagram 2 of a decoder provided in implementations of the description. Figure 15 is the schematic structural diagram 1 of an encoder provided in the implementations of the description. Figure 16 is the schematic structural diagram 2 of an encoder provided in the implementations of the description. DETAILED DESCRIPTION OF THE INVENTION The technical solutions in implementations of the description will be clearly and completely described below with reference to the drawings in the implementations of the description. It should be understood that the implementations described in this document are intended only to explain the relevant description and not to limit the description. Furthermore, it should be noted that to facilitate the description, only the parts related to the description are illustrated in the drawings. In a video image, a first color component, a second color component, and a third color component are generally used to represent a current block (for example, a coding block (CB)). The three color components are, respectively, a luminance component, a blue chrominance component, and a red chrominance component, specifically, the luminance component is usually denoted by the symbol Y, the blue chrominance component is usually denoted by the symbol Cb or U, and the red chrominance component is usually indicated by the symbol Cr or V. In this way, the video image can be expressed in YCbCr format or YUV format. Generally, digital video compression technology is applied to image data with the YCbCr (YUV) color coding method. The YUV ratio is generally 4:2:0, 4:2:2, or 4:4:4. Y represents luminance, Cb(U) represents blue chrominance, Cr(V) represents red chrominance, and U and V They represent chrominance, to describe color and saturation. Figures 1A to 1C illustrate distribution diagrams of various components in different color formats, where the Y component is white and the UV components are black gray. As illustrated in Figure 1A, in color format, 4:2:0 denotes four luminance components and two chrominance components (YYYYCbCr) per four pixels, as illustrated in Figure IB, 4:2:2 indicates four luminance components and four chrominance components (YYYYCbCrCbCr) per four pixels, and as illustrated in Figure 1C, 4:4:4 indicates a full pixel display (YYYYCbCrCbCrCbCrCbCr). Currently, general video coding standards are based on a hybrid block-based coding framework. Each frame of the video image is divided into a larger square coding unit (LCU) of the same size (such as 128 x 128, 64 x 64, etc.), and each larger coding unit can also be divided into a rectangular coding unit (CU) according to the rules. Furthermore, the coding unit can be divided into smaller prediction units (PUs). Specifically, the hybrid coding box may include modules such as prediction, transformation, quantization, entropy coding, loop filter. The prediction module may include intra-prediction and inter-prediction, and the inter-prediction may include motion estimation and motion compensation. Because there is a strong correlation between neighboring samples in a video image, interprediction can eliminate spatial redundancy between neighboring samples in video coding technology. For interprediction, image information from different frames can be referenced, and motion estimation is used to find motion vector information that best matches a current partition block, to eliminate temporal redundancy. For the transformation, the predicted image block is transformed into the frequency domain, the energy is redistributed, and the information insensitive to the human eye can be removed in combination with quantization, which is used to eliminate visual redundancy. Entropy encoding can eliminate character redundancy based on the current context model and probability information of the binary bitstream. It should be noted that in the video coding procedure, the encoder first reads the image information and divides the image into several coding tree units (CTUs), and a coding tree unit can be divided into coding units multiple (CU), which can be rectangular blocks or square blocks. The specific relationship can refer to Figure 2. In the interprediction procedure, for the current coding unit, the information of reference blocks of different images is considered for prediction, it is rc} «nn / eznz / B / YiAi that is, according to a higher coding order Generally from left to right and top to bottom, the top left coding unit, the top coding unit and the left coding unit of the reference block can be used as reference information to predict that the digital video input of the current coding unit is in color format, that is, the input source of the current mainstream digital video encoder YUV 4: 2: 0 format, that is, every four pixels of the image are composed of four Y components and two UV components. The encoder encodes the Y component and UV components respectively, and the adopted encoding tools and technologies are slightly different, while the decoder also decodes according to different formats. For the interprediction part of digital video coding, the encoding block of the current frame is mainly predicted by considering the reconstructed image information of the decoded frame, the image block in the reference frame is searched by motion estimation, the block matching the smallest error is found based on the mean square error (MSE) or other algorithms, and the motion vector (MV) corresponding to the current coding unit is obtained, motion compensation is performed in the reference block pointed by the MV to obtain the prediction block, and the residual error between the prediction block and the original image block is calculated to obtain residual information, and through transformation and quantization, the residual information is transmitted to the decoder. After receiving and analyzing the bit stream, the decoder obtains the residual information through inverse transformation and inverse quantization, and the residual information is added to the image block predicted by the decoder to obtain the reconstructed image block. Based on the above concept, by way of example, the lighting compensation technology can be applied to various prediction technologies such as interprediction, non-rectangular interprediction, affine transform prediction and the like, which are not limited in the implementations of the description. . Taking interprediction as an example, implementations of the disclosure provide a network architecture of a video coding system that includes an illumination compensation method. Figure 3 is a schematic structural diagram of a video coding network architecture of implementations of the disclosure. As illustrated in Figure 3, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, where the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic device can be various types of devices that have video encoding and decoding functions during deployment. For example, the electronic device may include a mobile phone, a tablet, a personal computer, a personal digital assistant, a browser, a digital phone, a video phone, a television, a rp} «nn / eznz / B / YiAi sensor device , a server, etc. Implementations of the description are not limited. The lighting compensation device in the implementations of the description may be the electronic device. The electronic device in the implementations of the description has a video encoding and decoding function, which generally includes a video encoder (i.e., an encoder) and a video decoder (i.e., a decoder). The description provides a video coding system. As illustrated in Figure 4, the video coding system 11 includes: a transformation unit 111, a quantization unit 112, a mode selection and coding control logic unit 113, an intra-prediction unit 114, a interprediction unit 115 (including motion compensation and motion estimation), an inverse quantization unit 116, an inverse transformation unit 117, a loop filter unit 118, an encoding unit 119 and a memory buffer unit decoded images 110. For an input original video signal, a video reconstruction block can be obtained by dividing a coding tree unit (CTU), a coding mode is determined by the coding and selection control logic unit mode 113, and then for the residual sample information obtained after intra or inter predictions, the video reconstruction block is transformed by the transformation unit 111 and the quantization unit 112, including the transformation of the residual information of a domain of pixels to a transformation domain, and the obtained transformation coefficients are quantized to further reduce the bit rate. The intra-prediction unit 114 performs intra-prediction in the video reconstruction block. The intra-prediction unit 114 is used to determine an optimal intra-prediction mode (i.e., a target prediction mode) of the video reconstruction block. The interprediction unit 115 is used to perform interpredictive coding on the received video reconstruction block with respect to one or more blocks in one or more reference frames, to provide temporal prediction information. Motion estimation is a motion vector generation procedure, where the motion vector can estimate the motion of the video reconstruction block, and motion compensation is performed based on the motion vector determined by motion estimation. After determining the interprediction mode, the interprediction unit 115 is further used to provide the selected interprediction data to the coding unit 119, and also to send the determined motion vector data to the coding unit 119. Furthermore, the inverse quantization unit 116 and the inverse transformation unit 117 are used for reconstruction of the video reconstruction block. The residual block is reconstructed in the pixel domain, the blocking artifacts of the reconstructed residual block are removed by the loop filter unit 118, and then the reconstructed residual block rp} «nn / eznz / B / YiAi is added to a predictive block in the frame of the decoded image buffer unit 110, to generate the reconstructed video reconstruction block. The coding unit 119 is used to encode various coding parameters and quantized transformation coefficients. The decoded image buffer unit 110 is used to store the reconstructed video reconstruction block for prediction reference. As video image encoding progresses, a new reconstructed video reconstruction block is continuously generated and all of these reconstructed video reconstruction blocks are stored in the decoded image buffer unit 110. The implementations of the description provide a video decoding system. Figure 5 is a schematic structural diagram of a video decoding system of implementations of the description. As illustrated in Figure 5, the video decoding system 12 includes: an encoding unit 121, an inverse transformation unit 127, an inverse quantization unit 122, an interprediction unit 123, a motion compensation unit 124, a loop filter unit 125 and a decoded image buffer unit 126. After the input video signal is encoded by the video coding system 11, a bit stream of the video signal is output. video. The bit stream is input to the video decoding system 12, and through the coding unit 121, the decoded transformation coefficients can be obtained. The transformation coefficients are processed by the inverse transformation unit 127 and the inverse quantization unit 122, to generate a residual block in the pixel domain. The intra-prediction unit 123 can be used to generate prediction data for the current video decoding block based on the determined intra-prediction address and the data of the previously decoded block of the current frame or image. The motion compensation unit 124 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements and uses the prediction information to generate a predictive block of the video decoding block being processed. decoding. A decoded video block is formed by adding the residual block of the inverse transformation unit 127 and the inverse quantization unit 122 to the corresponding predictive block generated by the interprediction unit 123 or the motion compensation unit 124. The decoded video signal can be removed through the loop filter unit 125, which can improve the video quality. The decoded video block is then stored in the decoded image buffer unit 126. The decoded image buffer unit 126 stores a reference image for subsequent intra-prediction or motion compensation, and is also for the output of the video signal, resulting in a restored original video signal. In practical application, there are often changes in the illumination intensity of video content in real natural videos, such as the decrease of illumination intensity over time, the obstruction of dark clouds. or changing the intensity of the camera flash. The difference between the previous and subsequent frames in these video contents mainly lies in the strength of the DC component of the image, but there is basically no change in the texture information in the content. However, due to the influence of the large value of the DC component, motion search and motion compensation for interprediction technology cannot effectively predict these contents, and it is easy to encode more residual information. Illumination compensation (IC) technology can eliminate this redundant DC information and accurately predict luminance changes and perform corresponding compensation, thereby reducing residual information and improving coding efficiency. In related technologies, illumination compensation technology includes multifunctional video coding, the technology carried in JEM of H.266 (versatile video coding, VVC), and the illumination compensation technology specified in the audio coding standard and video (AVS) 3 are currently as follows. In interprediction mode, for each CU block that can use the lighting compensation technology, rate distortion costs (Rdcost) are calculated and compared with and without the lighting compensation technology used. The lighting compensation technology is mainly achieved by linear compensation of the prediction block through a linear lighting compensation model. The lighting compensation model is mainly composed of a scale factor a and a shift factor b, and the specific formula is illustrated in formula (1): Pred'(x,y) = a Pred(x,y) + b (1) where Pred(x,y') is a prediction block before lighting compensation and Pred'Oc.y) is a prediction block prediction after lighting compensation, a is a scaling factor in the lighting compensation model and b is a displacement factor in the lighting compensation model. In the digital video encoding and decoding procedure, as illustrated in Figure 6, according to the reconstructed reference block of the reference frame, the illumination difference of the encoding block (that is, the current block) of the current frame is modified / refined by the lighting compensation model, to obtain the compensated prediction block. It should be noted that both a and b need to be calculated through the image information of the current frame and the image information of the reference frame, and are obtained by modeling the spatial neighbor reconstructed samples of the current block and the corresponding neighbor reference samples of the reconstructed block in the reference box. The derivation formula is illustrated in formula (2): rp} «nn / eznz / B / YiAi Curr_Recneigh= a Ref_Recneigh+ b (2) where Curr_Recneigh is the reconstructed sample of the reconstructed image of the current frame, and Ref_Recneigh is the reconstructed reference sample of the reconstructed image of the reference frame. In implementations of the disclosure, the scale factor a and the shift factor b are calculated with the corresponding neighboring reconstructed reference samples of the reconstructed reference block in the reference frame and the neighboring reconstructed samples of the encoding block in the current frame. According to the correlation between the reconstructed neighbor samples of the current frame encoding block and the reconstructed reference samples at the same corresponding sample positions in the reference frame, modeling and solving formula (2), the prediction block with Lighting compensation corresponding to the current block can be obtained. For example, as illustrated in Figure 7A and Figure 7B, the reconstructed samples are the most neighboring reconstructed samples of CU, the reference image CU is the corresponding reconstructed CU (reference block) in the reference frame, and The current image CU is the CU to be encoded (current block) in the current frame. By modeling the corresponding reconstructed samples into two frames and solving the linear relationship, the scale factor a and the displacement factor b are obtained, and then the linear relationship is applied to the reference image CU to obtain the prediction block of the current image CU. Specifically, the reconstructed neighbor samples of the CU reference image are classified, and to prevent some noise from affecting the accuracy of the linear model, a maximum value and a minimum value are removed after classification. The average value of the two largest values of the samples reconstructed after classification is calculated and recorded as Maxl, and the average value of the two smallest values of the samples reconstructed after classification is calculated and recorded as Minl. In addition, the average value of the reconstructed samples of the current CU image corresponding to the two largest coordinates taken after classification is calculated and recorded as Max2, and the average value of the reconstructed samples of the current CU image corresponding to the two Smallest coordinates taken after classification are calculated and recorded as Min2. Formula (3) and formula (4) are obtained by solving the linear model. Max2-Min2 a = --------(3) Maxl-Minl b = a x Min2 — Minl (4) In implementations of the disclosure, Maxl, Max2, Minl and Min2 are substituted into formulas (3) and (4) to calculate a and b. The lighting compensation technology in the implementations of the description is applied to the interprediction part in the hybrid video coding frame, specifically applied to all interprediction prediction modes and It acts on both the encoder and the decoder. An encoder employing an inter-prediction IC technology in an inter-prediction encoding mode is implemented as follows. The input digital video information is divided into several coding tree units in the encoder, each coding tree unit is divided into several rectangular or square coding units (that is, current blocks), and interprediction is performed respectively in each coding unit to calculate the prediction blocks. In the current coding unit, if the lighting compensation enabled flag is '1', all the following steps are performed, and if the lighting compensation enabled flag is '0', only steps a), b are performed ) and f). a) For interprediction, all candidate MVs are first traversed and motion compensation is performed, the prediction sample after motion compensation is calculated on each MV, and the rate distortion cost is calculated according to the original sample and the prediction sample. b) The prediction mode (such as SKIP, MERGE / DIRECT or INTER) and the optimal MV of the current coding unit are selected according to the principle of determining the minimum rate distortion costs of all MVs, and the optimal information and information corresponding to the cost of rate distortion is recorded. c) All candidate MVs are traversed again and in this procedure, lighting compensation technology is used. The reference block (reconstructed samples of the reference frame) is first compared and obtained according to the prediction mode and MV, the left and top reconstructed samples of the reference block and the left and top reconstructed samples of the unit are extracted current encoding, then the samples are extracted, sorted, averaged (the specific operation is described above), and substituted into the above formula to obtain the linear model parameters a and b. d) Motion compensation is performed in the reference block, prediction block after obtaining the normal motion compensation, then lighting compensation is performed in the prediction block, that is, a linear transformation is performed on the samples in each prediction block according to the linear model and the final prediction block of the current coding unit is obtained. e) The rate distortion cost information of each MV is calculated according to the final prediction sample after using the lighting compensation technology and the original sample, and the MV index of the rate distortion cost information minimum rate and its corresponding prediction mode (such as skip mode, fused / direct mode, or normal intermode) ΑΓ} Αηη / Γζηζ / Β / ΥΙΛΙ and its corresponding rate distortion cost is recorded. f) If the lighting compensation technology enabled flag is '0', the MV index and prediction mode recorded in b) are transmitted to the decoder via the bitstream. If the lighting compensation technology enabled flag is 'Γ, the minimum cost value recorded in b) is compared to the minimum cost value recorded in e). If the rate distortion cost in b) is smaller, the MV index and prediction mode recorded in b) are encoded as the optimal information of the current coding unit and transmitted to the decoder through the bitstream, and the flag position of the lighting compensation technology of the current coding unit is invalid, indicating that the lighting compensation technology is not used, which is also transmitted to the decoder through the bit stream. If the distortion rate in e) is smaller, the MV index and prediction mode recorded in e) are encoded as the optimal information of the current coding unit and transmitted to the decoder through the bit stream, and the flag position of the illumination compensation technology of the current coding unit is set to valid, indicating that the illumination compensation technology is used, which is also transmitted to the decoder through the bit stream. A decoder that employs the IC in inter-prediction coding mode is implemented as follows. The decoder obtains and analyzes the bitstream to obtain the information of the digital video stream, the illumination compensation enabled flag, the encoding mode of the current encoding unit (i.e., the current block), and the use lighting compensation of the current encoding unit. In the current encoding unit, if the lighting compensation enabled flag is '1', all of the following steps are performed; and if the lighting compensation enabled flag is '0', only steps a), b), d) and f) are performed. a) The bitstream information is obtained, the residual information of the current coding unit is analyzed, and then the inverse transform and inverse quantization are performed to obtain pixel domain residuals. b) The bitstream is parsed to obtain the prediction mode information and MV index of the current coding unit. c) The bitstream is analyzed to obtain the lighting compensation technology usage flag. d) The reference block in the reference frame is obtained according to the prediction mode and MV index of the current coding unit, and after motion compensation, the prediction block of the coding unit is obtained current. rp} «nn / eznz / B / YiAi e) If the lighting compensation technology usage flag of the current coding unit is '1', the left and top reconstructed samples of the reference block in the reference frame, the left and top reconstructed samples of the current coding unit is obtained, the reconstructed samples obtained from the reference frame and the current frame are sorted and averaged (the specific operation is described above), and the scale factor a and shift factor b of the linear model are obtained calculating the formula described above. The prediction block of the current coding unit is linearly transformed to obtain the final prediction block of the current coding unit. f) The prediction block is added to the restored residual information, to obtain the reconstructed block of the current coding unit, and the reconstructed block is output after post-processing. It should be noted that, the lighting compensation enabled flag in the implementations of the description is the form of numerical representation of the lighting compensation enabled flag, and the lighting compensation use flag is the numerical representation form of the flag of use of lighting compensation. In implementations of the description, for lighting compensation technology, when calculating the linear model, lighting compensation technology only has a good prediction compensation effect on a specific video sequence, such as lamp action image flash taken by a mobile phone or camera, the headlight changing image of a motor vehicle passing at night, etc. In this case, lighting compensation technology can minimize the difference between the predicted value and the actual sample value. However, for video sequences without lighting compensation, such as normal natural video, lighting compensation technology cannot play a good role in prediction compensation, and due to the overhead of flags at the image level coding unit, the bit rate of the bit stream will increase. Therefore, for an image or video with specific lighting, the codec must adaptively enable or disable the lighting compensation technology from the enabled flag at the frame level, to save overhead bits and improve compression efficiency. . Based on this, when performing interprediction, the description is applied to the current block, and the lighting compensation method provided in the implementations of the description is mainly applied to the interprediction unit 115 of the video coding system 11 and the interprediction unit of the video decoding system 12, that is, the motion compensation unit 124. That is, whether a better prediction effect can be obtained in the video encoding system 11 with the provided lighting compensation method in the rp} «nn / eznz / B / YiAi implementations of the description, consequently, the video decoding quality can be improved in the decoder. Based on this, the technical solutions of the description are further described in detail with reference to the drawings and implementations. Before elaborating, it should be noted that the first, second and third mentioned throughout the specification are simply to distinguish different features and do not have the functions of limiting priority, order and size. Implementations of the disclosure provide a lighting compensation method, which is applied to a video decoding device, i.e., a decoder. The functions of the method may be achieved by invoking program codes by a first processor in the video decoding device, and the program codes may be stored on a computer storage medium. It can be seen that the video decoding device includes at least the first processor and a first storage medium. The current coding unit and the current coding unit are represented by the current block below. Figure 8 is a schematic flowchart of a lighting compensation method of implementations of the disclosure. As illustrated in Figure 8, the method includes the following. S101, a bit stream is obtained, and the bit stream is analyzed to obtain a lighting compensation enable flag. S102, a lighting compensation frame-level enabled flag is obtained in the bitstream, when the lighting compensation enabled flag is valid. S103, a lighting compensation use flag is obtained in the bitstream, when the lighting compensation frame-level enabled flag is valid. S104, index information of a target lighting compensation mode is obtained in the bitstream, when the lighting compensation use flag is valid. S105, lighting compensation is performed in a current block based on the index information of the target lighting compensation mode. The lighting compensation method provided in the implementations of the description can be combined with various application scenarios of prediction technology, such as interprediction, non-rectangular interprediction, affine transformation prediction, etc. Implementations of the description are not limited. In implementations of the disclosure, after obtaining the bitstream, the decoder may first determine whether illumination compensation is allowed in the video sequence to be analyzed from the header information of the bitstream, i.e. , you can parse the lighting compensation enabled flag, which is an indication of rc} Rnn / eznz / B / YiAi whether lighting compensation is allowed in the video stream. It should be noted that, in the implementations of the description, if the lighting compensation enabled flag analyzed by the decoder is valid, indicating that the lighting compensation function is allowed to be enabled in the video stream, then the bitstream obtained by the decoder must have the illumination compensation frame-level enabled flag at the frame level that further indicates whether each frame allows illumination compensation, that is, the decoder can also analyze the illumination compensation frame-level enabled flag. illumination compensation in the bitstream. When the lighting compensation frame-level enabled flag corresponding to a given frame (such as the current frame) in the video sequence is valid, indicating that the lighting compensation function is allowed to be enabled in the frame, then the Decoder needs to further analyze and confirm the block in the box for which lighting compensation technology is used. When decoding the current block, the decoder can determine whether lighting compensation technology is used for the current block through the block-level lighting compensation use flag, for the subsequent decoding procedure. If the lighting compensation use flag corresponding to the current block is valid, the lighting compensation technology is used when encoding the current block. Therefore, in the analysis, the decoder can obtain the index information of the target illumination compensation mode used in the encoding of the current block, which is transmitted in the bit stream, so that the decoder can perform illumination compensation. illumination in the current block with the index information of the target illumination compensation mode. In the implementations of the description, when the decoder knows that the IC technology is used, the lighting compensation enabled flag is valid (where the value of the lighting compensation enabled flag represents valid or not). In this case, when the decoder knows that the video stream to which the current block belongs can use IC technology, it needs to further determine whether the illumination compensation frame-level enabled flag corresponding to the current frame to which the block belongs current is valid from the bitstream, and if valid, indicates that the current block can use lighting compensation. Then the decoder needs to further determine whether the lighting compensation usage flag corresponding to the current block is valid from the bitstream, if it is valid, it indicates that the lighting compensation is used for the current block, and if it is not valid , indicates that the current block is allowed to use lighting compensation technology, but lighting compensation is not used for the current block. In the implementations of the disclosure, if lighting compensation is used in encoding, the decoder may obtain the used index information from the target lighting compensation mode of the bitstream. rc} Rnn / eznz / B / YiAi As an example, the decoder may also analyze the current prediction mode and the current motion information used by the encoder. According to the index information of the target illumination compensation mode, the current prediction mode and the current motion information, the decoder performs interprediction on the current block to obtain the prediction value, and then performs the decoding procedure subsequent based on the prediction value. It should be noted that in the description implementation, the flag can be represented by a numeric value, which is not limited in the description implementations. As an example, the lighting compensation enabled flag is '1', indicating that the lighting compensation enabled flag is valid. The lighting compensation enabled flag is '0', indicating that the lighting compensation enabled flag is invalid. The lighting compensation box-level enabled flag is '1', indicating that the lighting compensation box-level enabled flag is valid. The lighting compensation box-level enabled flag is Ό', indicating that the lighting compensation box-level enabled flag is invalid. The lighting compensation use flag is Ί', indicating that the lighting compensation use flag is valid. The lighting compensation use flag is '0', indicating that the lighting compensation use flag is invalid. Alternatively, the lighting compensation enabled flag is '0', indicating that the lighting compensation enabled flag is valid. The lighting compensation enabled flag is '1', indicating that the lighting compensation enabled flag is invalid. The lighting compensation box-level enabled flag is Ό', indicating that the lighting compensation box-level enabled flag is valid. The lighting compensation box-level enabled flag is '1', indicating that the lighting compensation box-level enabled flag is invalid. The lighting compensation use flag is Ό1, indicating that the lighting compensation use flag is valid. The lighting compensation use flag is T, indicating that the lighting compensation use flag is invalid, which is not limited in the implementations of the description. In some implementations of the disclosure, the lighting compensation box level enabled flag includes at least one lighting compensation box level enabled flag. That is, in the implementations of the disclosure, a frame-level illumination compensation enabled flag indicates that illumination compensation technology is enabled for the current image to be encoded (i.e., the current frame), rc} Rnn / eznz / B / YiAi or multiple illumination compensation enabled flags at the frame level indicates that illumination compensation technology is enabled for the current image to be encoded. In the implementations of the disclosure, the at least one flag enabled at the lighting compensation frame level is in one-to-one correspondence with different prediction modes of a current frame, or the at least one flag enabled at the compensation frame level illumination is in a one-to-one correspondence with different regions of the current frame. That is, for different prediction modes or different image regions of a frame, different illumination compensation frame-level enabled flags can be used. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes N levels of lighting compensation box-level enabled flags corresponding to prediction modes. In this case, the decoder obtains the lighting compensation use flag in the bitstream as follows, when the lighting compensation frame-level enabled flag is valid. When an ith level of lighting compensation box-level enabled flag in the N levels of lighting compensation box-level enabled flags is valid, an (i+l)th level of lighting compensation box-level enabled flag illumination compensation box in the bitstream is determined until an Nth enabled flag level is determined at the illumination compensation box level in the bitstream, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 1; and when the (i+ l)-th lighting compensation frame-level enabled flag is invalid, the lighting compensation usage flag is obtained in the bitstream. It should be noted that the decoder can sequentially analyze the bitstream according to the order of the N levels of flags enabled at the lighting compensation frame level. There is a priority relationship on the N levels of lighting compensation box-level enabled flags, and the priorities of the first level of lighting compensation box-level enabled flag to the Nth level of lighting compensation box-level enabled flag lighting compensation are decreasing, where the flag enabled at the first level lighting compensation box level has the highest priority. In this case, when the decoder decodes the lighting compensation box-level enabled flag with high priority, the decoder can continue to parse the subsequent lighting compensation box-level enabled flags according to the priority when the enabled flag a Lighting compensation box level with high priority is valid. That is, when the lighting compensation box-level enabled flag with high priority is determined to be invalid, the subsequent lighting compensation box-level enabled flag rq} Rnn / eznz / B / YiAi is not analyzed. In the implementations of the description, if the lighting compensation technology can be combined with some prediction modes corresponding to the current frame, the first level of the lighting compensation frame-level enabled flag indicates that the lighting compensation technology can be combined with the current frame but the lighting compensation technology is not enabled for all prediction modes, the enabled flag must be obtained at the backlight compensation frame level and the lighting compensation technology is enabled for the corresponding prediction mode in the encoder and decoder according to the bitstream syntax. If the lighting compensation technology is not enabled in the current frame, the first level of the lighting compensation frame-level enabled flag is 'no', and the subsequent flag does not need to be obtained and no codeword exists of the subsequent flag in the bitstream. It should be noted that, if the ith level of lighting compensation box-level enabled flag in the N levels of lighting compensation box-level enabled flags is valid, the (i+l)th level of the lighting compensation box-level flag enabled in the bitstream is determined, and whether the (i+l)th level of the lighting compensation box-level enabled flag is still valid, it continues to be determined. the next level, but if the Nth level of the lighting compensation box-level enabled flag is still valid, the next level is no longer determined because there is no next level. In this procedure, if the (i+l)th level of the flag enabled at the lighting compensation box level is invalid, the next level is no longer determined, but the lighting compensation technology is enabled for the prediction mode corresponding to the ith flag level enabled at the lighting compensation box level, and lighting compensation for which the current block is determined, is used to obtain the lighting compensation usage flag in the flow bits. In some implementations of the disclosure, if the first level of the illumination compensation frame-level enabled flag is invalid, the illumination compensation technology is not enabled for any of the prediction modes of the current frame and therefore Therefore, no lighting compensation is required. In some implementations of the disclosure, the decoder may also directly parse all N levels of lighting compensation box-level enabled flags of the bitstream, which do not have a priority relationship. If any lighting compensation box-level enabled flag level is valid, the lighting compensation mode is enabled for the prediction mode corresponding to that lighting compensation box-level enabled flag level, and can continue determining the lighting compensation usage flag rq} Rnn / eznz / B / YiAi. If invalid, it indicates that the lighting compensation mode is not enabled for the prediction mode corresponding to that enabled flag level at the lighting compensation frame level, and normal decoding can be performed. In some implementations of the disclosure, the prediction mode may include a fusion mode / direct mode, a skip mode, a normal intermode, and the like, and are not limited by the implementations of the disclosure. As an example, when N=3, the first level of the lighting compensation box-level enabled flag corresponds to blend mode / direct mode, a second level of lighting compensation box-level enabled flag corresponds to bypass mode, and a third level lighting flag enabled at the compensation box level corresponds to normal intermode. Understandably, the decoder may determine, according to different prediction modes, a prediction mode for which the lighting compensation technology is enabled and a prediction mode for which the lighting compensation technology is not enabled, and then can filter out at the frame level a part of the codewords of the current frame with illumination compensation technology disabled, which improves decompression efficiency. In some implementations of the disclosure, the decoder may also obtain an image region partition flag by analyzing the bitstream, obtain the M enabled flags at the lighting compensation frame level, when the image region partition flag is valid, and ignore illumination compensation, when the image region partition flag is invalid, where M is a positive integer greater than or equal to 1. It should be noted that the decoder can set different illumination compensation frame-level enabled flags for different image regions of the current frame. In the implementations of the description, the current frame is divided into M image regions. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to image regions. In this case, the decoder obtains the lighting compensation use flag in the bitstream as follows, when the lighting compensation frame-level enabled flag is valid. When a jth lighting compensation box-level enabled flag in the M lighting compensation box-level enabled flags is valid, a (j+l)th lighting compensation box-level enabled flag is determined. illumination in the bitstream until the enabled flag is determined at the illumination compensation box level in the bitstream, where j is rq} Rnn / eznz / B / YiAi a positive integer greater than or equal to 1 and less or equal to M, and M is a positive integer greater than or equal to 1; and when the (j+l)th enabled flag at the lighting compensation frame level is invalid, the lighting compensation usage flag is obtained in the bitstream. It should be noted that the decoder can sequentially analyze the bitstream according to the order of the M flags enabled at the lighting compensation frame level. There is a priority relationship on the M flags enabled at the lighting compensation box level, and the priorities of the first flag enabled at the lighting compensation box level with respect to the Mth flag enabled at the compensation box level are decreasing, where the first flag enabled at the lighting compensation box level has the highest priority. In this case, when the decoder decodes the lighting compensation box level enabled flag with high priority, the decoder can continue to analyze the subsequent lighting compensation box level enabled flags according to the priority when the lighting compensation box level enabled flag Lighting compensation box level with high priority is valid. That is, when the lighting compensation box-level enabled flag with high priority is determined to be invalid, the subsequent lighting compensation box-level enabled flag is not analyzed. In the implementations of the description, if the lighting compensation technology can be combined with some image regions corresponding to the current frame, the first lighting compensation enabled frame-level flag indicates that the lighting compensation technology can be combined with the first image region of the current frame but the illumination compensation technology is not enabled for all image regions, the subsequent illumination compensation frame-level enabled flag must be obtained, and the illumination compensation technology is enabled for the corresponding image region in the encoder and decoder according to the bitstream syntax. If lighting compensation technology is not enabled in the first image region of the current frame, the first flag enabled at the lighting compensation frame level is 'no', and it is not necessary to obtain the subsequent flag and any signal words. Subsequent flag code exists in the bitstream, that is, the illumination compensation technology is disabled for all image regions of the current frame. It should be noted that, if the ith lighting compensation box-level enabled flag in the M lighting compensation box-level enabled flags is valid, the (i+l)th lighting compensation box-level enabled flag lighting compensation in the bitstream is determined, and if the (i+ l)th enabled flag at the rc} Rnn / eznz / B / YiAi lighting compensation box level is still valid, the following continues to be determined, but if the Mth flag enabled at the lighting compensation box level is still valid, the next one is no longer determined because there is no next one. In this procedure, if the (i+l)th flag enabled at the illumination compensation frame level is invalid, the next one is no longer determined, but the illumination compensation technology is enabled for the image region corresponding to the ith lighting compensation frame-level enabled flag, and the lighting compensation for which the current block is determined is used to obtain the lighting compensation usage flag in the bitstream. In some implementations of the disclosure, if the first illumination compensation frame-level enabled flag is invalid, the illumination compensation technology is enabled for none of the image regions of the current frame and therefore is not requires lighting compensation. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to image regions. In this case, the decoder obtains the lighting compensation use flag in the bitstream as follows, when the lighting compensation frame-level enabled flag is valid. The lighting compensation use flag in the bitstream is obtained when any of the M flags enabled at the lighting compensation frame level are valid. In some implementations of the disclosure, the decoder may also directly parse all M enabled flags at the bitstream illumination compensation frame level, which do not have a priority relationship. If any lighting compensation box-level enabled flag is valid, it indicates that the lighting compensation mode is enabled in the region of the image corresponding to that lighting compensation box-level enabled flag, and you can proceed. determining the lighting compensation use flag. If invalid, it indicates that the illumination compensation mode is not enabled in the image region corresponding to that illumination compensation enabled frame-level flag, and normal decoding can be performed. In some implementations of the disclosure, lighting compensation is ignored or not performed if the first flag enabled at the lighting compensation box level is invalid. Understandably, the decoder may determine, according to different image regions of the current frame, image regions for which the illumination compensation technology is enabled and image regions for which the illumination compensation technology is not enabled, and then it can filter out from the frame level a portion of rq} Rnn / eznz / B / YiAi codewords from image regions with illumination compensation technology disabled, thus improving decompression efficiency. In some implementations of the description, under the premise that the lighting compensation function or lighting compensation technology is enabled for the current frame, when decoding the current block, the decoder can directly decode the current block or divide the block current to obtain at least two subblocks corresponding to at least two regions and decode the at least two subblocks sequentially. Implementations of the description are not limited. In some implementations of the disclosure, the decoder may perform lighting compensation in the current block based on the index information of the target lighting compensation mode as follows. For the at least two subblocks, the reconstructed samples of a current frame and the reconstructed reference samples of a reference frame are determined based on the index information of the target illumination compensation mode. An h-th model parameter corresponding to an h-th region is determined based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, where h is a positive integer greater than or equal to 1 and less than the number of the at least two subblocks. Illumination compensation is performed in the h-th region based on the parameter of the h-th model, to obtain a prediction block of the h-th region. Lighting compensation is performed in an (h+l)th region until lighting compensation is completed in at least two subblocks. It should be noted that, in the implementations of the disclosure, there may be three illumination compensation modes: a top left illumination compensation mode (IC_TL), a top illumination compensation mode (IC_T), and a left illumination compensation mode. (IC_L). The lens illumination compensation mode index information corresponds to the top illumination compensation mode left (IC_TL), the top illumination compensation mode (IC_T), and the illumination compensation left mode (IC_L). The top left illumination compensation mode, the top illumination compensation mode, and the left illumination compensation mode are determined by neighboring edge samples at different positions. According to the index information of the target lighting compensation mode, the decoder can determine the lighting compensation mode, so that the neighboring edges used in this lighting compensation mode can be determined, to determine the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame. Each subblock is sequentially subjected to illumination compensation at least based on the reconstructed samples of the current frame and the reconstructed reference rp} «nn / eznz / B / YiAi samples of the reference frame. In implementations of the description, the at least two subblocks may have a processing order, for example, the subblock in the upper left region is processed first, the subblock in the upper right region is processed next, and then the subblock in the lower right region, etc. Implementations of the description are not limited. The decoder can determine the h-th model parameter corresponding to the h-th region according to the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, construct the h-th corresponding target illumination compensation mode to the h-th region with the h-th model parameter, and perform illumination compensation in the h-th region using the h-th target illumination compensation mode, to obtain the illumination prediction value of the h-th region. th region prediction block of the th region. Continue performing lighting compensation in the next region until lighting compensation is completed in at least two subblocks. Understandably, in the decoding procedure of the current block, under the premise of realizing the lighting compensation function in the current block (that is, when the lighting compensation use flag of the current block is valid), the decoder can realize the block region partition in the current block, to obtain at least two sub-blocks, calculate the target lighting compensation mode corresponding to each sub-block, and then perform lighting compensation based on the respective target lighting compensation mode. As such, the target illumination compensation mode is determined for each sub-block and the corresponding processing can be performed in different sub-blocks, thereby improving the decoding accuracy and decoding performance. It should be noted that when the decoder calculates the linear model parameters (that is, the model parameters), it can divide the current block into multiple regions of specified size, and the linear model parameters are respectively calculated and applied to the corresponding regions . In some implementations of the disclosure, the decoder determines the h-th model parameter corresponding to the h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame in at least one of the following ways . Way 1 When there exists an h-th neighbor reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the h-th neighbor reconstructed reference sample and the reconstructed samples of the hth region into the reconstructed samples of the current frame. rc} Rnn / eznz / B / YiAi When h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the neighboring samples in a (h-l)-th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. It should be noted that the reference samples used by the decoder to calculate the linear model can be the neighboring reconstructed samples (or neighboring reconstructed reference samples) corresponding to each region. If there is no neighboring reconstructed sample corresponding to the region, the prediction samples (region prediction block) after illumination compensation in the neighboring region of the block can be used for linear model calculation. As an example, if the current coding unit has a size of 32x32, the current coding unit is divided into four 16x16 sample regions, and for each 16x16 sample region, the linear model is calculated and the linear compensation. Way 2 When h is not equal to 1 and there exists an h-th neighboring reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the h -th reference neighbor reconstructed sample, neighbor samples in a first region prediction block to an (h-1)th region prediction block, and h-th region reconstructed samples in the reconstructed samples of the current frame . When h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the neighboring samples in the first region prediction block for the (h-l)th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. It should be noted that in lighting compensation technology, when calculating the parameters of the linear model, the current block can be divided into several regions of specific sizes, where the pixel inheritance relationship is allowed. By determining the neighboring reconstructed reference samples in the next region, the neighboring reconstructed reference samples of the current block or the neighboring reference samples of the neighboring subblock of the current subblock in the current block (that is, the samples in the prediction block region from the previous region) can be used. If the current subblock has neighboring reconstructed reference samples, the model parameters corresponding to the current subblock are calculated with the neighboring reconstructed reference samples, but if the current subblock does not have neighboring reconstructed reference samples, the model parameters corresponding to the current subblock is calculated with rp} Rnn / eznz / B / YiAi the samples in the region prediction block of the previous region. As an example, if the current block has a size of 32x32, the current block is divided into four 16x16 sample regions. Assuming that lighting compensation is performed on the top left 16x16 sample region 1 and then lighting compensation is performed on the top right 16x16 sample region 2, the top right 16x16 sample region can use all samples prediction and the neighboring reconstructed samples of the top left and top right 16x16 sample regions for the calculation of the linear lighting compensation model. In some implementations of the disclosure, if the current subblock has neighboring reconstructed reference samples, the model parameters corresponding to the current subblock are calculated with the neighboring reconstructed reference samples and samples from at least one of the region prediction blocks of the anterior region. If the current subblock does not have a neighboring reconstructed reference sample, the model parameters corresponding to the current subblock are computed with the samples from at least one of the prediction blocks in the region of the previous region. The number of at least one region prediction block is not limited, which can be global or local. It should be noted that when h is 1, there is no pixel inheritance relationship of the current block. The first parameter of the model is calculated based on the first neighboring reconstructed reference sample and the reconstructed samples of the first region between the reconstructed samples of the current frame. Mode 3 After the decoder determines the h-th model parameter corresponding to the h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, when h is not equal to 1, at least one of a first model parameter to a (h-l)-th new model parameter is weighted with the h-th model parameter, to obtain an h-th new model parameter, and the illumination compensation is performed on the h -th region based on the h-th parameter of the new model, to obtain the h-th region prediction block. It should be noted that in lighting compensation technology, when calculating linear model parameters, the current block can be divided into several regions of specific sizes, where the inheritance relationship of model parameters is allowed. When calculating the model parameters in the next region, the model parameters can be calculated in way 1 or way 2, and then weighted together with at least one of the model parameters calculated in the previous region (which can be parameters of the model calculated directly in way 1 and way 2 or new model parameters obtained by weighting with the region ΑΓ} Αηη / Γζηζ / Β / ΥΙΛΙ above), to obtain the final model parameters, that is, the new model parameters. It should be noted that if h is 1, the first parameter of the model is also the first parameter of the new model. In implementations of the disclosure, the weight information for weighting may be that: the weight of the model parameter calculated using the current subblock is the largest, and the weight of the model parameter calculated using the subblock adjacent to the current subblock is the second. in importance, that is, the weight distribution depends on the degree of relevance with the current subblock, and the more relevant, the greater the weight. The weight distribution is not limited in the implementations of the description. As an example, if the current block has a size of 32x32, the current block is divided into four 16x16 sample regions. When lighting compensation is performed on the top right 16x16 sample region 2, the information after lighting compensation can be queried. For example, the top right 16x16 sample region 2 can reference the linear parameters of the top left 16x16 sample region 1 after computing the linear parameters with only its prediction samples and neighboring samples. Simply, operations such as weighting can be performed, and new linear model parameters can be obtained and applied to the top right 16x16 sample region 2 to compensate for illumination. When the new model parameters are calculated in sample region 2, the model parameters al and bl calculated in sample region 1 are inherited with the parameters a?and b2 calculated in sample region 2, and al and a2 are are weighted to obtain a final of sample region 2, and bl and b2 are weighted to obtain bfinal of sample region 2. It should be noted that the model parameters include the scale factor <?and the displacement factor b. In some implementations of the description, the decoder obtains a block region partition flag, when parsing the bitstream, it splits the current block to obtain at least two subblocks, when the block region partition flag is valid; and calculates a block model parameter of the current block, when the block region partition flag is invalid. It should be noted that the block region partitioning flag can be provided, or the block partition can be performed directly by default without passing the flag, to reduce the code words, which is not limited in the implementations of the description. In implementations of the description, the decoder calculates the parameters of the linear model not by partitioning the region in the current block, but rather it calculates the parameters rc i Rnn / eznz / B / YiAi of the model as a whole, that is, it calculates the block model parameters of the current block (in the case of lighting compensation). It should be noted that the left upper illumination compensation mode, the upper illumination compensation mode, and the left illumination compensation mode are all obtained by the model principle illustrated in formula (1). However, the neighboring edges of the reconstructed reference samples of the reference frame and the reconstructed samples of the current frame that are used are different to obtain the model parameters, that is, the scale factor and the displacement factor, of the top left illumination compensation, the top illumination compensation mode and the left illumination compensation mode. The top left lighting compensation mode mainly uses the top neighbor and the left neighbor, the top lighting compensation mode uses the top neighbor, and the left lighting compensation mode uses the left neighbor. In some implementations of the disclosure, the decoder determines the target illumination compensation mode with the index information of the target illumination compensation mode as follows. According to the index information of the target lighting compensation mode, the decoder determines the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame. Based on the reconstructed samples of the current block of the current frame and the reconstructed reference samples of the reference frame, the model parameters of the target illumination compensation mode are determined, and then the target illumination compensation mode is determined. In some implementations of the disclosure, the decoder determines the target lighting compensation mode based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame as follows. Based on the top reconstructed samples and the left reconstructed samples of the current block of the current frame and the top reconstructed reference samples and the left reconstructed reference samples of the reference frame at the same corresponding sample positions, it is determined that the Lens illumination compensation is the top left illumination compensation mode. Alternatively, based on the top reconstructed samples of the current block of the current frame and the top reconstructed reference samples of the reference frame at the same corresponding sample positions, the target illumination compensation mode is determined to be the illumination compensation mode. superior lighting. Alternatively, based on the reconstructed samples to the left of the current block of the current frame and the reconstructed reference samples to the left rq} Rnn / eznz / B / YiAi of the reference frame at the same corresponding sample positions, it is determined that The target illumination compensation mode is the left illumination compensation mode. In some implementations of the disclosure, the top reconstructed samples of the current frame include at least a first sample of a neighboring reconstructed block of a top row of the current block in the current frame. Reconstructed samples to the left of the current frame include at least a second sample from a neighboring reconstructed block of a left column of the current block in the current frame. The top reconstructed reference samples of the reference frame include at least a third sample from a neighboring reconstructed block of a top row of the initial prediction block in the reference frame, or at least a fourth sample from the Nth row in the reference frame. initial block prediction in the reference box, where N is a positive integer greater than or equal to 1 and less than the number of rows in the current block. Reconstructed reference samples to the left of the reference frame include at least a fifth sample from a neighboring reconstructed block of a left column of the initial prediction block in the reference frame, or at least a sixth sample from the M-th column in the initial prediction block in the reference box, where M is a positive integer greater than or equal to 1 and less than the number of columns in the current block. For example, as illustrated in Figure 9, in the lighting compensation mode IC_T, the fifth sample of the reconstructed neighbor block of the top row is used in the current frame, and the fifth sample of the reconstructed reference neighbor block of a certain row in the reference box is also used in the current box. For example, as illustrated in Figure 10, in the lighting compensation mode IC_L, the first sample of the reconstructed neighbor block of the left column is used in the current frame, and the first sample of the reference reconstructed neighbor block of the left column is also used in the reference chart. For example, as illustrated in Figure 11, when the motion information compensation is completed, the prediction block after motion compensation is obtained and the illumination compensation is performed. In the IC_T lighting compensation mode, the fifth sample of the reconstructed neighbor block of the top row and the fifth prediction sample of a given row of the prediction block are used in the current frame. In the implementations of the description, samples of a certain row or a certain column in the reference block can be combined with the reference frame. That is, in some implementations of the disclosure, in the lighting compensation technology, the obtained position and the number of reconstructed reference samples in the reference frame may be any position in the reference block in the reference frame and a integer greater than 0, such as the first row and / or the first column in the reference block pointed to by rc} Rnn / eznz / B / YiAi the motion information, which is not limited in the implementations of the description. Furthermore, the obtained position and the number of reconstructed samples in the current frame must be consistent with the obtained position and the number of reconstructed samples in the reference frame. It should be noted that if the current block is split, the reconstructed samples of the current block refer to the reconstructed samples of the sub-block when calculating the model parameters of each sub-block. It can be understood that, in the current block coding procedure, when using lighting compensation technology, the decoder determines which lighting compensation mode is used for lighting compensation from the upper left lighting compensation mode, the top illumination compensation mode, and the left illumination compensation mode through the index information of the target illumination compensation mode parsed from the bitstream. In this procedure, because the top left illumination compensation mode, the top illumination compensation mode and the left illumination compensation mode are determined by neighboring edge samples at different positions, which is considered based on different neighboring edges, different lighting compensation modes can be used for lighting compensation. Therefore, in the case of a large difference of samples from different neighboring edges, different sample positions may correspond to different lighting compensation models, and different lighting compensation models can be selected for the current block prediction procedure. , which can improve the decoding accuracy. In some implementations of the disclosure, the decoder may obtain current motion information and a current prediction mode, by analyzing the bit stream, and predict the current block according to the index information of the target lighting compensation mode, the current prediction mode and the current motion information, to obtain a prediction value. In some implementations of the description, the decoder may determine an initial prediction block corresponding to the current block based on the current motion information, perform motion compensation on the initial prediction block, to obtain a first prediction block, determine a model parameter with the target illumination compensation mode information index, perform illumination compensation in the first prediction block with the model parameter, to obtain a second prediction block, and perform interprediction in the second block prediction with the current prediction mode, to obtain the prediction value. In some implementations of the disclosure, the decoder performs rq} Rnn / eznz / B / YiAi interprediction in the current block according to the target illumination compensation mode index information, the current prediction mode, and the target illumination compensation mode index information. current movement, to obtain the prediction value in the following three ways. Way 1 The decoder determines the target illumination compensation mode with the index information of the target illumination compensation mode, determines the initial prediction block corresponding to the current block based on the current motion information, performs motion compensation in the initial prediction block to obtain the first prediction block, perform illumination compensation in the first prediction block with the target illumination compensation mode, to obtain the second prediction block, and perform interprediction in the second prediction block. prediction with the current prediction mode, to obtain the prediction value. Way 2 The decoder determines the target illumination compensation mode with the index information of the target illumination compensation mode, determines the initial prediction block corresponding to the current block based on the current motion information, performs illumination compensation in the initial prediction block with the target illumination compensation mode, to obtain the third prediction block, perform motion compensation in the third prediction block, to obtain the fourth prediction block, and perform interprediction in the fourth block prediction with the current prediction mode, to obtain the prediction value. Way 3 The decoder determines the initial prediction block corresponding to the current block based on the current motion information, performs motion compensation in the initial prediction block, to obtain the first prediction block, determines the target illumination compensation mode with the index information of the target illumination compensation mode, perform illumination compensation in the first prediction block with the target illumination compensation mode, to obtain the second prediction block; and performs an interprediction in the second prediction block with the current prediction mode, to obtain the prediction value. The decoder may first determine the illumination compensation mode of the target, and the procedure of performing illumination compensation based on the illumination compensation mode of the target may be before or after motion compensation. In way 1, lighting compensation is done after motion compensation, and in way 2, lighting compensation is done before motion compensation, which is not limited to implementations of the description. In the implementations of the disclosure, when the decoder calculates the illumination compensation mode of the target, the reconstructed reference sample used from the reference block of the reference frame may be the sample before motion compensation or the sample after motion compensation. motion compensation. In way 3, the reconstructed reference sample of the reference block of the reference frame is the sample after motion compensation, and in way 1, the reconstructed reference sample of the reference block of the reference frame is the sample before motion compensation, which is not limited in the implementations of the description. Understandably, if lighting compensation is performed before motion compensation, the hardware implementation difficulty and implementation complexity can be reduced, while if lighting compensation is performed after motion compensation, the effect of encoding and decoding can be better. In some implementations of the disclosure, the lens illumination compensation mode index information includes first index information and second index information. In the implementations of the description, the decoder may determine the neighbor edge used for calculation of the target lighting compensation mode model according to the index information of the target lighting compensation mode, and then directly solve the scaling factor and the corresponding displacement factor according to formulas (2) - (4), and finally substitute into formula (1) to obtain the target lighting compensation mode. In some implementations of the disclosure, the decoder determines which lighting compensation mode to use when the lighting compensation use flag of the current block is valid. When the lighting compensation use flag of the current block is invalid, lighting compensation is not used. In the implementation of the descriptions, the decoder determines the target illumination compensation mode with the index information of the target illumination compensation mode in the following two ways. Way 1 If the first index information is invalid, the lens illumination compensation mode is determined to be the top left illumination compensation mode. If the first index information is valid and the second index information is invalid, the illumination compensation mode of the lens is determined to be the upper illumination compensation mode. If the first index information is valid and the second rq} Rnn / eznz / B / YiAi index information is valid, the illumination compensation mode of the target is determined to be the left illumination compensation mode. Way 2 If the first index information is valid, the illumination compensation mode of the lens is determined to be the upper left illumination compensation mode. If the first index information is invalid and the second index information is invalid, the illumination compensation mode of the lens is determined to be the upper illumination compensation mode. If the first index information is invalid and the second index information is valid, the illumination compensation mode of the lens is determined to be the left illumination compensation mode. It should be noted that the decoder uses different representations of the first index information and the second index information to incorporate the three lighting compensation modes. As an example, the syntax of keyword transmission during lighting compensation is illustrated in Table 1. rq} Rnn / eznz / B / YiAi TABLE 1 ICJindex IC_flag ICJindexO ICJindexel NoJC 0 - - IC_TL 1 0 - IC_T 1 1 0 IC_L 1 1 1 IC_index is the lighting compensation mode type, including IC_TL, IC_T and IC_L, and IC_flag represents the lighting compensation use flag, where ICJndiceO is the first index information and ICJndicel is the second index information. The syntax logic in Table 1 is described below with '1' as valid and '0' as invalid. In implementations of the description, for Table 1, if the lighting compensation use flag is invalid, there is no lighting compensation mode available. Only when the lighting compensation use flag is valid, if ICJndiceO is invalid, the target lighting compensation mode is determined to be IC_TL; if ICJndiceO is valid and ICJndicel is invalid, the illumination compensation mode of the target is determined to be IC_T; if ICJndiceO is valid and ICJndicel is valid, the illumination compensation mode of the target is determined to be IC_L. It should be noted that in addition to the above two, the exchange of the index information of the target illumination compensation mode IC_L and the target illumination compensation mode IC_T may also be feasible, or '0' denoting valid and ' 1' denoting invalid it is also feasible to perform the above determination logic, which is not limited in the implementations of the description. As an example, the interprediction is described with '1' representing valid and '0' representing invalid. The decoder obtains the bitstream and analyzes the bitstream to obtain the illumination compensation enabled flag of the current video stream. In the inter-prediction decoding procedure, if the lighting compensation enabled flag is '1', the lighting compensation box-level enabled flag of the current frame is analyzed, and if the lighting compensation box-level enabled flag of lighting is Ί', all the following steps are performed, and if the lighting compensation enabled flag is '0' or the lighting compensation box-level enabled flag is Ό', only steps a), b are performed ), d) and f). a) The bit stream is obtained and decoded to obtain residual information, and the residual information in the time domain is obtained by inverse transformation and inverse quantization. b) The bitstream is parsed to obtain the interprediction mode and MV Index of the current decoding block. c) The bitstream is analyzed to obtain the IC usage flag of the current decoding block. Taking the syntax in Table 1 as an example, if the IC usage flag of the current decoding block is true, continue parsing the bitstream to obtain the first index flag of the lighting compensation mode of the current decoding block; Otherwise, the lighting compensation technology is not used for the current encoding unit. If the first lighting compensation mode index flag is 'true', continue analyzing the second lighting compensation mode index flag; otherwise, the illumination compensation mode index is set to 1, indicating that the first linear illumination compensation mode IC_TL is used (the top and left reconstructed samples can be used for linear compensation model calculation of lighting). If the second lighting compensation mode index flag obtained by analysis is 'true', the lighting compensation mode index is set to 3, indicating that the third linear lighting compensation mode IC_L is used ( only the reconstructed samples on the left can be used for the calculation of the linear illumination compensation model), otherwise the illumination compensation mode index is set to 2, indicating that the second linear mode of illumination is used. illumination compensation IC_T (only the top reconstructed samples can be used for the calculation of the linear illumination compensation model). According to the obtained illumination compensation mode index rq} Rnn / eznz / B / YiAi, the reconstructed samples at the corresponding positions are obtained, to calculate the parameters of the linear model and obtain the scale factor a and the displacement factor b. d) Motion compensation is performed in the current decoding block, to obtain the prediction block. e) If the lighting compensation use flag is not Ό', that is, lighting compensation must be performed in the current prediction block, all samples in the current prediction block are linearly compensated according to the scale a and the displacement factor b obtained in c), to obtain the final prediction block. f) The final prediction block is added to the residual information restored in a), to obtain the reconstructed block of the current coding unit, which is output after post-processing. Understandably, the index information of the lens illumination compensation mode only occupies two code words, which can save the bit stream. It should be noted that in the linear model parameter calculation procedure, all sample values are sorted, and then the maximum value and minimum value, and the average value of the two largest values and the average value are removed. From the two smallest values are obtained; or the points are taken at intervals, such as the first point and the second to last point on the top and the first point and the second to last point on the left, and then sorted, and the average value of two largest values and the average value smaller values are obtained from two; The subsequent calculation steps are consistent with the above. In some implementations of the disclosure, the at least one first sample is samples spaced by a preset spacing sample position in a neighboring reconstructed block of a top row of the current block. The at least one second sample is samples separated by the preset spacing sample position in a neighboring reconstructed block of a left column of the current block. The at least one third sample is samples separated by the preset spacing sample position in a neighboring reconstructed reference block of a previous row of the initial prediction block. The at least one fourth sample is samples separated by the preset spacing sample position in samples of the Nth row in the initial prediction block. The at least a fifth sample are samples separated by the preset spacing sample position in a reconstructed reference block neighboring a left column of the initial prediction block. The at least one sixth sample is samples separated by the preset spacing sample position in samples of the M-th column in the initial prediction block. In the implementations of the disclosure, in the procedure of calculating a and Z?of the target lighting compensation mode by the decoder, all sample values are rq} Rnn / eznz / B / YiAi sorted and then the maximum value is removed and the minimum value, and the average value of the two largest values, the values and the average value of the two smallest values are obtained, that is, consistent with the description in the previous implementations. Alternatively, the decoder takes points at interval sample positions, such as the first point and the second to last point on the top and the first point and the second to last point on the left, and then they are sorted and the average value of two large values and the average value of two smaller values, and then a and b are calculated according to formulas (2) - (4), to obtain the target lighting compensation mode of formula (1). See the following. In some implementations of the disclosure, the decoder determines that the target illumination compensation mode is the top left illumination compensation mode based on the top reconstructed samples and the left reconstructed samples of the current frame, and the top and reconstructed reference samples. The reconstructed left reference samples of the reference frame at the same corresponding sample positions as follows. At least one first sample value of at least one first sample and at least one second sample value of at least one second sample are sorted to determine first n largest first sample values and first n smallest first sample values, where n is a positive integer greater than or equal to 1 and less than the number of columns and the number of rows in the current block. At least a third sample or at least a fourth sample, and at least a fifth sample or at least a sixth sample, are sorted to determine the first n largest second sample values and the first n smallest second sample values. . A first maximum average of the first n largest values of the first sample, a first minimum average of the first n smallest values of the first sample, a second maximum average of the first n largest values of the second sample, and a second minimum average From the first n smallest values of the second smallest sample are determined. A first scale factor and a first shift factor are determined based on the first maximum average, the first minimum average, the second maximum average, and the second minimum average. The top left illumination compensation mode is determined based on the first scale factor, the first shift factor and an initial top left illumination compensation mode, where the top left illumination compensation mode is the illumination compensation mode aim. In some implementations of the disclosure, the decoder determines that the target illumination compensation mode is the top illumination compensation mode based on the top reconstructed samples of the current frame and the top reconstructed reference samples of the reference frame at the same positions. sample rq} Rnn / eznz / B / YiAi corresponding as follows. At least one first sample value of at least one first sample is sorted to determine the first m largest third sample values and the first m smallest third sample values, where m is a positive integer greater than or equal to 1 and less than the number of columns and the number of rows of the current block. The at least one third sample or the at least one fourth sample is classified to determine the first m largest fourth sample values and the first m smallest fourth sample values. A third maximum average value of the first m largest third sample values, a third minimum average value of the first m smallest third sample values, a fourth maximum average value of the first m largest fourth sample values , and a fourth minimum average value of the first m smallest values of the fourth sample. A second scale factor and a second shift factor are determined based on the third maximum average, the third minimum average, the fourth maximum average, and the fourth minimum average. The top illumination compensation mode is determined based on the second scale factor, the second offset factor, and an initial top illumination compensation mode, where the top illumination compensation mode is the target illumination compensation mode. In some implementations of the disclosure, the decoder determines that the target illumination compensation mode is the left illumination compensation mode based on the left reconstructed samples of the current frame and the left reconstructed reference samples of the reference frame at the same positions. corresponding sample samples as follows. At least one second sample value from at least one first sample is sorted to determine the first h largest fifth sample values and the first h smallest fifth sample values, where h is a positive integer greater than or equal to 1 and less than the number of columns and the number of rows of the current block. At least a fifth sample or at least a sixth sample is classified to determine the first h largest sixth sample values and the first h smallest sixth sample values. A fifth maximum average of the first h largest fifth sample values, a fifth minimum average of the first h smallest fifth sample values, a sixth maximum average of the first h largest sixth sample values and a sixth Minimum average of the first h smallest sixth sample values are determined. A third scale factor and a third shift factor are determined based on the fifth maximum average, the fifth minimum average, the sixth maximum average, and the sixth minimum average. Based on the third scale factor, the third shift factor and an initial left illumination compensation mode, the left illumination compensation mode is determined, where the left illumination compensation mode is ΑΓ} Αηη / Γζηζ / Β / ΥΙΛΙ the target illumination compensation mode. In some implementations of the disclosure, the above illumination compensation is applied to any position in the implementation stream of bidirectional optical flow (BDOF / BIO), decoder lateral motion vector refinement (DMVR), biprediction with CU level weights (BCW), bidirectional gradient correction (BGC), inter-prediction filtering (INTERPF) or combined inter- and intra-prediction (CIIP). Illumination compensation technology can be applied to any position of other technologies such as BDOF / BIO, DMVR, BCW, BGC, INTERPF or CIIP. For example, lighting compensation technology is applied before BDOF / BIO and BCW technology, etc., which is not limited in the implementations of the description. In some implementations of the disclosure, processing of at least one of BDOF / BIO, DMVR, BCW, BGC, INTERPF, or CIIP and lighting compensation are not applied to the same current block. Lighting compensation technology is not applied to the same current block along with other technologies. If IC technology is used for the current block, the current block is no longer modified / refined and compensated using BDOF / BIO. Implementations of the description are not limited. In some implementations of the disclosure, the top left lighting compensation mode includes a luminance top left lighting compensation mode, a first chrominance top left lighting compensation mode, and a second chrominance top left lighting compensation mode. . The toplight compensation mode includes a luminance toplight compensation mode, a first chrominance toplight compensation mode, and a second chrominance toplight compensation mode. The left illumination compensation mode includes a luminance left illumination compensation mode, a first chrominance left illumination compensation mode, and a second chrominance left illumination compensation mode. In the implementations of the description, for the lighting compensation technology, it is necessary to recalculate the linear model for different color components. For example, for the YUV color space, the linear model corresponding to each of the three color components Y, U, and V must be calculated. It should be noted that the current CU may restrict the minimum area and maximum area for IC technology. In some implementations of the disclosure, the current block size ranges from 64 pixels to 128 x 128 pixels. rc} Rnn / eznz / B / YiAi Implementations of the description are not limited to a specific area. The lighting compensation technology uses the area limit or width and height limit at the coding unit level, for example, the minimum area is 64 and the maximum area is 128 x 128. In some implementations of the disclosure, the decoder may parse the bitstream to obtain a frame-level illumination compensation enabled flag of the current frame, use the frame-level illumination compensation enabled flag as the frame-level illumination compensation enabled flag. illumination and then perform the decoding procedure. In lighting compensation technology, a frame level switch is added, and the decoder obtains the frame level switch and determines whether to continue to obtain the lighting compensation use flag at the current frame coding unit level and the lighting compensation mode index information. In some implementations of the disclosure, the decoder may parse the bitstream to obtain a frame-level prediction mode illumination compensation enabled flag of the current frame, use the frame-level prediction mode illumination compensation enabled flag frame as lighting compensation enabled flag, and then perform the decoding procedure. In the implementations of the description, the decoder adds a frame-level flag specific to the normal interprediction mode or SKIP, MERGE (DIRECT), which is used to limit the use of the illumination compensation technology in some of the modes prediction modes, but is not limited to these, and there may also be other specific prediction modes, which can be determined according to the actual configuration. In some implementations of the disclosure, the top-left illumination compensation mode includes multiple sub-top-left illumination compensation modes, and the multiple sub-top-left illumination compensation modes are applied to different sample regions of the initial prediction block. The top illumination compensation mode includes multiple secondary illumination compensation modes, and the multiple secondary illumination compensation modes are applied to different sample regions of the initial prediction block. The left illumination compensation mode includes multiple sub-left illumination compensation modes, and the multiple sub-left illumination compensation modes are applied to different sample regions of the initial prediction block. It should be noted that multiple linear models can be solved in a coding unit block and applied to different regions in the current block, so that a block can select the lighting compensation mode based on its own characteristics and make the compensation lighting is more suitable for its own characteristics, rp} Rnn / eznz / B / YiAi thus improving the decoding accuracy. As an example, the decoding portion of interprediction provides selection for interprediction in operations that require lighting compensation or local linear transformation. For the region with obvious luminance changes between the current frame and the reference frame, the linear transformation model can be calculated using illumination compensation technology. After performing illumination compensation in the current coding block, the prediction block will be closer to the original image block, which will reduce the residual error and finally improve the coding efficiency. The lighting compensation method of the disclosure will be understood to provide selection for interprediction or the like in operations requiring lighting compensation or local linear transform or the like. For the region with obvious luminance changes between the current frame and the reference frame, the linear transformation model can be calculated using illumination compensation technology. After compensation is performed on the current coding block, the prediction block will be closer to the original image block, making the residual error smaller and finally improving the coding efficiency. The lighting compensation method in the description was tested on AVS's official HPM10.0 simulation platform. After integrating and enabling the IC technology, for 4K, 1080P and 720P classes, the test results were illustrated in Table 2 under the random access and low delay test conditions. Table 2 illustrates the results under the random access testing condition. rc} Rnn / eznz / B / YiAi TABLE 2 Class Y U V 4K -0.02% -0.33% -0.08% 1080P -0.38% -0.00% -0.24% 720P -0.73% -0.48% -0.26% Average performance -0.38% -0.27% -0.14% Under the random access test condition, the luma component saves 0.38% BDBR and the UV components respectively saves 0.27% and 0.14% BDBR, which can obviously show high performance and effectively improve the decoding efficiency of the decoder. Secondly, under the low delay test condition, the luma component and UV components also save BDBR, which can obviously show high performance and effectively improve the coding efficiency of the encoder. From the application point of view, the low delay test condition mainly faces applications such as live broadcast industry and public service video. In the era of well-developed Internet, this technology will effectively reduce the bit rate and bandwidth. It should be noted that the lighting compensation of the implementations of the description can also be applied to non-rectangular block interprediction technology, that is, the lighting compensation technology is used in geometric partition mode (GPM) in VVC and technology. Angular Weighted Prediction (AWP) in AVS. After the decoder combines the motion-compensated prediction blocks of two reference frames in some way to obtain a new prediction block, lighting compensation technology can be used for prediction compensation. Some of the above ways can take prediction samples from non-rectangular regions of different prediction blocks, respectively, to combine them. That is, for the current block, a second sub-prediction block is obtained by combining a non-rectangular region of a first sub-prediction block specified by a motion information and a complementary non-rectangular region of the first prediction block specified by another motion information. . The prediction technology between non-rectangular blocks can be GPM in VVC, AWP in AVS, inter-inter in AV, etc., which are not limited here. Illumination compensation is performed in the second sub-prediction block with the target illumination compensation mode, to obtain the target prediction block, which is the final prediction block of the current block. In some implementations of the disclosure, in the lighting compensation method, a flag may be added to the group of pictures (GOP), that is, a picture set level lighting compensation enabled flag, which is used to indicate whether lighting compensation technology is enabled for the current GOP. The picture set level illumination compensation enabled flag must be signaled in the bitstream, which is analyzed in the decoder. If the illumination compensation enabled flag is valid, the image set level illumination compensation enabled flag is obtained in the bitstream. If the picture set level illumination compensation enabled flag is valid, the illumination compensation frame level enabled flag is obtained in the bitstream. For example, in a specific configuration, the video has 500 frames, 25 frames of the 500 frames are an image set, and each frame with an image set-level enabled flag of 1 has an image-level enabled flag of 1. frame, that is, a lighting compensation frame-level enabled flag, which can further save bitstream overhead. In some implementations of the disclosure, the illumination compensation method may be combined with affine transform prediction technology, such as AFFINE and rq} Rnn / eznz / B / YiAi prediction refinement with optical flow for affine (PROF), which is an improvement of AFFINE, in WC, AFFINE, AFFINE_UMVE (last motion vector expression) and affine secondary prediction (ASP, similar to PROF in VVC) in AVS and other technologies. That is, the decoder performs lighting compensation in the prediction block, that is, the reference block after affine motion compensation according to the affine transformation parameters. In implementations of the disclosure, when analyzing the bitstream, the decoder obtains a current affine transformation parameter, performs affine motion compensation on the current block based on the current affine transformation parameter, to obtain a third prediction block, determines a model parameter with the index information of the target illumination compensation mode, and performs illumination compensation in the third prediction block with the model parameter, to obtain a fourth prediction block. The fourth prediction block is the final prediction block of the current block. In the implementation of the description, by analyzing the bitstream, the decoder obtains modified / refined motion information, performs motion compensation on the current block based on the modified / refined motion information, to obtain a fifth block of prediction, determines a model parameter with the index information of the target illumination compensation mode, and performs illumination compensation in the fifth prediction block with the model parameter, to obtain a sixth prediction block. The sixth prediction block is the final prediction block of the current block. The modified / refined motion information is determined by any of the final motion vector expression, the enhanced temporal motion vector prediction, the angular motion vector prediction, or the motion vector difference. In the implementations of the disclosure, the illumination compensation method can be combined with any technology to modify / refine the MV, such as Blending Mode with MVD (MMVD) in VVC and Final Motion Vector Expression (UMVE), enhanced temporal motion vector prediction (ETMVP) and motion vector angular prediction (MVAP) in AVS and other technologies. That is, the decoder performs lighting compensation in the prediction block, that is, the modified / refined / improved reference block of MV after motion compensation. Understandably, in the current block decoding procedure, in the case of using lighting compensation technology, the decoder can directly obtain the lighting compensation frame-level enabled flag at the frame level of the bitstream, to so that the decoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only if the lighting compensation frame-level enabled flag is rc} Valid Rnn / eznz / B / YiAi, a CU level flag can be obtained in the bitstream, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmit bits of the bitstream will be greatly reduced. Therefore, when illumination compensation is selected for a frame-level image based on different situations, a frame-level illumination compensation enabled flag is added to represent whether the illumination compensation technology is used. lighting compensation, to save coding bit overhead and improve coding performance. Implementations of the disclosure provide a lighting compensation method, which is applied to a video encoding device, i.e., an encoder. The function of the method may be achieved by invoking program codes by a second processor in the video encoding device, and the program codes may be stored on a computer storage medium. It can be seen that the video encoding device includes at least the second processor and a second storage medium. Figure 12 is a schematic flowchart of a lighting compensation method of the implementation of the disclosure. As illustrated in Figure 12, the method includes the following. S201, a lighting compensation frame-level enabled flag is determined based on the luminance information of a current frame. S202, a lighting compensation function is enabled for the current frame, and lighting compensation is performed in a current block of the current frame, to obtain a lighting prediction value, when the compensation frame-level enabled flag of lighting is valid. S203, the lighting compensation frame-level enabled flag is signaled to a bit stream. The lighting compensation method provided in the implementations of the description can be combined with various application scenarios of prediction technology, such as interprediction, non-rectangular interprediction, affine transform prediction, etc. Implementations of the description are not limited. As an example, on the basis of interprediction, lighting compensation technology can also be used to achieve interprediction. That is, when CI is allowed, the interprediction procedure is performed on the encoder side. In the implementations of the description, the video image may be divided into multiple image blocks, each image block currently to be encoded may be referred to as an encoding block. Each coding block may include a first color component, a second color component, and a third color component. The current block is an encoding block that is currently to be predicted for the first color component, the second color component, or the third color component in the video image. If the prediction is made on the first color component of the current block and the first color component is a luminance component, that is, the color component to be predicted is a luminance component, the current block can also be called luminance block. Alternatively, if the prediction is performed on the second color component of the current block and the second color component is a chrominance component, that is, the color component to be predicted is a chrominance component, the current block will also It can be called a chrominance block. In some implementations of the disclosure, the encoder determines the enabled flag at the illumination compensation frame level based on the luminance information of the current frame. If the frame-level lighting compensation enabled flag is valid, the lighting compensation function is enabled for the current frame, and the current block of the current frame is allowed or enabled for lighting compensation, and then the values of Corresponding lighting predictions are obtained by traversing different lighting compensation modes, and the lighting compensation frame-level enabled flag is signaled in the bitstream. In some implementations of the disclosure, the lighting compensation box level enabled flag includes at least one lighting compensation box level enabled flag. That is, in the implementations of the disclosure, a frame-level lighting compensation flag indicates that lighting compensation technology is enabled for the current image to be encoded (i.e., the current frame), or Multiple illumination compensation enabled flags at the frame level indicate that illumination compensation technology is enabled for the current image to be encoded. In some implementations of the disclosure, when a luminance difference value greater than a preset luminance change threshold exists by at least one luminance difference value, a valid lighting compensation box-level enabled flag corresponding to the luminance difference value; and when there is no luminance difference value greater than the preset luminance change threshold in the at least one luminance difference value, an invalid lighting compensation box-level enabled flag is determined. It should be noted that the encoder can set the preset luminance change threshold and compares at least one luminance difference value between the current frame and rq} Rnn / eznz / B / YiAi minus a reference frame with the change threshold. Preset luminance, to determine the enabled flag at the current frame's illumination compensation box level. Specifically, if the luminance difference value greater than the preset luminance change threshold exists in at least one luminance difference value, the luminance difference value corresponds to a valid lighting compensation box-level enabled flag, that is, the lighting compensation frame level enabled flag of the current frame is valid; If the at least one luminance difference value is less than or equal to the preset luminance change threshold, the current frame's illumination compensation box-level enabled flag is invalid. In the implementations of the description, the at least one flag enabled at the lighting compensation frame level is in one-to-one correspondence with different prediction modes of the current frame, or the at least one flag enabled at the illumination compensation frame level. Illumination is in a one-to-one correspondence with different regions of the current frame. That is, for different prediction modes or different image regions of a frame, different illumination compensation frame-level enabled flags can be used. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes N levels of lighting compensation box-level enabled flags corresponding to prediction modes. In this case, the encoder can determine the enabled flag at the illumination compensation frame level based on the luminance information of the current frame as follows. The encoder determines at least one luminance difference value between the current frame and at least one reference frame based on the luminance information of the current frame, and determines the illumination compensation frame-level enabled flag based on the al minus a luminance difference value and the preset luminance change threshold. In some implementations of the disclosure, the preset luminance change threshold includes: a first preset luminance change threshold and a second preset luminance change threshold, the second preset luminance change threshold being greater than the first change threshold preset luminance level, and the lighting compensation box-level enabled flag includes N levels of lighting compensation box-level enabled flags corresponding to the prediction modes. N is a positive integer greater than or equal to 1. The encoder further determines the enabled flag at the lighting compensation frame level based on at least one luminance difference value and the preset luminance change threshold as follows. The encoder determines that the N levels of flags enabled at the illumination compensation box level are all valid, rc} Rnn / eznz / B / YiAi when at least one luminance difference value is greater than the second luminance change threshold. preset luminance, determines that the N levels of flags enabled at the lighting compensation box level are all invalid, when the at least one luminance difference value is less than the first preset luminance change threshold; and determines that a first level of enabled flag at the lighting compensation box level is valid and other levels of enabled flags at the lighting compensation box level are invalid, when at least one luminance difference value is greater than the first preset luminance change threshold and is less than the second preset luminance change threshold. In some implementations of the disclosure, the prediction mode may include a fusion mode / direct mode, a skip mode, a normal intermode, and the like, and are not limited by the implementations of the disclosure. As an example, when N=3, the first level of the lighting compensation box-level enabled flag corresponds to a combination mode / direct mode, a second level of lighting compensation box-level enabled flag corresponds to to a bypass mode, and a third level of the flag enabled at the lighting compensation box level corresponds to a normal intermode. It should be noted that for different prediction modes, the encoder may determine different threshold intervals according to the number of prediction modes, to determine one or more prediction modes for which the lighting compensation function or technology is enabled at different intervals. threshold. Taking three modes as examples, in implementations of the disclosure, three threshold ranges can be obtained using the first preset luminance change threshold and the second preset luminance change threshold. If the at least one luminance difference value is greater than the maximum preset luminance change threshold, the illumination compensation function is enabled for all prediction modes. If the at least one luminance difference value is less than the preset minimum luminance change threshold, the illumination compensation function is not enabled for all prediction modes. If there are different threshold intervals between the minimum preset luminance change threshold and the maximum preset luminance change threshold, each threshold interval is determined to correspond to one or more prediction modes, to enable the illumination compensation function. In the implementations of the description, if the at least one luminance difference value is greater than the first preset luminance change threshold and is less than the second preset luminance change threshold, the first flag level enabled is determined to be at the lighting compensation box level is valid and other flag levels enabled at the lighting compensation box level are determined to be invalid. rc} Rnn / eznz / B / YiAi It can be understood that the decoder may determine, according to different prediction modes, a prediction mode or modes for which the lighting compensation technology is enabled and a prediction mode or modes for which the lighting compensation technology is not enabled. . As such, the encoder can signal from the frame level a portion of the codewords of the current frame with illumination compensation technology enabled in the bitstream, while the codewords are not transmitted in other cases, saving thus overloading the codeword and improving decompression efficiency. In some implementations of the disclosure, the encoder may further perform region partitioning on the current frame, to obtain M image regions and a valid image region partition flag, calculate luminance information of the M image regions, to obtain the corresponding M luminance information and signal the image region partition flag in the bitstream. M is a positive integer greater than or equal to 1. It should be noted that the encoder may set different illumination compensation frame-level enabled flags for different image regions of the current frame. In the implementations of the description, the current frame is divided into M image regions. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to regions of the image. In this case, the luminance information of the current frame includes the M luminance information of the M image regions. In some implementations of the disclosure, the encoder may determine the enabled flag at the illumination compensation frame level based on the luminance information of the current frame as follows. The encoder determines the enabled flag at the lighting compensation box level based on M luminance information and a preset luminance information threshold. Alternatively, when there is luminance information greater than the preset luminance information threshold in the M luminance information, a valid lighting compensation box-level enabled flag corresponding to the luminance information is determined, and when there is no luminance information luminance greater than the luminance information threshold preset in the M luminance information, an invalid lighting compensation box-level enabled flag is determined, and the M lighting compensation box-level enabled flags are obtained until The comparison of M luminance information is completed. It should be noted that each luminance information is compared with the preset luminance information threshold, and if it is greater than the preset luminance information threshold, the flag enabled at the illumination compensation box level of the region rq} Rnn / eznz / B / YiAi of the image corresponding to this luminance information is valid; otherwise, it is invalid. In some implementations of the disclosure, luminance information may be calculated using a luminance histogram. In some implementations of the disclosure, the lighting compensation mode includes a top left lighting compensation mode, a top lighting compensation mode, and a left lighting compensation mode. The lighting prediction value includes a first type of prediction value, a second type of prediction value, and a third type of prediction value. The encoder traverses multiple candidate motion information to determine the initial prediction value of the initial prediction block corresponding to the current block, where the initial prediction block is in one-to-one correspondence with the multiple candidate motion information, the current block belongs to the current frame, and the initial prediction block belongs to the reference frame. For the initial prediction block, the top left lighting compensation mode, the top lighting compensation mode and the left lighting compensation mode are traversed for lighting compensation, to obtain the first type of prediction value, the second type of prediction value and the third type of prediction value corresponding to multiple candidate motion information, where the top left illumination compensation mode, the top illumination compensation mode and the left illumination compensation mode are determined by samples of neighboring edges in different positions. The rate distortion cost with the original sample value of the current block is calculated by respectively adopting the initial prediction value, the first type of prediction value, the second type of prediction value and the third type of prediction value, for determine the lighting compensation usage flag, the current prediction mode corresponding to the optimal rate distortion cost, the current motion information and the target lighting compensation mode. Interprediction is performed in the current coding block with the current prediction mode, the current motion information and the target illumination compensation mode, to obtain the current prediction value. The index information of the current prediction mode, the index information of the current motion information, the index information of the target illumination compensation mode, and the illumination compensation use flag are signaled in the bitstream. As an example, interprediction is described as an example, the encoder obtains encoding information, including the interprediction illumination compensation enabled flag, divides the image into multiple CTUs after obtaining the image information, and divides it into multiple CU, where interprediction is performed at each independent CU. The current CU may restrict the minimum area and maximum area for IC technology. rq} Rnn / eznz / B / YiAi In the interprediction procedure in the encoder, if the IC flag on is '1', the sum of the absolute difference (SAD) between the luminance histograms of the current image to be encoded and each reference image, i.e. , at least one value of the luminance difference, is calculated. If the SAD between the luminance histograms of the current image to be encoded and a certain reference image is greater than the illumination change threshold, the illumination compensation technology is activated for the current image to be encoded , or the lighting compensation technology is enabled for some prediction modes of the current image to be encoded, and the enabled flag (that is, the enabled flag at the lighting compensation box level) of the current image is signals in the bit stream and is transmitted to the decoder. The illumination change threshold can be preset or determined according to the experience value of the current encoded image. Some of the prediction modes for the current image to be encoded may be an interprediction mode, a blending mode, a skip mode, and the like. If the illumination compensation technology is enabled for the current image to be encoded, all the following steps are performed, and if the IC enabled flag is '0' or the illumination compensation technology is not enabled for the image to be encoded, only a), b) and f) are performed. a) For interprediction, all candidate MV motion information is traversed first and motion compensation is performed, the prediction sample is calculated after motion compensation on each MV, and the rate distortion cost is calculated. according to the original sample. b) The optimal MV of the current coding unit and the prediction mode (such as SKIP, MERGE / DIRECT or INTER) are selected according to the principle of determining the minimum rate distortion costs of all MVs, and the optimal information and information corresponding to the cost of rate distortion is recorded. c) All candidate MVs are traversed again, and in this procedure, the lighting compensation technology is enabled and three lighting compensation modes are traversed. The reference block is first compared according to the prediction mode and MV, according to the index of the illumination compensation mode, the left and / or top reconstructed samples of the reference block and the left and / or top reconstructed samples of the block to be encoded from the current frame are extracted, and the reconstructed samples are sorted and averaged (the specific operation is described as above) and substituted into the above formula, to obtain the linear model parameters a and b. The index 1 of the lighting compensation mode is denoted as IC_TL, and the left and top reconstructed samples of the reference block and the current block can be used to calculate the linear model. The rq mode index 2} Rnn / eznz / B / YiAi illumination compensation is recorded as IC_T, and only the top reconstructed samples of the reference block and the current block can be used to calculate the linear model. The index 3 of the lighting compensation mode is denoted as IC_L, and only the reconstructed samples from the left of the reference block and the current block can be used to calculate the linear model. d) Motion compensation is performed in the reference block, prediction block after obtaining the normal motion compensation, then lighting compensation is performed in the prediction block, that is, a linear transformation is performed on the samples in each prediction block according to the linear model and the final prediction block of the current coding unit is obtained. e) The rate distortion cost information of each MV is calculated according to the final prediction sample after using the lighting compensation technology and the original sample, and the current lighting compensation mode index, and the MV index of the minimum rate distortion cost information, the corresponding prediction mode (such as skip mode, merge / direct mode, or normal intermode) and the corresponding cost are recorded. f) If the lighting compensation technology enabled flag is '0', the MV index and prediction mode recorded in b) are transmitted to the decoder via the bitstream. If the lighting compensation technology enabled flag is '1', the minimum cost value recorded in b) is compared to the minimum cost value recorded in e). If the rate distortion cost in b) is smaller, the MV index and prediction mode recorded in b) are encoded as the optimal information of the current coding unit and transmitted to the decoder through the bitstream. , and the illumination compensation technology flag position of the current encoding unit is set to 'false', indicating that the illumination compensation technology is not used, which is also transmitted to the decoder through the bit stream. If the distortion rate in e) is smaller, the MV index, lighting compensation mode index and prediction mode recorded in e) are encoded as the optimal information of the current coding unit and transmitted to the decoder through the bitstream and the current coding unit illumination compensation technology flag position is set to 'true' and the current coding unit block illumination compensation mode index is encoded , indicating that lighting compensation technology is used, which is also transmitted to the decoder through the bit stream. In some implementations of the disclosure, during encoding, the encoder may also determine a size of the current block and determine a lighting compensation mode of the current block based on the size of the current block and a prediction size threshold. rq} Rnn / eznz / B / YiAi In some implementations of the disclosure, the encoder determines that the lighting compensation mode of the current block is at least one of: a top left lighting compensation mode, a top lighting compensation mode, or a left lighting compensation mode. , when the size of the current block is less than the prediction size threshold; or determines that the lighting compensation mode of the current block is at least one of: top left lighting compensation mode, top lighting compensation mode, or left lighting compensation mode, when the size of the current block is greater than the prediction size threshold. As an example, the lighting compensation technology allows prediction compensation in all prediction blocks by using IC_TL, IC_T and IC_L, or it can also limit the range of use, for example, only lighting compensation modes. illumination IC_TL or IC_T or IC_L can be used for a coding unit with a small number of samples or a coding unit with a width / height less than a preset threshold. Lighting compensation technology allows prediction compensation in all prediction blocks using IC_TL, IC_T and IC_L, or can also limit the range of use, for example, only IC_TL or IC_T or IC_L lighting compensation modes can be used for a coding unit with a large number of samples or a coding unit with a width / height greater than the preset threshold. It can be understood that for the current blocks with different sizes, the encoder can use a part of the lighting modes to determine the lighting prediction value, which can avoid crossing all lighting compensation modes and reduce the computational complexity and save bits. In some implementations of the disclosure, during encoding of the current block, the encoder may perform region partitioning on the current block to obtain at least two subblocks of at least two regions and then encode the at least two subblocks. In some implementations of the disclosure, the encoder enables the lighting compensation function for the current frame and performs lighting compensation in the current block of the current frame, to obtain the lighting prediction value, when the enabled flag at the level of Lighting compensation chart is valid as follows. Multiple candidate motion information is traversed to determine an initial prediction value of an initial prediction block corresponding to each of the at least two subblocks, where the initial prediction block is in one-to-one correspondence with the multiple candidate motion information. ; and for the initial prediction block of each subblock, different lighting compensation modes are traversed for lighting compensation, to obtain corresponding lighting prediction values, when the lighting compensation box-level enabled flag is valid. rq} Rnn / eznz / B / YiAi It should be noted that for the initial prediction block of each sub-block, the encoder traverses the different illumination compensation modes for illumination compensation to obtain the corresponding illumination prediction values. The encoder may, for each lighting compensation mode, determine reconstructed samples of the current frame and reconstructed reference samples of a reference frame, determine an h-th model parameter corresponding to an h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, where h is a positive integer greater than or equal to 1 and less than the number of at least two subblocks, perform illumination compensation in the h-th region based on of the h-th model parameter, to obtain an h-th illumination prediction value from an h-th region prediction block, and perform illumination compensation in an (h+l)-th region until the compensation of lighting in at least two subblocks of at least two regions are completed. In some implementations of the disclosure, the encoder determines the h-th model parameter corresponding to the h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame in at least one of the following ways . Way 1 When there exists an h-th neighbor reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the h-th neighbor reconstructed reference sample and the reconstructed samples of the hth region into the reconstructed samples of the current frame; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the neighboring samples in an (h-l)-th region prediction block and the reconstructed samples of the h-th region into the reconstructed samples of the current frame. Way 2 When h is not equal to 1 and there exists an h-th neighboring reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the h -th neighbor reconstructed reference sample, the neighbor samples in a prediction block of the first region to a (h-1)th prediction block of the region, and reconstructed samples of the h-th region in the reconstructed samples of the frame current; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, the h-th model parameter is calculated based on the neighboring samples in the block ΑΓ} Αηη / Γζηζ / Β / ΥΙΛΙ prediction of the first region to the (h-l)th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. Way 3 After the encoder determines the h-th model parameter corresponding to the h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, when h is not equal to 1, at least one of a first model parameter to a (h-l)-th new model parameter is weighted with the h-th model parameter, to obtain an h-th new model parameter, and the illumination compensation is performed on the h -th region based on the h-th new model parameter, to obtain the h-th lighting prediction value of the h-th region prediction block. In some implementations of the disclosure, the encoder may also generate a valid block region partition flag and signal the block region partition flag in the bitstream. Understandably, in the encoding procedure of the current block, under the premise of realizing the lighting compensation function in the current block (that is, when the lighting compensation use flag of the current block is valid), the encoder can realize partition the block region into the current block, to obtain at least two sub-blocks, calculate the lighting compensation mode corresponding to each sub-block, and then perform lighting compensation based on the respective target lighting compensation mode. As such, the lighting compensation mode is determined for each sub-block and different processing is performed on different sub-blocks, thereby improving the coding accuracy and coding performance. In some implementations of the disclosure, the lighting compensation mode in the implementation of the disclosure may include: the top left lighting compensation mode, the top lighting compensation mode, and the left lighting compensation mode. Illumination compensation is performed to obtain illumination prediction values corresponding to multiple candidate motion information. It should be noted that the encoder determines a color component to be predicted from the current block, performs predictive coding on the color component to be predicted respectively with the multiple prediction modes based on parameters of the current block, to obtain the initial prediction value, and then calculate the rate distortion cost corresponding to each prediction mode of the multiple prediction modes based on the initial prediction value, select a minimum rate distortion cost (that is, a first minimum rate distortion cost) from the multiple calculated rate distortion costs, and determine the minimum rate distortion cost rq} Rnn / eznz / B / YiAi as an optimal rate distortion cost, and determine a prediction mode corresponding to the optimal rate distortion cost as the prediction mode of the current block. However, in the implementation of the description, the encoder also needs to traverse the lighting compensation modes to determine the lighting prediction values, calculate the rate distortion cost corresponding to each prediction mode of the multiple prediction modes in based on the lighting prediction values, and then compare the rate distortion cost corresponding to each prediction mode of the multiple prediction modes calculated based on the initial prediction value, to finally determine the optimal rate distortion cost, to determine whether lighting compensation should be performed on the current block. In some implementations of the disclosure, the encoder calculates a rate distortion cost with an original sample value of the current block by respectively adopting the initial prediction value and the lighting prediction value, to determine a lighting compensation use flag. , a current prediction mode corresponding to the optimal rate distortion cost, the current motion information and a target illumination compensation mode, and predicts the current block with the current prediction mode, the current motion information and the target illumination compensation, to obtain a prediction value. In some implementations of the description, the encoder determines the initial prediction block corresponding to the current block based on the current motion information, performs motion compensation on the initial prediction block to obtain the first prediction block, performs motion compensation of illumination in the first prediction block with the target illumination compensation mode, to obtain the second prediction block, and performs interprediction in the second prediction block with the current prediction mode, to obtain the prediction value. The lighting compensation method of the disclosure will be understood to provide selection for interprediction or the like in operations requiring lighting compensation or local linear transform or the like. For the region with obvious luminance changes between the current frame and the reference frame, the linear transformation model can be calculated using illumination compensation technology. After compensation is performed on the current coding block, the prediction block will be closer to the original image block, making the residual error smaller and finally improving the coding efficiency. It should be noted that the lighting compensation of the implementations of the description can also be applied to the prediction technology between non-rectangular blocks, that is, the lighting compensation technology is used in GPM in VVC and the AWP technology in AVS. After the encoder combines the motion-compensated prediction blocks of two reference frames in some way to obtain a new prediction block, the illumination compensation technology can be used for motion compensation. prediction compensation. Some of the above ways can take prediction samples from non-rectangular regions of different prediction blocks, respectively, to combine them. That is, for the current block, a second sub-prediction block is obtained by combining a non-rectangular region of a first sub-prediction block specified by a motion information and a complementary non-rectangular region of the first prediction block specified by another motion information. . The prediction technology between non-rectangular blocks can be GPM in VVC, AWP in AVS, inter-inter in AV, etc., which are not limited here. Illumination compensation is performed in the second sub-prediction block with the target illumination compensation mode, to obtain the target prediction block, which is the final prediction block of the current block. In some implementations of the disclosure, in the lighting compensation method, a flag may be added to the group of pictures (GOP), that is, a picture set level lighting compensation enabled flag, which is used to indicate whether lighting compensation technology is enabled for the current GOP. The image set level illumination compensation enabled flag must be signaled in the bitstream. For example, in a specific configuration, the video has 500 frames, 25 frames of the 500 frames are an image set, and each frame with an image set-level enabled flag of 1 has an image-level enabled flag of 1. frame, that is, a lighting compensation frame-level enabled flag, which can further save bitstream overhead. In some implementations of the disclosure, the lighting compensation method can be combined with affine transform prediction technology, such as AFFINE and PROF, which is an improvement of AFFINE, in VVC, AFFINE, AFFINE_UMVE and ASP in AVS, and other technologies . That is, the encoder performs illumination compensation in the prediction block, that is, the reference block after affine motion compensation according to the affine transformation parameters. In implementations of the disclosure, when analyzing the bitstream, the encoder obtains a current affine transformation parameter, performs affine motion compensation on the current block based on the current affine transformation parameter, to obtain a third prediction block, determines a model parameter with the target illumination compensation mode index information, and performs illumination compensation in the third prediction block with the model parameter, to obtain a fourth prediction block. The fourth prediction block is the final prediction block of the current block. rc} Rnn / eznz / B / YiAi In the implementation of the description, by analyzing the bitstream, the encoder obtains modified / refined motion information, performs motion compensation on the current block based on the modified / refined motion information, to obtain a fifth block of prediction, determines a model parameter with the index information of the target illumination compensation mode, and performs illumination compensation in the fifth prediction block with the model parameter, to obtain a sixth prediction block. The sixth prediction block is the final prediction block of the current block. The modified / refined motion information is determined by any of the final motion vector expression, the enhanced temporal motion vector prediction, the angular motion vector prediction, or the motion vector difference. In the implementations of the disclosure, the illumination compensation method can be combined with any technology to modify / refine the MV, such as Blending Mode with MVD (MMVD) in VVC and Final Motion Vector Expression (UMVE), enhanced temporal motion vector prediction (ETMVP) and motion vector angular prediction (MVAP) in AVS and other technologies. That is, the encoder performs illumination compensation in the prediction block, that is, the MV modified / refined / enhanced reference block after motion compensation. Understandably, in the current block decoding procedure, in the case of using illumination compensation technology, the encoder can directly obtain the illumination compensation frame-level enabled flag at the frame level of the bitstream, to that the encoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only in the case that the lighting compensation frame-level enabled flag is valid, a CU level flag can be obtained in the bitstream, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmission bits of the bitstream will be greatly reduced. Therefore, when illumination compensation is selected for a frame-level image based on different situations, a frame-level illumination compensation enabled flag is added to represent whether the illumination compensation technology is used. lighting compensation, to save coding bit overhead and improve coding performance. It should be noted that the description of the encoder is consistent and corresponds to the principle of the decoder, which will not be repeated here. Based on the implementation of the above implementations, as illustrated in Figure 13, the implementations of the description provide a decoder 1. The rp} Rnn / eznz / B / YiAi decoder 1 includes an analysis section 10, a first obtaining section 11 and a first lighting compensation section 12. The analysis section 10 is configured to: obtain a bitstream and analyze the bitstream to obtain an enabled lighting compensation flag. The first get section 11 is configured to: obtain a lighting compensation enabled flag at the frame level in the bitstream, when the lighting compensation enabled flag is valid, obtain a lighting compensation use flag in the bitstream, when the lighting compensation frame-level enabled flag is valid, and obtain index information of a target lighting compensation mode in the bitstream, when the lighting compensation use flag is valid. The first lighting compensation section 12 is configured to perform lighting compensation in a current block based on the index information of the target lighting compensation mode. In some implementations of the disclosure, the lighting compensation box level enabled flag includes at least one lighting compensation box level enabled flag; and the at least one lighting compensation frame-level enabled flag is in one-to-one correspondence with different prediction modes of a current frame, or the at least one lighting compensation frame-level enabled flag is in one-to-one correspondence. to one with different regions of the current frame. In some implementations of the disclosure, the analysis section 10 is further configured to: when an ith level of lighting compensation box-level enabled flag is valid in the N levels of lighting compensation box-level enabled flags. illumination, determine an (i+ l)-th illumination compensation frame-level enabled flag level in the bitstream until an Nth illumination compensation frame-level enabled flag level is determined in the stream of bits, where i is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 1; and when the (+l)th level of the illumination compensation frame-level enabled flag is invalid, obtain the illumination compensation use flag in the bitstream. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to image regions; and the analysis section 10 is further configured to: when a jth lighting compensation box-level enabled flag in the M lighting compensation box-level enabled flags is valid, determining a (j-ι- l )-th illumination compensation frame-level enabled flag in the bitstream until an Mth frame-level enabled flag is determined from rq} Rnn / eznz / B / YiAi illumination compensation in the bitstream , where j is a positive integer greater than or equal to 1 and less than or equal to M, and M is a positive integer greater than or equal to 1; and when the (j+l)th lighting compensation frame-level enabled flag is invalid, obtain the lighting compensation use flag in the bitstream. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to image regions; and the analysis section 10 is further configured to: obtain the lighting compensation use flag in the bitstream, when any of the M flags enabled at the lighting compensation frame level are valid. In some implementations of the disclosure, when N=3, a first level of frame-level illumination compensation enabled flag corresponds to a blend mode / direct mode, a second level of frame-level illumination compensation enabled flag corresponds to a bypass mode, and a third level of flag enabled at the lighting compensation box level corresponds to a normal intermode. In some implementations of the disclosure, the first lighting compensation section 12 is further configured to: skip lighting compensation, when a first level flag enabled at the lighting compensation box level is invalid. In some implementations of the disclosure, the first lighting compensation section 12 is further configured to: skip lighting compensation, when the first of the flags enabled at the lighting compensation box level is invalid. In some implementations of the disclosure, the analysis section 10 is further configured to: obtain an image region partition flag, by analyzing the bitstream; and get the M flags enabled at the lighting compensation box level, when the image region partition flag is valid. The first illumination compensation section 12 is further configured to: skip illumination compensation, when the image region partition flag is invalid. In some implementations of the disclosure, the first obtaining section 11 is further configured to divide the current block to obtain at least two subblocks corresponding to at least two regions. In some implementations of the disclosure, the first lighting compensation section 12 is further configured to: determine reconstructed samples of a current frame and reconstructed reference samples of a reference frame based on the index information of the target lighting compensation mode ; determine an h-th model parameter corresponding to an h-th region based on the reconstructed samples of the current rq} Rnn / eznz / B / YiAi frame and the reconstructed reference samples of the reference frame, where h is an integer positive greater than or equal to 1 and less than the number of the at least two sub-blocks; performing illumination compensation in the h-th region based on the h-th model parameter, to obtain an h-th region prediction block; and performing lighting compensation in an (h+l)th region until lighting compensation in the at least two subblocks is completed. In some implementations of the disclosure, the first illumination compensation section 12 is further configured to: when there exists an h-th neighboring reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculating the h-th model parameter based on the h-th neighboring reconstructed reference sample and reconstructed samples of the h-th region in the reconstructed samples of the current frame; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculate the h-th model parameter based on neighboring samples in a (h-l )-th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. In some implementations of the disclosure, the first illumination compensation section 12 is further configured for: when h is not equal to 1 and an h-th neighboring reconstructed reference sample exists adjacent to the h-th region in the reference samples reconstructed from the reference frame, calculate the h-th model parameter based on the h-th neighbor reconstructed reference sample, the neighbor samples in a prediction block of the first region to a (h-l)-th prediction block of the region and the reconstructed samples of the hth region into the reconstructed samples of the current frame; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculate the h-th model parameter based on the neighboring samples in the prediction block of the first region for the (h-l)th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. In some implementations of the disclosure, the first lighting compensation section 12 is further configured to: when h is not equal to 1, weight at least one of a first model parameter to a (h-l)th new model parameter with the h-th model parameter, to obtain a h-th new model parameter; and perform lighting compensation in the h-th region based on the h-th parameter of the new model, to obtain the h-th prediction block of the region, after determining the h-th model parameter corresponding to the h -th region based on the reconstructed rc} Rnn / eznz / B / YiAi samples from the current frame and the reconstructed reference samples from the reference frame. In some implementations of the disclosure, the parsing section 10 is further configured to: obtain a block region partition flag by parsing the bitstream. The first fetch section 11 is further configured to split the current block to obtain at least two sub-blocks, when the block region partition flag is valid. The first lighting compensation section 12 is further configured to calculate a block model parameter of the current block, when the block region partition flag is invalid. In some implementations of the disclosure, the decoder further includes a decoding section 13. The analysis section 10 is further configured to obtain current motion information and a current prediction mode, when analyzing the bit stream. The decoding section 13 is configured to predict the current block according to the index information of the target illumination compensation mode, the current prediction mode and the current motion information, to obtain a prediction value. In some implementations of the disclosure, the decoding section 13 is further configured to determine an initial prediction block corresponding to the current block based on the current motion information; and performing motion compensation in the initial prediction block, to obtain a first prediction block. The first lighting compensation section 12 is further configured to: determine a model parameter with the index information of the target lighting compensation mode; and perform an illumination compensation in the first prediction block with the model parameter, to obtain a second prediction block. The decoding section 13 is configured to perform interprediction on the second prediction block with the current prediction mode to obtain the prediction value. In some implementations of the disclosure, during the use of a prediction technology between non-rectangular blocks, for the current block, a second sub-prediction block is obtained by combining a non-rectangular region of a first sub-prediction block specified by a motion information and a non-rectangular region complementary to the first prediction block specified by other motion information. The first illumination compensation section 12 is further configured to perform illumination compensation in the second sub-prediction block with the target illumination compensation mode, to obtain a target prediction block. In some implementations of the disclosure, the parsing section 10 is further configured to: obtain a picture set level illumination compensation enabled flag in the bitstream, when the rc compensation enabled flag} Rnn / eznz / B / YiAi lighting is valid; and obtaining the illumination compensation frame-level enabled flag in the bitstream, when the image set level illumination compensation enabled flag is valid. In some implementations of the disclosure, the analysis section 10 is further configured to: obtain a current affine transformation parameter, when analyzing the bitstream. The decoding section 13 is further configured to: perform affine motion compensation on the current block based on the current affine transformation parameter, to obtain a third prediction block. The first lighting compensation 12 is further configured to: determine a model parameter with the index information of the target lighting compensation mode; and performing lighting compensation in the third prediction block with the model parameter, to obtain a fourth prediction block. In some implementations of the disclosure, the analysis section 10 is further configured to: obtain modified / refined motion information by analyzing the bitstream. The decoding section 13 is further configured to: perform motion compensation on the current block based on the modified / refined motion information, to obtain a fifth prediction block. The first lighting compensation section 12 is further configured to: determine a model parameter with the index information of the target lighting compensation mode; and perform lighting compensation in the fifth prediction block with the model parameter, to obtain a sixth prediction block. In some implementations of the disclosure, the modified / refined motion information is determined by any of the final motion vector expression, the enhanced temporal motion vector prediction, the angular motion vector prediction, or the motion vector difference. . Understandably, in the current block decoding procedure, in the case of using lighting compensation technology, the decoder can directly obtain the lighting compensation frame-level enabled flag at the frame level of the bitstream, to that the encoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only in the case that the lighting compensation frame-level enabled flag is valid, a CU level flag can be obtained in the bitstream, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmission bits of the bitstream will be greatly reduced. Therefore, when lighting compensation is selected for a frame-level image based on different situations, a rc compensation frame-level enabled flag is added} Rnn / eznz / B / YiAi frame-level lighting , to represent whether lighting compensation technology is used, to save coding bit overhead and improve coding performance. In the practical application of the description, as illustrated in Figure 14, the implementations of the description also provide a decoder. The decoder includes a first memory 14 and a first processor 15. The first memory 14 stores an executable computer program in the first processor 15, and upon executing the computer program, the first processor 15 implements the lighting compensation method corresponding to the decoder. The first processor 15 may be implemented by software, hardware, firmware, or a combination thereof, using circuits, single or multiple application-specific integrated circuits (ASICs), single or multiple general-purpose integrated circuits, single or multiple microprocessors, logic devices. single or multiple programmable devices, or combinations of the aforementioned circuits or devices, or other suitable circuits or devices, so that the first processor 15 can perform the corresponding steps of the lighting compensation method on the decoder side in the aforementioned implementations . Implementations of the disclosure provide an encoder 2. As illustrated in Figure 15, the encoder 2 includes a second determination section 20, a second prediction section 21 and a signaling section 22. The second determination section 20 is configured to determine an enabled flag at the lighting compensation frame level based on the luminance information of a current frame. The second prediction section 21 is configured to: enable a lighting compensation function for the current frame, and perform lighting compensation on a current block of the current frame, to obtain a lighting prediction value, when the flag enabled to lighting compensation box level is valid. The signaling section 22 is configured to signal the enabled flag at the lighting compensation frame level to a bit stream. In some implementations of the disclosure, the second determination section 20 is further configured to: determine at least one luminance difference value between the current frame and at least one reference frame based on the luminance information of the current frame; and determining the enabled flag at the lighting compensation box level based on at least one luminance difference value and a preset luminance change threshold. In some implementations of the disclosure, the second determination section 20 is further configured to: when there is a luminance difference value greater than the rq} Rnn / eznz / B / YiAi preset luminance change threshold at at least a value of luminance difference, determining a valid lighting compensation box-level enabled flag corresponding to the value of the luminance difference; and when there is no luminance difference value greater than the preset luminance change threshold in the at least one luminance difference value, determining an invalid lighting compensation box-level enabled flag. In some implementations of the disclosure, the preset luminance change threshold includes: a first preset luminance change threshold and a second preset luminance change threshold, the second preset luminance change threshold being greater than the first change threshold preset luminance, and the lighting compensation box-level enabled flag includes N levels of lighting compensation box-level enabled flags corresponding to the prediction modes; and the second determination section 20 is further configured to: determine that the N levels of flags enabled at the lighting compensation box level are all valid, when the at least one luminance difference value is greater than the second change threshold preset luminance; determining that the N levels of the flags enabled at the lighting compensation box level are all invalid, when the at least one luminance difference value is less than the first pre-established luminance change threshold; and determining that a first level of enabled flag at the lighting compensation box level is valid and other levels of enabled flags at the lighting compensation box level are invalid, when at least one luminance difference value is greater than the first preset luminance change threshold and is less than the second preset luminance change threshold. In some implementations of the disclosure, when N=3, the first level of the lighting compensation box-level enabled flag corresponds to a blend mode / direct mode, a second level of lighting compensation box-level enabled flag corresponds to a lighting corresponds to a bypass mode, and a third level of enabled flag at the lighting compensation box level corresponds to a normal Inter mode. In some implementations of the disclosure, the second determination section 20 is further configured to: perform region partitioning on the current frame, to obtain M image regions and a valid image region partitioning flag; and calculate the luminance information of the M image regions, to obtain the corresponding M luminance information. The signaling section 22 is further configured to: signal the image region partition flag in the bit stream. In some implementations of the disclosure, the luminance information of the current frame includes the M luminance information of the M image regions; and the second rq} Rnn / eznz / B / YiAi determination section 20 is further configured to: determine the enabled flag at the lighting compensation box level based on the luminance information M and a preset luminance information threshold. In some implementations of the disclosure, the lighting compensation box-level enabled flag includes M lighting compensation box-level enabled flags corresponding to regions of the image; and the second determination section 20 is further configured to: when there is luminance information greater than the preset luminance information threshold in the M luminance information, determine a valid lighting compensation box-level enabled flag corresponding to the information luminance; and when there is no luminance information greater than the preset luminance information threshold in the M luminance information, determine an invalid lighting compensation box-level enabled flag and obtain M lighting compensation box-level enabled flags. until the comparison of the M luminance information is completed. In some implementations of the disclosure, the second determination section 20 is further configured to: perform region partitioning on the current block, to obtain at least two subblocks of at least two regions. In some implementations of the disclosure, the second prediction section 21 is further configured to: traverse multiple candidate motion information, to determine an initial prediction value of an initial prediction block corresponding to each of the at least two subblocks, where the initial prediction block is in one-to-one correspondence with the multiple candidate motion information, the at least two sub-blocks belong to the current frame, and the initial prediction block belongs to a reference frame; and for the initial prediction block of each subblock, traversing different lighting compensation modes for lighting compensation, to obtain corresponding lighting prediction values, when the lighting compensation box-level enabled flag is valid. In some implementations of the disclosure, the second prediction section 21 is further configured to: for each lighting compensation mode, determine reconstructed samples of the current frame and reconstructed reference samples of a reference frame; determine an h-th model parameter corresponding to an h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame, where h is a positive integer greater than or equal to 1 and less than the number of the at least two sub-blocks; performing illumination compensation in the h-th region based on the h-th model parameter, to obtain an h-th illumination prediction value of an h rp} Rnn / eznz / B / YiAi th region prediction block; and performing lighting compensation in an (h+1)th region until lighting compensation is completed in the at least two subblocks of the at least two regions. In some implementations of the disclosure, the second prediction section 21 is further configured to: when there exists an h-th neighboring reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculating the h -th model parameter based on the h-th neighboring reconstructed reference sample and reconstructed samples of the h-th region in the reconstructed samples of the current frame; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculate the h-th model parameter based on neighboring samples in a (h-l )-th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. In some implementations of the disclosure, the second prediction section 21 is further configured for: when h is not equal to 1 and there is an h-th neighboring reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculate the h-th model parameter based on the h-th neighbor reconstructed reference sample, the neighbor samples in a first region prediction block to a (h-l)-th region prediction block and the reconstructed samples of the hth region into the reconstructed samples of the current frame; and when h is not equal to 1 and there is no reconstructed reference sample adjacent to the h-th region in the reconstructed reference samples of the reference frame, calculate the h-th model parameter based on the neighboring samples in the prediction block of the first region for the (h-l)th region prediction block and the reconstructed samples of the h-th region in the reconstructed samples of the current frame. In some implementations of the disclosure, the second prediction section 21 is further configured to: when h is not equal to 1, weight at least one of a first parameter of the model to an (h-l)th parameter of the new model with the h -th model parameter, to obtain an h-th new model parameter; and perform lighting compensation in the h-th region based on the h-th parameter of the new model, to obtain the h-th lighting prediction value of the h-th region prediction block, after determining the h -th model parameter corresponding to the h-th region based on the reconstructed samples of the current frame and the reconstructed reference samples of the reference frame. In some implementations of the disclosure, the second determination section 20 is further configured to: generate a valid block region partition flag and the signaling section 22 is further configured to: signal the region partition flag ΑΓ} Αηη / Γζηζ / Β / ΥΙΛΙ valid block in the bitstream. In some implementations of the disclosure, the second prediction section 21 is further configured to: calculate a rate distortion cost with an original sample value of the current block respectively adopting the initial prediction value and the illumination prediction value, to determining an illumination compensation usage flag, a current prediction mode corresponding to the optimal rate distortion cost, current motion information, and a target illumination compensation mode; and predict the current block with the current prediction mode, the current motion information and the target illumination compensation mode, to obtain a prediction value. In some implementations of the disclosure, the second prediction section 21 is further configured to: determine an initial prediction block corresponding to the current block based on the current motion information; performing motion compensation in the initial prediction block, to obtain a first prediction block; performing illumination compensation in the first prediction block with the target illumination compensation mode, to obtain a second prediction block; and perform an interprediction in the second prediction block with the current prediction mode, to obtain the prediction value. In some implementations of the disclosure, during the use of a prediction technology between non-rectangular blocks, for the current block, a second sub-prediction block is obtained by combining a non-rectangular region of a first sub-prediction block specified by a motion information and a non-rectangular region complementary to the first prediction block specified by other motion information; and the second prediction section 21 is further configured to: perform illumination compensation in the second sub-prediction block with the target illumination compensation mode, to obtain a target prediction block. In some implementations of the disclosure, the second determination section 20 is further configured to: determine an image set level illumination compensation enabled flag, when the illumination compensation enabled flag is valid; and determining a frame-level illumination compensation enabled flag of each frame in a set of images, when the image set-level illumination compensation enabled flag is valid. In some implementations of the disclosure, the second prediction section 21 is further configured to: obtain a current affine transformation parameter; performing affine motion compensation on the current block based on the current affine transformation parameter, to obtain a third prediction block; and perform lighting compensation in the third prediction block with the target lighting compensation mode, to obtain a fourth prediction block. In some implementations of the disclosure, the second prediction section 21 is further configured to: obtain modified / refined motion information; performing motion compensation on the current block based on the modified / refined motion information to obtain a fifth prediction block; and performing illumination compensation in the fifth prediction block with the target illumination compensation mode, to obtain a sixth prediction block. In some implementations of the disclosure, the modified / refined motion information is determined by any of the final motion vector expression, the enhanced temporal motion vector prediction, the angular motion vector prediction, or the motion vector difference. . In some implementations of the disclosure, the second determination section 20 is further configured to: determine a size of the current block; and determining a lighting compensation mode of the current block based on the size of the current block and a prediction size threshold. In some implementations of the disclosure, the second determination section 20 is further configured to: determine that the lighting compensation mode of the current block is at least one of: a top left lighting compensation mode, a lighting compensation mode top or a left lighting compensation mode, when the current block size is less than the prediction size threshold; or determining that the lighting compensation mode of the current block is at least one of: top left lighting compensation mode, top lighting compensation mode, or left lighting compensation mode, when the size of the current block is greater than the prediction size threshold. Understandably, in the current block decoding procedure, in the case of using illumination compensation technology, the encoder can directly obtain the illumination compensation frame-level enabled flag at the frame level of the bitstream, to that the encoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only in the case that the lighting compensation frame-level enabled flag is valid, a CU level flag can be obtained in the bitstream, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmission bits of the bitstream will be greatly reduced. Therefore, when lighting compensation is selected for a frame-level image based on different situations, rq} Rnn / eznz / B / YiAi a frame-level lighting compensation enabled flag is added. , to represent whether lighting compensation technology is used, to save coding bit overhead and improve coding performance. In the practical application of the description, as illustrated in Figure 16, implementations of the description also provide an encoder. The encoder includes a second memory 23 and a second processor 24. The second memory 23 stores an executable computer program in the second processor 24, and upon executing the computer program, the second processor 24 implements the lighting compensation method corresponding to the encoder. The implementations of the description provide a storage medium. The storage medium stores a computer program. When the computer program is executed by a first processor, the lighting compensation method corresponding to the decoder of the claim is implemented. Alternatively, when the computer program is executed by a second processor, the lighting compensation method corresponding to the encoder of the claim is implemented. Sections in various implementations of the disclosure may be integrated into a processing unit, or each unit may be physically present, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of a hardware or software functional unit. The embedded drive may be stored in computer-readable storage when implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solutions of the description essentially, or the part of the technical solutions that contributes to the related art, or all or part of the technical solutions, may be incorporated in the form of a software product that is stored on a storage medium and includes instructions for causing a computing device (which may be a personal computer, a server or a network device, etc.) or a processor to perform all or part of the steps described in the various implementations of the description. The above storage media includes various media that can store program codes, such as ferromagnetic random access memory (FRAM), read-only memory (ROM), programmable read-only memory (PROM), read-only memory erasable programmable read-only memory (EPROM), electrically programmable read-only memory (EEPROM), flash memory, magnetic surface memory, an optical disk or CDROM, compact disk read-only memory, which is not limited in the implementations of the description . rq} Rnn / eznz / B / YiAi The above are some implementations of the description, but the scope of protection of the description is not limited to them. Any changes or substitutions that are readily conceivable by those skilled in the art within the technical scope disclosed by the description should be covered by the protective scope of the description. Therefore, the scope of protection of the description must be subject to the scope of protection of the claims. Industrial applicability The implementations of the description provide the lighting compensation method, the encoder, the decoder and the storage medium. The bitstream is obtained, and the bitstream is analyzed to obtain the lighting compensation enabled flag, the current motion information, and the current prediction mode. The lighting compensation frame-level enabled flag is obtained in the bitstream, when the lighting compensation enabled flag is valid. The illumination compensation use flag in the bitstream is obtained when the illumination compensation frame-level enabled flag is valid. The target lighting compensation mode index information in the bitstream is obtained when the lighting compensation use flag is valid. Illumination compensation is performed in the current block based on the index information of the target illumination compensation mode. By adopting the above technical solution, in the decoding procedure of the current block, in the case of using lighting compensation technology, the decoder can directly obtain the lighting compensation frame-level enabled flag at the frame level of the bitstream, so the encoder can determine from the frame level whether it is necessary to continue obtaining a lighting compensation use flag at the block level, and only if the flag enabled at the frame level lighting compensation is valid, a CU level flag in the bitstream can be obtained, and subsequent decoding can be performed, to perform prediction (such as interprediction) on the current block. Therefore, when the lighting compensation frame-level enabled flag is invalid, the transmission bits of the bitstream will be greatly reduced. Therefore, when the illumination compensation is selected for the frame-level image based on different situations, the frame-level illumination compensation enabled flag is added, to represent whether the illumination compensation technology is used. lighting compensation, to save coding bit overhead, and improve coding performance.
Claims
1. A lighting compensation method, applied to a decoder and comprising: obtaining a bitstream and analyzing the bitstream to obtain a lighting compensation enable flag; obtaining a lighting compensation frame-level enable flag in the bitstream, when the lighting compensation enable flag is valid; obtaining a lighting compensation usage flag in the bitstream, when the lighting compensation frame-level enable flag is valid; obtaining index information of a target lighting compensation mode in the bitstream, when the lighting compensation usage flag is valid; and performing lighting compensation on a current block based on the index information of the target lighting compensation mode.
2. The method according to claim 1, further characterized in that the flag enabled at the lighting compensation panel level comprises at least one flag enabled at the lighting compensation panel level; and the at least one flag enabled at the lighting compensation panel level corresponds one-to-one with different prediction modes of a current panel.
3. The method according to claim 1 or 2, further characterized in that it additionally comprises: obtaining current motion information and a current prediction mode by analyzing the bit stream; and predicting the current block according to the target illumination compensation mode index information, the current prediction mode, and the current motion information, to obtain a prediction value.
4. The method according to claim 3, further characterized in that it further comprises: obtaining modified / refined motion information by analyzing the bitstream; performing motion compensation on the current block based on the modified / refined motion information to obtain a motion-compensated prediction block; determining a model parameter using the target illumination compensation mode index information; and performing illumination compensation on the motion-compensated prediction block using the model parameter to obtain an illumination-compensated prediction block.
5. The method according to claim 4, further characterized in that the modified / refined motion information is determined by either enhanced temporal motion vector prediction or angular motion vector prediction.
6. A lighting compensation method, applied to an encoder and comprising: determining a lighting compensation frame-level enable flag based on the luminance information of a current frame; enabling a lighting compensation function for the current frame, and performing lighting compensation on a current block of the current frame, to obtain a lighting prediction value, when the lighting compensation frame-level enable flag is valid; and signaling the lighting compensation frame-level enable flag to a bitstream.
7. The method according to claim 6, further characterized in that the flag enabled at the lighting compensation panel level comprises at least one flag enabled at the lighting compensation panel level; and the at least one flag enabled at the lighting compensation panel level corresponds one-to-one with different prediction modes of a current panel.
8. The method according to claim 6 or 7, further characterized in that it additionally comprises: determining a lighting compensation usage flag, a current prediction mode, current motion information, and a target lighting compensation mode; and predicting the current block with the current prediction mode, current motion information, and target lighting compensation mode, to obtain a prediction value.
9. The method according to claim 8, further characterized in that it additionally comprises: obtaining modified / refined motion information; performing motion compensation on the current block based on the modified / refined motion information, to obtain a motion-compensated prediction block; and performing illumination compensation on the motion-compensated prediction block using the target illumination compensation mode, to obtain an illumination-compensated prediction block.
10. The method according to claim 9, further characterized in that the modified / refined motion information is determined by either enhanced temporal motion vector prediction or angular motion vector prediction.
11. A decoder, comprising: an analysis section configured to: obtain a bitstream, and analyze the bitstream to obtain an enabled lighting compensation flag; a first obtaining section configured to: obtain an enabled lighting compensation flag at the frame level in the bitstream, when the enabled lighting compensation flag is valid, obtain a lighting compensation usage flag in the bitstream, when the enabled lighting compensation flag at the frame level is valid, and obtain index information of a target lighting compensation mode in the bitstream, when the lighting compensation usage flag is valid; and a first lighting compensation section configured to perform lighting compensation on a current block based on the index information of the target lighting compensation mode.
12. An encoder, comprising: a second determination section configured to determine an enabled flag at the lighting compensation frame level based on the luminance information of a current frame; a second prediction section configured to: enable a lighting compensation function for the current frame, and perform lighting compensation on a current block of the current frame, to obtain a lighting prediction value, when the enabled flag at the lighting compensation frame level is valid; and a signaling section configured to signal the enabled flag at the lighting compensation frame level to a bitstream.
13. A decoder comprising a first memory and a first processor, wherein the first memory stores a computer program executable in the first processor and when executing the computer program, the first processor implements the method of any one of claims 1 to 5.
14. An encoder comprising a second memory and a second processor, wherein the second memory stores a computer program executable in the second processor and when executing the computer program, the second processor implements the method of any one of claims 6 to 10.
15. A storage medium that stores a computer program that, when executed by a first processor, implements the method of any one of claims 1 to 5, or when executed by a second processor, implements the method of any one of claims 6 to 10.