WO2023197229A1 - 视频编解码方法、装置、设备、系统及存储介质 - Google Patents

视频编解码方法、装置、设备、系统及存储介质 Download PDF

Info

Publication number
WO2023197229A1
WO2023197229A1 PCT/CN2022/086725 CN2022086725W WO2023197229A1 WO 2023197229 A1 WO2023197229 A1 WO 2023197229A1 CN 2022086725 W CN2022086725 W CN 2022086725W WO 2023197229 A1 WO2023197229 A1 WO 2023197229A1
Authority
WO
WIPO (PCT)
Prior art keywords
current block
adjacent
block
samples
sample
Prior art date
Application number
PCT/CN2022/086725
Other languages
English (en)
French (fr)
Inventor
谢志煌
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/086725 priority Critical patent/WO2023197229A1/zh
Publication of WO2023197229A1 publication Critical patent/WO2023197229A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • the present application relates to the technical field of video coding and decoding, and in particular to a video coding and decoding method, device, equipment, system and storage medium.
  • Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers, or video players.
  • video data includes a larger amount of data.
  • video devices implement video compression technology to make the video data more efficiently transmitted or stored.
  • the obtained prediction values can be Illumination compensation to fit the illumination changes between the current frame and the reference image to reduce redundancy.
  • Embodiments of the present application provide a video encoding and decoding method, device, equipment, system and storage medium to improve the illumination compensation effect and improve the prediction effect of the current block.
  • this application provides a video decoding method, including:
  • the reconstructed sample mode is one of N candidate modes.
  • the N candidate modes include an upper reconstruction sample mode, a left reconstruction sample mode, an upper side and a left reconstruction sample mode. at least one of;
  • embodiments of the present application provide a video encoding method, including:
  • the reconstructed sample mode is one of N candidate modes.
  • the N candidate modes include an upper reconstruction sample mode, a left reconstruction sample mode, an upper side and a left reconstruction sample mode. at least one of;
  • a second predicted value of the current block is determined, and the second predicted value is obtained by performing illumination compensation on the first predicted value by the reconstructed sample mode of the current block.
  • the present application provides a video encoder for performing the method in the above first aspect or its respective implementations.
  • the encoder includes a functional unit for performing the method in the above-mentioned first aspect or its respective implementations.
  • the present application provides a video decoder for performing the method in the above second aspect or various implementations thereof.
  • the decoder includes a functional unit for performing the method in the above-mentioned second aspect or its respective implementations.
  • a video encoder including a processor and a memory.
  • the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the above first aspect or its respective implementations.
  • a sixth aspect provides a video decoder, including a processor and a memory.
  • the memory is used to store a computer program
  • the processor is used to call and run the computer program stored in the memory to execute the method in the above second aspect or its respective implementations.
  • a seventh aspect provides a video encoding and decoding system, including a video encoder and a video decoder.
  • the video encoder is used to perform the method in the above-mentioned first aspect or its various implementations
  • the video decoder is used to perform the method in the above-mentioned second aspect or its various implementations.
  • An eighth aspect provides a chip for implementing any one of the above-mentioned first to second aspects or the method in each implementation manner thereof.
  • the chip includes: a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes any one of the above-mentioned first to second aspects or implementations thereof. method.
  • a ninth aspect provides a computer-readable storage medium for storing a computer program that causes a computer to execute any one of the above-mentioned first to second aspects or the method in each implementation thereof.
  • a computer program product including computer program instructions, which enable a computer to execute any one of the above-mentioned first to second aspects or the methods in each implementation thereof.
  • An eleventh aspect provides a computer program that, when run on a computer, causes the computer to execute any one of the above-mentioned first to second aspects or the method in each implementation thereof.
  • a twelfth aspect provides a code stream, including a code stream generated by any aspect of the second aspect.
  • the reconstruction sample mode of the current block determined by this application can be one of the upper reconstruction sample mode, the left reconstruction sample mode, the upper and left reconstruction sample modes, which not only enriches the selection mode of the reconstruction sample , and the reconstruction sample pattern that is adapted to the characteristic information of the current block can be accurately determined from the above patterns.
  • the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be obtained more accurately.
  • Reconstruct the sample determine the linear transformation parameters based on the accurately determined adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linearly transform the first predicted value of the current block according to the linear transformation parameters to obtain the accurate first predicted value.
  • the second prediction value improves the illumination compensation effect of the current block and improves the prediction effect of the current block.
  • Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application
  • Figure 2 is a schematic block diagram of a video encoder provided by an embodiment of the present application.
  • Figure 3 is a schematic block diagram of a decoding framework provided by an embodiment of the present application.
  • Figure 4A and Figure 4B are schematic diagrams of illumination of two images
  • Figure 5 is a schematic diagram of the principle of illumination compensation technology involved in the embodiment of the present application.
  • Figure 6 is an example diagram of a reconstructed sample involved in the embodiment of the present application.
  • Figure 7 is a schematic flow chart of a video decoding method provided by an embodiment of the present application.
  • Figure 8A and Figure 8B are an example diagram of the left adjacent sample involved in the embodiment of the present application.
  • Figure 9A and Figure 9B are an example diagram of an upper adjacent sample involved in the embodiment of the present application.
  • Figure 10 is a schematic flow chart of a video encoding method provided by an embodiment of the present application.
  • Figure 11 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
  • Figure 12 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
  • Figure 13 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
  • Figure 14 is a schematic block diagram of a video encoding system provided by an embodiment of the present application.
  • This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc.
  • the solution of this application can be operated in conjunction with other proprietary or industry standards, including ITU-TH.261, ISO/IECMPEG-1Visual, ITU-TH.262 or ISO/IECMPEG-2Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including scalable video codec (SVC) and multi-view video codec (MVC) extensions.
  • SVC scalable video codec
  • MVC multi-view video codec
  • FIG. 1 For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG. 1 .
  • Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application. It should be noted that Figure 1 is only an example, and the video encoding and decoding system in the embodiment of the present application includes but is not limited to what is shown in Figure 1 .
  • the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120 .
  • the encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device.
  • the decoding device decodes the code stream generated by the encoding device to obtain decoded video data.
  • the encoding device 110 in the embodiment of the present application can be understood as a device with a video encoding function
  • the decoding device 120 can be understood as a device with a video decoding function. That is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120. Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, and the like.
  • the encoding device 110 may transmit the encoded video data (eg, code stream) to the decoding device 120 via the channel 130 .
  • Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
  • channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real time.
  • encoding device 110 may modulate the encoded video data according to the communication standard and transmit the modulated video data to decoding device 120.
  • the communication media includes wireless communication media, such as radio frequency spectrum.
  • the communication media may also include wired communication media, such as one or more physical transmission lines.
  • channel 130 includes a storage medium that can store video data encoded by encoding device 110 .
  • Storage media include a variety of local access data storage media, such as optical disks, DVDs, flash memories, etc.
  • the decoding device 120 may obtain the encoded video data from the storage medium.
  • channel 130 may include a storage server that may store video data encoded by encoding device 110 .
  • the decoding device 120 may download the stored encoded video data from the storage server.
  • the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a File Transfer Protocol (FTP) server, etc.
  • FTP File Transfer Protocol
  • the encoding device 110 includes a video encoder 112 and an output interface 113.
  • the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
  • the encoding device 110 may include a video source 111 in addition to the video encoder 112 and the input interface 113 .
  • Video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface for receiving video data from a video content provider, a computer graphics system Used to generate video data.
  • a video capture device eg, a video camera
  • a video archive e.g., a video archive
  • video input interface for receiving video data from a video content provider
  • computer graphics system Used to generate video data.
  • the video encoder 112 encodes the video data from the video source 111 to generate a code stream.
  • Video data may include one or more images (pictures) or sequence of pictures (sequence of pictures).
  • the code stream contains the encoding information of an image or image sequence in the form of a bit stream.
  • Encoded information may include encoded image data and associated data.
  • the associated data may include sequence parameter set (SPS), picture parameter set (PPS) and other syntax structures.
  • SPS sequence parameter set
  • PPS picture parameter set
  • An SPS can contain parameters that apply to one or more sequences.
  • a PPS can contain parameters that apply to one or more images.
  • a syntax structure refers to a collection of zero or more syntax elements arranged in a specified order in a code stream.
  • the video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113 .
  • the encoded video data can also be stored on a storage medium or storage server for subsequent reading by the decoding device 120 .
  • decoding device 120 includes input interface 121 and video decoder 122.
  • the decoding device 120 may also include a display device 123.
  • the input interface 121 includes a receiver and/or a modem. Input interface 121 may receive encoded video data over channel 130.
  • the video decoder 122 is used to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .
  • the display device 123 displays the decoded video data.
  • Display device 123 may be integrated with decoding device 120 or external to decoding device 120 .
  • 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.
  • LCD liquid crystal display
  • plasma display a plasma display
  • OLED organic light emitting diode
  • Figure 1 is only an example, and the technical solution of the embodiment of the present application is not limited to Figure 1.
  • the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.
  • FIG. 2 is a schematic block diagram of a video encoder provided by an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression of images (lossy compression), or can also be used to perform lossless compression (lossless compression) of images.
  • the lossless compression can be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
  • the video encoder 200 can be applied to image data in a luminance-chrominance (YCbCr, YUV) format.
  • YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents brightness (Luma), Cb(U) represents blue chroma, Cr(V) represents red chroma, U and V represent Chroma, which is used to describe color and saturation.
  • 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr)
  • 4:2:2 means that every 4 pixels have 4 luminance components and 4 Chroma component (YYYYCbCrCbCr)
  • 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
  • the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (coding tree units, CTU).
  • CTB may be called “Tree block", “Largest Coding unit” (LCU for short) or “coding tree block” (CTB for short).
  • LCU Large Coding unit
  • CTB coding tree block
  • Each CTU can be associated with an equal-sized block of pixels within the image.
  • Each pixel can correspond to one luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU can be associated with one block of luma samples and two blocks of chroma samples.
  • a CTU size is, for example, 128 ⁇ 128, 64 ⁇ 64, 32 ⁇ 32, etc.
  • a CTU can be further divided into several coding units (Coding Units, CUs) for encoding.
  • CUs can be rectangular blocks or square blocks.
  • CU can be further divided into prediction unit (PU for short) and transform unit (TU for short), thus enabling coding, prediction, and transformation to be separated and processing more flexible.
  • the CTU is divided into CUs in a quad-tree manner, and the CU is divided into TUs and PUs in a quad-tree manner.
  • Video encoders and video decoders can support various PU sizes. Assuming that the size of a specific CU is 2N ⁇ 2N, the video encoder and video decoder can support a PU size of 2N ⁇ 2N or N ⁇ N for intra prediction, and support 2N ⁇ 2N, 2N ⁇ N, N ⁇ 2N, N ⁇ N or similar sized symmetric PU for inter prediction. The video encoder and video decoder can also support 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N and nR ⁇ 2N asymmetric PUs for inter prediction.
  • 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, and a loop filter unit. 260. Decode the image cache 270 and the entropy encoding unit 280. It should be noted that the video encoder 200 may include more, less, or different functional components.
  • the current block may be called the current coding unit (CU) or the current prediction unit (PU), etc.
  • the prediction block may also be called a predicted image block or an image prediction block
  • the reconstructed image block may also be called a reconstruction block or an image reconstructed image block.
  • prediction unit 210 includes inter prediction unit 211 and intra prediction unit 212. Since there is a strong correlation between adjacent pixels in a video frame, the intra-frame prediction method is used in video encoding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in the video, the interframe prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving coding efficiency.
  • the inter prediction unit 211 may be used for inter prediction, which includes motion estimation and motion compensation.
  • Inter-frame prediction can refer to the image information of different frames.
  • Inter-frame prediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks to eliminate temporal redundancy.
  • the frames used in inter-frame prediction can be P frames. and/or B-frames, P-frames refer to forward-predicted frames, and B-frames refer to bi-directional predicted frames.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be in whole pixels or sub-pixels. If the motion vector is in sub-pixels, then interpolation filtering needs to be used in the reference frame to make the required sub-pixel blocks.
  • the reference frame found based on the motion vector is A block of whole pixels or sub-pixels is called a reference block.
  • Some technologies will directly use the reference block as a prediction block, and some technologies will process the reference block to generate a prediction block. Reprocessing to generate a prediction block based on a reference block can also be understood as using the reference block as a prediction block and then processing to generate a new prediction block based on the prediction block.
  • the intra prediction unit 212 only refers to the information of the same frame image and predicts the pixel information in the current coded image block to eliminate spatial redundancy.
  • the frames used in intra prediction may be I frames.
  • the white 4 ⁇ 4 block is the current block
  • the gray pixels in the left row and the upper column of the current block are the reference pixels of the current block.
  • Intra-frame prediction uses these reference pixels to predict the current block.
  • These reference pixels may all be available, that is, all of them may have been encoded and decoded. There may also be some parts that are unavailable. For example, if the current block is the leftmost part of the entire frame, then the reference pixel on the left side of the current block is unavailable.
  • the lower left part of the current block has not been encoded or decoded, so the reference pixels in the lower left are also unavailable.
  • the available reference pixels or certain values or certain methods can be used for filling, or no filling can be performed.
  • the intra prediction method also includes a multiple reference line intra prediction method (multiple reference line, MRL).
  • MRL can use more reference pixels to improve coding efficiency.
  • mode 0 is to copy the pixels above the current block in the vertical direction to the current block as the prediction value
  • mode 1 is to copy the reference pixel on the left to the current block in the horizontal direction as the prediction value
  • mode 2 is to copy A ⁇
  • the average value of the eight points D and I ⁇ L is used as the predicted value of all points.
  • Mode 3 to mode 8 copy the reference pixel to the corresponding position of the current block at a certain angle. Because some positions of the current block cannot exactly correspond to the reference pixels, it may be necessary to use the weighted average of the reference pixels, or the sub-pixels of the interpolated reference pixels.
  • the intra-frame prediction modes used by HEVC include planar mode (Planar), DC and 33 angle modes, for a total of 35 prediction modes.
  • the intra-frame modes used by VVC include Planar, DC and 65 angle modes, for a total of 67 prediction modes.
  • the intra-frame modes used by AVS3 include DC, Plane, Bilinear and 63 angle modes, for a total of 66 prediction modes.
  • Residual unit 220 may generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block of a CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the PU of the CU. Predict the corresponding sample in the block.
  • Transform/quantization unit 230 may quantize the transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with the TU of the CU based on quantization parameter (QP) values associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
  • QP quantization parameter
  • Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct the residual block from the quantized transform coefficients.
  • Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing blocks of samples for each TU of a CU in this manner, video encoder 200 can reconstruct blocks of pixels of the CU.
  • Loop filtering unit 260 may perform deblocking filtering operations to reduce blocking artifacts for blocks of pixels associated with the CU.
  • the loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, and an adaptive loop filtering ALF unit.
  • Decoded image cache 270 may store reconstructed pixel blocks.
  • Inter prediction unit 211 may perform inter prediction on PUs of other images using reference images containing reconstructed pixel blocks.
  • intra prediction unit 212 may use the reconstructed pixel blocks in decoded image cache 270 to perform intra prediction on other PUs in the same image as the CU.
  • Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
  • the basic process of video encoding involved in this application is as follows: at the encoding end, the current image is divided into blocks, and for the current block, the prediction unit 210 uses intra prediction or inter prediction to generate a prediction block of the current block.
  • the residual unit 220 may calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block.
  • the residual block may also be called residual information.
  • the residual block undergoes transformation and quantization processes such as transformation/quantization unit 230 to remove information that is insensitive to human eyes to eliminate visual redundancy.
  • the residual block before transformation and quantization by the transformation/quantization unit 230 may be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation/quantization unit 230 may be called a frequency residual block. or frequency domain residual block.
  • the entropy encoding unit 280 receives the quantized transform coefficients output by the transform and quantization unit 230, and may perform entropy encoding on the quantized transform coefficients to output a code stream. For example, the entropy encoding unit 280 may eliminate character redundancy according to the target context model and probability information of the binary code stream.
  • the video encoder performs inverse quantization and inverse transformation on the quantized transform coefficients output by the transform and quantization unit 230 to obtain the residual block of the current block, and then adds the residual block of the current block and the prediction block of the current block, Get the reconstructed block of the current block.
  • reconstruction blocks corresponding to other image blocks in the current image can be obtained, and these reconstruction blocks are spliced to obtain a reconstructed image of the current image. Since errors are introduced during the encoding process, in order to reduce the error, the reconstructed image is filtered.
  • ALF is used to filter the reconstructed image to reduce the difference between the pixel value of the pixel in the reconstructed image and the original pixel value of the pixel in the current image. difference.
  • the filtered reconstructed image is stored in the decoded image cache 270 and can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the block division information determined by the encoding end as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the code stream when necessary.
  • the decoding end determines the same block division information as the encoding end by parsing the code stream and analyzing the existing information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information, thereby ensuring the decoded image obtained by the encoding end It is the same as the decoded image obtained by the decoding end.
  • Figure 3 is a schematic block diagram of a video decoder provided by an embodiment of the present application.
  • the video decoder 300 includes an entropy decoding unit 310 , a prediction unit 320 , an inverse quantization/transformation unit 330 , a reconstruction unit 340 , a loop filtering unit 350 and a decoded image cache 360 . It should be noted that the video decoder 300 may include more, less, or different functional components.
  • Video decoder 300 can receive the code stream.
  • Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the code stream, the entropy decoding unit 310 may parse entropy-encoded syntax elements in the code stream.
  • the prediction unit 320, the inverse quantization/transformation unit 330, the reconstruction unit 340 and the loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, that is, generate decoded video data.
  • prediction unit 320 includes inter prediction unit 321 and intra prediction unit 322.
  • Inter prediction unit 321 may perform intra prediction to generate predicted blocks for the PU. Inter prediction unit 321 may use an intra prediction mode to generate predicted blocks for a PU based on pixel blocks of spatially neighboring PUs. Inter prediction unit 321 may also determine the intra prediction mode of the PU based on one or more syntax elements parsed from the codestream.
  • Intra prediction unit 322 may construct a first reference image list (List 0) and a second reference image list (List 1) based on syntax elements parsed from the codestream. Additionally, if the PU uses inter-prediction encoding, entropy decoding unit 310 may parse the motion information of the PU. Intra-prediction unit 322 may determine one or more reference blocks for the PU based on the motion information of the PU. Intra-prediction unit 322 may generate a predicted block for the PU based on one or more reference blocks of the PU.
  • Inverse quantization/transform unit 330 may inversely quantize (ie, dequantize) transform coefficients associated with a TU. Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
  • inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to produce a residual block associated with the TU.
  • Reconstruction unit 340 uses the residual blocks associated with the TU of the CU and the prediction blocks of the PU of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
  • Loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for blocks of pixels associated with the CU.
  • the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, and an adaptive loop filtering ALF unit.
  • Video decoder 300 may store the reconstructed image of the CU in decoded image cache 360 .
  • the video decoder 300 may use the reconstructed image in the decoded image cache 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
  • the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block.
  • the prediction unit 320 uses intra prediction or inter prediction for the current block based on the prediction information to generate the current block.
  • the inverse quantization/transform unit 330 uses the quantization coefficient matrix obtained from the code stream to perform inverse quantization and inverse transformation on the quantization coefficient matrix to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstruction block.
  • the reconstructed blocks constitute a reconstructed image
  • the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain a decoded image.
  • the decoded image can also be called a reconstructed image.
  • the reconstructed image can be displayed by the display device, and on the other hand, it can be stored in the decoded image buffer 360 and used as a reference frame for inter-frame prediction for subsequent frames.
  • ECM Enhanced Compression Model
  • the technical solution provided by the embodiment of the present application can be understood as an improvement on the ECM reference software in order to obtain higher coding efficiency.
  • LIC Local Illuminance Compensation
  • the local illumination compensation technology is simply referred to as illumination compensation.
  • Illumination compensation technology is an inter-frame coding technology.
  • the current coding unit obtains the corresponding reference block based on the motion vector MV information, and this reference block usually comes from different coding frames, or the reference coding unit does not Belongs to the current image. Images in different frames have large or small changes in some specific scenes, and lighting compensation technology is very effective in processing some of these changes.
  • Figure 4A and Figure 4B the texture information in Figure 4A and Figure 4B is basically the same, and the difference lies in the brightness change between the two. Because 4B is illuminated by the camera's flash and appears very bright, Figure 4A shows normal natural light. There is a difference between the two, and this difference brings a huge burden in video encoding. Assume that Figure 4A uses Figure 4B as the reference coding unit. The texture information of the two is the same, so the difference in texture details is very small, but the overall residual is very large. This is because the pixels in Figure 4B have been shifted as a whole due to the effect of the flash, and the residuals between the two include this part of the shift. If this part of the residual is directly transformed and quantized and then written into the code stream, the overhead of this part will be huge.
  • the illumination compensation technology in the ECM reference software uses linear fitting to eliminate the above-mentioned illumination changes, such as those caused by flash or illumination changes, making the overall prediction effect better.
  • the main parts of the illumination compensation technique are as follows:
  • the correlation between the reconstructed samples in the adjacent parts of the reference coding unit (also known as the reference block) and the current coding unit (also known as the current block) is used to fit the correlation between the changes in the internal prediction samples of the current coding unit and the reference samples. sex. Because the adjacent upper and left reconstructed samples of the current coding unit can be obtained if they exist, and the adjacent upper and left reconstructed samples of the reference coding unit in the reference image can also be obtained.
  • the corresponding fitting model can be obtained by modeling the reconstructed samples of the current frame and the reconstructed samples of the reference image.
  • ECM's illumination compensation adopts a linear fitting method.
  • the model is simplified to consist of a scaling parameter a and an offset parameter b, which can fit the illumination changes between the current frame and the reference image.
  • the change relationship is expressed as formula (1):
  • Pred(x,y) is the prediction block before lighting compensation
  • Pred'(x,y) is the prediction block after lighting compensation
  • a is the scaling parameter in the lighting compensation model
  • b is the scaling parameter in the lighting compensation model. offset parameter.
  • Both a and b in the formula need to be calculated through the image information of the current frame and the image information of the reference frame, by constructing the reconstructed samples adjacent to the current block space and the samples adjacent to the reconstructed block in the corresponding reference frame.
  • the module is obtained, and the derivation process is as shown in formula (2):
  • Curr_Rec neigh a ⁇ Ref_Rec neigh +b (2)
  • Curr_Rec neigh is the reconstructed image of the current frame
  • Ref_Rec neigh is the reconstructed image of the reference frame.
  • the encoding block of the current frame is corrected for the illumination difference through the illumination compensation model, and the compensated prediction block is obtained, as shown in Figure 5.
  • the calculation of the above scaling parameter a and offset parameter b requires the use of adjacent reconstructed samples corresponding to the reference block in the reference frame and adjacent reconstructed samples of the coding block in the current frame. According to the adjacent reconstructed samples of the coding unit of the current frame and the adjacent reconstructed samples in the reference frame. The correlation between adjacent reconstructed samples of the reference block at the corresponding position is modeled and solved, as shown in Figure 6.
  • Reconstructed pixels are all the most adjacent reconstructed samples of CU.
  • Reference picture CU is the corresponding reconstructed CU in the reference frame, also called reference CU or reference block
  • Current picture CU is the corresponding reconstructed CU in the current encoding frame.
  • the CU to be encoded also called the current CU or current block.
  • the illumination compensation model is a linear model in ECM.
  • the model parameters include the scaling factor a and the offset parameter b. Optional, both are obtained by the least square method (Least Square Error).
  • the number of reconstruction samples is set according to the width and height of the current coding unit. In some embodiments, if the width and height of the current coding unit are equal to 4, they are reconstructed from the upper and left adjacent sides of the coding unit. Four reconstruction samples are taken from each sample. For example, the width of the current coding unit is 16 and the height is 4. Then all 4 reconstructed samples are taken from the adjacent reconstruction samples on the left side, and 4 reconstructed samples are taken from the adjacent reconstruction samples from the upper side with a step size of 3. If the width and height of the current coding unit are not equal to 4, logarithmic samples with a smaller side length of 2 are obtained from the adjacent reconstructed samples on the upper and left sides.
  • the model parameters are calculated after the upper and left reconstructed samples are obtained. Assume that the obtained reference reconstruction sample is recorded as The sum of the multiplications of the reference reconstruction sample and the current reconstruction sample is recorded as sumXY, and the parameters a and b are calculated according to the following formula (3) and formula (4):
  • sumXsumY is sumX multiplied by sumY.
  • the final prediction block is obtained by performing linear transformation on the prediction block after motion compensation.
  • the illumination compensation technology in ECM can be used in ordinary inter prediction, merged prediction mode and sub-block mode, where ordinary inter prediction is the inter mode, the merged prediction mode is the merged prediction technology Merge mode, and the sub-block mode Block mode is affine mode.
  • illumination compensation technology only works in single-frame prediction mode, and is prohibited from being used in multi-frame bidirectional reference mode.
  • the illumination compensation technology in ECM has a coupling relationship with the adopted technology.
  • the illumination compensation technology is not coupled with bi-directional optical flow technology (Bi-directional optical flow, BDOF) and symmetric motion vector difference technology (symmetric MVD mode, SMVD) and so on.
  • the illumination compensation technology described in the above embodiment determines parameters a and b, if both the upper reconstruction sample and the left reference sample are available, the upper and left reconstruction samples of the current block and the reference block are selected.
  • the embodiment of the present application adds a reconstruction sample selection method, that is, adds a reconstruction sample mode, for example, a left reconstruction sample mode and/or an upper reconstruction sample mode is added, wherein the reconstruction in the left reconstruction sample mode
  • the samples are all from the left adjacent samples of the image block
  • the reconstructed samples in the upper reconstruction sample mode are all from the upper adjacent samples of the image block.
  • FIG. 7 is a schematic 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 FIGS. 1 and 3 .
  • the method in the embodiment of this application includes:
  • S401 Decode the code stream and predict the current block to obtain the first prediction value of the current block.
  • the decoding end decodes the code stream, determines the prediction mode corresponding to the current block, predicts the current block according to the prediction mode, and obtains the prediction value of the current block. Since the embodiment of the present application performs a step on the prediction value obtained in this step Illumination compensation is used to obtain a new predicted value. Therefore, for the convenience of description, in this embodiment of the present application, the predicted value obtained according to the prediction mode is recorded as the first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as the third predicted value. 2 predicted values.
  • This embodiment of the present application does not place any restrictions on the prediction method of the current block.
  • the inter prediction mode is used to predict the current block to obtain the first prediction value of the current block.
  • the code stream is decoded to obtain motion information corresponding to the current block
  • the reference block is found from the reference frame based on the motion information
  • the first predicted value of the current block is generated based on the reference block.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be a whole sample or a sub-sample. If the motion vector is a sub-sample, then interpolation filtering needs to be used in the reference frame to make the required sub-sample block.
  • the reference frame found based on the motion vector is The whole sample or the block of sub-samples is called the reference block.
  • the reference block is directly used as the prediction block, and in some embodiments, the prediction block is generated based on the reference block.
  • the reconstructed sample mode is one of N candidate modes, and 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.
  • the above-mentioned S402 can be executed before the above-mentioned S401, or after the above-mentioned S401, or executed synchronously with the above-mentioned S401.
  • This embodiment of the present application has No restrictions.
  • illumination compensation is performed on the obtained first predicted value to obtain the second predicted value.
  • the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined.
  • the adjacent reconstructed samples and the adjacent reconstructed samples of the reference block are used to determine linear transformation parameters, and the first predicted value is linearly transformed according to the linear transformation parameters to obtain the second predicted value of the current block.
  • embodiments of the present application add several new ways of determining reconstruction samples, such as adding an upper reconstruction sample mode and/or a left reconstruction sample mode.
  • the left reconstruction sample mode means that the samples in the adjacent reconstruction samples of the current block are all from the left adjacent reconstruction samples of the current block, and the samples in the adjacent reconstruction samples of the reference block are all from the left adjacent of the reference block. Reconstruct the sample.
  • the upper reconstruction sample mode means that the reconstructed samples in the adjacent reconstruction samples of the current block are all from the upper adjacent reconstruction samples of the current block, and the reconstructed samples in the adjacent reconstruction samples of the reference block are all from the upper side of the reference block. Adjacent reconstructed samples.
  • the upper and left reconstruction sample modes mean that the reconstructed samples in the adjacent reconstruction samples of the current block are all from the upper and left adjacent reconstruction samples of the current block, and the reconstructed samples in the adjacent reconstruction samples of the reference block are all from Upper and left adjacent reconstructed samples from the reference block.
  • the decoder first determines the reconstructed sample mode of the current block.
  • the reconstructed sample mode of the current block can be one of N candidate modes, and the N candidate modes include the upper reconstructed sample mode, the left reconstructed sample mode, and the upper reconstructed sample mode. At least one of a sample mode, an upper side and a left reconstructed sample mode. That is to say, in this embodiment of the present application, the reconstruction sample mode of the current block can be one of the upper reconstruction sample mode, the left reconstruction sample mode, the upper and left reconstruction sample modes, which not only enriches the selection of reconstruction samples mode, and the reconstruction sample mode that adapts to the characteristic information of the current block can be accurately determined from the above modes.
  • the adjacent reconstruction samples and reference of the current block can be determined more accurately.
  • the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and the first predicted value of the current block is linearly transformed according to the linear transformation parameters to obtain The accurate second prediction value thereby improves the illumination compensation effect of the current block and improves the prediction effect of the current block.
  • the ways in which the decoder determines the reconstructed sample mode of the current block include but are not limited to the following:
  • Method 1 Use the index to indicate the reconstruction sample mode of the current block.
  • the above S402 includes the following steps of S402-A1 and S402-A2:
  • S402-A2 Determine the reconstructed sample mode of the current block according to the first index corresponding to the current block.
  • the first index is used to indicate the reconstructed sample mode of the current block.
  • the decoder determines the reconstructed sample mode of the current block, it first determines the first index, and then determines the reconstructed sample mode of the current block based on the first index. .
  • N candidate patterns are shown in Table 1:
  • index candidate pattern 0 Upper side reconstructed sample pattern 1 Reconstructed sample pattern on the left 2 Upper and left reconstructed sample patterns ... ...
  • the embodiment of the present application does not limit the specific modes and the number of modes of the N candidate modes.
  • the N candidate modes include an upper reconstruction sample mode, a left reconstruction sample mode, and
  • the upper and left reconstructed sample patterns have an index of 0, the index of the left reconstructed sample pattern is 1, and the index of the upper and left reconstructed sample patterns is 2.
  • the indexes corresponding to each mode shown in Table 1 are only an example, and the present application is not limited thereto.
  • each candidate mode corresponds to an index, so that when the decoder determines the reconstructed sample mode of the current block, it can determine the first index, and determine the reconstructed sample mode of the current block based on the first index, for example, the first The index is 1.
  • index 1 corresponds to the left reconstructed sample mode, so that the decoder determines that the reconstructed sample mode of the current block is the left reconstructed sample mode.
  • the method of determining the first index corresponding to the current block includes but is not limited to the following:
  • Method 1 decode the code stream to obtain the first index corresponding to the current block.
  • the encoding end selects a mode from N candidate modes, for example, selects a 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 code stream.
  • the decoder decodes the code stream to obtain the first index, and then determines the reconstructed sample mode of the current block based on the first index.
  • the decoding end can directly obtain the first index from the code stream, and the calculation process is simple, which reduces the decoding complexity of the decoding end and improves the decoding efficiency of the decoding end.
  • Method 2 if the prediction mode of the current block is Merge mode, the decoder determines the first index through the following steps S402-A1-11 and S402-A1-12:
  • S402-A1-11 Determine the first flag of the adjacent block of the current block.
  • the first flag of the adjacent block is used to indicate whether the adjacent block uses local illumination compensation technology;
  • the decoder can determine the first index based on the relevant decoding information of adjacent blocks of the current block.
  • the adjacent blocks of the current block are decoded blocks, and the relevant decoding information of the adjacent blocks is known.
  • the decoding end can obtain the decoding information of the adjacent blocks from the adjacent blocks.
  • the adjacent blocks of the current block may be the upper adjacent blocks of the current block.
  • the adjacent block of the current block may also be the left adjacent block of the current block.
  • the illumination compensation technology proposed in the embodiments of this application is called illumination compensation technology.
  • the decoder determines whether the current block uses the illumination compensation technology based on whether the adjacent blocks of the current block use this illumination compensation technology. For example, if the adjacent block uses lighting compensation technology, it is determined that the current block also uses lighting compensation technology.
  • the decoding end obtains the first flag of the neighboring block from the neighboring block.
  • the first flag of the neighboring block is used to indicate whether the neighboring block uses illumination compensation technology, and according to the first flag of the neighboring block, Determine the first index.
  • the embodiment of the present application does not limit the method of determining the first index according to the first flag of the adjacent block in S402-A1-12.
  • the first index is determined to be the default index, and the default index is used to indicate the upper and left reconstruction sample modes. . That is to say, in this implementation, if the prediction mode of the current block is Merge mode, and the adjacent blocks of the current block adopt illumination compensation technology, the upper and left reconstruction sample modes are used to predict the first prediction value of the current block. Perform illumination compensation to obtain the second predicted value of the current block.
  • the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology
  • determine a second index and the second index is used to indicate the reconstructed sample pattern of the adjacent block; Determine the second index as the first index.
  • the prediction mode of the current block is Merge mode, and the adjacent blocks of the current block adopt illumination compensation technology, the current block not only inherits the flag of the adjacent block, but also inherits the index of the adjacent block, then the adjacent block will be The second index corresponding to the block is determined as the first index of the current block.
  • the current block does not use the illumination compensation extension scheme provided by the embodiment of the present application, but uses the same as the adjacent block.
  • Perform illumination compensation using the same illumination compensation method for the block For example, use the upper 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. Alternatively, illumination compensation is not performed on the first predicted value of the current block.
  • Method 3 if the prediction mode of the current block is non-Merge mode, the decoder determines the first index through the following steps S402-A1-21 to S402-A1-23:
  • S402-A1-2 Determine the first flag of the current block.
  • the first flag of the current block is used to indicate whether the current block uses illumination compensation technology
  • the second flag of the current block is used to indicate whether the current block uses illumination compensation expansion technology
  • the first flag of the current block when the first flag of the current block is 1, it indicates that the current block uses illumination compensation technology. If the first flag of the current block is 0, it indicates that the current block does not use illumination compensation technology.
  • the decoder determines the first predicted value as the second predicted value, or uses other methods to The first predicted value is processed to obtain the second predicted value.
  • the decoder determines the second flag of the current block, and the second flag of the current block is used to indicate the current block. Whether the block uses this application's lighting compensation extension technology.
  • the second flag of the current block when the second flag of the current block is 1, it indicates that the current block uses the illumination compensation expansion technology. If the second flag of the current block is 0, it indicates that the current block does not use the illumination compensation expansion technology.
  • the decoding end may determine the first index according to the second flag of the current block.
  • the first index is obtained by decoding the code stream.
  • the first index is determined to be a default index, and the default index is used to indicate the upper and left reconstruction sample modes.
  • the decoding end decodes the code stream to obtain the first flag of the current block. That is to say, the encoding end determines the first flag of the current block corresponding to the current block and writes the first flag of the current block into Code stream, the decoder can directly decode to obtain the first flag of the current block.
  • the decoding end decodes the code stream and obtains the second flag of the current block. That is to say, the encoding end determines the second flag of the current block and writes the second flag of the current block into the code stream.
  • the decoding end The second flag of the current block can be directly decoded.
  • the above-mentioned first flag includes at least one of a sequence-level flag, an image-level flag, and a block-level flag.
  • the above-mentioned first flag includes a sequence-level flag, which is used to indicate whether the current sequence uses illumination compensation technology.
  • sps_lic_enable_flag can be used to represent the sequence-level flag.
  • sequence-level flags can be located in the sequence header.
  • the above-mentioned first flag includes an image-level flag, which is used to indicate whether the current image uses illumination compensation technology.
  • ph_lic_enable_flag can be used to represent an image-level flag.
  • the image-level flag can be located in the picture header.
  • the above-mentioned first flag includes a block-level flag, which is used to indicate whether the image block uses illumination compensation technology.
  • lic_flag can be used to represent block-level flags.
  • the above-mentioned first flag may also include a slice-level flag, a unit-level flag, etc.
  • the second flag includes a block-level flag.
  • syntax lic_ext can be used to represent the second flag.
  • lic_ext As an example, if the lic_ext is 1, it is determined that the current block does not use the lighting compensation extension technology proposed by this application. If lic_ext is 0, it is determined that the current block uses the lighting compensation extension technology proposed by this application.
  • the encoding unit level syntax is shown in Table 2:
  • the decoder determines the reconstruction sample mode of the current block according to the first index, and determines the adjacent reconstruction samples of the current block and the adjacent reconstruction of the reference block based on the reconstruction sample mode.
  • Sample determine the linear transformation parameters according to the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block, and linearly transform the first predicted value of the current block according to the linear transformation parameters to obtain the second predicted value of the current block, Implement accurate lighting compensation for the current block.
  • the decoder can also use the following method two to determine the reconstructed sample mode of the current block.
  • Method 2 If the prediction mode of the current block is the Merge mode, the reconstructed sample mode of the current block is determined based on the decoding information of adjacent blocks of the current block.
  • the above S402 includes the following steps of S402-B1 and S402-B2:
  • S402-B Determine the first flag of the neighboring block of the neighboring block of the current block.
  • the first flag of the neighboring block is used to indicate whether the neighboring block uses illumination compensation technology;
  • the decoder when the decoder determines that the prediction mode of the current block is the Merge mode, it directly determines the reconstructed sample mode of the current block based on the first flag of the adjacent block of the current block without determining the first index.
  • the process is simpler and more efficient.
  • the methods for determining the reconstructed sample mode of the current block based on the first flag of the adjacent block include but are not limited to the following:
  • Method 1 If the first flag of the adjacent block indicates that the adjacent block uses the illumination compensation technology, it is determined that the reconstruction sample mode of the current block is the upper and left reconstruction sample modes.
  • the decoder defaults the reconstruction sample mode of the current block to the upper and left reconstruction sample modes, and then directly The upper and left reconstructed sample modes are used to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value of the current block.
  • Method 2 If the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, determine the reconstructed sample mode of the adjacent block; determine the reconstructed sample mode of the adjacent block as the reconstructed sample mode of the current block.
  • the decoder determines the reconstructed sample mode of the adjacent block of the current block as the reconstructed sample mode of the current block. . Specifically, the decoding end obtains the reconstructed sample pattern of the adjacent block from the adjacent block, and uses the reconstructed sample pattern of the adjacent block to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value.
  • the way the decoder determines the reconstructed sample pattern of the adjacent block of the current block includes at least the following examples:
  • Example 1 The decoder directly obtains the reconstructed sample pattern of the adjacent block from the adjacent block.
  • Example 2 The decoding end obtains the second index from the adjacent block.
  • the second index is used to indicate the reconstructed sample mode of the adjacent block.
  • the decoding end determines the reconstructed sample mode of the adjacent block based on the second index, for example The second index is 0. As shown in Table 1, it is determined that the reconstructed sample mode of the adjacent block is the upper reconstructed sample mode.
  • the decoder directly determines the reconstructed sample mode of the current block based on the first flag and/or the first index of the adjacent block of the current block.
  • the decoding end After determining the reconstructed sample pattern of the current block according to the above-mentioned method 1 or 2, the decoding end performs the following steps of S403.
  • the adjacent reconstruction samples of the current block are reconstructed samples determined from the left and/or upper reconstruction samples of the current block according to the reconstruction sample pattern of the current block.
  • the adjacent reconstructed samples of the reference block are reconstructed samples determined from left and/or upper reconstruction samples of the reference block of the current block according to the reconstruction sample pattern of the current block.
  • the determined adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are also different.
  • the above S403 includes the following steps of S403-A:
  • S403-A Determine the adjacent reconstruction samples of the current block based on the left adjacent samples of the current block, and determine the adjacent reconstruction samples of the reference block based on the left adjacent samples of the reference block corresponding to the current block in the reference frame.
  • the adjacent reconstructed samples of the current block are determined from the left adjacent samples, where all the left adjacent samples are reconstructed samples. .
  • the adjacent reconstructed samples of the current block are determined according to the left adjacent samples of the current block.
  • the reference block of the current block is determined in the reference frame.
  • the adjacent reconstructed samples of the current block are determined according to the reference frame.
  • the adjacent samples on the left side of the reference block are determined to determine the adjacent reconstructed samples of the reference block.
  • linear transformation parameters are determined based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and the first predicted value of the current block is linearly transformed according to the linear transformation parameters to obtain the second predicted value of the current block.
  • the embodiment of the present application does not limit the specific method of determining the adjacent reconstructed sample of the current block based on the left adjacent sample of the current block in S403-A.
  • multiple reconstruction samples adjacent to the left side of the current block are determined as adjacent reconstruction samples of the current block.
  • the adjacent reconstructed samples of the current block are determined according to the height of the current block and the left adjacent sample of the current block.
  • Example 1 Determine the reconstructed samples on the left side of the current block that are adjacent to the current block and within the height range of the current block as adjacent reconstructed samples of the current block. For example, if the height of the current block is 4, then the four adjacent reconstruction samples on the left side of the current block are determined as the adjacent reconstruction samples of the current block.
  • Example 2 If the height of the current block is equal to the first numerical value, select the first numerical value samples from the left adjacent samples of the current block to determine the adjacent reconstructed samples of the current block.
  • the first value is 4, that is, if the height of the current block is equal to 4, then 4 samples are selected from the left adjacent samples of the current block and determined as adjacent reconstructed samples of the current block.
  • Example 2 If the height of the current block is not equal to the first value, select the second value samples from the left adjacent samples of the current block to determine the adjacent reconstructed samples of the current block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the third value is 2.
  • the second value is the value of log2 (height) and then the value is taken.
  • the decoder selects 5 samples from the 16 adjacent samples on the left side of the current block as adjacent reconstructed samples of the current block.
  • these five samples are selected with equal step size, or they can be selected randomly, and the embodiment of the present application does not limit this.
  • this embodiment of the present application does not limit the specific method of determining the adjacent reconstructed samples of the reference block based on the left adjacent samples of the reference block corresponding to the current block in the reference frame in S403-A.
  • multiple reconstruction samples adjacent to the left side of the reference block in the reference frame are determined as adjacent reconstruction samples of the reference block.
  • the adjacent reconstructed samples of the reference block are determined according to the height of the reference block and the left adjacent sample of the reference block.
  • Example 1 Determine the reconstructed samples on the left side of the reference block in the reference frame that are adjacent to the reference block and within the height range of the reference block as adjacent reconstructed samples of the reference block. For example, if the height of the reference block is 4, then the four reconstructed samples adjacent to the left side of the reference block in the reference frame are determined as adjacent reconstructed samples of the reference block.
  • Example 2 if the height of the reference block is equal to the first numerical value, interpolate the left adjacent samples of the reference block to obtain the first numerical value samples, which are used as adjacent reconstructed samples of the reference block.
  • the first value is 4, that is, if the height of the reference block is equal to 4, then the left adjacent samples of the reference block are interpolated to obtain 4 samples, which are determined as adjacent reconstructed samples of the reference block.
  • Example 2 If the height of the reference block is not equal to the first numerical value, the left adjacent samples of the reference block are interpolated to obtain the second numerical value of samples, which are used as adjacent reconstructed samples of the reference block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the third value is 2.
  • the second value is the value of log2 (height) and then the value is taken.
  • the second value is determined to be 5, and then the decoder interpolates the 16 adjacent samples on the left side of the reference block to obtain 5 samples, which are used as adjacent reconstructed samples of the reference block.
  • the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined according to any of the above methods, where the phase of the current block is determined.
  • the adjacent reconstructed samples 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.
  • the above S403 includes the following steps of S403-B:
  • S403-B Determine the adjacent reconstruction samples of the current block based on the upper adjacent samples of the current block, and determine the adjacent reconstruction samples of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference frame.
  • the adjacent reconstructed samples of the current block are determined from the upper adjacent samples, where all the upper adjacent samples are reconstructed samples. .
  • the adjacent reconstructed samples of the current block are determined based on the upper adjacent samples of the current block.
  • the reference block of the current block is determined in the reference frame.
  • the upper adjacent samples of the reference block are determined to determine the adjacent reconstructed samples of the reference block.
  • linear transformation parameters are determined based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and the first predicted value of the current block is linearly transformed according to the linear transformation parameters to obtain the second predicted value of the current block.
  • the embodiment of the present application does not limit the specific method of determining the adjacent reconstructed samples of the current block based on the upper adjacent samples of the current block in S403-B.
  • multiple reconstruction samples adjacent to the upper side of the current block are determined as adjacent reconstruction samples of the current block.
  • the adjacent reconstructed samples of the current block are determined according to the height of the current block and the upper adjacent samples of the current block.
  • Example 1 Determine the reconstructed samples whose upper side is adjacent to the current block and within the height range of the current block as adjacent reconstructed samples of the current block. For example, if the height of the current block is 4, then the four adjacent reconstruction samples on the upper side of the current block are determined as the adjacent reconstruction samples of the current block.
  • Example 2 If the height of the current block is equal to the first numerical value, select the first numerical value samples from the upper adjacent samples of the current block to determine the adjacent reconstructed samples of the current block.
  • the first value is 4, that is, if the height of the current block is equal to 4, then 4 samples are selected from upper adjacent samples of the current block and determined as adjacent reconstructed samples of the current block.
  • Example 2 If the height of the current block is not equal to the first numerical value, select the second numerical value samples from the upper adjacent samples of the current block to determine the adjacent reconstructed samples of the current block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the third value is 2.
  • the second value is the value of log2 (height) and then the value is taken.
  • the decoder selects 5 samples from the 16 adjacent samples on the upper side of the current block as adjacent reconstructed samples of the current block.
  • these five samples are selected with equal step size, or they can be selected randomly, and the embodiment of the present application does not limit this.
  • this embodiment of the present application does not limit the specific method of determining the adjacent reconstructed samples of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference frame in S403-B.
  • multiple reconstructed samples adjacent to the upper side of the reference block in the reference frame are determined as adjacent reconstructed samples of the reference block.
  • adjacent reconstructed samples of the reference block are determined according to the height of the reference block and upper adjacent samples of the reference block.
  • Example 1 Determine the reconstructed samples whose upper side of the reference block in the reference frame is adjacent to the reference block and within the height range of the reference block as adjacent reconstructed samples of the reference block. For example, if the height of the reference block is 4, then the four adjacent reconstructed samples on the upper side of the reference block in the reference frame are determined as adjacent reconstructed samples of the reference block.
  • Example 2 If the height of the reference block is equal to the first numerical value, the upper adjacent samples of the reference block are interpolated to obtain the first numerical value samples, which are used as adjacent reconstructed samples of the reference block.
  • the first value is 4, that is, if the height of the reference block is equal to 4, then the upper adjacent samples of the reference block are interpolated to obtain 4 samples, which are used as adjacent reconstructed samples of the reference block.
  • Example 2 If the height of the reference block is not equal to the first numerical value, the upper adjacent samples of the reference block are interpolated to obtain the second numerical value of samples, which are used as adjacent reconstructed samples of the reference block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the third value is 2.
  • the second value is the value of log2 (height) and then rounded.
  • the second value is determined to be 5, and then the decoding end interpolates the 16 adjacent samples on the upper side of the reference block to obtain 5 samples, which are used as adjacent reconstructed samples of the reference block.
  • the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block are determined according to any of the above methods, where the phase of the current block is determined.
  • the adjacent reconstructed samples 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.
  • the decoding end After determining the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block according to the above method, the decoding end performs the following S404.
  • S404 Determine linear transformation parameters based on adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block, and linearly transform the first prediction value according to the linear transformation parameters to obtain the second prediction value of the current block.
  • the embodiments of the present application do not limit the specific method of determining the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block.
  • determining the linear transformation parameters based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block includes the following steps:
  • S404-A2 Determine the offset parameter according to the adjacent reconstruction samples of the current block, the adjacent reconstruction samples of the reference block, and the scaling factor.
  • the embodiment of the present application does not limit the method of determining the scaling factor a based on the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block in S404-A1.
  • the scaling factor a is determined based on the ratio of the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block.
  • the scaling factor a is determined according to the above formula (3).
  • the embodiment of the present application does not limit the method of determining the offset parameter in S404-A2 based on the adjacent reconstruction samples of the current block, the adjacent reconstruction samples of the reference block, and the scaling factor.
  • the offset parameter b is determined according to the above formula (4).
  • the linear transformation parameters are used to linearly transform the first predicted value to obtain the second predicted value of the current block. For example, the product of the scaling factor and the first predicted value is determined; The sum with the offset parameter is determined as the second predicted value.
  • the second predicted value is determined according to the following formula (5):
  • P(x,y) is the prediction block before illumination compensation, that is, the first prediction value of the current block
  • P'(x,y) is the prediction block after illumination compensation, that is, the second prediction value of the current block.
  • a is the scaling parameter
  • b is the offset parameter.
  • the illumination compensation extension technology proposed in the embodiment of this application is executed, that is, the above-mentioned S402 is executed to determine the reconstruction sample mode of the current block.
  • the specific type of the first type frame in this embodiment of the present application is not limited.
  • the illumination compensation extension technology proposed in this application is enabled by default.
  • the illumination compensation expansion technology proposed in the embodiment of the present application is executed, that is, the above-mentioned S402 is executed to determine the reconstruction sample mode of the current block.
  • This application does not limit the specific value of the preset threshold.
  • the preset threshold is 64, that is, if the area of the current block is greater than or equal to the preset threshold, the illumination compensation expansion technology proposed in the embodiment of this application is executed, that is, the above S402 is executed to determine the reconstructed sample mode of the current block.
  • the video decoding method decodes the code stream and predicts the current block to obtain the first prediction value of the current block; determines the reconstructed sample mode of the current block, and the reconstructed sample mode is one of N candidate modes,
  • the N candidate modes include at least one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes; according to the reconstruction sample mode of the current block, determine the adjacent reconstruction samples of the current block and the reference block.
  • Adjacent reconstruction samples determine the linear transformation parameters according to the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block, and linearly transform the first prediction value according to the linear transformation parameters to obtain the second prediction value of the current block.
  • the reconstruction sample mode of the current block can be one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes, which not only enriches the reconstruction sample selection mode, but also can Accurately determine the reconstruction sample pattern that is adapted to the characteristic information of the current block from the above patterns.
  • the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be obtained more accurately, and Based on the accurately obtained 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.
  • the video decoding method involved in the embodiment of the present application is described above. On this basis, the video decoding method involved in the present application is described below with respect to the encoding end.
  • FIG 10 is a schematic flowchart of a video encoding method provided by an embodiment of the present application.
  • the execution subject of the embodiment of the present application may be the encoder shown in the above-mentioned Figure 1 and Figure 2.
  • the method in the embodiment of this application includes:
  • the encoding determines the prediction mode corresponding to the current block, predicts the current block according to the prediction mode, and obtains the predicted value of the current block. Since the embodiment of the present application performs illumination compensation on the predicted value obtained in this step, a new Therefore, for convenience of description, in this embodiment of the present application, the predicted value obtained according to the prediction mode is recorded as the first predicted value, and the predicted value obtained by performing illumination compensation on the first predicted value is recorded as the second predicted value.
  • This embodiment of the present application does not place any restrictions on the prediction method of the current block.
  • the inter prediction mode is used to predict the current block to obtain the first prediction value of the current block.
  • the encoding end determines the motion information corresponding to the current block, finds the reference block from the reference frame based on the motion information, and generates the first prediction value of the current block based on the reference block.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be a whole sample or a sub-sample. If the motion vector is a sub-sample, then interpolation filtering needs to be used in the reference frame to make the required sub-sample block.
  • the reference frame found based on the motion vector is The whole sample or the block of sub-samples is called the reference block.
  • the reference block is directly used as the prediction block, and in some embodiments, the prediction block is generated based on the reference block.
  • the reconstructed sample mode is one of N candidate modes, and 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.
  • the above-mentioned S702 can be executed before the above-mentioned S701, or after the above-mentioned S701, or executed synchronously with the above-mentioned S701.
  • This embodiment of the present application has No restrictions.
  • illumination compensation is performed on the obtained first predicted value to obtain the second predicted value.
  • the adjacent reconstructed samples of the current block and the adjacent reconstructed samples of the reference block are determined.
  • the adjacent reconstructed samples and the adjacent reconstructed samples of the reference block are used to determine linear transformation parameters, and the first predicted value is linearly transformed according to the linear transformation parameters to obtain the second predicted value of the current block.
  • embodiments of the present application add several new ways of determining reconstruction samples, such as adding an upper reconstruction sample mode and/or a left reconstruction sample mode.
  • the left reconstruction sample mode means that the reconstructed samples in the adjacent reconstruction samples of the current block are all from the left adjacent reconstruction samples of the current block, and the reconstructed samples in the adjacent reconstruction samples of the reference block are all from the left side of the reference block. Adjacent reconstructed samples.
  • the upper reconstruction sample mode means that the reconstructed samples in the adjacent reconstruction samples of the current block are all from the upper adjacent reconstruction samples of the current block, and the reconstructed samples in the adjacent reconstruction samples of the reference block are all from the upper side of the reference block. Adjacent reconstructed samples.
  • the upper and left reconstruction sample modes mean that the reconstructed samples in the adjacent reconstruction samples of the current block are all from the upper and left adjacent reconstruction samples of the current block, and the reconstructed samples in the adjacent reconstruction samples of the reference block are all from Upper and left adjacent reconstructed samples from the reference block.
  • the decoder first determines the reconstructed sample mode of the current block.
  • the reconstructed sample mode of the current block can be one of N candidate modes, and the N candidate modes include the upper reconstructed sample mode, the left reconstructed sample mode, and the upper reconstructed sample mode. At least one of a sample mode, an upper side and a left reconstructed sample mode.
  • the embodiment of the present application adds a reconstruction sample selection method, that is, adds a reconstruction sample mode, for example, adds a left reconstruction sample mode and/or an upper reconstruction sample mode, wherein the reconstruction sample in the left reconstruction sample mode All are from the left adjacent samples of the image block, and the reconstructed samples in the upper reconstruction sample mode are all from the upper adjacent samples of the image block.
  • a reconstruction sample selection method that is, adds a reconstruction sample mode, for example, adds a left reconstruction sample mode and/or an upper reconstruction sample mode, wherein the reconstruction sample in the left reconstruction sample mode All are from the left adjacent samples of the image block, and the reconstructed samples in the upper reconstruction sample mode are all from the upper adjacent samples of the image block.
  • the embodiments of the present application do not limit the specific method of determining the reconstruction sample mode of the current block.
  • any one of the N candidate modes is determined as the reconstructed sample mode of the current block.
  • the current block is analyzed and a reconstructed sample pattern of the current block is determined based on characteristics of the samples in the current block. For example, if the samples in the current block are very different and most of them are closer to the reconstructed samples on the upper side, then the upper reconstructed sample mode is determined as the reconstructed sample mode of the current block. If the samples in the current block are very different, And most of the reconstructed samples are closer to the left side. At this time, the left reconstructed sample mode is determined as the reconstructed sample mode of the current block. If the samples in the current block are not very different, at this time, the upper and left sides are The reconstruction sample mode is determined as the reconstruction sample mode of the current block.
  • the above S702 includes the following steps S702-A and S702-B:
  • S702-B Determine the reconstructed sample mode of the current block from the N candidate modes according to the costs corresponding to the N candidate modes.
  • the encoding end uses each of the N candidate modes to perform illumination compensation processing on the first predicted value of the current block to obtain the cost corresponding to each candidate mode, and then based on the cost corresponding to each candidate mode, Select one candidate mode from N candidate modes as the reconstructed sample mode of the current block.
  • the process of determining the cost corresponding to each candidate mode among the N candidate modes is the same.
  • the i-th candidate mode among the N candidate modes is used as an example for explanation.
  • Determining the cost corresponding to the i-th candidate mode in S702-A above includes the following steps from S702-A1 to S702-A4:
  • the i-th adjacent reconstruction sample of the current block is a reconstruction sample determined from the left and/or upper reconstruction samples of the current block according to the i-th candidate mode.
  • the i-th adjacent reconstruction sample of the reference block is a reconstruction sample determined from the left and/or upper reconstruction samples of the reference block of the current block according to the i-th candidate mode.
  • the determined i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block are also different.
  • the above S702-A1 includes the following steps of S702-A1-A:
  • S702-A1-A Determine the i-th adjacent reconstructed sample of the current block based on the left adjacent sample of the current block, and determine the i-th adjacent reconstructed sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference frame. i adjacent reconstructed samples.
  • the i-th adjacent reconstructed sample of the current block is determined from the left adjacent samples, where all the left adjacent samples have been reconstructed sample. For example, as shown in Figure 8A, the i-th adjacent reconstructed sample of the current block is determined based on the left adjacent sample of the current block. For another example, the reference block of the current block is determined in the reference frame, as shown in Figure 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 frame.
  • 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 the current block the second predicted value.
  • the embodiment of the present application does not limit the specific method of determining the i-th adjacent reconstructed sample of the current block based on the left adjacent sample of the current block in S702-A1-A.
  • multiple reconstruction samples adjacent to the left side of the current block are determined as the i-th adjacent reconstruction sample of the current block.
  • the i-th adjacent reconstructed sample of the current block is determined based on the height of the current block and the left adjacent sample of the current block.
  • Example 1 Determine the reconstructed sample on the left side of the current block that is adjacent to 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, then the four adjacent reconstruction samples on the left side of the current block are determined as the i-th adjacent reconstruction sample of the current block.
  • Example 2 if the height of the current block is equal to the first numerical value, select the first numerical value samples from the left adjacent samples of the current block to determine the i-th adjacent reconstructed sample of the current block.
  • the first value is 4, that is, if the height of the current block is equal to 4, then 4 samples are selected from the left adjacent samples of the current block and determined as the i-th adjacent reconstructed sample of the current block.
  • Example 2 if the height of the current block is not equal to the first value, select the second value samples from the left adjacent samples of the current block to determine the i-th adjacent reconstructed sample of the current block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the second value is the value of log2 (height) rounded.
  • the encoding end selects 5 samples from the 16 adjacent samples on the left side of the current block as the i-th adjacent reconstruction of the current block. sample.
  • these five samples are selected with equal step size, or they can be selected randomly, and the embodiment of the present application does not limit this.
  • the embodiment of this application does not limit the specific method of determining the i-th adjacent reconstruction sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference frame in S702-A1-A.
  • a plurality of reconstruction samples adjacent to the left side of the reference block in the reference frame are determined as the i-th adjacent reconstruction sample of the reference block.
  • the i-th adjacent reconstructed sample of the reference block is determined according to the height of the reference block and the left adjacent sample of the reference block.
  • Example 1 Determine the reconstructed sample on the left side of the reference block in the reference frame that is adjacent to the reference block and within the height range of the reference block as the i-th adjacent reconstructed sample of the reference block. For example, if the height of the reference block is 4, then the four reconstructed samples adjacent to the left side of the reference block in the reference frame are determined as the i-th adjacent reconstructed sample of the reference block.
  • Example 2 If the height of the reference block is equal to the first numerical value, the left adjacent samples of the reference block are interpolated to obtain the first numerical value samples, which are used as the i-th adjacent reconstructed sample of the reference block.
  • the first value is 4, that is, if the height of the reference block is equal to 4, then the left adjacent samples of the reference block are interpolated to obtain 4 samples, which are used as the i-th adjacent reconstructed sample of the reference block.
  • Example 2 if the height of the reference block is not equal to the first value, interpolate the left adjacent samples of the reference block to obtain the second number of samples, which are used as the i-th adjacent reconstructed sample of the reference block.
  • the encoding end interpolates the 16 adjacent samples on the left side of the reference block to obtain 5 samples, which are used as the i-th adjacent sample of the reference block. Reconstruct the sample.
  • the i-th candidate mode is the left reconstruction sample mode
  • the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block are determined according to any of the above methods,
  • the i-th adjacent reconstructed sample of the current block is only related to the left adjacent sample of the current block
  • the i-th adjacent reconstructed sample of the reference block is only related to the left adjacent sample of the reference block.
  • the above-mentioned S702-A1 includes the following steps of S702-A1-B:
  • S702-A1-B Determine the i-th adjacent reconstruction sample of the current block based on the upper adjacent sample of the current block, and determine the i-th adjacent reconstruction sample of the reference block based on the upper adjacent sample of the reference block corresponding to the current block in the reference frame. i adjacent reconstructed samples.
  • the i-th adjacent reconstructed sample of the current block is determined from the upper adjacent samples, where all the upper adjacent samples are reconstructed sample. For example, as shown in Figure 9A, the i-th adjacent reconstructed sample of the current block is determined based on the upper adjacent sample of the current block. For another example, the reference block of the current block is determined in the reference frame, as shown in Figure 9B. The i-th reconstructed sample of the reference block is determined based on the upper adjacent samples of the reference block in the reference frame.
  • 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 the current block the second predicted value.
  • the embodiment of the present application does not limit the specific method of determining the i-th adjacent reconstructed sample of the current block based on the upper adjacent sample of the current block in S702-A1-B.
  • multiple reconstruction samples adjacent to the upper side of the current block are determined as the i-th adjacent reconstruction sample of the current block.
  • the i-th adjacent reconstructed sample of the current block is determined based on the height of the current block and the upper adjacent sample of the current block.
  • Example 1 Determine the reconstructed sample whose upper side is adjacent to 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, then the four adjacent reconstruction samples on the upper side of the current block are determined as the i-th adjacent reconstruction sample of the current block.
  • Example 2 If the height of the current block is equal to the first numerical value, select the first numerical value samples from the upper adjacent samples of the current block to determine the i-th adjacent reconstructed sample of the current block.
  • the first value is 4, that is, if the height of the current block is equal to 4, then 4 samples are selected from the upper adjacent samples of the current block and determined as the i-th adjacent reconstructed sample of the current block.
  • Example 2 If the height of the current block is not equal to the first value, select the second value of samples from the upper adjacent samples of the current block to determine the i-th adjacent reconstructed sample of the current block.
  • the second value is greater than or equal to 4.
  • the second value is the logarithm of the height with the third value as the base height.
  • the third value is 2.
  • the second value is the value of log2 (height) rounded.
  • the encoding end selects 5 samples from the 16 adjacent samples on the upper side of the current block as the i-th adjacent reconstruction of the current block. sample.
  • these five samples are selected with equal step size, or they can be selected randomly, and the embodiment of the present application does not limit this.
  • the embodiment of this application does not limit the specific method 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 frame in S702-A1-B.
  • a plurality of reconstruction samples adjacent to the upper side of the reference block in the reference frame are determined as the i-th adjacent reconstruction sample of the reference block.
  • the i-th adjacent reconstructed sample of the reference block is determined according to the height of the reference block and the upper adjacent sample of the reference block.
  • Example 1 Determine the reconstructed sample whose upper side of the reference block in the reference frame is adjacent to the reference block and within the height range of the reference block as the i-th adjacent reconstructed sample of the reference block. For example, if the height of the reference block is 4, then the four adjacent reconstructed samples on the upper side of the reference block in the reference frame are determined as the i-th adjacent reconstructed sample of the reference block.
  • Example 2 If the height of the reference block is equal to the first numerical value, the upper adjacent samples of the reference block are interpolated to obtain the first numerical value samples, which are used as the i-th adjacent reconstructed sample of the reference block.
  • the first value is 4, that is, if the height of the reference block is equal to 4, the decoding end interpolates the upper adjacent samples of the reference block to obtain 4 samples, which are determined as the i-th adjacent reconstruction of the reference block. sample.
  • Example 2 if the height of the reference block is not equal to the first numerical value, interpolate the upper adjacent samples of the reference block to obtain the second numerical value of samples, which is used as the i-th adjacent reconstructed sample of the reference block.
  • the encoding end interpolates the 16 adjacent samples on the upper side of the reference block to obtain 5 samples, which are used as the i-th adjacent sample of the reference block. Reconstruct the sample.
  • the i-th candidate mode is the upper reconstruction sample mode
  • the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block are determined according to any of the above methods,
  • the i-th adjacent reconstructed sample of the current block is only related to the upper adjacent sample of the current block
  • the i-th adjacent reconstructed sample of the reference block is only related to the upper adjacent sample of the reference block.
  • the encoding end After determining the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block according to the above method, the encoding end performs the following S702-A2.
  • S702-A2 Determine the i-th linear transformation parameter based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
  • the embodiments of the present application do not limit the specific method of determining the i-th linear transformation parameter based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
  • i adjacent reconstruction samples include the following steps:
  • S702-A22 Determine the i-th offset parameter based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor.
  • the embodiment of the present application does not limit the method of determining the i-th scaling factor a based on the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block in the above S702-A21.
  • the i-th scaling factor a is determined based on the ratio of the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block.
  • the i-th scaling factor a is determined according to the above formula (3).
  • the embodiment of the present application does not change the method of determining the i-th offset parameter based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block, and the i-th scaling factor in the above-mentioned S702-A22. limit.
  • the i-th offset parameter b is determined according to the above formula (4).
  • S702-A3 Determine the first predicted value of the current block, and linearly transform the first predicted value according to the i-th linear transformation parameter to obtain the second predicted value corresponding to the i-th candidate mode.
  • the i-th linear transformation parameter is used to linearly transform the first predicted value to obtain the 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; determine the sum of the product and the i-th offset parameter as the second predicted value corresponding to the i-th candidate mode.
  • the second predicted value in the i-th candidate mode is determined according to the following formula (5).
  • S702-A4 Determine the cost corresponding to the i-th candidate mode according to the second prediction value corresponding to the i-th candidate mode.
  • the cost corresponding to the i-th candidate mode is determined based on the second prediction value corresponding to the i-th candidate mode and the current block.
  • the residual of the current block is obtained by difference between the second predicted value corresponding to the i-th candidate mode and the original value corresponding to the current block.
  • the rate distortion optimization (Rate Distorti on Optimized) is calculated through operations such as transformation and quantization, which is recorded as Costi.
  • cost calculation methods such as sum of absolute errors (Sum of Absolute Difference, SAD) and sum of absolute values after transformation (Sum of Absolute Transformed Difference, STAD) can also be used to determine the i-th candidate mode corresponding price.
  • the cost corresponding to each candidate mode among the N candidate modes can be determined, and then the above S702-B is executed. According to the cost corresponding to the N candidate modes, the reconstruction of the current block is determined from the N candidate modes. Sample pattern.
  • the candidate mode with the smallest cost among the N candidate modes is determined as the reconstructed sample mode of the current block.
  • the encoding end after determining the reconstructed sample mode of the current block from the N candidate modes based on the costs corresponding to the N candidate modes, writes the first index in the code stream, and the first index is used for Indicates the reconstructed sample pattern for the current block.
  • the encoding end may also determine the reconstructed sample mode of the current block in the following manner. That is, the above S702 includes the following steps S702-C1 and S702-C2:
  • S702-C Determine the first flag of the adjacent block of the current block.
  • the first flag of the adjacent block is used to indicate whether the adjacent block uses illumination compensation technology;
  • the encoding end when the encoding end performs illumination compensation on the current block, if the prediction mode of the current block is the Merge mode, the encoding end determines whether the adjacent blocks of the current block use the illumination compensation technology proposed in the embodiment of this application. To determine whether the current block uses this lighting compensation technology. For example, if the adjacent block uses the illumination compensation technology proposed in the embodiment of the present application, it is determined that the current block also uses the illumination compensation technology proposed in the embodiment of the present application.
  • the encoding end obtains the first flag from the adjacent block, and determines the reconstructed sample mode of the current block based on the first flag of the adjacent block.
  • the methods for determining the reconstructed sample mode of the current block based on the first flag of the adjacent block include but are not limited to the following:
  • Method 1 If the first flag of the adjacent block indicates that the adjacent block uses the illumination compensation technology, it is determined that the reconstruction sample mode of the current block is the upper and left reconstruction sample modes.
  • the encoding end defaults the reconstruction sample mode of the current block to the upper and left reconstruction sample modes, and then directly The upper and left reconstructed sample modes are used to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value of the current block.
  • Method 2 If the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, determine the reconstructed sample mode of the adjacent block; determine the reconstructed sample mode of the adjacent block as the reconstructed sample mode of the current block.
  • the encoding end determines the reconstructed sample mode of the adjacent block of the current block as the reconstructed sample mode of the current block. . Specifically, the encoding end obtains the reconstructed sample pattern of the adjacent block from the adjacent block, and uses the reconstructed sample pattern of the adjacent block to perform illumination compensation on the first predicted value of the current block to obtain the second predicted value.
  • the way in which the encoding end determines the reconstructed sample pattern of the adjacent blocks of the current block includes at least the following examples:
  • Example 1 The encoding end directly obtains the reconstructed sample pattern of the adjacent block from the adjacent block.
  • Example 2 The coding end obtains the second index from the adjacent block.
  • the second index is used to indicate the reconstructed sample mode of the adjacent block.
  • the coding end determines the reconstructed sample mode of the adjacent block based on the second index, for example The second index is 0. As shown in Table 1, it is determined that the reconstructed sample mode of the adjacent block is the upper reconstructed sample mode.
  • the encoding end directly determines the reconstructed sample mode of the current block based on the first flag and/or the first index of the adjacent block of the current block.
  • the encoding end After determining the reconstructed sample pattern of the current block according to the above method, the encoding end performs the following steps of S703.
  • S703. Determine the second predicted value of the current block according to the reconstructed sample mode of the current block.
  • the second predicted value is obtained by performing illumination compensation on the first predicted value using the reconstructed sample mode of the current block.
  • the encoding end determines the second prediction value corresponding to each of the N candidate modes according to the above-mentioned S702-A and S702-B methods, and the reconstructed sample mode of the current block is determined from the above-mentioned N candidate modes, If selected from the candidate modes, the encoding end 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, without re-calculating the illumination compensation.
  • the encoding end determines the reconstructed sample mode of the current block according to the above-mentioned steps S702-C1 and S702-C2, that is, determines the first flag of the neighboring block of the current block, and determines the first flag of the neighboring block according to the first flag of the neighboring block. flag to determine the reconstruction sample mode of the current block.
  • the above S703 includes the following steps:
  • S703-A2 Determine linear transformation parameters based on adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block, and linearly transform the first prediction value according to the linear transformation parameters to obtain the second prediction value of the current block.
  • S703-A2 refers to the above description of S702-A2 and S702-A3, and will not be described again here.
  • the encoding end selects the reconstructed sample mode of the current block from the upper reconstructed sample mode, the left reconstructed sample mode, the upper and left reconstructed sample modes, which not only enriches the selection mode of the reconstructed sample, but also can
  • the reconstruction sample mode adapted to the characteristic information of the current block is accurately determined. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be determined more accurately.
  • a flag is used to define whether to adopt the illumination compensation extension technology of the embodiment of the present application. That is, before the above S702, the encoding end first determines the first flag of the current block. The first flag of the current block is used to indicate the current block. Whether the block uses lighting compensation techniques.
  • the encoding end determines the first flag of the current block and writes the first flag into the code stream.
  • the encoding end determines the second flag of the current block and writes the second flag into the code stream.
  • the second flag of the current block Flag used to indicate whether the current block uses lighting compensation expansion technology.
  • the encoding end writes the index of the reconstructed sample mode of the current block into the code stream.
  • the first flag of the current block when the first flag of the current block is 1, it indicates that the current block uses illumination compensation technology. If the first flag of the current block is 0, it indicates that the current block does not use illumination compensation technology.
  • the decoder determines the first predicted value as the second predicted value, or uses other methods to The first predicted value is processed to obtain the second predicted value.
  • the decoder determines the second flag of the current block, and the second flag of the current block is used to indicate the current block. Whether the block uses this application's lighting compensation extension technology.
  • the second flag of the current block when the second flag of the current block is 1, it indicates that the current block uses the illumination compensation expansion technology. If the second flag of the current block is 0, it indicates that the current block does not use the illumination compensation expansion technology.
  • the decoder can adopt the default reconstruction sample mode, for example, select the upper and left reconstruction samples. mode, perform illumination compensation on the first predicted value of the current block to obtain the second predicted value.
  • the encoding end writes the index of the reconstructed sample mode of the current block into the code stream.
  • the encoding end determines the first flag of the current block in at least the following ways:
  • Method 1 get the first flag of the current block from the configuration file.
  • the encoding end writes the first flag of the current block into the code stream, and the decoding end can directly decode to obtain the first flag of the current block.
  • Method 2 if the prediction mode of the current block is Merge mode, the encoding end determines the 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 illumination compensation technology, and then according to The first flag of the adjacent block determines the first flag of the current block. For example, the encoding end obtains the first flag from the adjacent block. If the value of the first flag of the adjacent block is 1, it determines that the value of the first flag of the current block is also 1, that is, the value of the first flag of the adjacent block is 1. When the flag indicates that the adjacent block uses lighting compensation technology, it is determined that the current block also uses lighting compensation technology.
  • the value of the first flag of the adjacent block is 0, it is determined that the value of the first flag of the current block is also 0, that is, when the first flag of the adjacent block indicates that the adjacent block does not use illumination compensation technology, then The current block is also determined not to use lighting compensation techniques.
  • the encoding end determines the second flag of the current block in at least the following ways:
  • Method 1 get the second flag of the current block from the configuration file.
  • the encoding end writes the second flag of the current block into the code stream, and the decoding end can directly decode to obtain the second flag of the current block.
  • Method 2 if the prediction mode of the current block is Merge mode, the encoding end determines the second flag of the neighboring block corresponding to the neighboring block of the current block.
  • the second flag of the neighboring block is used to indicate whether the neighboring block uses this
  • the applied illumination compensation extension technology further determines the second flag of the current block based on the second flag of the adjacent block. For example, the encoding end obtains the second flag of the adjacent block from the adjacent block. If the value of the second flag of the adjacent block is 1, it determines that the value of the second flag of the current block is also 1, that is, the value of the second flag of the adjacent block is 1.
  • the second flag of the block indicates that the adjacent block uses the illumination compensation expansion technology of the present application
  • the above-mentioned first flag includes at least one of a sequence-level flag, an image-level flag, and a block-level flag.
  • the encoding end continues to traverse other inter-frame prediction technologies, calculates the rate-distortion cost values corresponding to each technology, and selects the prediction mode corresponding to the smallest cost value as the optimal prediction mode for the current coding unit.
  • the current block uses illumination compensation technology and costMin is the minimum, then the current block uses illumination compensation technology, and the coding unit level flag bit of the illumination compensation technology needs to be set, such as lic_flag is set to true and written into the code stream.
  • the illumination compensation mode expansion flag that is, the second flag of the current block, for example, lic_ext is set to true and written into the code stream, and the index corresponding to costMin is written into the code stream through equal probability encoding; otherwise, Set the illumination compensation mode expansion flag, that is, the second flag of the current block, into the code stream.
  • the current block uses illumination compensation technology and costMin is not the minimum, then the current block does not use illumination compensation technology, and the coding unit level flag bit of the illumination compensation technology needs to be set, such as lic_flag is set or not, and written into the code stream.
  • the optimal prediction mode information of other non-illumination compensation technologies will be written into the code stream.
  • the illumination compensation extension technology proposed in the embodiment of this application is executed, that is, the above-mentioned S702 is executed to determine the reconstruction sample mode of the current block.
  • the specific type of the first type frame in this embodiment of the present application is not limited.
  • the illumination compensation extension technology proposed in this application is enabled by default.
  • the illumination compensation expansion technology proposed in the embodiment of the present application is executed, that is, the above-mentioned S702 is executed to determine the reconstruction sample mode of the current block.
  • This application does not limit the specific value of the preset threshold.
  • the preset threshold is 64, that is, if the area of the current block is greater than or equal to the preset threshold, the illumination compensation expansion technology proposed in the embodiment of this application is executed, that is, the above S702 is executed to determine the reconstructed sample mode of the current block.
  • the encoding end determines the predicted value of the current block according to the above steps, for example, determines the second predicted value of the current block, calculates the difference between the predicted block of the current block and the current block to obtain the residual value of the current block, and compares the residual value Transform is performed to obtain the transform coefficients, the transform coefficients are quantized to obtain the quantized coefficients, and the quantized coefficients are encoded to obtain the code stream.
  • the illumination compensation extension technology proposed in the embodiment of the present application has improved performance for all sequence categories of RA and LDB.
  • the improvement of the 4K A2 sequence is the most obvious in the RA test condition, with an average of 0.11% BD. -bitrate savings.
  • the comprehensive performance improvement proves the effectiveness of this technology and can improve the coding efficiency of existing ECM reference software. It is worth noting that due to server load, the encoding and decoding time is inaccurate. Theoretically, the decoding time will not change, and no encoding-side optimization was performed on the results of this experiment. In addition, this method does not bring additional burden to the decoding end and does not increase the complexity of hardware implementation.
  • the encoding end predicts the current block to obtain the first predicted value of the current block; determines the reconstructed sample mode of the current block, and the reconstructed sample mode is one mode among N candidate modes, N
  • the candidate mode includes at least one of an upper side reconstruction sample mode, a left side reconstruction sample mode, an upper side and a left side reconstruction sample mode; according to the reconstruction sample mode of the current block, a second prediction value of the current block is determined, and the second prediction value passes The reconstructed sample pattern of the current block is obtained by performing illumination compensation on the first predicted value.
  • the reconstruction sample mode of the current block can be one of the upper reconstruction sample mode, the left reconstruction sample mode, and the upper and left reconstruction sample modes, which not only enriches the selection mode of the reconstruction sample, but also can In each of the above modes, the reconstruction sample mode that is adapted to the characteristic information of the current block is accurately determined. In this way, based on the accurate reconstruction sample mode, the adjacent reconstruction samples of the current block and the adjacent reconstruction samples of the reference block can be obtained more accurately.
  • FIG. 7 to FIG. 10 are only examples of the present application and should not be understood as limitations of the present application.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be used in this application.
  • the implementation of the examples does not constitute any limitations.
  • the term "and/or" is only an association relationship describing associated objects, indicating that three relationships can exist. Specifically, A and/or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
  • the character "/" in this article generally indicates that the related objects are an "or" relationship.
  • Figure 11 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
  • the video decoding device 10 includes:
  • the decoding unit 11 is used to decode the code stream and predict the current block to obtain the first prediction value
  • the mode determination unit 12 is used to determine the reconstructed sample mode of the current block.
  • the reconstructed sample mode is one of N candidate modes.
  • the N candidate modes include an upper reconstruction sample mode, a left reconstruction sample mode, an upper reconstruction sample mode, and an upper reconstruction sample mode. at least one of side and left reconstruction sample patterns;
  • the sample determination unit 13 is configured to determine adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block according to the reconstruction sample mode of the current block;
  • Linear transformation unit 14 configured to determine linear transformation parameters based on adjacent reconstructed samples of the current block and adjacent reconstructed samples of the reference block, and perform linear transformation on the first predicted value based on the linear transformation parameters. , obtain the second predicted value of the current block.
  • the mode determining unit 12 is specifically configured to determine a first index, which is used to indicate the reconstructed sample mode of the current block; and determine the reconstructed sample mode of the current block according to the first index. Sample pattern.
  • the mode determination unit 12 is specifically used to decode the code stream to obtain the first index.
  • the mode determination unit 12 is specifically configured to determine the first flag of the neighboring block of the current block, and the first flag of the neighboring block is To indicate whether the adjacent block uses illumination compensation technology; determine the first index according to the first flag of the adjacent block.
  • the mode determining unit 12 is specifically configured to determine the first index as a default index if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology. Used to indicate the upper and left reconstructed sample modes.
  • the mode determining unit 12 is specifically configured to determine a second index if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology, and the second index is used to indicate that the adjacent block uses illumination compensation technology.
  • the reconstructed sample pattern of the adjacent block is determined as the first index by determining the second index.
  • the mode determination unit 12 is specifically configured to determine a first flag of the current block, and the first flag of the current block is used to indicate the Whether the current block uses illumination compensation technology; if the first flag of the current block indicates that the current block uses the illumination compensation technology, then determine the second flag of the current block, and the second flag of the current block is To indicate whether the current block uses illumination compensation expansion technology; determine the first index according to the second flag of the current block.
  • the mode determination unit 12 is specifically configured to obtain the first index by decoding the code stream if the second flag of the current block indicates that the current block uses the illumination compensation extension technology. .
  • the mode determining unit 12 is specifically configured to determine the first index as a default index if the second flag of the current block indicates that the current block does not use the illumination compensation expansion technology, and the Default indexes are used to indicate the upper and left reconstructed sample modes.
  • the mode determination unit 12 is specifically used to decode the code stream to obtain the first flag of the current block.
  • the mode determination unit 12 is specifically used to decode the code stream to obtain the second flag of the current block.
  • the mode determination unit 12 is specifically configured to determine the first flag of the neighboring block of the current block, and the first flag of the neighboring block is To indicate whether the adjacent block uses illumination compensation technology; determine the reconstructed sample mode of the current block according to the first flag of the adjacent block.
  • the mode determining unit 12 is specifically configured to determine the reconstructed sample mode of the current block to be the upper side if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology. and reconstructed sample pattern on the left.
  • the mode determining unit 12 is specifically configured to determine the reconstructed sample mode of the adjacent block if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology; The reconstructed sample pattern of the adjacent block is determined as the reconstructed sample pattern of the current block.
  • the mode determining unit 12 is specifically configured to determine a second index, where the second index is used to indicate the reconstructed sample mode of the adjacent block;
  • a reconstructed sample pattern of the adjacent block is determined.
  • the sample determination unit 13 is specifically configured to determine the phase of the current block based on the left adjacent sample of the current block if the reconstructed sample mode of the current block is a left reconstructed sample mode.
  • Adjacent reconstruction samples determine the adjacent reconstruction samples of the reference block based on the left adjacent samples of the reference block corresponding to the current block in the reference frame.
  • the sample determination unit 13 is specifically configured to determine adjacent reconstructed samples of the current block according to the height of the current block and the left adjacent sample of the current block.
  • the sample determination unit 13 is specifically configured to select the first value sample from the left adjacent samples of the current block if the height of the current block is equal to the first value, and determine the first value sample. The adjacent reconstructed samples of the current block.
  • the sample determination unit 13 is specifically configured to select a second value of samples from the left adjacent samples of the current block if the height of the current block is not equal to the first value, and determine the Neighboring reconstructed samples of the current block.
  • the sample determination unit 13 is specifically configured to determine the adjacent reconstructed sample of the reference block based on the height of the reference block and the left adjacent sample of the reference block.
  • the sample determination unit 13 is specifically configured to interpolate the left adjacent samples of the reference block to obtain the first value samples if the height of the reference block is equal to a first value, as Adjacent reconstructed samples of the reference block.
  • the sample determination unit 13 is specifically configured to interpolate the left adjacent samples of the reference block to obtain a second value of samples if the height of the reference block is not equal to the first value. adjacent reconstructed samples of the reference block.
  • the sample determination unit 13 is specifically configured to determine the phase of the current block based on the upper adjacent samples of the current block if the reconstruction sample mode of the current block is an upper reconstruction sample mode.
  • Adjacent reconstruction samples determine the adjacent reconstruction samples of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference frame.
  • the sample determination unit 13 is specifically configured to determine adjacent reconstructed samples of the current block according to the width of the current block and upper adjacent samples of the current block.
  • the sample determination unit 13 is specifically configured to select the first value sample from the upper adjacent samples of the current block if the width of the current block is equal to the first value, and determine the first value sample. The adjacent reconstructed samples of the current block.
  • the sample determination unit 13 if the width of the current block is not equal to the first value, selects a second value of samples from the upper adjacent samples of the current block, and determines the width of the current block. Adjacent reconstructed samples.
  • the sample determination unit 13 is specifically configured to determine adjacent reconstructed samples of the reference block according to the width of the reference block and upper adjacent samples of the reference block.
  • the sample determination unit 13 is specifically configured to, if the width of the reference block is equal to a first value, interpolate upper adjacent samples of the reference block to obtain the first value samples, as Adjacent reconstructed samples of the reference block.
  • the sample determination unit 13 is specifically configured to interpolate the upper adjacent samples of the reference block to obtain a second value of samples if the width of the reference block is not equal to the first value, and based on The second number of samples are interpolated to determine adjacent reconstructed samples of the reference block.
  • the first flag includes at least one of a sequence-level flag, an image-level flag, and a block-level flag.
  • the linear transformation parameters include a scaling factor and an offset parameter
  • the linear transformation unit 14 is configured to determine the Scaling factor
  • the offset parameter is determined based on adjacent reconstructed samples of the current block, adjacent reconstructed samples of the reference block, and the scaling factor.
  • the linear transformation unit 14 is configured to linearly transform the first predicted value according to the scaling factor and the offset parameter to obtain a second predicted value of the current block.
  • the linear transformation unit 14 is configured to determine the product of the scaling factor and the first predicted value; and determine the sum of the product and the offset parameter as the second predicted value.
  • the mode determining unit 12 is specifically configured to determine the reconstructed sample mode of the current block if the current image to which the current block belongs is a first type frame.
  • the pattern determination unit 12 is configured to determine the reconstructed sample pattern of the current block if the area of the current block is greater than or equal to a preset threshold.
  • the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be repeated here.
  • the video decoding device 10 shown in FIG. 11 may correspond to the corresponding subject in performing the method of the embodiment of the present application, and the aforementioned and other operations and/or functions of each unit in the video decoding device 10 are respectively to implement the method, etc. The corresponding processes in each method will not be repeated here for the sake of brevity.
  • Figure 12 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
  • the video encoding device 20 includes:
  • the prediction unit 21 is used to predict the current block and obtain the first prediction value of the current block
  • the pattern determination unit 22 is used to determine the reconstructed sample mode of the current block.
  • the reconstructed sample mode is one of N candidate modes.
  • the N candidate modes include an upper reconstructed sample mode, a left reconstructed sample mode, an upper reconstructed sample mode, and a left reconstructed sample mode. at least one of side and left reconstruction sample patterns;
  • Linear transformation unit 23 configured to determine a second predicted value of the current block according to the reconstructed sample mode of the current block, and the second predicted value is compared with the first predicted value through the reconstructed sample mode of the current block. Obtained by performing lighting compensation.
  • the style determination unit 22 is configured to determine the cost corresponding to the i-th candidate mode among the N candidate modes, where i is a positive number from 1 to N. Integer; determine the reconstructed sample mode of the current block from the N candidate modes according to the costs corresponding to the N candidate modes.
  • the pattern determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the current block and the i-th adjacent reconstruction sample of the reference block according to the i-th candidate mode; according to the The i-th adjacent reconstructed sample of the current block and the i-th adjacent reconstructed sample of the reference block are used to determine the i-th linear transformation parameter; the first predicted value of the current block is determined, and based on the i-th The linear transformation parameter linearly transforms the first predicted value to obtain the second predicted value corresponding to the i-th candidate mode; based on the second predicted value corresponding to the i-th candidate mode, determine the i-th The cost corresponding to the candidate mode.
  • the pattern determination unit 22 is configured to determine the i-th candidate pattern of the current block based on the left adjacent sample of the current block if the i-th candidate pattern is a left reconstructed sample pattern.
  • Adjacent reconstruction samples determine the i-th adjacent reconstruction sample of the reference block based on the left adjacent sample of the reference block corresponding to the current block in the reference frame.
  • the pattern determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the current block according to the height of the current block and the left adjacent sample of the current block.
  • the pattern determination unit 22 is configured to select the first value samples from the left adjacent samples of the current block if the height of the current block is equal to a first value, and determine the The i-th adjacent reconstructed sample of the current block.
  • the pattern determination unit 22 is configured to select a second value of samples from the left adjacent samples of the current block if the height of the current block is not equal to the first value, and determine the current value. The ith adjacent reconstructed sample of the block.
  • the pattern determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the reference block according to the height of the reference block and the left adjacent sample of the reference block.
  • the pattern determination unit 22 is configured to interpolate the left adjacent samples of the reference block to obtain the first value samples if the height of the reference block is equal to the first value. The i-th adjacent reconstructed sample of the reference block.
  • the pattern determination unit 22 is configured to interpolate the left adjacent samples of the reference block to obtain a second value of samples if the height of the reference block is not equal to the first value. The i-th adjacent reconstructed sample of the reference block.
  • the pattern determination unit 22 is configured to determine the i-th candidate mode of the current block based on upper adjacent samples of the current block if the i-th candidate mode is an upper reconstruction sample mode.
  • Adjacent reconstruction samples determine the i-th adjacent reconstruction sample of the reference block based on the upper adjacent samples of the reference block corresponding to the current block in the reference frame.
  • the pattern determination unit 22 is configured to determine the i-th adjacent reconstruction sample of the current block according to the width of the current block and the upper adjacent sample of the current block.
  • the pattern determination unit 22 is configured to, if the width of the current block is equal to a first value, select the first value samples from upper adjacent samples of the current block, and determine the The i-th adjacent reconstructed sample of the current block.
  • the pattern determination unit 22 is configured to select a second value of samples from upper adjacent samples of the current block if the width of the current block is not equal to the first value, and determine the current value. The ith adjacent reconstructed sample of the block.
  • the pattern determination unit 22 is configured to determine the i-th adjacent reconstructed sample of the reference block according to the width of the reference block and the upper adjacent sample of the reference block.
  • the pattern determination unit 22 is configured to, if the width of the reference block is equal to a first value, interpolate upper adjacent samples of the reference block to obtain the first value samples, as the The i-th adjacent reconstructed sample of the reference block.
  • the pattern determination unit 22 is configured to interpolate upper adjacent samples of the reference block to obtain a second value of samples if the width of the reference block is not equal to the first value. The i-th adjacent reconstructed sample of the reference block.
  • the i-th linear transformation parameter includes an i-th scaling factor and an i-th offset parameter pattern determination unit 22, which is used to determine the i-th adjacent reconstructed sample of the current block and the i-th
  • the i-th adjacent reconstruction sample of the reference block is used to determine the i-th scaling factor; based on the i-th adjacent reconstruction sample of the current block, the i-th adjacent reconstruction sample of the reference block and the The i-th scaling factor determines the i-th offset parameter.
  • the style determination unit 22 is configured to linearly transform the first predicted value according to the i-th scaling factor and the i-th offset parameter to obtain the i-th candidate pattern. The corresponding second predicted value.
  • the pattern determination unit 22 is configured to determine the product of the i-th scaling factor and the first predicted value; determine the sum of the product and the i-th offset parameter as the The second predicted value corresponding to the i-th candidate mode.
  • the pattern determination unit 22 is configured to determine the cost corresponding to the i-th candidate mode according to the second prediction value corresponding to the i-th candidate mode and the current block.
  • the pattern 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.
  • 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.
  • the linear transformation unit 23 is configured to write a first index in the code stream, where the first index is used to indicate the reconstructed sample pattern of the current block.
  • the pattern determination unit 22 is used to determine the first flag of the neighboring block of the current block, and the first flag of the neighboring block is To indicate whether the adjacent block uses illumination compensation technology; determine the reconstructed sample mode of the current block according to the first flag of the adjacent block.
  • the pattern determination unit 22 is configured to determine the reconstructed sample pattern of the current block to be the upper side and the upper side if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology. Reconstructed sample pattern on the left.
  • the pattern determination unit 22 is configured to determine the reconstructed sample pattern of the adjacent block if the first flag of the adjacent block indicates that the adjacent block uses illumination compensation technology; The reconstructed sample pattern of the neighboring block is determined as the reconstructed sample pattern of the current block.
  • the pattern determination unit 22 is used to determine a second index, the second index being used to indicate the reconstructed sample pattern of the adjacent block; according to the second index, determine the reconstructed sample pattern of the adjacent block. Reconstruct the sample pattern.
  • the pattern determination unit 22 is configured to determine adjacent reconstruction samples of the current block and adjacent reconstruction samples of the reference block according to the reconstruction sample pattern of the current block; Reconstruct samples and adjacent reconstructed samples of the reference block to determine linear transformation parameters, and linearly transform the first prediction value according to the linear transformation parameters to obtain the second prediction value of the current block.
  • the linear transformation unit 23 is used to determine the first flag of the current block and write the first flag into the code stream.
  • the first flag of the current block is used to indicate whether the current block uses Light compensation technology.
  • the linear transformation unit 23 is configured to, if the first flag of the current block indicates that the current block uses the illumination compensation technology, determine the second flag of the current block, and convert the second flag to the current block. A flag is written into the code stream, and the second flag of the current block is used to indicate whether the current block uses illumination compensation extension technology.
  • the linear transformation unit 23 is configured to write the index of the reconstructed sample mode of the current block into the current block if the second flag of the current block indicates that the current block uses the illumination compensation expansion technology. Describe the code stream.
  • the linear transformation unit 23 is used to determine the first flag of the neighboring block of the current block, and the first flag of the neighboring block is used to Indicate whether the neighboring block uses illumination compensation technology; determine the first flag of the current block according to the first flag of the neighboring block.
  • the linear transformation unit 23 is used to determine the second flag of the neighboring block of the current block, and the second flag of the neighboring block is used to Indicate whether the adjacent block uses illumination compensation expansion technology; determine the second flag of the current block according to the second flag of the neighboring block.
  • the first flag includes at least one of a sequence-level flag, an image-level flag, and a block-level flag.
  • the pattern determining unit 22 is configured to determine the reconstructed sample pattern of the current block if the current image to which the current block belongs is a first type frame.
  • the pattern determination unit 22 is configured to determine the reconstructed sample pattern of the current block if the area of the current block is greater than or equal to a preset threshold.
  • the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be repeated here.
  • the video encoding device 20 shown in FIG. 12 may correspond to the corresponding subject in performing the method of the embodiment of the present application, and the aforementioned and other operations and/or functions of each unit in the video encoding device 20 are respectively to implement the method, etc. The corresponding processes in each method will not be repeated here for the sake of brevity.
  • the software unit may be located in a mature storage medium in this field such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.
  • Figure 13 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 30 may be the video encoder or video decoder described in the embodiment of the present application.
  • the electronic device 30 may include:
  • Memory 33 and processor 32 the memory 33 is used to store the computer program 34 and transmit the program code 34 to the processor 32.
  • the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.
  • the processor 32 may be configured to perform steps in the above method according to instructions in the computer program 34 .
  • the processor 32 may include but is not limited to:
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the memory 33 includes but is not limited to:
  • Non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache.
  • RAM Random Access Memory
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • Direct Rambus RAM Direct Rambus RAM
  • the computer program 34 can be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the tasks provided by this application.
  • the one or more units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
  • the electronic device 30 may also include:
  • Transceiver 33 the transceiver 33 can be connected to the processor 32 or the memory 33 .
  • the processor 32 can control the transceiver 33 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices.
  • Transceiver 33 may include a transmitter and a receiver.
  • the transceiver 33 may further include an antenna, and the number of antennas may be one or more.
  • bus system where in addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus.
  • Figure 14 is a schematic block diagram of the video encoding and decoding system 40 provided by the embodiment of the present application.
  • the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42, where the video encoder 41 is used to perform the video encoding method involved in the embodiment of the present application, and the video decoder 42 is used to perform The embodiment of the present application relates to a video decoding method.
  • this application also provides a code stream, which is obtained by the above encoding method.
  • This application also provides a computer storage medium on which a computer program is stored.
  • the computer program When the computer program is executed by a computer, the computer can perform the method of the above method embodiment.
  • embodiments of the present application also provide a computer program product containing instructions, which when executed by a computer causes the computer to perform the method of the above method embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted over a wired connection from a website, computer, server, or data center (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital video discs (DVD)), or semiconductor media (such as solid state disks (SSD)), etc.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separate.
  • a component shown as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请实施例提供一种视频编解码方法、装置、设备、系统及存储介质,确定的当前块的重建样本模式可以是上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的一模式,不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出与当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以更加准确地得到当前块的相邻重建样本和参考块的相邻重建样本,基于准确确定的当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,提高了当前块的光照补偿效果,提升了当前块的预测效果。

Description

视频编解码方法、装置、设备、系统及存储介质 技术领域
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法、装置、设备、系统及存储介质。
背景技术
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。
在视频压缩过程中,通过预测来减少数据冗余,不同帧的图像在一些特定场景下有或大或小的变化,在一些实施例中,为了提升压缩性能,则可以对得到的预测值进行光照补偿,以拟合当前帧与参考图像之间的光照变化,减少冗余。
但是,目前的光照补偿技术效果不佳。
发明内容
本申请实施例提供了一种视频编解码方法、装置、设备、系统及存储介质,以提升光照补偿效果,提升了当前块的预测效果。
第一方面,本申请提供了一种视频解码方法,包括:
解码码流,并对当前块进行预测,得到第一预测值;
确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;
根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
第二方面,本申请实施例提供一种视频编码方法,包括:
对当前块进行预测,得到所述当前块的第一预测值;
确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
根据所述当前块的重建样本模式,确定所述当前块的第二预测值,所述第二预测值通过所述当前块的重建样本模式对所述第一预测值进行光照补偿得到。
第三方面,本申请提供了一种视频编码器,用于执行上述第一方面或其各实现方式中的方法。具体地,该编码器包括用于执行上述第一方面或其各实现方式中的方法的功能单元。
第四方面,本申请提供了一种视频解码器,用于执行上述第二方面或其各实现方式中的方法。具体地,该解码器包括用于执行上述第二方面或其各实现方式中的方法的功能单元。
第五方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。
第六方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频编码器用于执行上述第一方面或其各实现方式中的方法,视频解码器用于执行上述第二方面或其各实现方式中的方法。
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十二方面,提供了一种码流,包括第二方面任一方面生成的码流。
基于以上技术方案,本申请确定的当前块的重建样本模式可以是上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的一模式,不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出与当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以更加准确地得到当前块的相邻重建样本和参考块的相邻重建样本,基于准确确定的当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,提高了当前块的光照补偿效果,提升了当前块的预测效果。
附图说明
图1为本申请实施例涉及的一种视频编解码系统的示意性框图;
图2是本申请实施例提供的视频编码器的示意性框图;
图3是本申请实施例提供的解码框架的示意性框图;
图4A和图4B为两张图像的光照示意图;
图5为本申请实施例涉及的光照补偿技术原理示意图;
图6为本申请实施例涉及的重建样本的一种示例图;
图7为本申请实施例提供的一种视频解码码方法的流程示意图;
图8A和图8B为本申请实施例涉及的左侧相邻样本的一种示例图;
图9A和图9B为本申请实施例涉及的上侧相邻样本的一种示例图;
图10为本申请实施例提供的视频编码方法的一种流程示意图;
图11是本申请实施例提供的视频解码装置的示意性框图;
图12是本申请实施例提供的视频编码装置的示意性框图;
图13是本申请实施例提供的电子设备的示意性框图;
图14是本申请实施例提供的视频编码系统的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本申请的技术不限于任何特定编解码标准或技术。
为了便于理解,首先结合图1对本申请实施例涉及的视频编解码系统进行介绍。
图1为本申请实施例涉及的一种视频编解码系统的示意性框图。需要说明的是,图1只是一种示例,本申请实施例的视频编解码系统包括但不限于图1所示。如图1所示,该视频编解码系统100包含编码设备110和解码设备120。其中编码设备用于对视频数据进行编码(可以理解成压缩)产生码流,并将码流传输给解码设备。解码设备对编码设备编码产生的码流进行解码,得到解码后的视频数据。
本申请实施例的编码设备110可以理解为具有视频编码功能的设备,解码设备120可以理解为具有视频解码功能的设备,即本申请实施例对编码设备110和解码设备120包括更广泛的装置,例如包含智能手机、台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机等。
在一些实施例中,编码设备110可以经由信道130将编码后的视频数据(如码流)传输给解码设备120。信道130可以包括能够将编码后的视频数据从编码设备110传输到解码设备120的一个或多个媒体和/或装置。
在一个实例中,信道130包括使编码设备110能够实时地将编码后的视频数据直接发射到解码设备120的一个或多个通信媒体。在此实例中,编码设备110可根据通信标准来调制编码后的视频数据,且将调制后的视频数据发射到解码设备120。其中通信媒体包含无线通信媒体,例如射频频谱,可选的,通信媒体还可以包含有线通信媒体,例如一根或多根物理传输线。
在另一实例中,信道130包括存储介质,该存储介质可以存储编码设备110编码后的视频数据。存储介质包含多种本地存取式数据存储介质,例如光盘、DVD、快闪存储器等。在该实例中,解码设备120可从该存储介质中获取编码后的视频数据。
在另一实例中,信道130可包含存储服务器,该存储服务器可以存储编码设备110编码后的视频数据。在此实例中,解码设备120可以从该存储服务器中下载存储的编码后的视频数据。可选的,该存储服务器可以存储编码后的视频数据且可以将该编码后的视频数据发射到解码设备120,例如web服务器(例如,用于网站)、文件传送协议(FTP)服务器等。
一些实施例中,编码设备110包含视频编码器112及输出接口113。其中,输出接口113可以包含调制器/解调器(调制解调器)和/或发射器。
在一些实施例中,编码设备110除了包括视频编码器112和输入接口113外,还可以包括视频源111。
视频源111可包含视频采集装置(例如,视频相机)、视频存档、视频输入接口、计算机图形系统中的至少一个,其中,视频输入接口用于从视频内容提供者处接收视频数据,计算机图形系统用于产生视频数据。
视频编码器112对来自视频源111的视频数据进行编码,产生码流。视频数据可包括一个或多个图像(picture)或图像序列(sequence of pictures)。码流以比特流的形式包含了图像或图像序列的编码信息。编码信息可以包含编码图像数据及相关联数据。相关联数据可包含序列参数集(sequence parameter set,简称SPS)、图像参数集(picture parameter set,简称PPS)及其它语法结构。SPS可含有应用于一个或多个序列的参数。PPS可含有应用于一个或多个图像的参数。语法结构是指码流中以指定次序排列的零个或多个语法元素的集合。
视频编码器112经由输出接口113将编码后的视频数据直接传输到解码设备120。编码后的视频数据还可存储于存储介质或存储服务器上,以供解码设备120后续读取。
在一些实施例中,解码设备120包含输入接口121和视频解码器122。
在一些实施例中,解码设备120除包括输入接口121和视频解码器122外,还可以包括显示装置123。
其中,输入接口121包含接收器及/或调制解调器。输入接口121可通过信道130接收编码后的视频数据。
视频解码器122用于对编码后的视频数据进行解码,得到解码后的视频数据,并将解码后的视频数据传输至显示装置123。
显示装置123显示解码后的视频数据。显示装置123可与解码设备120整合或在解码设备120外部。显示装置123可包括多种显示装置,例如液晶显示器(LCD)、等离子体显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。
此外,图1仅为实例,本申请实施例的技术方案不限于图1,例如本申请的技术还可以应用于单侧的视频编码或单侧的视频解码。
下面对本申请实施例涉及的视频编码器进行介绍。
图2是本申请实施例提供的视频编码器的示意性框图。应理解,该视频编码器200可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。
该视频编码器200可应用于亮度色度(YCbCr,YUV)格式的图像数据上。例如,YUV比例可以为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。例如,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。
例如,该视频编码器200读取视频数据,针对视频数据中的每帧图像,将一帧图像划分成若干个编码树单元(coding tree unit,CTU),在一些例子中,CTB可被称作“树型块”、“最大编码单元”(Largest Coding unit,简称LCU)或“编码树型块”(coding tree block,简称CTB)。每一个CTU可以与图像内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTU可与一个亮度采样块及两个色度采样块相关联。一个CTU大小例如为128×128、64×64、32×32等。一个CTU又可以继续被划分成若干个编码单元(Coding Unit,CU)进行编码,CU可以为矩形块也可以为方形块。CU可以进一步划分为预测单元(prediction Unit,简称PU)和变换单元(transform unit,简称TU),进而使得编码、预测、变换分离,处理的时候更灵活。在一种示例中,CTU以四叉树方式划分为CU,CU以四叉树方式划分为TU、PU。
视频编码器及视频解码器可支持各种PU大小。假定特定CU的大小为2N×2N,视频编码器及视频解码器可支持2N×2N或N×N的PU大小以用于帧内预测,且支持2N×2N、2N×N、N×2N、N×N或类似大小的对称PU以用于帧间预测。视频编码器及视频解码器还可支持2N×nU、2N×nD、nL×2N及nR×2N的不对称PU以用于帧间预测。
在一些实施例中,如图2所示,该视频编码器200可包括:预测单元210、残差单元220、变换/量化单元230、反变换/量化单元240、重建单元250、环路滤波单元260、解码图像缓存270和熵编码单元280。需要说明的是,视频编码器200可包含更多、更少或不同的功能组件。
可选的,在本申请中,当前块可以称为当前编码单元(CU)或当前预测单元(PU)等。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建图像块。
在一些实施例中,预测单元210包括帧间预测单元211和帧内预测单元212。由于视频的一个帧中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻帧之间的时间冗余,从而提高编码效率。
帧间预测单元211可用于帧间预测,帧间预测包括运动估计(motion estimation)和运动补偿(motion compensation)。帧间预测可以参考不同帧的图像信息,帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块,用于消除时间冗余;帧间预测所使用的帧可以为P帧和/或B帧,P帧指的是向前预测帧,B帧指的是双向预测帧。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要再参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。
帧内预测单元212只参考同一帧图像的信息,预测当前码图像块内的像素信息,用于消除空间冗余。帧内预测所使用的帧可以为I帧。例如图5所示,白色的4×4块是当前块,当前块左边一行和上面一列的灰色的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如当前块是整帧的最左侧,那么当前块的左边的参考像素不可得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。
在一些实施例中,帧内预测方法还包括多参考行帧内预测方法(multiple reference line,MRL),MRL可以使用更多的参考像素从而提高编码效率。
帧内预测有多种预测模式,H.264中对4×4的块进行帧内预测的9种模式。其中模式0是将当前块上面的像素按竖直方向复制到当前块作为预测值;模式1是将左边的参考像素按水平方向复制到当前块作为预测值;模式2(DC)是将A~D和I~L这8个点的平均值作为所有点的预测值,模式3至模式8是分别按某一个角度将参考像素复制到当前块的对应位置。因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。
HEVC使用的帧内预测模式有平面模式(Planar)、DC和33种角度模式,共35种预测模式。VVC使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。AVS3使用的帧内模式有DC、Plane、Bilinear和63种角度模 式,共66种预测模式。
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。
残差单元220可基于CU的像素块及CU的PU的预测块来产生CU的残差块。举例来说,残差单元220可产生CU的残差块,使得残差块中的每一采样具有等于以下两者之间的差的值:CU的像素块中的采样,及CU的PU的预测块中的对应采样。
变换/量化单元230可量化变换系数。变换/量化单元230可基于与CU相关联的量化参数(QP)值来量化与CU的TU相关联的变换系数。视频编码器200可通过调整与CU相关联的QP值来调整应用于与CU相关联的变换系数的量化程度。
反变换/量化单元240可分别将逆量化及逆变换应用于量化后的变换系数,以从量化后的变换系数重建残差块。
重建单元250可将重建后的残差块的采样加到预测单元210产生的一个或多个预测块的对应采样,以产生与TU相关联的重建图像块。通过此方式重建CU的每一个TU的采样块,视频编码器200可重建CU的像素块。
环路滤波单元260可执行消块滤波操作以减少与CU相关联的像素块的块效应。
在一些实施例中,环路滤波单元260包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。
解码图像缓存270可存储重建后的像素块。帧间预测单元211可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测单元212可使用解码图像缓存270中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。
熵编码单元280可接收来自变换/量化单元230的量化后的变换系数。熵编码单元280可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。
本申请涉及的视频编码的基本流程如下:在编码端,将当前图像划分成块,针对当前块,预测单元210使用帧内预测或帧间预测产生当前块的预测块。残差单元220可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化单元230变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化单元230变换与量化之前的残差块可称为时域残差块,经过变换/量化单元230变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码单元280接收到变换量化单元230输出的量化后的变换系数,可对该量化后的变换系数进行熵编码,输出码流。例如,熵编码单元280可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。
另外,视频编码器对变换量化单元230输出的量化后的变换系数进行反量化和反变换,得到当前块的残差块,再将当前块的残差块与当前块的预测块进行相加,得到当前块的重建块。随着编码的进行,可以得到当前图像中其他图像块对应的重建块,这些重建块进行拼接,得到当前图像的重建图像。由于编码过程中引入误差,为了降低误差,对重建图像进行滤波,例如,使用ALF对重建图像进行滤波,以减小重建图像中像素点的像素值与当前图像中像素点的原始像素值之间差异。将滤波后的重建图像存放在解码图像缓存270中,可以为后续的帧作为帧间预测的参考帧。
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。
图3是本申请实施例提供的视频解码器的示意性框图。
如图3所示,视频解码器300包含:熵解码单元310、预测单元320、反量化/变换单元330、重建单元340、环路滤波单元350及解码图像缓存360。需要说明的是,视频解码器300可包含更多、更少或不同的功能组件。
视频解码器300可接收码流。熵解码单元310可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码单元310可解析码流中的经熵编码后的语法元素。预测单元320、反量化/变换单元330、重建单元340及环路滤波单元350可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。
在一些实施例中,预测单元320包括帧间预测单元321和帧内预测单元322。
帧间预测单元321可执行帧内预测以产生PU的预测块。帧间预测单元321可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧间预测单元321还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。
帧内预测单元322可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码单元310可解析PU的运动信息。帧内预测单元322可根据PU的运动信息来确定PU的一个或多个参考块。帧内预测单元322可根据PU的一个或多个参考块来产生PU的预测块。
反量化/变换单元330可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换单元330可使用与TU的CU相关联的QP值来确定量化程度。
在逆量化变换系数之后,反量化/变换单元330可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。
重建单元340使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建单元340可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。
环路滤波单元350可执行消块滤波操作以减少与CU相关联的像素块的块效应。
在一些实施例中,环路滤波单元350包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。
视频解码器300可将CU的重建图像存储于解码图像缓存360中。视频解码器300可将解码图像缓存360中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。
本申请涉及的视频解码的基本流程如下:熵解码单元310可解析码流得到当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。重建块组成重建图像,环路滤波单元350基于图像或基于块对重建图像进行环路滤波,得到解码图像。该解码图像也可以称为重建图像,该重建图像一方面可以被显示设备进行显示,另一方面可以存放在解码图像缓存360中,为后续的帧作为帧间预测的参考帧。
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
下面对本申请涉及的量化相关技术进行介绍。
国际视频编码标准制定组织JVET已成立超越H.266/VVC编码模型研究的小组,并将该模型,即平台测试软件,命名为增强的压缩模型(Enhanced Compression Model,ECM)。ECM在VVC的参考软件测试平台(VVC TEST MODEL,VTM)VTM10.0的基础上开始接收更新和更高效的压缩算法,目前已超越VVC约13%的编码性能。ECM不仅扩大了特定分辨率的编码单元尺寸,同时也集成了许多帧内预测和帧间预测技术。
本申请实施例提供的技术方案可以理解为在ECM参考软件之上改进,以求得到更高的编码效率。
现实自然视频中经常存在视频内容上的光照强度变化,如随着时间流逝光照强度下降,乌云遮挡抑或是相机的闪光灯强度变化等视频内容。这些视频内容与前后帧图像的差别主要在于图像直流分量的强弱,对于内容中的纹理信息基本没有变化。但碍于较大的直流分量数值影响,对于帧间预测技术的运动搜索与运动补偿并不能有效的预测这些内容,容易编入较多的残差信息。局部光照补偿技术(Local Illuminance Compensation,LIC)能够很好的去除这些直流冗余信息,准确预测亮度变化和做出对应的补偿,使得残差信息更小,提高编码效率。在一些实施例中,将局部光照补偿技术简称为光照补偿。
当前最新视频编解码标准H.266/VVC已经定稿,JVET提出在VVC基础之上探索超越VVC编码性能的视频编解码标准,以beyond VVC为目的创立探索实验EE2。探索实验所用的平台参考软件以VTM11.0为基础,新的算法将集成到上面并将分支改成为ECM,同时针对ECM成立多个专家讨论组。最新的ECM参考软件4.0版本已经拥有超过VVC约15%的编码性能,而作为当前最新标准的VVC也仅比上一代视频编解码标准H.265/HEVC高出约27%的编码性能,可以想象在不久的将来,或许以ECM为基础开启下一代视频编解码标准探索和研究的窗口。
在ECM提出初期,参考软件中已集成VVC不具有的编码工具,而这些编码工具为ECM的不同编码场景提供了高效的编码性能和处理能力,这其中就包括LIC。
下文对一些实施例涉及的ECM中的LIC进行简单介绍。
光照补偿技术为一种帧间编码技术,在帧间编码过程中,当前编码单元根据运动矢量MV信息获取对应的参考块,而这参考块通常来自不同的编码帧,或者说参考编码单元并不属于当前图像。不同帧的图像在一些特定场景下有或大或小的变化,而光照补偿技术对其中一些变化的处理十分有效。
以图4A和图4B为例,从图4A和图4B的纹理信息基本相同,不同点在于两者的亮度变化。由于4B经过相机的闪光灯照射而显得十分的明亮,图4A为正常自然光照射。两者相比产生了差异,而这个差异在视频编码当中所带来的负担是巨大的。假设图4A以图4B作为参考编码单元,两者的纹理信息相同,所以纹理细节上的差异是很小的,但残差整体却很大。因为,图4B的像素由于闪光灯的作用,像素样本整体做了偏移,两者的残差中包含了这部分偏移。若将这部分残差直接变换和量化后写入码流当中,则这部分的开销是巨大的。
ECM参考软件中的光照补偿技术通过线性拟合的方式来消除上述光照变化,如因闪光灯或者光照变化带来的影响,使得整体的预测效果更好。
在一些实施例中,光照补偿技术的主要部分如下:
利用参考编码单元(也称为参考块)和当前编码单元(也称为当前块)相邻部分的重建样本的相关性,来拟合当前编码单元的内部预测样本与参考样本之间变化的相关性。因为当前编码单元相邻的上侧和左侧重建样本如若存在是可以获取得到的,而参考图像中参考编码单元相邻的上侧和左侧重建样本也同样是可以获取得到的。对当前帧的重建样本和参考图像的重建样本进行建模即可以得到对应的拟合模型。
建模过程中,ECM的光照补偿采用线性拟合的方式,模型简化为通过一个缩放参数a和偏置参数b组成即可以拟合当前帧与参考图像之间的光照变化。变化关系通过表示如公式(1)所示:
Pred'(x,y)=a·Pred(x,y)+b     (1)
其中,Pred(x,y)为未进行光照补偿前的预测块,Pred'(x,y)为光照补偿之后的预测块,a为光照补偿模型中的缩放参数,b为光照补偿模型中的偏移参数。
式中的a和b均需要通过当前帧的图像信息与参考帧的图像信息计算求取,通过对当前块空间相邻的已重建样本与对应参考帧中的已重建块相邻的样本进行建模得到,推导过程如公式(2)所示:
Curr_Rec neigh=a·Ref_Rec neigh+b   (2)
其中,Curr_Rec neigh为当前帧的重建图像,Ref_Rec neigh为参考帧的重建图像。
在数字视频编解码过程中,当前帧的编码块通过光照补偿模型进行光照差异的修正,得到补偿后的预测块,如图5所示。
上述缩放参数a和偏移参数b的计算需要借助参考帧中对应参考块的相邻重建样本和当前帧中编码块的相邻重建样本,根据当前帧编码单元的相邻重建样本与参考帧中对应位置的参考块的相邻重建样本之间的相关性,对其进行建 模和求解,具体如图6所示。
如上6图所示,Reconstructed pixels均为CU的最相邻重建样本,其中,Reference picture CU为参考帧中对应的已重建CU,也称为参考CU或参考块,Current picture CU为当前编码帧中待编码的CU,也称为当前CU或当前块。通过对两帧中对应Reconstructed pixels建模求解线性关系,得到缩放参数a和偏移参数b,再将该线性关系作用到Reference picture CU得到Current picture CU的预测块。
光照补偿模型在ECM中为线性模型,模型参数包含缩放因子a和偏移参数b,可选的,两者通过最小二乘法(Least Square Error)求得。根据当前编码单元的宽高大小,设定选取重建样本个数,在一些实施例中,若当前编码单元宽高其中存在等于4的情况,则均从编码单元的上侧和左侧相邻重建样本各取4个重建样本,例如当前编码单元宽为16,高为4,则从左侧相邻重建样本全取4个,从上侧相邻重建样本以步长为3取4个。若当前编码单元宽高不存在等于4的情况,则向上侧和左侧相邻重建样本获取以较小边长的2的对数个数的样本。
待获取完上侧和左侧重建样本之后计算模型参数。假设所获取得到的参考重建样本记为x,当前块的重建样本记为y;则参考重建样本和记为sumX,当前块的重建样本和记为sumY;参考重建样本的平方和记为sumXX,参考重建样本和当前重建样本的乘和记为sumXY,则根据如下公式(3)和公式(4)计算得到参数a和b:
a=(sumXY-sumXsumY)/(sumXX–sumXsumX)      (3)
b=sumY–a*sumX              (4)
其中,sumXsumY为sumX乘以sumY,在ECM参考软件的计算过程中存在一些移位操作均为简化过程,在此不细展开。在得到线性模型参数后,通过对运动补偿之后的预测块做线性变换得到最终的预测块。
上述用于计算线性模型参数的重建样本若属于帧间预测块,则需要插值操作。
在一些实施例中,ECM中的光照补偿技术可以作用在普通帧间预测、合并预测模式和子块模式,其中普通帧间预测即为inter模式,合并预测模式即为合并预测技术Merge模式,而子块模式则为affine模式。同时,光照补偿技术只作用在单帧预测模式,而对于多帧双向参考模式则禁止使用。
在一些实施例中,ECM中的光照补偿技术与已采纳技术有耦合关系,例如光照补偿技术不与双向光流技术(Bi-directional optical flow,BDOF)、对称运动矢量差技术(symmetric MVD mode,SMVD)等同时使用。
上述实施例所述的光照补偿技术在确定参数a和b时,若上侧重建样本和左侧参考样本均可用,则选取当前块和参考块的上侧和左侧的重建样本。
但是,在一些情况下,例如当编码块中存在像素差异较大且大部分更接近单边的重建像素,而和另一边的重建像素差距较大时,基于上侧和左侧的重建样本,不能很好地预测当前编码块,存在线性偏移不足或过偏的问题。
为了解决上述技术问题,本申请实施例增加了重建样本的选择方式,即增加重建样本模式,例如增加了左侧重建样本模式和/或上侧重建样本模式,其中左侧重建样本模式下的重建样本均来自图像块的左侧相邻样本,上侧重建样本模式下的重建样本均来自图像块的上侧相邻样本。这样,在对当前块的预测值进行光照补偿时,根据实际情况,从多种重建样本模式中进行选择,进而提高光照补偿的效果,提升预测性能。
下面结合具体的实施例对本申请实施例提供的技术方案进行详细描述。
首先结合图7,以解码端为例进行介绍。
图7为本申请实施例提供的一种视频解码码方法的流程示意图,本申请实施例应用于图1和图3所示视频解码器。如图7所示,本申请实施例的方法包括:
S401、解码码流,并对当前块进行预测,得到当前块的第一预测值。
在对当前块进行解码时,解码端解码码流,确定当前块对应的预测模式,根据预测模式对当前块进行预测,得到当前块的预测值,由于本申请实施例对该步骤得到预测值进行光照补偿,得到新的预测值,因此为了便于描述,本申请实施例将根据预测模式得到的预测值记为第一预测值,将对第一预测值进行光照补偿得到的预测值,记为第二预测值。
本申请实施例对当前块的预测方式不做限制。
在一些实施例中,采用帧间预测模式,对当前块进行预测,得到当前块的第一预测值。例如,解码码流,得到当前块对应的运动信息,根据运动信息从参考帧中找到参考块,根据参考块生成当前块的第一预测值。示例性的,运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整样本的或者是分样本的,如果运动矢量是分样本的,那么需要再参考帧中使用插值滤波做出所需的分样本的块,这里把根据运动矢量找到的参考帧中的整样本或者分样本的块叫参考块。在一些实施例中,直接把参考块作为预测块,在一些实施例中,在参考块的基础上再处理生成预测块。
S402、确定当前块的重建样本模式。
其中,重建样本模式为N个候选模式中的一模式,N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个。
需要说明的是,上述S402与上述S401在执行过程中没有严格的顺序要求,例如,上述S402可以在上述S401之前执行,或者在S401之后执行,或者与上述S401同步执行,本申请实施例对此不作限制。
由上述可知,为了提高预测效果,对得到的第一预测值进行光照补偿,得到第二预测值,具体是,确定当前块的相邻重建样本和参考块的相邻重建样本,根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,根据该线性变换参数对第一预测值进行线性变换,得到当前块的第二预测值。
为了提高光照补偿效果,本申请实施例增加了几种新的确定重建样本的方式,例如增加了上侧重建样本模式和/或左侧重建样本模式。
其中,左侧重建样本模式是指当前块的相邻重建样本中的样本均来自当前块的左侧相邻重建样本,参考块的相邻 重建样本中的样本均来自参考块的左侧相邻重建样本。
其中,上侧重建样本模式是指当前块的相邻重建样本中的重建样本均来自当前块的上侧相邻重建样本,参考块的相邻重建样本中的重建样本均来自参考块的上侧相邻重建样本。
其中,上侧和左侧重建样本模式是指当前块的相邻重建样本中的重建样本均来自当前块的上侧和左侧相邻重建样本,参考块的相邻重建样本中的重建样本均来自参考块的上侧和左侧相邻重建样本。
这样解码端在解码时,首先确定当前块的重建样本模式,其中,当前块的重建样本模式可以是N个候选模式中的一个模式,而N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个。也就是说,本申请实施例,当前块的重建样本模式可以是上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的一模式,进而不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出与当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以确定出更加准确地确定出当前块的相邻重建样本和参考块的相邻重建样本,并基于该当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,进而提高了当前块的光照补偿效果,提升了当前块的预测效果。
本申请实施例中,解码端确定当前块的重建样本模式的方式包括但不限于如下几种:
方式一,通过索引指示当前块的重建样本模式,此时上述S402包括如下S402-A1和S402-A2的步骤:
S402-A1、确定第一索引,该第一索引用于指示重建样本模式;
S402-A2、根据当前块对应的第一索引,确定当前块的重建样本模式。
在该方式一中,通过第一索引来指示当前块的重建样本模式,这样解码端在确定当前块的重建样本模式时,首先确定第一索引,进而根据第一索引确定当前块的重建样本模式。
示例性的,假设N个候选模式如表1所示:
表1
索引 候选模式
0 上侧重建样本模式
1 左侧重建样本模式
2 上侧和左侧重建样本模式
…… ……
本申请实施例对N个候选模式的具体模式和模式的个数不做限制,示例性的,如表1所示,这N个候选模式包括上侧重建样本模式、左侧重建样本模式、以及上侧和左侧重建样本模式,其中上侧重建样本模式的索引为0,左侧重建样本模式的索引为1,上侧和左侧重建样本模式的索引为2。需要说明的是,好表1示出的各模式对应的索引只是一种示例,本申请不局限于此。
如表1所示,各候选模式对应一个索引,这样解码端在确定当前块的重建样本模式时,可以确定第一索引,并根据第一索引,确定出当前块的重建样本模式,例如第一索引为1,则如表1所示,索引1对应左侧重建样本模式,这样解码端确定当前块的重建样本模式为左侧重建样本模式。
上述S402-A1、确定所述当前块对应的第一索引的方式包括但不限于如下几种:
方式1,解码码流,得到当前块对应的第一索引。
具体的,编码端从N个候选模式中选出一模式,例如选择代价最小的一候选模式作为当前块的重建样本模式,并将该重建样本模式的第一索引写入码流。这样解码端在解码时,解码码流,得到该第一索引,进而根据该第一索引确定出当前块的重建样本模式。
该方式1解码端可以直接从码流中得到第一索引,其计算过程简单,降低了解码端的解码复杂度,提高了解码端的解码效率。
方式2,若当前块的预测模式为Merge模式,则解码端通过如下S402-A1-11和S402-A1-12的步骤,确定第一索引:
S402-A1-11、确定当前块的相邻块的第一标志,该相邻块的第一标志用于指示相邻块是否使用局部光照补偿技术;
S402-A1-12、根据相邻块的第一标志,确定第一索引。
在该方式2中,若解码端确定当前块的预测模式为Merge模式时,则解码端可以根据当前块的相邻块的相关解码信息,确定第一索引。其中,当前块的相邻块为已解码的块,该相邻块的相关解码信息已知,在解码当前块时,解码端可以从相邻块中得到该相邻块的解码信息。
可选的,当前块的相邻块可以为当前块的上侧相邻块。
可选的,当前块的相邻块还可以是当前块的左侧相邻块。
在一些实施例中,将本申请实施例提出的光照补偿技术称为光照补偿技术。
解码端在对当前块进行光照补偿时,若当前块的预测模式为Merge模式时,则解码端根据当前块的相邻块是否使用本光照补偿技术,来确定当前块是否使用光照补偿技术。例如,相邻块使用光照补偿技术,则确定当前块也使用光照补偿技术。
基于此,解码端从相邻块中得到相邻块的第一标志,该相邻块的第一标志用于指示该相邻块是否使用光照补偿技术,并根据相邻块的第一标志,确定第一索引。
本申请实施例对S402-A1-12中根据相邻块的第一标志,确定第一索引的方式不做限制。
在一种可能的实现方式中,若相邻块的第一标志指示相邻块使用局部光照补偿技术,则确定第一索引为默认索引,该默认索引用于指示上侧和左侧重建样本模式。也就是说,在该实现方式中,若当前块的预测模式为Merge模式,且 当前块的相邻块采用光照补偿技术,则使用上侧和左侧重建样本模式对当前块的第一预测值进行光照补偿,得到当前块的第二预测值。
在另一种可能的实现方式中,若相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定第二索引,该第二索引用于指示相邻块的重建样本模式;将第二索引,确定为第一索引。在该实现方式中,若当前块的预测模式为Merge模式,且当前块的相邻块采用光照补偿技术,当前块不仅继承相邻块的标志,也继承相邻块的索引,则将相邻块对应的第二索引,确定为当前块的第一索引。
在一些实施例中,若相邻块的第一标志指示相邻块不使用局部光照补偿技术时,则确定当前块也不使用本申请实施例提供的光照补偿扩展方案,而是使用与相邻块相同的光照补偿方式进行光照补偿,例如,使用上侧和左侧重建样本模式对当前块的第一预测值进行光照补偿,得到当前块的第二预测值。或者,对当前块的第一预测值不进行光照补偿。
方式3,若当前块的预测模式为非Merge模式,则解码端通过如下S402-A1-21至S402-A1-23的步骤,确定第一索引:
S402-A1-21、确定当前块的第一标志,当前块的第一标志用于指示当前块是否使用光照补偿技术;
S402-A1-22、若当前块的第一标志指示当前块使用光照补偿技术时,则确定当前块的第二标志,当前块的第二标志用于指示当前块是否使用光照补偿扩展技术;
S402-A1-23、根据当前块的第二标志,确定第一索引。
示例性的,当前块的第一标志为1时,指示当前块使用光照补偿技术,若当前块的第一标志为0时,指示当前块不使用光照补偿技术。
若当前块的第一标志指示当前块不使用光照补偿技术时,例如,当前块的第一标志为0时,则解码端将第一预测值确定为第二预测值,或者采用其他的方式对第一预测值进行处理,得到第二预测值。
若当前块的第一标志指示当前块使用光照补偿技术时,例如,当前块的第一标志为1时,则解码端确定当前块的第二标志,该当前块的第二标志用于指示当前块是否使用本申请的光照补偿扩展技术。
示例性的,当前块的第二标志为1时,指示当前块使用光照补偿扩展技术,若当前块的第二标志为0时,指示当前块不使用光照补偿扩展技术。
本申请实施例中,解码端可以根据当前块的第二标志,确定第一索引。
例如,若当前块的第二标志指示当前块使用光照补偿扩展技术,则通过解码码流,得到第一索引。
再例如,若当前块的第二标志指示当前块不使用光照补偿扩展技术,则确定第一索引为默认索引,该默认索引用于指示上侧和左侧重建样本模式。
在一些实施例中,解码端,解码码流,得到当前块的第一标志,也就是说,编码端确定当前块对应的当前块的第一标志,并将该当前块的第一标志写入码流,解码端可以直接解码得到该当前块的第一标志。
在一些实施例中,解码端解码码流,得到当前块的第二标志,也就是说,编码端确定当前块的第二标志,并将该当前块的第二标志写入码流,解码端可以直接解码得到该当前块的第二标志。
在一些实施例中,上述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
在一种示例中,上述第一标志包括序列级标志,该序列级标志用于指示当前序列是否使用光照补偿技术。
可选的,可以使用sps_lic_enable_flag表示序列级标志。
可选的,上述序列级标志可以位于序列头(sequence header)中。
在另一种示例中,上述第一标志包括图像级标志,该图像级标志用于指示当前图像是否使用光照补偿技术。
可选的,可以使用ph_lic_enable_flag表示图像级标志。
可选的,该图像级标志可以位于图像头(picture header)中。
在另一种示例中,上述第一标志包括块级标志,该块级标志用于指示图像块是否使用光照补偿技术。
可选的,可以使用lic_flag表示块级标志。
在一些实施例中,上述第一标志还可以包括片级标志、单元级标志等。
在一些实施例中,第二标志包括块级标志。
可选的,可以使用语法lic_ext表示第二标志。
以第二标志为lic_ext为例,若该lic_ext为1,则确定当前块不使用本申请提出的光照补偿扩展技术,若lic_ext为0,则确定当前块使用本申请提出的光照补偿扩展技术。
在一种可能的实现方式中,编码单元级语法如表2所示:
表2
Figure PCTCN2022086725-appb-000001
Figure PCTCN2022086725-appb-000002
解码端对上述表2所示的语法进行解析,首先得到当前块的第一标志,包括sps_lic_enable_flag && ph_lic_enable_flag,若sps_lic_enable_flag=1,则确定当前序列使用光照补偿技术,接着解码端继续解析ph_lic_enable_flag,若ph_lic_enable_flag=1,则确定当前图像或当前帧使用光照补偿技术。接着,解码端继续解析lic_flag,若该lic_flag=1,则表示当前块使用光照补偿技术。接着,解码端继续解析当前块的第二标志lic_ext,若lic_ext=0,说明当前块不使用本申请提出的光照补偿扩展技术,此时,确定当前块的重建样本模式为上侧和左侧重建样本模式。若lic_ext=1说明当前块使用本申请提出的光照补偿扩展技术,此时,解码端继续解码码流,得到第一索引lic_index,若lic_index=0,则确定当前块的重建样本模式为上侧重建样本模式,若lic_index=1,则确定当前块的重建样本模式为左侧重建样本模式。
本申请实施例中,解码端根据上述确定出第一索引后,根据第一索引确定当前块的重建样本模式,并基于该重建样本模式确定当前块的相邻重建样本和参考块的相邻重建样本;根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据线性变换参数对当前块的第一预测值进行线性变换,得到当前块的第二预测值,实现对当前块的精确光照补偿。
解码端除了使用上述方式一确定当前块的重建样本模式外,还可以如下方式二,确定当前块的重建样本模式。
方式二,若当前块的预测模式为Merge模式,则根据当前块的相邻块的解码信息,确定当前块的重建样本模式。此时上述S402包括如下S402-B1和S402-B2的步骤:
S402-B1、确定当前块的相邻块的相邻块的第一标志,相邻块的第一标志用于指示相邻块是否使用光照补偿技术;
S402-B2、根据相邻块的第一标志,确定当前块的重建样本模式。
在该方式二中,解码端在确定当前块的预测模式为Merge模式时,则根据当前块的相邻块的第一标志,直接确定当前块的重建样本模式,而不用确定第一索引,整个过程更加简单有效。
其中,S402-B1中确定当前块的相邻块的第一标志的过程参照上述S402-A11的描述,在此不再赘述。
其中,S402-B2中根据相邻块的第一标志,确定当前块的重建样本模式的方式包括但不限于如下几种:
方式1,若相邻块的第一标志指示相邻块使用光照补偿技术,则确定当前块的重建样本模式为上侧和左侧重建样本模式。
在该方式1中,若当前块的预测模式为Merge模式,且当前块的相邻块采用光照补偿技术,则解码端默认当前块的重建样本模式为上侧和左侧重建样本模式,进而直接使用上侧和左侧重建样本模式对当前块的第一预测值进行光照补偿,得到当前块的第二预测值。
方式2,若相邻块的第一标志指示相邻块使用光照补偿技术,则确定相邻块的重建样本模式;将相邻块的重建样本模式,确定为当前块的重建样本模式。
在该方式2中,若当前块的预测模式为Merge模式,且当前块的相邻块采用光照补偿技术,则解码端将当前块的相邻块的重建样本模式确定为当前块的重建样本模式。具体是,解码端从相邻块中得到相邻块的重建样本模式,并使用相邻块的重建样本模式对当前块的第一预测值进行光照补偿,得到第二预测值。
其中,解码端确定当前块的相邻块的重建样本模式的方式至少包括如下几种示例:
示例1,解码端直接从相邻块中获得该相邻块的重建样本模式。
示例2,解码端从相邻块中得到第二索引,该第二索引用于指示该相邻块的重建样本模式,这样解码端根据该第二索引,确定相邻块的重建样本模式,例如第二索引为0,如表1所示,则确定相邻块的重建样本模式为上侧重建样本模式。
在该方式二中,若当前块采用Merge模式进行预测时,则解码端根据当前块的相邻块的第一标志和/或第一索引,直接确定出当前块的重建样本模式。
解码端根据上述方式一或方式二,确定出当前块的重建样本模式后,执行如下S403的步骤。
S403、根据当前块的重建样本模式,确定当前块的相邻重建样本和参考块的相邻重建样本。
其中,当前块的相邻重建样本为根据当前块的重建样本模式,从当前块的左侧和/或上侧重建样本中确定出的重建样本。
其中,参考块的相邻重建样本为根据当前块的重建样本模式,从当前块的参考块的左侧和/或上侧重建样本中确定出的重建样本。
本申请实施例中,若当前块的重建样本模式不同时,则确定出的当前块的相邻重建样本和参考块的相邻重建样本也不相同。
下面主要对左侧重建样本模式和上侧重建样本模式为例,对上述S403进行介绍。
在一些实施例中,若当前块的重建样本模式为左侧重建样本模式,则上述S403包括如下S403-A的步骤:
S403-A、根据当前块的左侧相邻样本,确定当前块的相邻重建样本,根据参考帧中当前块对应的参考块的左侧相邻样本,确定参考块的相邻重建样本。
在该实施例中,若当前块的重建样本模式为左侧重建样本模式,则从左侧相邻样本中,确定当前块的相邻重建样 本,其中左侧相邻样本均为已重建的样本。例如,如图8A所示,根据当前块的左侧相邻样本,确定当前块的相邻重建样本,再例如,在参考帧中确定当前块的参考块,如图8B所示,根据参考帧中该参考块的左侧相邻样本,确定参考块的相邻重建样本。进而根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到当前块的第二预测值。
本申请实施例对上述S403-A中根据当前块的左侧相邻样本,确定当前块的相邻重建样本的具体方式不做限制。
在一种实现方式中,将当前块的左侧相邻的多个重建样本,确定为当前块的相邻重建样本。
在另一种实现方式中,如图8A所示,根据当前块的高度和当前块的左侧相邻样本,确定当前块的相邻重建样本。
示例1,将当前块的左侧与当前块相邻且在当前块的高度范围内的重建样本,确定为当前块的相邻重建样本。例如,当前块的高度为4,则将当前块左侧相邻的4个重建样本,确定为当前块的相邻重建样本。
示例2,若当前块的高度等于第一数值,则从当前块的左侧相邻样本中选择第一数值个样本,确定当前块的相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若当前块的高度等于4时,则从当前块的左侧相邻样本中选择4个样本,确定为当前块的相邻重建样本。
示例2,若当前块的高度不等于第一数值,则从当前块的左侧相邻样本中选择第二数值个样本,确定当前块的相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2。
第二数值为log2(高度)的值再取值。
举例说明,假设当前块的高度为32,则确定出第二数值为5,进而解码端从当前块的左侧相邻16个样本中选择5个样本,作为当前块的相邻重建样本。其中,这5个样本是通过等步长选择的,也可以是随机选取的,本申请实施例对此不作限制。
同理,本申请实施例对上述S403-A中根据参考帧中当前块对应的参考块的左侧相邻样本,确定参考块的相邻重建样本的具体方式不做限制。
在一种实现方式中,将参考帧中参考块的左侧相邻的多个重建样本,确定为参考块的相邻重建样本。
在另一种实现方式中,如图8B所示,根据参考块的高度和参考块的左侧相邻样本,确定参考块的相邻重建样本。
示例1,将参考帧中参考块的左侧与参考块相邻且在参考块的高度范围内的重建样本,确定为参考块的相邻重建样本。例如,参考块的高度为4,则将参考帧中参考块左侧相邻的4个重建样本,确定为参考块的相邻重建样本。
示例2,若参考块的高度等于第一数值,则对参考块的左侧相邻样本进行插值得到第一数值个样本,作为参考块的相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若参考块的高度等于4时,则对参考块的左侧相邻样本进行插值得到4个样本,确定为参考块的相邻重建样本。
示例2,若参考块的高度不等于第一数值,则对参考块的左侧相邻样本进行插值得到第二数值个样本,作为参考块的相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2。
第二数值为log2(高度)的值再取值。
举例说明,假设参考块的高度为32,则确定出第二数值为5,进而解码端对参考块的左侧相邻16个样本进行插值得到5个样本,作为参考块的相邻重建样本。
本申请实施例中,若当前块的重建样本模式为左侧重建样本模式时,则根据上述任意方式,确定出当前块的相邻重建样本和参考块的相邻重建样本,其中当前块的相邻重建样本只与当前块的左侧相邻样本相关,参考块的相邻重建样本只与参考块的左侧相邻样本相关。
在一些实施例中,若当前块的重建样本模式为上侧重建样本模式,则上述S403包括如下S403-B的步骤:
S403-B、根据当前块的上侧相邻样本,确定当前块的相邻重建样本,根据参考帧中当前块对应的参考块的上侧相邻样本,确定参考块的相邻重建样本。
在该实施例中,若当前块的重建样本模式为上侧重建样本模式,则从上侧相邻样本中,确定当前块的相邻重建样本,其中上侧相邻样本均为已重建的样本。例如,如图9A所示,根据当前块的上侧相邻样本,确定当前块的相邻重建样本,再例如,在参考帧中确定当前块的参考块,如图9B所示,根据参考帧中该参考块的上侧相邻样本,确定参考块的相邻重建样本。进而根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到当前块的第二预测值。
本申请实施例对上述S403-B中根据当前块的上侧相邻样本,确定当前块的相邻重建样本的具体方式不做限制。
在一种实现方式中,将当前块的上侧相邻的多个重建样本,确定为当前块的相邻重建样本。
在另一种实现方式中,如图9A所示,根据当前块的高度和当前块的上侧相邻样本,确定当前块的相邻重建样本。
示例1,将当前块的上侧与当前块相邻且在当前块的高度范围内的重建样本,确定为当前块的相邻重建样本。例如,当前块的高度为4,则将当前块上侧相邻的4个重建样本,确定为当前块的相邻重建样本。
示例2,若当前块的高度等于第一数值,则从当前块的上侧相邻样本中选择第一数值个样本,确定当前块的相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若当前块的高度等于4时,则从当前块的上侧相邻样本中选择4个样本,确定为当前块的相邻重建样本。
示例2,若当前块的高度不等于第一数值,则从当前块的上侧相邻样本中选择第二数值个样本,确定当前块的相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2。
第二数值为log2(高度)的值再取值。
举例说明,假设当前块的高度为32,则确定出第二数值为5,进而解码端从当前块的上侧相邻16个样本中选择5个样本,作为当前块的相邻重建样本。其中,这5个样本是通过等步长选择的,也可以是随机选取的,本申请实施例对此不作限制。
同理,本申请实施例对上述S403-B中根据参考帧中当前块对应的参考块的上侧相邻样本,确定参考块的相邻重建样本的具体方式不做限制。
在一种实现方式中,将参考帧中参考块的上侧相邻的多个重建样本,确定为参考块的相邻重建样本。
在另一种实现方式中,如图9B所示,根据参考块的高度和参考块的上侧相邻样本,确定参考块的相邻重建样本。
示例1,将参考帧中参考块的上侧与参考块相邻且在参考块的高度范围内的重建样本,确定为参考块的相邻重建样本。例如,参考块的高度为4,则将参考帧中参考块上侧相邻的4个重建样本,确定为参考块的相邻重建样本。
示例2,若参考块的高度等于第一数值,则对参考块的上侧相邻样本进行插值得到第一数值个样本,作为参考块的相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若参考块的高度等于4时,则对参考块的上侧相邻样本进行插值得到4个样本,作为参考块的相邻重建样本。
示例2,若参考块的高度不等于第一数值,则对参考块的上侧相邻样本进行插值得到第二数值个样本,作为参考块的相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2。
第二数值为log2(高度)的值再取整。
举例说明,假设参考块的高度为32,则确定出第二数值为5,进而解码端对参考块的上侧相邻16个样本进行插值得到5个样本,作为参考块的相邻重建样本。
本申请实施例中,若当前块的重建样本模式为上侧重建样本模式时,则根据上述任意方式,确定出当前块的相邻重建样本和参考块的相邻重建样本,其中当前块的相邻重建样本只与当前块的上侧相邻样本相关,参考块的相邻重建样本只与参考块的上侧相邻样本相关。
解码端根据上述方法,确定出当前块的相邻重建样本和参考块的相邻重建样本后,执行如下S404。
S404、根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据线性变换参数对第一预测值进行线性变换,得到当前块的第二预测值。
本申请实施例对根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数的具体方式不做限制。
在一些实施例中,若线性变换参数包括缩放因子和偏移参数时,则上述S404中根据当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数包括如下步骤:
S404-A1、根据当前块的相邻重建样本和参考块的相邻重建样本,确定缩放因子;
S404-A2、根据当前块的相邻重建样本、参考块的相邻重建样本以及所述缩放因子,确定偏移参数。
本申请实施例对上述S404-A1中根据当前块的相邻重建样本和参考块的相邻重建样本,确定缩放因子a的方式不做限制。
在一种可能的实现方式中,将当前块的相邻重建样本与参考块的相邻重建样本的比值,确定缩放因子a。
在另一种可能的实现方式中,根据上述公式(3)确定缩放因子a。
本申请实施例对上述S404-A2中根据当前块的相邻重建样本、参考块的相邻重建样本以及所述缩放因子,确定偏移参数的方式不做限制。
在一种可能的实现方式中,根据上述公式(4)确定偏移参数b。
根据上述方法,确定出线性变换参数后,使用该线性变换参数,对第一预测值进行线性变换,得到当前块的第二预测值,例如,确定缩放因子与第一预测值的乘积;将乘积与偏移参数的和,确定为第二预测值。
在一种示例中,根据如下公式(5)确定第二预测值:
P'(x,y)=a·P(x,y)+b     (5)
其中,P(x,y)为未进行光照补偿前的预测块,即当前块的第一预测值,P'(x,y)为光照补偿之后的预测块,即当前块的第二预测值,a为缩放参数,b为偏移参数。
在一些实施例中,若当前块所属的当前图像为第一类型帧,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S402确定当前块的重建样本模式。
本申请实施例第一类型帧的具体类型不做限制。
可选的,第一类型帧为B帧,即当前图像为B帧,则默认开启本申请提出的光照补偿扩展技术。
在一些实施例中,若当前块的面积大于或等于预设阈值,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S402确定当前块的重建样本模式。
本申请对预设阈值的具体取值不做限制。
可选的,预设阈为64,即当前块的面积大于或等于预设阈值,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S402确定当前块的重建样本模式。
本申请实施例提供的视频解码方法,解码码流,并对当前块进行预测得到当前块的第一预测值;确定当前块的重建样本模式,重建样本模式为N个候选模式中的一模式,N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;根据当前块的重建样本模式,确定当前块的相邻重建样本和参考块的相邻重建样本;根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据线性变换参数对第一预测值进行线性变换,得到当前块的第二预测值。本申请实施例,当前块的重建样本模式可以是上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的一模式,进而不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出与当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以更加准确得到当前块的相邻重建样本和参考块的相邻重建样本,并基于准确得到的当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,进而提高了当前块的光照补偿效果,提升了当前块的预测效果。
上文对本申请实施例涉及的视频解码方法进行了描述,在此基础上,下面针对编码端,对本申请涉及的视频解码方法进行描述。
图10为本申请实施例提供的视频编码方法的一种流程示意图。本申请实施例的执行主体可以为上述图1和图2所示的编码器。
如图10所示,本申请实施例的方法包括:
S701、对当前块进行预测,得到当前块的第一预测值。
在对当前块进行编码时,编码确定当前块对应的预测模式,根据预测模式对当前块进行预测,得到当前块的预测值,由于本申请实施例对该步骤得到预测值进行光照补偿,得到新的预测值,因此为了便于描述,本申请实施例将根据预测模式得到的预测值记为第一预测值,将对第一预测值进行光照补偿得到的预测值,记为第二预测值。
本申请实施例对当前块的预测方式不做限制。
在一些实施例中,采用帧间预测模式,对当前块进行预测,得到当前块的第一预测值。例如,编码端确定当前块对应的运动信息,根据运动信息从参考帧中找到参考块,根据参考块生成当前块的第一预测值。示例性的,运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整样本的或者是分样本的,如果运动矢量是分样本的,那么需要再参考帧中使用插值滤波做出所需的分样本的块,这里把根据运动矢量找到的参考帧中的整样本或者分样本的块叫参考块。在一些实施例中,直接把参考块作为预测块,在一些实施例中,在参考块的基础上再处理生成预测块。
S702、确定当前块的重建样本模式。
其中,重建样本模式为N个候选模式中的一模式,N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个。
需要说明的是,上述S702与上述S701在执行过程中没有严格的顺序要求,例如,上述S702可以在上述S701之前执行,或者在S701之后执行,或者与上述S701同步执行,本申请实施例对此不作限制。
由上述可知,为了提高预测效果,对得到的第一预测值进行光照补偿,得到第二预测值,具体是,确定当前块的相邻重建样本和参考块的相邻重建样本,根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,根据该线性变换参数对第一预测值进行线性变换,得到当前块的第二预测值。
为了提高光照补偿效果,本申请实施例增加了几种新的确定重建样本的方式,例如增加了上侧重建样本模式和/或左侧重建样本模式。
其中,左侧重建样本模式是指当前块的相邻重建样本中的重建样本均来自当前块的左侧相邻重建样本,参考块的相邻重建样本中的重建样本均来自参考块的左侧相邻重建样本。
其中,上侧重建样本模式是指当前块的相邻重建样本中的重建样本均来自当前块的上侧相邻重建样本,参考块的相邻重建样本中的重建样本均来自参考块的上侧相邻重建样本。
其中,上侧和左侧重建样本模式是指当前块的相邻重建样本中的重建样本均来自当前块的上侧和左侧相邻重建样本,参考块的相邻重建样本中的重建样本均来自参考块的上侧和左侧相邻重建样本。
这样解码端在解码时,首先确定当前块的重建样本模式,其中,当前块的重建样本模式可以是N个候选模式中的一个模式,而N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个。也就是说,本申请实施例,增加了重建样本的选择方式,即增加重建样本模式,例如增加了左侧重建样本模式和/或上侧重建样本模式,其中左侧重建样本模式下的重建样本均来自图像块的左侧相邻样本,上侧重建样本模式下的重建样本均来自图像块的上侧相邻样本。这样,在对当前块的预测值进行光照补偿时,根据实际情况,从多种重建样本模式中进行选择,进而提高光照补偿的效果,提升预测性能。
本申请实施例对上述确定当前块的重建样本模式的具体方式不做限制。
在一些实施例中,将N个候选模式中的任意一个候选模式确定为当前块的重建样本模式。
在一些实施例中,对当前块进行分析,根据当前块中样本的特征确定当前块的重建样本模式。例如,若当前块中的样本差异较大且大部分更接近上侧的重建样本,此时,则将上侧重建样本模式确定为当前块的重建样本模式,若当前块中的样本差异较大且大部分更接近左侧的重建样本,此时,则将左侧重建样本模式确定为当前块的重建样本模式,若当前块中的样本差异不大,此时,则将上侧和左侧重建样本模式确定为当前块的重建样本模式。
在一些实施例中,上述S702包括如下S702-A和S702-B步骤:
S702-A、针对N个候选模式中的第i个候选模式,确定第i个候选模式对应的代价,i为从1到N的正整数;
S702-B、根据N个候选模式对应的代价,从N个候选模式中,确定出当前块的重建样本模式。
在该实施例中,编码端使用N个候选模式中的每个候选模式对当前块的第一预测值进行光照补偿处理,得到每个候选模式对应的代价,进而根据各候选模式对应的代价,从N个候选模式中选择一个候选模式作为当前块的重建样本模式。
本申请实施例中,确定N个候选模式中,每个候选模式对应的代价的过程相同,为了便于描述,以N个候选模式中的第i个候选模式为例进行说明。
上述S702-A中确定第i个候选模式对应的代价包括如下S702-A1至S702-A4的步骤:
S702-A1、根据第i个候选模式,确定当前块的第i个相邻重建样本和参考块的第i个相邻重建样本。
其中,当前块的第i个相邻重建样本为根据第i个候选模式,从当前块的左侧和/或上侧重建样本中确定出的重建样本。
其中,参考块的第i个相邻重建样本为根据第i个候选模式,从当前块的参考块的左侧和/或上侧重建样本中确定出的重建样本。
本申请实施例中,若第i个候选模式不同时,则确定出的当前块的第i个相邻重建样本和参考块的第i个相邻重建样本也不相同。
下面主要对左侧重建样本模式和上侧重建样本模式为例,对上述S702-A1进行介绍。
在一些实施例中,若第i个候选模式为左侧重建样本模式,则上述S702-A1包括如下S702-A1-A的步骤:
S702-A1-A、根据当前块的左侧相邻样本,确定当前块的第i个相邻重建样本,根据参考帧中当前块对应的参考块的左侧相邻样本,确定参考块的第i个相邻重建样本。
在该实施例中,若第i个候选模式为左侧重建样本模式,则从左侧相邻样本中,确定当前块的第i个相邻重建样本,其中左侧相邻样本均为已重建的样本。例如,如图8A所示,根据当前块的左侧相邻样本,确定当前块的第i个相邻重建样本,再例如,在参考帧中确定当前块的参考块,如图8B所示,根据参考帧中该参考块的左侧相邻样本,确定参考块的第i个相邻重建样本。进而根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到当前块的第二预测值。
本申请实施例对上述S702-A1-A中根据当前块的左侧相邻样本,确定当前块的第i个相邻重建样本的具体方式不做限制。
在一种实现方式中,将当前块的左侧相邻的多个重建样本,确定为当前块的第i个相邻重建样本。
在另一种实现方式中,如图8A所示,根据当前块的高度和当前块的左侧相邻样本,确定当前块的第i个相邻重建样本。
示例1,将当前块的左侧与当前块相邻且在当前块的高度范围内的重建样本,确定为当前块的第i个相邻重建样本。例如,当前块的高度为4,则将当前块左侧相邻的4个重建样本,确定为当前块的第i个相邻重建样本。
示例2,若当前块的高度等于第一数值,则从当前块的左侧相邻样本中选择第一数值个样本,确定当前块的第i个相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若当前块的高度等于4时,则从当前块的左侧相邻样本中选择4个样本,确定为当前块的第i个相邻重建样本。
示例2,若当前块的高度不等于第一数值,则从当前块的左侧相邻样本中选择第二数值个样本,确定当前块的第i个相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2,则第二数值为log2(高度)的值取整。
举例说明,假设当前块的高度为32,则确定出第二数值为5,进而编码端从当前块的左侧相邻16个样本中选择5 个样本,作为当前块的第i个相邻重建样本。其中,这5个样本是通过等步长选择的,也可以是随机选取的,本申请实施例对此不作限制。
同理,本申请实施例对上述S702-A1-A中根据参考帧中当前块对应的参考块的左侧相邻样本,确定参考块的第i个相邻重建样本的具体方式不做限制。
在一种实现方式中,将参考帧中参考块的左侧相邻的多个重建样本,确定为参考块的第i个相邻重建样本。
在另一种实现方式中,如图8B所示,根据参考块的高度和参考块的左侧相邻样本,确定参考块的第i个相邻重建样本。
示例1,将参考帧中参考块的左侧与参考块相邻且在参考块的高度范围内的重建样本,确定为参考块的第i个相邻重建样本。例如,参考块的高度为4,则将参考帧中参考块左侧相邻的4个重建样本,确定为参考块的第i个相邻重建样本。
示例2,若参考块的高度等于第一数值,则对参考块的左侧相邻样本进行插值得到第一数值个样本,作为参考块的第i个相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若参考块的高度等于4时,则对参考块的左侧相邻样本进行插值得到4个样本,作为为参考块的第i个相邻重建样本。
示例2,若参考块的高度不等于第一数值,则对参考块的左侧相邻样本进行插值得到第二数值个样本,作为参考块的第i个相邻重建样本。
举例说明,假设参考块的高度为32,则确定出第二数值为5,进而编码端对参考块的左侧相邻16个样本进行插值得到5个样本,作为参考块的第i个相邻重建样本。
本申请实施例中,若第i个候选模式为左侧重建样本模式时,则根据上述任意方式,确定出当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,其中当前块的第i个相邻重建样本只与当前块的左侧相邻样本相关,参考块的第i个相邻重建样本只与参考块的左侧相邻样本相关。
在一些实施例中,若第i个候选模式为上侧重建样本模式,则上述S702-A1包括如下S702-A1-B的步骤:
S702-A1-B、根据当前块的上侧相邻样本,确定当前块的第i个相邻重建样本,根据参考帧中当前块对应的参考块的上侧相邻样本,确定参考块的第i个相邻重建样本。
在该实施例中,若第i个候选模式为上侧重建样本模式,则从上侧相邻样本中,确定当前块的第i个相邻重建样本,其中上侧相邻样本均为已重建的样本。例如,如图9A所示,根据当前块的上侧相邻样本,确定当前块的第i个相邻重建样本,再例如,在参考帧中确定当前块的参考块,如图9B所示,根据参考帧中该参考块的上侧相邻样本,确定参考块的第i个重建样本。进而根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到当前块的第二预测值。
本申请实施例对上述S702-A1-B中根据当前块的上侧相邻样本,确定当前块的第i个相邻重建样本的具体方式不做限制。
在一种实现方式中,将当前块的上侧相邻的多个重建样本,确定为当前块的第i个相邻重建样本。
在另一种实现方式中,如图9A所示,根据当前块的高度和当前块的上侧相邻样本,确定当前块的第i个相邻重建样本。
示例1,将当前块的上侧与当前块相邻且在当前块的高度范围内的重建样本,确定为当前块的第i个相邻重建样本。例如,当前块的高度为4,则将当前块上侧相邻的4个重建样本,确定为当前块的第i个相邻重建样本。
示例2,若当前块的高度等于第一数值,则从当前块的上侧相邻样本中选择第一数值个样本,确定当前块的第i个相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若当前块的高度等于4时,则从当前块的上侧相邻样本中选择4个样本,确定为当前块的第i个相邻重建样本。
示例2,若当前块的高度不等于第一数值,则从当前块的上侧相邻样本中选择第二数值个样本,确定当前块的第i个相邻重建样本。
本申请实施例对上述第二数值的具体取值不做限制。
示例性的,第二数值大于或等于4。
可选的,该第二数值为以第三数值为底高度的对数取整。
本申请实施例对第三数值的具体取值不做限制。
可选的,第三数值为2。
例如,第二数值为log2(高度)的值取整。
举例说明,假设当前块的高度为32,则确定出第二数值为5,进而编码端从当前块的上侧相邻16个样本中选择5个样本,作为当前块的第i个相邻重建样本。其中,这5个样本是通过等步长选择的,也可以是随机选取的,本申请实施例对此不作限制。
同理,本申请实施例对上述S702-A1-B中根据参考帧中当前块对应的参考块的上侧相邻样本,确定参考块的第i个相邻重建样本的具体方式不做限制。
在一种实现方式中,将参考帧中参考块的上侧相邻的多个重建样本,确定为参考块的第i个相邻重建样本。
在另一种实现方式中,如图9B所示,根据参考块的高度和参考块的上侧相邻样本,确定参考块的第i个相邻重建样本。
示例1,将参考帧中参考块的上侧与参考块相邻且在参考块的高度范围内的重建样本,确定为参考块的第i个相邻重建样本。例如,参考块的高度为4,则将参考帧中参考块上侧相邻的4个重建样本,确定为参考块的第i个相邻重建样本。
示例2,若参考块的高度等于第一数值,则对参考块的上侧相邻样本进行插值得到第一数值个样本,作为参考块的第i个相邻重建样本。
本申请实施例对上述第一数值的具体取值不做限制。
可选的,第一数值为4,即若参考块的高度等于4时,则解码端对参考块的上侧相邻样本进行插值得到4个样本,确定为参考块的第i个相邻重建样本。
示例2,若参考块的高度不等于第一数值,则对参考块的上侧相邻样本进行插值插值得到第二数值个样本,作为参考块的第i个相邻重建样本。
举例说明,假设参考块的高度为32,则确定出第二数值为5,进而编码端对参考块的上侧相邻16个样本进行插值得到5个样本,作为参考块的第i个相邻重建样本。
本申请实施例中,若第i个候选模式为上侧重建样本模式时,则根据上述任意方式,确定出当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,其中当前块的第i个相邻重建样本只与当前块的上侧相邻样本相关,参考块的第i个相邻重建样本只与参考块的上侧相邻样本相关。
编码端根据上述方法,确定出当前块的第i个相邻重建样本和参考块的第i个相邻重建样本后,执行如下S702-A2。
S702-A2、根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定第i个线性变换参数。
本申请实施例对根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定第i个线性变换参数的具体方式不做限制。
在一些实施例中,若第i个线性变换参数包括第i个缩放因子和第i个偏移参数时,则上述S702-A2中根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本包括如下步骤:
S702-A21、根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定第i个缩放因子;
S702-A22、根据当前块的第i个相邻重建样本、参考块的第i个相邻重建样本以及第i个缩放因子,确定第i个偏移参数。
本申请实施例对上述S702-A21中根据当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,确定第i个缩放因子a的方式不做限制。
在一种可能的实现方式中,将当前块的第i个相邻重建样本与参考块的第i个相邻重建样本的比值,确定第i个缩放因子a。
在另一种可能的实现方式中,根据上述公式(3)确定第i个缩放因子a。
本申请实施例对上述S702-A22中根据当前块的第i个相邻重建样本、参考块的第i个相邻重建样本以及第i个缩放因子,确定第i个偏移参数的方式不做限制。
在一种可能的实现方式中,根据上述公式(4)确定第i个偏移参数b。
S702-A3、确定当前块的第一预测值,并根据第i个线性变换参数对第一预测值进行线性变换,得到第i个候选模式对应的第二预测值。
根据上述方法,确定出第i个线性变换参数后,使用该第i个线性变换参数,对第一预测值进行线性变换,得到第i个候选模式对应的当前块的第二预测值,例如,确定第i个缩放因子与第一预测值的乘积;将乘积与第i个偏移参数的和,确定为第i个候选模式对应的第二预测值。
在一种示例中,根据如下公式(5)确定第i个候选模式下的第二预测值。
S702-A4、根据第i个候选模式对应的第二预测值,确定第i个候选模式对应的代价。
示例性的,根据第i个候选模式对应的第二预测值和当前块,确定第i个候选模式对应的代价。
例如,将第i个候选模式对应的第二预测值与当前块所对应的原始值作差得到当前块的残差,通过变换量化等操作计算得到率失真优化(Rate Distorti on Optimized),记为costi。
为了降低代价的计算复杂度,还可以使用绝对误差和(Sum of Absolute Difference,SAD)、变换后再绝对值求和(Sum of Absolute Transformed Difference,STAD)等代价计算方式,确定第i个候选模式对应的代价。
根据上述方法,可以确定出N个候选模式中,每个候选模式对应的代价,进而执行上述S702-B,根据N个候选模式对应的代价,从N个候选模式中,确定出当前块的重建样本模式。
在一种示例中,将N个候选模式中代价最小的候选模式,确定为当前块的重建样本模式。
在一些实施例中,编码端根据N个候选模式对应的代价,从N个候选模式中,确定出当前块的重建样本模式后,在码流中写入第一索引,该第一索引用于指示当前块的重建样本模式。
在一些实施例中,若当前块的预测模式为Merge模式时,则编码端还可以通过如下方式,确定出当前块的重建样本模式。即上述S702包括如下S702-C1和S702-C2步骤:
S702-C1、确定当前块的相邻块的第一标志,相邻块的第一标志用于指示相邻块是否使用光照补偿技术;
S702-C2、根据相邻块的第一标志,确定当前块的重建样本模式。
在该实施例中,编码端在对当前块进行光照补偿时,若当前块的预测模式为Merge模式时,则编码端根据当前块的相邻块是否使用本申请实施例提出的光照补偿技术,来确定当前块是否使用本光照补偿技术。例如,相邻块使用本申请实施例提出的光照补偿技术,则确定当前块也使用本申请实施例提出的光照补偿技术。
基于此,编码端从相邻块中得到第一标志,根据相邻块的第一标志,确定当前块的重建样本模式。
其中,S702-C2中根据相邻块的第一标志,确定当前块的重建样本模式的方式包括但不限于如下几种:
方式1,若相邻块的第一标志指示相邻块使用光照补偿技术,则确定当前块的重建样本模式为上侧和左侧重建样本模式。
在该方式1中,若当前块的预测模式为Merge模式,且当前块的相邻块采用光照补偿技术,则编码端默认当前块的重建样本模式为上侧和左侧重建样本模式,进而直接使用上侧和左侧重建样本模式对当前块的第一预测值进行光照补偿,得到当前块的第二预测值。
方式2,若相邻块的第一标志指示相邻块使用光照补偿技术,则确定相邻块的重建样本模式;将相邻块的重建样本模式,确定为当前块的重建样本模式。
在该方式2中,若当前块的预测模式为Merge模式,且当前块的相邻块采用光照补偿技术,则编码端将当前块的相邻块的重建样本模式确定为当前块的重建样本模式。具体是,编码端从相邻块中得到相邻块的重建样本模式,并使用相邻块的重建样本模式对当前块的第一预测值进行光照补偿,得到第二预测值。
其中,编码端确定当前块的相邻块的重建样本模式的方式至少包括如下几种示例:
示例1,编码端直接从相邻块中获得该相邻块的重建样本模式。
示例2,编码端从相邻块中得到第二索引,该第二索引用于指示该相邻块的重建样本模式,这样编码端根据该第二索引,确定相邻块的重建样本模式,例如第二索引为0,如表1所示,则确定相邻块的重建样本模式为上侧重建样本模式。
在该方式二中,若当前块采用Merge模式进行预测时,则编码端根据当前块的相邻块的第一标志和/或第一索引,直接确定出当前块的重建样本模式。
编码端根据上述方式,确定出当前块的重建样本模式后,执行如下S703的步骤。
S703、根据当前块的重建样本模式,确定当前块的第二预测值,第二预测值通过当前块的重建样本模式对第一预测值进行光照补偿得到。
在一些实施例中,若编码端根据上述S702-A和S702-B的方式,确定出N个候选模式中每一个候选模式对应的第二预测值,且当前块的重建样本模式从上述N个候选模式中选择出,则编码端直接将该当前块的重建样本模式对应的第二预测值,确定为当前块的第二预测值,不需要再重新进行光照补偿计算。
在一些实施例中,若编码端根据上述S702-C1和S702-C2的步骤,确定出当前块的重建样本模式,即确定当前块的相邻块的第一标志,根据相邻块的第一标志,确定当前块的重建样本模式,此时,上述S703包括如下步骤:
S703-A1、根据当前块的重建样本模式,确定当前块的相邻重建样本和参考块的相邻重建样本;
S703-A2、根据当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据线性变换参数对第一预测值进行线性变换,得到当前块的第二预测值。
其中,S703-A1的实现过程参照上述S702-A1的描述,在此不再赘述。
其中,S703-A2的实现过程参照上述S702-A2和S702-A3的描述,在此不再赘述。
本申请实施例中,编码端从上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中选择当前块的重建样本模式,不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以确定出更加准确地确定出当前块的相邻重建样本和参考块的相邻重建样本,并基于当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,进而提高了当前块的光照补偿效果,提升了当前块的预测效果。
在一些实施例中,通过标志来限定是否采用本申请实施例的光照补偿扩展技术,即在上述S702之前,编码端首先确定当前块的第一标志,该当前块的第一标志用于指示当前块是否使用光照补偿技术。
在本申请的一些实施例中,编码端确定当前块的第一标志,并将第一标志写入码流。
在一些实施例中,若当前块的第一标志指示当前块使用所述光照补偿技术时,则编码端确定当前块的第二标志,并将第二标志写入码流,当前块的第二标志用于指示当前块是否使用光照补偿扩展技术。
在一些实施例中,若当前块的第二标志指示当前块使用所述光照补偿扩展技术,则编码端将当前块的重建样本模式的索引写入码流。
示例性的,当前块的第一标志为1时,指示当前块使用光照补偿技术,若当前块的第一标志为0时,指示不当前块使用光照补偿技术。
若当前块的第一标志指示当前块不使用光照补偿技术时,例如,当前块的第一标志为0时,则解码端将第一预测值确定为第二预测值,或者采用其他的方式对第一预测值进行处理,得到第二预测值。
若当前块的第一标志指示当前块使用光照补偿技术时,例如,当前块的第一标志为1时,则解码端确定当前块的第二标志,该当前块的第二标志用于指示当前块是否使用本申请的光照补偿扩展技术。
示例性的,当前块的第二标志为1时,指示当前块使用光照补偿扩展技术,若当前块的第二标志为0时,指示不实现当前块使用光照补偿扩展技术。
若当前块的第二标志指示当前块不使用光照补偿扩展技术时,例如,当前块的第二标志为0时,则解码端可以采用默认的重建样本模式,例如选择上侧和左侧重建样本模式,对当前块的第一预测值进行光照补偿,得到第二预测值。
在一些实施例中,若当前块的第二标志指示当前块使用本申请的光照补偿扩展技术,则编码端将当前块的重建样本模式的索引写入码流。
其中,编码端确定上述当前块的第一标志的方式至少包括如下几种:
方式1,从配置文件中得到当前块的第一标志。
在该方式1中,编码端将该当前块的第一标志写入码流,解码端可以直接解码得到该当前块的第一标志。
方式2,若当前块的预测模式为Merge模式,则编码端确定当前块的相邻块的第一标志,该相邻块的第一标志用于指示相邻块是否使用光照补偿技术,进而根据相邻块的第一标志,确定当前块的第一标志。例如,编码端从相邻块得到第一标志,若相邻块的第一标志的取值为1时,则确定当前块的第一标志的取值也为1,即相邻块的第一标志指示相邻块使用光照补偿技术时,则确定当前块也使用光照补偿技术。若相邻块的第一标志的取值为0时,则确定当前块的第一标志的取值也为0,即相邻块的第一标志指示相邻块不使用光照补偿技术时,则确定当前块也不使用光照补偿技术。
其中,编码端确定上述当前块的第二标志的方式至少包括如下几种:
方式1,从配置文件中得到当前块的第二标志。
在该方式1中,编码端将该当前块的第二标志写入码流,解码端可以直接解码得到该当前块的第二标志。
方式2,若当前块的预测模式为Merge模式,则编码端确定当前块的相邻块对应的相邻块的第二标志,该相邻块的第二标志用于指示相邻块是否使用本申请的光照补偿扩展技术,进而根据相邻块的第二标志,确定当前块的第二标志。例如,编码端从相邻块得到相邻块的第二标志,若相邻块的第二标志的取值为1时,则确定当前块的第二标志的取值也为1,即相邻块的第二标志指示相邻块使用本申请的光照补偿扩展技术时,则确定当前块也使用本申请的光照补偿扩展技术。若相邻块的第二标志的取值为0时,则确定当前块的第二标志的取值也为0,即相邻块的第二标志指示相邻块不使用本申请的光照补偿扩展技术时,则确定当前块也不使用本申请的光照补偿扩展技术。
在一些实施例中,上述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
在一些实施例中,编码端将本申请的光照补偿技术与其他的预测模式进行比较,例如,根据上述方法,确定出N个候选模式中,每个候选模式对应的代价,同时,计算预设的其他预测模式对应的代价。示例性的,以N=3为例,根据上述方法,确定出上侧重建样本模式对应的代价,记为cost1,确定出左侧重建样本模式对应的代价,记为cost2,确定出上侧和左侧重建样本模式对应的代价,记为cost3,比较cost1、cost2以及cost3,记录最小的代价值记为costMin,同时保存当前光照补偿模式下的信息包括光照补偿模式索引,cost1对应的模式索引为0,cost2对应模式索引为1,cost3对应模式索引为2。
接着,编码端继续遍历其他帧间预测技术,并计算得到各技术所对应的率失真代价值,选择最小的代价值所对应的预测模式作为当前编码单元最优预测模式。
若当前块使用光照补偿技术且costMin为最小,则当前块使用光照补偿技术,需要将光照补偿技术的编码单元级使用标识位,例如lic_flag置真写入码流。若costMin对应的索引大于0,则将光照补偿模式拓展标识位,即当前块的第二标志,例如lic_ext置真写入码流,且将costMin对应的索引通过等概率编码写入码流;否则将光照补偿模式拓展标识位,即当前块的第二标志置否写入码流。
若当前块使用光照补偿技术且costMin不为最小,则当前块不使用光照补偿技术,需要将光照补偿技术的编码单元级使用标识位,例如lic_flag置否写入码流。
若当前块不使用光照补偿技术,则将其他非光照补偿技术的最优预测模式信息等写入码流。
在一些实施例中,若当前块所属的当前图像为第一类型帧,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S702确定当前块的重建样本模式。
本申请实施例第一类型帧的具体类型不做限制。
可选的,第一类型帧为B帧,即当前图像为B帧,则默认开启本申请提出的光照补偿扩展技术。
在一些实施例中,若当前块的面积大于或等于预设阈值,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S702确定当前块的重建样本模式。
本申请对预设阈值的具体取值不做限制。
可选的,预设阈为64,即当前块的面积大于或等于预设阈值,则执行本申请实施例提出的光照补偿扩展技术,即执行上述S702确定当前块的重建样本模式。
编码端根据上述步骤,确定出当前块的预测值后,例如确定出当前块的第二预测值,将当前块的预测块与当前块求差,得到当前块的残差值,对残差值进行变换,得到变换系数,对变换系数进行量化,得到量化系数,对量化系数进行编码,得到码流。
进一步的,将本方案的第一个实施例集成到最新ECM3.1上后,在通测条件随机接入(RA,Random Access)和低延时B帧LDB下测试结果如表3所示。
表3
Figure PCTCN2022086725-appb-000003
由上述表3可知,本申请实施例提出的光照补偿扩展技术,对于RA和LDB的所有序列类别均有性能上的提升,RA测试条件中4K A2序列的提升最为明显,平均有0.11%的BD-bitrate节省。且综合有性能提升,证明了该技术的有效性,能够提升现有ECM参考软件的编码效率。值得注意的是,由于服务器负载原因,编解码时间不准确,理论上解码时间不会有变化,且本实验结果未做任何编码端优化。此外,该方法并不会给解码端带来额外负担,不会增加硬件实现的复杂度。
本申请实施例提供的视频编码方法,编码端对当前块进行预测,得到当前块的第一预测值;确定当前块的重建样本模式,重建样本模式为N个候选模式中的一模式,N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;根据当前块的重建样本模式,确定当前块的第二预测值,第二预测值通过当前块的重建样本模式对第一预测值进行光照补偿得到。本申请实施例,当前块的重建样本模式可以是上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的一模式,不仅丰富了重建样本的选择模式,而且可以从上述各模式中准确确定出与当前块的特征信息适配的重建样本模式,这样基于准确的重建样本模式,可以更加准确地得到当前块的相邻重建样本和参考块的相邻重建样本,基于准确确定的当前块的相邻重建样本和参考块的相邻重建样本,确定线性变换参数,并根据该线性变换参数对当前块的第一预测值进行线性变换,得到准确的第二预测值,提高了当前块的光照补偿效果,提升了当前块的预测效果。
应理解,图7至图10仅为本申请的示例,不应理解为对本申请的限制。
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
上文结合图7至图10,详细描述了本申请的方法实施例,下文结合图11至图14,详细描述本申请的装置实施例。
图11是本申请实施例提供的视频解码装置的示意性框图。
如图11所示,视频解码装置10包括:
解码单元11,用于解码码流,并对当前块进行预测,得到第一预测值;
模式确定单元12,用于确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
样本确定单元13,用于根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;
线性变换单元14,用于根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
在一些实施例中,模式确定单元12,具体用于确定第一索引,所述第一索引用于指示所述当前块的重建样本模式;根据所述第一索引,确定所述当前块的重建样本模式。
在一些实施例中,模式确定单元12,具体用于解码码流,得到所述第一索引。
在一些实施例中,若所述当前块的预测模式为Merge模式,模式确定单元12,具体用于确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;根据所述相邻块的第一标志,确定所述第一索引。
在一些实施例中,模式确定单元12,具体用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述第一索引为默认索引,所述默认索引用于指示所述上侧和左侧重建样本模式。
在一些实施例中,模式确定单元12,具体用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;将所述第二索引,确定为所述第一索引。
在一些实施例中,若所述当前块的预测模式为非Merge模式,模式确定单元12,具体用于确定所述当前块的第一标志,所述当前块的第一标志用于指示所述当前块是否使用光照补偿技术;若所述当前块的第一标志指示所述当前块使用所述光照补偿技术时,则确定所述当前块的第二标志,所述当前块的第二标志用于指示所述当前块是否使用光照补偿扩展技术;根据所述当前块的第二标志,确定所述第一索引。
在一些实施例中,模式确定单元12,具体用于若所述当前块的第二标志指示所述当前块使用所述光照补偿扩展技术,则通过解码所述码流,得到所述第一索引。
在一些实施例中,模式确定单元12,具体用于若所述当前块的第二标志指示所述当前块不使用所述光照补偿扩展技术,则确定所述第一索引为默认索引,所述默认索引用于指示所述上侧和左侧重建样本模式。
在一些实施例中,模式确定单元12,具体用于解码码流,得到所述当前块的第一标志。
在一些实施例中,模式确定单元12,具体用于解码码流,得到所述当前块的第二标志。
在一些实施例中,若所述当前块的预测模式为Merge模式,模式确定单元12,具体用于确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;根据所述相邻块的第一标志,确定所述当前块的重建样本模式。
在一些实施例中,模式确定单元12,具体用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确 定所述当前块的重建样本模式为所述上侧和左侧重建样本模式。
在一些实施例中,模式确定单元12,具体用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述相邻块的重建样本模式;将所述相邻块的重建样本模式,确定为所述当前块的重建样本模式。
在一些实施例中,模式确定单元12,具体用于确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;
根据所述第二索引,确定所述相邻块的重建样本模式。
在一些实施例中,样本确定单元13,具体用于若所述当前块的重建样本模式为左侧重建样本模式,则根据所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本,根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述当前块的高度等于第一数值,则从所述当前块的左侧相邻样本中选择所述第一数值个样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述当前块的高度不等于第一数值,则从所述当前块的左侧相邻样本中选择第二数值个样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的相邻重建样本本。
在一些实施例中,样本确定单元13,具体用于若所述参考块的高度等于第一数值,则对所述参考块的左侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述参考块的高度不等于第一数值,则对所述参考块的左侧相邻样本进行插值得到第二数值个样本,作为所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述当前块的重建样本模式为上侧重建样本模式,则根据所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本,根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述当前块的宽度等于第一数值,则从所述当前块的上侧相邻样本中选择所述第一数值个样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,若所述当前块的宽度不等于第一数值,则从所述当前块的上侧相邻样本中选择第二数值个样本,确定所述当前块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述参考块的宽度等于第一数值,则对所述参考块的上侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的相邻重建样本。
在一些实施例中,样本确定单元13,具体用于若所述参考块的宽度不等于第一数值,则对所述参考块的上侧相邻样本进行插值得到第二数值个样本,并基于插值得到的所述第二数量个样本,确定所述参考块的相邻重建样本。
可选的,所述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
在一些实施例中,所述线性变换参数包括缩放因子和偏移参数,线性变换单元14,用于根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定所述缩放因子;根据所述当前块的相邻重建样本、所述参考块的相邻重建样本以及所述缩放因子,确定所述偏移参数。
在一些实施例中,线性变换单元14,用于根据所述缩放因子和所述偏移参数,对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
在一些实施例中,线性变换单元14,用于确定所述缩放因子与所述第一预测值的乘积;将所述乘积与所述偏移参数的和,确定为所述第二预测值。
在一些实施例中,模式确定单元12,具体用于若所述当前块所属的当前图像为第一类型帧,则确定当前块的重建样本模式。
在一些实施例中,样式确定单元12,用于若所述当前块的面积大于或等于预设阈值,则确定当前块的重建样本模式。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图11所示的视频解码装置10可以对应于执行本申请实施例的方法中的相应主体,并且视频解码装置10中的各个单元的前述和其它操作和/或功能分别为了实现方法等各个方法中的相应流程,为了简洁,在此不再赘述。
图12是本申请实施例提供的视频编码装置的示意性框图。
如图12所示,视频编码装置20包括:
预测单元21,用于对当前块进行预测,得到所述当前块的第一预测值;
样式确定单元22,用于确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
线性变换单元23,用于根据所述当前块的重建样本模式,确定所述当前块的第二预测值,所述第二预测值通过所述当前块的重建样本模式对所述第一预测值进行光照补偿得到。
在一些实施例中,样式确定单元22,用于针对所述N个候选模式中的第i个候选模式,确定所述第i个候选模式 对应的代价,所述i为从1到N的正整数;根据所述N个候选模式对应的代价,从所述N个候选模式中,确定出所述当前块的重建样本模式。
在一些实施例中,样式确定单元22,用于根据所述第i个候选模式,确定所述当前块的第i个相邻重建样本和参考块的第i个相邻重建样本;根据所述当前块的第i个相邻重建样本和所述参考块的第i个相邻重建样本,确定第i个线性变换参数;确定所述当前块的第一预测值,并根据所述第i个线性变换参数对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值;根据所述第i个候选模式对应的第二预测值,确定所述第i个候选模式对应的代价。
在一些实施例中,样式确定单元22,用于若所述第i个候选模式为左侧重建样本模式,则根据所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本,根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述当前块的高度等于第一数值,则从所述当前块的左侧相邻样本中选择所述第一数值个样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述当前块的高度不等于第一数值,则从所述当前块的左侧相邻样本中选择第二数值个样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述参考块的高度等于第一数值,则对所述参考块的左侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述参考块的高度不等于第一数值,则对所述参考块的左侧相邻样本进行插值得到第二数值个样本,作为所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述第i个候选模式为上侧重建样本模式,则根据所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本,根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述当前块的宽度等于第一数值,则从所述当前块的上侧相邻样本中选择所述第一数值个样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述当前块的宽度不等于第一数值,则从所述当前块的上侧相邻样本中选择第二数值个样本,确定所述当前块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述参考块的宽度等于第一数值,则对所述参考块的上侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的第i个相邻重建样本。
在一些实施例中,样式确定单元22,用于若所述参考块的宽度不等于第一数值,则对所述参考块的上侧相邻样本进行插值得到第二数值个样本,作为所述参考块的第i个相邻重建样本。
在一些实施例中,所述第i个线性变换参数包括第i个缩放因子和第i个偏移参数样式确定单元22,用于,根据所述当前块的第i个相邻重建样本和所述参考块的第i个相邻重建样本,确定所述第i个缩放因子;根据所述当前块的第i个相邻重建样本、所述参考块的第i个相邻重建样本以及所述第i个缩放因子,确定所述第i个偏移参数。
在一些实施例中,样式确定单元22,用于根据所述第i个缩放因子和所述第i个偏移参数,对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值。
在一些实施例中,样式确定单元22,用于确定所述第i个缩放因子与所述第一预测值的乘积;将所述乘积与所述第i个偏移参数的和,确定为所述第i个候选模式对应的第二预测值。
在一些实施例中,样式确定单元22,用于根据所述第i个候选模式对应的第二预测值和所述当前块,确定所述第i个候选模式对应的代价。
在一些实施例中,样式确定单元22,用于将所述N个候选模式中所述代价最小的候选模式,确定为所述当前块的重建样本模式。
在一些实施例中,线性变换单元23,用于将所述当前块的重建样本模式对应的第二预测值,确定为所述当前块的第二预测值。
在一些实施例中,线性变换单元23,用于在码流中写入第一索引,所述第一索引用于指示所述当前块的重建样本模式。
在一些实施例中,若所述当前块的预测模式为Merge模式,则样式确定单元22,用于确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;根据所述相邻块的第一标志,确定所述当前块的重建样本模式。
在一些实施例中,样式确定单元22,用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述当前块的重建样本模式为所述上侧和左侧重建样本模式。
在一些实施例中,样式确定单元22,用于若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所 述相邻块的重建样本模式;将所述相邻块的重建样本模式,确定为所述当前块的重建样本模式。
在一些实施例中,样式确定单元22,用于确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;根据所述第二索引,确定所述相邻块的重建样本模式。
在一些实施例中,样式确定单元22,用于根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
在一些实施例中,线性变换单元23,用于确定当前块的第一标志,并将所述第一标志写入码流,所述当前块的第一标志用于指示所述当前块是否使用光照补偿技术。
在一些实施例中,线性变换单元23,用于若所述当前块的第一标志指示所述当前块使用所述光照补偿技术时,则确定当前块的第二标志,并将所述第二标志写入所述码流,所述当前块的第二标志用于指示所述当前块是否使用光照补偿扩展技术。
在一些实施例中,线性变换单元23,用于若所述当前块的第二标志指示所述当前块使用所述光照补偿扩展技术,则将所述当前块的重建样本模式的索引写入所述码流。
在一些实施例中,若所述当前块的预测模式为Merge模式,线性变换单元23,用于确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;根据所述相邻块的第一标志,确定所述当前块的第一标志。
在一些实施例中,若所述当前块的预测模式为Merge模式,线性变换单元23,用于确定所述当前块的相邻块的第二标志,所述相邻块的第二标志用于指示所述相邻块是否使用光照补偿扩展技术;根据所述相邻块的第二标志,确定所述当前块的第二标志。
可选的,所述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
在一些实施例中,样式确定单元22,用于若所述当前块所属的当前图像为第一类型帧,则确定当前块的重建样本模式。
在一些实施例中,样式确定单元22,用于若所述当前块的面积大于或等于预设阈值,则确定当前块的重建样本模式。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图12所示的视频编码装置20可以对应于执行本申请实施例的方法中的相应主体,并且视频编码装置20中的各个单元的前述和其它操作和/或功能分别为了实现方法等各个方法中的相应流程,为了简洁,在此不再赘述。
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。
图13是本申请实施例提供的电子设备的示意性框图。
如图13所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频解码器,该电子设备30可包括:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34,以实现本申请实施例中的方法。
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法中的步骤。
在本申请的一些实施例中,该处理器32可以包括但不限于:
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。
在本申请的一些实施例中,该存储器33包括但不限于:
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。
在本申请的一些实施例中,该计算机程序34可以被分割成一个或多个单元,该一个或者多个单元被存储在该存储器33中,并由该处理器32执行,以完成本申请提供的方法。该一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序34在该电子设备30中的执行过程。
如图13所示,该电子设备30还可包括:
收发器33,该收发器33可连接至该处理器32或存储器33。
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收 其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
图14是本申请实施例提供的视频编解码系统40的示意性框图。
如图14所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。
在一些实施例中,本申请还提供一种码流,该码流通过上述编码方法得到。
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。

Claims (78)

  1. 一种视频解码方法,其特征在于,包括:
    解码码流,并对当前块进行预测,得到第一预测值;
    确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
    根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;
    根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
  2. 根据权利要求1所述的方法,其特征在于,所述确定当前块的重建样本模式,包括:
    确定第一索引,所述第一索引用于指示所述当前块的重建样本模式;
    根据所述第一索引,确定所述当前块的重建样本模式。
  3. 根据权利要求2所述的方法,其特征在于,所述确定第一索引,包括:
    解码码流,得到所述第一索引。
  4. 根据权利要求2所述的方法,其特征在于,若所述当前块的预测模式为Merge模式,所述确定所述第一索引,包括:
    确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;
    根据所述相邻块的第一标志,确定所述第一索引。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述第一索引,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述第一索引为默认索引,所述默认索引用于指示所述上侧和左侧重建样本模式。
  6. 根据权利要求4所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述第一索引,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;
    将所述第二索引,确定为所述第一索引。
  7. 根据权利要求2所述的方法,其特征在于,若所述当前块的预测模式为非Merge模式,所述确定所述第一索引,包括:
    确定所述当前块的第一标志,所述当前块的第一标志用于指示所述当前块是否使用光照补偿技术;
    若所述当前块的第一标志指示所述当前块使用所述光照补偿技术时,则确定所述当前块的第二标志,所述当前块的第二标志用于指示所述当前块是否使用光照补偿扩展技术;
    根据所述当前块的第二标志,确定所述第一索引。
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述当前块的第二标志,确定所述第一索引,包括:
    若所述当前块的第二标志指示所述当前块使用所述光照补偿扩展技术,则通过解码所述码流,得到所述第一索引。
  9. 根据权利要求7所述的方法,其特征在于,所述根据所述当前块的第二标志,确定所述第一索引,包括:
    若所述当前块的第二标志指示所述当前块不使用所述光照补偿扩展技术,则确定所述第一索引为默认索引,所述默认索引用于指示所述上侧和左侧重建样本模式。
  10. 根据权利要求7所述的方法,其特征在于,所述确定所述当前块的第一标志,包括:
    解码码流,得到所述当前块的第一标志。
  11. 根据权利要求7所述的方法,其特征在于,所述确定所述当前块的第二标志,包括:
    解码码流,得到所述当前块的第二标志。
  12. 根据权利要求1所述的方法,其特征在于,若所述当前块的预测模式为Merge模式,则所述确定当前块的重建样本模式,包括:
    确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;
    根据所述相邻块的第一标志,确定所述当前块的重建样本模式。
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述当前块的重建样本模式,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述当前块的重建样本模式为所述上侧和左侧重建样本模式。
  14. 根据权利要求12所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述当前块的重建样本模式,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述相邻块的重建样本模式;
    将所述相邻块的重建样本模式,确定为所述当前块的重建样本模式。
  15. 根据权利要求14所述的方法,其特征在于,所述确定所述相邻块的重建样本模式,包括:
    确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;
    根据所述第二索引,确定所述相邻块的重建样本模式。
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本,包括:
    若所述当前块的重建样本模式为左侧重建样本模式,则根据所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本,根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的相邻重建样本。
  17. 根据权利要求16所述的方法,其特征在于,所述根据所述当前块的左侧相邻样本,确定所述当前块的相邻重 建样本,包括:
    根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本。
  18. 根据权利要求17所述的方法,其特征在于,所述根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本,包括:
    若所述当前块的高度等于第一数值,则从所述当前块的左侧相邻样本中选择所述第一数值个样本,确定所述当前块的相邻重建样本。
  19. 根据权利要求17所述的方法,其特征在于,所述根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的相邻重建样本,包括:
    若所述当前块的高度不等于第一数值,则从所述当前块的左侧相邻样本中选择第二数值个样本,确定所述当前块的相邻重建样本。
  20. 根据权利要求16所述的方法,其特征在于,所述根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的相邻重建样本,包括:
    根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的相邻重建样本。
  21. 根据权利要求20所述的方法,其特征在于,所述根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的相邻重建样本,包括:
    若所述参考块的高度等于第一数值,则对所述参考块的左侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的相邻重建样本。
  22. 根据权利要求20所述的方法,其特征在于,所述根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的相邻重建样本,包括:
    若所述参考块的高度不等于第一数值,则对所述参考块的左侧相邻样本进行插值得到第二数值个样本,作为所述参考块的相邻重建样本。
  23. 根据权利要求1-15任一项所述的方法,其特征在于,所述根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本,包括:
    若所述当前块的重建样本模式为上侧重建样本模式,则根据所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本,根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的相邻重建样本。
  24. 根据权利要求23所述的方法,其特征在于,所述根据所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本,包括:
    根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本。
  25. 根据权利要求23所述的方法,其特征在于,所述根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本,包括:
    若所述当前块的宽度等于第一数值,则从所述当前块的上侧相邻样本中选择所述第一数值个样本,确定所述当前块的相邻重建样本。
  26. 根据权利要求23所述的方法,其特征在于,所述根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的相邻重建样本,包括:
    若所述当前块的宽度不等于第一数值,则从所述当前块的上侧相邻样本中选择第二数值个样本,确定所述当前块的相邻重建样本。
  27. 根据权利要求23所述的方法,其特征在于,所述根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的相邻重建样本,包括:
    根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的相邻重建样本。
  28. 根据权利要求27所述的方法,其特征在于,所述根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的相邻重建样本,包括:
    若所述参考块的宽度等于第一数值,则对所述参考块的上侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的相邻重建样本。
  29. 根据权利要求27所述的方法,其特征在于,所述根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的相邻重建样本,包括:
    若所述参考块的宽度不等于第一数值,则对所述参考块的上侧相邻样本进行插值得到第二数值个样本,并基于插值得到的所述第二数量个样本,确定所述参考块的相邻重建样本。
  30. 根据权利要求4或7或12所述的方法,其特征在于,所述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
  31. 根据权利要求1-15任一项所述的方法,其特征在于,所述线性变换参数包括缩放因子和偏移参数,所述根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,包括:
    根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定所述缩放因子;
    根据所述当前块的相邻重建样本、所述参考块的相邻重建样本以及所述缩放因子,确定所述偏移参数。
  32. 根据权利要求31所述的方法,其特征在于,所述根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值,包括:
    根据所述缩放因子和所述偏移参数,对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
  33. 根据权利要求32所述的方法,其特征在于,所述根据所述缩放因子和所述偏移参数,对所述第一预测值进行线性变换,得到所述当前块的第二预测值,包括:
    确定所述缩放因子与所述第一预测值的乘积;
    将所述乘积与所述偏移参数的和,确定为所述第二预测值。
  34. 根据权利要求1-15任一项所述的方法,其特征在于,所述确定当前块的重建样本模式包括:
    若所述当前块所属的当前图像为第一类型帧,则确定当前块的重建样本模式。
  35. 根据权利要求1-15任一项所述的方法,其特征在于,所述确定当前块的重建样本模式包括:
    若所述当前块的面积大于或等于预设阈值,则确定当前块的重建样本模式。
  36. 一种视频编码方法,其特征在于,包括:
    对当前块进行预测,得到所述当前块的第一预测值;
    确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
    根据所述当前块的重建样本模式,确定所述当前块的第二预测值,所述第二预测值通过所述当前块的重建样本模式对所述第一预测值进行光照补偿得到。
  37. 根据权利要求36所述的方法,其特征在于,所述确定当前块的重建样本模式,包括:
    针对所述N个候选模式中的第i个候选模式,确定所述第i个候选模式对应的代价,所述i为从1到N的正整数;
    根据所述N个候选模式对应的代价,从所述N个候选模式中,确定出所述当前块的重建样本模式。
  38. 根据权利要求37所述的方法,其特征在于,所述确定所述第i个候选模式对应的代价,包括:
    根据所述第i个候选模式,确定所述当前块的第i个相邻重建样本和参考块的第i个相邻重建样本;
    根据所述当前块的第i个相邻重建样本和所述参考块的第i个相邻重建样本,确定第i个线性变换参数;
    确定所述当前块的第一预测值,并根据所述第i个线性变换参数对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值;
    根据所述第i个候选模式对应的第二预测值,确定所述第i个候选模式对应的代价。
  39. 根据权利要求38所述的方法,其特征在于,所述根据所述第i个候选模式,确定所述当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,包括:
    若所述第i个候选模式为左侧重建样本模式,则根据所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本,根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本。
  40. 根据权利要求39所述的方法,其特征在于,所述根据所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本,包括:
    根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本。
  41. 根据权利要求40所述的方法,其特征在于,所述根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本,包括:
    若所述当前块的高度等于第一数值,则从所述当前块的左侧相邻样本中选择所述第一数值个样本,确定所述当前块的第i个相邻重建样本。
  42. 根据权利要求40所述的方法,其特征在于,所述根据所述当前块的高度和所述当前块的左侧相邻样本,确定所述当前块的第i个相邻重建样本,包括:
    若所述当前块的高度不等于第一数值,则从所述当前块的左侧相邻样本中选择第二数值个样本,确定所述当前块的第i个相邻重建样本。
  43. 根据权利要求39所述的方法,其特征在于,所述根据参考帧中所述当前块对应的参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本。
  44. 根据权利要求43所述的方法,其特征在于,所述根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    若所述参考块的高度等于第一数值,则对所述参考块的左侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的第i个相邻重建样本。
  45. 根据权利要求43所述的方法,其特征在于,所述根据所述参考块的高度和所述参考块的左侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    若所述参考块的高度不等于第一数值,则对所述参考块的左侧相邻样本进行插值得到第二数值个样本,作为所述参考块的第i个相邻重建样本。
  46. 根据权利要求38所述的方法,其特征在于,所述根据所述第i个候选模式,确定所述当前块的第i个相邻重建样本和参考块的第i个相邻重建样本,包括:
    若所述第i个候选模式为上侧重建样本模式,则根据所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本,根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本。
  47. 根据权利要求46所述的方法,其特征在于,所述根据所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本,包括:
    根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本。
  48. 根据权利要求47所述的方法,其特征在于,所述根据所述当前块的宽度和所述当前块的上侧相邻样本,确定所述当前块的第i个相邻重建样本,包括:
    若所述当前块的宽度等于第一数值,则从所述当前块的上侧相邻样本中选择所述第一数值个样本,确定所述当前块的第i个相邻重建样本。
  49. 根据权利要求47所述的方法,其特征在于,所述根据所述当前块的宽度和所述当前块的上侧相邻样本,确定 所述当前块的第i个相邻重建样本,包括:
    若所述当前块的宽度不等于第一数值,则从所述当前块的上侧相邻样本中选择第二数值个样本,确定所述当前块的第i个相邻重建样本。
  50. 根据权利要求46所述的方法,其特征在于,所述根据参考帧中所述当前块对应的参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本。
  51. 根据权利要求50所述的方法,其特征在于,所述根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    若所述参考块的宽度等于第一数值,则对所述参考块的上侧相邻样本进行插值得到所述第一数值个样本,作为所述参考块的第i个相邻重建样本。
  52. 根据权利要求50所述的方法,其特征在于,所述根据所述参考块的宽度和所述参考块的上侧相邻样本,确定所述参考块的第i个相邻重建样本,包括:
    若所述参考块的宽度不等于第一数值,则对所述参考块的上侧相邻样本进行插值得到第二数值个样本,作为所述参考块的第i个相邻重建样本。
  53. 根据权利要求38-52任一项所述的方法,其特征在于,所述第i个线性变换参数包括第i个缩放因子和第i个偏移参数,所述根据所述当前块的第i个相邻重建样本和所述参考块的第i个相邻重建样本,确定第i个线性变换参数,包括:
    根据所述当前块的第i个相邻重建样本和所述参考块的第i个相邻重建样本,确定所述第i个缩放因子;
    根据所述当前块的第i个相邻重建样本、所述参考块的第i个相邻重建样本以及所述第i个缩放因子,确定所述第i个偏移参数。
  54. 根据权利要求53所述的方法,其特征在于,所述根据所述第i个线性变换参数对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值,包括:
    根据所述第i个缩放因子和所述第i个偏移参数,对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值。
  55. 根据权利要求53所述的方法,其特征在于,所述根据所述第i个缩放因子和所述第i个偏移参数,对所述第一预测值进行线性变换,得到所述第i个候选模式对应的第二预测值,包括:
    确定所述第i个缩放因子与所述第一预测值的乘积;
    将所述乘积与所述第i个偏移参数的和,确定为所述第i个候选模式对应的第二预测值。
  56. 根据权利要求38-52任一项所述的方法,其特征在于,根据所述第i个候选模式对应的第二预测值,确定所述第i个候选模式对应的代价,包括:
    根据所述第i个候选模式对应的第二预测值和所述当前块,确定所述第i个候选模式对应的代价。
  57. 根据权利要求37-52任一项所述的方法,其特征在于,所述根据所述N个候选模式对应的代价,从所述N个候选模式中,确定出所述当前块的重建样本模式,包括:
    将所述N个候选模式中所述代价最小的候选模式,确定为所述当前块的重建样本模式。
  58. 根据权利要求38-52任一项所述的方法,其特征在于,所述根据所述当前块的重建样本模式,确定所述当前块的第二预测值,包括:
    将所述当前块的重建样本模式对应的第二预测值,确定为所述当前块的第二预测值。
  59. 根据权利要求37-52任一项所述的方法,其特征在于,所述方法还包括:
    在码流中写入第一索引,所述第一索引用于指示所述当前块的重建样本模式。
  60. 根据权利要求36所述的方法,其特征在于,若所述当前块的预测模式为Merge模式,则所述确定当前块的重建样本模式,包括:
    确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;
    根据所述相邻块的第一标志,确定所述当前块的重建样本模式。
  61. 根据权利要求60所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述当前块的重建样本模式,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述当前块的重建样本模式为所述上侧和左侧重建样本模式。
  62. 根据权利要求60所述的方法,其特征在于,所述根据所述相邻块的第一标志,确定所述当前块的重建样本模式,包括:
    若所述相邻块的第一标志指示所述相邻块使用光照补偿技术,则确定所述相邻块的重建样本模式;
    将所述相邻块的重建样本模式,确定为所述当前块的重建样本模式。
  63. 根据权利要求62所述的方法,其特征在于,所述确定所述相邻块的重建样本模式,包括:
    确定第二索引,所述第二索引用于指示所述相邻块的重建样本模式;
    根据所述第二索引,确定所述相邻块的重建样本模式。
  64. 根据权利要求60-63任一项所述的方法,其特征在于,所述根据所述当前块的重建样本模式,确定所述当前块的第二预测值,包括:
    根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;
    根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
  65. 根据权利要求36-52任一项所述的方法,其特征在于,所述方法还包括:
    确定当前块的第一标志,并将所述第一标志写入码流,所述当前块的第一标志用于指示所述当前块是否使用光照补偿技术。
  66. 根据权利要求65所述的方法,其特征在于,所述方法还包括:
    若所述当前块的第一标志指示所述当前块使用所述光照补偿技术时,则确定所述当前块的第二标志,并将所述当前块的第二标志写入所述码流,所述当前块的第二标志用于指示所述当前块是否使用光照补偿扩展技术。
  67. 根据权利要求66所述的方法,其特征在于,所述方法还包括:
    若所述当前块的第二标志指示所述当前块使用所述光照补偿扩展技术,则将所述当前块的重建样本模式的索引写入所述码流。
  68. 根据权利要求65所述的方法,其特征在于,若所述当前块的预测模式为Merge模式,所述确定当前块的第一标志,包括:
    确定所述当前块的相邻块的第一标志,所述相邻块的第一标志用于指示所述相邻块是否使用光照补偿技术;
    根据所述相邻块的第一标志,确定所述当前块的第一标志。
  69. 根据权利要求68所述的方法,其特征在于,若所述当前块的预测模式为Merge模式,所述确定当前块的第二标志,包括:
    确定所述当前块的相邻块的第二标志,所述相邻块的第二标志用于指示所述相邻块是否使用光照补偿扩展技术;
    根据所述相邻块的第二标志,确定所述当前块的第二标志。
  70. 根据权利要求60或65所述的方法,其特征在于,所述第一标志包括序列级标志、图像级标志和块级标志中的至少一个。
  71. 根据权利要求36-52任一项所述的方法,其特征在于,所述确定当前块的重建样本模式包括:
    若所述当前块所属的当前图像为第一类型帧,则确定当前块的重建样本模式。
  72. 根据权利要求36-52任一项所述的方法,其特征在于,所述确定当前块的重建样本模式包括:
    若所述当前块的面积大于或等于预设阈值,则确定当前块的重建样本模式。
  73. 一种视频解码装置,其特征在于,包括:
    解码单元,用于解码码流,并对当前块进行预测,得到第一预测值;
    模式确定单元,用于确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
    样本确定单元,用于根据所述当前块的重建样本模式,确定所述当前块的相邻重建样本和参考块的相邻重建样本;
    线性变换单元,用于根据所述当前块的相邻重建样本和所述参考块的相邻重建样本,确定线性变换参数,并根据所述线性变换参数对所述第一预测值进行线性变换,得到所述当前块的第二预测值。
  74. 一种视频编码装置,其特征在于,包括:
    预测单元,用于对当前块进行预测,得到所述当前块的第一预测值;
    样式确定单元,用于确定当前块的重建样本模式,所述重建样本模式为N个候选模式中的一模式,所述N个候选模式包括上侧重建样本模式、左侧重建样本模式、上侧和左侧重建样本模式中的至少一个;
    线性变换单元,用于根据所述当前块的重建样本模式,确定所述当前块的第二预测值,所述第二预测值通过所述当前块的重建样本模式对所述第一预测值进行光照补偿得到。
  75. 一种视频编解码系统,其特征在于,包括视频编码器和视频解码器;
    所述视频解码器用于执行如权利要求1-35任一项所述的视频解码方法;
    所述视频编码器用于执行如权利要求36-72任一项所述的视频编码方法。
  76. 一种电子设备,其特征在于,包括:存储器,处理器;
    所述存储器,用于存储计算机程序;
    所述处理器,用于执行所述计算机程序以实现如上述权利要求1至35或36至72任一项所述方法。
  77. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1至35或36至72任一项所述的方法。
  78. 一种码流,其特征在于,包括如权利要求36至72任一项所述的方法得到的码流。
PCT/CN2022/086725 2022-04-13 2022-04-13 视频编解码方法、装置、设备、系统及存储介质 WO2023197229A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/086725 WO2023197229A1 (zh) 2022-04-13 2022-04-13 视频编解码方法、装置、设备、系统及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/086725 WO2023197229A1 (zh) 2022-04-13 2022-04-13 视频编解码方法、装置、设备、系统及存储介质

Publications (1)

Publication Number Publication Date
WO2023197229A1 true WO2023197229A1 (zh) 2023-10-19

Family

ID=88328556

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086725 WO2023197229A1 (zh) 2022-04-13 2022-04-13 视频编解码方法、装置、设备、系统及存储介质

Country Status (1)

Country Link
WO (1) WO2023197229A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109565593A (zh) * 2016-08-01 2019-04-02 韩国电子通信研究院 图像编码/解码方法和设备以及存储比特流的记录介质
CN111031319A (zh) * 2019-12-13 2020-04-17 浙江大华技术股份有限公司 一种局部光照补偿预测方法、终端设备及计算机存储介质
US20200413073A1 (en) * 2010-12-13 2020-12-31 Electronics And Telecommunications Research Institute Intra prediction method and apparatus
CN113170152A (zh) * 2019-01-18 2021-07-23 华为技术有限公司 用于预测译码的局部亮度补偿的方法和装置
CN113841405A (zh) * 2019-05-21 2021-12-24 华为技术有限公司 用于帧间预测的局部光照补偿的方法和设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200413073A1 (en) * 2010-12-13 2020-12-31 Electronics And Telecommunications Research Institute Intra prediction method and apparatus
CN109565593A (zh) * 2016-08-01 2019-04-02 韩国电子通信研究院 图像编码/解码方法和设备以及存储比特流的记录介质
CN113170152A (zh) * 2019-01-18 2021-07-23 华为技术有限公司 用于预测译码的局部亮度补偿的方法和装置
CN113841405A (zh) * 2019-05-21 2021-12-24 华为技术有限公司 用于帧间预测的局部光照补偿的方法和设备
CN111031319A (zh) * 2019-12-13 2020-04-17 浙江大华技术股份有限公司 一种局部光照补偿预测方法、终端设备及计算机存储介质

Similar Documents

Publication Publication Date Title
WO2017071480A1 (zh) 参考帧编解码的方法与装置
TW201841503A (zh) 視頻寫碼中之內濾波旗標
WO2023039859A1 (zh) 视频编解码方法、设备、系统、及存储介质
WO2023044868A1 (zh) 视频编解码方法、设备、系统、及存储介质
WO2023197229A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023220970A1 (zh) 视频编码方法、装置、设备、系统、及存储介质
WO2023173255A1 (zh) 图像编解码方法、装置、设备、系统、及存储介质
WO2023184747A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
US20230319267A1 (en) Video coding method and video decoder
WO2023044919A1 (zh) 视频编解码方法、设备、系统、及存储介质
WO2023220946A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023122968A1 (zh) 帧内预测方法、设备、系统、及存储介质
WO2023184248A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023236113A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2024007128A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2024092425A1 (zh) 视频编解码方法、装置、设备、及存储介质
WO2023220969A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023122969A1 (zh) 帧内预测方法、设备、系统、及存储介质
WO2024108391A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2023197183A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2024077553A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2024050723A1 (zh) 一种图像预测方法、装置及计算机可读存储介质
CN116760976B (zh) 仿射预测决策方法、装置、设备及存储介质
WO2023123736A1 (zh) 预测方法、装置、设备、系统、及存储介质
WO2023123478A1 (zh) 预测方法、装置、设备、系统、及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22936879

Country of ref document: EP

Kind code of ref document: A1