Video encoding and decoding methods, apparatus, devices, systems, and storage media
By increasing the selection method of reconstruction sample mode and applying linear transformation parameters, the problem of low video coding efficiency when illumination changes is solved, and more efficient illumination compensation and prediction effects are achieved.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-04-13
- Publication Date
- 2026-06-24
AI Technical Summary
Existing video coding technologies are ineffective at compensating for lighting changes, resulting in low coding efficiency.
By adding a method for selecting reconstruction sample modes, and using linear transformation parameters to perform illumination compensation on the predicted values, a suitable reconstruction sample mode can be selected to improve the illumination compensation effect and the prediction effect.
It improves coding efficiency and prediction accuracy in scenarios with changing lighting, reduces residual information, and enhances the overall performance of video coding.
Smart Images

Figure 0007879949000009 
Figure 0007879949000010 
Figure 0007879949000011
Abstract
Description
Technical Field
[0001] This application relates to the field of video encoding and decoding technologies, and more specifically, to video encoding and decoding methods, devices, apparatuses, systems, and storage media.
Background Art
[0002] Digital video technology can be applied to various video devices such as digital TVs, smartphones, computers, e-readers, and video players. With the development of video technology, the amount of data contained in video data is large. In order to facilitate the transmission of video data or to store video data more efficiently, video devices perform video compression technology.
[0003] In the video compression process, data redundancy is reduced by prediction, and different images have significant or slight changes in a specific scene. In some embodiments, in order to improve the compression performance, illumination compensation is performed on the obtained predicted value to adapt to the illumination change between the current image and the reference image, and redundancy can be reduced.
[0004] However, the current illumination compensation technology has poor effects.
Summary of the Invention
[0005] Embodiments of this application provide a video encoding and decoding method, device, apparatus, system, and storage media, thereby improving the illumination compensation effect and the prediction effect of the current block.
[0006] In a first aspect, this application provides a video decoding method. The method includes: decoding a bitstream and predicting a current block to obtain a first predicted value; To determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. Based on the current block's reconstruction sample mode, determine the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, Based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the linear transformation parameters are determined, and a linear transformation is performed on the first predicted value based on the linear transformation parameters to obtain the second predicted value of the current block. Includes.
[0007] In a second embodiment, the present application provides a video encoding method. The method is To predict the current block and obtain the first predicted value for the current block, To determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. The process involves determining a second predicted value for the current block based on the current block's reconstruction sampling mode, wherein the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the current block's reconstruction sampling mode. Includes.
[0008] In a third embodiment, the present application provides a video encoder configured to perform the method in the first embodiment or each of its embodiments. Specifically, the encoder comprises a functional unit configured to perform the method in the first embodiment or each of its embodiments.
[0009] In a fourth embodiment, the present application provides a video decoder comprising a processor and memory, the memory being configured to store a computer program, and the processor being configured to execute the method in the second embodiment or each of its embodiments by calling and executing the computer program stored in the memory.
[0010] In a fifth embodiment, a video encoder is provided. The video encoder comprises a processor and memory. The memory is configured to store a computer program. The processor is configured to execute the method in the first embodiment or each of its embodiments by calling and executing the computer program stored in the memory.
[0011] In a sixth embodiment, a video decoder is provided. The video decoder comprises a processor and memory. The memory is configured to store a computer program. The processor is configured to execute the method in the second embodiment or each of its embodiments by calling and executing the computer program stored in the memory.
[0012] In a seventh embodiment, a video encoding and decoding system is provided. The video encoding and decoding system includes a video encoder and a video decoder. The video encoder is configured to perform the method in the first embodiment or each of its embodiments. The video decoder is configured to perform the method in the second embodiment or each of its embodiments.
[0013] In the eighth embodiment, a chip is provided. The chip is configured to perform the first or second embodiment, or the method in each embodiment of the first or second embodiment. Specifically, the chip includes a processor, which is configured to cause a device to which the chip is mounted to perform the first or second embodiment, or the method in each embodiment of the first or second embodiment, by calling and executing a computer program from memory.
[0014] In the ninth embodiment, a computer-readable storage medium is provided. The computer-readable storage medium is configured to store a computer program, which causes the computer to execute the first or second embodiment, or the method in each embodiment of the first or second embodiment.
[0015] In the tenth embodiment, a computer program product is provided. When the computer program is executed on a computer, it is configured to cause the computer to execute the first or second embodiment, or the method in each embodiment of the first or second embodiment.
[0016] In the eleventh embodiment, a computer program is provided. When a computer executes the computer program, the computer is made to perform any of the embodiments or methods of each embodiment of the first and second embodiments.
[0017] In the twelfth aspect, a bitstream is provided, which is generated based on the method of the second aspect described above.
[0018] Based on the above technical solution, in the embodiments of the present application, the reconstruction sample mode of the current block can be one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. The selection mode of the reconstruction sample is rich, and the reconstruction sample mode that conforms to the feature information of the current block can be accurately determined from each of the above modes. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be more accurately determined. Based on the accurately determined adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the linear transformation parameters are determined. Based on the linear transformation parameters, linear transformation is performed on the first prediction value of the current block to obtain an accurate second prediction value, enhancing the illumination compensation effect of the current block and enhancing the prediction effect of the current block.
Brief Description of the Drawings
[0019] [Figure 1] Figure 1 is a block diagram showing a video encoding and decoding system according to an embodiment of the present application. [Figure 2] Figure 2 is a block diagram showing a video encoder provided by an embodiment of the present application. [Figure 3] Figure 3 is a block diagram showing a decoding framework provided by an embodiment of the present application. [Figure 4a] Figure 4a is a schematic diagram showing the illumination of an image. [Figure 4b] Figure 4b is a schematic diagram showing the illumination of an image. [Figure 5] Figure 5 is a schematic diagram showing the principle of the illumination compensation technology according to an embodiment of the present application. [Figure 6] Figure 6 is a schematic diagram of a reconstruction sample according to an embodiment of the present application. [Figure 7] Figure 7 is a flowchart of a video decoding method provided by an embodiment of the present application. [Figure 8a]FIG. 8a is a schematic diagram of a left adjacent sample according to an embodiment of the present application. [Figure 8b] FIG. 8b is a schematic diagram of a left adjacent sample according to an embodiment of the present application. [Figure 9a] FIG. 9a is a schematic diagram of an upper adjacent sample according to an embodiment of the present application. [Figure 9b] FIG. 9b is a schematic diagram of an upper adjacent sample according to an embodiment of the present application. [Figure 10] FIG. 10 is a flowchart of a video encoding method provided by an embodiment of the present application. [Figure 11] FIG. 11 is a block diagram showing a video decoding device provided by an embodiment of the present application. [Figure 12] FIG. 12 is a block diagram showing a video encoding device provided by an embodiment of the present application. [Figure 13] FIG. 13 is a block diagram showing an electronic device provided by an embodiment of the present application. [Figure 14] FIG. 14 is a block diagram showing a video encoding / decoding system provided by an embodiment of the present application.
DETAILED DESCRIPTION OF THE INVENTION
[0020] Hereinafter, the technical solutions in the embodiments of the present application will be described with reference to the drawings.
[0021] This application is applicable to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc. Alternatively, the proposed technology of this application can be combined with other dedicated or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), and includes scalable video coding (SVC) and multi-view video coding (MVC) extensions. However, the technology of this application is not limited to any specific encoding and decoding standard or technology.
[0022] To facilitate understanding, we will first introduce the video encoding and decoding system according to the embodiment of this application, with reference to Figure 1.
[0023] Figure 1 is a block diagram illustrating a video encoding / decoding system according to an embodiment of the present application. Figure 1 is merely an example, and the video encoding / decoding system according to an embodiment of the present application includes, but is not limited to, the one shown in Figure 1. As shown in Figure 1, the video encoding / decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is configured to encode (may be understood as compressing) video data to generate a bitstream and to transmit the bitstream to the decoding device. The decoding device is configured to decode the bitstream generated by the encoding device to obtain decoded video data.
[0024] The encoding device 110 according to the embodiment of this application can be understood as a device having video encoding capabilities, and the decoding device 120 can be understood as a device having video decoding capabilities. That is, the encoding device 110 and the decoding device 120 according to the embodiment of this application include a broader range of devices, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes (STBs), televisions, cameras, display devices, digital media players, video game consoles, and in-vehicle computers.
[0025] In some embodiments, the encoding device 110 can transmit encoded video data (e.g., a bitstream) to the decoding device 120 via channel 130. Channel 130 may include one or more media and / or devices that can transmit the encoded video data from the encoding device 110 to the decoding device 120.
[0026] In one example, channel 130 includes one or more communication media that enable the encoding device 110 to directly transmit encoded video data to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to the decoding device 120. The communication media includes wireless communication media such as radio frequency spectrum. Optionally, the communication media may also include wired communication media such as one or more physical transmission lines.
[0027] In another example, channel 130 includes a storage medium that can store video data encoded by the encoding device 110. The storage medium includes various locally accessible data storage media, such as optical discs, digital versatile discs (DVDs), and flash memory. In this example, the decoding device 120 can retrieve the encoded video data from the storage medium.
[0028] In another example, channel 130 may include a storage server that can store video data encoded by the encoding device 110. In this example, the decoding device 120 can download the encoded video data stored in the storage server from the storage server. Selectively, the storage server may store encoded video data and transmit the encoded video data to the decoding device 120. Examples of such storage servers include web servers (e.g., for websites) and file transfer protocol (FTP) servers.
[0029] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 may include a modulator / demodulator (modem) and / or transmitter.
[0030] In some embodiments, the encoding device 110 may further include a video source 111 in addition to a video encoder 112 and an output interface 113.
[0031] The video source 111 may include at least one of a video acquisition device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system. The video input interface is configured to receive video data from a video content provider, and the computer graphics system is configured to generate video data.
[0032] The video encoder 112 generates a bitstream by encoding video data from the video source 111. The video data may include one or more pictures or a sequence of pictures. The bitstream includes encoding information for the pictures or sequence of pictures. The encoding information may include encoded image data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. The SPS may include parameters applied to one or more sequences, and the PPS may include parameters applied to one or more pictures. A syntax structure is a set of zero or more syntax elements in the bitstream that are arranged in a specified order.
[0033] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored in a storage medium or storage server so that it can be read by the decoding device 120 later.
[0034] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.
[0035] In some embodiments, the decoding device 120 may further include a display device 123 in addition to the input interface 121 and the video decoder 122.
[0036] The input interface 121 includes a receiver and / or modem. The input interface 121 can receive encoded video data via channel 130.
[0037] The video decoder 122 is configured to decode the encoded video data, acquire the decoded video data, and transmit the decoded video data to the display device 123.
[0038] The display device 123 displays the decoded video data. The display device 123 may be built into the decoding device 120 or provided outside the decoding device 120. The display device 123 can include various types of display devices, such as liquid crystal displays (LCDs), plasma displays, organic light-emitting diode (OLED) displays, or other types of display devices.
[0039] Furthermore, Figure 1 is merely an example, and the technical invention of the embodiment of this application is not limited to Figure 1. For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding.
[0040] The following describes a video encoder according to an embodiment of this application.
[0041] Figure 2 is a block diagram showing a video encoder provided by an embodiment of the present application. The video encoder 200 can be configured to perform lossy compression or lossless compression on an image. The lossless compression may be visually lossless compression or mathematically lossless compression.
[0042] The video encoder 200 is applicable to image data in luminance-chroma (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (luma), Cb (U) represents blue chroma, Cr (V) represents red chroma, and U and V represent chroma to describe color and saturation. For example, in color formats, 4:2:0 indicates that there are four luminance components and two chroma components (YYYYCbCr) for every four pixels, 4:2:2 indicates that there are four luminance components and four chroma components (YYYYCbCrCbCr) for every four pixels, and 4:4:4 indicates full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0043] For example, the video encoder 200 reads video data and divides each image in the video data into several coding tree units (CTUs). In some examples, a CTU may be called a "tree block," "largest coding unit (LCU)," or "coding tree block (CTB)." Each CTU can be associated with a pixel block in the image that has the same size as the CTU, and each pixel may correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU may be, for example, 128×128, 64×64, or 32×32. A CTU can then be further divided into several coding units (CUs) to be encoded. A CU may be a rectangular block or a square block. The CU can be further divided into prediction units (PU) and transform units (TU), resulting in the separation of encoding, prediction, and transformation, and allowing for more flexible processing. In one example, the CTU is divided into CUs using a quadtree scheme, and the CUs are then divided into TUs and PUs using a quadtree scheme.
[0044] Video encoders and video decoders can support various PU sizes. Assuming a specific CU size is 2N×2N, video encoders and video decoders can support PU sizes of 2N×2N or N×N for intra-prediction, and symmetrical PUs with sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for inter-prediction. Video encoders and video decoders can also support asymmetrical PUs with sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-prediction.
[0045] In some embodiments, as shown in Figure 2, the video encoder 200 may include a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoding image buffer 270, and an entropy encoding unit 280. The video encoder 200 may also include more, fewer, or different functional units.
[0046] Selectively, in this application, the current block may be called the current CU or current PU, etc. The prediction block may be called the prediction image block or image prediction block. The reconstructed image block may be called the reconstruction block or image reconstruction block.
[0047] In some embodiments, the prediction unit 210 includes an inter-prediction unit 211 and an intra-prediction unit 212. Because there is a strong correlation between adjacent samples in a video picture, the intra-prediction method is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent samples. Because there is a strong similarity between adjacent images in a video, the inter-prediction method is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent images and improve coding efficiency.
[0048] The interpretation unit 211 can be used for interpretation. Interpretation includes motion estimation and motion compensation. Interpretation allows referencing image information from different images, uses motion information to find reference blocks from the reference images, and generates prediction blocks based on the reference blocks, thereby eliminating temporal redundancy. The images used for interpretation can be P-frames and / or B-frames. P-frames refer to forward prediction images, and B-frames refer to bidirectional prediction images. Motion information includes a list of reference images containing the reference images, reference image indices, and motion vectors. Motion vectors can be integer-sample motion vectors or fractional-sample motion vectors. If the motion vector is a fractional-sample motion vector, an interpolation filter must be used on the reference images to generate the necessary fractional-sample blocks. The integer-sample blocks or fractional-sample blocks in the reference images found based on the motion vectors are called reference blocks. There are techniques that use the reference blocks directly as prediction blocks, and techniques that process the reference blocks to generate prediction blocks. The process of generating a prediction block by processing a reference block can also be understood as using the reference block as a prediction block, and then generating a new prediction block by processing the prediction block.
[0049] The intra-prediction unit 212 predicts sample information within the current image block by referencing only information from the same image to eliminate spatial redundancy. The image used for intra-prediction may be an I-frame. For example, as shown in Figure 5, the white 4x4 block is the current block, and the gray samples (also called pixels) in the leftmost row and topmost column of the current block are the reference samples of the current block, and the intra-prediction uses these reference samples to predict the current block. All of these reference samples may be available, i.e., all may have been encoded and decoded. Alternatively, some reference samples may be unavailable. For example, if the current block is at the leftmost end of the image, the reference samples to the left of the current block may be unavailable. Or, when encoding and decoding the current block, the sample in the lower left corner of the current block may not have been encoded and decoded, in which case the reference sample in the lower left corner may also be unavailable. If reference samples are unavailable, the unit may fill in the gaps using available reference samples, any value, and any method, or it may not fill in the gaps.
[0050] In some embodiments, the intra-prediction method further includes a multiple reference line (MRL) intra-prediction method. MRLs can improve encoding efficiency by using more reference samples.
[0051] Intra prediction has several prediction modes. In H.264, nine modes are used for intra prediction of a 4x4 block. Mode 0 copies the sample above the current block vertically into the current block to obtain the predicted value. Mode 1 copies the reference sample to the left of the current block horizontally into the current block to obtain the predicted value. Mode 2 (DC) uses the average of eight samples (A-D and I-L) as the predicted value for all samples. Modes 3 through 8 copy the reference sample to its corresponding position in the current block along a certain angle. Since some positions in the current block cannot perfectly correspond to the reference sample, it is necessary to use a weighted mean of the reference sample or an interpolated subsample of the reference sample.
[0052] The intra-predictive modes used in High Efficiency Video Coding (HEVC) include Plane, DC, and 33 angle modes, for a total of 35 predictive modes. The intra-predictive modes used in Versatile Video Coding (VVC) include Plane, DC, and 65 angle modes, for a total of 67 predictive modes. The intra-predictive modes used in Audio Video Coding Standard (AVS) 3 include DC, Plane, Bilinear, and 63 angle modes, for a total of 66 predictive modes.
[0053] Furthermore, the increase in the number of angle modes will lead to more accurate intra-prediction and better meet the needs of the development of high-resolution and ultra-high-resolution digital video.
[0054] The residual unit 220 can generate residual blocks of the CU based on the sample blocks of the CU and the prediction blocks of the PU of the CU. For example, the residual unit 220 can generate residual blocks of the CU such that each sample in the residual block is equal to the difference between the sample in the sample block of the CU and the corresponding sample in the prediction block of the PU of the CU.
[0055] The conversion / quantization unit 230 can quantize the conversion coefficients. The conversion / quantization unit 230 can quantize the conversion coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. The video encoder 200 can adjust the degree of quantization applied to the conversion coefficients associated with the CU by adjusting the QP value associated with the CU.
[0056] The inverse transformation / quantization unit 240 can reconstruct residual blocks from quantized transformation coefficients by applying inverse quantization and inverse transformation, respectively, to the quantized transformation coefficients.
[0057] The reconstruction unit 250 can generate a reconstructed image block associated with the TU by adding the samples in the reconstructed residual block to the corresponding samples in one or more prediction blocks generated by the prediction unit 210. In this way, the video encoder 200 can reconstruct the sample blocks of the CU by reconstructing the sample blocks of each TU in the CU.
[0058] The loop filtering unit 260 can perform deblocking filtering to reduce blocking artifacts in sample blocks associated with the CU.
[0059] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive offset (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0060] The decoding image buffer 270 can store the reconstructed sample block. The inter-prediction unit 211 can perform inter-prediction on other PUs of images using the reference image containing the reconstructed sample block. In addition, the intra-prediction unit 212 can perform intra-prediction on other PUs of images that are the same as the CU, using the reconstructed sample block in the decoding image buffer 270.
[0061] The entropy encoding unit 280 can receive quantized conversion coefficients from the conversion / quantization unit 230. The entropy encoding unit 280 can generate entropy-coded data by performing one or more entropy coding operations on the quantized conversion coefficients.
[0062] The basic flow of video encoding related to this application is as follows: On the encoding side, the current image (frame) is divided into blocks, and the prediction unit 210 performs intra-prediction or inter-prediction on the current block to generate a predicted block of the current block. The residual unit 220 can calculate a residual block based on the difference between the predicted block and the original block of the current block, i.e., between the predicted block and the original block of the current block, and this residual block is also called residual information. This residual block is transformed and quantized by the transformation / quantization unit 230, thereby removing information that is not sensitive to the human eye and eliminating visual redundancy. Selectively, the residual block before being transformed and quantized by the transformation / quantization unit 230 can be called a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transformation / quantization unit 230 can be called a frequency residual block or frequency-domain residual block. The entropy encoding unit 280 can receive the quantized change coefficient output by the conversion / quantization unit 230 and output a bitstream by entropy encoding the quantized change coefficient. For example, the entropy encoding unit 280 can remove character redundancy based on the target context model and the probability information of the binary bitstream.
[0063] Furthermore, the video encoder inversely quantizes and inversely transforms the quantized conversion coefficients output by the conversion / quantization unit 230 to obtain the residual block of the current block, and adds the residual block of the current block to the predicted block of the current block to obtain the reconstructed block of the current block. As encoding progresses, reconstructed blocks corresponding to other image blocks in the current image are obtained, and these reconstructed blocks are spliced to obtain the reconstructed image of the current image. Errors are introduced during encoding, so the reconstructed image is filtered to reduce these errors. For example, the reconstructed image is filtered using ALF to reduce the difference between the pixel value of a pixel point in the reconstructed image and the original pixel value of the pixel point in the current image. The filtered reconstructed image is stored in the decoding image buffer 270 and can serve as a reference image for interpretation of subsequent images.
[0064] Furthermore, block partitioning information determined on the encoding side, as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, are carried into the bitstream as needed. The decoding side analyzes the bitstream and, by analyzing existing information, determines the same block partitioning information, prediction, transformation, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding side. This ensures that the decoded image acquired on the encoding side and the decoded image acquired on the decoding side are the same.
[0065] Figure 3 is a block diagram showing a video decoder provided by an embodiment of the present application.
[0066] As shown in Figure 3, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / conversion unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoding image buffer 360. The video decoder 300 may also include more, fewer, or different functional units.
[0067] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can extract syntax elements from the bitstream by analyzing it. As part of the bitstream analysis, the entropy decoding unit 310 can analyze the entropy-coded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / conversion unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode the video data based on the syntax elements extracted from the bitstream, i.e., generate the decoded video data.
[0068] In some embodiments, the prediction unit 320 includes an interpretation unit 321 and an intrapretation unit 322.
[0069] Intra Prediction Unit 322 This allows for the generation of prediction blocks for the PU by performing intra-prediction. Intra Prediction Unit 322 This allows for the generation of predicted blocks for PUs based on spatially adjacent PU sample blocks using intra-prediction mode. Intra Prediction Unit 322 Furthermore, the intra-prediction mode of the PU can be determined based on one or more syntax elements analyzed from the bitstream.
[0070] Interpretation Unit 321Based on the syntax elements analyzed from the bitstream, a first reference image list (List 0) and a second reference image list (List 1) can be constructed. Furthermore, if the PU is encoded with interpretation, the entropy decoding unit 310 can analyze the motion information of the PU. Interpretation Unit 321 Based on the movement information of the PU, it is possible to determine one or more reference blocks of the PU. Interpretation Unit 321 It can generate predicted blocks for a PU based on one or more reference blocks of the PU.
[0071] The inverse quantization / conversion unit 330 can inverse quantize (i.e., dequantize) the conversion coefficients associated with TU. The inverse quantization / conversion unit 330 can determine the degree of quantization using the QP value associated with CU of TU.
[0072] After inverse quantization of the conversion coefficients, the inverse quantization / conversion unit 330 can generate residual blocks associated with the TU by applying one or more inverse transformations to the inversely quantized conversion coefficients.
[0073] The reconstruction unit 340 reconstructs the sample block of the CU using the residual block associated with the TU of the CU and the predicted block of the PU of the CU. For example, the reconstruction unit 340 can reconstruct the sample block of the CU and obtain a reconstructed image block by adding the sample in the residual block to the corresponding sample in the predicted block.
[0074] The loop filtering unit 350 can perform a deblocking filtering process to reduce block artifacts in the sample blocks associated with the CU.
[0075] In some embodiments, the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive offset (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0076] The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent predictions, or it can transmit the reconstructed image to a display device for display.
[0077] The basic flow of video decoding related to this application is as follows: The entropy decoding unit 310 can obtain prediction information and quantization coefficient matrix of the current block by analyzing the bitstream, and the prediction unit 320 generates a predicted block of the current block by performing intra-prediction or inter-prediction on the current block based on the prediction information. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the bitstream to inverse quantize the quantization coefficient matrix and perform an inverse transform to obtain a residual block. The reconstruction unit 340 obtains a reconstructed block by adding the predicted block and the residual block. The reconstructed block forms a reconstructed image. The loop filtering unit 350 obtains a decoded image by loop filtering the reconstructed image based on the image or block. The decoded image may also be called a reconstructed image, and the reconstructed image can be displayed by a display device on the one hand, and stored in the decoded image buffer 360 on the other hand, and can be a reference image for inter-prediction of subsequent images.
[0078] The above describes the basic flow of video encoding and decoding in a block-based mixed coding framework. As technology advances, some modules or steps of this framework or flow may be optimized. This application applies to, but is not limited to, the basic flow of video encoding and decoding in the block-based mixed coding framework.
[0079] The following describes the quantization technology related to this application.
[0080] The Japan Video Coding Test Organization (JVET), an international organization for establishing video coding standards, has established a team to research coding models other than H.266 / VCC, and has named this model, namely the platform test software, the Enhanced Compression Model (ECM). Based on the VVC reference software test platform (VVC TEST MODEL, VTM) VTM10.0, ECM has introduced updates and more efficient compression algorithms, and currently boasts coding performance approximately 13% higher than VVC. ECM not only expands the coding unit size for specific resolutions but also utilizes numerous intra-predictive and inter-predictive techniques.
[0081] The technical solution provided by the embodiments of this application can be understood as an improvement on top of ECM reference software to obtain higher encoding efficiency.
[0082] In real-world natural video, the illumination intensity on the video content is constantly changing. For example, the illumination intensity decreases over time, is obscured by clouds, or the camera flash intensity changes. The difference between images in these video contents between previous and subsequent frames is primarily the strength of the DC component of the image, while the texture information within the content remains largely unchanged. However, due to the influence of large DC component values, motion search and motion compensation techniques of interpretation techniques cannot effectively predict these contents, making it easy to encode a large amount of residual information. Local illumination compensation (LIC) techniques can effectively remove this DC redundant information, accurately predict brightness changes, and provide appropriate compensation, thus reducing residual information and improving encoding efficiency. In some embodiments, local illumination compensation techniques are simply called illumination compensation.
[0083] Currently, the latest video coding standard, H.266 / VCC, has already been finalized. JVET proposed exploring video coding standards that surpass VVC in encoding performance, and conducted the VVC-surpassing exploration experiment EE 2. The platform reference software used in the exploration experiment adopted a new algorithm based on VTM10.0, the branch was changed to ECM, and several expert discussion groups were simultaneously established for ECM. The latest version of the ECM reference software, 4.0, surpasses VVC in encoding performance by approximately 15%, but the current latest standard, VVC, is only about 27% more efficient than the previous generation video coding standard, H.265 / HEVC. It can be imagined that ECM may open a window for the exploration and research of next-generation video coding standards in the near future.
[0084] In the initial stages of the proposed ECM, the reference software integrated coding tools not present in VVC, and these encoding tools provided efficient coding performance and processing power for ECM's different encoding scenarios (including LIC).
[0085] The following briefly describes LICs in ECMs according to several embodiments.
[0086] Lighting compensation is an inter-encoding technique. In the inter-encoding process, the current coding unit obtains corresponding reference blocks based on motion vector (MV) information, and these reference blocks typically come from different coding images, or the reference coding unit does not belong to the current image. In a particular scene, there may be significant or slight changes in the different images, and lighting compensation can effectively handle some of these changes.
[0087] For example, referring to Figures 4A and 4B, the texture information in Figures 4A and 4B is basically the same, but the brightness changes in the two are different. Figure 4B appears very bright because it is illuminated by a camera flash. Figure 4A is illuminated by normal natural light. Comparing the two reveals a difference, and this difference places a significant burden on video encoding. If Figure 4A is used as the reference coding unit for Figure 4B, the texture information in both is the same, so the difference in texture detail is small, but the overall residual is large. This is because the pixels in Figure 4B are offset overall due to the effect of the flash, and this offset is included in the residuals of the two. If the residual is directly converted, quantized, and written to the bitstream, the overhead in this part becomes enormous.
[0088] Lighting compensation technology in ECM reference software removes lighting changes, such as the effects of flash and lighting variations, using a linear fitting method, thereby improving the overall predictive effect.
[0089] In some embodiments, the main components of the lighting compensation technology are as follows:
[0090] The relationship between the predicted sample of the current coding unit and the reference sample is fitted using the relationship between the reconstructed sample of the reference unit and the adjacent portion of the reference coding unit (also called the reference block) and the current coding unit (also called the current block). If upper and left reconstructed samples adjacent to the current coding unit exist, they can be obtained, as can upper and left reconstructed samples adjacent to the reference coding unit in the reference image. By modeling the reconstructed samples of the current image and the reconstructed samples of the reference image, a corresponding fitting model can be obtained.
[0091] JPEG0007879949000001.jpg57152
[0092] JPEG0007879949000002.jpg57152
[0093] In the digital video coding process, the current image coding block is compensated for by using an illumination compensation model to compensate for illumination differences, as shown in Figure 5, to obtain a compensated predicted block.
[0094] The scaling factor a and offset parameter b are calculated based on the adjacent reconstructed samples of the corresponding reference block in the reference image and the adjacent reconstructed samples of the coding block in the current image. As shown in Figure 6, the scaling factor a and offset parameter b are obtained by modeling based on the relationship between the adjacent reconstructed samples of the coding unit in the current image and the adjacent reconstructed samples of the reference block at the corresponding position in the reference image.
[0095] As shown in Figure 6, each reconstructed sample (also called a reconstructed pixel) is the nearest adjacent reconstructed sample of the CU. The reference image CU is the corresponding reconstructed CU in the reference image and is also called the reference CU or reference block. The current image CU is the CU to be encoded in the current image and is also called the current CU or current block. By modeling the corresponding reconstructed samples in the two images and finding a linear relationship, we obtain the scaling parameter a and the offset parameter b, and apply the linear relationship to the reference image CU to obtain the predicted block of the current image CU.
[0096] The illumination compensation model is a linear model in ECM, and the model parameters include a scaling factor a and an offset parameter b. Selectively, the two parameters are obtained by the least squares error method. The number of reconstructed samples to be selected is determined based on the width and height of the current coding unit. In some embodiments, if at least one of the width and height of the current coding unit is equal to 4, then 4 reconstructed samples are selected from the upper adjacent reconstructed samples of the coding unit and 4 reconstructed samples are selected from the left adjacent reconstructed samples of the coding unit. For example, if the width of the current coding unit is 16 and the height is 4, then all 4 left adjacent reconstructed samples are selected and 4 reconstructed samples are selected from the upper adjacent reconstructed samples with a step size of 3. If the width and height of the current coding unit are not equal to 4, then log(log2(minimum width and height)) samples are taken from the upper adjacent reconstructed samples, and log(log2(minimum width and height)) samples are taken from the left adjacent reconstructed samples, each with a base of 2.
[0097] JPEG0007879949000003.jpg95152
[0098] If the reconstructed samples used to calculate the linear mode parameters belong to the interprediction block, interpolation is required.
[0099] In some embodiments, illumination compensation techniques in the ECM can operate on ordinary inter-prediction mode, merge-prediction mode, and sub-block mode. Ordinary inter-prediction mode is the inter mode, merge-prediction mode is the merge-prediction technique, i.e., the merge mode, and sub-block mode is the affine mode. At the same time, illumination compensation techniques are applied only to single-frame prediction mode and are not available in multi-frame bidirectional reference mode.
[0100] In some embodiments, illumination compensation techniques in the ECM are related to the techniques employed. For example, illumination compensation techniques are not used in conjunction with bidirectional optical flow (BDOF) techniques or symmetric motion vector difference (SMVD) techniques.
[0101] In the illumination compensation technique described in the above embodiment, when determining parameters a and b, if both the upper reconstructed sample and the left reference sample are available, the upper reconstructed sample and the left reconstructed sample of the current block and the reference block are selected.
[0102] However, in some cases, for example, if the samples within a coding block differ significantly, being similar to one reconstructed sample and remarkably different from the other, the current coding block cannot be accurately predicted based on the upper and left reconstructed samples, resulting in problems such as insufficient or excessive linear offset.
[0103] To solve the technical problems described above, embodiments of the present invention increase the selection method for reconstruction samples, i.e., increase the number of reconstruction sample modes, for example, by increasing the left-side reconstruction sample mode and / or the upper-side reconstruction sample mode, where all reconstruction samples in the left-side reconstruction sample mode are obtained from the left-side adjacent sample of the image block, and all reconstruction samples in the upper-side reconstruction sample mode are obtained from the upper-side adjacent sample of the image block. In this way, when performing illumination compensation on the predicted value of the current block, it is possible to select from multiple reconstruction sample modes depending on the actual situation, thereby enhancing the effect of light illumination compensation and improving prediction performance.
[0104] The technical solution provided by the embodiments of this application will be described in detail below with reference to specific embodiments.
[0105] First, let's refer to Figure 7 and explain the decoding side as an example.
[0106] Figure 7 is a flowchart of a video decoding method provided by an embodiment of the present application. The embodiment of the present application is applicable to the video decoders shown in Figures 1 and 3. As shown in Figure 7, the method of the embodiment of the present invention includes the following steps.
[0107] S401 decodes the bitstream and predicts the current block to obtain the first predicted value for the current block.
[0108] When decoding the current block, the decoding side decodes the bitstream to determine the prediction mode corresponding to the current block, predicts the current block based on the prediction mode, and obtains the predicted value of the current block. In the embodiments of this application, illumination compensation is performed on the predicted value obtained in this step to obtain a new predicted value. For the sake of explanation, in the embodiments of this application, the predicted value obtained based on the prediction mode is recorded as the first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as the second predicted value.
[0109] The embodiments of this application do not limit the current block prediction method.
[0110] In some embodiments, an interpretation mode is used to predict the current block and obtain a first predicted value for the current block. For example, the bitstream is decoded to obtain motion information corresponding to the current block, the reference block is found in the reference image based on the motion information, and the first predicted value for the current block is generated based on the reference block. Exemplaryly, the motion information includes a list of reference images in which the reference image is located, the reference image index, and a motion vector. The motion vector can be an integer-sample motion vector or a fractional-sample motion vector. If the motion vector is a fractional-sample motion vector, an interpolation filter must be used on the reference image to generate the required fractional-sample blocks. The integer-sample or fractional-sample blocks in the reference image found based on the motion vector are called reference blocks. In some embodiments, the reference block is used directly as the predicted block. In some embodiments, the predicted block is generated by further processing based on the reference block.
[0111] S402, Confirm the current block reconstruction sample mode.
[0112] Here, the reconstructed sample mode is one of N candidate modes. The N candidate modes include at least one of the upper reconstructed sample mode, the left reconstructed sample mode, and the upper and left reconstructed sample modes.
[0113] There are no strict sequential requirements for S402 and S401 during execution. For example, S402 can be executed before S401, after S401, or synchronously with S401, and the embodiments of this application are not limited to these.
[0114] As described above, in order to improve the prediction effect, illumination compensation is applied to the obtained first prediction value to obtain a second prediction value. Specifically, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined, the linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the linear transformation is applied to the first prediction value based on the linear transformation parameters to obtain a second prediction value for the current block.
[0115] To enhance the illumination compensation effect, embodiments of this application add several novel methods for determining the reconstructed sample, such as an upper reconstructed sample mode and / or a left-side reconstructed sample mode.
[0116] Left-side reconstruction sample mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the left-side adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the left-side adjacent reconstruction samples of the reference block.
[0117] Upper Reconstruction Sample Mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the upper adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the upper adjacent reconstruction samples of the reference block.
[0118] The upper and left-side reconstruction sample mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the upper and left-side adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the upper and left-side adjacent reconstruction samples of the reference block.
[0119] When the decoding side decodes, it first determines the reconstruction sample mode of the current block. The reconstruction sample mode of the current block is one of N candidate modes. The N candidate modes include at least one of the upper reconstruction sample mode, left reconstruction sample mode, and upper and left reconstruction sample modes. That is, in the embodiments of this application, the reconstruction sample mode of the current block can be one of the upper reconstruction sample mode, left reconstruction sample mode, and upper and left reconstruction sample modes. Therefore, there is a rich selection mode for reconstruction samples, and it is possible to accurately determine a reconstruction sample mode that matches the current block feature information from each of the above modes. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be determined more accurately. Based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, linear transformation parameters are determined, and based on the linear transformation parameters, a linear transformation is performed on the first predicted value of the current block to obtain an accurate second predicted value, thereby improving the illumination compensation effect of the current block and improving the prediction effect of the current block.
[0120] In embodiments of this application, the method by which the decoding side determines the reconstruction sample mode of the current block includes, but is not limited to, several types.
[0121] Method I, the current block's reconstruction sample mode is indicated by an index, in which case step S402 includes the following steps S402-A1 and S402-A2.
[0122] S402-A1, the first index that indicates the reconstructed sample mode is determined.
[0123] S402-A1 determines the reconstruction sample mode for the current block based on the first index corresponding to the current block.
[0124] In method I, the first index indicates the reconstruction sample mode of the current block. When the decoding side determines the reconstruction sample mode of the current block, it first determines the first index, and then determines the reconstruction sample mode of the current block based on the first index.
[0125] For illustrative purposes, let's assume that there are N candidate modes as shown in Table 1.
[0126] JPEG0007879949000004.jpg41157
[0127] The embodiments of this application do not limit the specific modes and number of modes of the N candidate modes. Exemplarily, as shown in Table 1, the N candidate modes include an upper reconstruction sample mode, a left reconstruction sample mode, and upper and left reconstruction sample modes. The upper reconstruction sample mode has an index of 0, the left reconstruction sample mode has an index of 1, and the upper and left reconstruction sample modes have an index of 2. Note that the indices corresponding to each mode shown in Table 1 are illustrative and this application is not limited thereto.
[0128] As shown in Table 1, each candidate mode corresponds to one index. Therefore, when the decoding side determines the reconstruction sample mode of the current block, it can determine the first index and then determine the reconstruction sample mode of the current block based on the first index. For example, if the first index is 1, as shown in Table 1, index 1 corresponds to the left-side reconstruction sample mode, so the decoding side determines that the reconstruction sample mode of the current block is the left-side reconstruction sample mode.
[0129] In S402-A1, the method for determining the first index corresponding to the current block includes, but is not limited to, the following types:
[0130] Method 1: Decode the bitstream to obtain the first index corresponding to the current block.
[0131] Specifically, the encoding side selects one mode from N candidate modes, for example, the candidate mode with the lowest cost, and sets it as the reconstruction sample mode for the current block. It then writes the first index of the reconstruction sample mode to the bitstream. In this way, when the decoding side decodes, it decodes the bitstream to obtain the first index, and then determines the reconstruction sample mode for the current block based on that first index.
[0132] In Method 1, the decoding side can directly obtain the first index from the bitstream, the calculation process is simple, and the decoding complexity on the decoding side is reduced, and the decoding efficiency on the decoding side is increased.
[0133] Method 2: If the prediction mode of the current block is merge mode, the decoding side determines the first index by steps S402-A1-11 and S402-A1-12 as follows.
[0134] S402-A1-11 determines the first flag of the adjacent block to the current block, and the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology.
[0135] S402-A1-12, the first index is determined based on the first flag of the adjacent block.
[0136] In method 2, if the decoding side determines that the prediction mode of the current block is merge mode, the decoding side can determine the first index based on the relevant decoding information of the adjacent blocks of the current block. The adjacent blocks of the current block are decoded blocks, the relevant decoding information of the adjacent blocks is known, and when decoding the current block, the decoding side can obtain the decoding information of the adjacent blocks from the adjacent blocks.
[0137] Selectively, the adjacent block to the current block may also be the block adjacent to the current block above.
[0138] Selectively, the block adjacent to the current block may also be the block adjacent to the current block to its left.
[0139] In some embodiments, the illumination compensation technology provided by the embodiments of this application is referred to as the illumination compensation technology.
[0140] When the decoding side performs illumination compensation for the current block, if the prediction mode of the current block is merge mode, the decoding side determines whether the current block uses illumination compensation technology based on whether the adjacent blocks of the current block use illumination compensation technology. For example, if the adjacent blocks use illumination compensation technology, the decoding side will determine that the current block also uses illumination compensation technology.
[0141] Based on this, the decoding side obtains the first flag of the adjacent block and determines the first index based on the first flag of the adjacent block. The first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology.
[0142] The embodiments of this application do not limit the method for determining the first index based on the first flag of the adjacent block in S402-A1-12.
[0143] In one possible embodiment, if the first flag of an adjacent block indicates that the adjacent block is using Local Illumination Compensation (LIC) technique, the first index is determined to be the default index, and the default index is used to indicate the upper and left reconstructed sample modes. That is, in this embodiment, if the prediction mode of the current block is merge mode and the adjacent block of the current block is using illumination compensation technique, illumination compensation is performed on the first predicted value of the current block using the upper and left reconstructed sample modes to obtain the second predicted value of the current block.
[0144] In another possible embodiment, if the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, a second index is determined, and the second index is used to indicate the reconstructed sample mode of the adjacent block, and the second index is determined as the first index. In this embodiment, if the prediction mode of the current block is merge mode and the adjacent block of the current block is using illumination compensation technology, the current block not only inherits the flag of the adjacent block but also inherits the index of the adjacent block, and the second index corresponding to the adjacent block is determined as the first index of the current block.
[0145] In some embodiments, if the first flag of an adjacent block indicates that the adjacent block is not using local illumination compensation techniques, it is determined that the current block will also not use the illumination compensation extension scheme provided by embodiments of this application and will perform illumination compensation using the same illumination compensation scheme as the adjacent block. For example, illumination compensation may be performed on the first predicted value of the current block using upper and left reconstructed sample modes to obtain the second predicted value of the current block. Alternatively, illumination compensation may not be performed on the first predicted value of the current block.
[0146] Method 3: If the prediction mode of the current block is non-merging mode, the decoding side determines the first index by steps S402-A1-21 to S402-A1-23 as follows.
[0147] S402-A1-21 determines the first flag of the current block, which is used to indicate whether or not the current block uses lighting compensation technology.
[0148] S402-A1-22, the first flag of the current block is used to determine the second flag of the current block if the current block is to use illumination compensation technology, and the second flag of the current block is used to indicate whether or not the current block is to use illumination compensation extension technology.
[0149] S402-A1-23, determine the first index based on the second flag of the current block.
[0150] For example, if the first flag of the current block is 1, it instructs the current block to use lighting compensation technology, and if the first flag of the current block is 0, it instructs the current block not to use lighting compensation technology.
[0151] If the first flag of the current block indicates that the current block will not use illumination compensation techniques, for example, if the first flag of the current block is 0, the decoding side either confirms the first predicted value as the second predicted value, or processes the first predicted value using another method to obtain the second predicted value.
[0152] If the first flag of the current block indicates that the current block uses illumination compensation technology, for example, if the first flag of the current block is 1, the decoding side determines the second flag of the current block, and the second flag of the current block is used to indicate whether or not the current block uses the illumination compensation extension technology of this application.
[0153] For example, if the second flag of the current block is 1, it instructs the current block to use lighting compensation enhancement technology, and if the second flag of the current block is 0, it instructs the current block not to use lighting compensation enhancement technology.
[0154] In the embodiments of this application, the decoding side can determine the first index based on the second flag of the current block.
[0155] For example, if the second flag of the current block indicates that the current block uses illumination compensation extension techniques, the first index is obtained by decoding the bitstream.
[0156] In another example, if the second flag of the current block indicates that the current block does not use illumination compensation extension techniques, then the first index is determined to be the default index, which is used to indicate the upper and left reconstructed sample modes.
[0157] In some embodiments, the decoding side obtains the first flag of the current block by decoding the bitstream. That is, the encoding side 、 The first flag of the current block can be determined, written to the bitstream, and the decoding side can directly decode it to obtain the first flag of the current block.
[0158] In some embodiments, the decoding side obtains the second flag of the current block by decoding the bitstream. That is, the encoding side determines the second flag of the current block and writes the second flag of the current block to the bitstream, and the decoding side can directly decode and obtain the second flag of the current block.
[0159] In some embodiments, the first flag includes at least one of a sequence-level flag, a picture-level flag, and a block-level flag.
[0160] In one example, the first flag includes a sequence level flag to indicate whether the current sequence uses illumination compensation technology.
[0161] Selectively, the `sps_lic_enable_flag` can be used to represent the sequence level flag.
[0162] Selectively, the sequence level flag can be located in the sequence header.
[0163] In another example, the first flag includes a picture-level flag to indicate whether the current image uses lighting compensation techniques.
[0164] Selectively, the picture-level flag can be represented using ph_lic_enable_flag.
[0165] Selectively, the picture level flag can be located at the picture header.
[0166] In another example, the first flag includes a block-level flag to indicate whether the image block uses illumination compensation techniques.
[0167] Selectively, block-level flags can be represented using lic_flag.
[0168] In some embodiments, the first flag may further include a slice level flag, a unit level flag, and so on.
[0169] In some embodiments, the second flag includes a block-level flag.
[0170] Selectively, the second flag can be represented using the syntax `lic_ext`.
[0171] Taking the second flag "lic_ext" as an example, if lic_ext is 1, it is determined that the current block does not use the illumination compensation extension technology proposed in this application, and if lic_ext is 0, it is determined that the current block uses the illumination compensation extension technology proposed in this application.
[0172] In one possible embodiment, the coding unit-level syntax (CU-level syntax) is as shown in Table 2.
[0173] JPEG0007879949000005.jpg77137
[0174] The decoding side parses the syntax shown in Table 2. First, it obtains the first flag of the current block, which includes sps_lic_enable_flag and ph_lic_enable_flag. If sps_lic_enable_flag=1, it is confirmed that the current sequence uses illumination compensation technology. Next, the decoding side parses ph_lic_enable_flag, and if ph_lic_enable_flag=1, it is confirmed that the current image or current frame uses illumination compensation technology. Next, the decoding side parses lic_flag, and if lic_flag=1, it is explained that the current block uses illumination compensation technology. Next, the decoding side parses the second flag of the current block, lic_ext, and if lic_ext=0, it is explained that the current block does not use the illumination compensation enhancement technology proposed in this application. In this case, the reconstruction sample mode of the current block is the upper and left reconstruction sample mode. If lic_ext=1, it is explained that the current block uses the illumination compensation enhancement technology proposed in this application. In this case, the decoding side then decodes the bitstream to obtain the first index, lic_index. If lic_index=0, it is determined that the reconstruction sample mode of the current block is the upper reconstruction sample mode, and if lic_index=1, it is determined that the reconstruction sample mode of the current block is the left reconstruction sample mode.
[0175] In the embodiments of this application, the decoding side determines a first index, then determines the reconstruction sample mode of the current block based on the first index, determines the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block based on the reconstruction sample mode, determines the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and linearly transforms the first predicted value of the current block based on the linear transformation parameters to obtain the second predicted value of the current block, thereby achieving accurate illumination compensation for the current block.
[0176] In addition to determining the reconstruction sample mode of the current block using method I described above, the decoding side can also determine the reconstruction sample mode of the current block using method II described below.
[0177] Method II: If the prediction mode of the current block is merge mode, the reconstruction sample mode of the current block is determined based on the decoding information of the adjacent blocks of the current block. In this case, S402 includes the following steps S402-B1 and S402-B2.
[0178] S402-B1, current block of The first flag of the adjacent block is determined, and the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology.
[0179] S402-B2 determines the reconstruction sample mode of the current block based on the first flag of the adjacent block.
[0180] In Method II, if the decoding side determines that the prediction mode of the current block is merge mode, it does not determine the first index, but instead directly determines the reconstruction sample mode of the current block based on the first flag of the adjacent block to the current block. This process is simpler and more efficient.
[0181] The process for determining the first flag of the adjacent block to the current block in S402-B1 can be found in the explanation in S402-A11 and will not be described in detail here.
[0182] The method for determining the reconstruction sample mode of the current block based on the first flag of the adjacent block in S402-B2 includes, but is not limited to, the following types:
[0183] Method 1: If the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, then the current block's reconstruction sample mode is determined to be the upper and left-side reconstruction sample mode.
[0184] In Method 1, if the prediction mode of the current block is merge mode and the adjacent blocks of the current block use illumination compensation technology, the decoding side defaults to the upper and left reconstruction sample mode of the current block and directly uses the upper and left reconstruction sample mode to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value of the current block.
[0185] Method 2: If the first flag of an adjacent block indicates that the adjacent block will use lighting compensation technology, the reconstruction sample mode of the adjacent block is determined, and the reconstruction sample mode of the adjacent block is determined as the reconstruction sample mode of the current block.
[0186] In Method 2, if the prediction mode of the current block is merge mode and the adjacent block of the current block uses illumination compensation technology, the decoding side determines the reconstructed sample mode of the adjacent block of the current block as the reconstructed sample mode of the current block. Specifically, the decoding side obtains the reconstructed sample mode of the adjacent block, performs illumination compensation on the first predicted value of the current block using the reconstructed sample mode of the adjacent block, and obtains the second predicted value.
[0187] The methods by which the decoding side determines the reconstruction sample mode of the adjacent blocks to the current block include at least the following examples.
[0188] Example 1: The decoding side directly obtains the reconstruction sample mode of the adjacent block from the adjacent block.
[0189] Example 2: The decoding side obtains a second index from the adjacent block, and this second index is used to indicate the reconstruction sample mode of the adjacent block. Based on the second index, the decoding side determines the reconstruction sample mode of the adjacent block. For example, as shown in Table 1, if the second index is 0, it is determined that the reconstruction sample mode of the adjacent block is the upper reconstruction sample mode.
[0190] In Method II, when predicting the current block using merge mode, the decoding side directly determines the reconstruction sample mode of the current block based on the first flag and / or first index of the adjacent blocks of the current block.
[0191] The decoding side determines the reconstruction sample mode of the current block based on Method I or Method II, and then performs the following step S403.
[0192] S403, Based on the current block's reconstruction sample mode, determine the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block.
[0193] The adjacent reconstruction sample of the current block is a reconstruction sample determined from the left-side reconstruction sample and / or upper-side reconstruction sample of the current block, based on the reconstruction sample mode of the current block.
[0194] The adjacent reconstruction sample of the reference block is a reconstruction sample determined from the left-side reconstruction sample and / or upper-side reconstruction sample of the reference block of the current block, based on the reconstruction sample mode of the current block.
[0195] In the embodiments of this application, if the reconstruction sample mode of the current block is different, then the determined adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are also different.
[0196] Next, we will explain S403 using the left-side reconstruction sample mode and the upper-side reconstruction sample mode as examples.
[0197] In some embodiments, if the current block reconstruction sample mode is left-side reconstruction sample mode, S403 includes the following step S403-A.
[0198] S403-A: Based on the left-side adjacent sample of the current block, the adjacent reconstructed sample of the current block is determined, and based on the left-side adjacent sample of the reference block corresponding to the current block in the reference image, the adjacent reconstructed sample of the reference block is determined.
[0199] In this embodiment, if the reconstruction sample mode of the current block is left-side reconstruction sample mode, the adjacent reconstruction samples of the current block are determined from the left-side adjacent samples, and all left-side adjacent samples are reconstruction samples. For example, as shown in Figure 8A, the adjacent reconstruction samples of the current block are determined based on the left-side adjacent samples of the current block. Furthermore, for example, the reference block of the current block is determined in the reference image. As shown in Figure 8B, the adjacent reconstruction samples of the reference block are determined based on the left-side adjacent samples of the reference block in the reference image. Furthermore, the linear transformation parameter is determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameter to obtain the second predicted value of the current block.
[0200] The embodiments of this application do not limit the specific method for determining the adjacent reconstructed sample of the current block based on the left adjacent sample of the current block in S403-A.
[0201] In one embodiment, multiple reconstruction samples adjacent to the left of the current block are identified as adjacent reconstruction samples of the current block.
[0202] In another embodiment, as shown in Figure 8A, the adjacent reconstruction sample of the current block is determined based on the height of the current block and the left-side adjacent sample of the current block.
[0203] Example 1: Reconstruction samples adjacent to the left of the current block and within the height range of the current block are identified as adjacent reconstruction samples of the current block. For example, if the height of the current block is 4, the four reconstruction samples adjacent to the left of the current block are identified as adjacent reconstruction samples of the current block.
[0204] Example 2: If the height of the current block is equal to the first number, select the first number of samples from the left-side adjacent samples of the current block and confirm them as the adjacent reconstruction samples of the current block.
[0205] The embodiments of this application are not limited to a specific value for the first numerical value.
[0206] Selectively, the first value is 4. That is, if the height of the current block is equal to 4, then 4 samples are selected from the left-side adjacent samples of the current block and confirmed as adjacent reconstruction samples of the current block.
[0207] Example 2: If the height of the current block is not equal to the first number, select the second number of samples from the left-side adjacent samples of the current block and confirm them as adjacent reconstruction samples of the current block.
[0208] The embodiments of this application are not limited to a specific value for the second numerical value.
[0209] For example, the second value is 4 or greater.
[0210] Selectively, the second value is the logarithm of the height with the third value as the base (log 第三数値 This is the value obtained by rounding the (height) to the nearest whole number.
[0211] The embodiments of this application are not limited to a specific value for the third numerical value.
[0212] Selectively, the third value is 2.
[0213] The second value is obtained by rounding the value of log2(height).
[0214] For example, assuming the current block height is 32, the second value is determined to be 5. Furthermore, the decoding side selects 5 samples from the 16 left-side adjacent samples of the current block to form adjacent reconstruction samples of the current block. These 5 samples may be selected with equal step sizes or randomly, and embodiments of this application are not limited thereto.
[0215] Similarly, embodiments of this application do not limit the specific method for determining adjacent reconstruction samples of a reference block based on the left-side adjacent sample of the reference block corresponding to the current block in the reference image, as in S403-A.
[0216] In one embodiment, multiple reconstructed samples adjacent to the left of a reference block in a reference image are identified as adjacent reconstructed samples of the reference block.
[0217] In another embodiment, as shown in Figure 8B, the adjacent reconstruction sample of the reference block is determined based on the height of the reference block and the left-side adjacent sample of the reference block.
[0218] Example 1: Reconstructed samples adjacent to the left of the reference block in the reference image and within the height range of the reference block are identified as adjacent reconstruction samples of the reference block. For example, if the height of the reference block is 4, the four reconstructed samples adjacent to the left of the reference block in the reference image are identified as adjacent reconstruction samples of the reference block.
[0219] Example 2: If the height of the reference block is equal to the first number, the left-side adjacent samples of the reference block are interpolated to obtain the first number of samples, which are then used as the adjacent reconstructed samples of the reference block.
[0220] The embodiments of this application are not limited to a specific value for the first numerical value.
[0221] Selectively, the first value is 4. That is, if the height of the reference block is equal to 4, the left-side adjacent samples of the reference block are interpolated to obtain 4 samples, which are then determined as the adjacent reconstructed samples of the reference block.
[0222] Example 2: If the height of the reference block is not equal to the first number, interpolate the left-side adjacent samples of the reference block to obtain a second number of samples, which are then used as the adjacent reconstructed samples of the reference block.
[0223] The embodiments of this application are not limited to a specific value for the second numerical value.
[0224] For example, the second value is 4 or greater.
[0225] Selectively, the second value is the logarithm of the height with the third value as the base (log 第三数値 This is the value obtained by rounding the (height) to the nearest whole number.
[0226] The embodiments of this application are not limited to a specific value for the third numerical value.
[0227] Selectively, the third value is 2.
[0228] The second value is obtained by rounding the value of log2(height).
[0229] For example, assuming the height of the reference block is 32, the second value is determined to be 5. Furthermore, the decoding side interpolates the 16 left-side adjacent samples of the reference block to obtain 5 samples, which are then used as the adjacent reconstruction samples of the reference block.
[0230] In embodiments of this application, when the reconstruction sample mode of the current block is left-side reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined based on any of the above-described methods, wherein the adjacent reconstruction samples of the current block are related only to the left-side adjacent samples of the current block, and the adjacent reconstruction samples of the reference block are related only to the left-side adjacent samples of the reference block.
[0231] In some embodiments, if the current block reconstruction sample mode is the upper reconstruction sample mode, S403 includes the following step S403-B.
[0232] S403-B: Based on the upper adjacent sample of the current block, the adjacent reconstructed sample of the current block is determined, and based on the upper adjacent sample of the reference block corresponding to the current block in the reference image, the adjacent reconstructed sample of the reference block is determined.
[0233] In this embodiment, when the reconstruction sample mode of the current block is the upper reconstruction sample mode, the adjacent reconstruction samples of the current block are determined from the upper adjacent samples, and all upper adjacent samples are reconstruction samples. For example, as shown in Figure 9A, the adjacent reconstruction samples of the current block are determined based on the upper adjacent samples of the current block. Furthermore, for example, the reference block of the current block is determined in the reference image. As shown in Figure 9B, the adjacent reconstruction samples of the reference block are determined based on the upper adjacent samples of the reference block in the reference image. Furthermore, linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameters to obtain the second predicted value of the current block.
[0234] The embodiments of this application do not limit the specific method for determining the adjacent reconstruction sample of the current block based on the upper adjacent sample of the current block in S403-B.
[0235] In one embodiment, multiple reconstruction samples adjacent to the upper side of the current block are identified as adjacent reconstruction samples of the current block.
[0236] In another embodiment, as shown in Figure 9A, the current block width Based on the upper adjacent sample of the current block, the adjacent reconstructed sample of the current block is determined.
[0237] Example 1, adjacent to the top of the current block and the current block width The reconstructed samples within the range are identified as adjacent reconstructed samples of the current block. For example, the current block width If the value is 4, the four reconstruction samples adjacent to the top of the current block are identified as adjacent reconstruction samples of the current block.
[0238] Example 2, the current block width If the value is equal to the first number, select the first number of samples from the upper adjacent samples of the current block and confirm them as the adjacent reconstruction samples of the current block.
[0239] The embodiments of this application are not limited to a specific value for the first numerical value.
[0240] Selectively, the first number is 4. That is, the current block width If the value is equal to 4, select four samples from the upper adjacent samples of the current block and confirm them as adjacent reconstruction samples for the current block.
[0241] Example 2, the current block width If the value is not equal to the first value, select two numerical samples from the upper adjacent samples of the current block and confirm them as adjacent reconstruction samples for the current block.
[0242] The embodiments of this application are not limited to a specific value for the second numerical value.
[0243] For example, the second value is 4 or greater.
[0244] Selectively, the second value has the third value as its base. width logarithm of (log 第三数値 ( width This is the value obtained by rounding the value to the nearest integer.
[0245] The embodiments of this application are not limited to a specific value for the third numerical value.
[0246] Selectively, the third value is 2.
[0247] The second value is log2( width This is a numerical value obtained by rounding the value of ).
[0248] For example, the current block width Assuming that is 32, the second value is determined to be 5. Furthermore, the decoding side selects 5 samples from the 16 upper neighbor samples of the current block to form the neighbor reconstruction samples of the current block. These 5 samples may be selected with equal step sizes or randomly, and embodiments of this application are not limited thereto.
[0249] Similarly, the embodiments of this application do not limit the specific method for determining adjacent reconstruction samples of a reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image, as in S403-B.
[0250] In one embodiment, multiple reconstructed samples adjacent to the upper side of a reference block in a reference image are identified as adjacent reconstructed samples of the reference block.
[0251] In another embodiment, as shown in Figure 9B, the reference block width Based on the upper adjacent sample of the reference block, it is determined to be an adjacent reconstruction sample of the reference block.
[0252] Example 1, adjacent to the upper side of the reference block in the reference image and the reference block width The reconstructed samples within the range are identified as adjacent reconstructed samples of the reference block. For example, the reference block width If the value is 4, the four reconstructed samples adjacent to the upper side of the reference block in the reference image are identified as adjacent reconstructed samples of the reference block.
[0253] Example 2, Reference block width If the value is equal to the first value, the upper adjacent samples of the reference block are interpolated to obtain the first value of samples, which are then used as the adjacent reconstructed samples of the reference block.
[0254] The embodiments of this application are not limited to a specific value for the first numerical value.
[0255] Selectively, the first number is 4. That is, the reference block width If the value is equal to 4, the upper adjacent samples of the reference block are interpolated to obtain 4 samples, which are then used as the adjacent reconstructed samples of the reference block.
[0256] Example 2, Reference block width If the first value is not equal to the second value, interpolate the upper adjacent samples of the reference block to obtain a second number of samples, which will be used as the adjacent reconstructed samples of the reference block.
[0257] The embodiments of this application are not limited to a specific value for the second numerical value.
[0258] For example, the second value is 4 or greater.
[0259] Selectively, the second value has the third value as its base. width logarithm of (log 第三数値 ( width This is the value obtained by rounding the value to the nearest integer.
[0260] The embodiments of this application are not limited to a specific value for the third numerical value.
[0261] Selectively, the third value is 2.
[0262] The second value is log2( width This is a numerical value obtained by rounding the value of ).
[0263] For example, the reference block width Assuming that is 32, the second value is determined to be 5. Furthermore, the decoding side interpolates the 16 upper neighbor samples of the reference block to obtain 5 samples, which are then used as the neighbor reconstruction samples of the reference block.
[0264] In embodiments of this application, when the current block reconstruction sample mode is the upper reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined based on any of the above-described methods, wherein the adjacent reconstruction samples of the current block are related only to the upper adjacent samples of the current block, and the adjacent reconstruction samples of the reference block are related only to the upper adjacent samples of the reference block.
[0265] The decoding side determines the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block using the method described above, and then executes S404 below.
[0266] S404, linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and a linear transformation is performed on the first predicted value based on the linear transformation parameters to obtain the second predicted value of the current block.
[0267] Embodiments of this application do not limit the specific method for determining linear transformation parameters based on adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block.
[0268] In some embodiments, when the linear transformation parameters include a scaling factor and an offset parameter, determining the linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block in S404 comprises the following steps.
[0269] S404-A1. Determine the scaling factor based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block.
[0270] S404-A2. Determine the offset parameter based on the adjacent reconstructed samples of the current block, the adjacent reconstructed samples of the reference block, and the scaling factor.
[0271] The embodiments of the present application are not limited to the method of determining the scaling factor based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block in S404-A1.
[0272] In one possible embodiment, determine the ratio between the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block as the scaling factor a.
[0273] In another possible embodiment, determine the scaling factor a according to the above formula (3).
[0274] In the embodiments of the present disclosure, the method of determining the offset parameter based on the adjacent reconstructed samples of the current block, the adjacent reconstructed samples of the reference block, and the scaling factor in S404-A2 is not limited.
[0275] In one possible embodiment, determine the offset parameter b according to the above formula (4).
[0276] Based on the method described above, after determining the linear transformation parameters, a linear transformation is performed on the first predicted value using the linear transformation parameters to obtain the second predicted value for the current block. For example, the product of the scaling factor and the first predicted value is determined. Then, the sum of this product and the offset parameter is determined as the second predicted value.
[0277] JPEG0007879949000006.jpg13114
[0278] JPEG0007879949000007.jpg20153
[0279] In some embodiments, if the current image to which the current block belongs is a first-type image, the illumination compensation extension technique submitted by embodiments of this application is performed, i.e., S402 above, to determine the reconstruction sample mode of the current block.
[0280] Embodiments of this disclosure do not limit the specific type of first type image.
[0281] Selectively, if the first type image is a B-frame, i.e., if the current image is a B-frame, the illumination compensation extension technology submitted in this application is enabled by default.
[0282] In some embodiments, if the area of the current block is greater than or equal to a preset threshold, the illumination compensation extension technique proposed in the embodiments of this application is performed, i.e., S402 described above, to determine the reconstruction sample mode of the current block.
[0283] This application is not limited to specific values of pre-set thresholds.
[0284] Selectively, if the preset threshold is 64, that is, if the area of the current block is greater than or equal to the preset threshold, the illumination compensation extension technique proposed in this application is executed, i.e., S402 described above, which determines the reconstruction sample mode of the current block.
[0285] The video decoding method provided in the embodiments of this application is as follows: Decode the bitstream and predict the current block to obtain a first predicted value for the current block. Determine the reconstruction sample mode for the current block. The reconstruction sample mode is one of N candidate modes. The N candidate modes include at least one of the upper reconstruction sample mode, left reconstruction sample mode, and upper and left reconstruction sample mode. Based on the reconstruction sample mode for the current block, determine the adjacent reconstruction samples for the current block and the adjacent reconstruction samples for the reference block. Based on the adjacent reconstruction samples for the current block and the adjacent reconstruction samples for the reference block, determine the linear transformation parameters, and perform a linear transformation on the first predicted value based on the linear transformation parameters to obtain a second predicted value for the current block. In the embodiments of this application, the reconstruction sample mode for the current block can be one of the upper reconstruction sample mode, left reconstruction sample mode, and upper and left reconstruction sample mode. Therefore, there is a rich selection mode for reconstruction samples, and a reconstruction sample mode that matches the current block feature information can be accurately determined from each of the above modes. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are more accurately determined, the linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameters to obtain an accurate second predicted value, thereby improving the illumination compensation effect of the current block and enhancing the prediction effect of the current block.
[0286] The video decoding method according to the embodiment of this application has been described above. Based on this, the following describes the video decoding method of this application to the encoding side. En I will explain the coding method.
[0287] Figure 10 is a flowchart of a video encoding method provided by an embodiment of the present application. The execution entity of the embodiment of the present application may be the encoder shown in Figures 1 and 2.
[0288] As shown in Figure 10, the method of the embodiment of this application includes the following:
[0289] S701 predicts the current block and obtains the first predicted value for the current block.
[0290] When encoding the current block, the encoding side determines the prediction mode corresponding to the current block, predicts the current block based on the prediction mode, and obtains the predicted value of the current block. In the embodiments of this application, illumination compensation is performed on the predicted value obtained in this step to obtain a new predicted value. For the sake of explanation, in the embodiments of this application, the predicted value obtained based on the prediction mode is recorded as the first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as the second predicted value.
[0291] The embodiments of this application do not limit the current block prediction method.
[0292] In some embodiments, the current block is predicted using an inter prediction mode to obtain a first prediction value of the current block. For example, on the encoding side, motion information corresponding to the current block is determined, a reference block is found from a reference image based on the motion information, and a first prediction value of the current block is generated based on the reference block. Exemplarily, the motion information includes a reference image list where the reference image is located, a reference image index, and a motion vector. The motion vector can be an integer-sample motion vector or a fractional-sample motion vector. When the motion vector is a fractional-sample motion vector, it is necessary to perform interpolation filtering on the reference image to generate the required fractional-sample block. The integer-sample block or fractional-sample block in the reference image found based on the motion vector is called a reference block. In some embodiments, the reference block is directly used as the prediction block. In some embodiments, the prediction block is generated by further processing based on the reference block.
[0293] S702. Determine the reconstruction sample mode of the current block.
[0294] Here, the reconstruction sample mode is one of N candidate modes. The N candidate modes include at least one of an upper reconstruction sample mode, a left reconstruction sample mode, and an upper and left reconstruction sample mode.
[0295] S702 and S701 do not have strict order requirements during the execution process. For example, S702 can be executed before S701, after S701, or synchronously with S701, and the embodiments of the present application are not limited thereto.
[0296] As described above, in order to improve the prediction effect, illumination compensation is applied to the obtained first prediction value to obtain a second prediction value. Specifically, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined, the linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the linear transformation is applied to the first prediction value based on the linear transformation parameters to obtain a second prediction value for the current block.
[0297] To enhance the illumination compensation effect, embodiments of this application add several novel methods for determining the reconstructed sample, such as an upper reconstructed sample mode and / or a left-side reconstructed sample mode.
[0298] Left-side reconstruction sample mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the left-side adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the left-side adjacent reconstruction samples of the reference block.
[0299] Upper Reconstruction Sample Mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the upper adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the upper adjacent reconstruction samples of the reference block.
[0300] The upper and left-side reconstruction sample mode means that all reconstruction samples in the adjacent reconstruction samples of the current block come from the upper and left-side adjacent reconstruction samples of the current block, and all reconstruction samples in the adjacent reconstruction samples of the reference block come from the upper and left-side adjacent reconstruction samples of the reference block.
[0301] Encoding side but encodingWhen doing so, first, the reconstruction sample mode of the current block is determined. The reconstruction sample mode of the current block is one of N candidate modes. The N candidate modes include at least one of the upper reconstruction sample mode, left reconstruction sample mode, and upper and left reconstruction sample modes. That is, in the embodiments of this application, the selection method for reconstruction samples is increased, i.e., the number of reconstruction sample modes is increased, for example, the left reconstruction sample mode and / or upper reconstruction sample mode are increased, all reconstruction samples in the left reconstruction sample mode are obtained from the left adjacent sample of the image block, and all reconstruction samples in the upper reconstruction sample mode are obtained from the upper adjacent sample of the image block. In this way, when performing illumination compensation on the predicted value of the current block, it is possible to select from multiple reconstruction sample modes depending on the actual situation, thereby increasing the effect of light irradiation compensation and improving prediction performance.
[0302] The embodiments of this application are not limited to a specific method for determining the current block's reconstruction sample mode.
[0303] In some embodiments, one of the N candidate modes is determined as the reconstruction sample mode for the current block.
[0304] In some embodiments, the current block is analyzed to determine the reconstructed sample mode for the current block based on the characteristics of the samples in the current block. For example, if the sample differences in the current block are large and it is very similar to the upper reconstructed sample, the upper reconstructed sample mode is determined as the reconstructed sample mode for the current block. If the sample differences in the current block are large and it is very similar to the left reconstructed sample, the left reconstructed sample mode is determined as the reconstructed sample mode for the current block. If the sample differences in the current block are not large, both the upper and left reconstructed sample modes are determined as the reconstructed sample modes for the current block.
[0305] In some embodiments, S702 includes the following steps, S702-A and S702-B.
[0306] S702-A: For the i-th candidate mode out of N candidate modes, determine the cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N.
[0307] S702-B determines the reconstruction sample mode for the current block from the N candidate modes based on the costs corresponding to the N candidate modes.
[0308] In this embodiment, the encoding side uses each of the N candidate modes to perform illumination compensation on the first predicted value of the current block to obtain a cost corresponding to each candidate mode, and based on the cost corresponding to each candidate mode, selects one candidate mode from the N candidate modes to be used as the reconstruction sample mode for the current block.
[0309] In the embodiments of this application, the process for determining the cost corresponding to each of the N candidate modes is the same. For the sake of explanation, the i-th candidate mode among the N candidate modes will be described as an example.
[0310] Determining the cost corresponding to the i-th candidate mode in S702-A involves the following steps S702-A1 to S702-A4.
[0311] S702-A1, based on the i-th candidate mode, determines the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
[0312] The i-th adjacent reconstructed sample in the current block is a reconstructed sample determined from the left-side and / or upper-side reconstructed samples of the current block, based on the i-th candidate mode.
[0313] The i-th adjacent reconstruction sample of the reference block is a reconstruction sample determined from the left-side and / or upper-side reconstruction samples of the reference block of the current block, based on the i-th candidate mode.
[0314] In embodiments of this application, if the i-th candidate mode is different, the i-th adjacent reconstruction sample of the determined current block and the i-th adjacent reconstruction sample of the reference block are also different.
[0315] The following describes S702-A1 using the left-side reconstruction sample mode and the upper-side reconstruction sample mode as examples.
[0316] In some embodiments, if the i-th candidate mode is the left-side reconstruction sample mode, S702-A1 includes the following step S702-A1-A.
[0317] S702-A1-A determines the i-th adjacent reconstructed sample of the current block based on the left adjacent sample of the current block, and determines the i-th adjacent reconstructed sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference image.
[0318] In this embodiment, if the i-th candidate mode is the left-side reconstructed sample mode, the i-th adjacent reconstructed sample of the current block is determined from the left-side adjacent samples, and all left-side adjacent samples are reconstructed samples. For example, as shown in Figure 8A, the i-th adjacent reconstructed sample of the current block is determined based on the left-side adjacent samples of the current block. To give another example, the reference block of the current block is determined from the reference image. As shown in Figure 8B, the i-th adjacent reconstructed sample of the reference block is determined based on the left-side adjacent samples of the reference block in the reference image. Furthermore, the linear transformation parameter is determined based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameter to obtain the second predicted value of the current block.
[0319] The embodiments of this application are not limited to a specific method for determining the i-th adjacent reconstructed sample of the current block based on the left-side adjacent sample of the current block, as described in S702-A1-A.
[0320] In one embodiment, multiple reconstructed samples adjacent to the left of the current block are identified as the i-th adjacent reconstructed sample of the current block.
[0321] In another embodiment, as shown in Figure 8A, the i-th adjacent reconstructed sample of the current block is determined based on the height of the current block and the left-side adjacent sample of the current block.
[0322] Example 1: A reconstructed sample adjacent to the left of the current block and within the height range of the current block is identified as the i-th adjacent reconstructed sample of the current block. For example, if the height of the current block is 4, the four reconstructed samples adjacent to the left of the current block are identified as the i-th adjacent reconstructed samples of the current block.
[0323] Example 2: If the height of the current block is equal to the first number, select the first number of samples from the left-side adjacent samples of the current block and confirm them as the i-th adjacent reconstructed sample of the current block.
[0324] The embodiments of this application are not limited to a specific value for the first numerical value.
[0325] Selectively, the first value is 4. That is, if the height of the current block is equal to 4, then 4 samples are selected from the left-side adjacent samples of the current block and confirmed as the i-th adjacent reconstruction sample of the current block.
[0326] Example 2: If the height of the current block is not equal to the first number, select the second number of samples from the left-side adjacent samples of the current block and determine them as the i-th adjacent reconstructed sample of the current block.
[0327] The embodiments of this application are not limited to a specific value for the second numerical value.
[0328] For example, the second value is 4 or greater.
[0329] Selectively, the second value is the logarithm of the height with the third value as the base (log 第三数値 This is the value obtained by rounding the (height) to the nearest whole number.
[0330] The embodiments of this application are not limited to a specific value for the third numerical value.
[0331] Selectively, the third value is 2, and the second value is the value obtained by rounding the log2(height) value.
[0332] For example, assuming the current block height is 32, the second value is determined to be 5. Furthermore, the encoding side selects 5 samples from the 16 left-side neighbor samples of the current block to be the i-th neighbor reconstruction sample of the current block. These 5 samples may be selected with equal step sizes or randomly, and embodiments of this application are not limited thereto.
[0333] Similarly, embodiments of this application do not limit the specific method for determining the i-th adjacent reconstructed sample of a reference block based on the left-side adjacent sample of the reference block corresponding to the current block in the reference image, as in S702-A1-A.
[0334] In one embodiment, multiple reconstructed samples adjacent to the left of a reference block in a reference image are identified as the i-th adjacent reconstructed sample of the reference block.
[0335] In another embodiment, as shown in Figure 8B, the i-th adjacent reconstructed sample of the reference block is determined based on the height of the reference block and the left-side adjacent sample of the reference block.
[0336] Example 1: A reconstructed sample adjacent to the left of the reference block in the reference image and within the height range of the reference block is determined as the i-th adjacent reconstructed sample of the reference block. For example, if the height of the reference block is 4, the four reconstructed samples adjacent to the left of the reference block in the reference image are determined as the i-th adjacent reconstructed samples of the reference block.
[0337] Example 2: If the height of the reference block is equal to the first number, interpolate the left-side adjacent samples of the reference block to obtain the first number of samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0338] The embodiments of this application are not limited to a specific value for the first numerical value.
[0339] Selectively, the first value is 4. That is, if the height of the reference block is equal to 4, the left-side adjacent samples of the reference block are interpolated to obtain 4 samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0340] Example 2: If the height of the reference block is not equal to the first number, interpolate the left-side adjacent samples of the reference block to obtain a second number of samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0341] For example, assuming the height of the reference block is 32, the second value is determined to be 5. Furthermore, the encoding side interpolates the 16 left-side neighbor samples of the reference block to obtain 5 samples, which are then used as the i-th neighbor reconstruction sample of the reference block.
[0342] In embodiments of this application, if the i-th candidate mode is the left-side reconstructed sample mode, the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block are determined based on any of the above-described methods, wherein the i-th adjacent reconstructed sample of the current block is related only to the left-side adjacent sample of the current block, and the i-th adjacent reconstructed sample of the reference block is related only to the left-side adjacent sample of the reference block.
[0343] In some embodiments, if the i-th candidate mode is the upper reconstructed sample mode, S702-A1 includes the following step S702-A1-B.
[0344] S702-A1-B determines the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block, and determines the i-th adjacent reconstructed sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image.
[0345] In this embodiment, if the i-th candidate mode is the upper reconstructed sample mode, the i-th adjacent reconstructed sample of the current block is determined from the upper adjacent samples, and all upper adjacent samples are reconstructed samples. For example, as shown in Figure 9A, the i-th adjacent reconstructed sample of the current block is determined based on the upper adjacent samples of the current block. Furthermore, for example, the reference block of the current block is determined in the reference image. As shown in Figure 9B, the i-th adjacent reconstructed sample of the reference block is determined based on the upper adjacent samples of the reference block in the reference image. Furthermore, the linear transformation parameter is determined based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameter to obtain the second predicted value of the current block.
[0346] The embodiments of this application do not limit the specific method for determining the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block in S702-A1-B.
[0347] In one embodiment, multiple reconstructed samples adjacent to the upper side of the current block are identified as the i-th adjacent reconstructed sample of the current block.
[0348] In another embodiment, as shown in Figure 9A, the current block width Based on the upper neighboring sample of the current block, the i-th neighboring reconstructed sample of the current block is determined.
[0349] Example 1, adjacent to the top of the current block and the current block width The reconstructed sample within the range is identified as the i-th adjacent reconstructed sample of the current block. For example, the current block width If the value is 4, the four reconstructed samples adjacent to the top of the current block are identified as the i-th adjacent reconstructed sample of the current block.
[0350] Example 2, the current block width If the value is equal to the first number, select the first number of samples from the upper neighboring samples of the current block and confirm them as the i-th neighboring reconstructed sample of the current block.
[0351] The embodiments of this application are not limited to a specific value for the first numerical value.
[0352] Selectively, the first number is 4. That is, the current block width If the value is equal to 4, select 4 samples from the upper neighbor samples of the current block and confirm them as the i-th neighbor reconstruction sample of the current block.
[0353] Example 2, the current block widthIf the first value is not equal to the second value, select two samples from the upper neighbor samples of the current block and confirm them as the i-th neighbor reconstruction sample of the current block.
[0354] The embodiments of this application are not limited to a specific value for the second numerical value.
[0355] For example, the second value is 4 or greater.
[0356] Selectively, the second value has the third value as its base. width logarithm of (log 第三数値 ( width This is the value obtained by rounding the value to the nearest integer.
[0357] The embodiments of this application are not limited to a specific value for the third numerical value.
[0358] Selectively, the third value is 2.
[0359] The second value is log2( width This is a numerical value obtained by rounding the value of ).
[0360] For example, the current block width Assuming that is 32, the second value is determined to be 5. Furthermore, the encoding side selects 5 samples from the 16 upper neighbor samples of the current block to be the i-th neighbor reconstruction sample of the current block. These 5 samples may be selected with equal step sizes or randomly, and embodiments of this application are not limited thereto.
[0361] Similarly, the embodiments of this application do not limit the specific method for determining the i-th adjacent reconstructed sample of a reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image, as in S702-A1-B.
[0362] In one embodiment, multiple reconstructed samples adjacent to the upper side of a reference block in a reference image are identified as the i-th adjacent reconstructed sample of the reference block.
[0363] In another embodiment, as shown in Figure 9B, the reference block width Based on the upper adjacent sample of the reference block, the i-th adjacent reconstructed sample of the reference block is determined.
[0364] Example 1, adjacent to the upper side of the reference block in the reference image and the reference block width The reconstructed sample within the range is determined as the i-th adjacent reconstructed sample of the reference block. For example, the reference block width If the value is 4, the four reconstructed samples adjacent to the upper side of the reference block in the reference image are identified as the i-th adjacent reconstructed sample of the reference block.
[0365] Example 2, Reference block width If the value is equal to the first value, interpolate the upper adjacent samples of the reference block to obtain the first value of samples, which will be the i-th adjacent reconstructed sample of the reference block.
[0366] The embodiments of this application are not limited to a specific value for the first numerical value.
[0367] Selectively, the first number is 4. That is, the reference block width If it is equal to 4, Encoding side This interpolates the upper adjacent samples of the reference block to obtain four samples, which are then determined as the i-th adjacent reconstructed sample of the reference block.
[0368] Example 2, Reference block width If the first value is not equal to the second value, interpolate the upper adjacent samples of the reference block to obtain a second value of samples, which will be the i-th adjacent reconstructed sample of the reference block.
[0369] For example, the reference block widthAssuming that is 32, the second value is determined to be 5. Furthermore, the encoding side interpolates the 16 upper neighbor samples of the reference block to obtain 5 samples, which are the i-th neighbor reconstruction sample of the reference block.
[0370] In embodiments of this application, if the i-th candidate mode is an upper reconstructed sample mode, the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block are determined based on any of the above-described methods, wherein the i-th adjacent reconstructed sample of the current block is related only to the upper adjacent sample of the current block, and the i-th adjacent reconstructed sample of the reference block is related only to the upper adjacent sample of the reference block.
[0371] The encoding side determines the adjacent reconstruction sample of the current i-th block and the i-th adjacent reconstruction sample of the reference block using the method described above, and then performs the following S702-A2.
[0372] S702-A2, the i-th linear transformation parameter is determined based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
[0373] Embodiments of this application do not limit the specific method for determining the i-th linear transformation parameter based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
[0374] In some embodiments, if the i-th linear transformation parameter includes the i-th scaling factor and the i-th offset parameter, then in S702-A2, based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, Determining the i-th linear transformation parameter is: The following steps are included.
[0375] S702-A21, determine the i-th scaling factor based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
[0376] S702-A22 determines the i-th offset parameter based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor.
[0377] The embodiments of this application are not limited to the method in S702-A21 for determining the i-th scaling factor a based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
[0378] In one possible embodiment, the ratio of the i-th adjacent reconstruction sample of the current block to the i-th adjacent reconstruction sample of the reference block is determined as the i-th scaling factor a.
[0379] In another possible embodiment, the i-th scaling factor a is determined by equation (3) above.
[0380] In embodiments of this disclosure, the method for determining the i-th offset parameter in S702-A22 based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor is not limited.
[0381] In one possible embodiment, the i-th offset parameter b is determined by equation (4) described above.
[0382] S702-A3: The first predicted value for the current block is determined, and a linear transformation is performed on the first predicted value based on the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode.
[0383] Based on the method described above, after determining the i-th linear transformation parameter, a linear transformation is performed on the first predicted value using the i-th linear transformation parameter to obtain the second predicted value for the current block corresponding to the i-th candidate mode. For example, the product of the i-th scaling factor and the first predicted value is determined. Then, the sum of this product and the i-th offset parameter is determined as the second predicted value corresponding to the i-th candidate mode.
[0384] In one example, the above Based on equation (5), the second predicted value corresponding to the i-th candidate mode is determined.
[0385] S702-A4, based on the second predicted value corresponding to the i-th candidate mode, the cost corresponding to the i-th candidate mode is determined.
[0386] For example, the cost corresponding to the i-th candidate mode is determined based on the second predicted value corresponding to the i-th candidate mode and the current block.
[0387] For example, the difference between the second predicted value corresponding to the i-th candidate mode and the original value corresponding to the current block is calculated to obtain the residual of the current block, and the rate distortion optimization (RAT Distorti on Optimized) is calculated by operations such as transformation quantization, and this is denoted as costi.
[0388] To reduce the complexity of cost calculation, cost calculation methods such as SAD (Sum of Absolute Difference) and STAD (Sum of Absolute Transformed Difference) can be used to determine the cost corresponding to the i-th candidate mode.
[0389] Based on the method described above, the cost corresponding to each of the N candidate modes can be determined, and then S702-B can be executed to determine the reconstruction sample mode of the current block from the N candidate modules based on the costs corresponding to the N candidate models.
[0390] In one example, the candidate mode with the minimum cost among the N candidate modes is determined as the reconstruction sample mode for the current block.
[0391] In some embodiments, the encoding side determines the reconstruction sample mode of the current block from the N candidate models based on the costs corresponding to the N candidate modes, then writes a first index to the bitstream, which is used to indicate the reconstruction sample mode of the current block.
[0392] In some embodiments, if the prediction mode of the current block is merge mode, the encoding side can determine the reconstruction sample mode of the current block by the following method. That is, step S702 includes the following steps S702-C1 and S702-C2.
[0393] S702-C1 determines the first flag of the adjacent block to the current block, and the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology.
[0394] S702-C2 determines the reconstruction sample mode of the current block based on the first flag of the adjacent block.
[0395] In this embodiment, when the encoding side performs illumination compensation for the current block, if the prediction mode of the current block is merge mode, the encoding side determines whether the current block uses the illumination compensation technique based on whether the adjacent blocks of the current block use the illumination compensation technique proposed in this embodiment. For example, if the adjacent blocks use the illumination compensation technique proposed in this embodiment, the encoding side determines that the current block also uses the illumination compensation technique proposed in this embodiment.
[0396] Based on this, the encoding side obtains the first flag from the adjacent block and determines the reconstruction sample mode of the current block based on the first flag of the adjacent block.
[0397] The method for determining the reconstruction sample mode of the current block based on the first flag of the adjacent block in S702-C2 includes, but is not limited to, the following types:
[0398] Method 1: If the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, then the reconstruction sample mode of the current block is determined to be the upper and left reconstruction sample mode.
[0399] In Method 1, if the prediction mode of the current block is merge mode and the adjacent blocks of the current block use illumination compensation technology, the encoding side defaults to the upper and left reconstruction sample mode for the current block and directly uses the upper and left reconstruction sample mode to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value of the current block.
[0400] Method 2: If the first flag of an adjacent block indicates that the adjacent block will use lighting compensation technology, the reconstruction sample mode of the adjacent block is determined, and the reconstruction sample mode of the adjacent block is determined as the reconstruction sample mode of the current block.
[0401] In Method 2, if the prediction mode of the current block is merge mode and the adjacent block of the current block uses illumination compensation technology, the encoding side determines the reconstructed sample mode of the adjacent block of the current block as the reconstructed sample mode of the current block. Specifically, the encoding side obtains the reconstructed sample mode of the adjacent block, performs illumination compensation on the first predicted value of the current block using the reconstructed sample mode of the adjacent block, and obtains the second predicted value.
[0402] The methods by which the encoding side determines the reconstruction sample mode of adjacent blocks to the current block include at least the following examples:
[0403] Example 1: The encoding side directly obtains the reconstructed sample mode of the adjacent block from the adjacent block.
[0404] Example 2: The encoding side obtains a second index from the adjacent block, and this second index is used to indicate the reconstructed sample mode of the adjacent block. Based on the second index, the encoding side determines the reconstructed sample mode of the adjacent block. For example, as shown in Table 1, if the second index is 0, it is determined that the reconstructed sample mode of the adjacent block is the upper reconstructed sample mode.
[0405] In Method II, when predicting the current block using merge mode, the encoding side directly determines the reconstruction sample mode of the current block based on the first flag and / or first index of the adjacent blocks of the current block.
[0406] The encoding side determines the reconstruction sample mode of the current block based on the method described above, and then performs the following step S703.
[0407] S703, a second predicted value for the current block is determined based on the current block's reconstruction sample mode. The second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the current block's reconstruction sample mode.
[0408] In some embodiments, when the encoding side determines a second predicted value corresponding to each of the N candidate modes based on the methods S702-A and S702-B described above, and selects the reconstruction sample mode for the current block from the N candidate modes, the encoding side does not need to directly determine the second predicted value corresponding to the reconstruction sample mode for the current block as the second predicted value for the current block, and does not need to perform the illumination compensation calculation again.
[0409] In some embodiments, when the encoding side determines the reconstruction sample mode of the current block based on S702-C1 and S702-C2, that is, when it determines the first flag of the adjacent block of the current block and determines the reconstruction sample mode of the current block based on the first flag of the adjacent block, S703 includes the following steps.
[0410] S703-A1 determines the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block based on the reconstruction sample mode of the current block.
[0411] S703-A2, based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the linear transformation parameters are determined, and a linear transformation is performed on the first predicted value based on the linear transformation parameters to obtain the second predicted value of the current block.
[0412] For the implementation process of S703-A1, please refer to the explanation of S702-A1. It will not be explained again here.
[0413] For the implementation process of S703-A2, please refer to the explanations of S702-A2 and S702-A3. They will not be repeated here.
[0414] In the embodiments of this application, the encoding side selects the reconstruction sample mode for the current block from an upper reconstruction sample mode, a left reconstruction sample mode, and upper and left reconstruction sample modes. The selection modes for reconstruction samples are abundant, and the reconstruction sample mode that matches the current block feature information can be accurately determined from each of the above modes. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are more accurately determined, the linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameters to obtain an accurate second predicted value, thereby improving the illumination compensation effect of the current block and improving the prediction effect of the current block.
[0415] In some embodiments, whether or not the illumination compensation extension technique of the embodiments of this application is employed is determined by a flag. Prior to S702, the encoding side first determines a first flag for the current block, which is used to indicate whether or not the current block uses illumination compensation technique.
[0416] In some embodiments of this application, the encoding side determines the first flag of the current block and writes the first flag to the bitstream.
[0417] In some embodiments, the first flag of the current block indicates that the current block uses illumination compensation techniques. The encoding side then determines the second flag of the current block and writes the second flag to the bitstream. The second flag of the current block is used to indicate whether or not the current block uses illumination compensation extension techniques.
[0418] In some embodiments, if the second flag of the current block indicates that the current block uses illumination compensation extension techniques, the encoding side writes the index of the reconstructed sample mode of the current block to the bitstream.
[0419] For example, if the first flag of the current block is 1, it instructs the current block to use lighting compensation technology, and if the first flag of the current block is 0, it instructs the current block not to use lighting compensation technology.
[0420] If the first flag of the current block indicates that the current block will not use illumination compensation techniques, for example, if the first flag of the current block is 0, the decoding side either confirms the first predicted value as the second predicted value, or processes the first predicted value using another method to obtain the second predicted value.
[0421] If the first flag of the current block indicates that the current block uses illumination compensation technology, for example, if the first flag of the current block is 1, the decoding side determines the second flag of the current block, and the second flag of the current block is used to indicate whether or not the current block uses the illumination compensation extension technology of this application.
[0422] For example, if the second flag of the current block is 1, it instructs the current block to use lighting compensation enhancement technology, and if the second flag of the current block is 0, it instructs the current block not to use lighting compensation enhancement technology.
[0423] If the second flag of the current block indicates that the current block will not use illumination compensation extension techniques, for example, if the second flag of the current block is 0, the decoding side can use the default reconstruction sample mode, for example, by selecting the upper and left reconstruction sample modes and performing illumination compensation on the first predicted value of the current block to obtain the second predicted value.
[0424] In some embodiments, if the second flag of the current block indicates that the current block uses the illumination compensation extension technique of this application, the encoding side writes the index of the reconstructed sample mode of the current block to the bitstream.
[0425] The methods by which the encoding side determines the first flag of the current block include at least the following:
[0426] Method 1: Obtain the first flag of the current block from the profile.
[0427] In method 1, the encoding side writes the first flag of the current block to the bitstream, and the decoding side can directly decode and obtain the first flag of the current block.
[0428] Method 2: When the prediction mode of the current block is merge mode, the encoding side determines the first flag of the adjacent block of the current block. The first flag of the adjacent block is used to indicate whether or not the adjacent block uses illumination compensation technology, and then the first flag of the current block is determined based on the first flag of the adjacent block. For example, the encoding side obtains the first flag from the adjacent block, and if the value of the adjacent block's first flag is 1, it determines that the value of the current block's first flag is also 1. That is, if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, it determines that the current block also uses illumination compensation technology. If the value of the adjacent block's first flag is 0, it determines that the value of the current block's first flag is also 0. That is, if the first flag of the adjacent block indicates that the adjacent block does not use illumination compensation technology, it determines that the current block also does not use illumination compensation technology.
[0429] The methods by which the encoding side determines the second flag of the current block include at least the following:
[0430] Method 1: Obtain the second flag of the current block from the profile.
[0431] In method 1, the encoding side writes the second flag of the current block to the bitstream, and the decoding side can directly decode and obtain the second flag of the current block.
[0432] Method 2: If the prediction mode of the current block is merge mode, the encoding side is the current block of The second flag of the adjacent block is determined, and the second flag of the adjacent block is used to indicate whether or not the adjacent block uses the illumination compensation extension technology of this application. Furthermore, the second flag of the current block is determined based on the second flag of the adjacent block. For example, the encoding side obtains the second flag of the adjacent block from the adjacent block, and if the value of the second flag of the adjacent block is 1, it is determined that the value of the second flag of the current block is also 1. That is, if the second flag of the adjacent block indicates that the adjacent block uses the illumination compensation extension technology of this application, it is determined that the current block also uses the illumination compensation extension technology of this application. If the value of the second flag of the adjacent block is 0, it is determined that the value of the second flag of the current block is also 0. That is, if the second flag of the adjacent block indicates that the adjacent block does not use the illumination compensation extension technology of this application, it is determined that the current block also does not use the illumination compensation extension technology of this application.
[0433] In some embodiments, the first flag includes at least one of a sequence-level flag, a picture-level flag, and a block-level flag.
[0434] In some embodiments, the encoding side compares the illumination compensation technology of this application with other prediction modes and, for example, determines the cost corresponding to each of the N candidate modes by the method described above, and calculates the costs corresponding to other preset prediction modes. Exemplarily, taking N=3 as an example, the cost corresponding to the upper reconstructed sample mode is determined by the method described above and recorded as cost1, the cost corresponding to the left reconstructed sample mode is determined and recorded as cost2, the costs corresponding to the upper and left reconstructed sample modes are determined and recorded as cost3, cost1, cost2 and cost3 are compared and the minimum cost value is recorded as costMin, and at the same time information related to the current illumination compensation is stored, including an illumination compensation mode index, where the mode index corresponding to cost1 is 0, the mode index corresponding to cost2 is 1, and the mode index corresponding to cost3 is 2.
[0435] Subsequently, the encoding side traverses other interpretation techniques, calculates the rate-distortion cost values corresponding to these techniques, and selects the prediction mode corresponding to the minimum cost value, which becomes the optimal prediction mode for the current coding unit.
[0436] If the current block has illumination compensation enabled and costMin is minimal, the current block should use illumination compensation and write to the bitstream with a coding unit-level flag indicating whether or not to use illumination compensation, such as lic_flag, set to "true". If the index corresponding to costMin is greater than 0, write to the bitstream with a flag indicating whether or not to use illumination compensation extension, i.e., the current block's second flag, such as lic_ext, set to "true", and write to the bitstream, and write to the bitstream the index corresponding to costMin using equal probability coding. Otherwise, write to the bitstream with a flag indicating whether or not to use illumination compensation extension, i.e., the current block's second flag, set to "false".
[0437] If the current block has illumination compensation enabled but costMin is not the minimum, the current block will not use illumination compensation and will need to write the bitstream with a coding unit-level flag, such as lic_flag, set to "false", which indicates whether or not to use illumination compensation.
[0438] If the current block does not use illumination compensation technology, it writes information such as the optimal prediction mode for other non-illumination compensation technologies to the bitstream.
[0439] In some embodiments, if the current image to which the current block belongs is a first-type image, the illumination compensation extension technique proposed in the embodiments of this application is performed, i.e., S702 above, to determine the reconstruction sample mode of the current block.
[0440] Embodiments of this disclosure do not limit the specific type of first type image.
[0441] Selectively, the illumination compensation extension technique proposed in this application is enabled by default when the first type image is a B-frame, i.e., when the current image is a B-frame.
[0442] In some embodiments, if the area of the current block is greater than or equal to a preset threshold, the illumination compensation extension technique proposed in the embodiments of this application is performed, i.e., S702 described above, to determine the reconstruction sample mode of the current block.
[0443] This application is not limited to specific values of pre-set thresholds.
[0444] Selectively, if the preset threshold is 64, that is, if the area of the current block is greater than or equal to the preset threshold, the illumination compensation extension technique proposed in this application is executed, i.e., S702 described above, which determines the reconstruction sample mode of the current block.
[0445] The encoding side, after determining the predicted value of the current block through the steps described above, for example, after determining the second predicted value of the current block, calculates the difference between the predicted block and the current block to obtain the residual value of the current block, transforms the residual value to obtain a transformation coefficient, quantizes the transformation coefficient to obtain a quantization coefficient, and encodes the quantization coefficient to obtain a bitstream.
[0446] Furthermore, after integrating the first embodiment of this solution into the latest EXM3.1, the test results under random access (RA) and low-delay B (LDB) test conditions are shown in Table 3.
[0447] JPEG0007879949000008.jpg68134
[0448] As can be seen from Table 3 above, the illumination compensation extension technology proposed in the embodiments of this disclosure improves the performance of all sequence types for RA and LDB, with the improvement being most significant for the 4KA2 sequence under RA test conditions, resulting in an average 0.11% reduction in BD bitrate. Furthermore, the improved integrated performance demonstrates the effectiveness of this technology and can enhance the encoding efficiency of existing ECM reference software. It should be noted that, due to server load, the encoding and decoding times are not precise, and theoretically, the decoding time remains unchanged, meaning that the encoding side was not optimized in these experimental results. Moreover, this method does not add a burden to the decoding side and does not increase the complexity of the hardware implementation.
[0449] The video encoding method provided in the embodiments of this application is as follows: The encoding side predicts the current block and obtains a first predicted value for the current block. The reconstruction sample mode for the current block is determined. The reconstruction sample mode is one of N candidate modes. The N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample mode. A second predicted value for the current block is determined based on the reconstruction sample mode for the current block, and the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the reconstruction sample mode for the current block. In the embodiments of this application, the reconstruction sample mode for the current block can be one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample mode. Therefore, there is a rich selection of reconstruction sample modes, and a reconstruction sample mode that matches the current block feature information can be accurately determined from each of the above modes. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are more accurately determined, the linear transformation parameters are determined based on the accurately determined adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed based on the linear transformation parameters to obtain an accurate second predicted value, thereby improving the illumination compensation effect of the current block and enhancing the prediction effect of the current block.
[0450] Figures 7 to 10 are merely illustrative examples of this application and should not be understood as limitations on this application.
[0451] While preferred embodiments of this application have been described in detail above with reference to the attached drawings, this application is not limited to the detailed contents of the above embodiments. Within the scope of the technical idea of this application, various simple modifications can be made to the technical proposal of this application, and any such simple modifications will fall within the scope of protection of this application. For example, each specific technical feature described in the above specific embodiments may be combined by any appropriate means, provided that they are not contradictory, and in order to avoid unnecessary redundancy, various possible combinations are not described again in this application. Furthermore, for example, any combination between various different embodiments of this application should be considered disclosed in this application, as long as it does not contradict the idea of this application.
[0452] It should be understood that in the various method embodiments of this application, the magnitude of the sequence number of each process does not indicate the execution order. The execution order of each process should be determined by its function and internal logic and should not constitute any limitation on the implementation of the embodiments of this application. In the embodiments of this application, the term "and / or" simply describes the relationship between related objects and indicates that there are three types of relationships. Specifically, in the case of A and / or B, it indicates three situations: A exists alone, A and B exist simultaneously, and B exists alone. Also, in this specification, the symbol " / " generally indicates that the preceding and succeeding related objects have an "or" relationship.
[0453] The method embodiments of this application have been described in detail above with reference to Figures 7 to 10. Hereafter, the apparatus embodiments of this application will be described in detail with reference to Figures 11 to 14.
[0454] Figure 11 is a block diagram showing a video decoding device provided by an embodiment of the present application.
[0455] As shown in Figure 11, the video decoding device 10 comprises a decoding unit 11, a mode determination unit 12, a sample determination unit 13, and a linear conversion unit 14.
[0456] The decoding unit 11 is configured to decode the bitstream and predict the current block to obtain the first predicted value of the current block.
[0457] The mode determination unit 12 is configured to determine the reconstruction sample mode of the current block. The reconstruction sample mode is one of N candidate modes. The N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes.
[0458] The sample confirmation unit 13 is configured to confirm the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block based on the reconstruction sample mode of the current block.
[0459] The linear transformation unit 14 is configured to determine linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and to perform a linear transformation on the first predicted value based on the linear transformation parameters to obtain the second predicted value of the current block.
[0460] In some embodiments, the mode determination unit 12 is configured to determine a first index that indicates the reconstruction sample mode of the current block, and to determine the reconstruction sample mode of the current block based on the first index.
[0461] In some embodiments, the mode determination unit 12 is specifically configured to decode the bitstream to obtain a first index.
[0462] In some embodiments, if the prediction mode of the current block is merge mode, the mode determination unit 12 is configured to specifically determine the first flag of the adjacent block of the current block and to determine the first index based on the first flag of the adjacent block, the first flag of the adjacent block is used to indicate whether or not the adjacent block uses illumination compensation technology.
[0463] In some embodiments, the mode determination unit 12 is configured to determine the first index to be the default index if the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, and the default index is used to indicate the upper and left reconstructed sample modes.
[0464] In some embodiments, the mode determination unit 12 is configured to determine a second index if the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, and to determine the second index as the first index, which is used to indicate the reconstructed sample mode of the adjacent block.
[0465] In some embodiments, if the prediction mode of the current block is non-merging mode, the mode determination unit 12 is configured to determine, specifically, a first flag of the current block, which is used to indicate whether the current block uses illumination compensation technology; if the first flag of the current block indicates that the current block uses illumination compensation technology, then it determines a second flag of the current block, which is used to indicate whether the current block uses illumination compensation extension technology; and based on the second flag of the current block, it determines a first index.
[0466] In some embodiments, the mode determination unit 12 is configured to obtain a first index by decoding the bitstream if the second flag of the current block indicates that the current block uses illumination compensation extension technology.
[0467] In some embodiments, the mode determination unit 12 is configured to determine the first index is the default index if the second flag of the current block indicates that the current block does not use illumination compensation extension techniques, and the default index is used to indicate the upper and left reconstructed sample modes.
[0468] In some embodiments, the mode determination unit 12 is configured to obtain the first flag of the current block by specifically decoding the bitstream.
[0469] In some embodiments, the mode determination unit 12 is configured to obtain the second flag of the current block by specifically decoding the bitstream.
[0470] In some embodiments, if the prediction mode of the current block is merge mode, the mode determination unit 12 is configured to specifically determine the first flag of the adjacent block of the current block and determine the reconstruction sample mode of the current block based on the first flag of the adjacent block, the first flag of the adjacent block is used to indicate whether or not the adjacent block uses illumination compensation technology.
[0471] In some embodiments, the mode determination unit 12 is configured to determine that the current block's reconstructed sample mode is the upper and left reconstructed sample mode if the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology.
[0472] In some embodiments, the mode determination unit 12 is configured to determine the reconstructed sample mode of an adjacent block if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, and to determine the reconstructed sample mode of the adjacent block as the reconstructed sample mode of the current block.
[0473] In some embodiments, the mode determination unit 12 is specifically configured to determine a second index and to determine the reconstructed sample mode of an adjacent block based on the second index, the second index being used to indicate the reconstructed sample mode of an adjacent block.
[0474] In some embodiments, the sample determination unit 13 is configured to determine the adjacent reconstructed samples of the current block based on the left adjacent samples of the current block when the reconstruction sample mode of the current block is left reconstruction sample mode, and to determine the adjacent reconstructed samples of the reference block based on the left adjacent samples of the reference block corresponding to the current block in the reference image.
[0475] In some embodiments, the sample determination unit 13 is configured to determine the adjacent reconstructed sample of the current block based specifically on the height of the current block and the adjacent sample to the left of the current block.
[0476] In some embodiments, the sample determination unit 13 is configured to select a first number of samples from the left-side adjacent samples of the current block and determine them as adjacent reconstructed samples of the current block, if the height of the current block is equal to a first number.
[0477] In some embodiments, the sample determination unit 13 is configured to select a second number of samples from the left-side adjacent samples of the current block and determine them as adjacent reconstructed samples of the current block if the height of the current block is not equal to a first number.
[0478] In some embodiments, the sample determination unit 13 is configured to determine the adjacent reconstructed sample of the reference block based specifically on the height of the reference block and the adjacent sample to the left of the reference block.
[0479] In some embodiments, the sample determination unit 13 is configured to interpolate the left-side adjacent samples of the reference block to obtain a first number of samples, if the height of the reference block is equal to a first number, to form adjacent reconstructed samples of the reference block.
[0480] In some embodiments, the sample determination unit 13 is configured to interpolate the left-side adjacent samples of the reference block to obtain a second number of samples if the height of the reference block is not equal to the first number, thereby obtaining adjacent reconstructed samples of the reference block.
[0481] In some embodiments, the sample determination unit 13 is configured to determine the adjacent reconstructed samples of the current block based on the upper adjacent samples of the current block when the reconstruction sample mode of the current block is the upper reconstruction sample mode, and to determine the adjacent reconstructed samples of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference image.
[0482] In some embodiments, the sample determination unit 13 is configured to determine the adjacent reconstructed sample of the current block based specifically on the width of the current block and the upper adjacent sample of the current block.
[0483] In some embodiments, the sample determination unit 13 is configured to select a first number of samples from the upper adjacent samples of the current block and determine them as adjacent reconstruction samples of the current block, if the width of the current block is equal to a first number.
[0484] In some embodiments, the sample determination unit 13 is configured to select a second number of samples from the upper adjacent samples of the current block and determine them as adjacent reconstruction samples of the current block if the width of the current block is not equal to a first number.
[0485] In some embodiments, the sample determination unit 13 is configured to determine adjacent reconstructed samples of the reference block, specifically based on the width of the reference block and the upper adjacent samples of the reference block.
[0486] In some embodiments, the sample determination unit 13 is configured to interpolate the upper adjacent samples of the reference block to obtain a first number of samples, if the width of the reference block is equal to a first number, to form adjacent reconstructed samples of the reference block.
[0487] In some embodiments, the sample determination unit 13 is configured to, specifically, if the width of the reference block is not equal to a first number, to interpolate the upper adjacent samples of the reference block to obtain a second number of samples, and to determine the interpolated second number of samples as adjacent reconstructed samples of the reference block.
[0488] Selectively, the first flag includes at least one of the sequence-level flag, picture-level flag, or block-level flag.
[0489] In some embodiments, if the linear transformation parameters include a scaling factor and an offset parameter, the linear transformation unit 14 is configured to determine the scaling factor based on adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block, and to determine the offset parameter based on adjacent reconstruction samples of the current block, adjacent reconstruction samples of the reference block and the scaling factor.
[0490] In some embodiments, the linear transformation unit 14 is configured to perform a linear transformation on the first predicted value based on the scaling factor and offset parameter to obtain a second predicted value for the current block.
[0491] In some embodiments, the linear transformation unit 14 is configured to determine the product of the scaling factor and the first predicted value, and to determine the sum of the product and the offset parameter as the second predicted value.
[0492] In some embodiments, the mode determination unit 12 is configured to determine the reconstruction sample mode of the current block if the current image to which the current block belongs is a first-type image.
[0493] In some embodiments, the mode determination unit 12 is configured to determine the reconstruction sample mode of the current block if the area of the current block is greater than or equal to a preset threshold.
[0494] The apparatus embodiments can correspond to method embodiments, and similar descriptions can be found in the method embodiments. To avoid duplication, such descriptions are omitted here. Specifically, the video decoding apparatus 10 shown in Figure 11 may correspond to an entity that performs the method in the embodiments of this application. Furthermore, the aforementioned and other operations and / or functions of each unit in the video decoding apparatus 10 are used to realize the corresponding processes in each method, and for the sake of brevity, their descriptions are omitted here.
[0495] Figure 12 is a block diagram showing a video encoding device provided by an embodiment of the present application.
[0496] As shown in Figure 12, the video encoding device 20 comprises a prediction unit 21, a mode determination unit 22, and a linear conversion unit 23.
[0497] The prediction unit 21 is configured to predict the current block and obtain the first predicted value for the current block.
[0498] The mode determination unit 22 is configured to determine the reconstruction sample mode of the current block, the reconstruction sample mode being one of N candidate modes, the N candidate modes including at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes.
[0499] The linear transformation unit 23 is configured to determine a second predicted value for the current block based on the reconstruction sample mode of the current block, and the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the reconstruction sample mode of the current block.
[0500] In some embodiments, the mode determination unit 22 is configured to determine the cost corresponding to the i-th candidate mode out of N candidate modes, where i is a positive integer from 1 to N, and to determine the reconstructed sample mode of the current block from the N candidate modes based on the costs corresponding to the N candidate modes.
[0501] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block based on the i-th candidate mode, determine the i-th linear transformation parameter based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, determine the first predicted value of the current block, perform a linear transformation on the first predicted value based on the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode, and determine the cost corresponding to the i-th candidate mode based on the second predicted value corresponding to the i-th candidate mode.
[0502] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the current block based on the left adjacent sample of the current block when the i-th candidate mode is a left-side reconstructed sample mode, and to determine the i-th adjacent reconstructed sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference image.
[0503] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the current block based on the height of the current block and the left-side adjacent sample of the current block.
[0504] In some embodiments, the mode determination unit 22 is configured to select a first number of samples from the left-side adjacent samples of the current block and determine them as the i-th adjacent reconstructed sample of the current block if the height of the current block is equal to a first number.
[0505] In some embodiments, the mode determination unit 22 is configured to select a second number of samples from the left-side adjacent samples of the current block and determine them as the i-th adjacent reconstructed sample of the current block if the height of the current block is not equal to a first number.
[0506] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the reference block based on the height of the reference block and the left-side adjacent sample of the reference block.
[0507] In some embodiments, the mode determination unit 22 is configured to interpolate the left-side adjacent samples of the reference block to obtain a first numerical number of samples, which are the i-th adjacent reconstructed sample of the reference block, if the height of the reference block is equal to the first numerical value.
[0508] In some embodiments, the mode determination unit 22 is configured to interpolate the left-side adjacent samples of the reference block to obtain a second number of samples if the height of the reference block is not equal to the first number, and to use these as the i-th adjacent reconstructed sample of the reference block.
[0509] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block if the i-th candidate mode is an upper reconstructed sample mode, and to determine the i-th adjacent reconstructed sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image.
[0510] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block.
[0511] In some embodiments, the mode determination unit 22 is configured to select a first number of samples from the upper adjacent samples of the current block and determine them as the i-th adjacent reconstruction sample of the current block, if the width of the current block is equal to a first number.
[0512] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the current block by selecting a second number of samples from the upper adjacent samples of the current block if the width of the current block is not equal to a first number.
[0513] In some embodiments, the mode determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the reference block based on the width of the reference block and the upper adjacent sample of the reference block.
[0514] In some embodiments, the mode determination unit 22 is configured to interpolate the upper adjacent samples of the reference block to obtain a first numerical number of samples if the width of the reference block is equal to a first numerical value, and to use the i-th adjacent reconstructed sample of the reference block.
[0515] In some embodiments, the mode determination unit 22 is configured to interpolate the upper adjacent samples of the reference block to obtain a second number of samples if the width of the reference block is not equal to the first number, and to use these as the i-th adjacent reconstructed sample of the reference block.
[0516] In some embodiments, the i-th linear transformation parameter includes the i-th scaling factor and the i-th offset parameter. The mode determination unit 22 is configured to determine the i-th scaling factor based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, and to determine the i-th offset parameter based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor.
[0517] In some embodiments, the mode determination unit 22 is configured to perform a linear transformation on the first predicted value based on the i-th scaling factor and the i-th offset parameter to obtain a second predicted value for the current block corresponding to the i-th candidate mode.
[0518] In some embodiments, the mode determination unit 22 is configured to determine the product of the i-th scaling factor and the first predicted value, and to determine the sum of the product and the i-th offset parameter as the second predicted value corresponding to the i-th candidate mode.
[0519] In some embodiments, the mode determination unit 22 is configured to determine the cost corresponding to the i-th candidate mode based on a second predicted value corresponding to the i-th candidate mode and the current block.
[0520] In some embodiments, the mode determination unit 22 is configured to determine the candidate mode with the lowest cost among N candidate modes as the reconstruction sample mode for the current block.
[0521] In some embodiments, the linear transformation unit 23 is configured to determine a second predicted value corresponding to the reconstruction sample mode of the current block as the second predicted value of the current block.
[0522] In some embodiments, the linear transformation unit 23 is configured to write a first index to the bitstream, which is used to indicate the reconstruction sample mode of the current block.
[0523] In some embodiments, if the prediction mode of the current block is merge mode, the mode determination unit 22 is configured to determine the first flag of the adjacent block of the current block, the first flag of the adjacent block is used to indicate whether the adjacent block uses illumination compensation technology, and to determine the reconstructed sample mode of the current block based on the first flag of the adjacent block.
[0524] In some embodiments, the mode determination unit 22 is configured to determine that the current block's reconstructed sample mode is the upper and left reconstructed sample mode if the first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology.
[0525] In some embodiments, the mode determination unit 22 is configured to determine the reconstructed sample mode of an adjacent block if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, and to determine the reconstructed sample mode of the adjacent block as the reconstructed sample mode of the current block.
[0526] In some embodiments, the mode determination unit 22 is configured to determine a second index, which is used to indicate the reconstructed sample mode of an adjacent block, and to determine the reconstructed sample mode of an adjacent block based on the second index.
[0527] In some embodiments, the mode determination unit 22 is configured to determine the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block based on the reconstruction sample mode of the current block, determine the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and perform a linear transformation on the first predicted value based on the linear transformation parameters to obtain a second predicted value for the current block.
[0528] In some embodiments, the linear transformation unit 23 is configured to determine a first flag of the current block and write the first flag to the bitstream, the first flag of the current block is used to indicate whether or not the current block uses illumination compensation technology.
[0529] In some embodiments, the linear transformation unit 23 is configured to determine the second flag of the current block and write the second flag to the bitstream if the first flag of the current block indicates that the current block uses illumination compensation technology, the second flag of the current block is used to indicate whether or not the current block uses illumination compensation extension technology.
[0530] In some embodiments, the linear transformation unit 23 is configured to write the index of the reconstructed sample mode of the current block to the bitstream if the second flag of the current block indicates that the current block uses illumination compensation extension techniques.
[0531] In some embodiments, when the prediction mode of the current block is merge mode, the linear transformation unit 23 is configured to determine the first flag of the adjacent block of the current block, the first flag of the adjacent block is used to indicate whether the adjacent block uses illumination compensation technology, and further to determine the first flag of the current block based on the first flag of the adjacent block.
[0532] In some embodiments, if the prediction mode of the current block is merge mode, the linear transformation unit 23 is configured to determine the second flag of the adjacent block of the current block, the second flag of the adjacent block is used to indicate whether the adjacent block uses illumination compensation extension technology, and further to determine the second flag of the current block based on the second flag of the adjacent block.
[0533] Selectively, the first flag includes at least one of the sequence-level flag, picture-level flag, or block-level flag.
[0534] In some embodiments, the mode determination unit 22 is configured to determine the reconstruction sample mode of the current block if the current image to which the current block belongs is a first-type image.
[0535] In some embodiments, the mode determination unit 22 is configured to determine the reconstruction sample mode of the current block when the area of the current block is greater than or equal to a preset threshold.
[0536] The apparatus embodiments can correspond to method embodiments, and similar descriptions can be found in the method embodiments. To avoid duplication, such descriptions are omitted here. Specifically, the video encoding apparatus 20 shown in Figure 12 may correspond to an entity that performs the method in the embodiments of this application. Furthermore, the aforementioned and other operations and / or functions of each unit in the video encoding apparatus 20 are used to realize the corresponding processes in each method, and for the sake of brevity, such descriptions are omitted here.
[0537] The apparatus and system of the embodiments of this application have been described above with reference to the drawings, from the perspective of functional units. These functional units may be implemented in hardware form, in software form by instructions, or in combination of hardware and software. Specifically, each step of the method embodiment in the embodiments of this application can be completed by an integrated logic circuit in hardware or by instructions in software form in a processor. The steps of the method disclosed in the embodiments of this application can be executed and completed directly by a hardware decoding processor, or by a combination of hardware and software in a decoding processor. Optionally, the software can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium resides in memory. The processor reads information from memory and, together with the hardware, completes the steps of the method embodiment.
[0538] Figure 13 is a block diagram showing an electronic device according to an embodiment of this application.
[0539] As shown in Figure 13, the electronic device 30 may be a video encoder or a video decoder as described in the embodiments of this application. The electronic device 30 is a memory 31、 Processor 32 and transceiver 33 It can be equipped with memory. 31 This is used to store the computer program 34 and to transmit the computer program 34 to the processor 32. In other words, the processor 32 uses memory. 31 The method in this embodiment of the application can be realized by calling and executing the computer program 34.
[0540] For example, the processor 32 can be used to perform the steps of the above method based on instructions in the computer program 34.
[0541] In some embodiments of this application, the processor 32 may include, but is not limited to, a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and the like.
[0542] In some embodiments of this application, memory 31This includes, but is not limited to, volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM) that functions as an external high-speed cache. As illustrative but not limited examples, various types of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synch-link dynamic random access memory (synch-link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM).
[0543] In some embodiments of this application, the computer program 34 may be divided into one or more units, and one or more units may be in memory 31 The method according to this application is completed by being stored in and executed by the processor 32. The one or more units may be a series of computer program instruction segments capable of performing a specific function, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30.
[0544] As shown in Figure 13, the electronic device 30 may further include a transceiver 33. The transceiver 33 is connected to the processor 32 or memory 31 It can be connected.
[0545] The processor 32 can control the transceiver 33 to communicate with other devices. Specifically, the transceiver 33 can transmit information or data to other devices, or receive information or data transmitted by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include an antenna. The number of antennas may be one or more.
[0546] Furthermore, each component of the electronic device 30 is connected via a bus system. In addition to the data bus, the bus system further includes a power bus, a control bus, and a status signal bus.
[0547] Figure 14 is a block diagram showing a video encoding / decoding system 40 according to an embodiment of this application.
[0548] As shown in Figure 14, the video encoding / decoding system 40 may include a video encoder 41 and a video decoder 42. The video encoder 41 is used to perform a video encoding method according to an embodiment of this application, and the video decoder 42 is used to perform a video decoding method according to an embodiment of this application.
[0549] In some embodiments, the application further provides a bitstream, which is obtained by the encoding method described above.
[0550] This application further provides a computer storage medium in which a computer program is stored. The computer program, when executed by a computer, enables the computer to perform the method of the above-described embodiment of the method. Alternatively, embodiments of this application further provide a computer program product including instructions, which, when executed by a computer, causes the computer to perform the method of the above-described embodiment of the method.
[0551] When implemented by software, all or part of the above embodiments may be implemented in the form of a computer program product. Such computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions of the embodiments of this application are implemented. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable device. The computer instructions may be stored on a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic cable, digital subscriber line (DSL), etc.) or wirelessly (e.g., infrared, radio, microwave, etc.). The computer-readable storage medium may be any available medium accessible to a computer, or it may be a data storage device that integrates one or more available mediums, such as a server or data center. The available media may be magnetic media (e.g., floppy disks, hard disks, or magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0552] A person skilled in the art will be aware that, in conjunction with the exemplary units and algorithmic operations described in the embodiments disclosed herein, the invention can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software will depend on the specific application of the invention and design limitations. A person skilled in the art may implement the functions described using different methods for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0553] In some embodiments of this application, the systems, devices, and methods disclosed should be understood to be implementable in other forms. For example, the above-described device embodiments are merely illustrative. For example, the division of a unit is merely a division of a logic function, and in actual implementation, it may have a different division form. For example, multiple units or components may be combined or integrated into another system, or some of their features may be ignored or not performed. Furthermore, the coupling, direct coupling, and communication connections between the shown or considered may be indirect coupling or communication connections by several interfaces, devices, or units, and may be in electrical, mechanical, or other forms.
[0554] Units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units. That is, they may be located in one place or be arranged in multiple network units. Some or all of the units can be selected according to actual needs to achieve the objectives of the technical proposal of this embodiment. For example, each functional unit according to each embodiment of this application may be integrated into one processing unit, each unit may exist physically independently, or two or more units may be integrated into one unit.
[0555] A video decoding method, Decode the bitstream and predict the current block to obtain the first predicted value, To determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. Based on the current block's reconstruction sample mode, determine the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, This includes determining linear transformation parameters based on adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block, and performing a linear transformation on the first predicted value based on the linear transformation parameters to obtain a second predicted value for the current block.
[0556] Determining the current block's reconstruction sample mode is: Determine the first index that indicates the reconstruction sample mode for the current block, This includes determining the reconstruction sample mode of the current block based on the first index.
[0557] Determining the first index involves decoding the bitstream to obtain the first index.
[0558] If the prediction mode for the current block is merge mode, then confirming the first index means that This involves determining the first flag of the adjacent block to the current block, the first flag of the adjacent block being used to indicate whether or not the adjacent block uses lighting compensation technology, and determining that flag. This includes determining the first index based on the first flag of the adjacent block.
[0559] Determining the first index based on the first flag of the adjacent block is: The first flag for an adjacent block includes determining that the first index is the default index if it indicates that the adjacent block is using lighting compensation technology. The default index is used to indicate the upper and left-side reconstruction sample modes.
[0560] Determining the first index based on the first flag of the adjacent block is: The first flag of an adjacent block indicates that the adjacent block is using illumination compensation technology, and the second index is used to determine the reconstructed sample mode of the adjacent block. This includes confirming the second index as the first index.
[0561] If the prediction mode for the current block is non-merge mode, confirming the first index means that This involves determining the first flag of the current block, which is used to indicate whether or not the current block uses lighting compensation technology. The first flag of the current block indicates that the current block will use lighting compensation technology, and the second flag of the current block is used to indicate whether or not the current block will use lighting compensation extension technology. This includes determining the first index based on the second flag of the current block.
[0562] Determining the first index based on the second flag of the current block is: If the second flag of the current block indicates that the current block uses illumination compensation extension techniques, this includes obtaining the first index by decoding the bitstream.
[0563] Determining the first index based on the second flag of the current block is: If the second flag of the current block indicates that the current block does not use illumination compensation extension technology, then the first index is determined to be the default index, The default index is used to indicate the upper and left-side reconstruction sample modes.
[0564] To determine the first flag of the current block, This involves decoding the bitstream to obtain the first flag of the current block.
[0565] To confirm the second flag of the current block, This includes obtaining the second flag of the current block by decoding the bitstream.
[0566] If the prediction mode for the current block is merge mode, determining the reconstruction sample mode for the current block is: This involves determining the first flag of the adjacent block to the current block, the first flag of the adjacent block being used to indicate whether or not the adjacent block uses lighting compensation technology, and determining that flag. This includes determining the reconstruction sample mode of the current block based on the first flag of the adjacent block.
[0567] Determining the reconstruction sample mode of the current block based on the first flag of the adjacent block is: The first flag for an adjacent block includes determining that the current block's reconstruction sample mode is the upper and left-side reconstruction sample mode, if the adjacent block indicates that it will use illumination compensation techniques.
[0568] Determining the reconstruction sample mode of the current block based on the first flag of the adjacent block is: The first flag of the adjacent block indicates that the adjacent block will use illumination compensation technology, and determines the reconstruction sample mode of the adjacent block. This includes determining the reconstruction sample mode of an adjacent block as the reconstruction sample mode of the current block.
[0569] Determining the reconstruction sample mode for adjacent blocks is This involves determining the second index, which is used to indicate the reconstruction sample mode of the adjacent block. This includes determining the reconstruction sample mode of adjacent blocks based on the second index.
[0570] Based on the current block's reconstruction sample mode, determining the adjacent reconstruction samples of the current block and the reference block is: If the reconstruction sample mode for the current block is left-side reconstruction sample mode, this includes determining the adjacent reconstruction samples for the current block based on the left-side adjacent samples for the current block, and determining the adjacent reconstruction samples for the reference block based on the left-side adjacent samples for the reference block corresponding to the current block in the reference image.
[0571] Determining the adjacent reconstructed sample of the current block based on the left-side adjacent sample of the current block is: This includes determining the adjacent reconstruction sample of the current block based on the current block height and the left-side adjacent sample of the current block.
[0572] Determining the adjacent reconstructed sample of the current block based on the current block height and the left-side adjacent sample of the current block is: If the current block height is equal to the first number, this includes selecting the first number of samples from the left-side adjacent samples of the current block and confirming them as adjacent reconstruction samples of the current block.
[0573] Determining the adjacent reconstructed sample of the current block based on the current block height and the left-side adjacent sample of the current block is: If the current block height is not equal to the first number, this includes selecting a second number of samples from the left-side adjacent samples of the current block and determining them as adjacent reconstruction samples for the current block.
[0574] Determining the adjacent reconstructed sample of a reference block based on the left-side adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining the adjacent reconstruction samples of the reference block based on the height of the reference block and the left-side adjacent samples of the reference block.
[0575] Determining the adjacent reconstruction sample of a reference block based on the height of the reference block and the left adjacent sample of the reference block is: If the height of the reference block is equal to the first number, the process includes interpolating the left-side adjacent samples of the reference block to obtain the first number of samples, which are then used as the adjacent reconstructed samples of the reference block.
[0576] Determining the adjacent reconstruction sample of a reference block based on the height of the reference block and the left adjacent sample of the reference block is: If the height of the reference block is not equal to the first number, this includes interpolating the left-side adjacent samples of the reference block to obtain a second number of samples, which will be the adjacent reconstructed samples of the reference block.
[0577] Based on the current block's reconstruction sample mode, determining the adjacent reconstruction samples of the current block and the reference block is: If the reconstruction sample mode of the current block is upper reconstruction sample mode, this includes determining the adjacent reconstruction samples of the current block based on the upper adjacent samples of the current block, and determining the adjacent reconstruction samples of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference image.
[0578] Determining the adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block is: This includes determining the adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block.
[0579] Determining the adjacent reconstruction sample of the current block based on the current block width and the upper adjacent sample of the current block is: If the width of the current block is equal to the first number, this includes selecting the first number of samples from the upper adjacent samples of the current block and determining them as adjacent reconstruction samples for the current block.
[0580] Determining the adjacent reconstruction sample of the current block based on the current block width and the upper adjacent sample of the current block is: If the width of the current block is not equal to the first number, this includes selecting a second number of samples from the upper adjacent samples of the current block and determining them as adjacent reconstruction samples for the current block.
[0581] Determining the adjacent reconstructed sample of a reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining adjacent reconstruction samples of a reference block based on the width of the reference block and the upper adjacent samples of the reference block.
[0582] Determining the adjacent reconstruction samples of a reference block based on the width of the reference block and the upper adjacent samples of the reference block is: If the width of the reference block is equal to the first number, the process includes interpolating the upper adjacent samples of the reference block to obtain the first number of samples, which are then used as adjacent reconstructed samples of the reference block.
[0583] Determining the adjacent reconstruction samples of a reference block based on the width of the reference block and the upper adjacent samples of the reference block is: If the width of the reference block is not equal to the first number, the process includes interpolating the upper adjacent samples of the reference block to obtain a second number of samples, and determining the adjacent reconstructed samples of the reference block based on the second number of interpolated samples.
[0584] The first flag includes at least one of the sequence-level flag, picture-level flag, or block-level flag.
[0585] The linear transformation parameters include the scaling factor and offset parameters, and the linear transformation parameters are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block. Based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the scaling factor is determined, Based on the adjacent reconstruction samples of the current block, the adjacent reconstruction samples of the reference block, and the scaling factor, the offset parameter is determined. Includes.
[0586] Performing a linear transformation on the first predicted value based on the linear transformation parameters to obtain the second predicted value for the current block is: This includes performing a linear transformation on the first predicted value based on the scaling factor and offset parameter to obtain the second predicted value for the current block.
[0587] By performing a linear transformation on the first predicted value based on the scaling factor and offset parameter, we can obtain the second predicted value for the current block. Determining the product of the scaling factor and the first predicted value, The sum of the product and the offset parameter is determined as the second predicted value, Includes.
[0588] Determining the current block's reconstruction sample mode is: This includes determining the reconstruction sample mode for the current block if the current image to which the current block belongs is a first-type image.
[0589] Determining the current block's reconstruction sample mode is: This includes determining the reconstruction sample mode for the current block if the area of the current block is greater than or equal to a preset threshold.
[0590] A video encoding method, To predict the current block and obtain the first predicted value for the current block, To determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. The process involves determining a second predicted value for the current block based on the current block's reconstruction sampling mode, wherein the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the current block's reconstruction sampling mode. Includes.
[0591] Determining the current block's reconstruction sample mode is: For the i-th candidate mode out of N candidate modes, determine the cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N. Based on the costs corresponding to the N candidate modes, the reconstruction sample mode for the current block is determined from the N candidate modes, Includes.
[0592] Determining the cost corresponding to the i-th candidate mode is: Based on the i-th candidate mode, determine the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, Based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, the i-th linear transformation parameter is determined, The first predicted value for the current block is determined, and a linear transformation is performed on the first predicted value based on the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode. This includes determining the cost corresponding to the i-th candidate mode based on a second predicted value corresponding to the i-th candidate mode.
[0593] Based on the i-th candidate mode, determining the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block is: If the i-th candidate mode is the left re-converted sample mode, the process includes determining the i-th adjacent reconstructed sample of the current block based on the left adjacent sample of the current block, and determining the i-th adjacent reconstructed sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference image.
[0594] Determining the i-th adjacent reconstructed sample of the current block based on the left-side adjacent sample of the current block is: This includes determining the i-th adjacent reconstructed sample of the current block based on the current block height and the left-side adjacent sample of the current block.
[0595] Determining the i-th adjacent reconstructed sample of the current block based on the current block height and the left-side adjacent sample of the current block is: If the height of the current block is equal to the first number, this includes selecting a first number of samples from the left-side adjacent samples of the current block and determining them as the i-th adjacent reconstructed sample of the current block.
[0596] Determining the i-th adjacent reconstructed sample of the current block based on the current block height and the left-side adjacent sample of the current block is: If the current block height is not equal to the first number, this includes selecting a second number of samples from the left-side adjacent samples of the current block and determining them as the i-th adjacent reconstructed sample of the current block.
[0597] Determining the i-th adjacent reconstructed sample of a reference block based on the left-side adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining the i-th adjacent reconstructed sample of the reference block based on the height of the reference block and the left-side adjacent sample of the reference block.
[0598] Determining the i-th adjacent reconstructed sample of the reference block based on the height of the reference block and the left adjacent sample of the reference block is: If the height of the reference block is equal to the first number, this includes interpolating the left-side adjacent samples of the reference block to obtain the first number of samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0599] Determining the i-th adjacent reconstructed sample of the reference block based on the height of the reference block and the left adjacent sample of the reference block is: If the height of the reference block is not equal to the first number, this includes interpolating the left-side adjacent samples of the reference block to obtain a second number of samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0600] Based on the i-th candidate mode, determining the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block is: If the i-th candidate mode is the upper reconstructed sample mode, the process includes determining the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block, and determining the i-th adjacent reconstructed sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image.
[0601] Determining the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block is: This includes determining the i-th adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block.
[0602] Determining the i-th adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block is: If the width of the current block is equal to the first number, this includes selecting the first number of samples from the upper adjacent samples of the current block and determining them as the i-th adjacent reconstruction sample of the current block.
[0603] Determining the i-th adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block is: If the width of the current block is not equal to the first number, this includes selecting a second number of samples from the upper adjacent samples of the current block and determining them as the i-th adjacent reconstructed sample of the current block.
[0604] Determining the i-th adjacent reconstructed sample of a reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining the i-th adjacent reconstructed sample of the reference block based on the width of the reference block and the upper adjacent sample of the reference block.
[0605] Determining the i-th adjacent reconstructed sample of the reference block based on the width of the reference block and the upper adjacent sample of the reference block is: If the width of the reference block is equal to the first number, this includes interpolating the upper adjacent samples of the reference block to obtain the first number of samples, which are then used as the i-th adjacent reconstructed sample of the reference block.
[0606] Determining the i-th adjacent reconstructed sample of the reference block based on the width of the reference block and the upper adjacent sample of the reference block is: If the width of the reference block is not equal to the first number, this includes interpolating the upper adjacent samples of the reference block to obtain a second number of samples, which will be the i-th adjacent reconstructed sample of the reference block.
[0607] The i-th linear transformation parameter includes the i-th scaling factor and the i-th offset parameter, and the i-th linear transformation parameter is determined based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block. Based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block, the i-th scaling factor is determined, Based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor, the i-th offset parameter is determined. Includes.
[0608] Performing a linear transformation on the first predicted value based on the i-th linear transformation parameter to obtain the second predicted value corresponding to the i-th candidate mode is: This includes performing a linear transformation on the first predicted value based on the i-th scaling factor and the i-th offset parameter to obtain a second predicted value corresponding to the i-th candidate mode.
[0609] Performing a linear transformation on the first predicted value based on the i-th scaling factor and the i-th offset parameter to obtain the second predicted value corresponding to the i-th candidate mode is: Determine the product of the i-th scaling factor and the first predicted value, The sum of the product and the i-th offset parameter is determined as the second predicted value corresponding to the i-th candidate mode, Includes.
[0610] Determining the cost corresponding to the i-th candidate mode based on the second predicted value corresponding to the i-th candidate mode is: This includes determining the cost corresponding to the i-th candidate mode based on the second predicted value corresponding to the i-th candidate mode and the current block.
[0611] Determining the reconstruction sample mode for the current block from N candidate modules based on the cost corresponding to N candidate models is: This includes determining the candidate mode with the minimum cost among the N candidate modes as the reconstruction sample mode for the current block.
[0612] Based on the current block's reconstruction sample mode, determining the second predicted value for the current block is: This includes determining the second predicted value corresponding to the current block's reconstruction sample mode as the second predicted value for the current block.
[0613] The video encoding method is: This further includes writing the first index to the bitstream, The first index is used to indicate the reconstruction sample mode for the current block.
[0614] If the prediction mode for the current block is merge mode, determining the reconstruction sample mode for the current block is: This involves determining the first flag of the adjacent block to the current block, the first flag of the adjacent block being used to indicate whether or not the adjacent block uses lighting compensation technology, and determining that flag. This includes determining the reconstruction sample mode of the current block based on the first flag of the adjacent block.
[0615] Determining the reconstruction sample mode of the current block based on the first flag of the adjacent block is: The first flag for an adjacent block includes determining that the current block's reconstruction sample mode is the upper and left-side reconstruction sample mode, if the adjacent block indicates that it will use illumination compensation techniques.
[0616] Determining the reconstruction sample mode of the current block based on the first flag of the adjacent block is: If the first flag of an adjacent block indicates that the adjacent block will use lighting compensation technology, then the reconstruction sample mode of the adjacent block is determined. This includes determining the reconstruction sample mode of an adjacent block as the reconstruction sample mode of the current block.
[0617] Determining the reconstruction sample mode for adjacent blocks is This involves determining the second index, which is used to indicate the reconstruction sample mode of the adjacent block. This includes determining the reconstruction sample mode of adjacent blocks based on the second index.
[0618] Based on the current block's reconstruction sample mode, determining the second predicted value for the current block is: Based on the current block's reconstruction sample mode, determine the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, Based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the linear transformation parameters are determined, and a linear transformation is performed on the first predicted value based on the linear transformation parameters to obtain the second predicted value of the current block. Includes.
[0619] The video encoding method is: This further includes determining the first flag of the current block and writing the first flag to the bitstream, The first flag of the current block is used to indicate whether or not the current block uses lighting compensation technology.
[0620] The video encoding method is: The first flag of the current block further includes determining the second flag of the current block if the current block indicates the use of illumination compensation techniques, and writing the second flag of the current block to the bitstream. The second flag of the current block is used to indicate whether the current block uses lighting compensation extension technology.
[0621] The video encoding method is: The second flag for the current block further includes writing the index of the current block's reconfigured sample mode to the bitstream if the current block indicates that it should use illumination compensation extension techniques.
[0622] If the prediction mode for the current block is merge mode, then determining the first flag of the current block is: This involves determining the first flag of the adjacent block to the current block, the first flag of the adjacent block being used to indicate whether or not the adjacent block uses lighting compensation technology, and determining that flag. This includes determining the first flag of the current block based on the first flag of the adjacent block.
[0623] If the prediction mode for the current block is merge mode, confirming the second flag for the current block is: This involves determining the second flag of the adjacent block to the current block, where the second flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation extension technology. This includes determining the second flag of the current block based on the second flag of the adjacent block.
[0624] The first flag includes at least one of the sequence-level flag, picture-level flag, or block-level flag.
[0625] Determining the current block's reconstruction sample mode is: This includes determining the reconstruction sample mode for the current block if the current image to which the current block belongs is a first-type image.
[0626] Determining the current block's reconstruction sample mode is: This includes determining the reconstruction sample mode for the current block if the area of the current block is greater than or equal to a preset threshold.
[0627] A video decoding device, It comprises a decoding unit, a mode determination unit, a sample determination unit, and a linear transformation unit. The decoding unit is configured to decode the bitstream and predict the current block to obtain the first predicted value of the current block. The mode determination unit is configured to determine the reconstructed sample mode of the current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of the upper reconstructed sample mode, the left reconstructed sample mode, and the upper and left reconstructed sample modes. The sample confirmation unit is configured to confirm the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block based on the reconstruction sample mode of the current block. The linear transformation unit is configured to determine the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and then perform a linear transformation on the first predicted value based on the linear transformation parameters to obtain the second predicted value for the current block.
[0628] A video encoding device, It comprises a prediction unit, a mode determination unit, and a linear transformation unit, The prediction unit is configured to predict the current block and obtain the first predicted value for the current block. The mode determination unit is configured to determine the reconstructed sample mode of the current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of the upper reconstructed sample mode, the left reconstructed sample mode, and the upper and left reconstructed sample modes. The linear transformation unit is configured to determine a second predicted value for the current block based on the reconstruction sample mode of the current block, and the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the reconstruction sample mode of the current block.
[0629] A video encoding / decoding system, Includes a video encoder and a video decoder, The video decoder is configured to perform a video decoding method. A video encoder is configured to perform a video encoding method.
[0630] It is an electronic device, Equipped with a processor and memory, Memory is configured to store computer programs. The processor is configured to execute a computer program to perform a video decoding method or a video encoding method.
[0631] A computer-readable storage medium, A computer-readable storage medium is configured to store computer-executable instructions, and when a processor executes a computer-executable instruction, it executes a video decoding method or a video encoding method.
[0632] It is a bitstream, generated based on a video encoding method.
[0633] The above description is merely a specific embodiment of the present application, and the scope of protection of this application is not limited thereto. Any modification or substitution that a person skilled in the art could easily conceive within the scope of the art disclosed in this application should be included within the scope of protection of this application. Accordingly, the scope of protection of this application should be the same as the scope of protection of the claims.
Claims
1. A video decoding method, Decode the bitstream and predict the current block to obtain the first predicted value, Determine the first index that indicates the reconstruction sample mode of the current block, Based on the first index, determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. Based on the reconstruction sample mode of the current block, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined, Based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, the linear transformation parameters are determined, and based on the linear transformation parameters, the first predicted value is subjected to a linear transformation to obtain the second predicted value of the current block. Includes, If the prediction mode of the current block is merge mode, then determining the first index means that Determining the first flag of the adjacent block to the current block, the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology, Based on the first flag of the adjacent block, the first index is determined, including, A video decoding method characterized by the following features.
2. Determining the first index based on the first flag of the adjacent block is: The first flag of the adjacent block includes determining that the first index is the default index if it indicates that the adjacent block is using lighting compensation technology. The default index is used to indicate the upper and left-side reconstruction sample modes. The video decoding method according to feature 1.
3. Determining the first index based on the first flag of the adjacent block is: The first flag of the adjacent block indicates that the adjacent block is using illumination compensation technology, and the second index is determined to be used to indicate the reconstructed sample mode of the adjacent block. The second index is determined to be the first index, including, The video decoding method according to feature 1.
4. If the prediction mode of the current block is non-merge mode, then determining the first index means that Determining the first flag of the current block, which is used to indicate whether or not the current block uses lighting compensation technology, The first flag of the current block indicates that the current block will use the illumination compensation technology, and the second flag of the current block is used to indicate whether or not the current block will use the illumination compensation extension technology. Based on the second flag of the current block, the first index is determined, including, The video decoding method according to feature 1.
5. Determining the first index based on the second flag of the current block means that If the second flag of the current block indicates that the current block uses the illumination compensation extension technique, the process includes obtaining the first index by decoding the bitstream. The video decoding method according to feature 4.
6. Determining the first index based on the second flag of the current block means that If the second flag of the current block indicates that the current block does not use the illumination compensation extension technique, then the first index is determined to be the default index, The default index is used to indicate the upper and left-side reconstruction sample modes. The video decoding method according to feature 4.
7. Based on the current block's reconstruction sample mode, determining the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block is: If the reconstruction sample mode of the current block is the upper reconstruction sample mode, the adjacent reconstruction samples of the current block are determined based on the upper adjacent samples of the current block, and the adjacent reconstruction samples of the reference block are determined based on the upper adjacent samples of the reference block corresponding to the current block in the reference image. The video decoding method according to any one of claims 1 to 6.
8. Determining the adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block is: This includes determining the adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block, The video decoding method according to feature 7.
9. Determining the adjacent reconstruction sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining adjacent reconstruction samples of the reference block based on the width of the reference block and the upper adjacent samples of the reference block. The video decoding method according to feature 7.
10. The linear transformation parameters include a scaling factor and an offset parameter, and determining the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block is: The scaling factor is determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block. The offset parameter is determined based on the adjacent reconstruction samples of the current block, the adjacent reconstruction samples of the reference block, and the scaling factor. Includes, Performing a linear transformation on the first predicted value based on the linear transformation parameters to obtain the second predicted value for the current block is: This includes performing a linear transformation on the first predicted value based on the scaling factor and the offset parameter to obtain a second predicted value for the current block, The video decoding method according to any one of claims 1 to 6.
11. A video encoding method, To predict the current block and obtain the first predicted value of the current block, Determine the first index that indicates the reconstruction sample mode of the current block, Based on the first index, determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. The determination of a second predicted value for the current block based on the current block's reconstruction sample mode, wherein the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the current block's reconstruction sample mode. Includes, If the prediction mode of the current block is merge mode, then determining the first index means that Determining the first flag of the adjacent block to the current block, the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology, Based on the first flag of the adjacent block, the first index is determined, including, A video encoding method characterized by the following features.
12. Determining the first index based on the first flag of the adjacent block is: The first flag of the adjacent block includes determining that the first index is the default index if it indicates that the adjacent block is using lighting compensation technology. The default index is used to indicate the upper and left-side reconstruction sample modes. The video encoding method according to feature 11.
13. Determining the first index based on the first flag of the adjacent block is: The first flag of the adjacent block indicates that the adjacent block is using illumination compensation technology, and the second index is determined to be used to indicate the reconstructed sample mode of the adjacent block. The second index is determined to be the first index, including, The video encoding method according to feature 11.
14. When the prediction mode of the current block is non-merge mode, determining the first index means Determining the first flag of the current block, which is used to indicate whether or not the current block uses lighting compensation technology, The first flag of the current block indicates that the current block will use the illumination compensation technology, and the second flag of the current block is used to indicate whether or not the current block will use the illumination compensation extension technology. Based on the second flag of the current block, the first index is determined, including, The video encoding method according to feature 11.
15. Determining the first index based on the second flag of the current block is: If the second flag of the current block indicates that the current block uses the illumination compensation extension technique, the process includes determining the first index and writing the first index to the bitstream. The video encoding method according to feature 14.
16. Determining the first index based on the second flag of the current block is: If the second flag of the current block indicates that the current block does not use the illumination compensation extension technique, then the first index is determined to be the default index, The default index is used to indicate the upper and left-side reconstruction sample modes. The video encoding method according to feature 14.
17. Based on the reconstruction sample mode of the current block, determining the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block is: If the reconstruction sample mode of the current block is the upper reconstruction sample mode, the adjacent reconstruction samples of the current block are determined based on the upper adjacent samples of the current block, and the adjacent reconstruction samples of the reference block are determined based on the upper adjacent samples of the reference block corresponding to the current block in the reference image. The video encoding method according to any one of claims 11 to 16, characterized by the features described herein.
18. Determining the adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block is: This includes determining the adjacent reconstruction sample of the current block based on the width of the current block and the upper adjacent sample of the current block, The video encoding method according to feature 17.
19. Determining the adjacent reconstruction sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference image is: This includes determining adjacent reconstruction samples of the reference block based on the width of the reference block and the upper adjacent samples of the reference block. The video encoding method according to feature 17.
20. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program / computer instruction and a bitstream, and when the computer program / computer instruction is executed by a processor, a video encoding method is implemented to generate the bitstream, The aforementioned video encoding method is To predict the current block and obtain the first predicted value for the current block, Determine the first index that indicates the reconstruction sample mode of the current block, Based on the first index, determine the reconstruction sample mode of the current block, wherein the reconstruction sample mode is one of N candidate modes, and the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes. This includes determining a second predicted value for the current block based on the current block's reconstruction sample mode, wherein the second predicted value is obtained by performing light irradiation compensation on the first predicted value based on the current block's reconstruction sample mode, If the prediction mode of the current block is merge mode, then determining the first index means that Determining the first flag of the adjacent block to the current block, the first flag of the adjacent block is used to indicate whether or not the adjacent block uses lighting compensation technology, Based on the first flag of the adjacent block, the first index is determined, including, A computer-readable storage medium characterized by the following features.