Video encoding / decoding method, apparatus, device, system, and storage medium
By determining the reconstruction sample mode of the current block in video encoding and decoding and performing linear transformation, the problem of poor lighting compensation effect in the prior art is solved, and the prediction effect and coding performance are improved.
Patent Information
- Application Number
- JP2024558468
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2025-04-30
- Estimated Expiration
- 2042-04-13
AI Technical Summary
The lighting compensation effect in existing video encoding technology is poor, resulting in unsatisfactory prediction effect.
During the video encoding and decoding process, the reconstruction sample mode of the current block is determined and linearly transformed based on adjacent reconstruction samples is improved.
Improve the lighting compensation effect and prediction effect of the current block, and enhance the performance of video encoding and decoding.
Smart Images

Figure 2025513778000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of video encoding and decoding technology, and more particularly to a video encoding and decoding method, apparatus, device, system, and storage medium. [Background technology]
[0002] Digital video technology can be applied to various video devices such as digital televisions, smartphones, computers, e-readers, video players, etc. 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, video devices perform video compression technology to transmit or store video data more efficiently.
[0003] In the video compression process, prediction is used to reduce data redundancy, and different images may have significant or subtle changes in a particular scene. In some embodiments, to improve compression performance, illumination compensation can be performed on the obtained prediction value to adapt to illumination changes between the current image and the reference image and reduce redundancy.
[0004] However, current illumination compensation techniques are not very effective. Summary of the Invention
[0005] The embodiments of the present application provide a video encoding and decoding method, apparatus, device, system, and storage medium, which can improve the illumination compensation effect and improve the prediction effect of the current block.
[0006] In a first aspect, the present application provides a video decoding method, the method comprising: Decoding the bitstream and predicting the current block to obtain a first prediction value; determining a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to a reconstructed sample mode of the current block; Determine a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block; Includes.
[0007] In a second aspect, the present application provides a video encoding method, the method comprising: predicting a current block to obtain a first prediction of the current block; determining a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; determining a second predicted value of the current block according to a reconstructed sample mode of the current block, where the second predicted value is obtained by performing light illumination compensation on the first predicted value according to the reconstructed sample mode of the current block; Includes.
[0008] In a third aspect, the present application provides a video encoder, the encoder being configured to perform the method of the first aspect or any embodiment thereof, in particular the encoder comprising functional units configured to perform the method of the first aspect or any embodiment thereof.
[0009] In a fourth aspect, the present application provides a video decoder, comprising a processor and a memory, the memory configured to store a computer program, the processor configured to perform the method of the second aspect or any embodiment thereof by calling and executing the computer program stored in the memory.
[0010] In a fifth aspect, there is provided a video encoder comprising a processor and a memory, the memory configured to store a computer program, the processor configured to perform the method of the first aspect or any embodiment thereof by invoking and executing the computer program stored in the memory.
[0011] In a sixth aspect, there is provided a video decoder comprising a processor and a memory, the memory configured to store a computer program, the processor configured to perform the method of the second aspect or any embodiment thereof by invoking and executing the computer program stored in the memory.
[0012] In a seventh aspect, there is provided a video encoding and decoding system, comprising a video encoder and a video decoder, the video encoder configured to perform the method of the first aspect or any embodiment thereof, and the video decoder configured to perform the method of the second aspect or any embodiment thereof.
[0013] In an eighth aspect, there is provided a chip configured to perform the method of the first or second aspect, or each embodiment of the first or second aspect, specifically, the chip includes a processor configured to call up and execute a computer program from a memory, thereby causing a device to which the chip is attached to perform the method of the first or second aspect, or each embodiment of the first or second aspect.
[0014] In a ninth aspect, there is provided a computer readable storage medium configured to store a computer program, the computer program causing a computer to perform the method of the first or second aspect above, or an embodiment of the first or second aspect.
[0015] In a tenth aspect, there is provided a computer program product which, when executed on a computer, is configured to cause the computer to carry out the method of the first or second aspect above, or a respective embodiment of the first or second aspect.
[0016] In an eleventh aspect, there is provided a computer program which, when executed by a computer, causes the computer to carry out the method of any of the first and second aspects or respective embodiments thereof.
[0017] In a twelfth aspect, there is provided a bitstream, the bitstream being generated according to the method of the second aspect.
[0018] Based on the above technical solution, in the embodiment of the present application, the reconstructed sample mode of the current block can be one of the following: an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode, the reconstructed sample selection modes are abundant, and the reconstructed sample mode that matches the feature information of the current block can be accurately determined from each of the above modes. Thus, based on the accurate reconstructed sample mode, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are more accurately determined, and linear transformation parameters are determined based on the accurately determined adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linear transformation is performed on the first predicted value of the current block 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. [Brief description of the drawings]
[0019] [Figure 1] FIG. 1 is a block diagram illustrating a video encoding / decoding system according to an embodiment of the present application. [Diagram 2] FIG. 2 is a block diagram illustrating a video encoder provided by an embodiment of the present application. [Diagram 3] FIG. 3 is a block diagram illustrating a decoding framework provided by an embodiment of the present application. [Figure 4a] FIG. 4a is a schematic diagram showing the illumination of an image. [Figure 4b] FIG. 4b is a schematic diagram showing the illumination of an image. [Diagram 5] FIG. 5 is a schematic diagram illustrating the principle of an illumination compensation technique according to an embodiment of the present application. [Figure 6] FIG. 6 is a schematic diagram of a reconstructed sample according to an embodiment of the present application. [Figure 7] FIG. 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 illustrating a video decoding device provided by an embodiment of the present application. [Figure 12] FIG. 12 is a block diagram illustrating a video encoding device provided by an embodiment of the present application. [Figure 13] FIG. 13 is a block diagram illustrating an electronic device provided by an embodiment of the present application. [Figure 14] FIG. 14 is a block diagram illustrating a video encoding and decoding system provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] Hereinafter, technical solutions in the embodiments of the present application will be described with reference to the drawings.
[0021] The present application may be applied to the image encoding / decoding field, the video encoding / decoding field, the hardware video encoding / decoding field, the dedicated circuit video encoding / decoding field, the real-time video encoding / decoding field, etc. Or, the technical solution of the present application may be combined with other dedicated standards 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 called ISO / IEC MPEG-4 AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. Note that the technology of the present application is not limited to a specific encoding / decoding standard or technology.
[0022] For ease of understanding, first, a video encoding and decoding system according to an embodiment of the present application will be introduced with reference to FIG.
[0023] FIG. 1 is a block diagram showing a video encoding / decoding system according to an embodiment of the present application. FIG. 1 is merely an example, and the video encoding / decoding system according to the embodiment of the present application includes, but is not limited to, that shown in FIG. 1. As shown in FIG. 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 transmit the bitstream to a 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 an embodiment of the present application may be understood as a device having a video encoding function, and the decoding device 120 may be understood as a device having a video decoding function, that is, the encoding device 110 and the decoding device 120 according to an embodiment of the present application may 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, in-vehicle computers, etc.
[0025] In some embodiments, encoding device 110 may transmit encoded video data (e.g., a bitstream) to decoding device 120 over channel 130. Channel 130 may include one or more media and / or devices that may transmit the encoded video data from encoding device 110 to decoding device 120.
[0026] In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit encoded video data directly 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 medium includes a wireless communication medium, such as a radio frequency spectrum. Alternatively, the communication medium can also include a wired communication medium, such as one or more physical transmission lines.
[0027] In another example, the channel 130 includes a storage medium. The storage medium can store the video data encoded by the encoding device 110. The storage medium can include various locally accessible data storage media, such as an optical disk, a digital versatile disc (DVD), a flash memory, etc. In this example, the decoding device 120 can obtain the encoded video data from the storage medium.
[0028] In another example, channel 130 may include a storage server, which may store the video data encoded by encoding device 110. In this example, decoding device 120 may download the encoded video data stored in the storage server from the storage server. Alternatively, the storage server may store the encoded video data and transmit the encoded video data to decoding device 120, examples of which include a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.
[0029] In some embodiments, encoding device 110 includes a video encoder 112 and an output interface 113. Output interface 113 may include a modulator / demodulator (modem) and / or a 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] 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 configured to receive video data from a video content provider, and the computer graphics system configured to generate the 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 encoding image data and related data. The related data may include sequence parameter sets (abbreviated as SPS), picture parameter sets (abbreviated as PPS), and other syntax structures. An SPS may include parameters that apply to one or more sequences, and a PPS may include parameters that apply to one or more pictures. A syntax structure is a collection of zero or more syntax elements arranged in a specified order in the bitstream.
[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 may also be stored in a storage medium or a storage server to be subsequently read by the decoding device 120.
[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 a modem and is capable of receiving encoded video data via a channel 130.
[0037] The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to a display device 123 .
[0038] The display device 123 displays the decoded video data and may be built into the decoding device 120 or may be external to the decoding device 120. The display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
[0039] In addition, FIG. 1 is only an example, and the technical solution of the embodiment of the present application is not limited to FIG. 1. For example, the technology of the present application can also be applied to one-sided video encoding or one-sided video decoding.
[0040] A video encoder according to an embodiment of the present application will now be described.
[0041] 2 is a block diagram illustrating a video encoder provided by an embodiment of the present application. The video encoder 200 can be configured to perform lossy or lossless compression on images. The lossless compression can be visually lossless compression or mathematically lossless compression.
[0042] The video encoder 200 is applicable to image data in luma-chroma (YCbCr, YUV) format. For example, the ratio of YUV can be 4:2:0, 4:2:2, or 4:4:4, where Y indicates luma, Cb (U) indicates blue chroma, Cr (V) indicates red chroma, and U, V indicate chroma to describe color and saturation. For example, in color format, 4:2:0 indicates that every four pixels have four luma components and two chroma components (YYYYCbCr), 4:2:2 indicates that every four pixels have four luma components and four chroma components (YYYYCbCrCbCr), and 4:4:4 indicates full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0043] For example, the video encoder 200 reads video data, and for each image in the video data, divides each image into several coding tree units (CTUs). In some examples, a CTU may be called a "tree block", a "largest coding unit (LCU)", or a "coding tree block (CTB)". Each CTU may be associated with a pixel block having the same size as the CTU in the image, and each pixel may correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU may be associated with one luminance sample block and two chrominance sample blocks. The size of the CTU may be, for example, 128×128, 64×64, 32×32, etc. The CTU may be subsequently divided into several coding units (CUs) to be encoded. The CU may be a rectangular block or a square block. The CU can be further divided into a prediction unit (PU) and a transform unit (TU), so that encoding, prediction and transformation are separated and processing can be flexible. In one example, the CTU is divided into CUs in a quadtree manner, and the CU is divided into TUs and PUs in a quadtree manner.
[0044] The video encoder and the video decoder can support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and the video decoder can support a PU size of 2N×2N or N×N for intra prediction, and can support a symmetric PU having a size of 2N×2N, 2N×N, N×2N, N×N or similar for inter prediction. The video encoder and the video decoder can also support asymmetric PUs having a size of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0045] 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. However, the video encoder 200 may include more, fewer, or different functional units.
[0046] Optionally, in this application, the current block may be referred to as the current CU or the current PU, etc. The prediction block may be referred to as the prediction image block or the image prediction block. The reconstructed image block may be referred to as the reconstruction block or the image reconstruction block.
[0047] In some embodiments, the prediction unit 210 includes an inter prediction unit 211 and an intra prediction unit 212. Since there is a strong correlation between adjacent samples in a video picture, the video encoding and decoding technology uses the intra prediction method to eliminate the spatial redundancy between adjacent samples. Since there is a strong similarity between adjacent images in a video, the video encoding and decoding technology uses the inter prediction method to eliminate the temporal redundancy between adjacent images, thereby improving the coding efficiency.
[0048] The inter prediction unit 211 can be used for inter prediction. Inter prediction includes motion estimation and motion compensation. In inter prediction, image information of different images can be referenced, and the motion information is used to find a reference block from the reference image, and a prediction block is generated based on the reference block, thereby eliminating temporal redundancy. The image used for inter prediction can be a P frame and / or a B frame. The P frame refers to a forward predicted image, and the B frame refers to a bidirectional predicted image. The motion information includes a reference image list including reference images, a 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 needs to be applied to 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. There are techniques that use the reference block as a prediction block as it is, and there are also techniques that generate a prediction block by processing based on the reference block. Processing based on a reference block to generate a predictive block can also be understood as using the reference block as a predictive block and then processing based on the predictive block to generate a new predictive block.
[0049] The intra prediction unit 212 predicts sample information in a current image block by only referring to information of the same image to eliminate spatial redundancy. The image used for intra prediction may be an I-frame. For example, as shown in FIG. 5, a white 4×4 block is a current block, and gray samples (also called pixels) one row to the left and one column above the current block are reference samples of the current block, and intra prediction uses these reference samples to predict the current block. All of these reference samples may be available, i.e., all have been encoded and decoded. Or, some reference samples may be unavailable. For example, if the current block is at the leftmost side of an image, the reference sample to the left of the current block cannot be used. Or, when encoding and decoding the current block, the sample at the bottom left corner of the current block has not been encoded and decoded, in this case, the reference sample at the bottom left corner cannot be used either. If no reference sample is available, any available reference sample, any value, or any method may be used to fill, or no filling may be used.
[0050] In some embodiments, the intra prediction method further includes a multiple reference line (MRL) intra prediction method, in which more reference samples can be used to improve encoding efficiency.
[0051] There are several prediction modes for intra prediction. In H.264, nine modes are used for intra prediction of 4x4 blocks. In mode 0, the sample above the current block is copied vertically into the current block as the prediction value. In mode 1, the reference sample to the left of the current block is copied horizontally into the current block as the prediction value. In mode 2 (direct current (DC)), the average of eight samples (A-D and I-L) is used as the prediction value for all samples. In modes 3 to 8, the reference samples are copied along a certain angle to the corresponding positions in the current block. Because some positions in the current block cannot correspond perfectly to the reference samples, a weighted average of the reference samples or an interpolated subsample of the reference samples must be used.
[0052] The intra prediction modes used in High Efficiency Video Coding (HEVC) include Plane, DC, and 33 angle modes, for a total of 35 prediction modes. The intra prediction modes used in Versatile Video Coding (VVC) include Plane, DC, and 65 angle modes, for a total of 67 prediction modes. The intra prediction modes used in Audio Video Coding Standard (AVS)3 include DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.
[0053] Furthermore, with an increase in the number of angle modes, intra prediction becomes more accurate and better meets the needs of the development of high-definition and ultra-high-definition digital videos.
[0054] Residual unit 220 may generate a residual block of a CU based on the sample block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block of a CU such that each sample in the residual block is equal to the difference between a sample in the sample block of the CU and a corresponding sample in the prediction block of the PU of the CU.
[0055] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with a CU by adjusting the QP value associated with the CU.
[0056] The inverse transform / quantization unit 240 may reconstruct a residual block from the quantized transform coefficients by applying inverse quantization and inverse transform, respectively, to the quantized transform coefficients.
[0057] Reconstruction unit 250 may generate a reconstructed image block associated with a TU by adding samples in the reconstructed residual block to corresponding samples in one or more prediction blocks generated by prediction unit 210. In this manner, by reconstructing the sample blocks of each TU of a CU, video encoder 200 may reconstruct the sample blocks of the CU.
[0058] The loop filtering unit 260 may perform a deblocking filtering process to reduce blocking artifacts of the 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 the PU of another image using the reference image including the reconstructed sample block. Also, the intra prediction unit 212 can perform intra prediction on the other PU in the same image as the CU using the reconstructed sample block in the decoding image buffer 270.
[0061] The entropy encoding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy encoding unit 280 may generate entropy coded data by performing one or more entropy coding operations on the quantized transform coefficients.
[0062] The basic flow of video encoding according to the present application is as follows: On the encoding side, a current image (frame) is divided into blocks, and for a current block, a prediction unit 210 performs intra prediction or inter prediction to generate a prediction block of the current block. A residual unit 220 can calculate a residual block based on a prediction block and an original block of the current block, i.e., a difference between the prediction block and the original block of the current block, and the residual block is also called residual information. The residual block is transformed and quantized by a transform / quantization unit 230, so that information that is not sensitive to human eyes can be removed and visual redundancy can be eliminated. Alternatively, the residual block before being transformed and quantized by the transform / quantization unit 230 can be called a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform / quantization unit 230 can be called a frequency residual block or a frequency-domain residual block. The entropy encoding unit 280 may receive the quantized transformation coefficients output by the transform / quantization unit 230 and output a bitstream by entropy coding the quantized transformation coefficients. For example, the entropy encoding unit 280 may remove character redundancies based on a target context model and probability information of the binary bitstream.
[0063] The video encoder also dequantizes and inverse transforms the quantized transform coefficients output by the transform / quantization unit 230 to obtain a residual block of the current block, and adds the residual block of the current block and the prediction block of the current block to obtain a reconstructed block of the current block. As the encoding proceeds, reconstructed blocks corresponding to other image blocks in the current image are obtained, and these reconstructed blocks are spliced together to obtain a reconstructed image of the current image. During encoding, errors are introduced, so the reconstructed image is filtered to reduce the errors. For example, the reconstructed image is filtered using ALF to reduce the difference between the pixel values of pixel points in the reconstructed image and the original pixel values of pixel points in the current image. The filtered reconstructed image is stored in the decoding image buffer 270 and can be a reference image for inter-prediction of subsequent images.
[0064] In addition, the block division information determined by the encoding side, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. are carried in the bitstream as necessary. The decoding side analyzes the bitstream and determines the same block division information, mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc. as the encoding side by analyzing the bitstream from existing information. This ensures that the decoding image obtained by the encoding side is the same as the decoding image obtained by the decoding side.
[0065] FIG. 3 is a block diagram illustrating a video decoder provided by an embodiment of the present application.
[0066] 3, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization and transform unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional units.
[0067] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may extract syntax elements from the bitstream by parsing the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse entropy coded syntax elements in the bitstream. The prediction unit 320, the inverse quantization and transformation unit 330, the reconstruction unit 340, and the loop filtering unit 350 may decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.
[0068] In some embodiments, the prediction unit 320 includes an inter prediction unit 321 and an intra prediction unit 322 .
[0069] Intra Prediction Unit 322 can generate a predicted block of the PU by performing intra prediction. Intra Prediction Unit 322 may utilize an intra prediction mode to generate a predictive block of a PU based on sample blocks of spatially neighboring PUs. Intra Prediction Unit 322 may further determine an intra-prediction mode of the PU based on one or more syntax elements parsed from the bitstream.
[0070] Inter Prediction Unit 321may construct a first reference image list (list 0) and a second reference image list (list 1) based on syntax elements parsed from the bitstream. In addition, if the PU is encoded with inter prediction, the entropy decoding unit 310 may parse motion information of the PU. Inter Prediction Unit 321 may determine one or more reference blocks of the PU based on the motion information of the PU. Inter Prediction Unit 321 may generate a predictive block of the PU based on one or more reference blocks of the PU.
[0071] The inverse quantization and transform unit 330 may inverse quantize (i.e., dequantize) the transform coefficients associated with the TU. The inverse quantization and transform unit 330 may determine the degree of quantization using a QP value associated with the CU of the TU.
[0072] After inverse quantizing the transform coefficients, the inverse quantization and transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
[0073] The reconstruction unit 340 reconstructs a sample block of a CU using a residual block associated with a TU of the CU and a prediction block of a PU of the CU. For example, the reconstruction unit 340 can reconstruct the sample block of a CU by adding a sample in the residual block to a corresponding sample in the prediction block to obtain a reconstructed image block.
[0074] The loop filtering unit 350 may 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 a sample adaptive loop filtering (ALF) unit.
[0076] The video decoder 300 may store the reconstructed image of the CU in the decoding image buffer 360. The video decoder 300 may use the reconstructed image in the decoding image buffer 360 as a reference image for subsequent prediction, or may transmit the reconstructed image to a display device for display.
[0077] The basic flow of video decoding according to the present application is as follows: The entropy decoding unit 310 may obtain prediction information, a quantization coefficient matrix, etc. of a current block by analyzing a bitstream, and the prediction unit 320 generates a prediction block of the current block by performing intra prediction or inter prediction on the current block based on the prediction information. The inverse quantization and transformation unit 330 uses the quantization coefficient matrix obtained from the bitstream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed block forms a reconstructed image. The loop filtering unit 350 loop filters the reconstructed image based on an image or block to obtain a decoded image. The decoded image may be called a reconstructed image, which may be displayed by a display device on the one hand, or may be stored in a decoding image buffer 360 and serve as a reference image for inter prediction of a subsequent image.
[0078] The above is a basic flow of video encoding and decoding in a block-based mixed coding framework. As technology develops, some modules or steps of the framework or flow may be optimized. This application applies to, but is not limited to, the basic flow of video encoding and decoding in a block-based mixed coding framework.
[0079] The quantization-related technology related to this application will be introduced below.
[0080] The international video coding standardization organization JVET established a team to research coding models other than H.266 / VCC, and named this model, i.e. platform test software, Enhanced Compression Model (ECM). ECM is based on VVC's reference software test platform (VVC Test Model, VTM) VTM10.0, and introduces updated and more efficient compression algorithms, and currently its coding performance is about 13% higher than VVC. ECM not only expands the coding unit size for a certain resolution, but also uses multiple intra prediction and inter prediction techniques.
[0081] It can be understood that the technical solution provided by the embodiment of the present application is an improvement on the ECM reference software to obtain higher encoding efficiency.
[0082] In real natural videos, the illumination intensity on the video content is constantly changing. For example, the illumination intensity decreases over time, is blocked by clouds, or the camera flash intensity changes. The difference between the image of the previous frame and the image of the next frame of these video contents is mainly the strength of the DC component of the image, and the texture information in the content is almost unchanged. However, due to the influence of the large DC component value, the motion search and motion compensation of the inter-prediction technique cannot effectively predict these contents, and it is easy to encode a large amount of residual information. The Local Illumination Compensation (LIC) technique can well remove these DC redundant information, accurately predict the luminance change, and perform corresponding compensation, thus reducing the residual information and improving the encoding efficiency. In some embodiments, the local illumination compensation technique is simply called illumination compensation.
[0083] At present, the latest video coding standard H.266 / VCC has been drafted, and JVET has proposed to explore a video coding standard that exceeds VVC in encoding performance based on VVC, and conducted the exploratory experiment EE 2 to surpass VVC. The platform reference software used in the exploratory experiment is based on VTM10.0, adopts a new algorithm, and the branch has been changed to ECM, and at the same time, several expert discussion groups have been established for ECM. The latest version 4.0 of the ECM reference software exceeds VVC in encoding performance by about 15%, but the current latest standard, VVC, has only about 27% higher encoding performance than the previous generation video coding standard H.265 / HEVC. It can be imagined that in the near future, it may open a window for the exploration and research of next-generation video coding standards based on ECM.
[0084] In the early stages when ECM is proposed, the reference software will integrate coding tools not present in VVC, and these encoding tools will provide efficient coding performance and processing power for different encoding scenarios of ECM (including LIC).
[0085] Below, the LIC in the ECM according to some embodiments will be briefly described.
[0086] Illumination compensation technology is an inter-encoding technology. In the inter-encoding process, the current coding unit obtains corresponding reference blocks based on motion vector (MV) information, and these reference blocks usually come from different coding pictures, or the reference coding unit does not belong to the current picture. In a certain scene, different pictures have significant or slight changes, and illumination compensation technology can effectively handle some changes therein.
[0087] For example, referring to FIG. 4A and FIG. 4B, the texture information of FIG. 4A and FIG. 4B are basically the same, but the luminance changes of the two are different. FIG. 4B is illuminated by the camera flash and looks very bright. FIG. 4A is illuminated by normal natural light. Differences arise when comparing the two, and this difference brings a large burden to video encoding. If FIG. 4A and FIG. 4B are taken as the reference coding unit, the texture information of the two is the same, so the difference in texture details is small, but the overall residual is large. This is because the pixel samples of the pixels in FIG. 4B are offset overall due to the effect of the flash, and the residuals of the two contain the offset of this part. If the residual is directly transformed and quantized and written into the bitstream, the overhead of this part will be huge.
[0088] The lighting compensation technology in the ECM re-referencing software uses linear fitting to remove lighting changes such as the effects of flash and lighting changes, resulting in a better overall prediction effect.
[0089] In some embodiments, the main parts of the illumination compensation technique are as follows.
[0090] The correlation of the reconstructed samples of the reference coding unit (also called reference block) and the neighboring parts of the current coding unit (also called current block) is used to fit the correlation of the changes between the predicted samples of the current coding unit and the reference samples. The upper and left reconstructed samples adjacent to the current coding unit can be obtained if they exist, and the upper and left reconstructed samples adjacent to the reference coding unit in the reference image can also be obtained. 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] JPEG2025513778000027.jpg57152
[0092] JPEG2025513778000028.jpg57152
[0093] In the process of coding digital video, the coding block of the current image obtains a compensated prediction block by compensating for illumination difference using an illumination compensation model, as shown in FIG.
[0094] Calculate a scaling factor a and an offset parameter b according to 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 the offset parameter b are obtained by modeling 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 FIG. 6, each reconstructed sample (also called reconstructed pixel) is the nearest neighbor reconstructed sample of a CU. The reference image CU is the corresponding reconstructed CU in the reference image, also called reference CU or reference block. The current image CU is the CU to be coded in the current image, also called current CU or current block. The corresponding reconstructed samples in the two images are modeled to obtain a linear relationship to obtain a scaling parameter a and an offset parameter b, and the linear relationship is applied to the reference image CU to obtain a 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. Optionally, the two parameters are obtained by a least square error method. Set the quantity of selected reconstructed samples 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, select four reconstructed samples from the upper neighboring reconstructed samples of the coding unit, and select four reconstructed samples from the left neighboring reconstructed samples of the coding unit. For example, if the width and height of the current coding unit is 16 and 4, select all four left neighboring reconstructed samples, and select four reconstructed samples from the upper neighboring reconstructed samples with a step size of 3. If the width and height of the current coding unit are not equal to 4, select the base 2 logarithm (log 2 (minimum of width and height) samples are taken, and the base 2 logarithm of the minimum of width and height (log 2 Take (minimum of width and height) samples.
[0097] JPEG2025513778000029.jpg95152
[0098] If the reconstructed samples used to compute the linear mode parameters belong to an inter-predicted block, an interpolation operation is necessary.
[0099] In some embodiments, the illumination compensation technique in the ECM can work on normal inter prediction mode, merged prediction mode and sub-block mode. The normal inter prediction mode is inter mode, the merged prediction mode is a merged prediction technique, i.e., merge mode, and the sub-block mode is affine mode. At the same time, the illumination compensation technique is only applied to single-frame prediction mode and is unavailable in multi-frame bidirectional reference mode.
[0100] In some embodiments, the illumination compensation technique in ECM is related to the technique employed, for example, the illumination compensation technique is not used in conjunction with bi-directional optical flow (BDOF) technique or symmetric motion vector difference mode (SMVD) technique.
[0101] In the illumination compensation technique described in the above embodiment, when determining the parameters a and b, if both the top reconstructed sample and the left reference sample are available, the top reconstructed sample and the left reconstructed sample of the current block and the reference block are selected.
[0102] However, in some cases, for example when samples in a coding block are significantly different, similar to one reconstructed sample and significantly different from the other reconstructed image, the current coding block cannot be predicted well based on the upper and left reconstructed samples, resulting in insufficient linear offset or too large linear offset.
[0103] In order to solve the above technical problems, the embodiment of the present invention increases the selection manner of the reconstruction sample, i.e. increases the reconstruction sample mode, for example, increases the left reconstruction sample mode and / or the top reconstruction sample mode, in which the reconstruction samples in the left reconstruction sample mode are all obtained from the left adjacent samples of the image block, and in the top reconstruction sample mode, the reconstruction samples are all obtained from the top adjacent samples of the image block. In this way, when performing illumination compensation on the predicted value of the current block, multiple reconstruction sample modes can be selected according to the actual situation, thereby improving the effect of illumination compensation and improving the prediction performance.
[0104] Hereinafter, the technical solutions provided by the embodiments of the present application will be described in detail with reference to specific embodiments.
[0105] First, the decoding side will be described as an example with reference to FIG.
[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 applied to the video decoder shown in Figure 1 and Figure 3. As shown in Figure 7, the method of the embodiment of the present invention includes the following steps:
[0107] S401, a bitstream is decoded and a current block is predicted to obtain a first predicted value of the current block.
[0108] When decoding a current block, the decoding side decodes a bitstream, determines a prediction mode corresponding to the current block, predicts the current block according to the prediction mode, and obtains a predicted value of the current block. In the embodiment of the present application, a new predicted value is obtained by performing illumination compensation on the predicted value obtained in this step, so for convenience of description, in the embodiment of the present application, the predicted value obtained based on the prediction mode is recorded as a first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as a second predicted value.
[0109] The embodiments of the present application do not limit the prediction method of the current block.
[0110] In some embodiments, the current block is predicted using an inter-prediction mode to obtain a first predicted value of the current block. For example, the bitstream is decoded to obtain motion information corresponding to the current block, a reference block is found from a reference image based on the motion information, and a first predicted 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. If the motion vector is a fractional-sample motion vector, an interpolation filter needs to be applied to 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 a prediction block. In some embodiments, the prediction block is generated by further processing based on the reference block.
[0111] S402, the reconstruction sample mode of the current block is determined.
[0112] Here, the reconstructed sample mode is one of N candidate modes, where the N candidate modes include at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode.
[0113] There is no strict order requirement for the execution process of S402 and S401. For example, S402 can be executed before S401, after S401, or synchronously with S401, and the embodiment of the present application is not limited thereto.
[0114] As mentioned above, in order to improve the prediction effect, the illumination compensation is performed on the obtained first predicted value to obtain a second predicted value. Specifically, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined, and linear transformation parameters are determined according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linear transformation is performed on the first predicted value according to the linear transformation parameters to obtain a second predicted value of the current block.
[0115] In order to improve the illumination compensation effect, the embodiments of the present application add some new methods of determining the reconstruction samples, such as the top reconstruction sample mode and / or the left reconstruction sample mode.
[0116] The left reconstructed sample mode means that all the reconstructed samples in the neighboring reconstructed samples of the current block come from the left neighboring reconstructed samples of the current block, and all the reconstructed samples in the neighboring reconstructed samples of the reference block come from the left neighboring reconstructed samples of the reference block.
[0117] The upper reconstructed sample mode means that all the reconstructed samples in the adjacent reconstructed samples of the current block come from the upper adjacent reconstructed samples of the current block, and all the reconstructed samples in the adjacent reconstructed samples of the reference block come from the upper adjacent reconstructed samples of the reference block.
[0118] The upper and left reconstructed sample mode means that all the reconstructed samples among the neighboring reconstructed samples of the current block come from the upper and left neighboring reconstructed samples of the current block, and all the reconstructed samples among the neighboring reconstructed samples of the reference block come from the upper and left neighboring reconstructed samples of the reference block.
[0119] When the decoding side decodes, first determine the reconstructed sample mode of the current block. The reconstructed sample mode of the current block is one of N candidate modes. The N candidate modes include at least one of the top reconstructed sample mode, the left reconstructed sample mode, and the top and left reconstructed sample mode. That is, in the embodiment of the present application, the reconstructed sample mode of the current block can be one of the top reconstructed sample mode, the left reconstructed sample mode, and the top and left reconstructed sample mode. Therefore, the reconstructed sample selection modes are rich, and the reconstructed sample mode that matches the current block feature information can be accurately determined from each of the above modes. In this way, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block can be more accurately determined based on the accurate reconstructed sample mode. A linear transformation parameter is determined based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and a linear transformation is performed on the first predicted value of the current block based on the linear transformation parameter 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 the embodiment of the present application, the manner in which the decoding side determines the reconstructed sample mode of the current block includes, but is not limited to, several types:
[0121] Method I: indicating the reconstructed sample mode of the current block by the index, in which case step S402 includes the following steps S402-A1 and S402-A2.
[0122] S402-A1, determining a first index indicating a reconstruction sample mode.
[0123] S402-A1, determining a reconstructed sample mode of the current block based on a first index corresponding to the current block.
[0124] In the manner I, the first index indicates the reconstructed sample mode of the current block. When the decoding side determines the reconstructed sample mode of the current block, the decoding side first determines the first index, and then determines the reconstructed sample mode of the current block according to the first index.
[0125] For illustrative purposes, assume that the N candidate modes are as shown in Table 1.
[0126] JPEG2025513778000030.jpg41157
[0127] The embodiment of the present application does not limit the specific modes and the number of modes of the N candidate modes. Exemplarily, as shown in Table 1, the N candidate modes include an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode. The index of the upper reconstructed sample mode is 0, the index of the left reconstructed sample mode is 1, and the index of the upper and left reconstructed sample modes is 2. Note that the indexes corresponding to each mode shown in Table 1 are merely examples, and the present application is not limited thereto.
[0128] As shown in Table 1, each candidate mode corresponds to an index, so when determining the reconstructed sample mode of the current block, the decoding side can determine a first index and determine the reconstructed sample mode of the current block according to the first index. For example, if the first index is 1, as shown in Table 1, index 1 corresponds to the left reconstructed sample mode, so the decoding side determines that the reconstructed sample mode of the current block is the left reconstructed sample mode.
[0129] In S402-A1, the manner of determining the first index corresponding to the current block includes, but is not limited to, the following several 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 the N candidate modes, for example, selects the candidate mode with the smallest cost as the reconstructed sample mode of the current block, and writes the first index of the reconstructed sample mode into the bitstream. Thus, when the decoding side decodes, it decodes the bitstream to obtain the first index, and then determines the reconstructed sample mode of the current block according to the first index.
[0132] In method 1, the decoding side can directly obtain the first index from the bitstream, and the calculation process is simple, which reduces the decoding complexity of the decoding side and improves the decoding efficiency of the decoding side.
[0133] Manner 2: if the prediction mode of the current block is a merge mode, the decoding side determines the first index through steps S402-A1-11 and S402-A1-12 as follows:
[0134] S402-A1-11, determining a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique or not;
[0135] S402-A1-12, a first index is determined based on the first flag of the adjacent block.
[0136] In the second method, if the decoding side determines that the prediction mode of the current block is a merge mode, the decoding side can determine the first index according to the related decoding information of the neighboring block of the current block. The neighboring block of the current block is a decoded block, and the related decoding information of the neighboring block is known, and when decoding the current block, the decoding side can obtain the decoding information of the neighboring block from the neighboring block.
[0137] Alternatively, the neighboring block of the current block may be an upper neighboring block of the current block.
[0138] Alternatively, the neighboring block of the current block may be the left neighboring block of the current block.
[0139] In some embodiments, the illumination compensation techniques provided by embodiments of the present application are referred to as illumination compensation techniques.
[0140] When the decoding side performs illumination compensation on the current block, if the prediction mode of the current block is the merge mode, the decoding side determines whether the current block uses the illumination compensation technique based on whether the neighboring blocks of the current block use the illumination compensation technique. For example, if the neighboring blocks use the illumination compensation technique, the decoding side determines that the current block also uses the illumination compensation technique.
[0141] Based on this, the decoding side obtains the first flag of the neighboring block from the neighboring block, and determines the first index according to the first flag of the neighboring block, which is used to indicate whether the neighboring block uses the illumination compensation technique.
[0142] The embodiment of the present application does not limit the manner of 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 the neighboring block indicates that the neighboring block uses a local illumination compensation (LIC) technique, determine the first index as a 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 a merge mode and the neighboring block of the current block uses an illumination compensation technique, use the upper and left reconstructed sample modes to perform illumination compensation on the first predicted value of the current block, and obtain a second predicted value of the current block.
[0144] In another possible embodiment, if the first flag of the neighboring block indicates that the neighboring block uses the illumination compensation technique, a second index is determined, and the second index is used to indicate the reconstructed sample mode of the neighboring block, and the second index is determined as the first index. In this embodiment, if the prediction mode of the current block is a merge mode and the neighboring block of the current block uses the illumination compensation technique, the current block not only inherits the flag of the neighboring block, but also inherits the index of the neighboring block, and determines the second index corresponding to the neighboring block as the first index of the current block.
[0145] In some embodiments, if the first flag of the neighboring block indicates that the neighboring block does not use local illumination compensation technology, determine that the current block also does not use the illumination compensation extension scheme provided by the embodiment of the present application, and uses the same illumination compensation method as the neighboring block to perform illumination compensation. For example, use the top and left reconstruction sample modes to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value of the current block. Or, do not perform illumination compensation on the first predicted value of the current block.
[0146] Manner 3: if the prediction mode of the current block is a non-merge mode, the decoding side determines the first index through steps S402-A1-21 to S402-A1-23 as follows:
[0147] S402-A1-21, determining a first flag of the current block, the first flag of the current block being used to indicate whether the current block uses the illumination compensation technique or not.
[0148] S402-A1-22, if the first flag of the current block indicates that the current block uses the illumination compensation technique, determine the second flag of the current block, where the second flag of the current block is used to indicate whether the current block uses the illumination compensation extension technique.
[0149] S402-A1-23, determining a 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 indicates that the current block uses the illumination compensation technique, and if the first flag of the current block is 0, it indicates that the current block does not use the illumination compensation technique.
[0151] If the first flag of the current block indicates that the current block does not use the illumination compensation technique, for example, if the first flag of the current block is 0, the decoding side determines the first predicted value as the second predicted value, or processes the first predicted value using another manner to obtain the second predicted value.
[0152] When the first flag of the current block indicates that the current block uses the illumination compensation technique, for example, when 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 the current block uses the illumination compensation extension technique of the present application.
[0153] Exemplarily, if the second flag of the current block is 1, it indicates that the current block uses the illumination compensation extension technique, and if the second flag of the current block is 0, it indicates that the current block does not use the illumination compensation extension technique.
[0154] In an embodiment of the present 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 the illumination compensation extension technique, 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 the illumination compensation extension technique, the first index is determined to be a default index, and the default index is used to indicate the top and left reconstruction sample modes.
[0157] In some embodiments, the decoder obtains the first flag of the current block by decoding the bitstream. 、 The first flag of the current block is determined, and the first flag of the current block is written into the bitstream, and the decoding side can directly decode 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 into the bitstream, and the decoding side can directly decode to 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, or a block level flag.
[0160] In one example, the first flag includes a sequence-level flag to indicate whether the current sequence uses an illumination compensation technique.
[0161] Alternatively, sps_lic_enable_flag can be used to represent a sequence level flag.
[0162] Alternatively, 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 an illumination compensation technique.
[0164] Alternatively, ph_lic_enable_flag can be used to represent a picture level flag.
[0165] Alternatively, the picture level flags can be located in the picture header.
[0166] In another example, the first flag includes a block-level flag to indicate whether the image block uses an illumination compensation technique or not.
[0167] Alternatively, lic_flag can be used to represent a block level flag.
[0168] In some embodiments, the first flags may further include slice level flags, unit level flags, and the like.
[0169] In some embodiments, the second flag includes a block-level flag.
[0170] Alternatively, the syntax lic_ext can be used to express the second flag.
[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 technique proposed in this application, and if lic_ext is 0, it is determined that the current block uses the illumination compensation extension technique proposed in this application.
[0172] In one possible embodiment, the coding unit-level syntax is as shown in Table 2.
[0173] JPEG2025513778000031.jpg77137
[0174] The decoding side parses the syntax shown in Table 2. First, obtain the first flag of the current block, which includes sps_lic_enable_flag && ph_lic_enable_flag. If sps_lic_enable_flag=1, determine that the current sequence uses the illumination compensation technique. Then, the decoding side continues to parse ph_lic_enable_flag, and if ph_lic_enable_flag=1, determine that the current image or current frame uses the illumination compensation technique. Then, the decoding side continues to parse lic_flag, and if lic_flag=1, describe that the current block uses the illumination compensation technique. Then, the decoding side continues to parse the second flag lic_ext of the current block, and if lic_ext=0, describe that the current block does not use the illumination compensation extension technique proposed in this application. In this case, the reconstruction sample mode of the current block is the top and left reconstruction sample mode. If lic_ext=1, describe that the current block uses the illumination compensation extension technique proposed in this application. In this case, the decoding side subsequently decodes the bitstream to obtain a first index lic_index. If lic_index=0, it determines that the reconstructed sample mode of the current block is the top reconstructed sample mode, and if lic_index=1, it determines that the reconstructed sample mode of the current block is the left reconstructed sample mode.
[0175] In an embodiment of the present application, after determining a first index, the decoding side determines a reconstructed sample mode of the current block based on the first index, determines adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block based on the reconstructed sample mode, determines linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linearly transforms the first predicted value of the current block based on the linear transformation parameters to obtain a second predicted value of the current block, thereby achieving accurate illumination compensation for the current block.
[0176] In addition to determining the reconstructed sample mode of the current block in the above-mentioned manner I, the decoding side can also determine the reconstructed sample mode of the current block in the following manner II.
[0177] Manner II: if the prediction mode of the current block is a merge mode, determine the reconstructed sample mode of the current block according to the decoding information of the neighboring blocks of the current block. In this case, S402 includes the following steps S402-B1 and S402-B2:
[0178] S402-B1, current block of A first flag of the neighboring block is determined, and the first flag of the neighboring block is used to indicate whether the neighboring block uses the illumination compensation technique or not.
[0179] S402-B2, determining the reconstruction sample mode of the current block based on the first flag of the neighboring block.
[0180] In method II, when the decoding side determines that the prediction mode of the current block is merge mode, instead of determining the first index, the decoding side directly determines the reconstructed sample mode of the current block based on the first flag of the adjacent block of the current block, and this process is simpler and more efficient.
[0181] The process of determining the first flag of the adjacent block of the current block in S402-B1 can refer to the description of S402-A11, and will not be described in detail here.
[0182] The manner of determining the reconstructed sample mode of the current block based on the first flag of the neighboring block in S402-B2 includes, but is not limited to, several kinds of the following:
[0183] Method 1: if the first flag of the neighboring block indicates that the neighboring block uses the illumination compensation technique, determine that the reconstruction sample mode of the current block is the top and left reconstruction sample mode.
[0184] In method 1, if the prediction mode of the current block is merge mode and the neighboring blocks of the current block use illumination compensation technology, the decoding side defaults that the reconstructed sample mode of the current block is the upper and left reconstructed sample mode, and directly uses the upper and left reconstructed 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 the neighboring block indicates that the neighboring block uses the illumination compensation technique, determine the reconstruction sample mode of the neighboring block, and determine the reconstruction sample mode of the neighboring block as the reconstruction sample mode of the current block.
[0186] In the second method, when the prediction mode of the current block is a merge mode and the neighboring block of the current block uses an illumination compensation technique, the decoding side determines the reconstructed sample mode of the neighboring 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 neighboring block from the neighboring block, and uses the reconstructed sample mode of the neighboring block to perform illumination compensation on the first predicted value of the current block to obtain a second predicted value.
[0187] The manner in which the decoding side determines the reconstructed sample mode of the neighboring blocks of the current block includes at least some examples as follows.
[0188] Example 1: the decoding side directly obtains the reconstruction sample mode of the neighboring block from the neighboring block.
[0189] Example 2: the decoding side obtains a second index from an adjacent block, and the second index is used to indicate the reconstructed sample mode of the adjacent block. The decoding side determines the reconstructed sample mode of the adjacent block according to the second index. For example, as shown in Table 1, if the second index is 0, the decoding side determines that the reconstructed sample mode of the adjacent block is the upper reconstructed sample mode.
[0190] In Scheme II, when the merge mode is used to predict the current block, the decoding side directly determines the reconstructed sample mode of the current block based on the first flag and / or the first index of the neighboring block of the current block.
[0191] The decoding side determines the reconstructed sample mode of the current block according to Scheme I or Scheme II, and then performs the following step S403.
[0192] S403, determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block.
[0193] The neighboring reconstructed samples of the current block are reconstructed samples determined from the left reconstructed samples and / or the top reconstructed samples of the current block based on the reconstructed sample mode of the current block.
[0194] The neighboring reconstructed samples of the reference block are reconstructed samples determined from the left reconstructed samples and / or the upper reconstructed samples of the reference block of the current block based on the reconstructed sample mode of the current block.
[0195] In an embodiment of the present application, if the reconstructed sample mode of the current block is different, the determined neighboring reconstructed samples of the current block and the neighboring reconstructed samples of the reference block are also different.
[0196] Next, S403 will be described using the left side reconstruction sample mode and the top side reconstruction sample mode as examples.
[0197] In some embodiments, if the reconstructed sample mode of the current block is a left reconstructed sample mode, S403 includes the following step S403-A.
[0198] S403-A, determining an adjacent reconstructed sample of the current block according to the left adjacent sample of the current block, and determining an adjacent reconstructed sample of the reference block according to the left adjacent sample of the reference block corresponding to the current block in the reference image.
[0199] In this embodiment, when the reconstructed sample mode of the current block is the left reconstructed sample mode, the adjacent reconstructed sample of the current block is determined from the left adjacent sample, and the left adjacent sample is all reconstructed sample. For example, as shown in FIG. 8A, the adjacent reconstructed sample of the current block is determined based on the left adjacent sample of the current block. In addition, for example, the reference block of the current block is determined in the reference image. As shown in FIG. 8B, the adjacent reconstructed sample of the reference block is determined based on the left adjacent sample of the reference block in the reference image. In addition, a linear transformation parameter is determined based on the adjacent reconstructed sample of the current block and the 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.
[0200] The embodiments of the present application do not limit the specific manner of determining the neighboring reconstructed samples of the current block based on the left neighboring samples of the current block in S403-A.
[0201] In one embodiment, a number of reconstructed samples adjacent to the left side of the current block are determined as adjacent reconstructed samples of the current block.
[0202] In another embodiment, as shown in FIG. 8A, the neighboring reconstructed samples of the current block are determined based on the height of the current block and the left neighboring sample of the current block.
[0203] Example 1: determine the reconstructed samples adjacent to the left side of the current block and within the height range of the current block as the adjacent reconstructed samples of the current block. For example, if the height of the current block is 4, determine the four reconstructed samples adjacent to the left side of the current block as the adjacent reconstructed samples of the current block.
[0204] Example 2: if the height of the current block is equal to a first value, select a first value number of samples from the left neighboring samples of the current block to determine them as neighboring reconstructed samples of the current block.
[0205] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0206] Optionally, the first value is 4. That is, if the height of the current block is equal to 4, four samples are selected from the left neighboring samples of the current block to be determined as the neighboring reconstructed samples of the current block.
[0207] Example 2: if the height of the current block is not equal to a first value, a second value number of samples are selected from the left neighboring samples of the current block to be determined as the neighboring reconstructed samples of the current block.
[0208] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0209] Illustratively, the second number is 4 or greater.
[0210] Optionally, the second number is the logarithm of the height to the base of the third number (log 第三数値 This is the numerical value obtained by rounding off the square root of the square root (height).
[0211] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0212] Optionally, the third number is two.
[0213] The second number is log 2 This is a number obtained by rounding off the (height) value.
[0214] For example, suppose the height of the current block is 32, the second value is determined to be 5. In addition, the decoding side selects 5 samples from the 16 left adjacent samples of the current block as the adjacent reconstruction samples of the current block. These 5 samples may be selected with equal step size or randomly selected, and the embodiment of the present application is not limited thereto.
[0215] Similarly, the embodiments of the present application do not limit the specific manner of determining the neighboring reconstructed samples of the reference block based on the left neighboring samples of the reference block corresponding to the current block in the reference image in S403-A.
[0216] In one embodiment, a number of reconstructed samples adjacent to the left side of the reference block in the reference image are determined as adjacent reconstructed samples of the reference block.
[0217] In another embodiment, as shown in FIG. 8B, the neighboring reconstructed samples of the reference block are determined based on the height of the reference block and the left neighboring samples of the reference block.
[0218] Example 1: determine the reconstructed samples adjacent to the left side of the reference block in the reference image and within the height range of the reference block as the adjacent reconstructed samples of the reference block. For example, if the height of the reference block is 4, determine the four reconstructed samples adjacent to the left side of the reference block in the reference image as the adjacent reconstructed samples of the reference block.
[0219] Example 2: if the height of the reference block is equal to a first value, the first value number of samples are obtained by interpolating the left adjacent samples of the reference block, as the adjacent reconstructed samples of the reference block.
[0220] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0221] Optionally, the first value is 4. That is, if the height of the reference block is equal to 4, four samples are obtained by interpolating the left adjacent samples of the reference block, and are determined as the adjacent reconstruction samples of the reference block.
[0222] Example 2: if the height of the reference block is not equal to the first value, the left adjacent samples of the reference block are interpolated to obtain the second value of samples as the adjacent reconstruction samples of the reference block.
[0223] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0224] Illustratively, the second number is 4 or greater.
[0225] Optionally, the second number is the logarithm of the height to the base of the third number (log 第三数値 This is the numerical value obtained by rounding off the square root of the square root (height).
[0226] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0227] Optionally, the third number is two.
[0228] The second number is log 2 This is a number obtained by rounding off the (height) value.
[0229] For example, if the height of the reference block is 32, the second value is determined to be 5. In addition, the decoding side interpolates 16 left adjacent samples of the reference block to obtain 5 samples as adjacent reconstruction samples of the reference block.
[0230] In an embodiment of the present application, when the reconstructed sample mode of the current block is a left reconstructed sample mode, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined based on any of the above-mentioned methods, and the adjacent reconstructed samples of the current block are only related to the left adjacent samples of the current block, and the adjacent reconstructed samples of the reference block are only related to the left adjacent samples of the reference block.
[0231] In some embodiments, if the reconstructed sample mode of the current block is the upper reconstructed sample mode, S403 includes the following step S403-B.
[0232] S403-B, determining adjacent reconstructed samples of the current block according to the upper adjacent samples of the current block, and determining adjacent reconstructed samples of the reference block according to the upper adjacent samples of a reference block corresponding to the current block in the reference image.
[0233] In this embodiment, when the reconstructed sample mode of the current block is the upper reconstructed sample mode, the adjacent reconstructed samples of the current block are determined from the upper adjacent samples, and the upper adjacent samples are all reconstructed samples. For example, as shown in FIG. 9A, the adjacent reconstructed samples of the current block are determined based on the upper adjacent samples of the current block. In addition, for example, the reference block of the current block is determined in the reference image. As shown in FIG. 9B, the adjacent reconstructed samples of the reference block are determined based on the upper adjacent samples of the reference block in the reference image. In addition, a linear transformation parameter is determined based on the adjacent reconstructed samples of the current block and the adjacent reconstructed 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.
[0234] The embodiment of the present application does not limit the specific manner of determining the neighboring reconstructed samples of the current block based on the upper neighboring samples of the current block in S403-B.
[0235] In one embodiment, a number of reconstructed samples adjacent to the upper side of the current block are determined as the adjacent reconstructed samples of the current block.
[0236] In another embodiment, as shown in FIG. 9A, width and determine adjacent reconstructed samples of the current block based on the upper adjacent samples of the current block.
[0237] Example 1: A block adjacent to the top of the current block and width The reconstructed samples in the range are determined as the neighboring reconstructed samples of the current block. For example, width If is 4, determine the four upper adjacent reconstructed samples of the current block as the neighboring reconstructed samples of the current block.
[0238] Example 2, current block width If equal to the first numerical value, the first numerical value number of samples are selected from the upper neighboring samples of the current block and determined as the neighboring reconstructed samples of the current block.
[0239] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0240] Alternatively, the first value is 4. That is, width If is equal to 4, select four samples from the upper neighboring samples of the current block to be determined as the neighboring reconstructed samples of the current block.
[0241] Example 2, current block width If ? is not equal to the first value, select a second value number of samples from the upper neighboring samples of the current block and determine them as the neighboring reconstructed samples of the current block.
[0242] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0243] Illustratively, the second number is 4 or greater.
[0244] Optionally, the second number is a base number based on the third number. width The logarithm of (log 第三数値 ( width )) is rounded off to the nearest 1.
[0245] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0246] Optionally, the third number is two.
[0247] The second number is log2( width ) is rounded off to the nearest whole number.
[0248] For example, the current block width Suppose the second value is 32, the second value is determined to be 5. In addition, the decoding side selects 5 samples from the 16 upper adjacent samples of the current block as the adjacent reconstruction samples of the current block. These 5 samples may be selected with an equal step size or may be selected randomly, and the embodiment of the present application is not limited thereto.
[0249] Similarly, the embodiments of the present application do not limit the specific manner of determining the neighboring reconstructed samples of the reference block based on the upper neighboring samples of the reference block corresponding to the current block in the reference image in S403-B.
[0250] In one embodiment, a number of reconstructed samples adjacent to the upper side of a reference block in a reference image are determined as adjacent reconstructed samples of the reference block.
[0251] In another embodiment, as shown in FIG. 9B, width and determining it as the neighboring reconstructed sample of the reference block based on the upper neighboring sample of the reference block.
[0252] Example 1: A pixel adjacent to the upper side of a reference block in a reference image and adjacent to the upper side of the reference block. width The reconstructed samples within the range are determined as neighboring reconstructed samples of the reference block. For example, width If is 4, the four reconstructed samples adjacent to the upper side of the reference block in the reference image are determined as the adjacent reconstructed samples of the reference block.
[0253] Example 2, Reference Block width If equal to the first value, the first value number of samples are obtained by interpolating the upper neighboring samples of the reference block, as the neighboring reconstructed samples of the reference block.
[0254] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0255] Alternatively, the first value is 4. That is, width If is equal to 4, then interpolate the upper neighboring samples of the reference block to obtain four samples as the neighboring reconstructed samples of the reference block.
[0256] Example 2, Reference Block width If not equal to the first value, the upper neighboring samples of the reference block are interpolated to obtain the second value number of samples as the neighboring reconstructed samples of the reference block.
[0257] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0258] Illustratively, the second number is 4 or greater.
[0259] Optionally, the second number is a base number based on the third number. width The logarithm of (log 第三数値 ( width )) is rounded off to the nearest 1.
[0260] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0261] Optionally, the third number is two.
[0262] The second number is log2( width ) is rounded off to the nearest whole number.
[0263] For example, the reference block width Assuming that the second value is 32, the second value is determined to be 5. In addition, the decoding side interpolates 16 upper adjacent samples of the reference block to obtain 5 samples as adjacent reconstruction samples of the reference block.
[0264] In an embodiment of the present application, when the reconstructed sample mode of the current block is an upper reconstructed sample mode, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined based on any of the above-mentioned methods, and the adjacent reconstructed samples of the current block are only related to the upper adjacent samples of the current block, and the adjacent reconstructed samples of the reference block are only related to the upper adjacent samples of the reference block.
[0265] After the decoding side determines the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block according to the above-mentioned method, it executes the following S404.
[0266] S404, determine a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block.
[0267] The embodiments of the present application do not limit the specific manner of determining the linear transformation parameters based on the neighboring reconstructed samples of the current block and the neighboring reconstructed 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 adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block in S404 comprises the following steps:
[0269] S404-A1, determining a scaling factor based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block.
[0270] S404-A2, determine an offset parameter based on the neighboring reconstructed samples of the current block, the neighboring reconstructed samples of the reference block and a scaling factor.
[0271] The embodiment of the present application is not limited to the manner of determining the scaling factor based on the neighboring reconstructed samples of the current block and the neighboring reconstructed samples of the reference block in S404-A1.
[0272] In one possible embodiment, the ratio between the neighboring reconstructed samples of the current block and the neighboring reconstructed samples of the reference block is determined as the scaling factor a.
[0273] In another possible embodiment, the scaling factor a is determined according to equation (3) above.
[0274] In the embodiment of the present disclosure, the manner of determining the offset parameter based on the neighboring reconstructed samples of the current block, the neighboring reconstructed samples of the reference block and the scaling factor in S404-A2 is not limited.
[0275] In one possible embodiment, the offset parameter b is determined by equation (4) above.
[0276] According to the above method, after determining the linear transformation parameters, perform a linear transformation on the first predicted value using the linear transformation parameters to obtain a second predicted value of the current block, for example, determine the product of the scaling factor and the first predicted value, and then determine the sum of the product and an offset parameter as the second predicted value.
[0277] JPEG2025513778000032.jpg13114
[0278] JPEG2025513778000033.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 proposed by an embodiment of the present application is performed, i.e., the above-mentioned S402, determining the reconstruction sample mode of the current block is performed.
[0280] The embodiments of the present disclosure do not limit the specific type of the first type image.
[0281] Optionally, if the first type image is a B frame, ie, if the current image is a B frame, the illumination compensation extension technique proposed by 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 the present application is performed, i.e., the above-mentioned S402, determining the reconstruction sample mode of the current block is performed.
[0283] The present application is not limited to a specific value for the pre-set threshold value.
[0284] Alternatively, the preset threshold is 64, i.e., if the area of the current block is greater than or equal to the preset threshold, execute the illumination compensation extension technique proposed in this application, i.e., execute the above-mentioned S402, determining the reconstruction sample mode of the current block.
[0285] The video decoding method provided in the embodiment of the present application is as follows: Decode the bitstream and predict the current block to obtain a first predicted value of the current block; Determine a reconstructed sample mode of the current block; The reconstructed sample mode is one of N candidate modes. The N candidate modes include at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; Determine adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to the reconstructed sample mode of the current block; Determine a linear transformation parameter according to the adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block. In the embodiment of the present application, the reconstructed sample mode of the current block can be one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode. Therefore, the selection modes of the reconstructed sample are rich, and the reconstructed 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 reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are more accurately determined, and linear transformation parameters are determined based on the adjacent reconstructed samples of the current block and the adjacent reconstructed 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.
[0286] The video decoding method according to the embodiment of the present application has been described above. Based on this, the video decoding method according to the embodiment of the present application will be described below. En Explain how to code it.
[0287] 10 is a flowchart of a video encoding method provided by an embodiment of the present application. The implementation entity of the embodiment of the present application can be the encoder shown in FIG.
[0288] As shown in FIG. 10 , the method of the embodiment of the present application includes:
[0289] S701, predict a current block to obtain a first predicted value of the current block.
[0290] When encoding a current block, the encoding side determines a prediction mode corresponding to the current block, predicts the current block according to the prediction mode, and obtains a predicted value of the current block. In the embodiment of the present application, a new predicted value is obtained by performing illumination compensation on the predicted value obtained in this step, so for convenience of description, in the embodiment of the present application, the predicted value obtained based on the prediction mode is recorded as a first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as a second predicted value.
[0291] The embodiments of the present application do not limit the prediction method of the current block.
[0292] In some embodiments, the current block is predicted using an inter prediction mode to obtain a first predicted value of the current block. For example, the encoding side determines motion information corresponding to the current block, finds a reference block from a reference image based on the motion information, and generates a first predicted value of the current block 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. If the motion vector is a fractional-sample motion vector, the reference image needs to be interpolated and filtered 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 a predicted block. In some embodiments, the predicted block is generated by further processing based on the reference block.
[0293] S702, the reconstruction sample mode of the current block is determined.
[0294] Here, the reconstructed sample mode is one of N candidate modes, where the N candidate modes include at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode.
[0295] There is no strict order requirement for the execution of S702 and S701. For example, S702 can be executed before S701, after S701, or synchronously with S701, and the embodiment of the present application is not limited thereto.
[0296] As mentioned above, in order to improve the prediction effect, the illumination compensation is performed on the obtained first predicted value to obtain a second predicted value. Specifically, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined, and linear transformation parameters are determined according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linear transformation is performed on the first predicted value according to the linear transformation parameters to obtain a second predicted value of the current block.
[0297] In order to improve the illumination compensation effect, the embodiments of the present application add some new methods of determining the reconstruction samples, such as the top reconstruction sample mode and / or the left reconstruction sample mode.
[0298] The left reconstructed sample mode means that all the reconstructed samples in the neighboring reconstructed samples of the current block come from the left neighboring reconstructed samples of the current block, and all the reconstructed samples in the neighboring reconstructed samples of the reference block come from the left neighboring reconstructed samples of the reference block.
[0299] The upper reconstructed sample mode means that all the reconstructed samples in the adjacent reconstructed samples of the current block come from the upper adjacent reconstructed samples of the current block, and all the reconstructed samples in the adjacent reconstructed samples of the reference block come from the upper adjacent reconstructed samples of the reference block.
[0300] The above and left reconstructed sample mode means that all the reconstructed samples in the neighboring reconstructed samples of the current block come from the neighboring reconstructed samples above and to the left of the current block, and all the reconstructed samples in the neighboring reconstructed samples of the reference block come from the neighboring reconstructed samples above and to the left of the reference block.
[0301] Encoding side but EncodingWhen performing the above, first determine 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 top reconstruction sample mode, the left reconstruction sample mode, and the top and left reconstruction sample modes. That is, in the embodiment of the present application, the selection manner of the reconstruction sample is increased, that is, the reconstruction sample mode is increased, for example, the left reconstruction sample mode and / or the top reconstruction sample mode is increased, and the reconstruction samples in the left reconstruction sample mode are all obtained from the left adjacent sample of the image block, and the reconstruction samples in the top reconstruction sample mode are all 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, a plurality of reconstruction sample modes can be selected according to the actual situation, thereby improving the effect of illumination compensation and improving the prediction performance.
[0302] The embodiments of the present application are not limited to a specific manner for determining the reconstructed sample mode of the current block.
[0303] In some embodiments, any one of the N candidate modes is determined as the reconstructed sample mode of the current block.
[0304] In some embodiments, the current block is analyzed to determine the reconstructed sample mode of the current block based on the characteristics of the samples in the current block. For example, if the differences of the samples in the current block are large and mostly similar to the top reconstructed samples, the top reconstructed sample mode is determined as the reconstructed sample mode of the current block. If the differences of the samples in the current block are large and mostly similar to the left reconstructed samples, the left reconstructed sample mode is determined as the reconstructed sample mode of the current block. If the differences of the samples in the current block are not large, the top and left reconstructed sample modes are determined as the reconstructed sample modes of the current block.
[0305] In some embodiments, S702 includes the following steps: S702-A and S702-B.
[0306] S702-A, for an i-th candidate mode among the N candidate modes, determine a cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N.
[0307] S702-B, determining a reconstruction sample mode of the current block from the N candidate modes based on 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 selects one candidate mode from the N candidate modes based on the cost corresponding to each candidate mode as the reconstructed sample mode of the current block.
[0309] In the embodiment of the present application, the process of determining the cost corresponding to each candidate mode among the N candidate modes is the same. For convenience of explanation, the i-th candidate mode among the N candidate modes is taken as an example.
[0310] Determining the cost corresponding to the i-th candidate mode in S702-A includes the following steps S702-A1 to S702-A4.
[0311] S702-A1, determining the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block according to the i-th candidate mode.
[0312] The i-th neighboring reconstructed sample of the current block is a reconstructed sample determined from the left reconstructed sample and / or the top reconstructed sample of the current block based on the i-th candidate mode.
[0313] The i-th neighboring reconstructed sample of the reference block is a reconstructed sample determined from the left reconstructed sample and / or the top reconstructed sample of the reference block of the current block based on the i-th candidate mode.
[0314] In an embodiment of the present application, if the i-th candidate mode is different, the i-th neighboring reconstructed sample of the determined current block and the i-th neighboring reconstructed sample of the reference block are also different.
[0315] Hereinafter, S702-A1 will be described taking the left side reconstruction sample mode and the top side reconstruction sample mode as examples.
[0316] In some embodiments, if the i-th candidate mode is a left reconstruction sample mode, S702-A1 includes the following step S702-A1-A.
[0317] S702-A1-A, determine the i-th adjacent reconstructed sample of the current block according to the left adjacent sample of the current block, and determine the i-th adjacent reconstructed sample of the reference block according to 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 reconstructed sample mode, the i-th adjacent reconstructed sample of the current block is determined from the left adjacent sample, and the left adjacent samples are all reconstructed samples. For example, as shown in FIG. 8A, the i-th adjacent reconstructed sample of the current block is determined based on the left adjacent sample of the current block. For further example, the reference block of the current block is determined in the reference image. As shown in FIG. 8B, the i-th adjacent reconstructed sample of the reference block is determined based on the left adjacent sample of the reference block in the reference image. Furthermore, a 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 the present application are not limited to a specific manner for determining the i-th neighboring reconstructed sample of the current block based on the left neighboring sample of the current block in S702-A1-A.
[0320] In one embodiment, a number of reconstructed samples adjacent to the left side of the current block are determined as the i-th adjacent reconstructed samples of the current block.
[0321] In another embodiment, as shown in FIG. 8A, the i-th neighboring reconstructed sample of the current block is determined based on the height of the current block and the left neighboring sample of the current block.
[0322] Example 1: determine the reconstructed sample adjacent to the left side of the current block and within the height range of the current block as the i-th adjacent reconstructed sample of the current block. For example, if the height of the current block is 4, determine the four reconstructed samples adjacent to the left side of the current block as the i-th adjacent reconstructed sample of the current block.
[0323] Example 2: if the height of the current block is equal to a first value, select a first number of samples from the left neighboring samples of the current block and determine them as the i-th neighboring reconstructed sample of the current block.
[0324] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0325] Optionally, the first value is 4. That is, if the height of the current block is equal to 4, four samples are selected from the left neighboring samples of the current block to be determined as the i-th neighboring reconstructed samples of the current block.
[0326] Example 2: if the height of the current block is not equal to the first value, select the second value number of samples from the left neighboring samples of the current block to determine them as the i-th neighboring reconstructed sample of the current block.
[0327] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0328] Illustratively, the second number is 4 or greater.
[0329] Optionally, the second number is the logarithm of the height to the base of the third number (log 第三数値 This is the numerical value obtained by rounding off the square root of the square root (height).
[0330] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0331] Optionally, the third number is 2 and the second number is log 2 This is a number obtained by rounding off the (height) value.
[0332] For example, suppose the height of the current block is 32, the second value is determined to be 5. In addition, the encoding side selects 5 samples from the 16 left adjacent samples of the current block as the i-th adjacent reconstruction sample of the current block. These 5 samples may be selected with an equal step size or may be selected randomly, and the embodiment of the present application is not limited thereto.
[0333] Similarly, the embodiments of the present application do not limit the specific manner of 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 in S702-A1-A.
[0334] In one embodiment, a number of reconstructed samples adjacent to the left side of the reference block in the reference image are determined as the i-th adjacent reconstructed samples of the reference block.
[0335] In another embodiment, as shown in FIG. 8B, the i-th neighboring reconstructed sample of the reference block is determined based on the height of the reference block and the left neighboring sample of the reference block.
[0336] Example 1: A reconstructed sample adjacent to the left side of a reference block in a reference image and within a 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, four reconstructed samples adjacent to the left side of the reference block in the reference image are determined as the i-th adjacent reconstructed sample of the reference block.
[0337] Example 2: if the height of the reference block is equal to a first value, the first value number of samples are obtained by interpolating the left adjacent samples of the reference block, as the i-th adjacent reconstructed sample of the reference block.
[0338] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0339] Optionally, the first value is 4. That is, if the height of the reference block is equal to 4, four samples are obtained by interpolating the left adjacent samples of the reference block, which are the i-th adjacent reconstructed samples of the reference block.
[0340] Example 2: if the height of the reference block is not equal to the first value, the left adjacent samples of the reference block are interpolated to obtain the second value number of samples as the i-th adjacent reconstructed sample of the reference block.
[0341] For example, assume that the height of the reference block is 32, the second value is determined to be 5. In addition, the encoding side interpolates 16 left adjacent samples of the reference block to obtain 5 samples as the i-th adjacent reconstructed sample of the reference block.
[0342] In an embodiment of the present application, when the i-th candidate mode is a left 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-mentioned methods, and the i-th adjacent reconstructed sample of the current block is related only to the left adjacent sample of the current block, and the i-th adjacent reconstructed sample of the reference block is related only to the left adjacent sample of the reference block.
[0343] In some embodiments, if the i-th candidate mode is the upper reconstruction sample mode, S702-A1 includes the following step S702-A1-B.
[0344] S702-A1-B, 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 a 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 sample, and the upper adjacent samples are all reconstructed samples. For example, as shown in FIG. 9A, the i-th adjacent reconstructed sample of the current block is determined based on the upper adjacent sample of the current block. Furthermore, for example, the reference block of the current block is determined in the reference image. As shown in FIG. 9B, the i-th adjacent reconstructed sample of the reference block is determined based on the upper adjacent sample of the reference block in the reference image. Furthermore, a 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 the present application do not limit the specific manner of determining the i-th neighboring reconstructed sample of the current block based on the upper neighboring sample of the current block in S702-A1-B.
[0347] In one embodiment, the upper adjacent reconstructed samples of the current block are determined as the i-th adjacent reconstructed samples of the current block.
[0348] In another embodiment, as shown in FIG. 9A, width and determine the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block.
[0349] Example 1: A block adjacent to the top of the current block and width Determine the reconstructed sample in the range as the i-th neighboring reconstructed sample of the current block. For example, width If i is 4, determine the four upper adjacent reconstructed samples of the current block as the i-th adjacent reconstructed samples of the current block.
[0350] Example 2, current block width If i is equal to the first numerical value, select the first numerical value number of samples from the upper neighboring samples of the current block and determine them as the i-th neighboring reconstructed samples of the current block.
[0351] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0352] Alternatively, the first value is 4. That is, width If is equal to 4, select four samples from the upper neighboring samples of the current block to be determined as the i-th neighboring reconstructed samples of the current block.
[0353] Example 2, current block widthIf i is not equal to the first value, select a second value number of samples from the upper neighboring samples of the current block and determine them as the i-th neighboring reconstructed samples of the current block.
[0354] The embodiments of the present application are not limited to a specific value of the second numerical value.
[0355] Illustratively, the second number is 4 or greater.
[0356] Optionally, the second number is a base number based on the third number. width The logarithm of (log 第三数値 ( width )) is rounded off to the nearest 1.
[0357] The embodiments of the present application are not limited to a specific value of the third numerical value.
[0358] Optionally, the third number is two.
[0359] The second number is log2( width ) is rounded off to the nearest whole number.
[0360] For example, the current block width Suppose that is 32, the second value is determined to be 5. In addition, the encoding side selects 5 samples from the 16 upper adjacent samples of the current block as the i-th adjacent reconstruction sample of the current block. These 5 samples may be selected with an equal step size or may be selected randomly, and the embodiment of the present application is not limited thereto.
[0361] Similarly, the embodiments of the present application do not limit the specific manner of 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 in S702-A1-B.
[0362] In one embodiment, a number of reconstructed samples adjacent to the upper side of a reference block in a reference image are determined as the i-th adjacent reconstructed samples of the reference block.
[0363] In another embodiment, as shown in FIG. 9B, width and determining the i-th neighboring reconstructed sample of the reference block based on the upper neighboring samples of the reference block.
[0364] Example 1: A pixel adjacent to the upper side of a reference block in a reference image and adjacent to the upper side of the reference block. width The reconstructed sample in the range is determined as the i-th adjacent reconstructed sample of the reference block. For example, width If i is 4, the four reconstructed samples adjacent to the upper side of the reference block in the reference image are determined as the i-th adjacent reconstructed samples of the reference block.
[0365] Example 2, Reference Block width If i is equal to the first numerical value, the upper neighboring samples of the reference block are interpolated to obtain the first numerical value of samples, which is the i-th neighboring reconstructed sample of the reference block.
[0366] The embodiments of the present application are not limited to a specific value of the first numerical value.
[0367] Alternatively, the first value is 4. That is, width If is equal to 4, Encoding side The i-th adjacent reconstructed sample of the reference block is determined by interpolating the upper adjacent samples of the reference block to obtain four samples.
[0368] Example 2, Reference Block width If i is not equal to the first value, the upper neighboring samples of the reference block are interpolated to obtain the second value number of samples as the i-th neighboring reconstructed sample of the reference block.
[0369] For example, the reference block widthAssuming that is 32, the second value is determined to be 5. In addition, the encoding side interpolates 16 upper adjacent samples of the reference block to obtain 5 samples as the i-th adjacent reconstructed sample of the reference block.
[0370] In an embodiment of the present application, when 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-mentioned methods, and the i-th adjacent reconstructed sample of the current block is only related to the upper adjacent sample of the current block, and the i-th adjacent reconstructed sample of the reference block is only related to the upper adjacent sample of the reference block.
[0371] After the encoding side determines the adjacent reconstructed samples of the current i-th block and the i-th adjacent reconstructed samples of the reference block according to the above-mentioned method, it performs the following S702-A2.
[0372] S702-A2, determine an i-th linear transformation parameter according to the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block.
[0373] The embodiment of the present application does not limit the specific manner of determining the i-th linear transformation parameter based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block.
[0374] In some embodiments, when the i-th linear transformation parameters include an i-th scaling factor and an i-th offset parameter, in S702-A2, based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block, Determining the i-th linear transformation parameter is The method comprises the following steps:
[0375] S702-A21, determine an i-th scaling factor based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block.
[0376] S702-A22, determine the i-th offset parameter based on the i-th adjacent reconstructed sample of the current block, the i-th adjacent reconstructed sample of the reference block, and the i-th scaling factor.
[0377] The embodiment of the present application is not limited to the manner of determining the i-th scaling factor a based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block in S702-A21.
[0378] In one possible embodiment, the ratio of the i-th adjacent reconstructed sample of the current block to the i-th adjacent reconstructed 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 the above formula (3).
[0380] In the embodiment of the present disclosure, the manner of determining the i-th offset parameter based on the i-th adjacent reconstructed sample of the current block, the i-th adjacent reconstructed sample of the reference block, and the i-th scaling factor in S702-A22 is not limited.
[0381] In one possible embodiment, the i-th offset parameter b is determined by equation (4) above.
[0382] S702-A3, a first predicted value of the current block is determined, and a linear transformation is performed on the first predicted value according to the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode.
[0383] According to the above-mentioned method, after determining the i-th linear transformation parameter, perform linear transformation on the first predicted value using the i-th linear transformation parameter to obtain a second predicted value of the current block corresponding to the i-th candidate mode, for example, determine the product of the i-th scaling factor and the first predicted value, and then determine the sum of the product and the i-th offset parameter as the second predicted value corresponding to the i-th candidate mode.
[0384] In one example, the above A second predicted value corresponding to the i-th candidate mode is determined based on Equation (5).
[0385] S702-A4, determining a cost corresponding to the i-th candidate mode according to a second predicted value corresponding to the i-th candidate mode.
[0386] For example, a 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 is calculated by operations such as transform quantization, and is denoted as costi.
[0388] In order to reduce the calculation complexity of the cost, a cost calculation method such as Sum of Absolute Difference (SAD) or Sum of Absolute Transformed Difference (STAD) can also be used to determine the cost corresponding to the i-th candidate mode.
[0389] Based on the above-mentioned method, a cost corresponding to each candidate mode among the N candidate modes can be determined, and S702-B can be further executed to determine a 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 smallest cost among the N candidate modes is determined as the reconstructed sample mode for the current block.
[0391] In some embodiments, after the encoding side determines a reconstructed sample mode of the current block from the N candidate models based on the costs corresponding to the N candidate modes, it writes a first index into the bitstream, where the first index is used to indicate the reconstructed sample mode of the current block.
[0392] In some embodiments, if the prediction mode of the current block is a merge mode, the encoding side can determine the reconstructed sample mode of the current block according to the following manner: That is, step S702 includes the following steps S702-C1 and S702-C2.
[0393] S702-C1, determining a first flag of a neighboring block of a current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique.
[0394] S702-C2, determining the reconstruction sample mode of the current block according to the first flag of the neighboring block.
[0395] In this embodiment, when the encoding side performs illumination compensation on the current block, if the prediction mode of the current block is a merge mode, the encoding side determines whether the current block uses the illumination compensation technique based on whether the neighboring blocks of the current block use the illumination compensation technique proposed in the embodiment of the present application. For example, if the neighboring blocks use the illumination compensation technique proposed in the embodiment of the present application, the encoding side determines that the current block also uses the illumination compensation technique proposed in the embodiment of the present application.
[0396] Based on this, the encoding side obtains the first flags from the neighboring blocks, and determines the reconstructed sample mode of the current block according to the first flags of the neighboring blocks.
[0397] The manner of determining the reconstructed sample mode of the current block based on the first flag of the neighboring block in S702-C2 includes, but is not limited to, several kinds:
[0398] Method 1: if the first flag of the neighboring block indicates that the neighboring block uses the illumination compensation technique, determine that the reconstructed sample mode of the current block is the top and left reconstructed sample mode.
[0399] In method 1, if the prediction mode of the current block is merge mode and the neighboring blocks of the current block use illumination compensation technology, the encoding side defaults that the reconstructed sample mode of the current block is the upper and left reconstructed sample mode, and directly uses the upper and left reconstructed 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 the neighboring block indicates that the neighboring block uses an illumination compensation technique, determine the reconstructed sample mode of the neighboring block, and determine the reconstructed sample mode of the neighboring block as the reconstructed sample mode of the current block.
[0401] In the second method, when the prediction mode of the current block is a merge mode and the neighboring block of the current block uses an illumination compensation technique, the encoding side determines the reconstructed sample mode of the neighboring 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 neighboring block from the neighboring block, and uses the reconstructed sample mode of the neighboring block to perform illumination compensation on the first predicted value of the current block to obtain a second predicted value.
[0402] The manner in which the encoding side determines the reconstructed sample mode of the neighboring blocks of the current block includes at least some examples as follows.
[0403] Example 1: the encoding side directly obtains the reconstruction sample mode of the neighboring block from the neighboring block.
[0404] Example 2: the encoding side obtains a second index from an adjacent block, and the second index is used to indicate the reconstructed sample mode of the adjacent block. The encoding side determines the reconstructed sample mode of the adjacent block according to the second index. For example, as shown in Table 1, if the second index is 0, the encoding side determines that the reconstructed sample mode of the adjacent block is the upper reconstructed sample mode.
[0405] In Scheme II, when the merge mode is used to predict the current block, the encoding side directly determines the reconstructed sample mode of the current block based on the first flag and / or the first index of the neighboring blocks of the current block.
[0406] The encoding side determines the reconstructed sample mode of the current block according to the above-mentioned method, and then performs the following step S703.
[0407] S703, determining a second predicted value of the current block according to a reconstructed sample mode of the current block, where the second predicted value is obtained by performing illumination compensation on the first predicted value according to the reconstructed sample mode of the current block.
[0408] In some embodiments, when the encoding side determines a second predicted value corresponding to each candidate mode among the N candidate modes based on the above-mentioned methods S702-A and S702-B, and selects a reconstructed sample mode of the current block from the N candidate modes, the encoding side directly determines the second predicted value corresponding to the reconstructed sample mode of the current block as the second predicted value of the current block, and does not need to perform illumination compensation calculation again.
[0409] In some embodiments, when the encoding side determines the reconstructed sample mode of the current block based on S702-C1 and S702-C2, i.e., determines the first flag of the adjacent block of the current block, and determines the reconstructed sample mode of the current block based on the first flag of the adjacent block, S703 includes the following steps:
[0410] S703-A1, determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block.
[0411] S703-A2, determine a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block.
[0412] For the implementation process of S703-A1, please refer to the explanation of S702-A1. We will not repeat it here.
[0413] For the implementation process of S703-A2, please refer to the explanation of S702-A2 and S702-A3. We will not repeat the explanation here.
[0414] In the embodiment of the present application, the encoding side selects the reconstructed sample mode of the current block from the upper reconstructed sample mode, the left reconstructed sample mode, and the upper and left reconstructed sample modes, the reconstructed sample selection modes are abundant, and the reconstructed sample mode that matches the current block feature information can be accurately determined from each of the above modes. Thus, according to the accurate reconstructed sample mode, the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are more accurately determined, and according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, the linear transformation parameters are determined, and the first predicted value of the current block is linearly transformed according to 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 to adopt the illumination compensation extension technique of the embodiment of the present application is determined by a flag. Before S702, the encoding side first determines a first flag of the current block, and the first flag of the current block is used to indicate whether the current block uses the illumination compensation technique.
[0416] In some embodiments of the present application, the encoding side determines a first flag of the current block and writes the first flag into the bitstream.
[0417] In some embodiments, if the first flag of the current block indicates that the current block uses the illumination compensation technique, the encoding side determines a second flag of the current block and writes the second flag into the bitstream, where the second flag of the current block is used to indicate whether the current block uses the illumination compensation extension technique.
[0418] In some embodiments, if the second flag of the current block indicates that the current block uses the illumination compensation extension technique, the encoding side writes an index of the reconstructed sample mode of the current block into the bitstream.
[0419] For example, if the first flag of the current block is 1, it indicates that the current block uses the illumination compensation technique, and if the first flag of the current block is 0, it indicates that the current block does not use the illumination compensation technique.
[0420] If the first flag of the current block indicates that the current block does not use the illumination compensation technique, for example, if the first flag of the current block is 0, the decoding side determines the first predicted value as the second predicted value, or processes the first predicted value using another manner to obtain the second predicted value.
[0421] When the first flag of the current block indicates that the current block uses the illumination compensation technique, for example, when 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 the current block uses the illumination compensation extension technique of the present application.
[0422] Exemplarily, if the second flag of the current block is 1, it indicates that the current block uses the illumination compensation extension technique, and if the second flag of the current block is 0, it indicates that the current block does not use the illumination compensation extension technique.
[0423] If the second flag of the current block indicates that the current block does not use the illumination compensation extension technique, for example, if the second flag of the current block is 0, the decoding side can use a default reconstructed sample mode, for example, select the upper and left reconstructed sample modes to perform illumination compensation on the first predicted value of the current block to obtain a 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 an index of the reconstructed sample mode of the current block into the bitstream.
[0425] The manner in which the encoding side determines the first flag of the current block includes at least some of the following manners:
[0426] Method 1: Get 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 into the bitstream, and the decoding side can directly decode to obtain the first flag of the current block.
[0428] Method 2: when the prediction mode of the current block is a merge mode, the encoding side determines a first flag of the neighboring block of the current block, the first flag of the neighboring block is used to indicate whether the neighboring block uses the illumination compensation technique, and further determines the first flag of the current block according to the first flag of the neighboring block. For example, the encoding side obtains a first flag from the neighboring block, and if the value of the first flag of the neighboring block is 1, the value of the first flag of the current block is also determined to be 1. That is, if the first flag of the neighboring block indicates that the neighboring block uses the illumination compensation technique, the current block also uses the illumination compensation technique. If the value of the first flag of the neighboring block is 0, the value of the first flag of the current block is also determined to be 0. That is, if the first flag of the neighboring block indicates that the neighboring block does not use the illumination compensation technique, the current block also does not use the illumination compensation technique.
[0429] The manner in which the encoding side determines the second flag of the current block includes at least some of the following manners:
[0430] Method 1: Get 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 into the bitstream, and the decoding side can directly decode to 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 of Determine the second flag of the neighboring block, the second flag of the neighboring block is used to indicate whether the neighboring block uses the illumination compensation extension technique of the present application, and further determine the second flag of the current block according to the second flag of the neighboring block. For example, the encoding side obtains the second flag of the neighboring block from the neighboring block, and if the value of the second flag of the neighboring block is 1, the value of the second flag of the current block is also determined to be 1. That is, if the second flag of the neighboring block indicates that the neighboring block uses the illumination compensation extension technique of the present application, the current block also uses the illumination compensation extension technique of the present application. If the value of the second flag of the neighboring block is 0, the value of the second flag of the current block is also determined to be 0. That is, if the second flag of the neighboring block indicates that the neighboring block does not use the illumination compensation extension technique of the present application, the current block also does not use the illumination compensation extension technique of the present application.
[0433] In some embodiments, the first flag includes at least one of a sequence level flag, a picture level flag, or a block level flag.
[0434] In some embodiments, the encoding side compares the illumination compensation technique of the present application with other prediction modes, for example, by the above-mentioned method to determine the cost corresponding to each candidate mode in N candidate modes, and calculate the cost corresponding to other pre-defined prediction modes. Illustratively, take N=3 as an example, by the above-mentioned method, determine the cost corresponding to the upper reconstruction sample mode and record it as cost1, determine the cost corresponding to the left reconstruction sample mode and record it as cost2, determine the cost corresponding to the upper and left reconstruction sample modes and record it as cost3, compare cost1, cost2 and cost3, record the minimum cost value as costMin, and at the same time save information related to the current illumination compensation, including 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] Then, the encoding side traverses other inter prediction techniques and calculates the rate-distortion cost values corresponding to these techniques, and selects the prediction mode corresponding to the minimum cost value as the optimal prediction mode for the current coding unit.
[0436] If the current block enables the illumination compensation technique and costMin is the smallest, the current block should use the illumination compensation technique and a coding unit level flag indicating whether the illumination compensation technique is used, e.g., lic_flag, should be set to "true" and written into the bitstream. If the index corresponding to costMin is greater than 0, a flag indicating whether the illumination compensation extension technique is used, i.e., a second flag of the current block, e.g., lic_ext, should be set to "true" and written into the bitstream, and the index corresponding to costMin should be written into the bitstream by equiprobability coding. Otherwise, a flag indicating whether the illumination compensation extension technique is used, i.e., a second flag of the current block, should be set to "false" and written into the bitstream.
[0437] If the current block has illumination compensation enabled but costMin is not minimum, the current block does not use illumination compensation and the bitstream must be written with a coding unit level flag, e.g., lic_flag, indicating whether illumination compensation is to be used or not, set to “false”.
[0438] If the current block does not use the illumination compensation technique, the optimal prediction mode information of other non-illumination compensation techniques, etc. is written into 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 the present application is performed, i.e., the above-mentioned S702, determining the reconstruction sample mode of the current block is performed.
[0440] The embodiments of the present disclosure do not limit the specific type of the first type image.
[0441] Alternatively, if the first type image is a B frame, ie, if the current image is a B frame, the illumination compensation extension technique proposed in this application is enabled by default.
[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 the present application is performed, i.e., the above-mentioned S702, determining the reconstruction sample mode of the current block is performed.
[0443] The present application is not limited to a specific value for the pre-set threshold value.
[0444] Alternatively, the preset threshold is 64, i.e., if the area of the current block is greater than or equal to the preset threshold, execute the illumination compensation extension technique proposed in this application, i.e., execute the above-mentioned S702, determining the reconstruction sample mode of the current block.
[0445] After the encoding side determines a predicted value of the current block through the above-mentioned steps, for example, after determining a second predicted value of the current block, it calculates a difference between the predicted block of the current block and the current block to obtain a residual value of the current block, transforms the residual value to obtain a transform coefficient, quantizes the transform coefficient to obtain a quantized coefficient, and encodes the quantized coefficient to obtain a bitstream.
[0446] Furthermore, after integrating the first embodiment of the present invention into the latest EXM3.1, the test results under the test conditions of random access (RA) and low-delay B (LDB) are as shown in Table 3.
[0447] JPEG2025513778000034.jpg68134
[0448] As can be seen from Table 3 above, the illumination compensation extension technique proposed in the embodiment of the present disclosure improves the performance of all sequence types, both RA and LDB, and the improvement of 4KA2 sequence under RA test conditions is most significant, with an average BD bitrate saving of 0.11%. In addition, the integration performance is improved, proving the effectiveness of this technique and improving the encoding efficiency of existing ECM reference software. It should be noted that due to the load on the server, the encoding and decoding times are not accurate, and theoretically, the decoding time remains the same, and the experimental results do not optimize the encoding side. In addition, this method does not add burden to the decoding side and does not increase the complexity of the hardware implementation.
[0449] The video encoding method provided in the embodiment of the present application is as follows: The encoding side predicts a current block to obtain a first predicted value of the current block; Determine a reconstructed sample mode of the current block, where the reconstructed sample mode is one of N candidate modes, where the N candidate modes include at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; Determine a second predicted value of the current block according to the reconstructed sample mode of the current block, where the second predicted value is obtained by performing light illumination compensation on the first predicted value according to the reconstructed sample mode of the current block. In the embodiment of the present application, the reconstructed sample mode of the current block can be one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode. Therefore, the selection modes of the reconstructed sample are rich, and the reconstructed 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 reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are more accurately determined, and linear transformation parameters are determined based on the accurately determined adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block. Based on the linear transformation parameters, the first predicted value of the current block is linearly transformed to obtain an accurate second predicted value, so as to improve the illumination compensation effect of the current block and the prediction effect of the current block.
[0450] 7 to 10 are merely examples of the present application and should not be understood as limitations to the present application.
[0451] The above describes the preferred embodiments of the present application in detail with reference to the accompanying drawings, but the present application is not limited to the detailed contents of the above embodiments, and various simple modifications can be made to the technical solutions of the present application within the scope of the technical ideas of the present application, and all such simple modifications fall within the scope of protection of the present application. For example, the specific technical features described in the above specific embodiments may be combined by any suitable means if there is no contradiction, and various possible combinations are not described again in this application to avoid unnecessary duplication. In addition, for example, any combination between various different embodiments of the present application should be considered as disclosed in the present application as long as it does not contradict the ideas of the present application.
[0452] It should be understood that in various method embodiments of the present application, the magnitude of the sequence number of each of the above processes does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In the embodiments of the present application, the term "and / or" simply describes the related relationship of related objects and indicates that there are three types of relationships. Specifically, in the case of A and / or B, it indicates three situations: only A exists, A and B exist simultaneously, and only B exists. In addition, in this specification, the sign " / " generally indicates that the related objects before and after have an "or" relationship.
[0453] Method embodiments of the present application have been described above in detail with reference to Figures 7 to 10. Hereinafter, apparatus embodiments of the present application will be described in detail with reference to Figures 11 to 14.
[0454] FIG. 11 is a block diagram illustrating a video decoding device provided by an embodiment of the present application.
[0455] As shown in FIG. 11, the video decoding apparatus 10 includes a decoding unit 11, a mode determination unit 12, a sample determination unit 13, and a linear transformation unit 14.
[0456] The decoding unit 11 is configured to decode the bitstream and predict a current block to obtain a first predicted value of the current block.
[0457] The mode determination unit 12 is configured to determine a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode.
[0458] The sample determination unit 13 is configured to determine, based on a reconstructed sample mode of the current block, adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block.
[0459] The linear transformation unit 14 is configured to determine linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed 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 of the current block.
[0460] In some embodiments, the mode determination unit 12 is specifically configured to determine a first index indicating a reconstructed sample mode of a current block, and determine the reconstructed 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 the first index.
[0462] In some embodiments, when the prediction mode of the current block is a merge mode, the mode determination unit 12 is specifically configured to determine a first flag of a neighboring block of the current block, and determine a first index based on the first flag of the neighboring block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique.
[0463] In some embodiments, the mode determination unit 12 is specifically configured to determine that if the first flag of the adjacent block indicates that the adjacent block uses an illumination compensation technique, the first index is a default index, and the default index is used to indicate the upper and left reconstruction sample modes.
[0464] In some embodiments, the mode determination unit 12 is specifically configured to determine a second index when the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, and determine the second index as the first index, where the second index is used to indicate a reconstruction sample mode of the neighboring block.
[0465] In some embodiments, when the prediction mode of the current block is a non-merge mode, the mode determination unit 12 is specifically configured to determine a first flag of the current block, where the first flag of the current block is used to indicate whether the current block uses an illumination compensation technique; if the first flag of the current block indicates that the current block uses an illumination compensation technique, determine a second flag of the current block, where the second flag of the current block is used to indicate whether the current block uses an illumination compensation extension technique; and determine the first index based on the second flag of the current block.
[0466] In some embodiments, the mode determination unit 12 is specifically configured to obtain the first index by decoding the bitstream if the second flag of the current block indicates that the current block uses the illumination compensation extension technique.
[0467] In some embodiments, the mode determination unit 12 is specifically configured to determine that when the second flag of the current block indicates that the current block does not use the illumination compensation extension technique, the first index is a default index, and the default index is used to indicate the upper and left reconstruction sample modes.
[0468] In some embodiments, the mode determination unit 12 is specifically configured to obtain the first flag of the current block by decoding the bitstream.
[0469] In some embodiments, the mode determination unit 12 is specifically configured to obtain the second flag of the current block by decoding the bitstream.
[0470] In some embodiments, when the prediction mode of the current block is a merge mode, the mode determination unit 12 is specifically configured to determine a first flag of a neighboring block of the current block, and determine the reconstructed sample mode of the current block based on the first flag of the neighboring block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique.
[0471] In some embodiments, the mode determination unit 12 is specifically configured to determine that the reconstructed sample mode of the current block is the top and left reconstructed sample mode if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique.
[0472] In some embodiments, the mode determination unit 12 is specifically configured to determine a reconstructed sample mode of the neighboring block when the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, and to determine the reconstructed sample mode of the neighboring 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 determine the reconstructed sample mode of the adjacent block based on the second index, where the second index is used to indicate the reconstructed sample mode of the adjacent block.
[0474] In some embodiments, the sample determination unit 13 is specifically configured to determine adjacent reconstructed samples of the current block based on the left adjacent samples of the current block when the reconstructed sample mode of the current block is a left reconstructed sample mode, and determine 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 specifically configured to determine the neighboring reconstructed samples of the current block based on a height of the current block and a left neighboring sample of the current block.
[0476] In some embodiments, the sample determination unit 13 is specifically configured to select a first number of samples from the left adjacent samples of the current block to determine them as adjacent reconstructed samples of the current block when the height of the current block is equal to a first number.
[0477] In some embodiments, the sample determination unit 13 is specifically configured to select a second number of samples from the left adjacent samples of the current block to determine them as adjacent reconstructed samples of the current block when the height of the current block is not equal to the first number.
[0478] In some embodiments, the sample determination unit 13 is specifically configured to determine the neighboring reconstructed samples of the reference block based on the height of the reference block and the left neighboring samples of the reference block.
[0479] In some embodiments, the sample determination unit 13 is specifically configured to: when the height of the reference block is equal to a first numerical value, interpolate the left adjacent samples of the reference block to obtain a first numerical value number of samples as the adjacent reconstruction samples of the reference block.
[0480] In some embodiments, the sample determination unit 13 is specifically configured to, when the height of the reference block is not equal to the first numerical value, interpolate the left adjacent samples of the reference block to obtain a second numerical value number of samples as the adjacent reconstruction samples of the reference block.
[0481] In some embodiments, the sample determination unit 13 is specifically configured to determine adjacent reconstructed samples of the current block based on upper adjacent samples of the current block when the reconstructed sample mode of the current block is an upper reconstructed sample mode, and to determine adjacent reconstructed samples of the reference block based on upper adjacent samples of a reference block corresponding to the current block in the reference image.
[0482] In some embodiments, the sample determination unit 13 is specifically configured to determine the neighboring reconstructed samples of the current block based on a width of the current block and upper neighboring samples of the current block.
[0483] In some embodiments, the sample determination unit 13 is specifically configured to select a first number of samples from the upper adjacent samples of the current block to determine them as adjacent reconstructed samples of the current block when 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 to determine them as adjacent reconstructed samples of the current block when the width of the current block is not equal to the first number.
[0485] In some embodiments, the sample determination unit 13 is specifically configured to determine the neighboring reconstructed samples of the reference block based on a width of the reference block and upper neighboring samples of the reference block.
[0486] In some embodiments, the sample determination unit 13 is specifically configured to: when the width of the reference block is equal to a first numerical value, interpolate the upper adjacent samples of the reference block to obtain the first numerical value number of samples as the adjacent reconstruction samples of the reference block.
[0487] In some embodiments, the sample determination unit 13 is specifically configured to, when the width of the reference block is not equal to the first numerical value, interpolate upper adjacent samples of the reference block to obtain a second numerical value number of samples, and determine the second numerical value number of samples obtained by interpolation as adjacent reconstruction samples of the reference block.
[0488] Optionally, the first flag includes at least one of a sequence level flag, a picture level flag, and a block level flag.
[0489] In some embodiments, when 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 reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and to 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.
[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 the 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 a product of the scaling factor and the first predicted value, and to determine a sum of the product and an offset parameter as the second predicted value.
[0492] In some embodiments, the mode determination unit 12 is specifically 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 reconstructed sample mode of the current block if the area of the current block is equal to or greater than a preset threshold.
[0494] It should be noted that the device embodiment may correspond to the method embodiment, and similar descriptions can be referred to the method embodiment. In order to avoid repetition, the description thereof is omitted here. Specifically, the video decoding device 10 shown in FIG. 11 may correspond to an entity that performs the method in the embodiment of the present application. In addition, the above and other operations and / or functions of each unit in the video decoding device 10 are respectively used to realize the corresponding process in each method, and the description thereof is omitted here for brevity.
[0495] FIG. 12 is a block diagram illustrating a video encoding device provided by an embodiment of the present application.
[0496] As shown in FIG. 12, the video encoding apparatus 20 includes a prediction unit 21, a mode determination unit 22, and a linear transformation unit .
[0497] The prediction unit 21 is configured to predict a current block to obtain a first predicted value of the current block.
[0498] The mode determination unit 22 is configured to determine a reconstructed sample mode of the current block, where the reconstructed sample mode is one of N candidate modes, where the N candidate modes include at least one of an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode.
[0499] The linear transformation unit 23 is configured to determine a second predicted value of the current block based on a reconstructed sample mode of the current block, and the second predicted value is obtained by performing light illumination compensation on the first predicted value based on the reconstructed sample mode of the current block.
[0500] In some embodiments, the mode determination unit 22 is configured to determine, for an i-th candidate mode among the N candidate modes, a cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N, and to determine a reconstructed sample mode for 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 an i-th adjacent reconstructed sample of the current block and an i-th adjacent reconstructed sample of the reference block based on the i-th candidate mode, determine an i-th linear transformation parameter based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block, determine a 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 a 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 neighboring reconstructed sample of the current block based on the left neighboring sample of the current block when the i-th candidate mode is a left reconstructed sample mode, and to determine the i-th neighboring reconstructed sample of the reference block based on the left neighboring 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 neighboring reconstructed sample of the current block based on a height of the current block and a left neighboring 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-neighboring samples of the current block to determine them as the i-th neighboring reconstructed samples of the current block when 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-neighboring samples of the current block to determine them as the i-th neighboring reconstructed samples of the current block if the height of the current block is not equal to the first number.
[0506] In some embodiments, the mode determination unit 22 is configured to determine the i-th neighboring reconstructed sample of the reference block based on a height of the reference block and a left neighboring sample of the reference block.
[0507] In some embodiments, the mode determination unit 22 is configured to, when the height of the reference block is equal to a first numerical value, interpolate the left-neighboring samples of the reference block to obtain the first numerical value number of samples as the i-th neighboring reconstructed sample of the reference block.
[0508] In some embodiments, the mode determination unit 22 is configured to, if the height of the reference block is not equal to the first numerical value, interpolate the left-neighboring samples of the reference block to obtain a second numerical value number of samples as the i-th neighboring reconstruction 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 an upper adjacent sample of the current block when 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 an upper adjacent sample of a 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 neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring 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 neighboring samples of the current block to determine them as the i-th neighboring reconstructed samples of the current block when the width of the current block is equal to the first number.
[0512] In some embodiments, the mode determination unit 22 is configured to select a second number of samples from the upper neighboring samples of the current block to determine the i-th neighboring reconstructed sample of the current block if the width of the current block is not equal to the first number.
[0513] In some embodiments, the mode determination unit 22 is configured to determine the i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block.
[0514] In some embodiments, the mode determination unit 22 is configured to, when the width of the reference block is equal to the first numerical value, interpolate upper neighboring samples of the reference block to obtain the first numerical value number of samples as the i-th neighboring reconstructed sample of the reference block.
[0515] In some embodiments, the mode determination unit 22 is configured to, when the width of the reference block is not equal to the first numerical value, interpolate upper neighboring samples of the reference block to obtain a second numerical value number of samples as the i-th neighboring reconstruction sample of the reference block.
[0516] In some embodiments, the i-th linear transformation parameters include an i-th scaling factor and an i-th offset parameter. The mode determination unit 22 is configured to determine the i-th scaling factor based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block, and to determine the i-th offset parameter based on the i-th adjacent reconstructed sample of the current block, the i-th adjacent reconstructed 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 a product of the i-th scaling factor and the first predicted value, and to determine a sum of the product and the i-th offset parameter as a second predicted value corresponding to the i-th candidate mode.
[0519] In some embodiments, the mode determination unit 22 is configured to determine a 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.
[0520] In some embodiments, the mode determination unit 22 is configured to determine the candidate mode with the smallest cost among the N candidate modes as the reconstructed sample mode of the current block.
[0521] In some embodiments, the linear transformation unit 23 is configured to determine the second predicted value corresponding to the reconstructed sample mode of the current block as the second predicted value of the current block.
[0522] In some embodiments, the linear transform unit 23 is configured to write a first index into the bitstream, where the first index is used to indicate the reconstructed sample mode of the current block.
[0523] In some embodiments, when the prediction mode of the current block is a merge mode, the mode determination unit 22 is configured to determine a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique or not, and to determine the reconstructed sample mode of the current block based on the first flag of the neighboring block.
[0524] In some embodiments, the mode determination unit 22 is configured to determine that the reconstructed sample mode of the current block is the top and left reconstructed sample mode if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique.
[0525] In some embodiments, the mode determination unit 22 is configured to determine a reconstructed sample mode of the neighboring block if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, and to determine the reconstructed sample mode of the neighboring 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, the second index being used to indicate the reconstructed sample mode of the adjacent block, and to determine the reconstructed sample mode of the adjacent block based on the second index.
[0527] In some embodiments, the mode determination unit 22 is configured to determine adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block based on a reconstructed sample mode of the current block, determine linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed 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 of 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, where the first flag of the current block is used to indicate whether the current block uses an illumination compensation technique or not.
[0529] In some embodiments, the linear transformation unit 23 is configured to determine a 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 the illumination compensation technique, where the second flag of the current block is used to indicate whether the current block uses the illumination compensation extension technique.
[0530] In some embodiments, the linear transformation unit 23 is configured to write an 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 the illumination compensation extension technique.
[0531] In some embodiments, when the prediction mode of the current block is a merge mode, the linear transformation unit 23 is configured to determine a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique or not, and to determine the first flag of the current block based on the first flag of the neighboring block.
[0532] In some embodiments, when the prediction mode of the current block is a merge mode, the linear transformation unit 23 is configured to determine a second flag of a neighboring block of the current block, where the second flag of the neighboring block is used to indicate whether the neighboring block uses the illumination compensation extension technique, and further to determine the second flag of the current block based on the second flag of the neighboring block.
[0533] Optionally, the first flag includes at least one of a sequence level flag, a picture level flag, and a 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 reconstructed sample mode of the current block when the area of the current block is equal to or greater than a preset threshold.
[0536] It should be noted that the apparatus embodiment may correspond to the method embodiment, and similar descriptions can be referred to the method embodiment. In order to avoid repetition, the description thereof is omitted here. Specifically, the video encoding apparatus 20 shown in FIG. 12 may correspond to an entity that performs the method in the embodiment of the present application. In addition, the above-mentioned and other operations and / or functions of each unit in the video encoding apparatus 20 are respectively used to realize the corresponding process in each method, such as the method, and the description thereof is omitted here for brevity.
[0537] The above describes the apparatus and system of the embodiments of the present application from the viewpoint of functional units with reference to the drawings. The functional units may be realized in a hardware form, in a software form, or in a combination of hardware and software. Specifically, each step of the method embodiment in the embodiments of the present application can be completed by a hardware integrated logic circuit in a processor or by a software form instruction. The steps of the method disclosed in the embodiments of the present application can be directly performed and completed by a hardware decoding processor, or can be performed and completed by a combination of hardware and software in a decoding processor. Alternatively, the software can be located in a mature storage medium in the technical field, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory. The processor reads the information in the memory and completes the steps of the method embodiment together with the hardware.
[0538] FIG. 13 is a block diagram showing an electronic device according to an embodiment of the present application.
[0539] 13, the electronic device 30 may be a video encoder or a video decoder according to the embodiments of the present application. The electronic device 30 includes a memory 31、 Processor 32 and transceiver 33 The memory may include: 31 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 is 31 The method according to the embodiment of the present application can be realized by calling and executing the computer program 34 from .
[0540] For example, the processor 32 can be used to carry out the steps of the above-described methods based on instructions in a computer program 34 .
[0541] In some embodiments of the present application, 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, or the like.
[0542] In some embodiments of the present application, the memory 31The memory may include, but is not limited to, volatile and / or non-volatile memory. Non-volatile memory may be read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) that acts as an external high-speed cache. By way of illustrative, but non-limiting example, various RAMs 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), synchronous link dynamic random access memory (synch-link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM).
[0543] In some embodiments of the present application, the computer program 34 may be divided into one or more units, one or more of which may be memory 31 and executed by the processor 32 to complete the method of the present application. 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] 13, the electronic device 30 may further include a transceiver 33. The transceiver 33 may include a processor 32 or a memory 31 It is possible to connect to.
[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 can include a transmitter and a receiver. The transceiver 33 can further include an antenna. The number of antennas can be one or more.
[0546] Each component in the electronic device 30 is connected via a bus system. In addition to a data bus, the bus system further includes a power bus, a control bus, and a status signal bus.
[0547] FIG. 14 is a block diagram illustrating a video encoding and decoding system 40 according to an embodiment of the present application.
[0548] 14, a 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 the present application, and the video decoder 42 is used to perform a video decoding method according to an embodiment of the present application.
[0549] In some embodiments, the present application further provides a bitstream, the bitstream being obtained by the encoding method described above.
[0550] The present application further provides a computer storage medium. The computer readable storage medium has a computer program stored therein. The computer program, when executed by a computer, enables the computer to perform the method of the above method embodiment. Alternatively, an embodiment of the present application further provides a computer program product including instructions, when executed by a computer, causes the computer to perform the method of the above method embodiment.
[0551] When implemented by software, all or part of the above embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed by a computer, all or part of the process or function of the embodiments of the present application is implemented. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can 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, digital subscriber line (DSL), etc.) or wirelessly (e.g., infrared, radio, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or can be a data storage device in which one or more available media are integrated, such as a server, a data center, etc. The available medium may be a magnetic medium (e.g. a floppy disk, hard disk or magnetic tape), an optical medium (e.g. a digital versatile disc (DVD)), or a semiconductor medium (e.g. a solid state disk (SSD)).
[0552] In combination with each exemplary unit and algorithm operation described in the embodiments disclosed in this application, those skilled in the art can be aware that the present application can be realized by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software is determined by the specific application of the technical solution, the design constraints, etc. Those skilled in the art can realize the described functions using different methods for each specific application, but these realizations should not be considered as going beyond the scope of this application.
[0553] In some embodiments of the present application, it should be understood that the disclosed system, device, and method may be realized in other forms. For example, the above device embodiment is merely exemplary. For example, the division of units is merely a division of logical functions, and may have other division forms when actually realized. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. Furthermore, the couplings, direct couplings, and communication connections between each other shown or discussed may be indirect couplings or communication connections by some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0554] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, i.e., they may be located in one place or may be arranged in multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the technical solution of the present embodiment. For example, each functional unit according to each embodiment of the present application may be integrated into one processing unit, each unit may be physically present alone, or two or more units may be integrated into one unit.
[0555] 1. A video decoding method, comprising: Decoding the bitstream and predicting the current block to obtain a first prediction value; determining a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to a reconstructed sample mode of the current block; determining linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block; and performing linear transformation on the first predicted value based on the linear transformation parameters to obtain a second predicted value of the current block.
[0556] Determining the reconstruction sample mode of the current block is determining a first index indicating a reconstruction sample mode of a current block; determining a reconstructed sample mode for the current block based on the first index.
[0557] Determining the first index includes decoding the bitstream to obtain the first index.
[0558] When the prediction mode of the current block is a merge mode, determining the first index includes: Determining a first flag of an adjacent block of a current block, where the first flag of the adjacent block is used to indicate whether the adjacent block uses an illumination compensation technique; determining a first index based on the first flag of the adjacent block.
[0559] determining a first index based on a first flag of the adjacent block, If the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining that the first index is a default index; The default index is used to indicate the top and left reconstruction sample modes.
[0560] determining a first index based on a first flag of the adjacent block, determining a second index if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, the second index being used to indicate a reconstruction sample mode of the neighboring block; determining the second index as the first index.
[0561] When the prediction mode of the current block is a non-merge mode, determining the first index includes: determining a first flag of a current block, where the first flag of the current block is used to indicate whether the current block uses an illumination compensation technique; If the first flag of the current block indicates that the current block uses an illumination compensation technique, determining a second flag of the current block, where the second flag of the current block is used to indicate whether the current block uses an illumination compensation extension technique; and determining; 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 the illumination compensation extension technique, 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 the illumination compensation extension technique, determining that the first index is a default index; The default index is used to indicate the top and left reconstruction sample modes.
[0564] Determining the first flag of the current block is This involves obtaining the first flag of the current block by decoding the bitstream.
[0565] To determine the second flag of the current block, Decoding the bitstream includes obtaining a second flag for the current block.
[0566] When the prediction mode of the current block is a merge mode, determining the reconstructed sample mode of the current block includes: Determining a first flag of an adjacent block of a current block, where the first flag of the adjacent block is used to indicate whether the adjacent block uses an illumination compensation technique; determining a reconstructed sample mode of the current block based on the first flag of the neighboring block.
[0567] Determining a reconstructed sample mode of a current block based on a first flag of a neighboring block includes: The first flag of the neighboring block includes determining that the reconstructed sample mode of the current block is the top and left reconstructed sample mode if the neighboring block indicates to use the illumination compensation technique.
[0568] Determining a reconstructed sample mode of a current block based on a first flag of a neighboring block includes: If the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining a reconstruction sample mode of the neighboring block; determining the reconstructed sample mode of the neighboring block as the reconstructed sample mode of the current block.
[0569] Determining the reconstruction sample mode of the neighboring block includes: determining a second index, the second index being used to indicate a reconstructed sample mode of the neighboring block; determining a reconstructed sample mode of the neighboring block based on the second index.
[0570] Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to a reconstructed sample mode of the current block includes: If the reconstructed sample mode of the current block is a left reconstructed sample mode, determining adjacent reconstructed samples of the current block based on the left adjacent samples of the current block, and determining 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.
[0571] Determining the neighboring reconstructed sample of the current block based on the left neighboring sample of the current block includes: Determining neighboring reconstructed samples of the current block based on the height of the current block and the left neighboring sample of the current block.
[0572] Determining the neighboring reconstructed sample of the current block based on the height of the current block and the left neighboring sample of the current block includes: If the height of the current block is equal to the first numerical value, the method includes selecting the first numerical value number of samples from the left neighboring samples of the current block and determining them as neighboring reconstructed samples of the current block.
[0573] Determining the neighboring reconstructed sample of the current block based on the height of the current block and the left neighboring sample of the current block includes: If the height of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the left neighboring samples of the current block and determining them as the neighboring reconstructed samples of the current block.
[0574] Determining an adjacent reconstructed sample of the reference block based on a left adjacent sample of the reference block corresponding to the current block in the reference image includes: Determining neighboring reconstructed samples of the reference block based on the height of the reference block and the left neighboring samples of the reference block.
[0575] Determining the neighboring reconstructed samples of the reference block based on the height of the reference block and the left neighboring samples of the reference block includes: If the height of the reference block is equal to the first numerical value, the first numerical value number of samples are obtained by interpolating the left neighboring samples of the reference block as the neighboring reconstruction samples of the reference block.
[0576] Determining the neighboring reconstructed samples of the reference block based on the height of the reference block and the left neighboring samples of the reference block includes: If the height of the reference block is not equal to the first value, the second value number of samples are obtained by interpolating the left neighboring samples of the reference block as the neighboring reconstruction samples of the reference block.
[0577] Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to a reconstructed sample mode of the current block includes: If the reconstructed sample mode of the current block is an upper reconstructed sample mode, determining adjacent reconstructed samples of the current block based on upper adjacent samples of the current block, and determining adjacent reconstructed samples of the reference block based on upper adjacent samples of a reference block corresponding to the current block in the reference image.
[0578] Determining adjacent reconstructed samples of the current block based on upper adjacent samples of the current block includes: Determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block.
[0579] Determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block includes: If the width of the current block is equal to the first numerical value, selecting the first numerical value number of samples from upper adjacent samples of the current block and determining them as adjacent reconstructed samples of the current block.
[0580] Determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block includes: If the width of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the upper adjacent samples of the current block and determining them as the adjacent reconstructed samples of the current block.
[0581] Determining adjacent reconstructed samples of the reference block based on upper adjacent samples of the reference block corresponding to the current block in the reference image includes: Determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block.
[0582] Determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block includes: If the width of the reference block is equal to the first numerical value, the first numerical value number of samples are obtained by interpolating the upper adjacent samples of the reference block as the adjacent reconstructed samples of the reference block.
[0583] Determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block includes: If the width of the reference block is not equal to the first numerical value, the method includes: interpolating upper adjacent samples of the reference block to obtain a second numerical value number of samples; and determining adjacent reconstruction samples of the reference block based on the second numerical value number of samples obtained by interpolation.
[0584] The first flag includes at least one of a sequence level flag, a picture level flag, and a block level flag.
[0585] The linear transformation parameters include a scaling factor and an offset parameter, and determining the linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block includes: determining a scaling factor based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block; determining an offset parameter based on the neighboring reconstructed samples of the current block, the neighboring reconstructed samples of the reference block, and a scaling factor; Includes.
[0586] performing a linear transformation on the first predicted value based on the linear transformation parameter to obtain a second predicted value for the current block; A linear transformation is performed on the first predicted value based on the scaling factor and the offset parameter to obtain a second predicted value for the current block.
[0587] 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; determining a product of a scaling factor and the first estimate; determining a sum of the product and an offset parameter as a second estimate; Includes.
[0588] Determining the reconstruction sample mode of the current block is If the current image to which the current block belongs is a first type image, determining the reconstruction sample mode of the current block.
[0589] Determining the reconstruction sample mode of the current block is If the area of the current block is equal to or greater than the preset threshold, determining the reconstruction sample mode of the current block.
[0590] 1. A video encoding method, comprising: predicting a current block to obtain a first prediction of the current block; determining a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; determining a second predicted value of the current block according to a reconstructed sample mode of the current block, where the second predicted value is obtained by performing light illumination compensation on the first predicted value according to the reconstructed sample mode of the current block; Includes.
[0591] Determining the reconstruction sample mode of the current block is For an i-th candidate mode among the N candidate modes, determine a cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N; determining a reconstruction sample mode of the current block from the N candidate modes based on costs corresponding to the N candidate modes; Includes.
[0592] Determining the cost corresponding to the i-th candidate mode includes: determining an i-th adjacent reconstructed sample of the current block and an i-th adjacent reconstructed sample of the reference block according to the i-th candidate mode; determining an i-th linear transformation parameter according to the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block; determining a first predicted value of the current block, and performing linear transformation on the first predicted value according to the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode; determining a cost corresponding to the i-th candidate mode based on a second predicted value corresponding to the i-th candidate mode.
[0593] Determining the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block based on the i-th candidate mode includes: If the i-th candidate mode is a left-side reconstructed sample mode, determining an i-th adjacent reconstructed sample of the current block based on a left-side adjacent sample of the current block, and determining an i-th adjacent reconstructed sample of the reference block based on a left-side 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 adjacent sample of the current block includes: Determining the i-th neighboring reconstructed sample of the current block based on the height of the current block and the left neighboring sample of the current block.
[0595] Determining the i-th adjacent reconstructed sample of the current block based on the height of the current block and the left adjacent sample of the current block includes: If the height of the current block is equal to the first numerical value, the method includes selecting the first numerical value number of samples from the left neighboring samples of the current block and determining them as the i-th neighboring reconstructed samples of the current block.
[0596] Determining the i-th adjacent reconstructed sample of the current block based on the height of the current block and the left adjacent sample of the current block includes: If the height of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the left neighboring samples of the current block and determining them as the i-th neighboring reconstructed samples of the current block.
[0597] Determining an i-th adjacent reconstructed sample of the reference block based on a left adjacent sample of the reference block corresponding to a current block in the reference image includes: Determining the i-th neighboring reconstructed sample of the reference block based on the height of the reference block and a left neighboring sample of the reference block.
[0598] Determining an i-th adjacent reconstruction sample of the reference block based on a height of the reference block and a left adjacent sample of the reference block includes: If the height of the reference block is equal to the first numerical value, the first numerical value number of samples are obtained by interpolating the left neighboring samples of the reference block, as the i-th neighboring reconstructed sample of the reference block.
[0599] Determining an i-th adjacent reconstruction sample of the reference block based on a height of the reference block and a left adjacent sample of the reference block includes: If the height of the reference block is not equal to the first value, the second value number of samples are obtained by interpolating the left neighboring samples of the reference block, as the i-th neighboring reconstructed sample of the reference block.
[0600] Determining the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block based on the i-th candidate mode includes: If the i-th candidate mode is an upper reconstructed sample mode, determining the i-th adjacent reconstructed sample of the current block based on an upper adjacent sample of the current block, and determining the i-th adjacent reconstructed sample of the reference block based on an upper adjacent sample of a reference block corresponding to the current block in the reference image.
[0601] Determining an i-th adjacent reconstructed sample of the current block based on an upper adjacent sample of the current block includes: Determining the i-th neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring sample of the current block.
[0602] Determining an i-th neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring sample of the current block includes: If the width of the current block is equal to the first numerical value, selecting the first numerical value number of samples from the upper neighboring samples of the current block and determining them as the i-th neighboring reconstructed samples of the current block.
[0603] Determining an i-th neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring sample of the current block includes: If the width of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the upper neighboring samples of the current block and determining them as the i-th neighboring reconstructed samples of the current block.
[0604] Determining an i-th adjacent reconstructed sample of the reference block based on an upper adjacent sample of the reference block corresponding to the current block in the reference image includes: Determining the i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block.
[0605] Determining an i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block includes: If the width of the reference block is equal to the first numerical value, interpolate the upper neighboring samples of the reference block to obtain the first numerical value number of samples as the i-th neighboring reconstructed sample of the reference block.
[0606] Determining an i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block includes: If the width of the reference block is not equal to the first value, the method includes: interpolating upper neighboring samples of the reference block to obtain a second value number of samples as the i-th neighboring reconstructed sample of the reference block.
[0607] The i-th linear transformation parameters include an i-th scaling factor and an i-th offset parameter, and determining the i-th linear transformation parameters based on the i-th adjacent reconstructed samples of the current block and the i-th adjacent reconstructed samples of the reference block includes: determining an i-th scaling factor based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block; determining an i-th offset parameter based on the i-th adjacent reconstructed sample of the current block, the i-th adjacent reconstructed sample of the reference block, and the i-th scaling factor; Includes.
[0608] performing 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; 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 a second predicted value corresponding to the i-th candidate mode; determining the product of the i-th scaling factor and the first predicted value; determining a sum of the product and the i-th offset parameter as a second predicted value corresponding to the i-th candidate mode; Includes.
[0610] determining a cost corresponding to the i-th candidate mode based on the second predicted value corresponding to the i-th candidate mode; Determining a 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 a reconstruction sample mode of the current block from the N candidate modules based on costs corresponding to the N candidate models includes: determining the candidate mode with the smallest cost among the N candidate modes as the reconstructed sample mode for the current block;
[0612] determining a second predicted value of the current block according to a reconstruction sample mode of the current block; determining a second predicted value corresponding to a reconstructed sample mode of the current block as a second predicted value of the current block.
[0613] The video encoding method is writing the first index to the bitstream; The first index is used to indicate the reconstructed sample mode of the current block.
[0614] When the prediction mode of the current block is a merge mode, determining the reconstructed sample mode of the current block includes: Determining a first flag of an adjacent block of a current block, where the first flag of the adjacent block is used to indicate whether the adjacent block uses an illumination compensation technique; determining a reconstructed sample mode of the current block based on the first flag of the neighboring block.
[0615] Determining a reconstructed sample mode of a current block based on a first flag of a neighboring block includes: The first flag of the neighboring block includes determining that the reconstructed sample mode of the current block is the top and left reconstructed sample mode if the neighboring block indicates to use the illumination compensation technique.
[0616] Determining a reconstructed sample mode of a current block based on a first flag of a neighboring block includes: determining a reconstruction sample mode of the neighboring block if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique; determining the reconstructed sample mode of the neighboring block as the reconstructed sample mode of the current block.
[0617] Determining the reconstruction sample mode of the neighboring block includes: determining a second index, the second index being used to indicate a reconstructed sample mode of the neighboring block; determining a reconstructed sample mode of the neighboring block based on the second index.
[0618] determining a second predicted value of the current block according to a reconstruction sample mode of the current block; Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block according to a reconstructed sample mode of the current block; Determine a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block; Includes.
[0619] The video encoding method is determining a first flag for the current block and writing the first flag to the bitstream; The first flag of the current block is used to indicate whether the current block uses the illumination compensation technique or not.
[0620] The video encoding method is If the first flag of the current block indicates that the current block uses an illumination compensation technique, determining a second flag of the current block, and writing the second flag of the current block into the bitstream; The second flag of the current block is used to indicate whether the current block uses the illumination compensation extension technique.
[0621] The video encoding method is If the second flag of the current block indicates that the current block uses the illumination compensation extension technique, further including writing an index of a reconstructed sample mode of the current block into the bitstream.
[0622] When the prediction mode of the current block is a merge mode, determining the first flag of the current block includes: Determining a first flag of an adjacent block of a current block, where the first flag of the adjacent block is used to indicate whether the adjacent block uses an illumination compensation technique; determining a first flag of the current block based on the first flag of the adjacent block.
[0623] When the prediction mode of the current block is a merge mode, determining the second flag of the current block includes: Determining a second flag of an adjacent block of the current block, where the second flag of the adjacent block is used to indicate whether the adjacent block uses an illumination compensation extension technique; determining a second flag of the current block based on the second flag of the adjacent block.
[0624] The first flag includes at least one of a sequence level flag, a picture level flag, and a block level flag.
[0625] Determining the reconstruction sample mode of the current block is If the current image to which the current block belongs is a first type image, determining the reconstruction sample mode of the current block.
[0626] Determining the reconstruction sample mode of the current block is If the area of the current block is equal to or greater than the preset threshold, determining the reconstruction sample mode of the current block.
[0627] A video decoding device, comprising: The method includes: 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 a current block to obtain a first predicted value of the current block; The mode determination unit is configured to determine a 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 an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; The sample determination unit is configured to determine, according to a reconstructed sample mode of the current block, adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block; The linear transformation unit is configured to determine linear transformation parameters based on the adjacent reconstructed samples of the current block and the adjacent reconstructed 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 of the current block.
[0628] 1. A video encoding device, comprising: A prediction unit, a mode decision unit, and a linear transformation unit, The prediction unit is configured to predict a current block to obtain a first predicted value of the current block; The mode determination unit is configured to determine a 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 an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; The linear transformation unit is configured to determine a second predicted value of the current block based on a reconstructed sample mode of the current block, and the second predicted value is obtained by performing light illumination compensation on the first predicted value based on the reconstructed sample mode of the current block.
[0629] A video encoding and decoding system, comprising: A video encoder and a video decoder, The video decoder is configured to perform a video decoding method, The video encoder is configured to perform a video encoding method.
[0630] 1. An electronic device comprising: A processor and a memory, the memory is configured to store a computer program; The processor is configured to execute a computer program to perform a video decoding or encoding method.
[0631] 1. A computer-readable storage medium, comprising: The computer-readable storage medium is configured to store computer-executable instructions that, when executed by a processor, perform a video decoding or encoding method.
[0632] The bitstream is generated based on a video encoding method.
[0633] The above content is only a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. 1. A video decoding method, comprising: Decoding the bitstream and predicting the current block to obtain a first prediction value; determining a reconstructed sample mode of a current block, the reconstructed sample mode being one of N candidate modes, the N candidate modes including at least one of a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block; determining a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block; and performing a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block; Including, 13. A video decoding method comprising:
2. Determining the reconstructed sample mode of the current block includes: determining a first index indicating a reconstructed sample mode of the current block; determining a reconstructed sample mode of the current block based on the first index; Including, 2. The method of claim 1 .
3. Determining the first index includes: decoding the bitstream to obtain the first index; 3. The method of claim 2 .
4. When the prediction mode of the current block is a merge mode, determining the first index includes: determining a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique; determining the first index based on a first flag of the adjacent block; Including, 3. The method of claim 2 .
5. determining the first index based on a first flag of the adjacent block, If the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining that the first index is a default index; the default index is used to indicate the upper and left reconstruction sample modes; 5. The method of claim 4.
6. determining the first index based on a first flag of the adjacent block, determining a second index if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, the second index being used to indicate a reconstructed sample mode of the neighboring block; determining the second index as the first index; Including, 5. The method of claim 4.
7. When the prediction mode of the current block is a non-merge mode, determining the first index includes: determining a first flag of the current block, the first flag of the current block being used to indicate whether the current block uses an illumination compensation technique; determining a second flag of the current block when the first flag of the current block indicates that the current block uses the illumination compensation technique, the second flag of the current block being used to indicate whether the current block uses an illumination compensation extension technique; and determining the first index based on a second flag of the current block; Including, 3. The method of claim 2 .
8. determining the first index based on a second flag of the current block, if a second flag of the current block indicates that the current block uses the illumination compensation extension technique, obtaining the first index by decoding the bitstream.
8. The method of claim 7.
9. determining the first index based on a second flag of the current block, If a second flag of the current block indicates that the current block does not use the illumination compensation extension technique, determining that the first index is a default index; the default index is used to indicate the upper and left reconstruction sample modes; 8. The method of claim 7.
10. determining a first flag of the current block; obtaining a first flag of the current block by decoding a bitstream; 8. The method of claim 7.
11. determining a second flag for the current block; obtaining a second flag for the current block by decoding the bitstream; 8. The method of claim 7.
12. When the prediction mode of the current block is a merge mode, determining a reconstructed sample mode of the current block includes: determining a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique; determining a reconstructed sample mode of the current block according to a first flag of the neighboring block; Including, 2. The method of claim 1 .
13. determining a reconstructed sample mode of the current block based on a first flag of the neighboring block, if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining that the reconstructed sample mode of the current block is an upper and left reconstructed sample mode; 13. The method of claim 12.
14. determining a reconstructed sample mode of the current block based on a first flag of the neighboring block, If the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining a reconstruction sample mode of the neighboring block; determining the reconstructed sample mode of the neighboring block as the reconstructed sample mode of the current block; Including, 13. The method of claim 12.
15. Determining the reconstructed sample mode of the neighboring blocks includes: determining a second index, the second index being used to indicate a reconstructed sample mode of the neighboring block; determining a reconstructed sample mode of the neighboring block based on the second index; Including, 15. The method of claim 14.
16. Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block includes: When the reconstructed sample mode of the current block is a left reconstructed sample mode, determining adjacent reconstructed samples of the current block based on left adjacent samples of the current block, and determining adjacent reconstructed samples of the reference block based on left adjacent samples of a reference block corresponding to the current block in a reference image.
16. The method according to any one of claims 1 to 15.
17. Determining neighboring reconstructed samples of the current block based on left neighboring samples of the current block includes: determining neighboring reconstructed samples of the current block based on a height of the current block and a left neighboring sample of the current block; 17. The method of claim 16.
18. determining neighboring reconstructed samples of the current block based on a height of the current block and a left neighboring sample of the current block, selecting a first number of samples from left neighboring samples of the current block as neighboring reconstructed samples of the current block if the height of the current block is equal to a first number; 20. The method of claim 17 .
19. determining neighboring reconstructed samples of the current block based on a height of the current block and a left neighboring sample of the current block, if the height of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the left neighboring samples of the current block to determine them as neighboring reconstructed samples of the current block; 20. The method of claim 17 .
20. Determining neighboring reconstructed samples of a reference block corresponding to the current block in a reference image based on left neighboring samples of the reference block, the left neighboring samples being determined based on the left neighboring samples of the reference block corresponding to the current block in a reference image, the left neighboring samples being determined based on the left neighboring samples of the reference block corresponding to the current block in a reference image, the left neighboring samples being determined based on the left neighboring samples of the reference block corresponding to the current block in a reference image, the left neighboring samples being determined based on the left neighboring samples of the reference block corresponding to the current block in a reference image, the left neighboring samples being determined based on the left neighboring samples of the reference block corresponding to the current block in a reference image, the right ... determining adjacent reconstructed samples of the reference block based on a height of the reference block and a left adjacent sample of the reference block; 17. The method of claim 16.
21. Determining neighboring reconstructed samples of the reference block based on a height of the reference block and a left neighboring sample of the reference block includes: If the height of the reference block is equal to a first value, interpolating the left adjacent samples of the reference block to obtain a first number of samples as adjacent reconstruction samples of the reference block.
21. The method of claim 20.
22. Determining neighboring reconstructed samples of the reference block based on a height of the reference block and a left neighboring sample of the reference block includes: if the height of the reference block is not equal to the first value, interpolating the left adjacent samples of the reference block to obtain a second value number of samples as the adjacent reconstruction samples of the reference block; 21. The method of claim 20.
23. Determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block includes: When the reconstructed sample mode of the current block is an upper reconstructed sample mode, determining adjacent reconstructed samples of the current block based on upper adjacent samples of the current block, and determining adjacent reconstructed samples of the reference block based on upper adjacent samples of a reference block corresponding to the current block in a reference image.
16. The method according to any one of claims 1 to 15.
24. Determining adjacent reconstructed samples of the current block based on upper adjacent samples of the current block includes: determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block; 24. The method of claim 23.
25. determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block, if the width of the current block is equal to a first numerical value, selecting a first numerical value number of samples from upper adjacent samples of the current block to determine them as adjacent reconstructed samples of the current block; 24. The method of claim 23.
26. determining adjacent reconstructed samples of the current block based on a width of the current block and upper adjacent samples of the current block, if the width of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from upper adjacent samples of the current block to determine them as adjacent reconstructed samples of the current block; 24. The method of claim 23.
27. Determining adjacent reconstructed samples of a reference block corresponding to the current block in a reference image based on upper adjacent samples of the reference block, the reference block including: determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block; 24. The method of claim 23.
28. Determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block includes: If the width of the reference block is equal to a first numerical value, interpolating upper adjacent samples of the reference block to obtain a first numerical value number of samples as adjacent reconstruction samples of the reference block.
28. The method of claim 27.
29. Determining adjacent reconstructed samples of the reference block based on a width of the reference block and upper adjacent samples of the reference block includes: if the width of the reference block is not equal to the first numerical value, interpolating upper adjacent samples of the reference block to obtain a second numerical value number of samples, and determining adjacent reconstruction samples of the reference block according to the second numerical value number of samples obtained by interpolation.
28. The method of claim 27.
30. the first flag includes at least one of a sequence level flag, a picture level flag, and a block level flag; 13. The method according to claim 4, 7 or 12.
31. The linear transformation parameters include a scaling factor and an offset parameter, and determining the linear transformation parameters based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block includes: determining the scaling factor based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block; determining the offset parameter based on neighboring reconstructed samples of the current block, neighboring reconstructed samples of the reference block, and the scaling factor; Including, 16. The method according to any one of claims 1 to 15.
32. performing a linear transformation on the first predicted value based on the linear transformation parameter to obtain a second predicted value of the current block; 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.
32. The method of claim 31 .
33. 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; determining a product of said scaling factor and said first predicted value; determining the sum of the product and the offset parameter as the second predicted value; Including, 33. The method of claim 32.
34. Determining the reconstructed sample mode of the current block includes: determining a reconstruction sample mode of the current block if the current image to which the current block belongs is a first type image; 16. The method according to any one of claims 1 to 15.
35. Determining the reconstructed sample mode of the current block includes: determining a reconstruction sample mode of the current block when the area of the current block is equal to or greater than a preset threshold; 16. The method according to any one of claims 1 to 15.
36. 1. A video encoding method, comprising: predicting a current block to obtain a first predicted value of the current block; determining a 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 a top reconstructed sample mode, a left reconstructed sample mode, and a top and left reconstructed sample mode; determining a second predicted value of the current block according to a reconstructed sample mode of the current block, the second predicted value being obtained by performing lighting compensation on the first predicted value according to a reconstructed sample mode of the current block; Including, 13. A video encoding method comprising:
37. Determining the reconstructed sample mode of the current block includes: For an i-th candidate mode among the N candidate modes, determine a cost corresponding to the i-th candidate mode, where i is a positive integer from 1 to N; determining a reconstructed sample mode of the current block from the N candidate modes based on costs corresponding to the N candidate modes; Including, 37. The method of claim 36.
38. Determining a cost corresponding to the i-th candidate mode comprises: determining an i-th neighboring reconstructed sample of the current block and an i-th neighboring reconstructed sample of a reference block based on the i-th candidate mode; determining an i-th linear transformation parameter based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block; determining a first predicted value of the current block, and performing a linear transformation on the first predicted value according to the i-th linear transformation parameter to obtain a second predicted value corresponding to the i-th candidate mode; determining a cost corresponding to the i-th candidate mode based on a second predicted value corresponding to the i-th candidate mode; Including, 38. The method of claim 37.
39. Determining an i-th neighboring reconstructed sample of the current block and an i-th neighboring reconstructed sample of a reference block based on the i-th candidate mode includes: If the i-th candidate mode is a left-side reconstructed sample mode, determining an i-th adjacent reconstructed sample of the current block based on a left-side adjacent sample of the current block, and determining an i-th adjacent reconstructed sample of the reference block based on a left-side adjacent sample of a reference block corresponding to the current block in a reference image.
39. The method of claim 38.
40. Determining the i-th neighboring reconstructed sample of the current block based on the left neighboring sample of the current block includes: determining an i-th neighboring reconstructed sample of the current block based on a height of the current block and a left neighboring sample of the current block; 40. The method of claim 39.
41. Determining the i-th neighboring reconstructed sample of the current block based on the height of the current block and the left neighboring sample of the current block includes: selecting a first number of samples from left neighboring samples of the current block as the i-th neighboring reconstructed samples of the current block if the height of the current block is equal to a first number; 41. The method of claim 40.
42. Determining the i-th neighboring reconstructed sample of the current block based on the height of the current block and the left neighboring sample of the current block includes: if the height of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from the left neighboring samples of the current block and determining them as the i-th neighboring reconstructed samples of the current block; 41. The method of claim 40.
43. Determining an i-th neighboring reconstructed sample of a reference block corresponding to the current block in a reference image based on a left neighboring sample of the reference block, determining an i-th neighboring reconstructed sample of the reference block based on a height of the reference block and a left neighboring sample of the reference block; 40. The method of claim 39.
44. Determining the i-th neighboring reconstructed sample of the reference block based on the height of the reference block and the left neighboring sample of the reference block includes: if the height of the reference block is equal to a first numerical value, interpolating the left neighboring samples of the reference block to obtain a first numerical value number of samples as the i-th neighboring reconstruction sample of the reference block; 44. The method of claim 43.
45. Determining the i-th neighboring reconstructed sample of the reference block based on the height of the reference block and the left neighboring sample of the reference block includes: if the height of the reference block is not equal to the first numerical value, interpolating the left adjacent samples of the reference block to obtain a second numerical value of samples as the i-th adjacent reconstruction sample of the reference block; 44. The method of claim 43.
46. Determining an i-th neighboring reconstructed sample of the current block and an i-th neighboring reconstructed sample of a reference block based on the i-th candidate mode includes: If the i-th candidate mode is an upper reconstructed sample mode, determining an i-th adjacent reconstructed sample of the current block based on an upper adjacent sample of the current block, and determining an i-th adjacent reconstructed sample of the reference block based on an upper adjacent sample of a reference block corresponding to the current block in a reference image.
39. The method of claim 38.
47. Determining the i-th neighboring reconstructed sample of the current block based on the upper neighboring samples of the current block includes: determining an i-th adjacent reconstructed sample of the current block based on a width of the current block and an upper adjacent sample of the current block; 47. The method of claim 46.
48. Determining the i-th neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring sample of the current block includes: if the width of the current block is equal to a first numerical value, selecting a first numerical value number of samples from upper adjacent samples of the current block to determine them as the i-th adjacent reconstructed samples of the current block; 48. The method of claim 47.
49. Determining the i-th neighboring reconstructed sample of the current block based on a width of the current block and an upper neighboring sample of the current block includes: if the width of the current block is not equal to the first numerical value, selecting a second numerical value number of samples from upper adjacent samples of the current block to determine them as the i-th adjacent reconstructed samples of the current block; 48. The method of claim 47.
50. Determining an i-th adjacent reconstructed sample of a reference block corresponding to the current block in a reference image based on an upper adjacent sample of the reference block, determining an i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block; 47. The method of claim 46.
51. Determining the i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block includes: If the width of the reference block is equal to a first numerical value, interpolating upper adjacent samples of the reference block to obtain a first numerical value number of samples as the i-th adjacent reconstruction sample of the reference block.
51. The method of claim 50.
52. Determining the i-th neighboring reconstructed sample of the reference block based on a width of the reference block and an upper neighboring sample of the reference block includes: if the width of the reference block is not equal to the first numerical value, interpolating upper adjacent samples of the reference block to obtain a second numerical value of samples as the i-th adjacent reconstruction sample of the reference block; 51. The method of claim 50.
53. The i-th linear transformation parameter includes an i-th scaling factor and an i-th offset parameter, and determining the i-th linear transformation parameter based on the i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block includes: determining the i-th scaling factor based on the i-th neighboring reconstructed sample of the current block and the i-th neighboring reconstructed sample of the reference block; determining the i-th offset parameter based on the i-th neighboring reconstructed sample of the current block, the i-th neighboring reconstructed sample of the reference block, and the i-th scaling factor; Including, 53. The method according to any one of claims 38 to 52.
54. performing 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, 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.
54. The method of claim 53.
55. 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; determining a product of the i-th scaling factor and the first predicted value; determining a sum of the product and the i-th offset parameter as a second predicted value corresponding to the i-th candidate mode; Including, 54. The method of claim 53.
56. determining a cost corresponding to the i-th candidate mode based on a second predicted value corresponding to the i-th candidate mode, determining a 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; 53. The method according to any one of claims 38 to 52.
57. determining a reconstructed sample mode for the current block from the N candidate models based on costs corresponding to the N candidate models, determining a candidate mode with a minimum cost among the N candidate modes as a reconstructed sample mode for the current block; 53. The method according to any one of claims 37 to 52.
58. determining a second predicted value for the current block based on a reconstructed sample mode of the current block, determining a second predicted value corresponding to a reconstructed sample mode of the current block as a second predicted value of the current block; 53. The method according to any one of claims 38 to 52.
59. The method comprises: writing the first index to the bitstream; the first index is used to indicate a reconstructed sample mode of the current block; 53. The method according to any one of claims 37 to 52.
60. When the prediction mode of the current block is a merge mode, determining a reconstructed sample mode of the current block includes: determining a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique; determining a reconstructed sample mode of the current block according to a first flag of the neighboring block; Including, 37. The method of claim 36.
61. determining a reconstructed sample mode of the current block based on a first flag of the neighboring block, if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique, determining that the reconstructed sample mode of the current block is an upper and left reconstructed sample mode; 61. The method of claim 60.
62. determining a reconstructed sample mode of the current block based on a first flag of the neighboring block, determining a reconstruction sample mode of the neighboring block if the first flag of the neighboring block indicates that the neighboring block uses an illumination compensation technique; determining the reconstructed sample mode of the neighboring block as the reconstructed sample mode of the current block; Including, 61. The method of claim 60.
63. Determining the reconstructed sample mode of the neighboring blocks includes: determining a second index, the second index being used to indicate a reconstructed sample mode of the neighboring block; determining a reconstructed sample mode of the neighboring block based on the second index; Including, 63. The method of claim 62.
64. determining a second predicted value for the current block based on a reconstructed sample mode of the current block, determining adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block; determining a linear transformation parameter according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block; and performing a linear transformation on the first predicted value according to the linear transformation parameter to obtain a second predicted value of the current block; Including, 64. The method according to any one of claims 60 to 63.
65. The method comprises: determining a first flag for the current block and writing the first flag to a bitstream; a first flag of the current block is used to indicate whether the current block uses an illumination compensation technique; 53. The method according to any one of claims 36 to 52.
66. The method comprises: If the first flag of the current block indicates that the current block uses an illumination compensation technique, the method further includes determining a second flag of the current block, and writing the second flag of the current block into a bitstream; a second flag of the current block is used to indicate whether the current block uses an illumination compensation extension technique; 66. The method of claim 65.
67. The method comprises: If the second flag of the current block indicates that the current block uses the illumination compensation extension technique, the method further includes writing an index of a reconstructed sample mode of the current block into the bitstream.
67. The method of claim 66.
68. When the prediction mode of the current block is a merge mode, determining a first flag of the current block includes: determining a first flag of a neighboring block of the current block, where the first flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation technique; determining a first flag of the current block based on a first flag of the adjacent block; Including, 66. The method of claim 65.
69. When the prediction mode of the current block is a merge mode, determining a second flag of the current block includes: determining a second flag of a neighboring block of the current block, where the second flag of the neighboring block is used to indicate whether the neighboring block uses an illumination compensation extension technique; determining a second flag of the current block based on a second flag of the adjacent block; Including, 69. The method of claim 68.
70. the first flag includes at least one of a sequence level flag, a picture level flag, and a block level flag; 66. The method of claim 60 or 65.
71. Determining the reconstructed sample mode of the current block includes: determining a reconstruction sample mode of the current block if the current image to which the current block belongs is a first type image; 53. The method according to any one of claims 36 to 52.
72. Determining the reconstructed sample mode of the current block includes: determining a reconstruction sample mode of the current block when the area of the current block is equal to or greater than a preset threshold; 53. The method according to any one of claims 36 to 52.
73. A video decoding device, comprising: The method includes: a decoding unit; a mode determination unit; a sample determination unit; and a linear transformation unit; The decoding unit is configured to decode a bitstream and predict a current block to obtain a first predicted value of the current block; The mode determination unit is configured to determine a 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 an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; The sample determination unit is configured to determine adjacent reconstructed samples of the current block and adjacent reconstructed samples of a reference block according to a reconstructed sample mode of the current block; the linear transformation unit is configured to determine linear transformation parameters according to adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and perform a linear transformation on the first predicted value according to the linear transformation parameters to obtain a second predicted value of the current block. A video decoding device comprising:
74. 1. A video encoding device, comprising: A prediction unit, a mode decision unit, and a linear transformation unit, The prediction unit is configured to predict a current block to obtain a first predicted value of the current block; The mode determination unit is configured to determine a 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 an upper reconstructed sample mode, a left reconstructed sample mode, and an upper and left reconstructed sample mode; The linear transformation unit is configured to determine a second predicted value of the current block according to a reconstructed sample mode of the current block, and the second predicted value is obtained by performing lighting compensation on the first predicted value according to the reconstructed sample mode of the current block. A video encoding device comprising:
75. 1. A video encoding and decoding system, comprising: A video encoder and a video decoder, The video decoder is configured to perform a video decoding method according to any one of claims 1 to 35, The video encoder is configured to perform a video encoding method according to any one of claims 36 to 72. A video encoding / decoding system comprising:
76. 1. An electronic device comprising: A processor and a memory, the memory is configured to store a computer program; The processor is configured to execute the computer program so as to perform the method according to any one of claims 1 to 35 or the method according to any one of claims 36 to 72.
1. An electronic device comprising:
77. 1. A computer-readable storage medium, comprising: The computer-readable storage medium is configured to store computer-executable instructions, which, when executed by a processor, perform the method according to any one of claims 1 to 35 or any one of claims 36 to 72. A computer-readable storage medium comprising:
78. A bitstream comprising: The bitstream is generated according to a method according to any one of claims 36 to 72. A bitstream comprising:
Citation Information
Patent Citations
Illumination compensation based inter-prediction method and apparatus in a video coding system
JP2019530345A
Method, apparatus and computer program for video encoding or decoding
JP2022508161A
Method and apparatus for video coding
WO2020191034A1
Method and apparatus of local illumination compensation for inter prediction
WO2020236039A1