WO2024207434A1 - 视频编解码方法、装置、设备、系统、及存储介质 - Google Patents
视频编解码方法、装置、设备、系统、及存储介质 Download PDFInfo
- Publication number
- WO2024207434A1 WO2024207434A1 PCT/CN2023/086930 CN2023086930W WO2024207434A1 WO 2024207434 A1 WO2024207434 A1 WO 2024207434A1 CN 2023086930 W CN2023086930 W CN 2023086930W WO 2024207434 A1 WO2024207434 A1 WO 2024207434A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- current block
- sample
- block
- samples
- model parameters
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 242
- 238000005286 illumination Methods 0.000 claims abstract description 317
- 230000008859 change Effects 0.000 claims abstract description 34
- 238000005516 engineering process Methods 0.000 claims description 85
- 238000005070 sampling Methods 0.000 claims description 50
- 230000015654 memory Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 26
- 230000000694 effects Effects 0.000 abstract description 33
- 230000008569 process Effects 0.000 description 39
- 238000013139 quantization Methods 0.000 description 30
- 238000010586 diagram Methods 0.000 description 28
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 18
- 230000009466 transformation Effects 0.000 description 18
- 238000004364 calculation method Methods 0.000 description 13
- 230000006835 compression Effects 0.000 description 10
- 238000007906 compression Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 10
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 9
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000010076 replication Effects 0.000 description 8
- 238000001914 filtration Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 4
- 239000003086 colorant Substances 0.000 description 4
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 3
- 230000002457 bidirectional effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000002123 temporal effect Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 239000010754 BS 2869 Class F Substances 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 2
- 238000012821 model calculation Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000012812 general test Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012958 reprocessing Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/189—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
- H04N19/196—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
Definitions
- the present application relates to the field of video coding and decoding technology, 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, smart phones, computers, e-readers or video players, etc. With the development of video technology, the amount of data included in video data is large. In order to facilitate the transmission of video data, video devices implement video compression technology to make video data more efficiently transmitted or stored.
- the embodiments of the present application provide a video encoding and decoding method, apparatus, device, system, and storage medium, which can improve the accuracy of constructing a candidate prediction mode list, improve the prediction accuracy of the current block, and thus improve the encoding and decoding performance.
- the present application provides a video decoding method, applied to a decoder, comprising:
- the prediction mode of the current block is the multi-model intra block copy illumination compensation mode, determining a reference block of the current block and determining N groups of linear model parameters, where N is a positive integer greater than 1;
- a target group of linear model parameters is selected from the N groups of linear model parameters, and the target group of linear model parameters is used to linearly change the reference block to obtain a prediction block of the current block.
- an embodiment of the present application provides a video encoding method, including:
- the prediction mode of the current block is the multi-model intra block copy illumination compensation mode, determining a reference block of the current block and determining N groups of linear model parameters, where N is a positive integer greater than 1;
- a target group of linear model parameters is selected from the N groups of linear model parameters, and the target group of linear model parameters is used to linearly change the reference block to obtain a prediction block of the current block.
- the present application provides a video decoding device, which is used to execute the method in the first aspect or its respective implementations.
- the device includes a functional unit for executing the method in the first aspect or its respective implementations.
- the present application provides a video encoding device, which is used to execute the method in the second aspect or its respective implementations.
- the device includes a functional unit for executing the method in the second aspect or its respective implementations.
- a video decoder comprising a processor and a memory, wherein 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 first aspect or its implementations.
- a video encoder comprising a processor and a memory, wherein 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 second aspect or its implementations.
- a video coding and decoding system including a video encoder and a video decoder.
- the video decoder is used to execute the method in the first aspect or its respective implementations
- the video encoder is used to execute the method in the second aspect or its respective implementations.
- a chip for implementing the method in any one of the first to second aspects or their respective implementations.
- the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method in any one of the first to second aspects or their respective implementations.
- a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method of any one of the first to second aspects or any of their implementations.
- a computer program product comprising computer program instructions, which enable a computer to execute the method in any one of the first to second aspects or their respective implementations.
- a computer program which, when executed on a computer, enables the computer to execute the method in any one of the first to second aspects or in each of their implementations.
- a code stream is provided, which is generated based on the method of the second aspect.
- a multi-model intra-block copy illumination compensation mode is proposed to increase the mode of intra-block copy illumination compensation, so that the codec can choose to use the single-model intra-block copy illumination compensation mode (i.e., only one set of model parameters) for prediction compensation, or use the multi-model intra-block copy illumination compensation mode (i.e., including multiple sets of model parameters) for prediction compensation according to the specific situation of the current block.
- the multi-model intra-block copy illumination compensation mode is selected to predict and compensate the current block
- N sets of linear model parameters are determined, and target linear model parameters are selected from the N sets of linear model parameters, and then the target model parameters are used to linearly change the reference block of the current block to obtain the prediction block of the current block, thereby improving the illumination compensation effect, thereby improving the prediction accuracy and encoding and decoding performance.
- FIG1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application.
- FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application.
- FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application.
- 4A and 4B are schematic diagrams of images with different brightness
- FIG5 is a schematic diagram of the principle of the illumination compensation model
- Figure 6 is a schematic diagram of sample selection
- FIG. 7 is a schematic diagram of the IBC principle
- FIG8 is a schematic diagram of images with different illuminations
- Figure 9 is a schematic diagram of IBC-LIC
- FIG10 is a schematic diagram of an application scenario
- FIG11 is a schematic diagram of a video decoding method flow chart provided by an embodiment of the present application.
- FIG12 is a schematic diagram of a template
- FIG13 is a schematic diagram of an extended template
- FIG14 is a schematic diagram of an extended template
- FIG15 is a schematic diagram of a video encoding method flow chart provided by an embodiment of the present application.
- FIG16 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
- FIG17 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
- FIG18 is a schematic block diagram of an electronic device provided in an embodiment of the present application.
- FIG19 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application.
- the present application can be applied to the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc.
- AVC H.264/audio and video coding
- HEVC H.265/high efficiency video coding
- VVC VVC
- the solution of the present application may be combined with other proprietary or industry standards and operate, the standards include ITU-TH.261, ISO/IEC MPEG-1 Visual, ITU-TH.262 or ISO/IEC MPEG-2 Visual, ITU-TH.263, ISO/IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO/IEC MPEG-4 AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions.
- SVC scalable video coding
- MVC multi-view video coding
- FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application. It should be noted that FIG1 is only an example, and the video encoding and decoding system of the embodiment of the present application includes but is not limited to that shown in FIG1.
- the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120.
- the encoding device is used to encode (which can be understood as compression) the video data 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 of 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, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, etc.
- the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130.
- the channel 130 may include one or more media and/or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120.
- the channel 130 includes one or more communication media that enable the encoding device 110 to transmit the encoded video data directly to the decoding device 120 in real time.
- the encoding device 110 can modulate the encoded video data according to the communication standard and transmit the modulated video data to the decoding device 120.
- the communication medium includes a wireless communication medium, such as a radio frequency spectrum, and optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.
- the channel 130 includes a storage medium, which can store the video data encoded by the encoding device 110.
- the storage medium includes a variety of locally accessible data storage media, such as optical disks, DVDs, flash memories, etc.
- the decoding device 120 can obtain the encoded video data from the storage medium.
- the channel 130 may include a storage server that can store the video data encoded by the encoding device 110.
- the decoding device 120 can download the stored encoded video data from the storage server.
- the storage server can store the encoded video data and transmit the encoded video data to the decoding device 120, such as a web server (e.g., 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 further include a video source 111 in addition to the video encoder 112 and the input interface 113 .
- the video source 111 may include at least one of a video acquisition device (eg, a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data.
- a video acquisition device eg, a video camera
- a video archive e.g., a video archive
- a video input interface e.g., a computer graphics system
- the video input interface is used to receive video data from a video content provider
- the computer graphics system is used to generate video data.
- the video encoder 112 encodes the video data from the video source 111 to generate a bitstream.
- the video data may include one or more pictures or a sequence of pictures.
- the bitstream contains the encoding information of the picture or the sequence of pictures in the form of a bitstream.
- the encoding information may include the encoded picture data and associated data.
- the associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short) and other syntax structures.
- SPS sequence parameter set
- PPS picture parameter set
- the syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the bitstream.
- the video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113.
- the encoded video data may also be stored in a storage medium or a storage server for subsequent reading by the decoding device 120.
- the decoding device 120 includes an input interface 121 and a video decoder 122 .
- the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .
- the input interface 121 includes a receiver and/or a modem.
- the input interface 121 can receive the encoded video data through the 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 decoded video data is displayed on the display device 123.
- the display device 123 may be integrated with the decoding device 120 or external to the decoding device 120.
- the display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
- FIG1 is only an example, and the technical solution of the embodiment of the present application is not limited to FIG1 .
- the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.
- FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on an image, or can be used to perform lossless compression on an image.
- the lossless compression can be visually lossless compression or mathematically lossless compression.
- the video encoder 200 can be applied to image data in luminance and chrominance (YCbCr, YUV) format.
- the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) for describing 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 chrominance components (YYYYCbCrCbCr)
- 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
- the video encoder 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs).
- CTB may be referred to as a "tree block", “largest coding unit” (LCU) or “coding tree block” (CTB).
- Each CTU may be associated with a pixel block of equal size within the image.
- Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU may be associated with a luminance sample block and two chrominance sample blocks.
- the size of a CTU is, for example, 128 ⁇ 128, 64 ⁇ 64, 32 ⁇ 32, etc.
- a CTU may be further divided into a number of coding units (CUs) for encoding, and a CU may be a rectangular block or a square block.
- CU can be further divided into prediction unit (PU) and transform unit (TU), which makes encoding, prediction and transformation separate and more flexible in processing.
- PU prediction unit
- TU transform unit
- CTU is divided into CU in quadtree mode
- CU is divided into TU and PU in quadtree mode.
- the video encoder and video decoder may support various PU sizes. Assuming that the size of a particular CU is 2N ⁇ 2N, the video encoder and video decoder may support PU sizes of 2N ⁇ 2N or N ⁇ N for intra-frame prediction, and support symmetric PUs of 2N ⁇ 2N, 2N ⁇ N, N ⁇ 2N, N ⁇ N or similar sizes for inter-frame prediction. The video encoder and video decoder may also support asymmetric PUs of 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ 2N for inter-frame 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, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components.
- the current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc.
- the prediction block may also be referred to as a prediction image block or an image prediction block
- the reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
- the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Since there is a strong correlation between adjacent pixels in a frame of a video, the intra-frame prediction method is used in the video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in a video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency.
- the inter-frame prediction unit 211 can be used for inter-frame prediction.
- Inter-frame prediction can include motion estimation and motion compensation. It 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 for inter-frame prediction can be P frames and/or B frames. P frames refer to forward prediction frames, and B frames refer to bidirectional prediction frames.
- Inter-frame prediction uses motion information to find reference blocks from reference frames, and generates prediction blocks based on the reference blocks.
- Motion information includes a reference frame list where the reference frame is located, a reference frame index, and a motion vector.
- the motion vector can be an integer pixel or a sub-pixel.
- the motion vector is a sub-pixel
- the integer pixel or sub-pixel block in the reference frame found according to the motion vector is called a reference block.
- Some technologies will directly use the reference block as a prediction block, and some technologies will generate a prediction block based on the reference block. Reprocessing the reference block to generate a prediction block can also be understood as taking the reference block as a prediction block and then processing the prediction block to generate a new prediction block.
- the intra-frame prediction unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy.
- the frame used for intra-frame prediction can be an I frame.
- the intra-frame prediction modes used by HEVC are Planar, DC, and 33 angle modes, for a total of 35 prediction modes.
- the intra-frame modes used by VVC are Planar, DC, and 65 angle modes, for a total of 67 prediction modes.
- the residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate a residual block of the CU so that each sample in the residual block has a value equal to the difference between the following two: a sample in the pixel blocks of the CU and a corresponding sample in the prediction blocks of the PUs of the CU.
- the transform/quantization unit 230 may quantize the transform coefficients.
- the transform/quantization unit 230 may quantize the transform coefficients associated with the TUs of the CU based on a quantization parameter (QP) value associated with the CU.
- QP quantization parameter
- the video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
- the inverse transform/quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct a residual block from the quantized transform coefficients.
- the reconstruction unit 250 may add the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this manner, the video encoder 200 may reconstruct the pixel blocks of the CU.
- the loop filter unit 260 is used to process the inverse transformed and inverse quantized pixels to compensate for distortion information and provide a better reference for subsequent coded pixels. For example, a deblocking filter operation may be performed to reduce the blocking effect of the pixel blocks associated with the CU.
- the loop filter unit 260 includes a deblocking filter unit and a sample adaptive offset/adaptive loop filter (SAO/ALF) unit, wherein the deblocking filter unit is used to remove the block effect, and the SAO/ALF unit is used to remove the ringing effect.
- SAO/ALF sample adaptive offset/adaptive loop filter
- the decoded image buffer 270 may store the reconstructed pixel blocks.
- the inter prediction unit 211 may use the reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images.
- the intra prediction unit 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU.
- the entropy encoding unit 280 may receive the quantized transform coefficients from the transform/quantization unit 230.
- the entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data.
- FIG3 is a schematic block diagram of a video decoder according to 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 filter unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.
- the video decoder 300 may receive a bitstream.
- the entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the syntax elements in the bitstream that have been entropy encoded.
- the prediction unit 320, the inverse quantization/transformation unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data according to the syntax elements extracted from the bitstream, that is, generate decoded video data.
- the prediction unit 320 includes an intra-prediction unit 322 and an inter-prediction unit 321 .
- the intra prediction unit 322 may perform intra prediction to generate a prediction block for the PU.
- the intra prediction unit 322 may use an intra prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs.
- the intra prediction unit 322 may also determine the intra prediction mode of the PU according to one or more syntax elements parsed from the code stream.
- the inter prediction unit 321 may construct a first reference image list (list 0) and a second reference image list (list 1) according to the syntax elements parsed from the code stream.
- the entropy decoding unit 310 may parse the motion information of the PU.
- the inter prediction unit 321 may determine one or more reference blocks of the PU according to the motion information of the PU.
- the inter prediction unit 321 may generate a prediction block of the PU according to one or more reference blocks of the PU.
- the inverse quantization/transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU.
- the inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
- the inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.
- the reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the 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.
- the loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking effects of pixel blocks associated with a CU.
- the video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360.
- the video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
- the basic process of video encoding and decoding is as follows: at the encoding end, a frame of image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block.
- the residual unit 220 can calculate the residual block based on the original block of the prediction block and the current block, that is, the difference between the original block of the prediction block and the current block, and the residual block can also be called residual information.
- the residual block can remove information that is not sensitive to the human eye through the transformation and quantization process of the transformation/quantization unit 230 to eliminate visual redundancy.
- the residual block before transformation and quantization by the transformation/quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation/quantization unit 230 can be called a frequency residual block or a frequency domain residual block.
- the entropy coding unit 280 receives the quantized change coefficient output by the change quantization unit 230, and can entropy encode the quantized change coefficient and output a bit stream. For example, the entropy coding unit 280 can eliminate character redundancy according to the target context model and the probability information of the binary bit stream.
- 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-frame prediction or inter-frame prediction to generate a prediction block of the current block based on the prediction information.
- the inverse quantization/transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block.
- the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block.
- the reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or on the block to obtain a decoded image.
- the encoding end also requires similar operations as the decoding end to obtain a decoded image.
- the decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-frame prediction for subsequent
- the block division information determined by the encoder as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the bitstream when necessary.
- the decoder parses the bitstream and determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder by analyzing the existing information, thereby ensuring that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder.
- the above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
- ECM Enhanced Compression Model
- the current block may be a current coding unit (CU) or a current prediction unit (PU), etc.
- CU current coding unit
- PU current prediction unit
- an image may be divided into slices, etc. Slices in the same image may be processed in parallel, that is, there is no data dependency between them.
- "Frame” is a commonly used term, and generally can be understood as a frame is an image. In the application, the frame can also be replaced by an image or a slice.
- LIC Local Illuminance Compensation
- the latest video codec standard H.266/VVC has been finalized.
- the Joint International Video Coding Standard Experts Group JVET proposed to explore video codec standards that exceed VVC encoding performance based on VVC, and established the exploratory experiment EE2 for the purpose of beyond VVC.
- the platform reference software used in the exploratory experiment is based on VTM11.0.
- the new algorithm will be integrated into it and the branch will be changed to ECM.
- multiple expert discussion groups will be established for ECM.
- the latest ECM reference software version 8.0 already has an encoding performance that exceeds VVC by about 19%, and VVC, as the current latest standard, is only about 27% higher than the previous generation video codec standard H.265/HEVC in encoding performance. It is conceivable that in the near future, the window for exploring and researching the next generation of video codec standards may be opened based on ECM.
- Illumination compensation technology is an inter-frame coding technology.
- the current coding unit obtains the corresponding reference block according to MV (motion vector information), and this reference block usually comes from different coding frames, or the reference coding unit does not belong to the current image. Images of different frames have large or small changes in some specific scenes, and illumination compensation technology is very effective in processing some of these changes.
- the texture information of the left and right parts is basically the same, and the difference lies in the brightness change of the two. Because the right image is illuminated by the camera flash and appears very bright, the left is illuminated by normal natural light. There is a difference between the two figures above, and the burden brought by this difference in video coding is huge.
- 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. Because the pixels of the right image are offset as a whole due to the effect of the flash, the residual of the two includes this part of the offset. If this part of the residual is directly transformed and quantized and written into the bitstream, the overhead of this part is huge.
- the illumination compensation technology in the existing ECM reference software eliminates these effects, such as those caused by flash or illumination changes, through linear fitting, making the overall prediction effect better.
- the main parts of the illumination compensation technology are as follows:
- the correlation between the reconstructed samples of the reference coding unit and the adjacent parts of the current coding unit is used to fit the correlation between the changes in the prediction samples and the reference samples within the coding unit. 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 illumination compensation adopts a linear fitting method, and the model is simplified to consist of a scaling parameter a and a bias parameter b, which can fit the illumination changes between the current frame and the reference image.
- Pred(x,y) is the prediction block before illumination compensation
- Pred'(x,y) is the prediction block after illumination compensation
- a is the scaling parameter in the illumination compensation model
- b is the offset parameter in the illumination compensation model.
- 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.
- Curr_Rec neigh is the reconstructed image of the current frame
- Ref_Rec neigh is the reconstructed image of the reference frame.
- the coding block of the current frame is corrected for illumination differences through an illumination compensation model to obtain a compensated prediction block.
- the calculation of the above-mentioned scaling parameter a and offset parameter b requires the use of the adjacent reconstructed pixels of the corresponding reconstructed block in the reference frame and the adjacent reconstructed pixels of the coding block in the current frame. According to the correlation between the adjacent reconstructed pixels of the coding unit of the current frame and the reconstructed pixels at the corresponding positions in the reference frame, they are modeled and solved, as shown in Figure 6.
- Reconstructed pixels are the most adjacent reconstructed sample pixels of CU
- Reference picture CU is the corresponding reconstructed CU in the reference frame
- Current picture CU is the CU to be encoded in the current encoding frame.
- sumXsumY is sumX multiplied by sumY.
- the final prediction block is obtained by linearly changing the prediction block after motion compensation.
- the illumination compensation technology in ECM can be used in ordinary inter-frame prediction, merge prediction mode and sub-block mode, among which ordinary inter-frame prediction is inter mode, merge prediction mode is merge mode, and sub-block mode is affine mode. At the same time, the illumination compensation technology only works in single-frame prediction mode and is prohibited for multi-frame bidirectional reference mode.
- the illumination compensation technology in ECM is coupled with the adopted technology.
- the illumination compensation technology is not used simultaneously with the bidirectional optical flow technology (BDOF) and the symmetric motion vector difference technology (SMVD).
- Intra-block copy technology is to find a block in the current frame that matches or is close to the current coding block and copy it as the prediction block of the current coding block. This is an intra-frame prediction technology specifically used for screen content coding.
- the solid line with an arrow is the block vector information BV of the current coding block.
- the current coding block finds a matching reconstructed block through BV as the prediction block of the current coding block.
- IBC has two modes, one is AMVP (advanced motion vector prediction) mode; the other is skip/merge mode, that is, merge mode.
- AMVP advanced motion vector prediction
- IBC In AMVP mode, IBC needs to transmit an index to indicate which block vector prediction (BVP) to use, as well as the coded block vector difference (BVD).
- BVP block vector prediction
- BVD coded block vector difference
- IBC In skip/merge mode, IBC needs to transmit an index to indicate which block vector (BV) information to use.
- BV block vector
- the most common scenario is illumination change. For example, a camera is fixedly illuminating a building, and the video content of the building taken in the morning is the same as the video content of the building taken in the afternoon. However, the light intensity has changed, so even if the inter-frame prediction uses the decoded reconstructed frame as the reference content, it cannot fully represent the video content, because the illumination is different, the overall mean of the video content is different, and the residual bit stream required for encoding consumes a lot.
- the illumination compensation technology solves this problem very well. By establishing a linear model, the reference content and the current content are converted to adapt to the changes in different light intensities without changing the texture content.
- the IBC-LIC technology is the same as the inter-frame LIC technology.
- the reference block is converted as the prediction block of the current coding unit.
- the process is the same as the inter-frame LIC part mentioned above.
- IBC in AMVP mode, IBC requires a flag to indicate whether to use the LIC technology, and in merge mode, the LIC technology is turned on and off by inheritance.
- IBC-LIC technology can indeed provide very impressive performance in screen content encoding application scenarios. Its calculation process is the same as that of inter-frame LIC technology. The complexity is acceptable both in terms of software and hardware, and the cost-effectiveness is still very high.
- IBC-LIC follows the inter-frame LIC, and uses the reference samples and reconstructed samples of the upper and left template areas as inputs for modeling, which may not be a good match for the screen content coding scenario.
- the illumination changes should be the same for the content in the current frame, while in the screen content scenario, the content is a pixel-level change, which is sharper.
- the color changes are very rapid and drastic. Some shapes are red, but the next shape may be green. If the current coding unit includes these two colors, and the reference reconstruction block texture is the same, but the color changes are different, the parameters calculated using the template cannot well reflect the change relationship between different colors. At this time, the model parameters are more like a compromise fit.
- the embodiment of the present application proposes a multi-model intra-block copy illumination compensation mode to increase the mode of intra-block copy illumination compensation, so that the codec can choose to use the single-model intra-block copy illumination compensation mode (i.e., only one set of model parameters) for prediction compensation, or use the multi-model intra-block copy illumination compensation mode (i.e., including multiple sets of model parameters) for prediction compensation according to the specific situation of the current block.
- the single-model intra-block copy illumination compensation mode i.e., only one set of model parameters
- the multi-model intra-block copy illumination compensation mode i.e., including multiple sets of model parameters
- the multi-model intra-block copy illumination compensation mode is selected to predict and compensate the current block, multiple sets of linear model parameters are determined, and target linear model parameters are selected from the multiple sets of linear model parameters, and then the target model parameters are used to linearly change the reference block of the current block to obtain the prediction block of the current block, thereby improving the prediction accuracy and the encoding and decoding performance.
- the video decoding method provided in the embodiment of the present application is introduced by taking the decoding end as an example.
- FIG11 is a schematic diagram of a video decoding method flow chart provided by an embodiment of the present application, and the embodiment of the present application is applied to the video decoders shown in FIG1 and FIG3. As shown in FIG11, the method of the embodiment of the present application includes:
- S101 Determine a prediction mode for a current block.
- the intra-block copy illumination compensation mode with only one set of model parameters is recorded as a single-model intra-block copy illumination compensation mode, for example, represented as an IBC-LIC-S mode, where the IBC-LIC-S mode is the existing IBC-LIC mode.
- the intra-block copy illumination compensation mode is recorded as a multi-model intra-block copy illumination compensation mode, for example, represented as an IBC-LIC-M mode.
- the embodiment of the present application proposes a multi-model intra-frame block copying illumination compensation mode, which can be understood as an intra-frame block copying illumination compensation mode including multiple sets of linear model parameters.
- the reference block (or initial prediction block) of the current block is determined, and then the optimal set of linear model parameters is selected from the multiple sets of linear model parameters, and the reference block of the current block is linearly changed (i.e., illumination compensation) to obtain the prediction block of the current block, thereby improving the effect of illumination compensation and prediction accuracy, and thus improving the decoding effect of the image.
- the intra block copy illumination compensation mode with only one set of model parameters is recorded as a single-model intra block copy illumination compensation mode, for example, represented as an IBC-LIC-S mode.
- the embodiment of the present application does not limit the specific method of determining the prediction mode of the current block.
- the decoding end defaults the prediction mode of the current block to the multi-model intra-block copy illumination compensation mode.
- the decoding end constructs a candidate prediction mode list, which includes a single-model intra-block copy illumination compensation mode and a multi-model intra-block copy illumination compensation mode.
- the decoding end determines the cost of each candidate prediction mode in the candidate prediction mode list when predicting the template of the current block, and determines the candidate prediction mode with the smallest cost as the prediction mode of the current block.
- the decoding end decodes the bit stream to obtain first information, where the first information is used to indicate the prediction type of the current block, and then determines the prediction mode of the current block based on the first information.
- the embodiment of the present application does not limit the specific form of the first information.
- the first information may be represented as modeType.
- modeType MODE_INTRA, it means that the prediction type of the current block is intra prediction.
- modeType MODE_INTER, it means that the prediction type of the current block is inter-frame prediction.
- modeType MODE_IBC, it means that the prediction type of the current block is intra block copy prediction.
- the third flag may be represented as sps_ibc_lic_enable_flag. By setting different values for the third flag sps_ibc_lic_enable_flag, it is indicated whether the current sequence allows the use of the local illumination compensation technology.
- the value of the third flag sps_ibc_lic_enable_flag is 1, it means that the current sequence allows the use of the local illumination compensation technology.
- the embodiment of the present application does not limit the specific manner in which the decoding end determines the prediction mode of the current block based on the first information.
- the decoding end if the decoding end determines that the prediction type of the current block is intra-block copy prediction based on the first information, the decoding end continues to decode the code stream to obtain a first flag, which is used to indicate whether the current block uses the merge mode, and then determines the prediction mode of the current block based on the first flag.
- the first flag may be represented as merge_flag. By setting different values for the first flag merge_flag, it is indicated whether the current block uses the merge mode for prediction.
- the value of the first flag merge_flag is 0, it means that the current block does not use the merge mode for prediction.
- the value of the first flag merge_flag is 1, it means that the current block is predicted using the merge mode.
- the embodiment of the present application does not limit the specific manner in which the decoding end determines the prediction mode of the current block based on the first flag.
- the decoding end defaults the prediction mode of the current block to the multi-model intra-frame block copy illumination compensation mode.
- the embodiment of the present application does not limit the specific form of the second information.
- the second information may be represented as cu_ibc_lic_flag. By setting different values for the second information cu_ibc_lic_flag, it is indicated whether the current block uses the intra block copy illumination compensation mode.
- the value of the second information cu_ibc_lic_flag is 0, it means that the current block is not predicted using the intra block copy illumination compensation mode.
- the value of the second information cu_ibc_lic_flag is 1, it indicates that the current block is predicted using the intra block copying illumination compensation mode.
- the decoding end has restrictions on the size of the block using the intra-block copy illumination compensation mode, for example, the intra-block copy illumination compensation mode is not used for blocks of some sizes, and the intra-block copy illumination compensation mode is used for blocks of some sizes. Based on this, before decoding the above-mentioned second information, the decoding end first determines whether the size of the current block meets the first preset size, and only decodes the bitstream to obtain the second information if the size of the current block meets the first preset size.
- the embodiment of the present application does not limit the specific indicator for measuring the size of the current block.
- the width and height of the current block can be used to measure the size of the current block. For example, when the width of the current block is greater than threshold 1 and the height is greater than threshold 2, it is determined that the size of the current block meets the first preset size, and then the code stream is decoded to obtain the second information.
- the values of threshold 1 and threshold 2 can be 4 and 8, respectively. 16, 32, 128, 256, etc.
- Threshold 1 can be equal to threshold 2.
- the product of the width and height of the current block can be used to measure the size of the current block.
- the area of the current block is greater than or equal to threshold 3 and less than threshold 5, it is determined that the size of the current block meets the first preset size, and then the code stream is decoded to obtain the second information.
- the value of threshold 3 can be 16, 32, etc.
- the value of threshold 5 is 256, 1024, etc.
- the size of the current block can be measured by the number of pixels included in the current block. For example, when the number of pixels included in the current block is greater than or equal to a threshold value of 4, it is determined that the size of the current block meets the first preset size, and then the code stream is decoded to obtain the second information.
- the value of the threshold value 4 can be 16, 32, 128, 256, 1024, etc.
- the embodiment of the present application does not limit the specific manner in which the decoding end determines the prediction mode of the current block based on the second information.
- Method 1 if the second information indicates that the current block does not use the intra block copy illumination compensation mode, the decoder continues to decode the bitstream, determines the prediction mode of the current block, and determines that the prediction mode of the current block is not the multi-model intra block copy illumination compensation mode.
- Mode 2 if the second information indicates that the current block uses the intra block copy illumination compensation mode, the decoding end defaults the prediction mode of the current block to the multi-model intra block copy illumination compensation mode.
- Method 3 If the second information indicates that the current block uses the intra block copying illumination compensation mode, the decoding end can use the single-model intra block copying illumination compensation mode and the multi-model intra block copying illumination compensation mode to predict the template area of the current block respectively, and select the mode with the lowest cost as the prediction mode of the current block.
- Method 4 If the second information indicates that the current block uses the intra-block copy illumination compensation mode, the decoding end continues to decode the code stream to obtain index information, which is used to indicate the mode index of the intra-block copy illumination compensation mode used by the current block, and then determines the prediction mode of the current block based on the index information.
- the index information may be represented as cu_ibc_lic_index.
- the mode index of the intra block copy illumination compensation mode used by the current block is represented.
- the value of the index information cu_ibc_lic_index is the first value, it indicates that the prediction mode of the current block is the single model intra block copy illumination compensation mode.
- the prediction mode of the current block is the multi-model intra block copy illumination compensation mode.
- the embodiment of the present application does not limit the specific values of the first numerical value and the second numerical value.
- the first value is 0.
- the second value is 1.
- the decoding end determines the prediction mode of the current block by decoding the syntax elements shown in Table 1:
- sps_ibc_lic_enable_flag is the third flag, which is used to indicate whether the current sequence allows local illumination compensation.
- modeType is the first information, which is used to indicate the prediction type of the current block.
- merge_flag is the first flag, which is used to indicate whether the current block is predicted using merge mode.
- cbWidth is the width of the current block, and cbHeight is the height of the current block.
- cu_ibc_lic_flag is the second information, which is used to indicate whether the current block uses the intra-block copy illumination compensation mode.
- cu_ibc_lic_index is an index flag, which is used to indicate the mode index of the intra-block copy illumination compensation mode used by the current block.
- the decoder first decodes sps_ibc_lic_enable_flag. If sps_ibc_lic_enable_flag indicates that the current sequence allows local illumination compensation, it continues to decode merge_flag. If merge_flag indicates that the current block does not use the merge mode, it determines whether the cbWidth*cbHeight of the current block is greater than 32, where 32 is a preset value and can be changed according to actual conditions. If the decoder determines that cbWidth*cbHeight of the current block>32, it continues to decode cu_ibc_lic_flag.
- cu_ibc_lic_flag indicates that the current block uses the intra-block copy illumination compensation mode, it continues to decode cu_ibc_lic_index to obtain whether the prediction mode of the current block is a single-model intra-block copy illumination compensation mode or a multi-model intra-block copy illumination compensation mode.
- the cu_ibc_lic_index may be decoded based on context or with equal probability.
- Mode 5 If the second information indicates that the current block uses the intra block copying illumination compensation mode, and the size of the current block is greater than or equal to the second preset size, the multi-model intra block copying illumination compensation mode is determined as the prediction mode of the current block.
- the multi-model intra-frame block replication illumination compensation mode is used by default, that is, when parsing the syntax elements at the decoding end, if cu_ibc_lic_flag is true and the size of the current block is larger than the second preset size, it means that the current block uses the multi-model intra-frame block replication illumination compensation mode, otherwise it means that the current block does not use illumination compensation technology and there is no need to parse the index.
- the embodiment of the present application does not limit the specific indicator for measuring the size of the current block.
- the width and height of the current block can be used to measure the size of the current block. For example, when the width of the current block is greater than threshold 1 and the height is greater than threshold 2, it is determined that the size of the current block is greater than the second preset size.
- the values of threshold 1 and threshold 2 can be 4, 8, 16, 32, 128, 256, etc., and threshold 1 can be equal to threshold 2.
- the product of the width and height of the current block can be used to measure the size of the current block.
- the area of the current block is greater than or equal to threshold 3, it is determined that the size of the current block is greater than the second preset size.
- the value of threshold 3 can be 16, 32, 128, 256, etc.
- the size of the current block can be measured by the number of pixels included in the current block. For example, when the number of pixels included in the current block is greater than or equal to a threshold value of 4, it is determined that the size of the current block is greater than a second preset size.
- the value of the threshold value 4 can be 16, 32, 128, 256, 1024, etc.
- the second information in the above embodiment only indicates whether the current block uses the intra block copy illumination compensation mode, and does not indicate the mode index of the intra block copy illumination compensation mode. Instead, the mode index of the intra block copy illumination compensation mode is indicated by index information.
- the second information in addition to indicating whether the current block uses the intra-block copy illumination compensation mode, may also indicate the mode index of the intra-block copy illumination compensation mode. In this case, the decoding end may directly determine the prediction mode of the current block based on the value of the second information.
- cu_ibc_lic_mode may be used to represent the second information.
- syntax elements may also be used to represent the second information, which is not limited in this embodiment of the present application.
- the prediction mode of the current block is the non-intra block copy illumination compensation mode
- the prediction mode of the current block is the single model intra block copy illumination compensation mode
- the prediction mode of the current block is the multi-model intra block copy illumination compensation mode.
- the embodiment of the present application does not limit the specific values of the first value, the second value and the third value.
- the first value is 0, the second value is 1, and the third value is 2.
- whether the current block uses the intra block copy illumination compensation mode and the mode index of the intra block copy illumination compensation mode used by the current block can be determined through the specific value of the second information cu_ibc_lic_mode.
- the decoding end decodes the bit stream to obtain the second information cu_ibc_lic_mode. If the value of the second information cu_ibc_lic_mode is the first value, it is determined that the current block does not use the intra block copy illumination compensation mode. If the value of the second information cu_ibc_lic_mode is the second value, it is determined that the prediction mode of the current block is the single-model intra block copy illumination compensation mode. If the value of the second information cu_ibc_lic_mode is the third value, it is determined that the prediction mode of the current block is the multi-model intra block copy illumination compensation mode.
- the decoding end determines the prediction mode of the current block by decoding the syntax elements shown in Table 2:
- the decoder first decodes sps_ibc_lic_enable_flag. If sps_ibc_lic_enable_flag indicates that the current sequence allows local illumination compensation, it continues to decode merge_flag. If merge_flag indicates that the current block does not use the merge mode, it determines whether the cbWidth*cbHeight of the current block is greater than 32, where 32 is a preset value and can be changed according to actual conditions. If the decoder determines that cbWidth*cbHeight of the current block>32, it continues to decode cu_ibc_lic_mode.
- cu_ibc_lic_mode If cu_ibc_lic_mode is 0, it indicates that the current block does not use the intra-block copy illumination compensation mode. If cu_ibc_lic_mode is 1, it indicates that the current block uses the single-model intra-block copy illumination compensation mode. If cu_ibc_lic_mode is 2, it indicates that the current block uses the multi-model intra-block copy illumination compensation mode.
- the intra-block copy illumination compensation mode is mutually exclusive with some tools.
- the condition for parsing the second information can be determined according to the existing decoding tool coupling relationship in the standard.
- the decoding end before decoding the second information, the decoding end also includes decoding the bitstream to obtain the third information, which is used to indicate whether the current block is decoded using the first tool, and the first tool is mutually exclusive with the intra-block copy illumination compensation technology; if the third information indicates that the current block is not decoded using the first tool, the bitstream is decoded to obtain the second information.
- the block-level use flag (i.e., the third information) of the first tool can be first parsed to determine whether to parse the second information of the current block. If the block-level use flag (i.e., the third information) of the first tool is true, there is no need to parse the second information of the current block; otherwise, the second information of the current block is parsed.
- RRIBC Reconstruction-reordered IBC, a technology that reconstructs samples and then searches for matching blocks.
- the reconstructing operation includes but is not limited to horizontal flipping and vertical flipping.
- the decoder decodes the syntax elements shown in Table 3 to obtain the prediction mode of the current block:
- cu_rribc_flip_type is the operation type of the first tool RRIBC. If cu_rribc_flip_type is 0, it means that the current block does not use the RRIBC technology; otherwise, it means that the current block uses the RRIBC technology.
- the second information in Table 3 may also be represented by cu_ibc_lic_mode in Table 2, and then the index information cu_ibc_lic_index in Table 3 is deleted.
- the above describes the specific process of the decoding end determining the prediction mode of the current block when the first flag indicates that the current block does not use the merge mode.
- the decoding end can determine the prediction mode of the current block in at least the following ways.
- Mode 1 If the first flag indicates that the current block uses the merge mode, the prediction mode of the reference block is determined as the prediction mode of the current block.
- the prediction mode of the current block is obtained by inheritance. Specifically, the decoder determines the reference block of the current block and determines the prediction mode of the reference block as the prediction mode of the current block.
- the prediction mode of the reference block is the single model intra block copy illumination compensation mode
- it is determined that the prediction mode of the current block is also the single model intra block copy illumination compensation mode.
- the prediction mode of the reference block is the multi-model intra block copy illumination compensation mode
- it is determined that the prediction mode of the current block is also the multi-model intra block copy illumination compensation mode.
- the encoder does not need to transmit the prediction mode information of the current block in the bitstream.
- Method 2 if the first flag indicates that the current block uses the merge mode, the illumination compensation mode is copied within the single model frame block and determined as the prediction mode of the current block.
- both ends of the codec will default to the single model intra-frame block copy illumination compensation mode and determine it as the prediction mode of the current block.
- the encoder does not need to transmit the prediction mode information of the current block in the bitstream.
- Method 3 If the first flag indicates that the current block uses the merge mode, the illumination compensation mode is copied to the block within the multi-model frame and determined as the prediction mode of the current block.
- both ends of the codec will default to the multi-model intra-frame block copy illumination compensation mode and determine it as the prediction mode of the current block.
- the encoder does not need to transmit the prediction mode information of the current block in the bit stream.
- Mode 4 if the first flag indicates that the current block uses the merge mode, the bitstream is decoded to obtain fourth information, where the fourth information is used to indicate the prediction mode of the current block; based on the fourth information, the prediction mode of the current block is obtained.
- the current block may not determine whether to use IBC-LIC by inheriting the surrounding information, but by calculating the rate-distortion cost at the encoding end, and transmit the use or not to the decoding end in the form of a flag and an index.
- the decoding end parses the technology in the merge mode and uses the flag to determine whether to use the IBC-LIC technology for the current coding unit. For example, the encoding end calculates the rate-distortion cost of each candidate prediction mode when predicting the current block, and determines the candidate prediction mode with the lowest cost as the prediction mode of the current block. At the same time, according to the candidate prediction mode with the lowest cost, the fourth information is written into the bitstream, and the prediction mode of the current block is indicated by the fourth information.
- the second information cu_ibc_lic_flag in the above table can be set to no.
- the second information cu_ibc_lic_flag in the above table can be set to true, and cu_ibc_lic_index is determined according to the specific IBC-LIC mode index of the current block. For example, when the prediction mode of the current block is the single-model intra-frame block copy illumination compensation mode, cu_ibc_lic_index is set to 0 and encoded into the bitstream. If the prediction mode of the current block is the multi-model intra-frame block copy illumination compensation mode, cu_ibc_lic_index is set to 1 and encoded into the bitstream.
- the second information cu_ibc_lic_mode in the above table can be set to no, for example, to 0.
- the second information cu_ibc_lic_mode in the above table can be set to true, and the specific value of cu_ibc_lic_mode is determined according to the specific IBC-LIC mode index of the current block. For example, when the prediction mode of the current block is the single-model intra-frame block copy illumination compensation mode, cu_ibc_lic_mode is set to 1 and encoded into the bitstream. If the prediction mode of the current block is the multi-model intra-frame block copy illumination compensation mode, cu_ibc_lic_mode is set to 2 and encoded into the bitstream.
- the decoder determines the prediction mode of the current block. If the prediction mode of the current block is the multi-model intra-block replication illumination compensation mode, the decoder needs to determine N sets of linear model parameters and the reference block of the current block. Then, a set of linear model parameters is selected from the N sets of linear model parameters as the target linear model parameters, and the reference block of the current block is linearly changed to obtain a prediction block with a good illumination compensation effect, thereby improving the prediction accuracy and decoding performance.
- the solid line with an arrow is the block vector information BV of the current block.
- the current block finds a matching reconstructed block through BV as the reference block of the current block.
- the decoding end constructs an MVP candidate list, decodes the bitstream, obtains an index, selects an MVP from the MVP candidate list based on the search, and then determines the starting point of motion estimation based on the selected MVP, and then searches near the starting point to obtain a reference block of the current block.
- the decoding end constructs an MVP candidate list, decodes the bitstream, obtains an index, selects an MVP from the MVP candidate list based on the index, uses the selected MVP as the MV of the current point, and then determines the reference block of the current block in the current image based on the MV.
- the decoding end may also use other existing methods to determine the reference block of the current block.
- the decoding end determines that the prediction mode of the current block is a multi-model intra-block replication illumination compensation mode, it is necessary to determine multiple sets of linear model parameters, and then select one set from these multiple sets of linear model parameters to perform linear changes on the reference block of the current block to obtain the prediction value of the current block.
- each of the N groups of linear model parameters includes a scaling parameter a and an offset parameter b. It should be noted that the parameters included in each of the N groups of linear model parameters are not completely the same.
- N groups of linear model parameters of the embodiment of the present application are shown in Table 4:
- (ai, bi) is the i-th group of linear model parameters, where ai is the scaling parameter in the i-th group of linear model parameters, and bi is the offset parameter in the i-th group of linear model parameters.
- the decoding end After the decoding end determines the N groups of linear model parameters shown in Table 4, it can select a group of linear model parameters from the N groups of linear model parameters shown in Table 4 above, and linearly change the reference block of the current block to achieve illumination compensation, thereby obtaining the illumination compensated reference block, and then determining the illumination compensated reference block as the prediction block of the current block.
- the embodiment of the present application does not limit the specific method for the decoding end to determine N groups of linear model parameters.
- the encoding end may write the determined N groups of linear model parameters into the bitstream, so that the decoding end may obtain the N groups of linear model parameters by decoding the bitstream.
- the above-mentioned N groups of linear model parameters are preset values or empirical values.
- the decoding end determines N groups of linear model parameters through the following step S102-A:
- S102-A Determine N groups of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block.
- the decoding end determines the reconstructed area around the reference block and the reconstructed area around the current block, and then determines N groups of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block.
- the reconstructed area around the reference block includes a reconstructed area adjacent to the reference block and/or a reconstructed area not adjacent to the reference block.
- the reconstructed area around the current block includes a reconstructed area adjacent to the current block and/or a reconstructed area not adjacent to the current block.
- the decoding end can determine N groups of different linear model parameters based on the feature information of the reconstructed area around the reference block and the feature information of the reconstructed area around the current block. These N groups of different linear model parameters can achieve different effects of illumination compensation, and then the decoding end can select a group of linear model parameters with a target illumination compensation effect from the N groups of linear model parameters with different illumination compensation effects according to actual conditions, and perform illumination compensation on the reference block of the current block to improve the illumination compensation effect and prediction effect, thereby improving the decoding performance.
- the decoding end determines the specific values of N groups of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block. No restrictions on the method.
- the decoding end first determines a set of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block.
- the process of determining a set of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block can be performed with reference to the method shown in the above formula (3).
- the set of linear model parameters is adjusted to obtain N sets of linear model parameters.
- the decoding end divides the reconstructed area around the reference block into N sub-areas, for example, based on the color information, brightness information, bit depth and other characteristic information of the reconstructed area around the reference block, the reconstructed area around the reference block is divided into N first sub-areas.
- the reconstructed area around the current block is also divided into N second sub-areas, where one first sub-area corresponds to one second sub-area.
- a set of linear model parameters can be determined according to each first sub-area in the N first sub-areas, according to the first sub-area and the second sub-area corresponding to the first sub-area.
- a set of linear model parameters 1 is determined, according to the first sub-area 2 and the second sub-area 2, a set of linear model parameters 2 is determined, and so on, N sets of linear model parameters can be determined.
- the process of determining a set of linear model parameters 1 according to the first sub-area 1 and the second sub-area 1 can be performed with reference to the method shown in the above formula (3).
- the above S102-A includes the following steps S102-A1 to S102-A3:
- the samples (i.e., reconstructed pixels) included in the reconstructed area around the reference block are recorded as first samples, and the samples (i.e., reconstructed pixels) included in the reconstructed area around the current block are recorded as second samples.
- the decoding end determines the surrounding reconstructed area of the reference block and the surrounding reconstructed area of the current block, it determines a first sample set from the surrounding reconstructed area of the reference block and determines a second sample set from the surrounding reconstructed area of the current block, wherein the first sample set includes at least one first sample and the second sample set includes at least one second sample set.
- the embodiment of the present application does not limit the specific manner in which the decoding end determines the first sample set from the surrounding reconstructed area of the reference block and determines the second sample set from the surrounding reconstructed area of the current block.
- the decoding end collects at least one first sample from the reconstructed area around the reference block according to a preset collection step size to form a first sample set, and collects at least one second sample from the reconstructed area around the current block according to a preset collection step size to form a second sample set.
- the decoding end determines all first samples included in the reconstructed area around the reference block as the first sample set, and determines all second samples included in the reconstructed area around the current block as the second sample set.
- the reconstructed area around the reference block includes the template area of the reference block
- the reconstructed area around the current block includes the template area of the current block.
- the above S102-A1 includes the following step S102-A1:
- the decoding end can directly determine the first sample set from the template area of the reference block, and determine the second sample set from the template area of the current block.
- determining the first sample set from the template area of the reference block and determining the second sample set from the template area of the current block include but are not limited to the following:
- Method 1 According to the width and height of the current block, the number of the first sample and the second sample to be selected is set.
- a preset value of 1 for example, 4
- a preset value of 1 for example, 4
- second samples are taken from the upper template and the left module of the current block to form a second sample set
- the second sample set includes 8 second samples.
- a preset value of 1 for example, 4
- first samples are taken from the upper template and the left module of the reference block to form a first sample set
- the first sample set includes 8 first samples.
- the current block width is a preset value of 2 (e.g., 16) and the height is a preset value of 3 (e.g., 4)
- 4 second samples are taken from the left template of the current block
- 5 (e.g., 4) second samples are taken from the upper template of the current block with a step size of a preset value of 4 (e.g., 3) to form a second sample set, which includes 8 second samples.
- 4 first samples are taken from the left template of the reference block, and 5 (e.g., 4) first samples are taken from the upper template of the reference block with a step size of a preset value of 4 (e.g., 3) to form a first sample set, which includes 8 first samples.
- the second samples with the logarithm of 2 of the smaller side length are obtained from the reconstructed samples included in the upper template and the left template of the current block to form a second sample set.
- the first samples with the logarithm of 2 of the smaller side length are obtained from the reconstructed samples included in the upper template and the left template of the reference block to form a first sample set.
- the upper template includes a row of sample rows (ie, pixel rows), and the left template includes a column of sample columns (ie, pixel columns).
- Method 2 The decoding end performs sampling in the template area of the reference block according to the first sampling step to obtain a first sample set; and performs sampling in the template area of the current block according to the first sampling step to obtain a second sample set, wherein the first sampling step is smaller than the preset sampling step.
- the decoding end can increase the number of samples involved in the calculation of the linear model parameters by reducing the sampling step size, so as to improve the calculation accuracy of the linear model parameters.
- the decoding end performs sampling in the template area of the reference block according to the first sampling step to obtain a first sample set; and performs sampling in the template area of the current block according to the first sampling step to obtain a second sample set, and the first sampling step is smaller than the preset sampling step.
- the first sampling step size is less than 3.
- the decoding end determines all samples included in the template area of the reference block as the first sample set; and determines all samples included in the template area of the current block as the second sample set.
- all samples included in the template area of the reference block can be determined as the first sample set, and all samples included in the template area of the current block can be determined as the second sample set, so as to increase the number of samples participating in the calculation of the linear model parameters and improve the calculation accuracy of the linear model parameters.
- the embodiment of the present application does not limit the specific sizes of the template area of the reference block and the template area of the current block.
- the template area of the reference block includes the upper template area of the reference block and/or the left template area of the reference block.
- the template area of the previous block includes an upper template area of the current block and/or a left template area of the current block.
- the template area may be enlarged.
- the upper template is expanded, such as shown in FIG13
- the left template area of the reference block includes the left template area and the lower left template area of the reference block
- the left template area of the current block includes the left template area and the lower left template area of the current block.
- the left template is expanded, such as shown in FIG14 , the number of sample rows included in the upper template area of the reference block is greater than or equal to the preset number of rows, and the number of sample rows included in the upper template area of the current block is greater than or equal to the preset number of rows.
- the embodiment of the present application can determine a first sample set from the upper template and/or left template of the reference block shown in Figures 13 and 14, and determine a second sample set from the upper template and/or left template of the current block shown in Figures 13 and 14, so as to increase the number of samples in the first sample set and the second sample set.
- the decoding end may also increase the number of rows of the upper template to implement template expansion.
- the number of sample rows included in the upper template region of the reference block is greater than or equal to a preset number of rows
- the number of sample rows included in the upper template region of the current block is greater than or equal to a preset number of rows.
- the preset number of rows may be 2, 3, 4, 5, etc.
- the decoding end may also increase the number of columns of the left template to implement template expansion.
- the number of sample columns included in the left template area of the reference block is greater than or equal to the preset number of columns, and the number of sample columns included in the left template area of the current block is greater than or equal to the preset number of columns.
- the preset number of columns may be 2, 3, 4, 5, etc.
- the decoding end determines the first sample set from the surrounding reconstructed area of the reference block and determines the second sample set from the surrounding reconstructed area of the current block through the above steps.
- the embodiment of the present application does not limit the specific manner in which the decoding end divides the first sample set and the second sample set into N groups of sample sets.
- the decoding end divides the first sample set and the second sample set into N groups of sample sets according to feature information such as color information, brightness information, and bit depth of each of the first sample and the second sample set, and each of the N groups of sample sets includes at least one first sample and at least one second sample.
- feature information such as color information, brightness information, and bit depth of each of the first sample and the second sample set
- each of the N groups of sample sets includes at least one first sample and at least one second sample.
- the first sample and the second sample in the first sample set and the second sample set that have similar feature information such as color information and brightness information are divided into one group of sample sets.
- the above S102-A2 includes the following steps:
- the decoding end first divides the first samples included in the first sample set into N types of first samples, and at the same time, divides the second samples included in the second sample set into N types of second samples.
- Each of the N types of first samples includes at least one first sample
- each of the N types of second samples includes at least one second sample.
- the embodiment of the present application does not limit the specific manner in which the decoding end divides the first samples included in the first sample set into N types of first samples.
- the decoding end classifies the first samples according to the feature information of each first sample in the first sample set to obtain N types of first samples.
- the above S102-A21 includes the following steps S102-A21-a1 and S102-A21-a2:
- S102-A21-a2 Based on the first sample means, divide the first sample set into N types of first samples.
- the decoding end classifies the first samples included in the first sample set according to the sample means.
- the decoding end first determines the sample mean of the first sample set according to the reconstructed values of each first sample in the first sample set, and for ease of description, the sample mean is recorded as the first sample mean. Then, according to the first sample mean, the first samples included in the first sample set are divided into N types of first samples.
- first samples in the first sample set that are greater than or equal to the first sample mean are classified as first-category first samples; and first samples in the first sample set that are less than or equal to the first sample mean are classified as second-category first samples.
- the first samples in the first sample set whose difference with the first sample mean is between the threshold c and the threshold d are classified as the first class of first samples.
- the first samples in the first sample set whose difference with the first sample mean is less than the threshold c are classified as the second class of first samples.
- the first samples in the first sample set whose difference with the first sample mean is greater than the threshold d are classified as the third class of first samples.
- the above S102-A21 includes the following step S102-A21-b:
- the decoding end divides the first sample set into N types of first samples according to the bit depth of each first sample in the first sample set.
- the first samples in the first sample set are divided into 2 categories, 3 categories, or 4 categories of first samples according to the size of the bit depth, and the bit depths of the first samples in each category of the first samples are similar.
- the decoding end determines a first bit depth mean of the first sample set; and divides the first sample set into N types of first samples based on the first bit depth mean.
- first samples in the first sample set whose bit depth is greater than or equal to the first bit depth average are classified as first-category first samples; and first samples in the first sample set whose bit depth is less than or equal to the first bit depth average are classified as second-category first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is between the threshold e and the threshold f are classified as the first class of first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is less than the threshold e are classified as the second class of first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is greater than the threshold f are classified as the third class of first samples.
- the decoding end divides the first samples in the first sample set into N types of first samples, and also divides the second samples in the second sample set into N types of second samples.
- the embodiment of the present application does not limit the specific manner in which the decoding end divides the second samples included in the second sample set into N types of second samples.
- the decoding end may divide the second samples included in the second sample set into N types of second samples in the same manner as dividing the N types of first samples.
- the decoding end divides the second samples included in the second sample set into N types of second samples through the following steps, that is, the above S102- A22 includes the following steps:
- the decoding end divides the first samples in the first sample set into N categories of first samples. For the j-th first sample in the N categories of first samples, the decoding end determines the second sample corresponding to the j-th first sample in the second sample set as the j-th second sample, where j is a positive integer less than or equal to N.
- the decoding end classifies the first samples in the first sample set that are greater than or equal to the first sample mean as first-category first samples, and correspondingly, classifies the second samples in the second sample set at positions corresponding to the first-category first samples as first-category second samples.
- the decoding end classifies the first samples in the first sample set that are less than the first sample mean as second-category first samples, and correspondingly, classifies the second samples in the second sample set at positions corresponding to the second-category first samples as second-category second samples.
- the N types of first samples obtained by the decoding end by dividing the first sample set correspond one-to-one with the N types of second samples obtained by dividing the second sample set, for example, the first type of first sample corresponds to the first type of second sample, and the second type of first sample corresponds to the second type of second sample. Therefore, the decoding end can determine the jth first sample of the N types of first samples and the jth second sample of the N types of second samples as the jth group of sample sets, so that the N types of first samples and the N types of second samples constitute N groups of sample sets.
- the decoding end divides the first sample set and the second sample set into N groups of sample sets and then performs the above steps S102 - A3 .
- the decoding end determines a set of linear model parameters based on each sample set in the N sample sets, thereby obtaining N sets of linear model parameters.
- the specific process of determining each group of linear model parameters based on each group of N groups of sample sets is consistent.
- the process of determining the i-th group of linear model parameters based on the i-th group of sample sets is taken as an example for explanation.
- the embodiment of the present application does not limit the specific method of determining the i-th group of linear model parameters based on the first sample and the second sample included in the i-th group of sample sets in the above S102-A3.
- a linear relationship between a first sample and a second sample included in the i-th sample set is determined, and then the i-th group of linear model parameters is determined. Since the first sample and the second sample included in the i-th sample set are both known, the scaling factor a and the offset parameter b corresponding to the i-th sample set can be determined by solving a linear equation, and then the i-th group of linear model parameters can be obtained.
- the first samples in the i-th group of sample sets are added to obtain a first sum
- the second samples in the i-th group of sample sets are added to obtain a second sum
- the sum of squares of the first samples in the i-th group of sample sets is determined to obtain a third sum
- the first sample and the second sample in the i-th group of sample sets are multiplied and then added to obtain a fourth sum
- the i-th group of linear model parameters are determined based on the first sum, the second sum, the third sum and the fourth sum.
- the first samples xi in the i-th group of samples are added to obtain a first sum value sumXi
- the second samples yi in the i-th group of samples are added to obtain a second sum value sumYi
- the sum of squares of the first samples xi in the i-th group of samples is determined to obtain a third sum value sumXiXi
- the first sample xi and the second sample yi in the i-th group of samples are multiplied and then added to obtain a fourth sum value sumXiYi
- the i-th group of linear model parameters are determined based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the embodiment of the present application does not limit the specific manner in which the decoding end determines the i-th group of linear model parameters based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the i-th set of linear model parameters includes scaling coefficients ai and offset parameters bi.
- the above is an introduction to the process of determining the i-th group of linear model parameters based on the i-th group of sample sets.
- the decoding end can refer to the above method and determine N groups of linear model parameters based on N groups of sample sets.
- step S103 After the decoding end determines N groups of linear model parameters based on the above steps, it executes the following step S103.
- the decoding end determines the reference block of the current block and determines N sets of linear model parameters. Then, the decoding end selects a target linear model parameter from the N sets of linear model parameters, and uses the target linear model parameter to linearly change the reference block of the current block, thereby improving the illumination compensation effect of the reference block, thereby improving the prediction effect and decoding performance.
- the embodiment of the present application does not limit the specific manner in which the decoding end selects the target group of linear model parameters from N groups of linear model parameters.
- the encoder and the decoder determine N groups of linear model parameters in the same manner, and the encoder may write the index of the selected target group of linear model parameters into the bitstream.
- the decoder determines N groups of linear model parameters based on the above steps, it decodes the bitstream to obtain the index of the target group of linear model parameters, and then determines the target group of linear model parameters from the N groups of linear model parameters determined as shown in Table 4 based on the index.
- the decoding end selects a target set of linear model parameters from N sets of linear model parameters using the following steps:
- the method of this embodiment corresponds to the methods of S102-A21-a1 and S102-A21-a2 described above.
- the decoding end selects the target linear model parameters from these N groups of linear model parameters, it determines the sample mean of the reference block of the current block, that is, the mean of the reconstructed pixel values included in the reference block, and records the mean as the second sample mean.
- the target group of linear model parameters can be selected from the N groups of linear model parameters based on the second sample mean.
- the embodiment of the present application does not limit the specific manner in which the decoding end selects the target group of linear model parameters from N groups of linear model parameters based on the second sample mean. system.
- the decoding end compares the second sample mean with the sample values in the N sample sets corresponding to the N linear model parameters, selects a set of linear model parameters corresponding to a sample set closest to the second sample mean, and determines it as the target set of linear model parameters.
- the second sample mean is closest to the first sample and the second sample included in the k-th sample set in the N sample sets (i.e., the distance is the smallest), and then a set of linear model parameters corresponding to the k-th sample set in the N linear model parameters is determined as the target set of linear model parameters.
- the decoding end selects a target group of linear model parameters from N groups of linear model parameters based on the second sample mean and the first sample mean.
- the decoding end when the decoding end divides the first sample set and the second sample set into N groups of sample sets, the first samples in the first sample set that are greater than or equal to the first sample mean are divided into the first category of first samples; and the first samples in the first sample set that are less than or equal to the first sample mean are divided into the second category of first samples. Then, according to the N groups of sample sets, N groups of linear model parameters are determined. Based on this, the decoding end can select the target group of linear model parameters from the N groups of linear model parameters based on the size of the second sample mean and the first sample mean.
- a group of linear model parameters corresponding to the first sample of the first category among the N groups of linear model parameters is determined as the target group of linear model parameters;
- a group of linear model parameters corresponding to the second class first sample in the N groups of linear model parameters is determined as the target group of linear model parameters.
- the decoding end selects a target set of linear model parameters from N sets of linear model parameters using the following steps:
- the method of this embodiment corresponds to the above-mentioned methods of S102-A21-b1 and S102-A21-b2.
- the decoding end selects the target linear model parameters from these N groups of linear model parameters, it determines the bit depth mean of the reference block of the current block, that is, the bit depth mean of the reconstructed pixel values included in the reference block, and records the mean as the second bit depth mean.
- the target group of linear model parameters can be selected from the N groups of linear model parameters based on the second bit depth mean.
- the embodiment of the present application does not limit the specific manner in which the decoding end selects the target group of linear model parameters from N groups of linear model parameters based on the second bit depth mean.
- the decoding end compares the second bit depth mean with the bit depth of samples in the N groups of sample sets corresponding to the N groups of linear model parameters, selects a group of linear model parameters corresponding to a group of sample sets closest to the second bit depth mean, and determines them as the target group of linear model parameters.
- the second bit depth mean is closest to the bit depth of the first sample and the second sample included in the kth group of sample sets in the N groups of sample sets, and then determines a group of linear model parameters corresponding to the kth group of sample sets in the N groups of linear model parameters as the target group of linear model parameters.
- the decoding end selects a target group of linear model parameters from N groups of linear model parameters based on the second bit depth mean and the first bit depth mean.
- the decoding end when the decoding end divides the first sample set and the second sample set into N groups of sample sets, the first samples in the first sample set whose bit depth is greater than or equal to the first bit depth mean are divided into the first category of first samples; and the first samples in the first sample set whose bit depth is less than or equal to the first bit depth mean are divided into the second category of first samples. Then, according to the N groups of sample sets, N groups of linear model parameters are determined. Based on this, the decoding end can select the target group of linear model parameters from the N groups of linear model parameters based on the size of the second bit depth mean and the first bit depth mean.
- a group of linear model parameters corresponding to the first sample of the first category in the N groups of linear model parameters is determined as the target group of linear model parameters;
- a group of linear model parameters corresponding to the second class first samples in the N groups of linear model parameters is determined as the target group of linear model parameters.
- the decoding end determines the target group of linear model parameters from the N groups of linear model parameters, and then uses the target group of linear model parameters to perform a linear transformation on the reference block of the current block.
- the target linear model parameters include a scaling parameter a1 and an offset parameter b1, and the decoding end linearly changes the reference block based on the scaling parameter and the offset parameter to obtain a prediction block.
- the decoding end performs a linear change on the reference block of the current block based on the above formula (5):
- Pred(x,y) is the reference block of the current block or the prediction block before illumination compensation
- a1 is the scaling parameter included in the target linear model parameters
- b1 is the offset number included in the target linear model parameters
- Pred′(x,y) is the prediction block of the current block or the prediction block after illumination compensation.
- the embodiment of the present application proposes a video decoding method, which is applicable to the intra-frame prediction part of the decoding end.
- the test results under the general test condition AI are shown in Table 5:
- Class F and class TGM are special sequence classes for screen content encoding. From the simulation results, the decoding scheme proposed in the embodiment of the present application has a 0.17% improvement in encoding performance for class F, while the encoding and decoding time does not change.
- the video decoding method provided by the embodiment of the present application proposes a multi-model intra-frame block copy illumination compensation mode to increase the mode of intra-frame block copy illumination compensation, so that the decoding end can choose to use the single-model intra-frame block copy illumination compensation mode (i.e., only one set of model parameters) for prediction compensation, or use the multi-model intra-frame block copy illumination compensation mode (i.e., including multiple sets of model parameters) for prediction compensation according to the specific situation of the current block.
- the single-model intra-frame block copy illumination compensation mode i.e., only one set of model parameters
- the multi-model intra-frame block copy illumination compensation mode i.e., including multiple sets of model parameters
- the multi-model intra-frame block copy illumination compensation mode is selected to predict and compensate the current block
- N sets of linear model parameters are determined, and target linear model parameters are selected from the N sets of linear model parameters, and then the target model parameters are used to linearly change the reference block of the current block to obtain the prediction block of the current block, thereby improving the illumination compensation effect, thereby improving the prediction accuracy and decoding performance.
- FIG15 is a schematic diagram of a video encoding method flow chart provided by an embodiment of the present application, and the embodiment of the present application is applied to the video encoders shown in FIG1 and FIG2. As shown in FIG15, the method of the embodiment of the present application includes:
- S201 Determine a prediction mode for a current block.
- the intra block copy illumination compensation mode with only one set of model parameters is recorded as a single-model intra block copy illumination compensation mode, for example, expressed as an IBC-LIC-S mode, where the IBC-LIC-S mode is the currently existing IBC-LIC mode.
- the intra block copy illumination compensation mode including a set of model parameters is recorded as a multi-model intra block copy illumination compensation mode, for example, expressed as an IBC-LIC-M mode.
- the embodiment of the present application proposes a multi-model intra-frame block copying illumination compensation mode, which can be understood as an intra-frame block copying illumination compensation mode including multiple sets of linear model parameters.
- the reference block (or initial prediction block) of the current block is determined, and then the optimal set of linear model parameters is selected from the multiple sets of linear model parameters, and the reference block of the current block is linearly changed (i.e., illumination compensation) to obtain the prediction block of the current block, thereby improving the illumination compensation effect and prediction accuracy, and thus improving the encoding effect of the image.
- the intra block copy illumination compensation mode with only one set of model parameters is recorded as a single-model intra block copy illumination compensation mode, for example, represented as an IBC-LIC-S mode.
- the embodiment of the present application does not limit the specific method of determining the prediction mode of the current block.
- the encoder sets the prediction mode of the current block to be the multi-model intra-block copy illumination compensation mode by default.
- the above S201 includes the following steps:
- the method before the encoder determines the candidate prediction mode list corresponding to the current block, the method also includes: determining a third flag, the third flag is used to indicate whether the current sequence allows local illumination compensation; if the third flag is used to indicate that the current sequence allows local illumination compensation, then the multi-model intra-frame block copy illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.
- the third flag may be represented as sps_ibc_lic_enable_flag. By setting different values for the third flag sps_ibc_lic_enable_flag, it is indicated whether the current sequence allows the use of the local illumination compensation technology.
- the value of the third flag sps_ibc_lic_enable_flag is 0, it means that the local illumination compensation technology is not allowed to be used in the current sequence.
- the value of the third flag sps_ibc_lic_enable_flag is 1, it means that the current sequence allows the use of the local illumination compensation technology.
- the encoder writes a third flag into the bitstream, where the third flag is used to indicate whether the current sequence allows local illumination compensation.
- the encoder has restrictions on the size of blocks using the intra block copy illumination compensation mode, for example, the intra block copy illumination compensation mode is not used for blocks of some sizes, and the intra block copy illumination compensation mode is used for blocks of some sizes. Based on this, before determining the candidate prediction mode list corresponding to the current block, the encoder determines whether the size of the current block meets the first preset size; if the size of the current block meets the first preset size, the multi-model intra block copy illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.
- the embodiment of the present application does not limit the specific indicator for measuring the size of the current block.
- the width and height of the current block can be used to measure the size of the current block. For example, when the width of the current block is greater than threshold 1 and the height is greater than threshold 2, it is determined that the size of the current block meets the first preset size.
- the values of threshold 1 and threshold 2 can be 4, 8, 16, 32, 128, 256, etc., and threshold 1 can be equal to threshold 2.
- the product of the width and height of the current block can be used to measure the size of the current block.
- the area of the current block is greater than or equal to threshold 3 and less than threshold 5, it is determined that the size of the current block meets the first preset size.
- the value of threshold 3 can be 16, 32, etc.
- threshold 5 can be 256, 1024, etc.
- the size of the current block can be measured by the number of pixels included in the current block. For example, when the number of pixels included in the current block is greater than or equal to a threshold value of 4, it is determined that the size of the current block meets the first preset size.
- the value of the threshold value 4 can be 16, 32, 128, 256, 1024, etc.
- the encoding end before determining the list of candidate prediction modes corresponding to the current block, determines whether the current block is encoded using a first tool, and the first tool is mutually exclusive with the intra-block copy illumination compensation technology; if it is determined that the current block is not encoded using the first tool, the multi-model intra-block copy illumination compensation mode is added to the list of candidate prediction modes corresponding to the current block.
- the encoding end traverses the prediction mode, and if the current prediction mode type is the intra block copy mode, the flag bit that allows the use of the present technology is obtained, and the third flag is set.
- the flag bit is a sequence-level flag bit, indicating whether the current sequence allows the use of the intra block copy local illumination compensation technology, which can be in the form of sps_ibc_lic_enable_flag.
- Step 1 If the use permission flag (i.e., the third flag) of IBC-LIC is true, and the size of the current block meets the first preset size, for example, the area of the current block is greater than threshold 1, and the area of the current block is less than threshold 2, the encoder tries the prediction method of IBC-LIC, that is, executes the following step 2. If the use permission flag (i.e., the third flag) of IBC-LIC or the size of the current block does not meet the first preset size, the encoder does not try the prediction method of IBC-LIC, that is, skips the following step 2 and directly executes step 3.
- the use permission flag i.e., the third flag
- Step 2 Obtain the reconstructed sample information of the upper and left template regions of the current block and the reconstructed sample information of the upper and left template regions of the reference block.
- the encoder traverses various prediction modes under the IBC AMVP mode and calculates the corresponding rate-distortion cost.
- the encoder tries the IBC-LIC-S mode.
- the number of samples obtained is the same as described above, depending on the width and height of the current block.
- the obtained reconstructed samples are modeled using the linear model calculation method described above, and the scaling factor a and offset parameter b are calculated.
- the prediction block is linearly transformed with the transformation parameters being scaling a times and compensation b to obtain the final prediction block of the current block.
- the residual of the current block is obtained by subtracting the original sample corresponding to the prediction block from the current block, and the rate-distortion cost is calculated through operations such as transform and quantization, recorded as cost1;
- the encoder tries the IBC-LIC-M mode.
- the number of samples obtained is the same as described above, depending on the width and height of the current block.
- the samples of the two template areas are classified according to the sample mean of the template area adjacent to the reference block, where the samples whose sample values of the template area adjacent to the reference block are greater than the sample mean are classified as the first category.
- the samples of the template area adjacent to the prediction block at the corresponding position are also classified as the first category; conversely, if the sample values of the template area adjacent to the reference block are less than or equal to the sample mean, they are classified as the second category.
- the samples of the template area adjacent to the prediction block at the corresponding position are also classified as the second category.
- the linear model parameters of the first category are calculated for the first category samples and the second category samples respectively using the above model calculation method to obtain the first model parameter scaling factor a1 and offset parameter b1; the second model parameter scaling factor a2 and offset parameter b2.
- the rate-distortion cost is calculated with the original image block, recorded as cost2;
- Compare cost1 and cost2 record the minimum cost value as costAmvpIbcLic, and save the information of the current illumination compensation mode including the illumination compensation mode index.
- the mode index corresponding to cost1 is 0, and the mode index corresponding to cost2 is 1.
- the encoder constructs the list information under the IBC merge mode, traverses each candidate mode and calculates the corresponding rate-distortion cost.
- the current block traverses the candidate BVs in the merge list. If IBC-LIC is turned on in the inherited information, the current block obtains the reference block according to the BV information. At the same time, the adjacent template area samples of the current block and the reference block are obtained according to the inherited IBC-LIC mode, and the linear model parameters are calculated. The reference block is transformed according to the linear model parameters, and the steps are the same as above to obtain the final prediction block. The residual of the current block is obtained by subtracting the original sample corresponding to the prediction block and the current block.
- the rate-distortion cost value is calculated through operations such as transformation and quantization, recorded as costIdx1; traverse other candidate BVs in the merge list, and the rate-distortion cost values, costIdx2, costIdx3, costIdx4, etc., are calculated by the same method.
- Step 3 The encoder continues to traverse other inter-frame prediction technologies, calculates the rate-distortion cost value corresponding to each technology, and selects the prediction mode corresponding to the minimum cost value as the optimal prediction mode for the current block.
- the current block uses intra-block copy illumination compensation technology, and the coding unit level usage identification position of the illumination compensation technology needs to be written into the bitstream.
- the intra-block copy illumination compensation mode index also needs to be written into the bitstream.
- the current block uses the intra-frame block copy technology in merge mode to write the merge identification position of IBC into the bitstream, and also write the merge index into the bitstream.
- the current block if the current block allows the use of illumination compensation technology and costLic is not the minimum, the current block does not use illumination compensation technology, and the coding unit level use identification position of the illumination compensation technology needs to be written into the bitstream; otherwise, other optimal prediction mode information is written into the bitstream, which is not strongly related to this technology and is not described in detail here;
- the encoding end determines the prediction type of the current block and writes first information into the bitstream, where the first information is used to indicate the prediction type of the current block.
- the embodiment of the present application does not limit the specific form of the first information.
- the first information may be represented as modeType.
- modeType MODE_INTRA, it means that the prediction type of the current block is intra prediction.
- modeType MODE_INTER, it means that the prediction type of the current block is inter-frame prediction.
- modeType MODE_IBC, it means that the prediction type of the current block is intra block copy prediction.
- a first flag is written into the bitstream, and the first flag is used to indicate whether the current block uses the merge mode.
- the embodiment of the present application does not limit the specific form of the first mark.
- the first flag may be represented as merge_flag. By setting different values for the first flag merge_flag, it is indicated whether the current block uses the merge mode for prediction.
- the value of the first flag merge_flag is 0, it means that the current block does not use the merge mode for prediction.
- the value of the first flag merge_flag is 1, it means that the current block is predicted using the merge mode.
- second information is written into the bitstream, where the second information is used to indicate whether the current block uses the intra block copy illumination compensation mode.
- the second information may be represented as cu_ibc_lic_flag. By setting different values for the second information cu_ibc_lic_flag, it is indicated whether the current block uses the intra block copy illumination compensation mode.
- the value of the second information cu_ibc_lic_flag is 0, it means that the current block is not predicted using the intra block copy illumination compensation mode.
- the value of the second information cu_ibc_lic_flag is 1, it indicates that the current block is predicted using the intra block copying illumination compensation mode.
- index information is written into the bitstream, where the index information is used to indicate a mode index of the intra block copy illumination compensation mode used by the current block.
- index information is written into the bitstream, where the index information is used to indicate a mode index of the intra block copy illumination compensation mode used by the current block.
- the index information may be represented as cu_ibc_lic_index.
- the mode index of the intra block copy illumination compensation mode used by the current block is represented.
- the value of the index information cu_ibc_lic_index is the first value.
- the value of the index flag cu_ibc_lic_index is the second value.
- the embodiment of the present application does not limit the specific values of the first numerical value and the second numerical value.
- the first value is 0.
- the second value is 1.
- the cu_ibc_lic_index may be encoded based on context, or encoded using an equal probability method.
- Mode 5 If the second information indicates that the current block uses the intra block copying illumination compensation mode, and the size of the current block is greater than or equal to the second preset size, the multi-model intra block copying illumination compensation mode is determined as the prediction mode of the current block.
- the multi-model intra-frame block copy illumination compensation mode is used by default, that is, when parsing the syntax elements on the encoding end, if cu_ibc_lic_flag is true and the size of the current block is larger than the second preset size, it means that the current block uses the multi-model intra-frame block copy illumination compensation mode, otherwise it means that the current block does not use illumination compensation technology and there is no need to parse the index.
- the embodiment of the present application does not limit the specific indicator for measuring the size of the current block.
- the width and height of the current block can be used to measure the size of the current block. For example, when the width of the current block is greater than threshold 1 and the height is greater than threshold 2, it is determined that the size of the current block is greater than the second preset size.
- the values of threshold 1 and threshold 2 can be 4, 8, 16, 32, 128, 256, etc., and threshold 1 can be equal to threshold 2.
- the product of the width and height of the current block can be used to measure the size of the current block.
- the area of the current block is greater than or equal to threshold 3, it is determined that the size of the current block is greater than the second preset size.
- the value of threshold 3 can be 16, 32, 128, 256, etc.
- the size of the current block can be measured by the number of pixels included in the current block. For example, when the number of pixels included in the current block is greater than or equal to a threshold value of 4, it is determined that the size of the current block is greater than a second preset size.
- the value of the threshold value 4 can be 16, 32, 128, 256, 1024, etc.
- the multi-model intra block copy illumination compensation mode is determined as the prediction mode of the current block.
- the second information in the above embodiment only indicates whether the current block uses the intra block copy illumination compensation mode, and does not indicate the mode index of the intra block copy illumination compensation mode. Instead, the mode index of the intra block copy illumination compensation mode is indicated by index information.
- the second information in addition to indicating whether the current block uses the intra block copy illumination compensation mode, may also indicate a mode index of the intra block copy illumination compensation mode.
- cu_ibc_lic_mode may be used to represent the second information.
- syntax elements may also be used to represent the second information, which is not limited in this embodiment of the present application.
- the prediction mode of the current block is a non-intra block copy illumination compensation mode, determining that the value of the second information cu_ibc_lic_mode is a first value;
- the prediction mode of the current block is the single model intra block copy illumination compensation mode
- the value of the second information cu_ibc_lic_mode is determined to be a second value
- the value of the second information cu_ibc_lic_mode is determined to be a third value.
- the embodiment of the present application does not limit the specific values of the first value, the second value and the third value.
- the first value is 0, the second value is 1, and the third value is 2.
- the encoder can determine the prediction mode of the current block in at least the following ways.
- Method 1 If the current block uses the merge mode, the prediction mode of the reference block is determined as the prediction mode of the current block.
- Method 2 If the current block uses the merge mode, the illumination compensation mode is copied to the block within the single model frame and determined as the prediction mode of the current block.
- Method 3 If the current block uses the merge mode, the illumination compensation mode is copied to the block within the multi-model frame and determined as the prediction mode of the current block.
- Mode 4 If the current block uses the merge mode, the prediction mode is not obtained by inheritance, but the rate-distortion cost of each candidate prediction mode when predicting the current block is calculated, and the candidate prediction mode with the smallest cost is determined as the prediction mode of the current block.
- fourth information is written in the bitstream, and the prediction mode of the current block is indicated by the fourth information.
- the encoder determines the prediction mode of the current block based on the above steps, it executes the following step S202.
- N is a positive integer greater than 1.
- the encoder determines the prediction mode of the current block. If the prediction mode of the current block is the multi-model intra-block replication illumination compensation mode, the encoder needs to determine N sets of linear model parameters and the reference block of the current block. Then, a set of linear model parameters is selected from the N sets of linear model parameters as the target linear model parameters, and the reference block of the current block is linearly changed to obtain a prediction block with a good illumination compensation effect, thereby improving the prediction accuracy and encoding performance.
- the reference block of the current block is also referred to as the prediction block of the current block, or the initial prediction block of the current block, or the first prediction block of the current block, etc. That is, in the embodiments of the present application, the reference block of the current block can be understood as a prediction block that has not been subjected to illumination compensation.
- the encoder determines a reference block of a current block in a current image (ie, a current frame).
- the solid line with an arrow is the block vector information BV of the current block.
- the current block finds a matching reconstructed block through BV as a reference block of the current block.
- IBC has two modes, one is AMVP (advanced motion vector prediction) mode; the other is skip/merge mode, that is, merge mode.
- AMVP advanced motion vector prediction
- the encoder constructs an MVP candidate list and determines an optimal MVP therefrom, and then determines a starting point for motion estimation based on the selected MVP, and then searches near the starting point to obtain a reference block for the current block.
- the encoder constructs an MVP candidate list, determines an optimal MVP from it, uses the selected MVP as the MV of the current point, and then determines the reference block of the current block in the current image based on the MV.
- the encoding end may also use other existing methods to determine the reference block of the current block.
- the encoding end determines that the prediction mode of the current block is a multi-model intra-block replication illumination compensation mode, it is necessary to determine multiple sets of linear model parameters, and then select one set from these multiple sets of linear model parameters to perform linear changes on the reference block of the current block to obtain the prediction value of the current block.
- the embodiment of the present application does not limit the specific parameters included in each set of linear model parameters.
- the parameters may be any parameters related to linear changes.
- each of the N groups of linear model parameters includes a scaling parameter a and an offset parameter b. It should be noted that the parameters included in each of the N groups of linear model parameters are not completely the same.
- N groups of linear model parameters of the embodiment of the present application are shown in Table 4.
- the encoder After the encoder determines the N groups of linear model parameters shown in Table 4, it can select a group of linear model parameters from the N groups of linear model parameters shown in Table 4 to linearly change the reference block of the current block to achieve illumination compensation, thereby obtaining the illumination compensated reference block, and then determining the illumination compensated reference block as the prediction block of the current block.
- the embodiment of the present application does not limit the specific method for the encoding end to determine N groups of linear model parameters.
- the above-mentioned N groups of linear model parameters are preset values or empirical values.
- the encoder determines N groups of linear model parameters through the following step S202-A:
- S202-A Determine N groups of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block.
- the encoding end determines the reconstructed area around the reference block and the reconstructed area around the current block, and then determines N groups of linear model parameters based on the reconstructed area around the reference block and the reconstructed area around the current block.
- the reconstructed area around the reference block includes a reconstructed area adjacent to the reference block and/or a reconstructed area not adjacent to the reference block.
- the reconstructed area around the current block includes a reconstructed area adjacent to the current block and/or a reconstructed area not adjacent to the current block.
- the encoder can determine N different sets of linear model parameters based on the feature information of the reconstructed area around the reference block and the feature information of the reconstructed area around the current block. These N different sets of linear model parameters can achieve different effects of illumination compensation, and then the encoder can select a set of linear model parameters with a target illumination compensation effect from the N sets of linear model parameters with different illumination compensation effects according to actual conditions, and perform illumination compensation on the reference block of the current block to improve the illumination compensation effect and prediction effect, thereby improving the encoding performance.
- the embodiment of the present application does not limit the specific manner in which the encoder determines N groups of linear model parameters based on the surrounding reconstructed area of the reference block and the surrounding reconstructed area of the current block.
- the encoder divides the reconstructed area around the reference block into N sub-areas, for example, based on the color information, brightness information, bit depth and other characteristic information of the reconstructed area around the reference block, the encoder divides the reconstructed area around the reference block into N first sub-areas.
- the reconstructed area around the current block is divided into N first sub-regions, and one first sub-region corresponds to one second sub-region. In this way, a set of linear model parameters can be determined according to each of the N first sub-regions and the second sub-region corresponding to the first sub-region.
- a set of linear model parameters 1 is determined according to the first sub-region 1 and the second sub-region 1
- a set of linear model parameters 2 is determined according to the first sub-region 2 and the second sub-region 2, and so on, and N sets of linear model parameters can be determined.
- the process of determining a set of linear model parameters 1 according to the first sub-region 1 and the second sub-region 1 can be performed with reference to the method shown in the above formula (3).
- the above S202-A includes the following steps S202-A1 to S202-A3:
- S202-A3 For the i-th sample set among the N sample sets, determine the i-th group of linear model parameters based on the first sample and the second sample included in the i-th sample set, where i is a positive integer less than or equal to N.
- the samples (i.e., reconstructed pixels) included in the reconstructed area around the reference block are recorded as first samples, and the samples (i.e., reconstructed pixels) included in the reconstructed area around the current block are recorded as second samples.
- the encoding end determines the surrounding reconstructed area of the reference block and the surrounding reconstructed area of the current block, it determines a first sample set from the surrounding reconstructed area of the reference block and determines a second sample set from the surrounding reconstructed area of the current block, wherein the first sample set includes at least one first sample and the second sample set includes at least one second sample set.
- the embodiment of the present application does not limit the specific manner in which the encoder determines the first sample set from the surrounding reconstructed area of the reference block and determines the second sample set from the surrounding reconstructed area of the current block.
- the encoding end collects at least one first sample from the reconstructed area around the reference block according to a preset collection step size to form a first sample set, and collects at least one second sample from the reconstructed area around the current block according to a preset collection step size to form a second sample set.
- the encoder determines all first samples included in the reconstructed area around the reference block as the first sample set, and determines all second samples included in the reconstructed area around the current block as the second sample set.
- the reconstructed area around the reference block includes the template area of the reference block
- the reconstructed area around the current block includes the template area of the current block.
- the above S202-A1 includes the following step S202-A1:
- the encoder may directly determine the first sample set from the template area of the reference block, and determine the second sample set from the template area of the current block.
- determining the first sample set from the template area of the reference block and determining the second sample set from the template area of the current block include but are not limited to the following:
- Method 1 According to the width and height of the current block, the number of the first sample and the second sample to be selected is set.
- a preset value of 1 for example, 4
- a preset value of 1 for example, 4
- second samples are taken from the upper template and the left module of the current block to form a second sample set
- the second sample set includes 8 second samples.
- a preset value of 1 for example, 4
- first samples are taken from the upper template and the left module of the reference block to form a first sample set
- the first sample set includes 8 first samples.
- the current block width is a preset value of 2 (e.g., 16) and the height is a preset value of 3 (e.g., 4)
- 4 second samples are taken from the left template of the current block
- 5 (e.g., 4) second samples are taken from the upper template of the current block with a step size of a preset value of 4 (e.g., 3) to form a second sample set, which includes 8 second samples.
- 4 first samples are taken from the left template of the reference block, and 5 (e.g., 4) first samples are taken from the upper template of the reference block with a step size of a preset value of 4 (e.g., 3) to form a first sample set, which includes 8 first samples.
- the second samples with the logarithm of 2 of the smaller side length are obtained from the reconstructed samples included in the upper template and the left template of the current block to form a second sample set.
- the first samples with the logarithm of 2 of the smaller side length are obtained from the reconstructed samples included in the upper template and the left template of the reference block to form a first sample set.
- the upper template includes a row of sample rows
- the left template includes a column of sample columns.
- Method 2 The encoding end samples in the template area of the reference block according to the first sampling step to obtain a first sample set; and samples in the template area of the current block according to the first sampling step to obtain a second sample set, wherein the first sampling step is smaller than the preset sampling step.
- the encoding end can increase the number of samples involved in the calculation of the linear model parameters by reducing the sampling step size, so as to improve the calculation accuracy of the linear model parameters.
- the encoding end performs sampling in the template area of the reference block according to a first sampling step to obtain a first sample set; and performs sampling in the template area of the current block according to the first sampling step to obtain a second sample set, and the first sampling step is smaller than the preset sampling step.
- the first sampling step size is less than 3.
- the encoder determines all samples included in the template area of the reference block as the first sample set; and determines all samples included in the template area of the current block as the second sample set.
- all samples included in the template area of the reference block can be determined as the first sample set, and all samples included in the template area of the current block can be determined as the second sample set, so as to increase the number of samples participating in the calculation of the linear model parameters and improve the calculation accuracy of the linear model parameters.
- the embodiment of the present application does not limit the specific sizes of the template area of the reference block and the template area of the current block.
- the template area of the reference block includes the upper template area of the reference block and/or the left template area of the reference block
- the template area of the current block includes the upper template area of the current block and/or the left template area of the current block.
- the template area may be enlarged.
- the upper template is expanded, such as shown in FIG13
- the left template area of the reference block includes the left template area and the lower left template area of the reference block
- the left template area of the current block includes the left template area and the lower left template area of the current block.
- the left template is expanded, such as shown in FIG14 , the number of sample rows included in the upper template area of the reference block is greater than or equal to the preset number of rows, and the number of sample rows included in the upper template area of the current block is greater than or equal to the preset number of rows.
- the embodiment of the present application can determine a first sample set from the upper template and/or left template of the reference block shown in Figures 13 and 14, and determine a second sample set from the upper template and/or left template of the current block shown in Figures 13 and 14, so as to increase the number of samples in the first sample set and the second sample set.
- the encoding end may further increase the number of rows of the upper template to implement template expansion.
- the number of sample rows included in the upper template region of the reference block is greater than or equal to a preset number of rows
- the number of sample rows included in the upper template region of the current block is greater than or equal to a preset number of rows.
- the preset number of rows may be 2, 3, 4, 5, etc.
- the encoding end may further increase the number of columns of the left template to implement template expansion.
- the number of sample columns included in the left template area of the reference block is greater than or equal to the preset number of columns, and the number of sample columns included in the left template area of the current block is greater than or equal to the preset number of columns.
- the preset number of columns may be 2, 3, 4, 5, etc.
- step S202-A2 After the encoder determines the first sample set from the surrounding reconstructed area of the reference block and determines the second sample set from the surrounding reconstructed area of the current block through the above steps, the above step S202-A2 is performed.
- the embodiment of the present application does not limit the specific manner in which the encoding end divides the first sample set and the second sample set into N groups of sample sets.
- the encoder divides the first sample set and the second sample set into N groups of sample sets according to feature information such as color information, brightness information, and bit depth of each of the first sample and the second sample set, and each of the N groups of sample sets includes at least one first sample and at least one second sample.
- feature information such as color information, brightness information, and bit depth of each of the first sample and the second sample set
- each of the N groups of sample sets includes at least one first sample and at least one second sample.
- the first sample and the second sample in the first sample set and the second sample set that have similar feature information such as color information and brightness information are divided into one group of sample sets.
- the above S202-A2 includes the following steps:
- the encoding end first divides the first samples included in the first sample set into N types of first samples, and at the same time, divides the second samples included in the second sample set into N types of second samples.
- Each of the N types of first samples includes at least one first sample
- each of the N types of second samples includes at least one second sample.
- the embodiment of the present application does not limit the specific manner in which the encoding end divides the first samples included in the first sample set into N types of first samples.
- the encoding end classifies the first samples according to feature information of each first sample in the first sample set to obtain N types of first samples.
- the above S202-A21 includes the following steps S202-A21-a1 and S202-A21-a2:
- S202-A21-a2 Based on the first sample means, divide the first sample set into N types of first samples.
- the encoding end classifies the first samples included in the first sample set according to the sample means.
- the encoding end first determines the sample mean of the first sample set according to the reconstructed values of each first sample in the first sample set, and for ease of description, the sample mean is recorded as the first sample mean. Then, according to the first sample mean, the first samples included in the first sample set are divided into N types of first samples.
- first samples in the first sample set that are greater than or equal to the first sample mean are classified as first-category first samples; and first samples in the first sample set that are less than or equal to the first sample mean are classified as second-category first samples.
- the first samples in the first sample set whose difference with the first sample mean is between the threshold c and the threshold d are classified as the first class of first samples.
- the first samples in the first sample set whose difference with the first sample mean is less than the threshold c are classified as the second class of first samples.
- the first samples in the first sample set whose difference with the first sample mean is greater than the threshold d are classified as the third class of first samples.
- the above S202-A21 includes the following step S202-A21-b:
- the encoding end divides the first sample set into N types of first samples according to the bit depth of each first sample in the first sample set.
- the first samples in the first sample set are divided into 2 categories, 3 categories, or 4 categories of first samples according to the size of the bit depth, and the bit depths of the first samples in each category of the first samples are similar.
- the encoding end determines a first bit depth mean of the first sample set; and divides the first sample set into N types of first samples based on the first bit depth mean.
- first samples in the first sample set whose bit depth is greater than or equal to the first bit depth average are classified as first-category first samples; and first samples in the first sample set whose bit depth is less than or equal to the first bit depth average are classified as second-category first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is between the threshold e and the threshold f are classified as the first class of first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is less than the threshold e are classified as the second class of first samples.
- the first samples in the first sample set whose difference between the bit depth and the first bit depth mean is greater than the threshold f are classified as the third class of first samples.
- the encoder divides the first samples in the first sample set into N types of first samples and also divides the second samples in the second sample set into N types of second samples.
- the embodiment of the present application does not limit the specific manner in which the encoding end divides the second samples included in the second sample set into N types of second samples.
- the encoding end may divide the second samples included in the second sample set into N categories of second samples in the same manner as dividing the N categories of first samples.
- the encoder divides the second samples included in the second sample set into N types of second samples through the following steps, that is, the above S202-A22 includes the following steps:
- the encoding end divides the first samples in the first sample set into N categories of first samples. For the j-th first sample in the N categories of first samples, the encoding end determines the second sample corresponding to the j-th first sample in the second sample set as the j-th second sample, where j is a positive integer less than or equal to N.
- the encoding end classifies the first samples in the first sample set that are greater than or equal to the first sample mean as first-category first samples, and correspondingly, classifies the second samples in the second sample set at positions corresponding to the first-category first samples as first-category second samples.
- the encoding end classifies the first samples in the first sample set that are less than the first sample mean as second-category first samples, and correspondingly, classifies the second samples in the second sample set at positions corresponding to the second-category first samples as second-category second samples.
- the N types of first samples obtained by the encoding end by dividing the first sample set correspond one-to-one with the N types of second samples obtained by dividing the second sample set, for example, the first type of first sample corresponds to the first type of second sample, and the second type of first sample corresponds to the second type of second sample. Therefore, the encoding end can determine the jth first sample of the N types of first samples and the jth second sample of the N types of second samples as the jth group of sample sets, so that the N types of first samples and the N types of second samples constitute N groups of sample sets.
- the encoder divides the first sample set and the second sample set into N groups of sample sets and then performs the above step S202-A3.
- the encoding end determines a set of linear model parameters based on each sample set in the N sample sets, thereby obtaining N sets of linear model parameters.
- the specific process of determining each group of linear model parameters based on each group of N groups of sample sets is consistent.
- the process of determining the i-th group of linear model parameters based on the i-th group of sample sets is taken as an example for explanation.
- the embodiment of the present application does not limit the specific method of determining the i-th group of linear model parameters based on the first sample and the second sample included in the i-th group of sample sets in the above S202-A3.
- a linear relationship between a first sample and a second sample included in the i-th sample set is determined, and then the i-th group of linear model parameters is determined. Since the first sample and the second sample included in the i-th sample set are both known, the scaling factor a and the offset parameter b corresponding to the i-th sample set can be determined by solving a linear equation, and then the i-th group of linear model parameters can be obtained.
- the first samples in the i-th group of sample sets are added to obtain a first sum
- the second samples in the i-th group of sample sets are added to obtain a second sum
- the sum of squares of the first samples in the i-th group of sample sets is determined to obtain a third sum
- the first sample and the second sample in the i-th group of sample sets are multiplied and then added to obtain a fourth sum
- the i-th group of linear model parameters are determined based on the first sum, the second sum, the third sum and the fourth sum.
- the first samples xi in the i-th group of samples are added to obtain a first sum value sumXi
- the second samples yi in the i-th group of samples are added to obtain a second sum value sumYi
- the sum of squares of the first samples xi in the i-th group of samples is determined to obtain a third sum value sumXiXi
- the first sample xi and the second sample yi in the i-th group of samples are multiplied and then added to obtain a fourth sum value sumXiYi
- the i-th group of linear model parameters are determined based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the embodiment of the present application does not limit the specific manner in which the encoding end determines the i-th group of linear model parameters based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the i-th set of linear model parameters includes scaling coefficients ai and offset parameters bi.
- the encoding end determines the i-th group of linear model parameters through the following formula (4).
- the above is an introduction to the process of determining the i-th group of linear model parameters based on the i-th group of sample sets.
- the encoder can refer to the above method and determine N groups of linear model parameters based on N groups of sample sets.
- the encoding end may write the determined N groups of linear model parameters into the bitstream, so that the decoding end may obtain the N groups of linear model parameters by decoding the bitstream.
- the encoder determines N groups of linear model parameters based on the above steps, it executes the following step S203.
- the encoder determines the reference block of the current block and determines N sets of linear model parameters. Then, the encoder selects a target linear model parameter from the N sets of linear model parameters, and uses the target linear model parameter to linearly change the reference block of the current block, thereby improving the illumination compensation effect of the reference block, thereby improving the prediction effect and encoding performance.
- the embodiment of the present application does not limit the specific manner in which the encoder selects the target group of linear model parameters from N groups of linear model parameters.
- the encoder uses the following steps to select a target set of linear model parameters from N sets of linear model parameters:
- the method of this embodiment corresponds to the above-mentioned methods of S202-A21-a1 and S202-A21-a2.
- the encoding end selects the target linear model parameters from these N groups of linear model parameters, it determines the sample mean of the reference block of the current block, that is, the mean of the reconstructed pixel values included in the reference block, and records the mean as the second sample mean.
- the target group of linear model parameters can be selected from the N groups of linear model parameters based on the second sample mean.
- the embodiment of the present application does not limit the specific manner in which the encoding end selects the target group of linear model parameters from N groups of linear model parameters based on the second sample mean.
- the encoder compares the second sample mean with the sample values in the N sample sets corresponding to the N linear model parameters, selects a set of linear model parameters corresponding to a sample set closest to the second sample mean, and determines them as the target set of linear model parameters.
- the second sample mean is closest to the first sample and the second sample included in the k-th sample set in the N sample sets (i.e., the distance is the smallest), and then a set of linear model parameters corresponding to the k-th sample set in the N linear model parameters is determined as the target set of linear model parameters.
- the encoding end selects a target group of linear model parameters from N groups of linear model parameters based on the second sample mean and the first sample mean.
- the encoding end divides the first sample set and the second sample set into N groups of samples.
- the first samples in the first sample set that are greater than or equal to the first sample mean are classified as first-category first samples; the first samples in the first sample set that are less than or equal to the first sample mean are classified as second-category first samples.
- N groups of linear model parameters are determined. Based on this, the encoder can select the target group of linear model parameters from the N groups of linear model parameters based on the size of the second sample mean and the first sample mean.
- a group of linear model parameters corresponding to the first sample of the first category among the N groups of linear model parameters is determined as the target group of linear model parameters;
- a group of linear model parameters corresponding to the second class first sample in the N groups of linear model parameters is determined as the target group of linear model parameters.
- the encoder uses the following steps to select a target set of linear model parameters from N sets of linear model parameters:
- the method of this embodiment corresponds to the above-mentioned methods of S202-A21-b1 and S202-A21-b2.
- the encoding end selects the target linear model parameters from these N groups of linear model parameters, it determines the bit depth mean of the reference block of the current block, that is, the bit depth mean of the reconstructed pixel values included in the reference block, and records the mean as the second bit depth mean.
- the target group of linear model parameters can be selected from the N groups of linear model parameters based on the second bit depth mean.
- the embodiment of the present application does not limit the specific manner in which the encoder selects the target group of linear model parameters from N groups of linear model parameters based on the second bit depth mean.
- the encoder compares the second bit depth mean with the bit depths of samples in the N sample sets corresponding to the N linear model parameters, selects a set of linear model parameters corresponding to a sample set closest to the second bit depth mean, and determines them as the target set of linear model parameters.
- the second bit depth mean is closest to the bit depths of the first sample and the second sample included in the k-th sample set in the N sample sets, and then determines a set of linear model parameters corresponding to the k-th sample set in the N linear model parameters as the target set of linear model parameters.
- the encoding end selects a target group of linear model parameters from N groups of linear model parameters based on the second bit depth mean and the first bit depth mean.
- a group of linear model parameters corresponding to the first sample of the first category in the N groups of linear model parameters is determined as the target group of linear model parameters;
- a group of linear model parameters corresponding to the second class first samples in the N groups of linear model parameters is determined as the target group of linear model parameters.
- the encoder determines the target group of linear model parameters from the N groups of linear model parameters, and then uses the target group of linear model parameters to perform a linear transformation on the reference block of the current block.
- the target linear model parameters include a scaling parameter a1 and an offset parameter b1, and the encoder performs a linear change on the reference block based on the scaling parameter and the offset parameter to obtain a prediction block.
- the encoder performs a linear change on the reference block of the current block based on the above formula (5).
- the video encoding method provided by the embodiment of the present application proposes a multi-model intra-frame block copy illumination compensation mode to increase the mode of intra-frame block copy illumination compensation, so that the encoding end can choose to use a single-model intra-frame block copy illumination compensation mode (i.e., only one set of model parameters) for prediction compensation, or use a multi-model intra-frame block copy illumination compensation mode (i.e., including multiple sets of model parameters) for prediction compensation according to the specific situation of the current block.
- a single-model intra-frame block copy illumination compensation mode i.e., only one set of model parameters
- a multi-model intra-frame block copy illumination compensation mode i.e., including multiple sets of model parameters
- the multi-model intra-frame block copy illumination compensation mode is selected to predict and compensate the current block
- N sets of linear model parameters are determined, and target linear model parameters are selected from the N sets of linear model parameters, and then the target model parameters are used to linearly change the reference block of the current block to obtain a prediction block of the current block, thereby improving the illumination compensation effect, thereby improving the prediction accuracy and encoding performance.
- the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
- the term "and/or” is merely a description of the association relationship of associated objects, indicating that three relationships may exist. Specifically, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
- the character "/" in the present application generally indicates that the associated objects before and after are in an "or" relationship.
- FIG. 16 is a schematic block diagram of a video encoding device provided in an embodiment of the present application.
- the video encoding device 10 is applied to the above-mentioned video encoder.
- the video encoding device 10 includes:
- a mode determination unit 11 configured to determine a prediction mode of a current block
- a parameter determination unit 12 configured to determine a reference block of the current block and determine N groups of linear model parameters if the prediction mode of the current block is a multi-model intra block copy illumination compensation mode, where N is a positive integer greater than 1;
- the changing unit 13 is used to select a target group of linear model parameters from the N groups of linear model parameters, and use the target group of linear model parameters to perform linear changes on the reference block to obtain a prediction block of the current block.
- the parameter determination unit 12 is specifically configured to determine N groups of linear model parameters based on a surrounding reconstructed area of the reference block and a surrounding reconstructed area of the current block.
- the parameter determination unit 12 is specifically used to determine a first sample set from a surrounding reconstructed area of the reference block, and to determine a second sample set from a surrounding reconstructed area of the current block; divide the first sample set and the second sample set into N groups of sample sets, any group of sample sets in the N groups of sample sets includes at least one first sample and at least one second sample; for the i-th group of sample sets in the N groups of sample sets, based on the first samples and the second samples included in the i-th group of sample sets, determine the i-th group of linear model parameters, where i is a positive integer less than or equal to N.
- the reconstructed area around the reference block includes a template area of the reference block
- the reconstructed area around the current block includes a template area of the current block
- the parameter determination unit 12 is specifically configured to determine the first sample set from the template area of the reference block, and determine the second sample set from the template area of the current block.
- the parameter determination unit 12 is specifically used to perform sampling in the template area of the reference block according to a first sampling step to obtain the first sample set, and the first sampling step is smaller than a preset sampling step; and perform sampling in the template area of the current block according to the first sampling step to obtain the second sample set.
- the parameter determination unit 12 is specifically configured to determine all samples included in the template area of the reference block as the first sample set; and determine all samples included in the template area of the current block as the second sample set.
- the template area of the reference block includes the upper template area of the reference block and/or the left template area of the reference block
- the template area of the current block includes the upper template area of the current block and/or the left template area of the current block.
- the upper template area of the reference block includes an upper template area and an upper right template area of the reference block
- the upper template area of the current block includes an upper template area and an upper right template area of the current block
- the left template area of the reference block includes a left template area and a lower left template area of the reference block
- the left template area of the current block includes a left template area and a lower left template area of the current block
- the number of sample rows included in the upper template region of the reference block is greater than or equal to a preset number of rows, and the number of sample rows included in the upper template region of the current block is greater than or equal to the preset number of rows.
- the number of sample columns included in the left template area of the reference block is greater than or equal to a preset number of columns, and the number of sample columns included in the left template area of the current block is greater than or equal to the preset number of columns.
- the parameter determination unit 12 is specifically used to divide the first samples included in the first sample set into N categories of first samples; divide the second samples included in the second sample set into N categories of second samples; and obtain the N groups of sample sets based on the N categories of first samples and the N categories of second samples.
- the parameter determination unit 12 is specifically configured to determine a first sample mean of the first sample set; and divide the first sample set into the N types of first samples based on the first sample mean.
- the parameter determination unit 12 is specifically used to classify the first samples in the first sample set that are greater than or equal to the first sample mean as first-category first samples; and classify the first samples in the first sample set that are less than or equal to the first sample mean as second-category first samples.
- the parameter determination unit 12 is specifically configured to divide the first sample set into the N types of first samples based on the bit depth of the first samples in the first sample set.
- the parameter determination unit 12 is specifically configured to determine a first bit depth mean of the first sample set; and divide the first sample set into the N types of first samples based on the first bit depth mean.
- the parameter determination unit 12 is specifically used to classify the first samples in the first sample set whose bit depth is greater than or equal to the first bit depth mean as the first category of first samples; and classify the first samples in the first sample set whose bit depth is less than or equal to the first bit depth mean as the second category of first samples.
- the parameter determination unit 12 is specifically used to determine, for the j-th first sample in the N-type first samples, the second sample corresponding to the j-th first sample in the second sample set as the j-th second sample, where j is a positive integer less than or equal to N.
- the parameter determination unit 12 is specifically configured to determine the j-th class first sample and the j-th class second sample as the j-th group of samples.
- the parameter determination unit 12 is specifically used to add the first samples in the i-th group of sample sets to obtain a first sum value, and add the second samples in the i-th group of sample sets to obtain a second sum value; determine the sum of squares of the first samples in the i-th group of sample sets to obtain a third sum value; multiply the first sample and the second sample in the i-th group of sample sets and then add them to obtain a fourth sum value; determine the i-th group of linear model parameters based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the changing unit 13 is specifically configured to determine a second sample mean of the reference block; and select the target group of linear model parameters from the N groups of linear model parameters based on the second sample mean.
- the changing unit 13 is specifically configured to select the target group of linear model parameters from the N groups of linear model parameters based on the second sample mean and the first sample mean.
- the change unit 13 is specifically used to determine a group of linear model parameters corresponding to the first sample of the first category in the N groups of linear model parameters as the target group of linear model parameters if the second sample mean is greater than or equal to the first sample mean; if the second sample mean is less than or equal to the first sample mean, then determine a group of linear model parameters corresponding to the first sample of the second category in the N groups of linear model parameters as the target group of linear model parameters.
- the changing unit 13 is specifically configured to determine a second bit depth mean of the reference block; based on the second bit depth mean, The target group of linear model parameters is selected from the N groups of linear model parameters.
- the changing unit 13 is specifically configured to select the target group of linear model parameters from the N groups of linear model parameters based on the second bit depth mean and the first bit depth mean.
- the changing unit 13 is specifically used to determine a group of linear model parameters corresponding to the first class first sample in the N groups of linear model parameters as the target group of linear model parameters if the second bit depth mean is greater than or equal to the first bit depth mean; if the second bit depth mean is less than or equal to the first bit depth mean, determine a group of linear model parameters corresponding to the second class first sample in the N groups of linear model parameters as the target group of linear model parameters.
- the mode determination unit 11 is specifically used to decode the code stream to obtain first information, where the first information is used to indicate the prediction type of the current block; and determine the prediction mode of the current block based on the first information.
- the mode determination unit 11 is specifically used to decode the code stream and obtain a first flag if the first information indicates that the prediction type of the current block is intra-block copy prediction, and the first flag is used to indicate whether the current block uses merge mode; based on the first flag, determine the prediction mode of the current block.
- the mode determination unit 11 is specifically used to decode the code stream to obtain second information if the first flag indicates that the current block does not use the merge mode, and the second information is used to indicate whether the current block uses the intra-block copy illumination compensation mode; based on the second information, determine the prediction mode of the current block.
- the mode determination unit 11 is specifically used to decode the code stream and obtain index information if the second information indicates that the current block uses the intra-block copy illumination compensation mode, wherein the index information is used to indicate the mode index of the intra-block copy illumination compensation mode used by the current block; and determine the prediction mode of the current block based on the index information.
- the mode determination unit 11 is specifically used to determine that the prediction mode of the current block is the single-model intra-frame block copy illumination compensation mode if the value of the index information is a first value; and to determine that the prediction mode of the current block is the multi-model intra-frame block copy illumination compensation mode if the value of the index flag is a second value.
- the mode determination unit 11 is specifically used to determine the multi-model intra-block copy illumination compensation mode as the prediction mode of the current block if the second information indicates that the current block uses the intra-block copy illumination compensation mode and the size of the current block is greater than or equal to a second preset size.
- the second information is also used to indicate a mode index of the intra block copy illumination compensation mode
- the mode determination unit 11 is specifically used to determine the prediction mode of the current block based on the value of the second information.
- the mode determination unit 11 is specifically used to determine that the prediction mode of the current block is a non-intra-block copy illumination compensation mode if the value of the second information is a first value; determine that the prediction mode of the current block is a single-model intra-block copy illumination compensation mode if the value of the second information is a second value; and determine that the prediction mode of the current block is a multi-model intra-block copy illumination compensation mode if the value of the second information is a third value.
- the mode determination unit 11 is further used to determine whether the size of the current block satisfies a first preset size before decoding the code stream to obtain the second information; if the size of the current block satisfies the first preset size, the code stream is decoded to obtain the second information.
- the mode determination unit 11 decodes the code stream to obtain third information before decoding the code stream to obtain the second information, wherein the third information is used to indicate whether the current block is decoded using a first tool, and the first tool is mutually exclusive with the intra-block copying illumination compensation technology; if the third information indicates that the current block is not decoded using the first tool, the code stream is decoded to obtain the second information.
- the mode determination unit 11 is specifically configured to determine the prediction mode of the reference block as the prediction mode of the current block if the first flag indicates that the current block uses the merge mode.
- the mode determination unit 11 is specifically configured to determine the single model intra block copy illumination compensation mode as the prediction mode of the current block if the first flag indicates that the current block uses the merge mode.
- the mode determination unit 11 is specifically used to decode the code stream to obtain fourth information if the first flag indicates that the current block uses the merge mode, and the fourth information is used to indicate the prediction mode of the current block; based on the fourth information, obtain the prediction mode of the current block.
- the mode determination unit 11 decodes the code stream to obtain a third flag before obtaining the first flag, and the third flag is used to indicate whether the current sequence allows local illumination compensation; if the third flag indicates that the current sequence allows local illumination compensation, the code stream is decoded to obtain the first flag.
- the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here.
- the device 10 shown in FIG. 16 can execute the decoding method of the decoding end of the embodiment of the present application, and the aforementioned and other operations and/or functions of each unit in the device 10 are respectively for implementing the corresponding processes in each method such as the decoding method of the decoding end, and for the sake of brevity, no further description is given here.
- FIG17 is a schematic block diagram of a video encoding device provided in an embodiment of the present application, and the video encoding device is applied to the above-mentioned encoder.
- the video encoding device 20 may include:
- a mode prediction unit 21 configured to determine a prediction mode of a current block
- a parameter determination unit 22 configured to determine a reference block of the current block and determine N groups of linear model parameters if the prediction mode of the current block is a multi-model intra block copy illumination compensation mode, where N is a positive integer greater than 1;
- the changing unit 23 is used to select a target group of linear model parameters from the N groups of linear model parameters, and use the target group of linear model parameters to perform linear changes on the reference block to obtain a prediction block of the current block.
- the parameter determination unit 22 is specifically configured to determine N groups of linear model parameters based on a surrounding reconstructed area of the reference block and a surrounding reconstructed area of the current block.
- the parameter determination unit 22 is specifically configured to determine a first sample set from the surrounding reconstructed area of the reference block, and determine a second sample set from the surrounding reconstructed area of the current block; divide the first sample set and the second sample set into N groups of sample sets, the N groups of sample sets Any sample set in the set includes at least one first sample and at least one second sample; for the i-th sample set in the N sample sets, based on the first sample and the second sample included in the i-th sample set, determine the i-th group of linear model parameters, where i is a positive integer less than or equal to N.
- the reconstructed area around the reference block includes a template area of the reference block
- the reconstructed area around the current block includes a template area of the current block
- the parameter determination unit 22 is specifically configured to determine the first sample set from the template area of the reference block, and determine the second sample set from the template area of the current block.
- the parameter determination unit 22 is specifically used to perform sampling in the template area of the reference block according to a first sampling step to obtain the first sample set, and the first sampling step is smaller than a preset sampling step; and perform sampling in the template area of the current block according to the first sampling step to obtain the second sample set.
- the parameter determination unit 22 is specifically configured to determine all samples included in the template area of the reference block as the first sample set; and determine all samples included in the template area of the current block as the second sample set.
- the template area of the reference block includes the upper template area of the reference block and/or the left template area of the reference block
- the template area of the current block includes the upper template area of the current block and/or the left template area of the current block.
- the upper template area of the reference block includes an upper template area and an upper right template area of the reference block
- the upper template area of the current block includes an upper template area and an upper right template area of the current block
- the left template area of the reference block includes a left template area and a lower left template area of the reference block
- the left template area of the current block includes a left template area and a lower left template area of the current block
- the number of sample rows included in the upper template region of the reference block is greater than or equal to a preset number of rows, and the number of sample rows included in the upper template region of the current block is greater than or equal to the preset number of rows.
- the number of sample columns included in the left template area of the reference block is greater than or equal to a preset number of columns, and the number of sample columns included in the left template area of the current block is greater than or equal to the preset number of columns.
- the parameter determination unit 22 is specifically used to divide the first samples included in the first sample set into N categories of first samples; divide the second samples included in the second sample set into N categories of second samples; and obtain the N groups of sample sets based on the N categories of first samples and the N categories of second samples.
- the parameter determination unit 22 is specifically configured to determine a first sample mean of the first sample set; and divide the first sample set into the N types of first samples based on the first sample mean.
- the parameter determination unit 22 is specifically used to classify the first samples in the first sample set that are greater than or equal to the first sample mean as first-category first samples; and classify the first samples in the first sample set that are less than or equal to the first sample mean as second-category first samples.
- the parameter determination unit 22 is specifically configured to divide the first sample set into the N types of first samples based on the bit depth of the first samples in the first sample set.
- the parameter determination unit 22 is specifically configured to determine a first bit depth mean of the first sample set; and divide the first sample set into the N types of first samples based on the first bit depth mean.
- the parameter determination unit 22 is specifically used to classify the first samples in the first sample set whose bit depth is greater than or equal to the first bit depth mean as the first category of first samples; and classify the first samples in the first sample set whose bit depth is less than or equal to the first bit depth mean as the second category of first samples.
- the parameter determination unit 22 is specifically used to determine, for the j-th first sample in the N-type first samples, the second sample corresponding to the j-th first sample in the second sample set as the j-th second sample, where j is a positive integer less than or equal to N.
- the parameter determination unit 22 is specifically configured to determine the j-th class first sample and the j-th class second sample as the j-th group of samples.
- the parameter determination unit 22 is specifically used to add the first samples in the i-th group of sample sets to obtain a first sum value, and add the second samples in the i-th group of sample sets to obtain a second sum value; determine the sum of squares of the first samples in the i-th group of sample sets to obtain a third sum value; multiply the first sample and the second sample in the i-th group of sample sets and then add them to obtain a fourth sum value; determine the i-th group of linear model parameters based on the first sum value, the second sum value, the third sum value and the fourth sum value.
- the variation unit 23 is specifically configured to determine a second sample mean of the reference block; and select the target group of linear model parameters from the N groups of linear model parameters based on the second sample mean.
- the changing unit 23 is specifically configured to select the target group of linear model parameters from the N groups of linear model parameters based on the second sample mean and the first sample mean.
- the change unit 23 is specifically used to determine a group of linear model parameters corresponding to the first sample of the first category in the N groups of linear model parameters as the target group of linear model parameters if the second sample mean is greater than or equal to the first sample mean; if the second sample mean is less than or equal to the first sample mean, then determine a group of linear model parameters corresponding to the first sample of the second category in the N groups of linear model parameters as the target group of linear model parameters.
- the changing unit 23 is specifically configured to determine a second bit depth mean of the reference block; and select the target group of linear model parameters from the N groups of linear model parameters based on the second bit depth mean.
- the changing unit 23 is specifically configured to select the target group of linear model parameters from the N groups of linear model parameters based on the second bit depth mean and the first bit depth mean.
- the changing unit 23 is specifically used to determine a group of linear model parameters corresponding to the first class first sample in the N groups of linear model parameters as the target group of linear model parameters if the second bit depth mean is greater than or equal to the first bit depth mean; if the second bit depth mean is less than or equal to the first bit depth mean, determine a group of linear model parameters corresponding to the second class first sample in the N groups of linear model parameters as the target group of linear model parameters.
- the mode determination unit 21 is specifically used to determine a candidate prediction mode list corresponding to the current block, wherein the candidate prediction mode includes the multi-model intra-block copy illumination compensation mode; determine to use each candidate prediction mode in the candidate prediction mode list to predict the current block The prediction mode of the current block is determined according to the cost.
- the mode determination unit 21 before determining the candidate prediction mode list corresponding to the current block, is also used to determine whether the size of the current block satisfies a first preset size; if the size of the current block satisfies the first preset size, the multi-model intra-frame block replication illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.
- the mode determination unit 21 before determining the candidate prediction mode list corresponding to the current block, is also used to determine whether the current block is encoded using a first tool, and the first tool is mutually exclusive with the intra-block copy illumination compensation technology; if it is determined that the current block is not encoded using the first tool, the multi-model intra-block copy illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.
- the mode determination unit 21 is further used to determine the prediction type of the current block and write first information into the bitstream, where the first information is used to indicate the prediction type of the current block.
- the mode determination unit 21 is further configured to write a first flag into the bitstream if the prediction type of the current block is intra block copy prediction, wherein the first flag is used to indicate whether the current block uses a merge mode.
- the mode determination unit 21 is further configured to write second information into the bitstream if the current block does not use the merge mode, wherein the second information is used to indicate whether the current block uses the intra block copy illumination compensation mode.
- the mode determination unit 21 is further used to write index information into the bitstream if the current block uses the intra block copy illumination compensation mode, wherein the index information is used to indicate the mode index of the intra block copy illumination compensation mode used by the current block.
- the mode determination unit 21 is also used to determine that the value of the index information is a first value if the prediction mode of the current block is a single-model intra-frame block copy illumination compensation mode; if the prediction mode of the current block is the multi-model intra-frame block copy illumination compensation mode, determine that the value of the index flag is a second value.
- the mode determination unit 21 is specifically used to determine the multi-model intra-block copy illumination compensation mode as the prediction mode of the current block if the second information indicates that the current block uses the intra-block copy illumination compensation mode and the size of the current block is greater than or equal to a second preset size.
- the second information is also used to indicate a mode index of the intra-block copy illumination compensation mode
- the mode determination unit 21 is further used to determine that the value of the second information is a first value if the prediction mode of the current block is a non-intra-block copy illumination compensation mode; determine that the value of the second information is a second value if the prediction mode of the current block is a single-model intra-block copy illumination compensation mode; and determine that the value of the second information is a third value if the prediction mode of the current block is the multi-model intra-block copy illumination compensation mode.
- the mode determination unit 21 is specifically configured to determine the prediction mode of the reference block as the prediction mode of the current block if the current block uses the merge mode.
- the mode determination unit 21 is specifically configured to determine the single model intra block copy illumination compensation mode as the prediction mode of the current block if the current block uses the merge mode.
- the mode determination unit 21 before determining the candidate prediction mode list corresponding to the current block, is also used to determine a third flag, and the third flag is used to indicate whether the current sequence allows local illumination compensation; if the third flag is used to indicate that the current sequence allows local illumination compensation, the multi-model intra-frame block copy illumination compensation mode is added to the candidate prediction mode list corresponding to the current block.
- the mode determination unit 21 is further configured to write the third flag into the bitstream, where the third flag is used to indicate whether the current sequence allows local illumination compensation.
- the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, it will not be repeated here.
- the device 20 shown in Figure 17 may correspond to the corresponding subject in the encoding method of the encoding end of the embodiment of the present application, and the aforementioned and other operations and/or functions of each unit in the device 20 are respectively for implementing the corresponding processes in each method such as the encoding method of the encoding end, and for the sake of brevity, it will not be repeated here.
- the functional unit can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software units.
- the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and/or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software units in the decoding processor to perform.
- the software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc.
- the storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
- FIG. 18 is a schematic block diagram of an electronic device provided in an embodiment of the present application.
- the electronic device 30 may be a video encoder or a video encoder as described in an embodiment of the present application, and the electronic device 30 may include:
- the memory 33 and the 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 execute the steps in the method 200 according to the 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:
- the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory.
- the volatile memory can be a random access memory (RAM), which is used as an external cache.
- RAM random access memory
- many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc. SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM) and Direct Rambus RAM (DR RAM).
- the computer program 34 may be divided into one or more units, which are stored in the memory 33 and executed by the processor 32 to complete the method provided by the present application.
- the one or more units may be a series of computer program instruction segments capable of completing specific functions, and 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 further include:
- the transceiver 33 may be connected to the processor 32 or the memory 33 .
- the processor 32 may control the transceiver 33 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices.
- the 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 includes not only a data bus but also a power bus, a control bus and a status signal bus.
- FIG19 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application.
- the video coding and decoding system 40 may include: a video encoder 41 and a video encoder 42, wherein the video encoder 41 is used to execute the video coding method involved in the embodiment of the present application, and the video encoder 42 is used to execute the video coding method involved in the embodiment of the present application.
- the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment.
- the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
- the present application also provides a code stream, which is generated according to the above encoding method.
- the computer program product includes one or more computer instructions.
- the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
- the computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations.
- the available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
- a magnetic medium e.g., a floppy disk, a hard disk, a magnetic tape
- an optical medium e.g., a digital video disc (DVD)
- DVD digital video disc
- SSD solid state disk
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the unit is only a logical function division.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请提供一种视频编解码方法、装置、设备、系统、及存储介质,在对当前块进行编解码时,确定当前块的预测模式;若当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定当前块的参考块,并确定N组线性模型参数,N为大于1的正整数;从N组线性模型参数中选择目标组线性模型参数,并使用目标组线性模型参数对参考块进行线性变化,得到当前块的预测块,提高了光照补偿效果,进而提升预测准确性和编解码性能。
Description
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法、装置、设备、系统、及存储介质。
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。
由于视频中存在时间或空间冗余,通过预测可以消除或降低视频中的冗余,提高压缩效率。目前为了提高预测效果,提出了帧内块复制光照补偿模式,但是在一些情况下,使用目前的帧内块复制光照补偿模式进行预测时,存在光照补偿效果差,导致预测不准确,编解码效率低的问题。
发明内容
本申请实施例提供了一种视频编解码方法、装置、设备、系统、及存储介质,可以提高候选预测模式列表的构建准确性,提升当前块的预测准确性,进而提高编解码性能。
第一方面,本申请提供了一种视频解码方法,应用于解码器,包括:
确定当前块的预测模式;
若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;
从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
第二方面,本申请实施例提供一种视频编码方法,包括:
确定当前块的预测模式;
若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;
从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
第三方面,本申请提供了一种视频解码装置,用于执行上述第一方面或其各实现方式中的方法。具体地,该装置包括用于执行上述第一方面或其各实现方式中的方法的功能单元。
第四方面,本申请提供了一种视频编码装置,用于执行上述第二方面或其各实现方式中的方法。具体地,该装置包括用于执行上述第二方面或其各实现方式中的方法的功能单元。
第五方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。
第六方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频解码器用于执行上述第一方面或其各实现方式中的方法,视频编码器用于执行上述第二方面或其各实现方式中的方法。
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十二方面,提供了一种码流,码流是基于上述第二方面的方法生成的。
基于以上技术方案,提出了一种多模型帧内块复制光照补偿模式,以增加帧内块复制光照补偿的模式,这样编解码端可以根据当前块的具体情况,选择使用单模型帧内块复制光照补偿模式(即只有一组模型参数)进行预测补偿,还是使用多模型帧内块复制光照补偿模式(即包括多组模型参数)进行预测补偿。若选择多模型帧内块复制光照补偿模式对当前块进行预测补偿时,确定N组线性模型参数,并从这N组线性模型参数中选出目标线性模型参数,进而使用该目标模型参数对当前块的参考块进行线性变化,得到当前块的预测块,提高了光照补偿效果,进而提升预测准确性和编解码性能。
图1为本申请实施例涉及的一种视频编解码系统的示意性框图;
图2是本申请实施例涉及的视频编码器的示意性框图;
图3是本申请实施例涉及的视频解码器的示意性框图;
图4A和图4B为不同亮度的图像示意图;
图5为光照补偿模型原理示意图;
图6为样本选择示意图;
图7为IBC原理示意图;
图8为不同光照的图像示意图;
图9为IBC-LIC示意图;
图10为一种应用场景示意图;
图11为本申请一实施例提供的视频解码方法流程示意图;
图12为一种模板示意图;
图13为一种扩展模板示意图;
图14为一种扩展模板示意图;
图15为本申请实一施例提供的视频编码方法流程示意图;
图16是本申请一实施例提供的视频解码装置的示意性框图;
图17是本申请一实施例提供的视频编码装置的示意性框图;
图18是本申请实施例提供的电子设备的示意性框图;
图19是本申请实施例提供的视频编解码系统的示意性框图。
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。例如,本申请的方案可结合至音视频编码标准(audio video coding standard,简称AVS),例如,H.264/音视频编码(audio video coding,简称AVC)标准,H.265/高效视频编码(high efficiency video coding,简称HEVC)标准以及H.266/多功能视频编码(versatile video coding,简称VVC)标准。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含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可包含更多、更少或不同的功能组件。
可选的,在本申请中,当前块(current block)可以称为当前编码单元(CU)或当前预测单元(PU)等。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建图像块。
在一些实施例中,预测单元210包括帧间预测单元211和帧内预测单元212。由于视频的一个帧中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻帧之间的时间冗余,从而提高编码效率。
帧间预测单元211可用于帧间预测,帧间预测可以包括运动估计(motion estimation)和运动补偿(motion compensation),可以参考不同帧的图像信息,帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块,用于消除时间冗余;帧间预测所使用的帧可以为P帧和/或B帧,P帧指的是向前预测帧,B帧指的是双向预测帧。帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要在参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。
帧内预测单元212只参考同一帧图像的信息,预测当前码图像块内的像素信息,用于消除空间冗余。帧内预测所使用的帧可以为I帧。
帧内预测有多种预测模式,以国际数字视频编码标准H系列为例,H.264/AVC标准有8种角度预测模式和1种非角度预测模式,H.265/HEVC扩展到33种角度预测模式和2种非角度预测模式。HEVC使用的帧内预测模式有平面模式(Planar)、DC和33种角度模式,共35种预测模式。VVC使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。
残差单元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)单元,其中去块滤波单元用于去方块效应,SAO/ALF单元用于去除振铃效应。
解码图像缓存270可存储重建后的像素块。帧间预测单元211可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测单元212可使用解码图像缓存270中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。
熵编码单元280可接收来自变换/量化单元230的量化后的变换系数。熵编码单元280可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。
图3是本申请实施例涉及的视频解码器的示意性框图。
如图3所示,视频解码器300包含:熵解码单元310、预测单元320、反量化/变换单元330、重建单元340、环路滤波单元350及解码图像缓存360。需要说明的是,视频解码器300可包含更多、更少或不同的功能组件。
视频解码器300可接收码流。熵解码单元310可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码单元310可解析码流中的经熵编码后的语法元素。预测单元320、反量化/变换单元330、重建单元340及环路滤波单元350可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。
在一些实施例中,预测单元320包括帧内预测单元322和帧间预测单元321。
帧内预测单元322可执行帧内预测以产生PU的预测块。帧内预测单元322可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧内预测单元322还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。
帧间预测单元321可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码单元310可解析PU的运动信息。帧间预测单元321可根据PU的运动信息来确定PU的一个或多个参考块。帧间预测单元321可根据PU的一个或多个参考块来产生PU的预测块。
反量化/变换单元330可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换单元330可使用与TU的CU相关联的QP值来确定量化程度。
在逆量化变换系数之后,反量化/变换单元330可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。
重建单元340使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建单元340可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。
环路滤波单元350可执行消块滤波操作以减少与CU相关联的像素块的块效应。
视频解码器300可将CU的重建图像存储于解码图像缓存360中。视频解码器300可将解码图像缓存360中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。
视频编解码的基本流程如下:在编码端,将一帧图像划分成块,针对当前块,预测单元210使用帧内预测或帧间预测产生当前块的预测块。残差单元220可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化单元230变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化单元230变换与量化之前的残差块可称为时域残差块,经过变换/量化单元230变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码单元280接收到变化量化单元230输出的量化后的变化系数,可对该量化后的变化系数进行熵编码,输出码流。例如,熵编码单元280可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。
在解码端,熵解码单元310可解析码流得到当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。重建块组成重建图像,环路滤波单元350基于图像或基于块对重建图像进行环路滤波,得到解码图像。编码端同样需要和解码端类似的操作获得解码图像。该解码图像也可以称为重建图像,重建图像可以为后续的帧作为帧间预测的参考帧。
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
国际视频编码标准制定组织JVET已成立超越H.266/VVC编码模型研究的小组,并将该模型,即平台测试软件,命名为增强的压缩模型(Enhanced Compression Model,ECM)。ECM在VTM10.0的基础上开始接收更新和更高效的压缩算法,目前已超越VVC约13%的编码性能。ECM不仅扩大了特定分辨率的编码单元尺寸,同时也集成了许多帧内预测和帧间预测技术。
本申请实施例的技术方案是在ECM参考软件之上改进,以求得到更高的编码效率。
在本申请实施例中,当前块(current block)可以是当前编码单元(CU)或当前预测单元(PU)等。由于并行处理的需要,图像可以被划分成片slice等,同一个图像中的片slice可以并行处理,也就是说它们之间没有数据依赖。
而“帧”是一种常用的说法,一般可以理解为一帧是一个图像。在申请中所述帧也可以替换为图像或slice等。
现实自然视频中经常存在视频内容上的光照强度变化,如随着时间流逝光照强度下降,乌云遮挡抑或是相机的闪光灯强度变化等视频内容。这些视频内容与前后帧图像的差别主要在于图像直流分量的强弱,对于内容中的纹理信息基本没有变化。但碍于较大的直流分量数值影响,对于帧间预测技术的运动搜索与运动补偿并不能有效的预测这些内容,容易编入较多的残差信息。局部光照补偿(Local Illuminance Compensation,LIC)技术能够很好的去除这些直流冗余信息,准确预测亮度变化和做出对应的补偿,使得残差信息更小,提高编码效率。以下文中将局部光照补偿技术简称为光照补偿。
当前最新视频编解码标准H.266/VVC已经定稿,国际视频编码联合标准专家组JVET提出在VVC基础之上探索超越VVC编码性能的视频编解码标准,以beyond VVC为目的创立探索实验EE2。探索实验所用的平台参考软件以VTM11.0为基础,新的算法将集成到上面并将分支改成为ECM,同时针对ECM成立多个专家讨论组。最新的ECM参考软件8.0版本已经拥有超过VVC约19%的编码性能,而作为当前最新标准的VVC也仅比上一代视频编解码标准H.265/HEVC高出约27%的编码性能,可以想象在不久的将来,或许以ECM为基础开启下一代视频编解码标准探索和研究的窗口。
在ECM提出初期,参考软件中已集成VVC不具有的编码工具,而这些编码工具为ECM的不同编码场景提供了高效的编码性能和处理能力,这其中就包括LIC,下文对现在ECM中的LIC进行简单介绍。
光照补偿技术为一种帧间编码技术,在帧间编码过程中,当前编码单元根据MV(运动矢量信息)获取对应的参考块,而这参考块通常来自不同的编码帧,或者说参考编码单元并不属于当前图像。不同帧的图像在一些特定场景下有或大或小的变化,而光照补偿技术对其中一些变化的处理十分有效。如图4A和图4B所示,左右两个部分的纹理信息基本相同,不同点在于两者的亮度变化。由于右边图像经过相机的闪光灯照射而显得十分的明亮,左边为正常自然光照射。上图两者相比产生了差异,而这个差异在视频编码当中所带来的负担是巨大的。假设左边块以右边块作为参考编码单元,两者的纹理信息相同,所以纹理细节上的差异是很小的,但残差整体却很大。因为,右边图像的像素由于闪光灯的作用,像素样本整体做了偏移,两者的残差中包含了这部分偏移。若将这部分残差直接变换和量化后写入码流当中,则这部分的开销是巨大的。
现有ECM参考软件中的光照补偿技术通过线性拟合的方式来消除这些,如因闪光灯或者光照变化带来的影响,使得整体的预测效果更好。其光照补偿技术的主要部分如下:
利用参考编码单元和当前编码单元相邻部分的重建样本的相关性,来拟合编码单元内部预测样本与参考样本之间变化的相关性。因为当前编码单元相邻的上侧和左侧重建样本如若存在是可以获取得到的,而参考图像中参考编码单元相邻的上侧和左侧重建样本也同样是可以获取得到的。对当前帧的重建样本和参考图像的重建样本进行建模即可以得到对应的拟合模型。
建模过程中,ECM的光照补偿采用线性拟合的方式,模型简化为通过一个缩放参数a和偏置参数b组成即可以拟合当前帧与参考图像之间的光照变化。
示例性的,变化关系通过模型参数表示如公式(1)所示:
Pred′(x,y)=a·Pred(x,y)+b (1)
Pred′(x,y)=a·Pred(x,y)+b (1)
其中,Pred(x,y)为未进行光照补偿前的预测块,Pred‘(x,y)为光照补偿之后的预测块,a为光照补偿模型中的缩放参数,b为光照补偿模型中的偏移参数。
式中的a和b均需要通过当前帧的图像信息与参考帧的图像信息计算求取。
示例性的,通过对当前块空间相邻的已重建像素与对应参考帧中的已重建块相邻的像素进行建模得到a和b,推导公式如公式(2)所示:
Curr_Recneigh=a·Ref_Recneigh+b (2)
Curr_Recneigh=a·Ref_Recneigh+b (2)
上述式子中,Curr_Recneigh为当前帧的重建图像,Ref_Recneigh为参考帧的重建图像。
如图5所示,在数字视频编解码过程中,当前帧的编码块通过光照补偿模型进行光照差异的修正,得到补偿后的预测块。
上述缩放参数a和偏移参数b的计算需要借助参考帧中对应已重建块的相邻重建像素和当前帧中编码块的相邻重建像素,根据当前帧编码单元的相邻重建像素与参考帧中对应位置的已重建像素之间的相关性,对其进行建模和求解,具体如图6所示。
如图6所示,Reconstructed pixels均为CU的最相邻重建样本像素,Reference picture CU为参考帧中对应的已重建CU,Current picture 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)所示:
a=(sumXY-sumXsumY)/(sumXX–sumXsumX)
b=sumY–a*sumX(3)
a=(sumXY-sumXsumY)/(sumXX–sumXsumX)
b=sumY–a*sumX(3)
其中,sumXsumY为sumX乘以sumY。
在ECM参考软件的计算过程中存在一些移位操作均为简化过程,在此不细展开。在得到线性模型参数后,通过对运动补偿之后的预测块做线性变化得到最终的预测块。
上述用于计算线性模型参数的重建样本若属于帧间预测块,则需要插值操作。
ECM中的光照补偿技术可以作用在普通帧间预测,合并预测模式和子块模式,其中普通帧间预测即为inter模式,合并预测模式即为merge模式,而子块模式则为affine模式。同时,光照补偿技术只作用在单帧预测模式,而对于多帧双向参考模式则禁止使用。
此外,ECM中的光照补偿技术与已采纳技术有耦合关系,当前编码单元中,光照补偿技术不与双向光流技术(BDOF)、对称运动矢量差技术(SMVD)等同时使用。
上述光照补偿技术应用于帧间预测当中,而在帧内预测当中有一种技术类似于帧间预测,即帧内块复制技术(Intra Block Copy,IBC)。帧内块复制技术,如名称所示,即在当前帧内寻找一个与当前编码块匹配或者相近的块复制之后作为当前编码块的预测块。这是一个专门用于屏幕内容编码的帧内预测技术。
示例性的,如图7所示,右侧的编码块内有一块倒三角的图形纹理,若用传统的帧内预测技术来编码当前编码块,均需要大量的比特消耗来编码残差信息。而采用帧内块复制技术后,在当前帧规定的范围内进行搜索,找到左上角有一处相似或相同之处。通过失真代价计算或哈希值匹配,确定搜索到的重建块将其复制过来作为当前编码块的预测块。可以看出,这种预测技术相比于传统的帧内编码技术要高效很多。在一些情况下,甚至能搜索到完全相同的预测块,无需编码残差信息,大量节省比特开销。
图7中,带箭头的实线为当前编码块的块矢量信息BV。在解码端,当前编码块通过BV找到匹配的重建块作为当前编码块的预测块。
与帧间预测相同,IBC拥有两种模式,一个为AMVP(advanced motion vector predition,高级运动矢量预测)模式;另一个为skip/merge模式,即合并模式。
在AMVP模式下,IBC需要传输索引来表示具体使用哪个块矢量预测(Block Vector Prediction,BVP),以及编码块矢量误差(Block Vector Difference,BVD);
在skip/merge模式下,IBC需要传输索引来表示具体使用哪个块矢量(Block Vector,BV)信息。
与帧间预测相同,在某一些应用场景下,即使编码块内的纹理信息都相同,也可能存在颜色上的差异。在自然序列下,最常见的场景就是光照变化,例如一个摄像头固定照射一栋大楼,在早上拍摄的大楼视频内容与下午拍摄的大楼视频内容相同。但光照强度发生了变化,因此即使帧间预测利用已解码的重建帧作为参考内容,也不能完全表示视频内容,因为光照不同,视频内容整体均值不同,编码所需要的残差比特流消耗大。而光照补偿技术很好解决了这样的问题,通过建立线性模型,对参考内容和当前内容做转换,在不改变纹理内容的情况下,适配不同光照强度的变化。
同样在屏幕内容编码中也存在类似问题,即使编码块内容相同,但存在颜色偏差或者其他问题而导致帧内块复制技术的编码效率较低,更甚至找不到相似的编码块。例如图8所示,即使图片内容纹理相同,但颜色的较大差异导致块复制技术效率降低或者甚至匹配不了这些已重建的图像内容。
而IBC-LIC技术与帧间LIC技术相同,通过建立参考块与编码块的线性关系,对参考块做转换后作为当前编码单元的预测块,其过程与前述帧间LIC部分相同。在一些实施例中,在AMVP模式下,IBC需要一个标识位来表示是否使用LIC技术,而merge模式下通过继承的方式来开启和关闭LIC技术。
示例性的,开启IBC-LIC技术后,当前图像区域的编码情况如图9所示。如图9所示,从第二个子图开始,越来越多的编码块使用IBC-LIC技术来拷贝前面已经重建的子图内容。
IBC-LIC技术在屏幕内容编码应用场景下确实能够提供非常可观的性能,其计算过程与帧间LIC技术相同,无论是从软件层面还是硬件层面来说复杂度都是能够接受且性价比还是很高的。
但是,IBC-LIC沿用帧间LIC的同时,采用上侧和左侧模板区域的参考样本以及重建样本作为输入进行建模的方式,不一定能很好契合屏幕内容编码的场景。通常在自然序列下,光照变化针对当前帧内的内容应该是相同的,而屏幕内容场景下,内容是像素级别的变化,比较锐化。例如,对于一些PPT应用场景,颜色的变化十分迅速且剧烈,某些形状是红色,但切换到下一个形状可能就是绿色。若当前编码单元将这两色包括在内,而参考的重建块纹理相同,但各自颜色变化不同,此时利用模板计算出的参数不能很好反应不同颜色之间的变化关系,这时候的模型参数更像是一种折中拟合。如若特殊例子中,以图10为例,假设右侧为蓝色圆形图案,左侧为橘色圆形图案,右侧蓝色圆形图案与左侧橘色圆形图案在形状上有着非常相似的地方,一些颜色渐变程度也十分相似,因此拷贝边缘形状后做颜色补偿是十分有效的节省码率方法。然而,模板所覆盖的区域通常有多种颜色,且预测块也存在不同颜色,造成模型拟合不准确,进而使用帧内块复制光照补偿模式进行预测时,存在预测不准确,导致编解码效率低的问题。
为了解决上述技术问题,本申请实施例提出了一种多模型帧内块复制光照补偿模式,以增加帧内块复制光照补偿的模式,这样编解码端可以根据当前块的具体情况,选择使用单模型帧内块复制光照补偿模式(即只有一组模型参数)进行预测补偿,还是使用多模型帧内块复制光照补偿模式(即包括多组模型参数)进行预测补偿。若选择多模型帧内块复制光照补偿模式对当前块进行预测补偿时,确定多组线性模型参数,并从这多组线性模型参数中选出目标线性模型参数,进而使用该目标模型参数对当前块的参考块进行线性变化,得到当前块的预测块,提高了预测准确性,提升编解码性能。
下面结合图11,以解码端为例,对本申请实施例提供的视频解码方法进行介绍。
图11为本申请一实施例提供的视频解码方法流程示意图,本申请实施例应用于图1和图3所示视频解码器。如图11所示,本申请实施例的方法包括:
S101、确定当前块的预测模式。
在本申请实施例中,为了便于描述,将只有一组模型参数的帧内块复制光照补偿模式,记为单模型帧内块复制光照补偿模式,例如表示为IBC-LIC-S模式,其中IBC-LIC-S模式为目前已有的IBC-LIC模式。将包括组模型参数的帧
内块复制光照补偿模式,记为多模型帧内块复制光照补偿模式,例如表示为IBC-LIC-M模式。
本申请实施例为了提高帧内块复制光照补偿的效果,则提出了一种多模型帧内块复制光照补偿模式,该多模型帧内块复制光照补偿模式可以理解为包括多组线性模型参数的帧内块复制光照补偿模式。例如,使用帧内复制技术,确定出当前块的参考块(或初始预测块),接着,从多组线性模型参数中选择最优的一组线性模型参数,对当前块的参考块进行线性变化(即光照补偿),得到当前块的预测块,提高了光照补偿的效果和预测准确性,进而提高了图像的解码效果。
在本申请实施例中,为了便于描述,将只有一组模型参数的帧内块复制光照补偿模式,记为单模型帧内块复制光照补偿模式,例如表示为IBC-LIC-S模式。
本申请实施例对确定当前块的预测模式的具体方式不做限制。
在一些实施例中,解码端默认当前块的预测模式为多模型帧内块复制光照补偿模式。
在一些实施例中,解码端构建候选预测模式列表,该候选预测模式中包括单模型帧内块复制光照补偿模式和多模型帧内块复制光照补偿模式。接着,解码端确定候选预测模式列表中的每一个候选预测模式对当前块的模板进行预测时的代价,将代价最小的候选预测模式,确定为当前块的预测模式。
在一些实施例中,解码端解码码流,得到第一信息,第一信息用于指示当前块的预测类型,进而基于该第一信息,确定当前块的预测模式。
本申请实施例对第一信息的具体表现形式不做限制。
在一种示例中,第一信息可以表示为modeType。
例如,若modeType=MODE_INTRA,则表示当前块的预测类型为帧内预测。
再例如,若modeType=MODE_INTER,则表示当前块的预测类型为帧间预测。
再例如,若modeType=MODE_IBC,则表示当前块的预测类型为帧内块复制预测。
在一些实施例中,若本申请实施例还包括序列级的标志位时,解码端在解码码流,得到第一信息之前,首先解码码流,得到第三标志,该第三标志为序列级的标志位,用于指示当前序列是否允许局部光照补偿。若第三标志指示当前序列允许局部光照补偿时,则解码端解码码流,得到第一标志。否则,解码端跳过解码码流得到第一信息的步骤。
本申请实施例对第三标志的具体表现形式不做限制。
在一种示例中,第三标志可以表示为sps_ibc_lic_enable_flag。通过为第三标志sps_ibc_lic_enable_flag置不同的值,来表示当前序列是否允许采用局部光照补偿技术。
例如,若第三标志sps_ibc_lic_enable_flag的取值为0时,则表示当前序列不允许采用局部光照补偿技术。
再例如,若第三标志sps_ibc_lic_enable_flag的取值为1时,则表示当前序列允许采用局部光照补偿技术。
本申请实施例对解码端基于第一信息,确定当前块的预测模式的具体方式不做限制。
在一些实施例中,若解码端基于第一信息,确定当前块的预测类型为帧内预测或帧间预测时,则继续解码码流,确定出当前块具体的帧预测模式或帧间预测模式。此时,解码端可以确定出当前块的预测模式不是多模型帧内块复制光照补偿模式。
在一些实施例中,若解码端基于第一信息,确定当前块的预测类型为帧内块复制预测时,则解码端可以默认当前块的预测模式为多模型帧内块复制光照补偿模式。
在一些实施例中,若解码端基于第一信息,确定当前块的预测类型为帧内块复制预测时,则解码端继续解码码流,得到第一标志,该第一标志用于指示当前块是否使用merge模式,进而基于该第一标志,确定当前块的预测模式。
本申请实施例对第一标志的具体表现形式不做限制。
在一种示例中,第一标志可以表示为merge_flag。通过为第一标志merge_flag置不同的值,来表示当前块是否使用merge模式进行预测。
例如,若第一标志merge_flag的取值为0时,则表示当前块不使用merge模式进行预测。
再例如,若第一标志merge_flag的取值为1时,则表示当前块使用merge模式进行预测。
本申请实施例对解码端基于第一标志,确定当前块的预测模式的具体方式不做限制。
在一种可能的实现方式中,若第一标志指示当前块不使用merge模式时,则解码端默认当前块的预测模式为多模型帧内块复制光照补偿模式。
在一种可能的实现方式中,若第一标志指示当前块不使用merge模式时,则解码端可以使用单模型帧内块复制光照补偿模式和多模型帧内块复制光照补偿模式分别对当前块的模板区域进行预测,选出代价最小的一个模式,作为当前块的预测模式。
在一种可能的实现方式中,若第一标志指示当前块不使用merge模式时,则解码端继续解码码流,得到第二信息,该第二信息用于指示当前块是否使用帧内块复制光照补偿模式,进而基于第二信息,确定当前块的预测模式。
本申请实施例对第二信息的具体表现形式不做限制。
在一些实施例中,第二信息可以表示为cu_ibc_lic_flag。通过为第二信息cu_ibc_lic_flag置不同的值,来表示当前块是否使用帧内块复制光照补偿模式。
例如,若第二信息cu_ibc_lic_flag的取值为0时,则表示当前块不使用帧内块复制光照补偿模式进行预测。
再例如,若第二信息cu_ibc_lic_flag的取值为1时,则表示当前块使用帧内块复制光照补偿模式进行预测。
在一些实施例中,解码端对使用帧内块复制光照补偿模式的块的大小有限制,例如对于一些大小的块不使用帧内块复制光照补偿模式,而对于一些大小的块使用帧内块复制光照补偿模式。基于此,解码端在解码上述第二信息之前,首先判断当前块的大小是否满足第一预设大小,若当前块的大小满足第一预设大小时,才解码码流,得到第二信息。
本申请实施例对衡量当前块的大小的具体指标不做限制。
示例性的,可以使用当前块的宽和高来衡量当前块的大小。例如,当前块的宽度大于阈值1且高度大于阈值2时,则确定当前块的大小满足第一预设大小,进而解码码流,得到第二信息。其中,阈值1和阈值2的值可以是4、8,
16,32、128、256等,阈值1可以等于阈值2。
示例性的,可以使用当前块的宽和高的乘积,即当前块的面积来衡量当前块的大小。例如,当前块的面积大于或等于阈值3且小于阈值5时,则确定当前块的大小满足第一预设大小,进而解码码流,得到第二信息。其中,阈值3的值可以是16、32等,阈值5为256、1024等。
示例性的,可以使用当前块所包括像素点个数衡量当前块的大小。例如,当前块所包括的像素点个数大于或等于阈值4时,则确定当前块的大小满足第一预设大小,进而解码码流,得到第二信息。其中,阈值4的值可以是16、32、128、256、1024等。
本申请实施例对解码端基于第二信息,确定当前块的预测模式的具体方式不做限制。
方式1,若第二信息指示当前块不使用帧内块复制光照补偿模式时,则解码端继续解码码流,确定当前块的预测模式,且确定当前块的预测模式不是多模型帧内块复制光照补偿模式。
方式2,若第二信息指示当前块使用帧内块复制光照补偿模式时,则解码端默认当前块的预测模式为多模型帧内块复制光照补偿模式。
方式3,若第二信息指示当前块使用帧内块复制光照补偿模式时,则解码端可以使用单模型帧内块复制光照补偿模式和多模型帧内块复制光照补偿模式分别对当前块的模板区域进行预测,选出代价最小的一个模式,作为当前块的预测模式。
方式4,若第二信息指示当前块使用帧内块复制光照补偿模式时,则解码端继续解码码流,得到索引信息,该索引信息用于指示当前块所使用的帧内块复制光照补偿模式的模式索引,进而基于该索引信息,确定当前块的预测模式。
本申请实施例对索引信息的具体表现形式不做限制。
在一些实施例中,索引信息可以表示为cu_ibc_lic_index。通过为该索引信息cu_ibc_lic_index置不同的值,来表示当前块所使用的帧内块复制光照补偿模式的模式索引。
例如,若索引信息cu_ibc_lic_index的取值为第一数值时,则表示当前块的预测模式为单模型帧内块复制光照补偿模式。
再例如,若索引标志cu_ibc_lic_index的取值为第二数值时,则确定当前块的预测模式为多模型帧内块复制光照补偿模式。
本申请实施例对第一数值和第二数值的具体取值不做限制。
例如,第一数值为0。
再例如,第二数值为1。
在方式4的一种示例中,解码端通过解码如表1所示的语法元素,确定当前块的预测模式:
表1
其中,sps_ibc_lic_enable_flag为第三标志,用于指示当前序列是否允许局部光照补偿。modeType为第一信息,用于指示当前块的预测类型,modeType==MODE_IBC表示当前块的预测类型为帧内块复制预测。merge_flag为第一标志,用于指示当前块是否使用merge模式进行预测。cbWidth为当前块的宽,cbHeight为当前块的高。cu_ibc_lic_flag为第二信息,用于指示当前块是否使用帧内块复制光照补偿模式,cu_ibc_lic_index为索引标志,用于表示当前块所使用的帧内块复制光照补偿模式的模式索引。
如上述表1所示,在该示例中,解码端首先解码sps_ibc_lic_enable_flag,若sps_ibc_lic_enable_flag指示当前序列允许局部光照补偿时,则继续解码merge_flag,若merge_flag指示当前块不使用merge模式时,则判断当前块的cbWidth*cbHeight是否大于32,其中32为预设值,可以根据实际情况进行更改。若解码端判断当前块的cbWidth*cbHeight>32时,则继续解码cu_ibc_lic_flag,若cu_ibc_lic_flag指示当前块使用帧内块复制光照补偿模式时,则继续解码cu_ibc_lic_index,得到当前块的预测模式是单模型帧内块复制光照补偿模式,还是多模型帧内块复制光照补偿模式。
示例性的,上述cu_ibc_lic_index可以基于上下文的方式进行解码,或者使用等概率的方式进行解码。
方式5,若第二信息指示当前块使用帧内块复制光照补偿模式,且当前块的大小大于或等于第二预设大小时,则将多模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式5中,对于较大的当前块,默认使用多模型帧内块复制光照补偿模式,即在解码端的语法元素解析时,若cu_ibc_lic_flag为真,且当前块的大小大于第二预设大小时,则表示当前块使用多模型帧内块复制光照补偿模式,否则表示当前块不使用光照补偿技术,无需解析索引。
本申请实施例对衡量当前块的大小的具体指标不做限制。
示例性的,可以使用当前块的宽和高来衡量当前块的大小。例如,当前块的宽度大于阈值1且高度大于阈值2时,则确定当前块的大小大于第二预设大小。其中,阈值1和阈值2的值可以是4、8,16,32、128、256等,阈值1可以等于阈值2。
示例性的,可以使用当前块的宽和高的乘积,即当前块的面积来衡量当前块的大小。例如,当前块的面积大于或等于阈值3时,则确定当前块的大小大于第二预设大小。其中,阈值3的值可以是16、32、128、256等。
示例性的,可以使用当前块所包括像素点个数衡量当前块的大小。例如,当前块所包括的像素点个数大于或等于阈值4时,则确定当前块的大小大于第二预设大小。其中,阈值4的值可以是16、32、128、256、1024等。
上述实施例中的第二信息只表示当前块是否使用帧内块复制光照补偿模式,不指示帧内块复制光照补偿模式的模式索引,而是通过索引信息来指示帧内块复制光照补偿模式的模式索引。
在一些实施例中,第二信息除了指示当前块是否使用帧内块复制光照补偿模式外,还可以指示帧内块复制光照补偿模式的模式索引,此时解码端直接可以基于第二信息的取值,来确定当前块的预测模式。
在一种示例中,在该实施例中可以使用cu_ibc_lic_mode表示第二信息。当然还可以使用的语法元素表示该第二信息,本申请实施例对此不做限制。
例如,若第二信息cu_ibc_lic_mode的取值为第一数值时,则确定当前块的预测模式为非帧内块复制光照补偿模式;
再例如,若第二信息cu_ibc_lic_mode的取值为第二数值时,则确定当前块的预测模式为单模型帧内块复制光照补偿模式;
再例如,若第二信息cu_ibc_lic_mode的取值为第三数值时,则确定当前块的预测模式为多模型帧内块复制光照补偿模式。
本申请实施例对上述第一数值、第二数值和第三数值的具体取值不做限制。
在一种示例中,第一数值为0,第二数值为1,第三数值为2。
在该实施例中,通过第二信息cu_ibc_lic_mode的具体取值,可以确定出当前块是否使用帧内块复制光照补偿模式,以及当前块所使用的帧内块复制光照补偿模式的模式索引。
例如,解码端解码码流,得到第二信息cu_ibc_lic_mode,若第二信息cu_ibc_lic_mode的取值为第一数值时,则确定当前块不使用帧内块复制光照补偿模式,若第二信息cu_ibc_lic_mode的取值为第二数值时,则确定当前块的预测模式为单模型帧内块复制光照补偿模式,若第二信息cu_ibc_lic_mode的取值为第三数值时,则确定当前块的预测模式为多模型帧内块复制光照补偿模式。
在该实施例的一种示例中,解码端通过解码如表2所示的语法元素,确定当前块的预测模式:
表2
如上述表2所示,在该示例中,解码端首先解码sps_ibc_lic_enable_flag,若sps_ibc_lic_enable_flag指示当前序列允许局部光照补偿时,则继续解码merge_flag,若merge_flag指示当前块不使用merge模式时,则判断当前块的cbWidth*cbHeight是否大于32,其中32为预设值,可以根据实际情况进行更改。若解码端判断当前块的cbWidth*cbHeight>32时,则继续解码cu_ibc_lic_mode,若cu_ibc_lic_mode为0时表示当前块不使用帧内块复制光照补偿模式,若cu_ibc_lic_mode为1时,则表示当前块使用单模型帧内块复制光照补偿模式,若cu_ibc_lic_mode为2时,则表示当前块使用多模型帧内块复制光照补偿模式。
在一些实施例中,帧内块复制光照补偿模式与一些工具互斥,此时,解析第二信息的条件可以根据标准中已有的解码工具耦合关系决定。此时,解码端在解码第二信息之前,还包括解码码流,得到第三信息,该第三信息用于指示当前块是否采用第一工具进行解码,第一工具与帧内块复制光照补偿技术互斥;若第三信息指示当前块不采用第一工具进行解码时,则解码码流,得到第二信息。
在本申请实施例中,若当前块允许使用其他帧内块复制类预测技术,且与帧内块复制光照补偿技术不能同时使用,则可以通过先解析第一工具的块级使用标识位(即第三信息),来判断是否解析当前块的第二信息。若第一工具的块级使用标识位(即第三信息)为真,则无需解析当前块的第二信息;否则,再解析当前块的第二信息。
示例性的,以第一工具为RRIBC为例,更新语法元素表。RRIBC为Reconstruction-reordered IBC,一种将重建样本进行重组后再搜索匹配块的技术,重组操作包括但不仅限于水平翻转和垂直翻转。此时,解码端解码如表3所示的语法元素,得到当前块的预测模式:
表3
表3所示,cu_rribc_flip_type为第一工具RRIBC的操作类型,若cu_rribc_flip_type为0,则表示当前块不使用RRIBC技术;否则表示当前块使用RRIBC技术。
如表3所示,解码端解码cu_rribc_flip_type,若cu_rribc_flip_type=0即表示当前块不使用RRIBC技术时,则继续解码第二信息cu_ibc_lic_flag。若cu_rribc_flip_type=1即表示当前块使用RRIBC技术时,则解码跳过解码第二信息cu_ibc_lic_flag,且确定当前块不使用帧内块复制光照补偿技术。
在一种示例中,上述表3中的第二信息还可以使用表2中的cu_ibc_lic_mode表示,进而删除表3中的索引信息cu_ibc_lic_index。
上文对第一标志指示当前块不使用merge模式时,解码端确定当前块的预测模式的具体过程进行介绍。
在一些实施例中,若第一标志指示当前块使用merge模式时,则解码端至少可以通过如下几种方式,确定出当前块的预测模式。
方式1、若第一标志指示当前块使用merge模式时,则将参考块的预测模式,确定为当前块的预测模式。
在该方式1中,若解码端确定当前块使用merge模式时,则通过继承的方式,得到当前块的预测模式。具体是,解码端确定当前块的参考块,进行将该参考块的预测模式,确定为当前块的预测模式。
例如,若参考块的预测模式为单模型帧内块复制光照补偿模式时,则确定当前块的预测模式也为单模型帧内块复制光照补偿模式。
再例如,若参考块的预测模式为多模型帧内块复制光照补偿模式时,则确定当前块的预测模式也为多模型帧内块复制光照补偿模式。
在该方式1中,编码端无需在码流传输当前块的预测模式信息。
方式2、若第一标志指示当前块使用merge模式时,则将单模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式2中,若当前块使用merge模式时,则编解码两端默认将单模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式2中,编码端无需在码流中传输当前块的预测模式信息。
方式3、若第一标志指示当前块使用merge模式时,则将多模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式3中,若当前块使用merge模式时,则编解码两端默认将多模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式3中,编码端无需在码流中传输当前块的预测模式信息。
方式4、若第一标志指示当前块使用merge模式时,则解码码流,得到第四信息,第四信息用于指示当前块的预测模式;基于第四信息,得到当前块的预测模式。
在该方式4中,若当前块使用merge模式时,当前块可以不通过继承周边信息的方式来决定IBC-LIC的使用与否,而是通过编码端率失真代价计算,将使用与否的情况用标识位和索引的形式传输到解码端。解码端解析merge模式下的该技术使用标识位来判断是否对当前编码单元使用IBC-LIC技术。例如编码端计算各候选预测模式对当前块进行预测时的率失真代价,并将代价最小的候选预测模式确定为当前块的预测模式,同时根据该代价最小的候选预测模式,在码流中写入第四信息,通过该第四信息指示当前块的预测模式。
在一种示例中,若编码端确定当前块不使用IBC-LIC时,则可以将上述表第二信息cu_ibc_lic_flag置否。再例如,若编码端确定当前块使用IBC-LIC时,则可以将上述表第二信息cu_ibc_lic_flag置真,且根据当前块的具体IBC-LIC模式索引,确定cu_ibc_lic_index。例如,当前块的预测模式为单模型帧内块复制光照补偿模式时,则将cu_ibc_lic_index置为0编入码流,若当前块的预测模式为多模型帧内块复制光照补偿模式时,则将cu_ibc_lic_index置为1编入码流。
在一种示例中,若编码端确定当前块不使用IBC-LIC时,则可以将上述表第二信息cu_ibc_lic_mode置否,例如置0。再例如,若编码端确定当前块使用IBC-LIC时,则可以将上述表第二信息cu_ibc_lic_mode置真,且根据当前块的具体IBC-LIC模式索引,确定cu_ibc_lic_mode的具体取值。例如,当前块的预测模式为单模型帧内块复制光照补偿模式时,则将cu_ibc_lic_mode置为1编入码流,若当前块的预测模式为多模型帧内块复制光照补偿模式时,则将cu_ibc_lic_mode置为2编入码流。
上文对解码端确定当前块的预测模式的具体过程进行介绍。
解码端基于上述步骤,确定出当前块的预测模式后,执行如下S102的步骤。
S102、若当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定当前块的参考块,并确定N组线性模型参数。
N为大于1的正整数。
解码端基于上述步骤,确定出当前块的预测模式,若当前块的预测模式为多模型帧内块复制光照补偿模式时,则解码端需要确定N组线性模型参数,同时确定当前块的参考块。接着,从这N组线性模型参数中选出一组线性模型参数作为目标线性模型参数,对当前块的参考块进行线性变化,以得到光照补偿效果佳的预测块,进而提升了预测准确性,提高解码性能。
下面对确定当前块的参考块的具体过程进行介绍。
在一些实施例中,当前块的参考块也称为当前块的预测块,或当前块的初始预测块,或当前块的第一预测块等。也就是说,本申请实施例中当前块的参考块可以理解为未进行光照补偿的预测块。
在一些实施例中,在帧内预测中,解码端在当前图像(即当前帧)中确定当前块的参考块。
示例性的,图7中,带箭头的实线为当前块的块矢量信息BV。在解码端,当前块通过BV找到匹配的重建块作为当前块的参考块。
与帧间预测相同,IBC拥有两种模式,一个为AMVP(advanced motion vector predition,高级运动矢量预测)模式;另一个为skip/merge模式,即合并模式。
在一种示例中,在AMVP模式下,解码端构建MVP候选列表,解码码流,得到一个索引,根据该搜索从MVP候选列表中选出一个MVP,进而根据该选出的MVP确定运动估计的起始点,进而在该起始点附近进行搜索,得到当前块的参考块。
在一种示例中,在skip/merge模式下,解码端构建MVP候选列表,解码码流,得到一个索引,根据该索引从MVP候选列表中选出一个MVP,将该选出的MVP作为当前点的MV,进而根据MV在当前图像中确定出当前块的参考块。
在一些实施例中,解码端还可以采用已有的其他方式,确定出当前块的参考块。
下面对解码端确定N组线性模型参数的具体过程进行介绍。
在本申请实施例中,若解码端确定当前块的预测模式为多模型帧内块复制光照补偿模式时,需要确定多组线性模型参数,进而从这多组线性模型参数中选出一组对当前块的参考块进行线性变化,得到当前块的预测值。
本申请实施例对每一组线性模型参数所包括的具体参数不做限制,例如可以为任意线性变化相关的参数。
在一种示例中,N组线性模型参数中的每一组线性模型参数包括缩放参数a和偏移参数b。需要说明的是,N组线性模型参数中,每一组所包括的参数不完全相同。
示例性的,本申请实施例的N组线性模型参数如表4所示:
表4
上述表4中,(ai,bi)为第i组线性模型参数,其中ai为第i组线性模型参数中的缩放参数,bi为第i组线性模型参数中的偏移参数。
解码端确定出表4所示的N组线性模型参数后,可以从上述表4所示的N组线性模型参数中选择一组线性模型参数,对当前块的参考块进行线性变化,以实现光照补偿,得到光照补偿后的参考块,进而将光照补偿后的参考块确定为当前块的预测块。
本申请实施例对解码端确定N组线性模型参数的具体方式不做限制。
在一些实施例中,编码端可以将确定的N组线性模型参数写入码流,这样解码端可以通过解码码流,得到N组线性模型参数。
在一些实施例中,上述N组线性模型参数为预设值或经验值。
在一些实施例中,解码端通过如下S102-A的步骤,确定N组线性模型参数:
S102-A、基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数。
在该实施例中,解码端确定参考块的周围已重建区域和当前块的周围已重建区域,进而基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数。
示例性的,参考块的周围已重建区域包括与参考块相邻的已重建区域和/或与参考块不相邻的已重建区域。对应的,当前块的周围已重建区域包括与当前块相邻的已重建区域和/或与当前块不相邻的已重建区域。
在本申请实施例中,解码端可以根据参考块的周围已重建区域的特征信息和当前块的周围已重建区域的特征信息,确定N组不同的线性模型参数。这N组不同的线性模型参数可以实现不同效果的光照补偿,进而解码端可以根据实际情况,从这N组光照补偿效果不同的线性模型参数中,选出目标光照补偿效果的一组线性模型参数,对当前块的参考块进行光照补偿,以提高光照补偿效果和预测效果,进而提升解码性能。
本申请实施例对解码端基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数的具体
方式不做限制。
在一些实施例中,解码端首先基于参考块的周围已重建区域和当前块的周围已重建区域,确定出一组线性模型参数。示例性的,根据参考块的周围已重建区域和当前块的周围已重建区域,确定出一组线性模型参数的过程可以参照上述公式(3)所示的方法进行。接着,对这一组线性模型参数进行调整,得到N组线性模型参数。
在一些实施例中,解码端将参考块的周围已重建区域划分为N个子区域,例如基于参考块的周围已重建区域的颜色信息、亮度信息、比特深度等特征信息,将参考块的周围已重建区域划分为N个第一子区域。对应的,按照参考块的N个第一子区域,将当前块周围已重建区域也划分为N个第二子区域,其中一个第一子区域与一个第二子区域对应。这样可以根据N个第一子区域中的每一个第一子区域,根据该第一子区域和该第一子区域对应的第二子区域,确定一组线性模型参数。例如,根据第一子区域1和第二子区域1,确定一组线性模型参数1,根据第一子区域2和第二子区域2,确定一组线性模型参数2,依次类推,可以确定出N组线性模型参数。示例性的,根据第一子区域1和第二子区域1,确定一组线性模型参数1的过程可以参照上述公式(3)所示的方法进行。
在一些实施例中,上述S102-A包括如下S102-A1至S102-A3的步骤:
S102-A1、从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集;
S102-A2、将第一样本集和第二样本集划分为N组样本集,N组样本集中的任一组样本集包括至少一个第一样本和至少一个第二样本;
S102-A3、对于N组样本集中的第i组样本集,基于第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,i为小于或等于N的正整数。
在本申请实施例中,为了便于描述,将参考块的周围已重建区域所包括的样本(即已重建像素点)记为第一样本,将当前块的周围已重建区域所包括的样本(即已重建像素点)记为第二样本。
在该实施例中,解码端确定出参考块的周围已重建区域和当前块的周围已重建区域后,从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集,其中第一样本集包括至少一个第一样本,第二样本集中包括至少一个第二样本集。
本申请实施例对解码端从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集的具体方式不做限制。
例如,解码端按照预设的采集步长,从参考块的周围已重建区域中采集至少一个第一样本,组成第一样本集,以及按照预设的采集步长,从当前块的周围已重建区域中采集至少一个第二样本,组成第二样本集。
再例如,解码端将参考块的周围已重建区域所包括的所有第一样本,确定为第一样本集,以及将当前块的周围已重建区域所包括的所有第二样本,确定为第二样本集。
在一些实施例中,参考块的周围已重建区域包括参考块的模板区域,当前块的周围已重建区域包括当前块的模板区域,此时上述S102-A1包括如下S102-A1的步骤:
S102-A11、从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集。
在该实施例中,若上述参考块的周围已重建区域包括参考块的模板区域,当前块的周围已重建区域包括当前块的模板区域时,则解码端可以直接从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集。
解码端从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集的具体实现方式包括但不限于如下几种:
方式1、根据当前块的宽高大小,设定选取第一样本和第二样本的个数。
例如,若当前块的宽和高中存在等于预设值1(例如4)的情况,则从当前块的上侧模板和左侧模块中各取预设值1(例如4)个第二样本,组成第二样本集,该第二样本集包括8个第二样本。以及从参考块的上侧模板和左侧模块中各取预设值1(例如4)个第一样本,组成第一样本集,该第一样本集包括8个第一样本。
再例如,若当前块宽为预设值2(例如16),高为预设值3(例如为4),则从当前块的左侧模板取4个第二样本,从当前块的上侧模板以步长为预设值4(例如3)取预设值5(例如为4)个第二样本,组成第二样本集,该第二样本集包括8个第二样本。以及从参考块的左侧模板取4个第一样本,从参考块的上侧模板以步长为预设值4(例如3)取预设值5(例如为4)个第一样本,组成第一样本集,该第一样本集包括8个第一样本。
再例如,若当前块宽和高均不存在等于预设值1(例如4)的情况,则从当前块的上侧模板和左侧模板所包括的重建样本中,获取以较小边长的2的对数个数的第二样本,组成第二样本集。以及从参考块的上侧模板和左侧模板所包括的重建样本中,获取以较小边长的2的对数个数的第一样本,组成第一样本集。
示例性的,上述的上侧模板包括一行样本行(即像素行),左侧模板包括一列样本列(即像素列)。
方式2、解码端按照第一采样步长,在参考块的模板区域中进行采样,得到第一样本集;按照第一采样步长,在当前块的模板区域中进行采样,得到第二样本集,其中第一采样步长小于预设采样步长。
在该方式2中,解码端可以通过减小采样步长,以增加参与线性模型参数计算的样本数量,以提高线性模型参数的计算准确性。
例如,解码端按照第一采样步长,在参考块的模板区域中进行采样,得到第一样本集;按照第一采样步长,在当前块的模板区域中进行采样,得到第二样本集,该第一采样步长小于预设采样步长。
示例性的,第一采样步长小于3。
方式3,解码端将参考块的模板区域所包括的所有样本,确定为第一样本集;将当前块的模板区域所包括的所有样本,确定为第二样本集。
在方式3中,可以将参考块的模板区域所包括的所有样本,确定为第一样本集,以及将当前块的模板区域所包括的所有样本,确定为第二样本集,以增加参与线性模型参数计算的样本数量,以提高线性模型参数的计算准确性。
本申请实施例对参考块的模板区域和当前块的模板区域的具体大小不做限制。
在一些实施例中,如图12所示,参考块的模板区域包括参考块的上侧模板区域和/或参考块的左侧模板区域,当
前块的模板区域包括当前块的上侧模板区域和/或当前块的左侧模板区域。
在一些实施例中,为了增加参与线性模型参数计算的样本数量,则可以扩大模板区域。
在一种示例中,将上侧模板进行扩展,例如图13所示,参考块的左侧模板区域包括参考块的左方模板区域和左下方模板区域,当前块的左侧模板区域包括当前块的左方模板区域和左下方模板区域。
在一种示例中,将左侧模板进行扩展,例如图14所示,参考块的上侧模板区域所包括的样本行数大于或等于预设行数,当前块的上侧模板区域所包括的样本行数大于或等于预设行数。
这样,本申请实施例在选择样本时,可以从图13和图14所示的参考块的上侧模板和/或左侧模板中确定出第一样本集,图13和图14所示的从当前块的上侧模板和/或左侧模板中确定出第二样本集,以增加第一样本集个第二样本集中的样本数量。
在一些实施例中,解码端还可以增加上侧模板的行数实现模板扩展。例如参考块的上侧模板区域所包括的样本行数大于或等于预设行数,当前块的上侧模板区域所包括的样本行数大于或等于预设行数。示例性的,该预设行数可以为2、3、4、5等。
在一些实施例中,解码端还可以增加左侧模板的列数实现模板扩展。例如参考块的左侧模板区域所包括的样本列数大于或等于预设列数,当前块的左侧模板区域所包括的样本列数大于或等于预设列数。示例性的,该预设列数可以为2、3、4、5等。
解码端通过上述步骤,从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集后,执行上述S102-A2的步骤。
本申请实施例对解码端将第一样本集和第二样本集划分为N组样本集的具体方式不做限制。
在一些实施例中,解码端根据第一样本集和第二样本集中各第一样本和第二样本的颜色信息、亮度信息和比特深度等特征信息,将第一样本集和第二样本集划分为N组样本集,这N组样本集中的每一组样本集包括至少一个第一样本和至少一个第二样本。例如,将第一样本集和第二样本集中,颜色信息、亮度信息等特征信息相近的第一样本和第二样本,划分到一组样本集中。
在一些实施例中,上述S102-A2包括如下步骤:
S102-A21、将第一样本集所包括的第一样本划分为N类第一样本;
S102-A22、将第二样本集所包括的第二样本划分为N类第二样本;
S102-A23、基于N类第一样本和N类第二样本,得到N组样本集。
在该实施例中,解码端首先将第一样本集所包括的第一样本划分为N类第一样本,同时,将第二样本集所包括的第二样本划分为N类第二样本。其中N类第一样本中每一类第一样本至少包括一个第一样本,N类第二样本中的每一个第二样本至少包括一个第二样本。
本申请实施例对解码端将第一样本集所包括的第一样本划分为N类第一样本的具体方式不做限制。
在一些实施例中,解码端根据第一样本集中各第一样本的特征信息,对第一样本进行分类,得到N类第一样本。
在一些实施例中,上述S102-A21包括如下S102-A21-a1和S102-A21-a2的步骤:
S102-A21-a1、确定第一样本集的第一样本均值;
S102-A21-a2、基于第一样本均值,将第一样本集划分为N类第一样本。
在该实施例中,解码端根据样本均值,对第一样本集所包括的第一样本进行分类。
具体的,解码端首先根据第一样本集中各第一样本的重建值,确定该第一样本集的样本均值,为了便于描述,将该样本均值记为第一样本均值。接着,根据该第一样本均值,将第一样本集所包括的第一样本划分为N类第一样本。
例如,将第一样本集中大于或等于第一样本均值的第一样本,划分为第一类第一样本;将第一样本集中小于或等于第一样本均值的第一样本,划分为第二类第一样本。
再例如,将第一样本集中与第一样本均值之间的差值在阈值c和阈值d之间的第一样本,划分为第一类第一样本。将第一样本集中与第一样本均值之间的差值小于阈值c的第一样本,划分为第二类第一样本。将第一样本集中与第一样本均值之间的差值大于阈值d的第一样本,划分为第三类第一样本。
在一些实施例中,上述上述S102-A21包括如下S102-A21-b的步骤:
S102-A21-b、基于第一样本集中第一样本的比特深度,将第一样本集划分为N类第一样本。
在该实施例中,解码端根据第一样本集中各第一样本的比特深度,将第一样本集划分为N类第一样本。
在一种示例中,按照比特深度的大小,将第一样本集中的各第一样本划分为2类、3类或4类第一样本,每一类第一样本中的各第一样本的比特深度接近。
在另一种示例中,解码端确定第一样本集的第一比特深度均值;基于第一比特深度均值,将第一样本集划分为N类第一样本。
例如,将第一样本集中比特深度大于或等于第一比特深度均值的第一样本,划分为第一类第一样本;将第一样本集中比特深度小于或等于第一比特深度均值的第一样本,划分为第二类第一样本。
再例如,将第一样本集中比特深度与第一比特深度均值之间的差值在阈值e和阈值f之间的第一样本,划分为第一类第一样本。将第一样本集中比特深度与第一比特深度均值之间的差值小于阈值e的第一样本,划分为第二类第一样本。将第一样本集中比特深度与第一比特深度均值之间的差值大于阈值f的第一样本,划分为第三类第一样本。
解码端基于上述步骤,将第一样本集中的第一样本划分为N类第一样本后,将第二样本集中的第二样本也划分为N类第二样本。
本申请实施例对解码端将第二样本集所包括的第二样本划分为N类第二样本的具体方式不做限制。
在一些实施例中,解码端可以采用与划分N类第一样本相同的方式,将第二样本集所包括的第二样本划分为N类第二样本。
在一些实施例中,解码端通过如下步骤,将第二样本集所包括的第二样本划分为N类第二样本,即上述S102-
A22包括如下步骤:
S102-A221、对于N类第一样本中的第j类第一样本,将第二样本集中第j类第一样本对应的第二样本,确定为第j类第二样本,j为小于或等于N的正整数。
解码端基于上述步骤,将第一样本集中的第一样本划分为N类第一样本,针对N类第一样本中的第j类第一样本,解码端将第二样本集中该第j类第一样本对应的第二样本,确定为第j类第二样本,其中j为小于或等于N的正整数。
例如,解码端将第一样本集中大于或等于第一样本均值的第一样本划分为第一类第一样本,对应的,将第二样本集中与第一类第一样本对应位置上的第二样本划分为第一类第二样本。解码端将第一样本集中小于第一样本均值的第一样本划分为第二类第一样本,对应的,将第二样本集中与第二类第一样本对应位置上的第二样本划分为第二类第二样本。
由上述可知,解码端对第一样本集划分得到的N类第一样本,与对第二样本集划分得到的N类第二样本一一对应的,例如第一类第一样本与第一类第二样本对应,第二类第一样本与第二类第二样本对应。因此,解码端可以将N类第一样本第j类第一样本和N类第二样本中第j类第二样本,确定为第j组样本集,这样N类第一样本和N类第二样本,组成N组样本集。
解码端基于上述步骤,将第一样本集和第二样本集划分为N组样本集后,执行上述S102-A3的步骤。
在本申请实施例中,解码端基于N组样本集中的每一组样本集,确定一组线性模型参数,进而得到N组线性模型参数。
在本申请实施例中,基于N组样本集中的每一组样本集,确定每一组线性模型参数的具体过程一致,为了便于描述,在此以基于第i组样本集,确定第i组线性模型参数为例进行说明。
本申请实施例对上述S102-A3中基于第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数的具体方式不做限制。
在一种示例中,确定第i组样本集所包括的第一样本和第二样本之间的线性关系,进而确定出第i组线性模型参数。由于第i组样本集所包括的第一样本和第二样本均已知,因此可以通过求解线性方程的方式,确定出第i组样本集对应的缩放系数a和偏移参数b,进而得到第i组线性模型参数。
在一种示例中,将第i组样本集中的第一样本相加,得到第一和值,并将第i组样本集中的第二样本相加,得到第二和值;确定第i组样本集中的第一样本的平方和,得到第三和值;将第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数。
在该示例中,将第i组样本集中的第一样本xi相加,得到第一和值sumXi,将第i组样本集中的第二样本yi相加,得到第二和值sumYi,确定第i组样本集中的第一样本xi的平方和,得到第三和值sumXiXi,将第i组样本集中的第一样本xi和第二样本yi相乘后再相加,得到第四和值sumXiYi,进而根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数。
本申请实施例对解码端根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数的具体方式不做限制。
在一些实施例中,第i组线性模型参数包括缩放系数ai和偏移参数bi。
示例性的,解码端通过如下公式(4),确定出第i组线性模型参数:
ai=(sumXiYi-sumXisumYi)/(sumXiXi–sumXisumXi)
bi=sumYi–ai*sumXi (5)
ai=(sumXiYi-sumXisumYi)/(sumXiXi–sumXisumXi)
bi=sumYi–ai*sumXi (5)
上述以基于第i组样本集,确定第i组线性模型参数的过程进行介绍。解码端可以参照上述方法,基于N组样本集,确定出N组线性模型参数。
解码端基于上述步骤,确定出N组线性模型参数后,执行如下S103的步骤。
S103、从N组线性模型参数中选择目标组线性模型参数,并使用目标组线性模型参数对参考块进行线性变化,得到当前块的预测块。
在本申请实施例中,若解码端确定当前块的预测模式为多模型帧内块复制光照补偿模式时,则解码端确定当前块的参考块,并确定N组线性模型参数。接着,解码端从这N组线性模型参数中选择一个目标线性模型参数,并使用该目标线性模型参数,对当前块的参考块进行线性变化,提高对参考块的光照补偿效果,进而提升预测效果和解码性能。
本申请实施例对解码端从N组线性模型参数中选择目标组线性模型参数的具体方式不做限制。
在一些实施例中,编码端和解码端采用相同的方式确定N组线性模型参数,编码端可以将选择的目标组线性模型参数的索引写入码流。这样,解码端基于上述步骤,确定出N组线性模型参数后,解码码流得到目标组线性模型参数的索引,进而基于该索引从上述如表4所确定的N组线性模型参数中,确定出目标组线性模型参数。
在一些实施例中,解码端采用如下步骤,从N组线性模型参数中选择目标组线性模型参数:
S103-A1、确定参考块的第二样本均值;
S103-A2、基于第二样本均值,从N组线性模型参数中,选择目标组线性模型参数。
该实施例的方法,与上述S102-A21-a1和S102-A21-a2的方法对应的。
由上述S102-A21-a1和S102-A21-a2可知,解码端在确定N组线性模型参数时,基于第一样本均值,将第一样本集所包括的第一样本划分为N类第一样本,以及根据N类第一样本的位置信息将第二样本集所包括的第二样本划分为N类第二样本,得到N组样本集。最终根据这N组样本集,确定出N组线性模型参数。基于此,解码端在从这N组线性模型参数中选择目标线性模型参数时,确定当前块的参考块的样本均值,即参考块所包括的重建像素值的均值,将该均值记为第二样本均值。这样可以根据该第二样本均值,从N组线性模型参数中,选择目标组线性模型参数。
本申请实施例对解码端基于第二样本均值,从N组线性模型参数中,选择目标组线性模型参数的具体方式不做限
制。
在一种可能的实现方式中,解码端将第二样本均值与N组线性模型参数对应的N组样本集中的样本值进行比较,选择与第二样本均值最接近的一组样本集对应的一组线性模型参数,确定为目标组线性模型参数。例如,第二样本均值与N组样本集中的第k组样本集所包括的第一样本和第二样本最接近(即距离最小),进而将N组线性模型参数中第k组样本集对应的一组线性模型参数,确定为目标组线性模型参数。
在一种可能的实现方式中,解码端基于第二样本均值和第一样本均值,从N组线性模型参数中,选择目标组线性模型参数。
由上述S102-A21-a1和S102-A21-a2可知,在一些实施例中,解码端在将第一样本集和第二样本集划分为N组样本集时,将第一样本集中大于或等于第一样本均值的第一样本,划分为第一类第一样本;将第一样本集中小于或等于第一样本均值的第一样本,划分为第二类第一样本。进而根据N组样本集,确定N组线性模型参数。基于此,解码端可以基于第二样本均值和第一样本均值的大小,从N组线性模型参数中,选择目标组线性模型参数。
例如,若第二样本均值大于或等于第一样本均值,则将N组线性模型参数中第一类第一样本对应的一组线性模型参数,确定为目标组线性模型参数;
再例如,若第二样本均值小于或等于第一样本均值,则将N组线性模型参数中第二类第一样本对应的一组线性模型参数,确定为目标组线性模型参数。
在一些实施例中,解码端采用如下步骤,从N组线性模型参数中选择目标组线性模型参数:
S103-B1、确定参考块的第二比特深度均值;
S103-B2、基于第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
该实施例的方法,与上述S102-A21-b1和S102-A21-b2的方法对应的。
由上述S102-A21-b1和S102-A21-b2可知,解码端在确定N组线性模型参数时,基于第一比特深度均值,将第一样本集所包括的第一样本划分为N类第一样本,以及根据N类第一样本的位置信息,将第二样本集所包括的第二样本划分为N类第二样本,进而得到N组样本集。最终根据这N组样本集,确定出N组线性模型参数。基于此,解码端在从这N组线性模型参数中选择目标线性模型参数时,确定当前块的参考块的比特深度均值,即参考块所包括的重建像素值的比特深度的均值,将该均值记为第二比特深度均值。这样可以根据该第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
本申请实施例对解码端基于第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数的具体方式不做限制。
在一种可能的实现方式中,解码端将第二比特深度均值与N组线性模型参数对应的N组样本集中的样本的比特深度进行比较,选择与第二比特深度均值最接近的一组样本集对应的一组线性模型参数,确定为目标组线性模型参数。例如,第二比特深度均值与N组样本集中的第k组样本集所包括的第一样本和第二样本的比特深度最接近,进而将N组线性模型参数中第k组样本集对应的一组线性模型参数,确定为目标组线性模型参数。
在一种可能的实现方式中,解码端基于第二比特深度均值和第一比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
由上述S102-A21-b1和S102-A21-b2可知,在一些实施例中,解码端在将第一样本集和第二样本集划分为N组样本集时,将第一样本集中比特深度大于或等于第一比特深度均值的第一样本,划分为第一类第一样本;将第一样本集中比特深度小于或等于第一比特深度均值的第一样本,划分为第二类第一样本。进而根据N组样本集,确定N组线性模型参数。基于此,解码端可以基于第二比特深度均值和第一比特深度均值的大小,从N组线性模型参数中,选择目标组线性模型参数。
例如,若第二比特深度均值大于或等于第一比特深度均值,则将N组线性模型参数中第一类第一样本对应的一组线性模型参数,确定为目标组线性模型参数;
再例如,若第二比特深度均值小于或等于第一比特深度均值,则将N组线性模型参数中第二类第一样本对应的一组线性模型参数,确定为目标组线性模型参数。
解码端基于上述步骤,从N组线性模型参数中,确定出目标组线性模型参数后,使用该目标组线性模型参数,当前块的参考块进行线性变换。
例如,目标线性模型参数包括缩放参数a1和偏移参数b1,则解码端基于该缩放参数和偏移参数,对参考块进行线性变化,得到预测块。
示例性的,解码端基于上述公式(5),对当前块的参考块进行线性变化:
Pred′(x,y)=a1·Pred(x,y)+b1 (5)
其中,Pred(x,y)为当前块的参考块或未进行光照补偿前的预测块,a1为目标线性模型参数所包括缩放参数,b1为目标线性模型参数所包括偏移数,Pred′(x,y)为当前块的预测块或光照补偿之后的预测块。
在一些实施例中,本申请实施例提出视频解码方法,适用于解码端的帧内预测部分,将本方案的实施例集成到最新ECM8.0上后,在通测条件AI下测试结果如表5所示:
表5 IBC-LIC-M模式性能
表6组合模式性能
需要说明的是,负数代表性能增益,同等质量下比特数减少。
由于本申请作用在屏幕内容编码的场景下,在测试时,使用通用的屏幕内容编码测试条件,即从class A1到Class E都是不打开这个技术的,因此这几个类下都没有编码性能上的变化以及编码时间上的波动。
其中,Class F和class TGM为屏幕内容编码专用序列类,从仿真结果上看本申请实施例提出的解码方案,对于class F有0.17%的编码性能提升,同时编解码时间没有变化。
本申请实施例提供的视频解码方法,提出了一种多模型帧内块复制光照补偿模式,以增加帧内块复制光照补偿的模式,这样解码端可以根据当前块的具体情况,选择使用单模型帧内块复制光照补偿模式(即只有一组模型参数)进行预测补偿,还是使用多模型帧内块复制光照补偿模式(即包括多组模型参数)进行预测补偿。若选择多模型帧内块复制光照补偿模式对当前块进行预测补偿时,确定N组线性模型参数,并从这N组线性模型参数中选出目标线性模型参数,进而使用该目标模型参数对当前块的参考块进行线性变化,得到当前块的预测块,提高了光照补偿效果,进而提升预测准确性和解码性能。
上文以解码端为例对本申请的视频解码方法进行介绍,下面以编码端为例进行说明。
图15为本申请实一施例提供的视频编码方法流程示意图,本申请实施例应用于图1和图2所示视频编码器。如图15所示,本申请实施例的方法包括:
S201、确定当前块的预测模式。
在本申请实施例中,为了便于描述,将只有一组模型参数的帧内块复制光照补偿模式,记为单模型帧内块复制光照补偿模式,例如表示为IBC-LIC-S模式,其中IBC-LIC-S模式为目前已有的IBC-LIC模式。将包括组模型参数的帧内块复制光照补偿模式,记为多模型帧内块复制光照补偿模式,例如表示为IBC-LIC-M模式。
本申请实施例为了提高帧内块复制光照补偿的效果,则提出了一种多模型帧内块复制光照补偿模式,该多模型帧内块复制光照补偿模式可以理解为包括多组线性模型参数的帧内块复制光照补偿模式。例如,使用帧内复制技术,确定出当前块的参考块(或初始预测块),接着,从多组线性模型参数中选择最优的一组线性模型参数,对当前块的参考块进行线性变化(即光照补偿),得到当前块的预测块,提高了光照补偿的效果和预测准确性,进而提高了图像的编码效果。
在本申请实施例中,为了便于描述,将只有一组模型参数的帧内块复制光照补偿模式,记为单模型帧内块复制光照补偿模式,例如表示为IBC-LIC-S模式。
本申请实施例对确定当前块的预测模式的具体方式不做限制。
在一些实施例中,编码端默认当前块的预测模式为多模型帧内块复制光照补偿模式。
在一些实施例中,上述S201包括如下步骤:
S201-A1、确定当前块对应的候选预测模式列表,候选预测模式中包括多模型帧内块复制光照补偿模式;
S201-A2、确定使用候选预测模式列表中各候选预测模式对当前块进行预测时的代价;
S201-A3、根据代价,确定当前块的预测模式。
在一些实施例中,编码端在确定当前块对应的候选预测模式列表之前,方法还包括:确定第三标志,第三标志用于指示当前序列是否允许局部光照补偿;若第三标志用于指示当前序列允许局部光照补偿时,则将多模型帧内块复制光照补偿模式,添加至当前块对应的候选预测模式列表中。
本申请实施例对第三标志的具体表现形式不做限制。
在一种示例中,第三标志可以表示为sps_ibc_lic_enable_flag。通过为第三标志sps_ibc_lic_enable_flag置不同的值,来表示当前序列是否允许采用局部光照补偿技术。
例如,若第三标志sps_ibc_lic_enable_flag的取值为0时,则表示当前序列不允许采用局部光照补偿技术。
再例如,若第三标志sps_ibc_lic_enable_flag的取值为1时,则表示当前序列允许采用局部光照补偿技术。
在一些实施例中,编码端将第三标志写入码流,该第三标志用于指示当前序列是否允许局部光照补偿。
在一些实施例中,编码端对使用帧内块复制光照补偿模式的块的大小有限制,例如对于一些大小的块不使用帧内块复制光照补偿模式,而对于一些大小的块使用帧内块复制光照补偿模式。基于此,编码端在确定当前块对应的候选预测模式列表之前,确定当前块的大小是否满足第一预设大小;若当前块的大小满足第一预设大小时,则将多模型帧内块复制光照补偿模式,添加至当前块对应的候选预测模式列表中。
本申请实施例对衡量当前块的大小的具体指标不做限制。
示例性的,可以使用当前块的宽和高来衡量当前块的大小。例如,当前块的宽度大于阈值1且高度大于阈值2时,则确定当前块的大小满足第一预设大小。其中,阈值1和阈值2的值可以是4、8,16,32、128、256等,阈值1可以等于阈值2。
示例性的,可以使用当前块的宽和高的乘积,即当前块的面积来衡量当前块的大小。例如,当前块的面积大于或等于阈值3且小于阈值5时,则确定当前块的大小满足第一预设大小。其中,阈值3的值可以是16、32等,阈值5为256、1024等。
示例性的,可以使用当前块所包括像素点个数衡量当前块的大小。例如,当前块所包括的像素点个数大于或等于阈值4时,则确定当前块的大小满足第一预设大小。其中,阈值4的值可以是16、32、128、256、1024等。
在一些实施例中,编码端在确定当前块对应的候选预测模式列表之前,确定当前块是否采用第一工具进行编码,第一工具与帧内块复制光照补偿技术互斥;若确定当前块不采用第一工具进行编码时,则将多模型帧内块复制光照补偿模式,添加至当前块对应的候选预测模式列表中。
在一种示例中,编码端遍历预测模式,若当前预测模式类型为帧内块复制模式,则获取本技术的允许使用标志位,集第三标志,该标志位为序列级标志位,表示当前序列是否允许使用帧内块复制局部光照补偿技术,可以如sps_ibc_lic_enable_flag的形式。
步骤1、若IBC-LIC的允许使用标志位(即第三标志)为真,且当前块的大小满足第一预设大小,例如当前块的面积大于阈值1,且当前块的面积小于阈值2,则编码端尝试IBC-LIC的预测方法,即执行如下步骤2。若IBC-LIC的允许使用标志位(即第三标志)或者当前块的大小不满足第一预设大小,则编码端不尝试IBC-LIC的预测方法,即跳过下面的步骤2,直接执行步骤3。
步骤2、获取当前块上侧和左侧模板区域的重建样本信息以及参考块的上侧和左侧模板区域的重建样本信息。
首先,编码端遍历IBC AMVP模式下的各种预测模式,并计算对应的率失真代价值。
第一轮:编码端尝试IBC-LIC-S模式,所获取样本个数与上文描述相同,取决于当前块的宽高。通过上文所描述的线性模型计算方法对获取得到的重建样本进行建模,计算缩放因子a和偏移参数b。对预测块进行线性变换,变换参数为缩放a倍及补偿b,得到当前块最终的预测块。将该预测块与当前块所对应的原始样本作差得到当前块的残差,通过变换量化等操作计算得到率失真代价值,记为cost1;
第二轮:编码端尝试IBC-LIC-M模式,所获取样本个数与上文描述相同,取决于当前块的宽高。根据参考块相邻的模板区域样本均值对两个模板区域的样本进行分类,其中参考块相邻的模板区域样本值大于样本均值的样本被归类为第一类,相应地,对应位置的预测块相邻的模板区域样本也被归为第一类;反之,若参考块相邻的模板区域样本值小于或等于样本均值的样本被归类为第二类,同理,对应位置的预测块相邻的模板区域样本也被归为第二类。分别对第一类样本和第二类样本用上述模型计算方法计算出第一类的线性模型参数,得到第一模型参数缩放因子a1和偏移参数b1;第二模型参数缩放因子a2和偏移参数b2。根据参考块中样本值与模板区域样本均值的大小关系选择第一模型或第二模型,其中,若参考块中样本值大于模板区域样本均值的样本使用第一模型参数做线性变换,反之,若参考块中样本值小于或等于模板区域样本均值的样本使用第二模型参数做线性变换。得到预测块后,与原始图像块计算得到率失真代价值,记为cost2;
比较cost1以及cost2,记录最小的代价值记为costAmvpIbcLic,同时保存当前光照补偿模式下的信息包括光照补偿模式索引,cost1对应的模式索引为0,cost2对应模式索引为1。
接着,编码端构建IBC merge模式下的列表信息,遍历各候选模式并计算对应的率失真代价值。
当前块遍历merge列表里的候选BV,若继承而来的信息中IBC-LIC为开启,则当前块根据该BV信息获取得到参考块,同时根据继承而来的IBC-LIC模式获取当前块以及参考块的相邻模板区域样本,并计算线性模型参数。将参考块根据线性模型参数做变换,步骤与前述相同,得到最终预测块。将该预测块与当前块所对应的原始样本作差得到当前块的残差,通过变换量化等操作计算得到率失真代价值,记为costIdx1;遍历merge列表中其他候选BV,通过同样方法计算得到率失真代价值,costIdx2,costIdx3,costIdx4等。
比较costIdx1、costIdx2等代价值,记录最小的代价值为costMergeIbc。
步骤3、编码端继续遍历其他帧间预测技术,并计算得到各技术所对应的率失真代价值,选择最小的代价值所对应的预测模式作为当前块的最优预测模式。
在一些实施例中,若costAmvpIbcLic为最小,则当前块使用帧内块复制光照补偿技术,需要将光照补偿技术的编码单元级使用标识位置真写入码流,此外帧内快复制光照补偿模式索引也需要写入码流。
在一些实施例中,若costMergeIbc为最小,则当前块使用merge模式的帧内块复制技术,将IBC的merge标识位置真写入码流,同时将merge索引也写入码流当中。
在一些实施例中,若当前块允许使用光照补偿技术且costLic不为最小,则当前块不使用光照补偿技术,需要将光照补偿技术的编码单元级使用标识位置否写入码流;否则将其他最优预测模式信息等写入码流,因与本技术并不强相关,故此处不详细介绍;
在一些实施例中,编码端确定当前块的预测类型,并在码流中写入第一信息,第一信息用于指示当前块的预测类型。
本申请实施例对第一信息的具体表现形式不做限制。
在一种示例中,第一信息可以表示为modeType。
例如,若modeType=MODE_INTRA,则表示当前块的预测类型为帧内预测。
再例如,若modeType=MODE_INTER,则表示当前块的预测类型为帧间预测。
再例如,若modeType=MODE_IBC,则表示当前块的预测类型为帧内块复制预测。
在一些实施例中,若第一信息指示当前块的预测类型为帧内块复制预测时,则将第一标志写入码流,第一标志用于指示当前块是否使用merge模式。
本申请实施例对第一标志的具体表现形式不做限制。
在一种示例中,第一标志可以表示为merge_flag。通过为第一标志merge_flag置不同的值,来表示当前块是否使用merge模式进行预测。
例如,若第一标志merge_flag的取值为0时,则表示当前块不使用merge模式进行预测。
再例如,若第一标志merge_flag的取值为1时,则表示当前块使用merge模式进行预测。
在一些实施例中,若当前块不使用所述merge模式时,则将第二信息写入所述码流,所述第二信息用于指示所述当前块是否使用帧内块复制光照补偿模式。
在一些实施例中,第二信息可以表示为cu_ibc_lic_flag。通过为第二信息cu_ibc_lic_flag置不同的值,来表示当前块是否使用帧内块复制光照补偿模式。
例如,若第二信息cu_ibc_lic_flag的取值为0时,则表示当前块不使用帧内块复制光照补偿模式进行预测。
再例如,若第二信息cu_ibc_lic_flag的取值为1时,则表示当前块使用帧内块复制光照补偿模式进行预测。
在一些实施例中,若所述当前块使用所述帧内块复制光照补偿模式,则将索引信息写入所述码流,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引。
在一些实施例中,若所述当前块使用所述帧内块复制光照补偿模式,则将索引信息写入所述码流,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引。
本申请实施例对索引信息的具体表现形式不做限制。
在一些实施例中,索引信息可以表示为cu_ibc_lic_index。通过为该索引信息cu_ibc_lic_index置不同的值,来表示当前块所使用的帧内块复制光照补偿模式的模式索引。
例如,若当前块的预测模式为单模型帧内块复制光照补偿模式,则索引信息cu_ibc_lic_index的取值为第一数值。
再例如,若当前块的预测模式为多模型帧内块复制光照补偿模式,则索引标志cu_ibc_lic_index的取值为第二数值。
本申请实施例对第一数值和第二数值的具体取值不做限制。
例如,第一数值为0。
再例如,第二数值为1。
示例性的,上述cu_ibc_lic_index可以基于上下文的方式进行编码,或者使用等概率的方式进行编码。
方式5,若第二信息指示当前块使用帧内块复制光照补偿模式,且当前块的大小大于或等于第二预设大小时,则将多模型帧内块复制光照补偿模式,确定为当前块的预测模式。
在该方式5中,对于较大的当前块,默认使用多模型帧内块复制光照补偿模式,即在编码端的语法元素解析时,若cu_ibc_lic_flag为真,且当前块的大小大于第二预设大小时,则表示当前块使用多模型帧内块复制光照补偿模式,否则表示当前块不使用光照补偿技术,无需解析索引。
本申请实施例对衡量当前块的大小的具体指标不做限制。
示例性的,可以使用当前块的宽和高来衡量当前块的大小。例如,当前块的宽度大于阈值1且高度大于阈值2时,则确定当前块的大小大于第二预设大小。其中,阈值1和阈值2的值可以是4、8,16,32、128、256等,阈值1可以等于阈值2。
示例性的,可以使用当前块的宽和高的乘积,即当前块的面积来衡量当前块的大小。例如,当前块的面积大于或等于阈值3时,则确定当前块的大小大于第二预设大小。其中,阈值3的值可以是16、32、128、256等。
示例性的,可以使用当前块所包括像素点个数衡量当前块的大小。例如,当前块所包括的像素点个数大于或等于阈值4时,则确定当前块的大小大于第二预设大小。其中,阈值4的值可以是16、32、128、256、1024等。
在一些实施例中,若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,且所述当前块的大小大于或等于第二预设大小时,则将所述多模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
上述实施例中的第二信息只表示当前块是否使用帧内块复制光照补偿模式,不指示帧内块复制光照补偿模式的模式索引,而是通过索引信息来指示帧内块复制光照补偿模式的模式索引。
在一些实施例中,第二信息除了指示当前块是否使用帧内块复制光照补偿模式外,还可以指示帧内块复制光照补偿模式的模式索引。
在一种示例中,在该实施例中可以使用cu_ibc_lic_mode表示第二信息。当然还可以使用的语法元素表示该第二信息,本申请实施例对此不做限制。
例如,若所述当前块的预测模式为非帧内块复制光照补偿模式,则确定所述第二信息cu_ibc_lic_mode的取值为第一数值;
再例如,若所述当前块的预测模式为单模型帧内块复制光照补偿模式,则确定所述第二信息cu_ibc_lic_mode的取值为第二数值;
再例如,若所述当前块的预测模式为所述多模型帧内块复制光照补偿模式,则确定所述第二信息cu_ibc_lic_mode的取值为第三数值。
本申请实施例对上述第一数值、第二数值和第三数值的具体取值不做限制。
在一种示例中,第一数值为0,第二数值为1,第三数值为2。
在一些实施例中,若当前块使用merge模式时,则编码端至少可以通过如下几种方式,确定出当前块的预测模式。
方式1、若当前块使用merge模式时,则将参考块的预测模式,确定为当前块的预测模式。
方式2、若当前块使用merge模式时,则将单模型帧内块复制光照补偿模式,确定为当前块的预测模式。
方式3、若当前块使用merge模式时,则将多模型帧内块复制光照补偿模式,确定为当前块的预测模式。
方式4、若当前块使用merge模式时,则不通过继承得到预测模式,而是计算各候选预测模式对当前块进行预测时的率失真代价,并将代价最小的候选预测模式确定为当前块的预测模式。在一种示例中,在码流中写入第四信息,通过该第四信息指示当前块的预测模式。
上文对编码端确定当前块的预测模式的具体过程进行介绍。
编码端基于上述步骤,确定出当前块的预测模式后,执行如下S202的步骤。
S202、若当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定当前块的参考块,并确定N组线性模型参数。
N为大于1的正整数。
编码端基于上述步骤,确定出当前块的预测模式,若当前块的预测模式为多模型帧内块复制光照补偿模式时,则编码端需要确定N组线性模型参数,同时确定当前块的参考块。接着,从这N组线性模型参数中选出一组线性模型参数作为目标线性模型参数,对当前块的参考块进行线性变化,以得到光照补偿效果佳的预测块,进而提升了预测准确性,提高编码性能。
下面对确定当前块的参考块的具体过程进行介绍。
在一些实施例中,当前块的参考块也称为当前块的预测块,或当前块的初始预测块,或当前块的第一预测块等。也就是说,本申请实施例中当前块的参考块可以理解为未进行光照补偿的预测块。
在一些实施例中,在帧内预测中,编码端在当前图像(即当前帧)中确定当前块的参考块。
示例性的,图7中,带箭头的实线为当前块的块矢量信息BV。在编码端,当前块通过BV找到匹配的重建块作为当前块的参考块。
与帧间预测相同,IBC拥有两种模式,一个为AMVP(advanced motion vector predition,高级运动矢量预测)模式;另一个为skip/merge模式,即合并模式。
在一种示例中,在AMVP模式下,编码端构建MVP候选列表,并从中确定出一个最优的MVP,进而根据该选出的MVP确定运动估计的起始点,进而在该起始点附近进行搜索,得到当前块的参考块。
在一种示例中,在skip/merge模式下,编码端构建MVP候选列表,并从中确定出一个最优的MVP,将该选出的MVP作为当前点的MV,进而根据MV在当前图像中确定出当前块的参考块。
在一些实施例中,编码端还可以采用已有的其他方式,确定出当前块的参考块。
下面对编码端确定N组线性模型参数的具体过程进行介绍。
在本申请实施例中,若编码端确定当前块的预测模式为多模型帧内块复制光照补偿模式时,需要确定多组线性模型参数,进而从这多组线性模型参数中选出一组对当前块的参考块进行线性变化,得到当前块的预测值。
本申请实施例对每一组线性模型参数所包括的具体参数不做限制,例如可以为任意线性变化相关的参数。
在一种示例中,N组线性模型参数中的每一组线性模型参数包括缩放参数a和偏移参数b。需要说明的是,N组线性模型参数中,每一组所包括的参数不完全相同。
示例性的,本申请实施例的N组线性模型参数如表4所示。
编码端确定出表4所示的N组线性模型参数后,可以从上述表4所示的N组线性模型参数中选择一组线性模型参数,对当前块的参考块进行线性变化,以实现光照补偿,得到光照补偿后的参考块,进而将光照补偿后的参考块确定为当前块的预测块。
本申请实施例对编码端确定N组线性模型参数的具体方式不做限制。
在一些实施例中,上述N组线性模型参数为预设值或经验值。
在一些实施例中,编码端通过如下S202-A的步骤,确定N组线性模型参数:
S202-A、基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数。
在该实施例中,编码端确定参考块的周围已重建区域和当前块的周围已重建区域,进而基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数。
示例性的,参考块的周围已重建区域包括与参考块相邻的已重建区域和/或与参考块不相邻的已重建区域。对应的,当前块的周围已重建区域包括与当前块相邻的已重建区域和/或与当前块不相邻的已重建区域。
在本申请实施例中,编码端可以根据参考块的周围已重建区域的特征信息和当前块的周围已重建区域的特征信息,确定N组不同的线性模型参数。这N组不同的线性模型参数可以实现不同效果的光照补偿,进而编码端可以根据实际情况,从这N组光照补偿效果不同的线性模型参数中,选出目标光照补偿效果的一组线性模型参数,对当前块的参考块进行光照补偿,以提高光照补偿效果和预测效果,进而提升编码性能。
本申请实施例对编码端基于参考块的周围已重建区域和当前块的周围已重建区域,确定N组线性模型参数的具体方式不做限制。
在一些实施例中,编码端首先基于参考块的周围已重建区域和当前块的周围已重建区域,确定出一组线性模型参数。示例性的,根据参考块的周围已重建区域和当前块的周围已重建区域,确定出一组线性模型参数的过程可以参照上述公式(3)所示的方法进行。接着,对这一组线性模型参数进行调整,得到N组线性模型参数。
在一些实施例中,编码端将参考块的周围已重建区域划分为N个子区域,例如基于参考块的周围已重建区域的颜色信息、亮度信息、比特深度等特征信息,将参考块的周围已重建区域划分为N个第一子区域。对应的,按照参考块
的N个第一子区域,将当前块周围已重建区域也划分为N个第二子区域,其中一个第一子区域与一个第二子区域对应。这样可以根据N个第一子区域中的每一个第一子区域,根据该第一子区域和该第一子区域对应的第二子区域,确定一组线性模型参数。例如,根据第一子区域1和第二子区域1,确定一组线性模型参数1,根据第一子区域2和第二子区域2,确定一组线性模型参数2,依次类推,可以确定出N组线性模型参数。示例性的,根据第一子区域1和第二子区域1,确定一组线性模型参数1的过程可以参照上述公式(3)所示的方法进行。
在一些实施例中,上述S202-A包括如下S202-A1至S202-A3的步骤:
S202-A1、从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集;
S202-A2、将第一样本集和第二样本集划分为N组样本集,N组样本集中的任一组样本集包括至少一个第一样本和至少一个第二样本;
S202-A3、对于N组样本集中的第i组样本集,基于第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,i为小于或等于N的正整数。
在本申请实施例中,为了便于描述,将参考块的周围已重建区域所包括的样本(即已重建像素点)记为第一样本,将当前块的周围已重建区域所包括的样本(即已重建像素点)记为第二样本。
在该实施例中,编码端确定出参考块的周围已重建区域和当前块的周围已重建区域后,从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集,其中第一样本集包括至少一个第一样本,第二样本集中包括至少一个第二样本集。
本申请实施例对编码端从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集的具体方式不做限制。
例如,编码端按照预设的采集步长,从参考块的周围已重建区域中采集至少一个第一样本,组成第一样本集,以及按照预设的采集步长,从当前块的周围已重建区域中采集至少一个第二样本,组成第二样本集。
再例如,编码端将参考块的周围已重建区域所包括的所有第一样本,确定为第一样本集,以及将当前块的周围已重建区域所包括的所有第二样本,确定为第二样本集。
在一些实施例中,参考块的周围已重建区域包括参考块的模板区域,当前块的周围已重建区域包括当前块的模板区域,此时上述S202-A1包括如下S202-A1的步骤:
S202-A11、从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集。
在该实施例中,若上述参考块的周围已重建区域包括参考块的模板区域,当前块的周围已重建区域包括当前块的模板区域时,则编码端可以直接从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集。
编码端从参考块的模板区域中确定第一样本集,以及从当前块的模板区域中确定第二样本集的具体实现方式包括但不限于如下几种:
方式1、根据当前块的宽高大小,设定选取第一样本和第二样本的个数。
例如,若当前块的宽和高中存在等于预设值1(例如4)的情况,则从当前块的上侧模板和左侧模块中各取预设值1(例如4)个第二样本,组成第二样本集,该第二样本集包括8个第二样本。以及从参考块的上侧模板和左侧模块中各取预设值1(例如4)个第一样本,组成第一样本集,该第一样本集包括8个第一样本。
再例如,若当前块宽为预设值2(例如16),高为预设值3(例如为4),则从当前块的左侧模板取4个第二样本,从当前块的上侧模板以步长为预设值4(例如3)取预设值5(例如为4)个第二样本,组成第二样本集,该第二样本集包括8个第二样本。以及从参考块的左侧模板取4个第一样本,从参考块的上侧模板以步长为预设值4(例如3)取预设值5(例如为4)个第一样本,组成第一样本集,该第一样本集包括8个第一样本。
再例如,若当前块宽和高均不存在等于预设值1(例如4)的情况,则从当前块的上侧模板和左侧模板所包括的重建样本中,获取以较小边长的2的对数个数的第二样本,组成第二样本集。以及从参考块的上侧模板和左侧模板所包括的重建样本中,获取以较小边长的2的对数个数的第一样本,组成第一样本集。
示例性的,上述的上侧模板包括一行样本行,左侧模板包括一列样本列。
方式2、编码端按照第一采样步长,在参考块的模板区域中进行采样,得到第一样本集;按照第一采样步长,在当前块的模板区域中进行采样,得到第二样本集,其中第一采样步长小于预设采样步长。
在该方式2中,编码端可以通过减小采样步长,以增加参与线性模型参数计算的样本数量,以提高线性模型参数的计算准确性。
例如,编码端按照第一采样步长,在参考块的模板区域中进行采样,得到第一样本集;按照第一采样步长,在当前块的模板区域中进行采样,得到第二样本集,该第一采样步长小于预设采样步长。
示例性的,第一采样步长小于3。
方式3,编码端将参考块的模板区域所包括的所有样本,确定为第一样本集;将当前块的模板区域所包括的所有样本,确定为第二样本集。
在方式3中,可以将参考块的模板区域所包括的所有样本,确定为第一样本集,以及将当前块的模板区域所包括的所有样本,确定为第二样本集,以增加参与线性模型参数计算的样本数量,以提高线性模型参数的计算准确性。
本申请实施例对参考块的模板区域和当前块的模板区域的具体大小不做限制。
在一些实施例中,如图12所示,参考块的模板区域包括参考块的上侧模板区域和/或参考块的左侧模板区域,当前块的模板区域包括当前块的上侧模板区域和/或当前块的左侧模板区域。
在一些实施例中,为了增加参与线性模型参数计算的样本数量,则可以扩大模板区域。
在一种示例中,将上侧模板进行扩展,例如图13所示,参考块的左侧模板区域包括参考块的左方模板区域和左下方模板区域,当前块的左侧模板区域包括当前块的左方模板区域和左下方模板区域。
在一种示例中,将左侧模板进行扩展,例如图14所示,参考块的上侧模板区域所包括的样本行数大于或等于预设行数,当前块的上侧模板区域所包括的样本行数大于或等于预设行数。
这样,本申请实施例在选择样本时,可以从图13和图14所示的参考块的上侧模板和/或左侧模板中确定出第一样本集,图13和图14所示的从当前块的上侧模板和/或左侧模板中确定出第二样本集,以增加第一样本集个第二样本集中的样本数量。
在一些实施例中,编码端还可以增加上侧模板的行数实现模板扩展。例如参考块的上侧模板区域所包括的样本行数大于或等于预设行数,当前块的上侧模板区域所包括的样本行数大于或等于预设行数。示例性的,该预设行数可以为2、3、4、5等。
在一些实施例中,编码端还可以增加左侧模板的列数实现模板扩展。例如参考块的左侧模板区域所包括的样本列数大于或等于预设列数,当前块的左侧模板区域所包括的样本列数大于或等于预设列数。示例性的,该预设列数可以为2、3、4、5等。
编码端通过上述步骤,从参考块的周围已重建区域中确定第一样本集,并从当前块的周围已重建区域中确定第二样本集后,执行上述S202-A2的步骤。
本申请实施例对编码端将第一样本集和第二样本集划分为N组样本集的具体方式不做限制。
在一些实施例中,编码端根据第一样本集和第二样本集中各第一样本和第二样本的颜色信息、亮度信息和比特深度等特征信息,将第一样本集和第二样本集划分为N组样本集,这N组样本集中的每一组样本集包括至少一个第一样本和至少一个第二样本。例如,将第一样本集和第二样本集中,颜色信息、亮度信息等特征信息相近的第一样本和第二样本,划分到一组样本集中。
在一些实施例中,上述S202-A2包括如下步骤:
S202-A21、将第一样本集所包括的第一样本划分为N类第一样本;
S202-A22、将第二样本集所包括的第二样本划分为N类第二样本;
S202-A23、基于N类第一样本和N类第二样本,得到N组样本集。
在该实施例中,编码端首先将第一样本集所包括的第一样本划分为N类第一样本,同时,将第二样本集所包括的第二样本划分为N类第二样本。其中N类第一样本中每一类第一样本至少包括一个第一样本,N类第二样本中的每一个第二样本至少包括一个第二样本。
本申请实施例对编码端将第一样本集所包括的第一样本划分为N类第一样本的具体方式不做限制。
在一些实施例中,编码端根据第一样本集中各第一样本的特征信息,对第一样本进行分类,得到N类第一样本。
在一些实施例中,上述S202-A21包括如下S202-A21-a1和S202-A21-a2的步骤:
S202-A21-a1、确定第一样本集的第一样本均值;
S202-A21-a2、基于第一样本均值,将第一样本集划分为N类第一样本。
在该实施例中,编码端根据样本均值,对第一样本集所包括的第一样本进行分类。
具体的,编码端首先根据第一样本集中各第一样本的重建值,确定该第一样本集的样本均值,为了便于描述,将该样本均值记为第一样本均值。接着,根据该第一样本均值,将第一样本集所包括的第一样本划分为N类第一样本。
例如,将第一样本集中大于或等于第一样本均值的第一样本,划分为第一类第一样本;将第一样本集中小于或等于第一样本均值的第一样本,划分为第二类第一样本。
再例如,将第一样本集中与第一样本均值之间的差值在阈值c和阈值d之间的第一样本,划分为第一类第一样本。将第一样本集中与第一样本均值之间的差值小于阈值c的第一样本,划分为第二类第一样本。将第一样本集中与第一样本均值之间的差值大于阈值d的第一样本,划分为第三类第一样本。
在一些实施例中,上述上述S202-A21包括如下S202-A21-b的步骤:
S202-A21-b、基于第一样本集中第一样本的比特深度,将第一样本集划分为N类第一样本。
在该实施例中,编码端根据第一样本集中各第一样本的比特深度,将第一样本集划分为N类第一样本。
在一种示例中,按照比特深度的大小,将第一样本集中的各第一样本划分为2类、3类或4类第一样本,每一类第一样本中的各第一样本的比特深度接近。
在另一种示例中,编码端确定第一样本集的第一比特深度均值;基于第一比特深度均值,将第一样本集划分为N类第一样本。
例如,将第一样本集中比特深度大于或等于第一比特深度均值的第一样本,划分为第一类第一样本;将第一样本集中比特深度小于或等于第一比特深度均值的第一样本,划分为第二类第一样本。
再例如,将第一样本集中比特深度与第一比特深度均值之间的差值在阈值e和阈值f之间的第一样本,划分为第一类第一样本。将第一样本集中比特深度与第一比特深度均值之间的差值小于阈值e的第一样本,划分为第二类第一样本。将第一样本集中比特深度与第一比特深度均值之间的差值大于阈值f的第一样本,划分为第三类第一样本。
编码端基于上述步骤,将第一样本集中的第一样本划分为N类第一样本后,将第二样本集中的第二样本也划分为N类第二样本。
本申请实施例对编码端将第二样本集所包括的第二样本划分为N类第二样本的具体方式不做限制。
在一些实施例中,编码端可以采用与划分N类第一样本相同的方式,将第二样本集所包括的第二样本划分为N类第二样本。
在一些实施例中,编码端通过如下步骤,将第二样本集所包括的第二样本划分为N类第二样本,即上述S202-A22包括如下步骤:
S202-A221、对于N类第一样本中的第j类第一样本,将第二样本集中第j类第一样本对应的第二样本,确定为第j类第二样本,j为小于或等于N的正整数。
编码端基于上述步骤,将第一样本集中的第一样本划分为N类第一样本,针对N类第一样本中的第j类第一样本,编码端将第二样本集中该第j类第一样本对应的第二样本,确定为第j类第二样本,其中j为小于或等于N的正整数。
例如,编码端将第一样本集中大于或等于第一样本均值的第一样本划分为第一类第一样本,对应的,将第二样本集中与第一类第一样本对应位置上的第二样本划分为第一类第二样本。编码端将第一样本集中小于第一样本均值的第一样本划分为第二类第一样本,对应的,将第二样本集中与第二类第一样本对应位置上的第二样本划分为第二类第二样本。
由上述可知,编码端对第一样本集划分得到的N类第一样本,与对第二样本集划分得到的N类第二样本一一对应的,例如第一类第一样本与第一类第二样本对应,第二类第一样本与第二类第二样本对应。因此,编码端可以将N类第一样本第j类第一样本和N类第二样本中第j类第二样本,确定为第j组样本集,这样N类第一样本和N类第二样本,组成N组样本集。
编码端基于上述步骤,将第一样本集和第二样本集划分为N组样本集后,执行上述S202-A3的步骤。
在本申请实施例中,编码端基于N组样本集中的每一组样本集,确定一组线性模型参数,进而得到N组线性模型参数。
在本申请实施例中,基于N组样本集中的每一组样本集,确定每一组线性模型参数的具体过程一致,为了便于描述,在此以基于第i组样本集,确定第i组线性模型参数为例进行说明。
本申请实施例对上述S202-A3中基于第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数的具体方式不做限制。
在一种示例中,确定第i组样本集所包括的第一样本和第二样本之间的线性关系,进而确定出第i组线性模型参数。由于第i组样本集所包括的第一样本和第二样本均已知,因此可以通过求解线性方程的方式,确定出第i组样本集对应的缩放系数a和偏移参数b,进而得到第i组线性模型参数。
在一种示例中,将第i组样本集中的第一样本相加,得到第一和值,并将第i组样本集中的第二样本相加,得到第二和值;确定第i组样本集中的第一样本的平方和,得到第三和值;将第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数。
在该示例中,将第i组样本集中的第一样本xi相加,得到第一和值sumXi,将第i组样本集中的第二样本yi相加,得到第二和值sumYi,确定第i组样本集中的第一样本xi的平方和,得到第三和值sumXiXi,将第i组样本集中的第一样本xi和第二样本yi相乘后再相加,得到第四和值sumXiYi,进而根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数。
本申请实施例对编码端根据第一和值、第二和值、第三和值和第四和值,确定第i组线性模型参数的具体方式不做限制。
在一些实施例中,第i组线性模型参数包括缩放系数ai和偏移参数bi。
示例性的,编码端通过如下公式(4),确定出第i组线性模型参数。
上述以基于第i组样本集,确定第i组线性模型参数的过程进行介绍。编码端可以参照上述方法,基于N组样本集,确定出N组线性模型参数。
在一些实施例中,编码端可以将确定的N组线性模型参数写入码流,这样解码端可以通过解码码流,得到N组线性模型参数。
编码端基于上述步骤,确定出N组线性模型参数后,执行如下S203的步骤。
S203、从N组线性模型参数中选择目标组线性模型参数,并使用目标组线性模型参数对参考块进行线性变化,得到当前块的预测块。
在本申请实施例中,若编码端确定当前块的预测模式为多模型帧内块复制光照补偿模式时,则编码端确定当前块的参考块,并确定N组线性模型参数。接着,编码端从这N组线性模型参数中选择一个目标线性模型参数,并使用该目标线性模型参数,对当前块的参考块进行线性变化,提高对参考块的光照补偿效果,进而提升预测效果和编码性能。
本申请实施例对编码端从N组线性模型参数中选择目标组线性模型参数的具体方式不做限制。
在一些实施例中,编码端采用如下步骤,从N组线性模型参数中选择目标组线性模型参数:
S203-A1、确定参考块的第二样本均值;
S203-A2、基于第二样本均值,从N组线性模型参数中,选择目标组线性模型参数。
该实施例的方法,与上述S202-A21-a1和S202-A21-a2的方法对应的。
由上述S202-A21-a1和S202-A21-a2可知,编码端在确定N组线性模型参数时,基于第一样本均值,将第一样本集所包括的第一样本划分为N类第一样本,以及根据N类第一样本的位置信息将第二样本集所包括的第二样本划分为N类第二样本,得到N组样本集。最终根据这N组样本集,确定出N组线性模型参数。基于此,编码端在从这N组线性模型参数中选择目标线性模型参数时,确定当前块的参考块的样本均值,即参考块所包括的重建像素值的均值,将该均值记为第二样本均值。这样可以根据该第二样本均值,从N组线性模型参数中,选择目标组线性模型参数。
本申请实施例对编码端基于第二样本均值,从N组线性模型参数中,选择目标组线性模型参数的具体方式不做限制。
在一种可能的实现方式中,编码端将第二样本均值与N组线性模型参数对应的N组样本集中的样本值进行比较,选择与第二样本均值最接近的一组样本集对应的一组线性模型参数,确定为目标组线性模型参数。例如,第二样本均值与N组样本集中的第k组样本集所包括的第一样本和第二样本最接近(即距离最小),进而将N组线性模型参数中第k组样本集对应的一组线性模型参数,确定为目标组线性模型参数。
在一种可能的实现方式中,编码端基于第二样本均值和第一样本均值,从N组线性模型参数中,选择目标组线性模型参数。
由上述S202-A21-a1和S202-A21-a2可知,在一些实施例中,编码端在将第一样本集和第二样本集划分为N组样
本集时,将第一样本集中大于或等于第一样本均值的第一样本,划分为第一类第一样本;将第一样本集中小于或等于第一样本均值的第一样本,划分为第二类第一样本。进而根据N组样本集,确定N组线性模型参数。基于此,编码端可以基于第二样本均值和第一样本均值的大小,从N组线性模型参数中,选择目标组线性模型参数。
例如,若第二样本均值大于或等于第一样本均值,则将N组线性模型参数中第一类第一样本对应的一组线性模型参数,确定为目标组线性模型参数;
再例如,若第二样本均值小于或等于第一样本均值,则将N组线性模型参数中第二类第一样本对应的一组线性模型参数,确定为目标组线性模型参数。
在一些实施例中,编码端采用如下步骤,从N组线性模型参数中选择目标组线性模型参数:
S203-B1、确定参考块的第二比特深度均值;
S203-B2、基于第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
该实施例的方法,与上述S202-A21-b1和S202-A21-b2的方法对应的。
由上述S202-A21-b1和S202-A21-b2可知,编码端在确定N组线性模型参数时,基于第一比特深度均值,将第一样本集所包括的第一样本划分为N类第一样本,以及根据N类第一样本的位置信息,将第二样本集所包括的第二样本划分为N类第二样本,进而得到N组样本集。最终根据这N组样本集,确定出N组线性模型参数。基于此,编码端在从这N组线性模型参数中选择目标线性模型参数时,确定当前块的参考块的比特深度均值,即参考块所包括的重建像素值的比特深度的均值,将该均值记为第二比特深度均值。这样可以根据该第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
本申请实施例对编码端基于第二比特深度均值,从N组线性模型参数中,选择目标组线性模型参数的具体方式不做限制。
在一种可能的实现方式中,编码端将第二比特深度均值与N组线性模型参数对应的N组样本集中的样本的比特深度进行比较,选择与第二比特深度均值最接近的一组样本集对应的一组线性模型参数,确定为目标组线性模型参数。例如,第二比特深度均值与N组样本集中的第k组样本集所包括的第一样本和第二样本的比特深度最接近,进而将N组线性模型参数中第k组样本集对应的一组线性模型参数,确定为目标组线性模型参数。
在一种可能的实现方式中,编码端基于第二比特深度均值和第一比特深度均值,从N组线性模型参数中,选择目标组线性模型参数。
由上述S202-A21-b1和S202-A21-b2可知,在一些实施例中,编码端在将第一样本集和第二样本集划分为N组样本集时,将第一样本集中比特深度大于或等于第一比特深度均值的第一样本,划分为第一类第一样本;将第一样本集中比特深度小于或等于第一比特深度均值的第一样本,划分为第二类第一样本。进而根据N组样本集,确定N组线性模型参数。基于此,编码端可以基于第二比特深度均值和第一比特深度均值的大小,从N组线性模型参数中,选择目标组线性模型参数。
例如,若第二比特深度均值大于或等于第一比特深度均值,则将N组线性模型参数中第一类第一样本对应的一组线性模型参数,确定为目标组线性模型参数;
再例如,若第二比特深度均值小于或等于第一比特深度均值,则将N组线性模型参数中第二类第一样本对应的一组线性模型参数,确定为目标组线性模型参数。
编码端基于上述步骤,从N组线性模型参数中,确定出目标组线性模型参数后,使用该目标组线性模型参数,当前块的参考块进行线性变换。
例如,目标线性模型参数包括缩放参数a1和偏移参数b1,则编码端基于该缩放参数和偏移参数,对参考块进行线性变化,得到预测块。
示例性的,编码端基于上述公式(5),对当前块的参考块进行线性变化。
本申请实施例提供的视频编码方法,提出了一种多模型帧内块复制光照补偿模式,以增加帧内块复制光照补偿的模式,这样编码端可以根据当前块的具体情况,选择使用单模型帧内块复制光照补偿模式(即只有一组模型参数)进行预测补偿,还是使用多模型帧内块复制光照补偿模式(即包括多组模型参数)进行预测补偿。若选择多模型帧内块复制光照补偿模式对当前块进行预测补偿时,确定N组线性模型参数,并从这N组线性模型参数中选出目标线性模型参数,进而使用该目标模型参数对当前块的参考块进行线性变化,得到当前块的预测块,提高了光照补偿效果,进而提升预测准确性和编码性能。
应理解,图11至图15仅为本申请的示例,不应理解为对本申请的限制。
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中字符“/”,一般表示前后关联对象是一种“或”的关系。
上文结合图11至图15,详细描述了本申请的方法实施例,下文结合图16至图17,详细描述本申请的装置实施例。
图16是本申请一实施例提供的视频编码装置的示意性框图,该视频编码装置10应用于上述视频编码器。
如图16所示,视频编码装置10包括:
模式确定单元11,用于确定当前块的预测模式;
参数确定单元12,用于若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;
变化单元13,用于从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
在一些实施例中,参数确定单元12,具体用于基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数。
在一些实施例中,参数确定单元12,具体用于从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集;将所述第一样本集和所述第二样本集划分为N组样本集,所述N组样本集中的任一组样本集包括至少一个第一样本和至少一个第二样本;对于所述N组样本集中的第i组样本集,基于所述第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,所述i为小于或等于N的正整数。
在一些实施例中,所述参考块的周围已重建区域包括所述参考块的模板区域,所述当前块的周围已重建区域包括所述当前块的模板区域,参数确定单元12,具体用于从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集。
在一些实施例中,参数确定单元12,具体用于按照第一采样步长,在所述参考块的模板区域中进行采样,得到所述第一样本集,所述第一采样步长小于预设采样步长;按照所述第一采样步长,在所述当前块的模板区域中进行采样,得到所述第二样本集。
在一些实施例中,参数确定单元12,具体用于将所述参考块的模板区域所包括的所有样本,确定为所述第一样本集;将所述当前块的模板区域所包括的所有样本,确定为所述第二样本集。
在一些实施例中,所述参考块的模板区域包括所述参考块的上侧模板区域和/或所述参考块的左侧模板区域,所述当前块的模板区域包括所述当前块的上侧模板区域和/或所述当前块的左侧模板区域。
在一些实施例中,所述参考块的上侧模板区域包括所述参考块的上方模板区域和右上方模板区域,所述当前块的上侧模板区域包括所述当前块的上方模板区域和右上方模板区域。
在一些实施例中,所述参考块的左侧模板区域包括所述参考块的左方模板区域和左下方模板区域,所述当前块的左侧模板区域包括所述当前块的左方模板区域和左下方模板区域。
在一些实施例中,所述参考块的上侧模板区域所包括的样本行数大于或等于预设行数,所述当前块的上侧模板区域所包括的样本行数大于或等于所述预设行数。
在一些实施例中,所述参考块的左侧模板区域所包括的样本列数大于或等于预设列数,所述当前块的左侧模板区域所包括的样本列数大于或等于所述预设列数。
在一些实施例中,参数确定单元12,具体用于将所述第一样本集所包括的第一样本划分为N类第一样本;将所述第二样本集所包括的第二样本划分为N类第二样本;基于所述N类第一样本和所述N类第二样本,得到所述N组样本集。
在一些实施例中,参数确定单元12,具体用于确定所述第一样本集的第一样本均值;基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元12,具体用于将所述第一样本集中大于或等于所述第一样本均值的第一样本,划分为第一类第一样本;将所述第一样本集中小于或等于所述第一样本均值的第一样本,划分为第二类第一样本。
在一些实施例中,参数确定单元12,具体用于基于所述第一样本集中第一样本的比特深度,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元12,具体用于确定所述第一样本集的第一比特深度均值;基于所述第一比特深度均值,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元12,具体用于将所述第一样本集中比特深度大于或等于所述第一比特深度均值的第一样本,划分为第一类第一样本;将所述第一样本集中比特深度小于或等于所述第一比特深度均值的第一样本,划分为第二类第一样本。
在一些实施例中,参数确定单元12,具体用于对于所述N类第一样本中的第j类第一样本,将所述第二样本集中所述第j类第一样本对应的第二样本,确定为第j类第二样本,所述j为小于或等于N的正整数。
在一些实施例中,参数确定单元12,具体用于将所述第j类第一样本和所述第j类第二样本,确定为所述第j组样本集。
在一些实施例中,参数确定单元12,具体用于将所述第i组样本集中的第一样本相加,得到第一和值,并将所述第i组样本集中的第二样本相加,得到第二和值;确定所述第i组样本集中的第一样本的平方和,得到第三和值;将所述第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据所述第一和值、所述第二和值、所述第三和值和所述第四和值,确定所述第i组线性模型参数。
在一些实施例中,变化单元13,具体用于确定所述参考块的第二样本均值;基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元13,具体用于基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元13,具体用于若所述第二样本均值大于或等于所述第一样本均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二样本均值小于或等于所述第一样本均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
在一些实施例中,变化单元13,具体用于确定所述参考块的第二比特深度均值;基于所述第二比特深度均值,
从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元13,具体用于基于所述第二比特深度均值和所述第一比特深度均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元13,具体用于若所述第二比特深度均值大于或等于所述第一比特深度均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二比特深度均值小于或等于所述第一比特深度均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
在一些实施例中,模式确定单元11,具体用于解码码流,得到第一信息,所述第一信息用于指示所述当前块的预测类型;基于所述第一信息,确定所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第一信息指示所述当前块的预测类型为帧内块复制预测时,则解码所述码流,得到第一标志,所述第一标志用于指示所述当前块是否使用merge模式;基于所述第一标志,确定所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第一标志指示所述当前块不使用所述merge模式时,则解码所述码流,得到第二信息,所述第二信息用于指示所述当前块是否使用帧内块复制光照补偿模式;基于所述第二信息,确定所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,则解码码流,得到索引信息,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引;基于所述索引信息,确定所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述索引信息的取值为第一数值时,则确定所述当前块的预测模式为单模型帧内块复制光照补偿模式;若所述索引标志的取值为第二数值时,则确定所述当前块的预测模式为所述多模型帧内块复制光照补偿模式。
在一些实施例中,模式确定单元11,具体用于若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,且所述当前块的大小大于或等于第二预设大小时,则将所述多模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
在一些实施例中,所述第二信息还用于指示所述帧内块复制光照补偿模式的模式索引,模式确定单元11,具体用于基于所述第二信息的取值,确定所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第二信息的取值为第一数值时,则确定所述当前块的预测模式为非帧内块复制光照补偿模式;若所述第二信息的取值为第二数值时,则确定所述当前块的预测模式为单模型帧内块复制光照补偿模式;若所述第二信息的取值为第三数值时,则确定所述当前块的预测模式为所述多模型帧内块复制光照补偿模式。
在一些实施例中,模式确定单元11,解码所述码流,得到第二信息之前,还用于确定所述当前块的大小是否满足第一预设大小;若所述当前块的大小满足所述第一预设大小时,则解码所述码流,得到所述第二信息。
在一些实施例中,模式确定单元11,解码所述码流,得到第二信息之前,还用于解码所述码流,得到第三信息,所述第三信息用于指示所述当前块是否采用第一工具进行解码,所述第一工具与帧内块复制光照补偿技术互斥;若所述第三信息指示所述当前块不采用第一工具进行解码时,则解码所述码流,得到所述第二信息。
在一些实施例中,模式确定单元11,具体用于若所述第一标志指示所述当前块使用所述merge模式时,则将所述参考块的预测模式,确定为所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第一标志指示所述当前块使用所述merge模式时,则将单模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
在一些实施例中,模式确定单元11,具体用于若所述第一标志指示所述当前块使用所述merge模式时,则解码码流,得到第四信息,所述第四信息用于指示所述所述当前块的预测模式;基于所述第四信息,得到所述当前块的预测模式。
在一些实施例中,模式确定单元11,解码码流,得到第一标志之前,还用于解码所述码流,得到第三标志,所述第三标志用于指示当前序列是否允许局部光照补偿;若所述第三标志指示所述当前序列允许局部光照补偿时,则解码所述码流,得到所述第一标志。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图16所示的装置10可以执行本申请实施例的解码端的解码方法,并且装置10中的各个单元的前述和其它操作和/或功能分别为了实现上述解码端的解码方法等各个方法中的相应流程,为了简洁,在此不再赘述。
图17是本申请一实施例提供的视频编码装置的示意性框图,该视频编码装置应用于上述编码器。
如图17所示,该视频编码装置20可以包括:
模式预测单元21,用于确定当前块的预测模式;
参数确定单元22,用于若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;
变化单元23,用于从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
在一些实施例中,参数确定单元22,具体用于基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数。
在一些实施例中,参数确定单元22,具体用于从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集;将所述第一样本集和所述第二样本集划分为N组样本集,所述N组样本
集中的任一组样本集包括至少一个第一样本和至少一个第二样本;对于所述N组样本集中的第i组样本集,基于所述第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,所述i为小于或等于N的正整数。
在一些实施例中,所述参考块的周围已重建区域包括所述参考块的模板区域,所述当前块的周围已重建区域包括所述当前块的模板区域,参数确定单元22,具体用于从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集。
在一些实施例中,参数确定单元22,具体用于按照第一采样步长,在所述参考块的模板区域中进行采样,得到所述第一样本集,所述第一采样步长小于预设采样步长;按照所述第一采样步长,在所述当前块的模板区域中进行采样,得到所述第二样本集。
在一些实施例中,参数确定单元22,具体用于将所述参考块的模板区域所包括的所有样本,确定为所述第一样本集;将所述当前块的模板区域所包括的所有样本,确定为所述第二样本集。
在一些实施例中,所述参考块的模板区域包括所述参考块的上侧模板区域和/或所述参考块的左侧模板区域,所述当前块的模板区域包括所述当前块的上侧模板区域和/或所述当前块的左侧模板区域。
在一些实施例中,所述参考块的上侧模板区域包括所述参考块的上方模板区域和右上方模板区域,所述当前块的上侧模板区域包括所述当前块的上方模板区域和右上方模板区域。
在一些实施例中,所述参考块的左侧模板区域包括所述参考块的左方模板区域和左下方模板区域,所述当前块的左侧模板区域包括所述当前块的左方模板区域和左下方模板区域。
在一些实施例中,所述参考块的上侧模板区域所包括的样本行数大于或等于预设行数,所述当前块的上侧模板区域所包括的样本行数大于或等于所述预设行数。
在一些实施例中,所述参考块的左侧模板区域所包括的样本列数大于或等于预设列数,所述当前块的左侧模板区域所包括的样本列数大于或等于所述预设列数。
在一些实施例中,参数确定单元22,具体用于将所述第一样本集所包括的第一样本划分为N类第一样本;将所述第二样本集所包括的第二样本划分为N类第二样本;基于所述N类第一样本和所述N类第二样本,得到所述N组样本集。
在一些实施例中,参数确定单元22,具体用于确定所述第一样本集的第一样本均值;基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元22,具体用于将所述第一样本集中大于或等于所述第一样本均值的第一样本,划分为第一类第一样本;将所述第一样本集中小于或等于所述第一样本均值的第一样本,划分为第二类第一样本。
在一些实施例中,参数确定单元22,具体用于基于所述第一样本集中第一样本的比特深度,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元22,具体用于确定所述第一样本集的第一比特深度均值;基于所述第一比特深度均值,将所述第一样本集划分为所述N类第一样本。
在一些实施例中,参数确定单元22,具体用于将所述第一样本集中比特深度大于或等于所述第一比特深度均值的第一样本,划分为第一类第一样本;将所述第一样本集中比特深度小于或等于所述第一比特深度均值的第一样本,划分为第二类第一样本。
在一些实施例中,参数确定单元22,具体用于对于所述N类第一样本中的第j类第一样本,将所述第二样本集中所述第j类第一样本对应的第二样本,确定为第j类第二样本,所述j为小于或等于N的正整数。
在一些实施例中,参数确定单元22,具体用于将所述第j类第一样本和所述第j类第二样本,确定为所述第j组样本集。
在一些实施例中,参数确定单元22,具体用于将所述第i组样本集中的第一样本相加,得到第一和值,并将所述第i组样本集中的第二样本相加,得到第二和值;确定所述第i组样本集中的第一样本的平方和,得到第三和值;将所述第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据所述第一和值、所述第二和值、所述第三和值和所述第四和值,确定所述第i组线性模型参数。
在一些实施例中,变化单元23,具体用于确定所述参考块的第二样本均值;基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元23,具体用于基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元23,具体用于若所述第二样本均值大于或等于所述第一样本均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二样本均值小于或等于所述第一样本均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
在一些实施例中,变化单元23,具体用于确定所述参考块的第二比特深度均值;基于所述第二比特深度均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元23,具体用于基于所述第二比特深度均值和所述第一比特深度均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
在一些实施例中,变化单元23,具体用于若所述第二比特深度均值大于或等于所述第一比特深度均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二比特深度均值小于或等于所述第一比特深度均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
在一些实施例中,模式确定单元21,具体用于确定所述当前块对应的候选预测模式列表,所述候选预测模式中包括所述多模型帧内块复制光照补偿模式;确定使用所述候选预测模式列表中各候选预测模式对所述当前块进行预测
时的代价;根据所述代价,确定所述当前块的预测模式。
在一些实施例中,所述确定所述当前块对应的候选预测模式列表之前,模式确定单元21,还用于确定所述当前块的大小是否满足第一预设大小;若所述当前块的大小满足所述第一预设大小时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
在一些实施例中,所述确定所述当前块对应的候选预测模式列表之前,模式确定单元21,还用于确定所述当前块是否采用第一工具进行编码,所述第一工具与帧内块复制光照补偿技术互斥;若确定所述当前块不采用第一工具进行编码时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
在一些实施例中,模式确定单元21,还用于确定所述当前块的预测类型,并在码流中写入第一信息,所述第一信息用于指示所述当前块的预测类型。
在一些实施例中,模式确定单元21,还用于若所述当前块的预测类型为帧内块复制预测时,则将第一标志写入所述码流,所述第一标志用于指示所述当前块是否使用merge模式。
在一些实施例中,模式确定单元21,还用于若所述当前块不使用所述merge模式时,则将第二信息写入所述码流,所述第二信息用于指示所述当前块是否使用帧内块复制光照补偿模式。
在一些实施例中,模式确定单元21,还用于若所述当前块使用所述帧内块复制光照补偿模式,则将索引信息写入所述码流,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引。
在一些实施例中,模式确定单元21,还用于若所述当前块的预测模式为单模型帧内块复制光照补偿模式,则确定所述索引信息的取值为第一数值;若所述当前块的预测模式为所述多模型帧内块复制光照补偿模式,则确定所述索引标志的取值为第二数值。
在一些实施例中,模式确定单元21,具体用于若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,且所述当前块的大小大于或等于第二预设大小时,则将所述多模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
在一些实施例中,所述第二信息还用于指示所述帧内块复制光照补偿模式的模式索引,模式确定单元21,还用于若所述当前块的预测模式为非帧内块复制光照补偿模式,则确定所述第二信息的取值为第一数值;若所述当前块的预测模式为单模型帧内块复制光照补偿模式,则确定所述第二信息的取值为第二数值;若所述当前块的预测模式为所述多模型帧内块复制光照补偿模式,则确定所述第二信息的取值为第三数值。
在一些实施例中,模式确定单元21,具体用于若所述当前块使用所述merge模式时,则将所述参考块的预测模式,确定为所述当前块的预测模式。
在一些实施例中,模式确定单元21,具体用于若所述当前块使用所述merge模式时,则将单模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
在一些实施例中,确定所述当前块对应的候选预测模式列表之前,模式确定单元21,还用于确定第三标志,所述第三标志用于指示当前序列是否允许局部光照补偿;若所述所述第三标志用于指示当前序列允许局部光照补偿时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
在一些实施例中,模式确定单元21,还用于将所述第三标志写入码流,所述第三标志用于指示当前序列是否允许局部光照补偿。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图17所示的装置20可以对应于执行本申请实施例的编码端的编码方法中的相应主体,并且装置20中的各个单元的前述和其它操作和/或功能分别为了实现编码端的编码方法等各个方法中的相应流程,为了简洁,在此不再赘述。
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。
图18是本申请实施例提供的电子设备的示意性框图。
如图18所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频编码器,该电子设备30可包括:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34,以实现本申请实施例中的方法。
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法200中的步骤。
在本申请的一些实施例中,该处理器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中的执行过程。
如图18所示,该电子设备30还可包括:
收发器33,该收发器33可连接至该处理器32或存储器33。
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
图19是本申请实施例提供的视频编解码系统的示意性框图。
如图19所示,该视频编解码系统40可包括:视频编码器41和视频编码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频编码器42用于执行本申请实施例涉及的视频编码方法。
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。
本申请还提供了一种码流,该码流是根据上述编码方法生成的。
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本申请中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。
Claims (73)
- 一种视频解码方法,其特征在于,包括:确定当前块的预测模式;若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
- 根据权利要求1所述的方法,其特征在于,所述确定N组线性模型参数,包括:基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数。
- 根据权利要求2所述的方法,其特征在于,所述基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数,包括:从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集;将所述第一样本集和所述第二样本集划分为N组样本集,所述N组样本集中的任一组样本集包括至少一个第一样本和至少一个第二样本;对于所述N组样本集中的第i组样本集,基于所述第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,所述i为小于或等于N的正整数。
- 根据权利要求3所述的方法,其特征在于,所述参考块的周围已重建区域包括所述参考块的模板区域,所述当前块的周围已重建区域包括所述当前块的模板区域,所述从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集,包括:从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集。
- 根据权利要求4所述的方法,其特征在于,所述从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集,包括:按照第一采样步长,在所述参考块的模板区域中进行采样,得到所述第一样本集,所述第一采样步长小于预设采样步长;按照所述第一采样步长,在所述当前块的模板区域中进行采样,得到所述第二样本集。
- 根据权利要求4所述的方法,其特征在于,所述从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集,包括:将所述参考块的模板区域所包括的所有样本,确定为所述第一样本集;将所述当前块的模板区域所包括的所有样本,确定为所述第二样本集。
- 根据权利要求4所述的方法,其特征在于,所述参考块的模板区域包括所述参考块的上侧模板区域和/或所述参考块的左侧模板区域,所述当前块的模板区域包括所述当前块的上侧模板区域和/或所述当前块的左侧模板区域。
- 根据权利要求7所述的方法,其特征在于,所述参考块的上侧模板区域包括所述参考块的上方模板区域和右上方模板区域,所述当前块的上侧模板区域包括所述当前块的上方模板区域和右上方模板区域。
- 根据权利要求7所述的方法,其特征在于,所述参考块的左侧模板区域包括所述参考块的左方模板区域和左下方模板区域,所述当前块的左侧模板区域包括所述当前块的左方模板区域和左下方模板区域。
- 根据权利要求7所述的方法,其特征在于,所述参考块的上侧模板区域所包括的样本行数大于或等于预设行数,所述当前块的上侧模板区域所包括的样本行数大于或等于所述预设行数。
- 根据权利要求7所述的方法,其特征在于,所述参考块的左侧模板区域所包括的样本列数大于或等于预设列数,所述当前块的左侧模板区域所包括的样本列数大于或等于所述预设列数。
- 根据权利要求3所述的方法,其特征在于,所述将所述第一样本集和所述第二样本集划分为N组样本集,包括:将所述第一样本集所包括的第一样本划分为N类第一样本;将所述第二样本集所包括的第二样本划分为N类第二样本;基于所述N类第一样本和所述N类第二样本,得到所述N组样本集。
- 根据权利要求12所述的方法,其特征在于,所述将所述第一样本集所包括的第一样本划分为N类第一样本,包括:确定所述第一样本集的第一样本均值;基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本。
- 根据权利要求13所述的方法,其特征在于,所述基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本,包括:将所述第一样本集中大于或等于所述第一样本均值的第一样本,划分为第一类第一样本;将所述第一样本集中小于或等于所述第一样本均值的第一样本,划分为第二类第一样本。
- 根据权利要求12所述的方法,其特征在于,所述将所述第二样本集所包括的第二样本划分为N类第二样本,包括:对于所述N类第一样本中的第j类第一样本,将所述第二样本集中所述第j类第一样本对应的第二样本,确定为第j类第二样本,所述j为小于或等于N的正整数。
- 根据权利要求15所述的方法,其特征在于,所述基于所述N类第一样本和所述N类第二样本,得到所述N组样本集,包括:将所述第j类第一样本和所述第j类第二样本,确定为所述第j组样本集。
- 根据权利要求3所述的方法,其特征在于,所述基于所述第i组样本集所包括的第一样本和第二样本,确定 第i组线性模型参数,包括:将所述第i组样本集中的第一样本相加,得到第一和值,并将所述第i组样本集中的第二样本相加,得到第二和值;确定所述第i组样本集中的第一样本的平方和,得到第三和值;将所述第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据所述第一和值、所述第二和值、所述第三和值和所述第四和值,确定所述第i组线性模型参数。
- 根据权利要求14所述的方法,其特征在于,所述从所述N组线性模型参数中选择目标组线性模型参数,包括,包括:确定所述参考块的第二样本均值;基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
- 根据权利要求18所述的方法,其特征在于,所述基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数,包括:基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
- 根据权利要求19所述的方法,其特征在于,所述基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数,包括:若所述第二样本均值大于或等于所述第一样本均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二样本均值小于或等于所述第一样本均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
- 根据权利要求2所述的方法,其特征在于,所述确定当前块的预测模式,包括:解码码流,得到第一信息,所述第一信息用于指示所述当前块的预测类型;基于所述第一信息,确定所述当前块的预测模式。
- 根据权利要求21所述的方法,其特征在于,所述基于所述第一信息,确定所述当前块的预测模式,包括:若所述第一信息指示所述当前块的预测类型为帧内块复制预测时,则解码所述码流,得到第一标志,所述第一标志用于指示所述当前块是否使用merge模式;基于所述第一标志,确定所述当前块的预测模式。
- 根据权利要求22所述的方法,其特征在于,所述基于所述第一标志,确定所述当前块的预测模式,包括:若所述第一标志指示所述当前块不使用所述merge模式时,则解码所述码流,得到第二信息,所述第二信息用于指示所述当前块是否使用帧内块复制光照补偿模式;基于所述第二信息,确定所述当前块的预测模式。
- 根据权利要求23所述的方法,其特征在于,所述基于所述第二信息,确定所述当前块的预测模式,包括:若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,则解码码流,得到索引信息,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引;基于所述索引信息,确定所述当前块的预测模式。
- 根据权利要求24所述的方法,其特征在于,所述基于所述索引信息,确定所述当前块的预测模式,包括:若所述索引信息的取值为第一数值时,则确定所述当前块的预测模式为单模型帧内块复制光照补偿模式;若所述索引标志的取值为第二数值时,则确定所述当前块的预测模式为所述多模型帧内块复制光照补偿模式。
- 根据权利要求23所述的方法,其特征在于,所述基于所述第二信息,确定所述当前块的预测模式,包括:若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,且所述当前块的大小大于或等于第二预设大小时,则将所述多模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
- 根据权利要求23所述的方法,其特征在于,所述第二信息还用于指示所述帧内块复制光照补偿模式的模式索引,所述基于所述第二信息,确定所述当前块的预测模式,包括:基于所述第二信息的取值,确定所述当前块的预测模式。
- 根据权利要求27所述的方法,其特征在于,所述基于所述第二信息的取值,确定所述当前块的预测模式,包括:若所述第二信息的取值为第一数值时,则确定所述当前块的预测模式为非帧内块复制光照补偿模式;若所述第二信息的取值为第二数值时,则确定所述当前块的预测模式为单模型帧内块复制光照补偿模式;若所述第二信息的取值为第三数值时,则确定所述当前块的预测模式为所述多模型帧内块复制光照补偿模式。
- 根据权利要求23所述的方法,其特征在于,所述解码所述码流,得到第二信息之前,所述方法还包括:确定所述当前块的大小是否满足第一预设大小;所述解码所述码流,得到第二信息,包括:若所述当前块的大小满足所述第一预设大小时,则解码所述码流,得到所述第二信息。
- 根据权利要求23所述的方法,其特征在于,所述解码所述码流,得到第二信息之前,所述方法还包括:解码所述码流,得到第三信息,所述第三信息用于指示所述当前块是否采用第一工具进行解码,所述第一工具与帧内块复制光照补偿技术互斥;所述解码所述码流,得到第二信息,包括:若所述第三信息指示所述当前块不采用第一工具进行解码时,则解码所述码流,得到所述第二信息。
- 根据权利要求23所述的方法,其特征在于,所述基于所述第一标志,确定所述当前块的预测模式,包括:若所述第一标志指示所述当前块使用所述merge模式时,则将所述参考块的预测模式,确定为所述当前块的预测模式。
- 根据权利要求23所述的方法,其特征在于,所述基于所述第一标志,确定所述当前块的预测模式,包括:若所述第一标志指示所述当前块使用所述merge模式时,则将单模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
- 根据权利要求23所述的方法,其特征在于,所述基于所述第一标志,确定所述当前块的预测模式,包括:若所述第一标志指示所述当前块使用所述merge模式时,则解码码流,得到第四信息,所述第四信息用于指示所述所述当前块的预测模式;基于所述第四信息,得到所述当前块的预测模式。
- 根据权利要求23所述的方法,其特征在于,所述解码码流,得到第一标志之前,所述方法还包括:解码所述码流,得到第三标志,所述第三标志用于指示当前序列是否允许局部光照补偿;所述解码码流,得到第一标志,包括:若所述第三标志指示所述当前序列允许局部光照补偿时,则解码所述码流,得到所述第一标志。
- 一种视频编码方法,其特征在于,包括:确定当前块的预测模式;若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
- 根据权利要求35所述的方法,其特征在于,所述确定N组线性模型参数,包括:基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数。
- 根据权利要求36所述的方法,其特征在于,所述基于所述参考块的周围已重建区域和所述当前块的周围已重建区域,所述确定N组线性模型参数,包括:从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集;将所述第一样本集和所述第二样本集划分为N组样本集,所述N组样本集中的任一组样本集包括至少一个第一样本和至少一个第二样本;对于所述N组样本集中的第i组样本集,基于所述第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,所述i为小于或等于N的正整数。
- 根据权利要求37所述的方法,其特征在于,所述参考块的周围已重建区域包括所述参考块的模板区域,所述当前块的周围已重建区域包括所述当前块的模板区域,所述从所述参考块的周围已重建区域中确定第一样本集,并从所述当前块的周围已重建区域中确定第二样本集,包括:从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集。
- 根据权利要求38所述的方法,其特征在于,所述从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集,包括:按照第一采样步长,在所述参考块的模板区域中进行采样,得到所述第一样本集,所述第一采样步长小于预设采样步长;按照所述第一采样步长,在所述当前块的模板区域中进行采样,得到所述第二样本集。
- 根据权利要求38所述的方法,其特征在于,所述从所述参考块的模板区域中确定所述第一样本集,以及从所述当前块的模板区域中确定所述第二样本集,包括:将所述参考块的模板区域所包括的所有样本,确定为所述第一样本集;将所述当前块的模板区域所包括的所有样本,确定为所述第二样本集。
- 根据权利要求38所述的方法,其特征在于,所述参考块的模板区域包括所述参考块的上侧模板区域和/或所述参考块的左侧模板区域,所述当前块的模板区域包括所述当前块的上侧模板区域和/或所述当前块的左侧模板区域。
- 根据权利要求41所述的方法,其特征在于,所述参考块的上侧模板区域包括所述参考块的上方模板区域和右上方模板区域,所述当前块的上侧模板区域包括所述当前块的上方模板区域和右上方模板区域。
- 根据权利要求41所述的方法,其特征在于,所述参考块的左侧模板区域包括所述参考块的左方模板区域和左下方模板区域,所述当前块的左侧模板区域包括所述当前块的左方模板区域和左下方模板区域。
- 根据权利要求41所述的方法,其特征在于,所述参考块的上侧模板区域所包括的样本行数大于或等于预设行数,所述当前块的上侧模板区域所包括的样本行数大于或等于所述预设行数。
- 根据权利要求41所述的方法,其特征在于,所述参考块的左侧模板区域所包括的样本列数大于或等于预设列数,所述当前块的左侧模板区域所包括的样本列数大于或等于所述预设列数。
- 根据权利要求37所述的方法,其特征在于,所述将所述第一样本集和所述第二样本集划分为N组样本集,包括:将所述第一样本集所包括的第一样本划分为N类第一样本;将所述第二样本集所包括的第二样本划分为N类第二样本;基于所述N类第一样本和所述N类第二样本,得到所述N组样本集。
- 根据权利要求46所述的方法,其特征在于,所述将所述第一样本集所包括的第一样本划分为N类第一样本,包括:确定所述第一样本集的第一样本均值;基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本。
- 根据权利要求47所述的方法,其特征在于,所述基于所述第一样本均值,将所述第一样本集划分为所述N类第一样本,包括:将所述第一样本集中大于或等于所述第一样本均值的第一样本,划分为第一类第一样本;将所述第一样本集中小于或等于所述第一样本均值的第一样本,划分为第二类第一样本。
- 根据权利要求46所述的方法,其特征在于,所述将所述第二样本集所包括的第二样本划分为N类第二样本,包括:对于所述N类第一样本中的第j类第一样本,将所述第二样本集中所述第j类第一样本对应的第二样本,确定为第j类第二样本,所述j为小于或等于N的正整数。
- 根据权利要求49所述的方法,其特征在于,所述基于所述N类第一样本和所述N类第二样本,得到所述N组样本集,包括:将所述第j类第一样本和所述第j类第二样本,确定为所述第j组样本集。
- 根据权利要求37所述的方法,其特征在于,所述基于所述第i组样本集所包括的第一样本和第二样本,确定第i组线性模型参数,包括:将所述第i组样本集中的第一样本相加,得到第一和值,并将所述第i组样本集中的第二样本相加,得到第二和值;确定所述第i组样本集中的第一样本的平方和,得到第三和值;将所述第i组样本集中的第一样本和第二样本相乘后再相加,得到第四和值;根据所述第一和值、所述第二和值、所述第三和值和所述第四和值,确定所述第i组线性模型参数。
- 根据权利要求48所述的方法,其特征在于,所述从所述N组线性模型参数中选择目标组线性模型参数,包括,包括:确定所述参考块的第二样本均值;基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
- 根据权利要求52所述的方法,其特征在于,所述基于所述第二样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数,包括:基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数。
- 根据权利要求53所述的方法,其特征在于,所述基于所述第二样本均值和所述第一样本均值,从所述N组线性模型参数中,选择所述目标组线性模型参数,包括:若所述第二样本均值大于或等于所述第一样本均值,则将所述N组线性模型参数中所述第一类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数;若所述第二样本均值小于或等于所述第一样本均值,则将所述N组线性模型参数中所述第二类第一样本对应的一组线性模型参数,确定为所述目标组线性模型参数。
- 根据权利要求37所述的方法,其特征在于,所述确定当前块的预测模式,包括:确定所述当前块对应的候选预测模式列表,所述候选预测模式中包括所述多模型帧内块复制光照补偿模式;确定使用所述候选预测模式列表中各候选预测模式对所述当前块进行预测时的代价;根据所述代价,确定所述当前块的预测模式。
- 根据权利要求55所述的方法,其特征在于,所述确定所述当前块对应的候选预测模式列表之前,所述方法还包括:确定所述当前块的大小是否满足第一预设大小;所述确定所述当前块对应的候选预测模式列表,包括:若所述当前块的大小满足所述第一预设大小时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
- 根据权利要求55所述的方法,其特征在于,所述确定所述当前块对应的候选预测模式列表之前,所述方法还包括:确定所述当前块是否采用第一工具进行编码,所述第一工具与帧内块复制光照补偿技术互斥;所述确定所述当前块对应的候选预测模式列表,包括:若确定所述当前块不采用第一工具进行编码时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
- 根据权利要求55所述的方法,其特征在于,所述方法还包括:确定所述当前块的预测类型,并在码流中写入第一信息,所述第一信息用于指示所述当前块的预测类型。
- 根据权利要求58所述的方法,其特征在于,所述方法还包括:若所述当前块的预测类型为帧内块复制预测时,则将第一标志写入所述码流,所述第一标志用于指示所述当前块是否使用merge模式。
- 根据权利要求59所述的方法,其特征在于,所述方法还包括:若所述当前块不使用所述merge模式时,则将第二信息写入所述码流,所述第二信息用于指示所述当前块是否使用帧内块复制光照补偿模式。
- 根据权利要求60所述的方法,其特征在于,所述方法还包括:若所述当前块使用所述帧内块复制光照补偿模式,则将索引信息写入所述码流,所述索引信息用于指示所述当前块所使用的所述帧内块复制光照补偿模式的模式索引。
- 根据权利要求61所述的方法,其特征在于,所述方法还包括:若所述当前块的预测模式为单模型帧内块复制光照补偿模式,则确定所述索引信息的取值为第一数值;若所述当前块的预测模式为所述多模型帧内块复制光照补偿模式,则确定所述索引标志的取值为第二数值。
- 根据权利要求60所述的方法,其特征在于,所述确定所述当前块的预测模式,包括:若所述第二信息指示所述当前块使用所述帧内块复制光照补偿模式,且所述当前块的大小大于或等于第二预设大小时,则将所述多模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
- 根据权利要求60所述的方法,其特征在于,所述第二信息还用于指示所述帧内块复制光照补偿模式的模式索引,所述方法还包括:若所述当前块的预测模式为非帧内块复制光照补偿模式,则确定所述第二信息的取值为第一数值;若所述当前块的预测模式为单模型帧内块复制光照补偿模式,则确定所述第二信息的取值为第二数值;若所述当前块的预测模式为所述多模型帧内块复制光照补偿模式,则确定所述第二信息的取值为第三数值。
- 根据权利要求59所述的方法,其特征在于,所述确定所述当前块的预测模式,包括:若所述当前块使用所述merge模式时,则将所述参考块的预测模式,确定为所述当前块的预测模式。
- 根据权利要求59所述的方法,其特征在于,所述确定所述当前块的预测模式,包括:若所述当前块使用所述merge模式时,则将单模型帧内块复制光照补偿模式,确定为所述当前块的预测模式。
- 根据权利要求55所述的方法,其特征在于,所述确定所述当前块对应的候选预测模式列表之前,所述方法还包括:确定第三标志,所述第三标志用于指示当前序列是否允许局部光照补偿;所述确定所述当前块对应的候选预测模式列表,包括:若所述所述第三标志用于指示当前序列允许局部光照补偿时,则将所述多模型帧内块复制光照补偿模式,添加至所述当前块对应的候选预测模式列表中。
- 根据权利要求67所述的方法,其特征在于,所述方法还包括:将所述第三标志写入码流,所述第三标志用于指示当前序列是否允许局部光照补偿。
- 一种视频解码装置,其特征在于,包括:模式确定单元,用于确定当前块的预测模式;参数确定单元,用于若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;变化单元,用于从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
- 一种视频编码装置,其特征在于,包括:模式预测单元,用于确定当前块的预测模式;参数确定单元,用于若所述当前块的预测模式为多模型帧内块复制光照补偿模式时,则确定所述当前块的参考块,并确定N组线性模型参数,所述N为大于1的正整数;变化单元,用于从所述N组线性模型参数中选择目标组线性模型参数,并使用所述目标组线性模型参数对所述参考块进行线性变化,得到所述当前块的预测块。
- 一种电子设备,其特征在于,包括处理器和存储器;所示存储器用于存储计算机程序;所述处理器用于调用并运行所述存储器中存储的计算机程序,以实现上述权利要求1至34或35至68任一项所述的方法。
- 一种视频编解码系统,其特征在于,包括:视频编码器和视频编码器;所述的视频解码器用于实现上述权利要求1至34任一项所述的方法;所述的视频编码器用于实现上述权利要求35至68任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,用于存储计算机程序;所述计算机程序使得计算机执行如上述权利要求1至34或35至68任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2023/086930 WO2024207434A1 (zh) | 2023-04-07 | 2023-04-07 | 视频编解码方法、装置、设备、系统、及存储介质 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2023/086930 WO2024207434A1 (zh) | 2023-04-07 | 2023-04-07 | 视频编解码方法、装置、设备、系统、及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024207434A1 true WO2024207434A1 (zh) | 2024-10-10 |
Family
ID=92970855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/086930 WO2024207434A1 (zh) | 2023-04-07 | 2023-04-07 | 视频编解码方法、装置、设备、系统、及存储介质 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2024207434A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111557095A (zh) * | 2018-01-08 | 2020-08-18 | 高通股份有限公司 | 多模型局部照明补偿 |
EP3706419A1 (en) * | 2019-03-08 | 2020-09-09 | InterDigital VC Holdings, Inc. | Multi-model local illumination compensation for video encoding or decoding |
CN112868239A (zh) * | 2018-10-23 | 2021-05-28 | 北京字节跳动网络技术有限公司 | 并置的局部照明补偿和帧内块复制编解码 |
WO2022116246A1 (zh) * | 2020-12-03 | 2022-06-09 | Oppo广东移动通信有限公司 | 帧间预测方法、视频编解码方法、装置及介质 |
WO2022174469A1 (zh) * | 2021-02-22 | 2022-08-25 | Oppo广东移动通信有限公司 | 一种光照补偿方法、编码器、解码器及存储介质 |
-
2023
- 2023-04-07 WO PCT/CN2023/086930 patent/WO2024207434A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111557095A (zh) * | 2018-01-08 | 2020-08-18 | 高通股份有限公司 | 多模型局部照明补偿 |
CN112868239A (zh) * | 2018-10-23 | 2021-05-28 | 北京字节跳动网络技术有限公司 | 并置的局部照明补偿和帧内块复制编解码 |
EP3706419A1 (en) * | 2019-03-08 | 2020-09-09 | InterDigital VC Holdings, Inc. | Multi-model local illumination compensation for video encoding or decoding |
WO2022116246A1 (zh) * | 2020-12-03 | 2022-06-09 | Oppo广东移动通信有限公司 | 帧间预测方法、视频编解码方法、装置及介质 |
WO2022174469A1 (zh) * | 2021-02-22 | 2022-08-25 | Oppo广东移动通信有限公司 | 一种光照补偿方法、编码器、解码器及存储介质 |
Non-Patent Citations (1)
Title |
---|
Y. WANG (BYTEDANCE), K. ZHANG (BYTEDANCE), L. ZHANG (BYTEDANCE), N. ZHANG (BYTEDANCE), C. MA (KUAISHOU), X. XIU, W. CHEN, H.-J. JH: "EE2-3.6: IBC-CIIP, IBC-GPM, and IBC-LIC", 29. JVET MEETING; 20230111 - 20230120; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-AC0112 ; m61690, 5 January 2023 (2023-01-05), XP030306650 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220094947A1 (en) | Method for constructing mpm list, method for obtaining intra prediction mode of chroma block, and apparatus | |
US11849109B2 (en) | Image prediction method, apparatus, and system, device, and storage medium | |
WO2020114394A1 (zh) | 视频编解码方法、视频编码器和视频解码器 | |
WO2022166462A1 (zh) | 编码、解码方法和相关设备 | |
WO2024212735A1 (zh) | 图像滤波方法、装置、设备及存储介质 | |
WO2024207434A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2023197229A1 (zh) | 视频编解码方法、装置、设备、系统及存储介质 | |
WO2024216632A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2024192733A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2024183007A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2024077553A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
US11917203B2 (en) | Non-separable transform method and device | |
WO2024152254A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2024007128A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2024108391A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
WO2023123736A1 (zh) | 预测方法、装置、设备、系统、及存储介质 | |
CN111669583A (zh) | 图像预测方法、装置、设备、系统及存储介质 | |
WO2024092425A1 (zh) | 视频编解码方法、装置、设备、及存储介质 | |
WO2023220970A1 (zh) | 视频编码方法、装置、设备、系统、及存储介质 | |
WO2023173255A1 (zh) | 图像编解码方法、装置、设备、系统、及存储介质 | |
WO2024207440A1 (zh) | 解码方法、编码方法、解码器以及编码器 | |
WO2023220946A1 (zh) | 视频编解码方法、装置、设备、系统及存储介质 | |
WO2023184747A1 (zh) | 视频编解码方法、装置、设备、系统及存储介质 | |
WO2023197183A1 (zh) | 视频编解码方法、装置、设备、系统、及存储介质 | |
US20240236372A1 (en) | Video encoding and decoding method, and device |