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

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

Info

Publication number
WO2024007128A1
WO2024007128A1 PCT/CN2022/103734 CN2022103734W WO2024007128A1 WO 2024007128 A1 WO2024007128 A1 WO 2024007128A1 CN 2022103734 W CN2022103734 W CN 2022103734W WO 2024007128 A1 WO2024007128 A1 WO 2024007128A1
Authority
WO
WIPO (PCT)
Prior art keywords
component block
prediction
combination
mode
weight
Prior art date
Application number
PCT/CN2022/103734
Other languages
English (en)
French (fr)
Inventor
王凡
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/103734 priority Critical patent/WO2024007128A1/zh
Priority to TW112124176A priority patent/TW202404356A/zh
Publication of WO2024007128A1 publication Critical patent/WO2024007128A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding

Definitions

  • the present application relates to the technical field of video coding and decoding, and in particular to a video coding and decoding method, device, equipment, system, and storage medium.
  • Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers, or video players.
  • video data includes a larger amount of data.
  • video devices implement video compression technology to make the video data more efficiently transmitted or stored.
  • prediction can eliminate or reduce the redundancy in the video and improve compression efficiency.
  • multiple prediction modes can be used to predict the current block.
  • more information needs to be transmitted in the code stream, which increases the coding cost.
  • Embodiments of the present application provide a video encoding and decoding method, device, equipment, system, and storage medium, which can reduce encoding costs.
  • this application provides a video decoding method, applied to a decoder, including:
  • the first combination includes a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1;
  • the present application provides a video encoding device for performing the method in the above second aspect or its respective implementations.
  • the device includes a functional unit for performing the method in the above-mentioned second aspect or its respective implementations.
  • a seventh aspect provides a video encoding and decoding system, including a video encoder and a video decoder.
  • the video decoder is used to perform the method in the above-mentioned first aspect or its various implementations
  • the video encoder is used to perform the method in the above-mentioned second aspect or its various implementations.
  • a computer program product including computer program instructions, which enable a computer to execute any one of the above-mentioned first to second aspects or the methods in each implementation thereof.
  • An eleventh aspect provides a computer program that, when run on a computer, causes the computer to execute any one of the above-mentioned first to second aspects or the method in each implementation thereof.
  • a twelfth aspect provides a code stream.
  • the code stream is generated based on the method of the second aspect.
  • the code stream includes a first index.
  • the first index is used to indicate the mode and K derived from a weight.
  • the first combination of prediction modes, K is a positive integer greater than 1.
  • Figure 4 is a schematic diagram of weight distribution
  • Figure 6B is a schematic diagram of weighted inter prediction
  • Figure 7A is a schematic diagram of intra prediction
  • Figure 7B is a schematic diagram of intra prediction
  • Figures 8A-8I are schematic diagrams of intra prediction
  • Figure 10 is a schematic diagram of intra prediction mode
  • Figure 12 is a schematic diagram of MIP
  • Figure 15 is a schematic diagram of the CCLM principle involved in the embodiment of the present application.
  • Figure 16 is a schematic flow chart of a video decoding method provided by an embodiment of the present application.
  • FIGS. 17A to 17D are schematic diagrams of block division methods
  • Figure 17E is a schematic diagram of CTU division
  • Figure 17F is a schematic diagram of the block division method of the luminance component and the chrominance component involved in the embodiment of the present application;
  • Figure 18 is a schematic diagram of the current component block and the specific position block involved in the embodiment of the present application.
  • Figure 19A is a schematic diagram of weight allocation
  • Figure 19B is a schematic diagram of another weight allocation
  • Figure 20 is a schematic flow chart of a video encoding method provided by an embodiment of the present application.
  • Figure 21 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
  • Figure 22 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
  • Figure 23 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
  • Figure 24 is a schematic block diagram of a video encoding and decoding system provided by an embodiment of the present application.
  • This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc.
  • the solution of this application can be combined with the audio and video coding standard (AVS for short), such as H.264/audio video coding (AVC for short) standard, H.265/high-efficiency video coding (AVS for short) high efficiency video coding (HEVC) standard and H.266/versatile video coding (VVC) standard.
  • AVC audio video coding
  • HEVC high efficiency video coding
  • VVC variatile video coding
  • FIG. 1 For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG. 1 .
  • Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application. It should be noted that Figure 1 is only an example, and the video encoding and decoding system in the embodiment of the present application includes but is not limited to what is shown in Figure 1 .
  • the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120 .
  • the encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device.
  • the decoding device decodes the code stream generated by the encoding device to obtain decoded video data.
  • the encoding device 110 in the embodiment of the present application can be understood as a device with a video encoding function
  • the decoding device 120 can be understood as a device with a video decoding function. That is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120. Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, and the like.
  • channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real time.
  • encoding device 110 may modulate the encoded video data according to the communication standard and transmit the modulated video data to decoding device 120.
  • the communication media includes wireless communication media, such as radio frequency spectrum.
  • the communication media may also include wired communication media, such as one or more physical transmission lines.
  • channel 130 includes a storage medium that can store video data encoded by encoding device 110 .
  • Storage media include a variety of local access data storage media, such as optical disks, DVDs, flash memories, etc.
  • the decoding device 120 may obtain the encoded video data from the storage medium.
  • channel 130 may include a storage server that may store video data encoded by encoding device 110 .
  • the decoding device 120 may download the stored encoded video data from the storage server.
  • the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a File Transfer Protocol (FTP) server, etc.
  • FTP File Transfer Protocol
  • the encoding device 110 includes a video encoder 112 and an output interface 113.
  • the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
  • the encoding device 110 may include a video source 111 in addition to the video encoder 112 and the input interface 113 .
  • Video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface for receiving video data from a video content provider, a computer graphics system Used to generate video data.
  • a video capture device eg, a video camera
  • a video archive e.g., a video archive
  • video input interface for receiving video data from a video content provider
  • computer graphics system Used to generate video data.
  • the video encoder 112 encodes the video data from the video source 111 to generate a code stream.
  • Video data may include one or more images (pictures) or sequence of pictures (sequence of pictures).
  • the code stream contains the encoding information of an image or image sequence in the form of a bit stream.
  • Encoded information may include encoded image data and associated data.
  • the associated data may include sequence parameter set (SPS), picture parameter set (PPS) and other syntax structures.
  • SPS sequence parameter set
  • PPS picture parameter set
  • An SPS can contain parameters that apply to one or more sequences.
  • a PPS can contain parameters that apply to one or more images.
  • a syntax structure refers to a collection of zero or more syntax elements arranged in a specified order in a code stream.
  • the video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113 .
  • the encoded video data can also be stored on a storage medium or storage server for subsequent reading by the decoding device 120 .
  • decoding device 120 includes input interface 121 and video decoder 122.
  • the decoding device 120 may also include a display device 123.
  • the input interface 121 includes a receiver and/or a modem. Input interface 121 may receive encoded video data over channel 130.
  • the video decoder 122 is used to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .
  • the display device 123 displays the decoded video data.
  • Display device 123 may be integrated with decoding device 120 or external to decoding device 120 .
  • Display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
  • LCD liquid crystal display
  • plasma display a plasma display
  • OLED organic light emitting diode
  • Figure 1 is only an example, and the technical solution of the embodiment of the present application is not limited to Figure 1.
  • the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.
  • FIG. 2 is a schematic block diagram of a video encoder related to an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression of images (lossy compression), or can also be used to perform lossless compression (lossless compression) of images.
  • the lossless compression can be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
  • the video encoder 200 can be applied to image data in a luminance-chrominance (YCbCr, YUV) format.
  • YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents brightness (Luma), Cb(U) represents blue chroma, Cr(V) represents red chroma, U and V represent Chroma, which is used to describe color and saturation.
  • the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (coding tree units, CTU).
  • CTB may be called “Tree block", “Largest Coding unit” (LCU for short) or “coding tree block” (CTB for short).
  • LCU Large Coding unit
  • CTB coding tree block
  • Each CTU can be associated with an equal-sized block of pixels within the image.
  • Each pixel can correspond to one luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU can be associated with one block of luma samples and two blocks of chroma samples.
  • a CTU size is, for example, 128 ⁇ 128, 64 ⁇ 64, 32 ⁇ 32, etc.
  • a CTU can be further divided into several coding units (Coding Units, CUs) for encoding.
  • CUs can be rectangular blocks or square blocks.
  • CU can be further divided into prediction unit (PU for short) and transform unit (TU for short), thus enabling coding, prediction, and transformation to be separated and processing more flexible.
  • the CTU is divided into CUs in a quad-tree manner, and the CU is divided into TUs and PUs in a quad-tree manner.
  • the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform/quantization unit 230, an inverse transform/quantization unit 240, a reconstruction unit 250, and a loop filter unit. 260. Decode the image cache 270 and the entropy encoding unit 280. It should be noted that the video encoder 200 may include more, less, or different functional components.
  • the current block may be called the current coding unit (CU) or the current prediction unit (PU), etc.
  • the prediction block may also be called a predicted image block or an image prediction block
  • the reconstructed image block may also be called a reconstruction block or an image reconstructed image block.
  • prediction unit 210 includes inter prediction unit 211 and intra prediction unit 212. Since there is a strong correlation between adjacent pixels in a video frame, the intra-frame prediction method is used in video encoding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in the video, the interframe prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving coding efficiency.
  • the inter-frame prediction unit 211 can be used for inter-frame prediction.
  • Inter-frame prediction can include motion estimation (motion estimation) and motion compensation (motion compensation). It can refer to image information of different frames.
  • Inter-frame prediction uses motion information to find a reference from a reference frame. block, a prediction block is generated based on the reference block to eliminate temporal redundancy; the frames used in inter-frame prediction can be P frames and/or B frames, P frames refer to forward prediction frames, and B frames refer to bidirectional predictions frame.
  • Inter-frame prediction uses motion information to find reference blocks from reference frames and generate prediction blocks based on the reference blocks.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be in whole pixels or sub-pixels.
  • the intra prediction unit 212 only refers to the information of the same frame image and predicts the pixel information in the current coded image block to eliminate spatial redundancy.
  • the frames used in intra prediction may be I frames.
  • Intra-frame prediction has multiple prediction modes. Taking the international digital video coding standard H series as an example, the H.264/AVC standard has 8 angle prediction modes and 1 non-angle prediction mode, and H.265/HEVC has been extended to 33 angles. prediction mode and 2 non-angle prediction modes.
  • the intra-frame prediction modes used by HEVC include planar mode (Planar), DC and 33 angle modes, for a total of 35 prediction modes.
  • the intra-frame modes used by VVC include Planar, DC and 65 angle modes, for a total of 67 prediction modes.
  • Residual unit 220 may generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block of a CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the PU of the CU. Predict the corresponding sample in the block.
  • Transform/quantization unit 230 may quantize the transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with the TU of the CU based on quantization parameter (QP) values associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
  • QP quantization parameter
  • Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct the residual block from the quantized transform coefficients.
  • Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing blocks of samples for each TU of a CU in this manner, video encoder 200 can reconstruct blocks of pixels of the CU.
  • the loop filtering unit 260 is used to process the inversely transformed and inversely quantized pixels to compensate for distortion information and provide a better reference for subsequent encoding of pixels. For example, a deblocking filtering operation can be performed to reduce the number of pixel blocks associated with the CU. block effect.
  • the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive compensation/adaptive loop filtering (SAO/ALF) unit, where the deblocking filtering unit is used to remove blocking effects, and the SAO/ALF unit Used to remove ringing effects.
  • SAO/ALF sample adaptive compensation/adaptive loop filtering
  • Decoded image cache 270 may store reconstructed pixel blocks.
  • Inter prediction unit 211 may perform inter prediction on PUs of other images using reference images containing reconstructed pixel blocks.
  • intra prediction unit 212 may use the reconstructed pixel blocks in decoded image cache 270 to perform intra prediction on other PUs in the same image as the CU.
  • Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
  • Figure 3 is a schematic block diagram of a video decoder related 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 filtering unit 350 and a decoded image cache 360 . It should be noted that the video decoder 300 may include more, less, or different functional components.
  • Video decoder 300 can receive the code stream.
  • Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the code stream, the entropy decoding unit 310 may parse entropy-encoded syntax elements in the code stream.
  • the prediction unit 320, the inverse quantization/transformation unit 330, the reconstruction unit 340 and the loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, that is, generate decoded video data.
  • prediction unit 320 includes intra prediction unit 322 and inter prediction unit 321.
  • Intra-prediction unit 322 may perform intra-prediction to generate predicted blocks for the PU. Intra-prediction unit 322 may use an intra-prediction mode to generate predicted blocks for a PU based on pixel blocks of spatially neighboring PUs. Intra-prediction unit 322 may also determine the intra-prediction mode of the PU based on one or more syntax elements parsed from the codestream.
  • the inter prediction unit 321 may construct a first reference image list (List 0) and a second reference image list (List 1) according to syntax elements parsed from the code stream. Additionally, if the PU uses inter-prediction encoding, entropy decoding unit 310 may parse the motion information of the PU. Inter prediction unit 321 may determine one or more reference blocks for the PU based on the motion information of the PU. Inter prediction unit 321 may generate a predictive block for the PU based on one or more reference blocks of the PU.
  • Inverse quantization/transform unit 330 may inversely quantize (ie, dequantize) transform coefficients associated with a TU. Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
  • inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to produce a residual block associated with the TU.
  • Reconstruction unit 340 uses the residual blocks associated with the TU of the CU and the prediction blocks of the PU of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
  • Loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for blocks of pixels associated with the CU.
  • Video decoder 300 may store the reconstructed image of the CU in decoded image cache 360 .
  • the video decoder 300 may use the reconstructed image in the decoded image 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, an image frame is divided into blocks.
  • the prediction unit 210 uses intra prediction or inter prediction to generate a prediction block of the current block.
  • the residual unit 220 may calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block.
  • the residual block may also be called residual information.
  • the residual block undergoes transformation and quantization processes such as transformation/quantization unit 230 to remove information that is insensitive to human eyes to eliminate visual redundancy.
  • the residual block before transformation and quantization by the transformation/quantization unit 230 may be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation/quantization unit 230 may be called a frequency residual block. or frequency domain residual block.
  • the entropy encoding unit 280 receives the quantized change coefficient output from the change quantization unit 230, and may perform entropy encoding on the quantized change coefficient to output a code stream. For example, the entropy encoding unit 280 may eliminate character redundancy according to the target context model and probability information of the binary code stream.
  • the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block.
  • the prediction unit 320 uses intra prediction or inter prediction for the current block based on the prediction information to generate a prediction block of the current block.
  • the inverse quantization/transform unit 330 uses the quantization coefficient matrix obtained from the code stream to perform inverse quantization and inverse transformation on the quantization coefficient matrix to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstruction block.
  • the reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain a decoded image.
  • the encoding end also needs similar operations as the decoding end to obtain the decoded image.
  • the decoded image may also be called a reconstructed image, and the reconstructed image may be used as a reference frame for inter-frame prediction for
  • the block division information determined by the encoding end as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the code stream when necessary.
  • the decoding end determines the same block division information as the encoding end by parsing the code stream and analyzing the existing information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information, thereby ensuring the decoded image obtained by the encoding end It is the same as the decoded image obtained by the decoding end.
  • 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
  • images can be divided into slices, etc. Slices in the same image can be processed in parallel, which means there is no data dependency between them.
  • “Frame” is a commonly used term, and it can generally be understood that a frame is an image. The frames described in the application can also be replaced by images or slices, etc.
  • VVC Versatile Video Coding
  • GPM Geometric Partitioning Mode
  • Angular Weighted Prediction mode Angular Weighted prediction
  • BIO Decoder sideMotion Vector Refinement
  • BIO Bi-directional Optical Flow
  • BIO can also be abbreviated as BDOF.
  • GPM or AWP also uses two reference blocks with the same size as the current block, but some pixel positions 100% use the pixel value corresponding to the first reference block, and some pixel positions 100% use the second reference block corresponding position.
  • the pixel values of the two reference blocks are used in the junction area or transition area according to a certain proportion.
  • the weight of the junction area also gradually transitions.
  • Figure 4 is a schematic diagram of weight allocation. As shown in Figure 4, it shows a schematic diagram of weight allocation of multiple division modes of GPM on the current block of 64 ⁇ 64 provided by the embodiment of the present application, wherein, There are 64 division modes in GPM.
  • Figure 5 is a schematic diagram of weight allocation. As shown in Figure 5, it shows a schematic diagram of weight allocation of multiple division modes of AWP on the current block of 64 ⁇ 64 provided by the embodiment of the present application, in which the AWP has 56 a dividing mode.
  • the black area indicates that the weight value of the corresponding position of the first reference block is 0%
  • the white area indicates that the weight value of the corresponding position of the first reference block is 100%
  • the gray area The area represents the weight value of the corresponding position of the first reference block according to the different shades of color, which is a weight value greater than 0% and less than 100%.
  • the weight value of the corresponding position of the second reference block is 100% minus the first The weight value of the corresponding position of each reference block.
  • GPM determines the angle and offset based on each mode, and then calculates the weight matrix of each mode.
  • AWP first makes a one-dimensional weight line, and then uses a method similar to intra-frame angle prediction to spread the one-dimensional weight line across the entire matrix.
  • GPM and AWP use masks of the weights of two reference blocks, which are the above-mentioned weight maps. This mask determines the weight of the two reference blocks when generating the prediction block, or it can be simply understood as that part of the position of the prediction block comes from the first reference block and part of the position comes from the second reference block, while the transition area (blending area) is weighted by the corresponding positions of the two reference blocks, thereby making the transition smoother.
  • GPM and AWP do not divide the current block into two CUs or PUs according to the dividing line, so the transformation, quantization, inverse transformation, inverse quantization, etc. of the residual after prediction are also processed on the current block as a whole.
  • GPM simulates the partitioning of the geometry, or more precisely the predicted partitioning, using a weight matrix.
  • To implement GPM in addition to the weight matrix, 2 predicted values are required, each predicted value is determined by 1 unidirectional motion information. These two pieces of one-way motion information come from a motion information candidate list, for example, from the merge motion information candidate list (mergeCandList).
  • GPM uses two indexes in the code stream to determine 2 unidirectional motion information from mergeCandList.
  • Inter-frame prediction uses motion information to represent "motion".
  • Basic motion information includes reference frame (reference picture) information and motion vector (MV, motion vector) information.
  • Commonly used bidirectional prediction uses 2 reference blocks to predict the current block.
  • Two reference blocks can use a forward reference block and a backward reference block.
  • 2 are both forward-facing or 2 are backward-facing.
  • the so-called forward refers to the time corresponding to the reference frame before the current frame
  • the backward refers to the time corresponding to the reference frame after the current frame.
  • the forward reference frame is positioned before the current frame in the video
  • the backward reference frame is positioned after the current frame in the video.
  • the POC (picture order count) of the forward reference frame is smaller than the POC of the current frame
  • the POC of the backward reference frame is greater than the POC of the current frame.
  • two sets of reference frame information and motion vector information are needed.
  • Each group of them can be understood as a one-way motion information, and combining these two groups together forms a two-way motion information.
  • one-way motion information and two-way motion information can use the same data structure, except that the two sets of reference frame information and motion vector information for the two-way motion information are valid, while one set of reference frames for the one-way motion information information and motion vector information are invalid.
  • two reference frame lists are supported, denoted RPL0 and RPL1, where RPL is the abbreviation of Reference Picture List.
  • RPL is the abbreviation of Reference Picture List.
  • P slice can only use RPLO
  • B slice can use RPLO and RPL1.
  • motion information is represented by reference frame indexes and motion vectors.
  • the reference frame index refIdxL0 corresponding to the reference frame list 0 the motion vector mvL0 corresponding to the reference frame list 0, the reference frame index refIdxL1 corresponding to the reference frame list 1, and the motion corresponding to the reference frame list 1 Vector mvL0.
  • the reference frame index corresponding to reference frame list 0 and the reference frame index corresponding to reference frame list 1 here can be understood as the above-mentioned reference frame information.
  • two flag bits are used to respectively indicate whether to use the motion information corresponding to the reference frame list 0 and whether to use the motion information corresponding to the reference frame list 0, respectively recorded as predFlagL0 and predFlagL1.
  • predFlagL0 and predFlagL1 indicate "whether the above-mentioned one-way motion information is valid."
  • the data structure of motion information is not explicitly mentioned, it uses the reference frame index corresponding to each reference frame list, the motion vector and the "valid" flag to represent motion information. In some standard texts, motion information does not appear, but motion vectors are used. It can also be considered that the reference frame index and the flag of whether to use the corresponding motion information are accessories of the motion vector. In this application, "motion information” is still used for convenience of description, but it should be understood that “motion vector” can also be used to describe it.
  • the motion information used by the current block can be saved.
  • Subsequent coded blocks of the current frame can use the motion information of previously coded blocks, such as adjacent blocks, according to adjacent position relationships. This takes advantage of the correlation in the spatial domain, so this encoded and decoded motion information is called motion information in the spatial domain.
  • the motion information used for each block of the current frame can be saved.
  • Subsequently coded frames can use the motion information of previously coded frames based on the reference relationship. This takes advantage of the correlation in the time domain, so the motion information of this encoded and decoded frame is called motion information in the time domain.
  • the storage method of motion information used in each block of the current frame usually uses a fixed-size matrix, such as a 4x4 matrix, as a minimum unit, and each minimum unit stores a set of motion information separately.
  • a fixed-size matrix such as a 4x4 matrix
  • each minimum unit stores a set of motion information separately.
  • the smallest units corresponding to its position can store the motion information of this block.
  • the motion information corresponding to the position can be found directly based on the position. For example, if a 16x16 block uses traditional unidirectional prediction, then all 4x4 minimum units corresponding to this block store the motion information of this unidirectional prediction.
  • a block uses GPM or AWP, then all the minimum units corresponding to this block will determine each minimum unit based on the mode of GPM or AWP, the first motion information, the second motion information and the position of each minimum unit. Stored motion information.
  • One method is that if the 4x4 pixels corresponding to a minimum unit all come from the first motion information, then this minimum unit stores the first motion information, and if the 4x4 pixels corresponding to a minimum unit all come from the second motion information , then this minimum unit stores the second motion information.
  • AWP will select one of the motion information for storage; GPM's approach is that if the two motion information point to different references Frame list, then combine them into bidirectional motion information storage, otherwise only store the second motion information.
  • the above mergeCandList is constructed based on air domain motion information, time domain motion information, historical motion information, and some other motion information.
  • mergeCandList uses positions 1 to 5 in Figure 6A to derive spatial domain motion information, and uses positions 6 or 7 in Figure 6A to derive temporal motion information.
  • History-based motion information adds the motion information of this block to a first-in, first-out list each time a block is encoded and decoded. The addition process may require some checks, such as whether it is repeated with existing motion information in the list. In this way, the motion information in this history-based list can be referenced when encoding and decoding the current block.
  • the syntax description of GPM is as shown in Table 1:
  • the current block may use CIIP or GPM. If the current block does not use CIIP, then it uses GPM, which is what the syntax "if(!ciip_flag[x0][y0])" in Table 1 shows.
  • GPM needs to transmit three pieces of information in the code stream, namely merge_gpm_partition_idx, merge_gpm_idx0, merge_gpm_idx1.
  • x0, y0 are used to determine the coordinates (x0, y0) of the brightness pixel in the upper left corner of the current block relative to the brightness pixel in the upper left corner of the image.
  • merge_gpm_partition_idx determines the partition shape of GPM. As mentioned above, it is "simulation partition".
  • merge_gpm_partition_idx is the weight matrix derivation mode or the index of the weight matrix derivation mode mentioned in this article, or the weight derivation mode or the weight derivation mode. index.
  • merge_gpm_idx0 is the first merge candidate index, and the first merge candidate index is used to determine the first motion information or the first merge candidate according to mergeCandList.
  • merge_gpm_idx1 is the second merge candidate index, and the second merge candidate index is used to determine the second motion information or the second merge candidate according to mergeCandList. If MaxNumGpmMergeCand>2, that is, the candidate list length is greater than 2, only merge_gpm_idx1 needs to be decoded, otherwise it can be determined directly.
  • the GPM decoding process includes the following steps:
  • the information input during the decoding process includes: the brightness position of the upper left corner of the current block relative to the coordinates (xCb, yCb) of the upper left corner of the image, the width of the brightness component of the current block cbWidth, the height of the brightness component of the current block cbHeight, and the brightness with 1/16 pixel accuracy.
  • motion information may be represented by a combination of motion vector, reference frame index and prediction list flag.
  • VVC supports 2 reference frame lists, and each reference frame list may have multiple reference frames.
  • Unidirectional prediction uses only one reference block of one reference frame in one of the reference frame lists as a reference, and bidirectional prediction uses one reference block of each reference frame in the two reference frame lists as a reference.
  • the GPM in VVC uses 2 unidirectional predictions.
  • a in the above mvA and mvB, mvCA and mvCB, refIdxA and refIdxB, predListFlagA and predListFlagB can be understood as the first prediction mode, and B can be understood as the second prediction mode.
  • predListFlagX represents the first reference frame list or the second reference frame list used by Represents the chroma motion vector used by X.
  • the motion vector, reference frame index and prediction list flag are combined to represent the motion information described in this article.
  • the information output by the decoding process includes: (cbWidth) X (cbHeight) brightness prediction sample matrix predSamplesL; (cbWidth/SubWidthC) X (cbHeight/SubHeightC) Cb chroma component prediction sample matrix, if necessary; (cbWidth/SubWidthC) Prediction sample matrix of Cr chroma components of X(cbHeight/SubHeightC), if needed.
  • the brightness component is used as an example below.
  • the processing of the chroma component is similar to that of the brightness component.
  • predSamplesLAL and predSamplesLBL are (cbWidth)X(cbHeight), which are prediction sample matrices based on two prediction modes.
  • predSamplesL is derived as follows: predSamplesLAL and predSamplesLBL are determined based on the brightness motion vectors mvA and mvB, the chroma motion vectors mvCA and mvCB, the reference frame indexes refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB respectively. That is, prediction is performed based on the motion information of the two prediction modes respectively, and the detailed process will not be described again.
  • GPM is a merge mode. It can be considered that the two prediction modes of GPM are both merge modes.
  • merge_gpm_partition_idx[xCb][yCb] use Table 2 to determine the division angle index variable angleIdx and distance index variable distanceIdx of GPM.
  • the weighted prediction derivation process of GPM includes the following steps:
  • the output of this process is the GPM prediction sample matrix pbSamples of (nCbW)X(nCbH).
  • offsetY ((-nH)>>1)+(angleIdx ⁇ 16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)).
  • offsetX ((-nW)>>1)+(angleIdx ⁇ 16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3),
  • variable wValue representing the weight of the predicted sample at the current position is derived as follows.
  • wValue is the weight of the predicted value predSamplesLA[x][y] of the prediction matrix of the first prediction mode at point (x, y), and (8-wValue) That is, it is the weight of the predicted value predSamplesLB[x][y] of the prediction matrix of the first prediction mode at point (x, y).
  • the distance matrix disLut is determined according to Table 3:
  • weightIdx (((xL+offsetX) ⁇ 1)+1)*disLut[displacementX]+(((yL+offsetY) ⁇ 1)+1)*disLut[displacementY],
  • weightIdxL partFlip? 32+weightIdx:32–weightIdx,
  • pbSamples[x][y] Clip3(0,(1 ⁇ BitDepth)-1,(predSamplesLA[x][y]*wValue+predSamplesLB[x][y]*(8-wValue)+offset1)>> shift1).
  • a weight value is derived for each position of the current block, and then a GPM predicted value pbSamples[x][y] is calculated. Because of this method, the weight wValue does not need to be written in the form of a matrix, but it can be understood that if the wValue of each position is saved in a matrix, then it is a weight matrix. Calculate the weight of each point separately and weight it to obtain the predicted value of GPM, or calculate all the weights and then weight them uniformly to obtain the predicted sample matrix of GPM. The principle is the same.
  • the weight matrix is used in many descriptions in this application to make the expression easier to understand and to use the weight matrix to draw pictures more intuitively. In fact, it can also be described according to the weight of each position.
  • the weight matrix export mode can also be said to be the weight export mode.
  • the GPM decoding process can be expressed as: parse the code stream, determine whether the current block uses GPM technology; if the current block uses GPM technology, determine the weight derivation mode (or division mode or weight matrix export mode), and the first motion information and the second motion information. Determine the first prediction block according to the first motion information, determine the second prediction block according to the second motion information, determine the weight matrix according to the weight matrix derivation mode, and determine the prediction of the current block according to the first prediction block, the second prediction block and the weight matrix. piece.
  • the intra prediction method uses the coded and reconstructed pixels surrounding the current block as reference pixels to predict the current block.
  • Figure 7A is a schematic diagram of intra prediction. As shown in Figure 7A, the size of the current block is 4x4. The pixels in the left row and the upper column of the current block are the reference pixels of the current block. Intra prediction uses these reference pixels to perform prediction on the current block. predict. These reference pixels may all be available, that is, all of them may have been encoded and decoded. There may also be some parts that are unavailable. For example, if the current block is the leftmost part of the entire frame, then the reference pixel on the left side of the current block is unavailable.
  • the lower left part of the current block has not been encoded or decoded, so the reference pixels in the lower left are also unavailable.
  • the available reference pixels or certain values or certain methods can be used for filling, or no filling can be performed.
  • Figure 7B is a schematic diagram of intra prediction.
  • the multiple reference line intra prediction method (Multiple reference line, MRL) can use more reference pixels to improve encoding and decoding efficiency. For example, using 4 reference lines/ Column is the reference pixel for the current block.
  • intra prediction has multiple prediction modes.
  • Figures 8A-5I are schematic diagrams of intra prediction.
  • intra prediction for 4x4 blocks in H.264 can mainly include 9 modes.
  • mode 0 as shown in Figure 8A copies the pixels above the current block in the vertical direction to the current block as the prediction value
  • mode 1 as shown in Figure 8B copies the reference pixel on the left to the current block in the horizontal direction as the prediction value.
  • the mode 2 direct current DC shown in Figure 8C takes the average of the 8 points A ⁇ D and I ⁇ L as the predicted value of all points
  • the modes 3 ⁇ 8 shown in Figure 8D-5I are based on a certain angle respectively. Copy the reference pixel to the corresponding position of the current block. Because some positions of the current block cannot exactly correspond to the reference pixel, it may be necessary to use the weighted average of the reference pixels, or the sub-pixels of the interpolated reference pixels.
  • FIG 9 is a schematic diagram of the intra prediction mode.
  • the intra prediction modes used by HEVC include Planar, DC and 33 angle modes, a total of 35 prediction modes.
  • Figure 10 is a schematic diagram of the intra-frame prediction mode.
  • the intra-frame modes used by VVC include Planar, DC and 65 angle modes, a total of 67 prediction modes.
  • Figure 11 is a schematic diagram of the intra prediction mode. As shown in Figure 11, VS3 uses DC, Plane, Bilinear, PCM and 62 angle modes in total 66 prediction modes.
  • the multiple intraprediction filter (MIPF) in AVS3 uses different filters to generate prediction values for different block sizes. For pixels at different positions in the same block, one filter is used to generate predicted values for pixels that are closer to the reference pixel, and another filter is used to generate predicted values for pixels that are farther from the reference pixel.
  • the technology for filtering predicted pixels is such as the intraprediction filter (IPF) in AVS3. The predicted values can be filtered using reference pixels.
  • the intra-frame mode coding technology of the Most Probable Modes List can be used to improve encoding and decoding efficiency.
  • the intra prediction mode of the surrounding coded blocks and the intra prediction mode derived based on the intra prediction mode of the surrounding coded blocks, such as adjacent modes, and some commonly used or used intra prediction modes with a relatively high probability Modes, such as DC, Planar, Bilinear mode, etc., constitute a mode list.
  • Intra prediction modes that refer to surrounding coded blocks take advantage of spatial correlation. Because the texture will have a certain continuity in space. MPM can be used as prediction in intra prediction mode. That is to say, the probability that the current block uses MPM will be higher than the probability that MPM is not used. Therefore, during binarization, fewer codewords will be used for MPM, thereby saving overhead and improving encoding and decoding efficiency.
  • matrix-based intra prediction which is also written as Matrix weighted Intra Prediction in some places, can be used for intra prediction.
  • MIP matrix-based intra prediction
  • MIP generates prediction blocks in the following three steps: reference pixel averaging (Averaging), matrix multiplication (Matrix Vector Multiplication) and interpolation (Interpolation).
  • matrix multiplication is the core of MIP.
  • MIP can be thought of as a process of generating prediction blocks from input pixels (reference pixels) using a matrix multiplication method. MIP provides a variety of matrices.
  • the difference in prediction methods is reflected in the differences in matrices. Using different matrices for the same input pixels will yield different results.
  • the process of reference pixel averaging and interpolation is a design that compromises performance and complexity. For larger blocks, an effect similar to downsampling can be achieved by reference pixel averaging, allowing the input to be adapted to a smaller matrix, while interpolation achieves an upsampling effect. In this way, there is no need to provide MIP matrices for blocks of each size, but only matrices of one or several specific sizes. As the demand for compression performance increases and hardware capabilities improve, more complex MIPs may appear in the next generation of standards.
  • MIP is somewhat similar to planar, but obviously MIP is more complex and more flexible than planar.
  • GPM combines two inter prediction blocks with a weight matrix. In fact it can be extended to combine two arbitrary prediction blocks. Such as two inter prediction blocks, two intra prediction blocks, one inter prediction block and one intra prediction block. Even in screen content encoding, IBC (intra block copy) or palette prediction blocks can be used as 1 or 2 prediction blocks.
  • IBC intra block copy
  • palette prediction blocks can be used as 1 or 2 prediction blocks.
  • the prediction mode can be understood as information according to which the codec can generate a prediction block for the current block.
  • the prediction mode can be a certain intra prediction mode, such as DC, Planar, various intra angle prediction modes, etc.
  • some or some auxiliary information can also be superimposed, such as optimization methods for intra-frame reference pixels, optimization methods (such as filtering) after generating preliminary prediction blocks, etc.
  • the prediction mode can be skip (skip) mode, merge (merge) mode or MMVD (merge with motion vector difference, merge with motion vector difference) mode, or AMVP (advanced motion vector predition, Advanced motion vector prediction), which can be unidirectional prediction, bidirectional prediction or multi-hypothesis prediction.
  • a prediction mode uses unidirectional prediction, a prediction mode must also be able to determine a piece of motion information, and a prediction block can be determined based on a piece of motion information.
  • the inter-frame prediction mode uses bidirectional prediction, one prediction mode must also be able to determine two pieces of motion information, and the prediction block can be determined based on the two pieces of motion information.
  • the information that GPM needs to determine can be expressed as 1 weight derivation mode and 2 prediction modes.
  • the weight derivation mode is used to determine the weight matrix or weight, and the two prediction modes determine a prediction block or prediction value respectively.
  • Weight derivation mode is also called partition mode in some places. But because it is simulated division, this application calls it weight derivation mode.
  • the two prediction modes can come from the same or different prediction methods, where the prediction methods include but are not limited to intra prediction, inter prediction, IBC, and palette.
  • the two prediction modes can come from the same or different prediction methods, where the prediction methods include but are not limited to intra prediction, inter prediction, IBC, and palette.
  • a specific concrete example is as follows: if the current block uses GPM. This example is used in inter-coded blocks, allowing the use of merge modes in intra-prediction and inter-prediction. As shown in Table 4, a syntax element intra_mode_idx is added to indicate which prediction mode is the intra prediction mode.
  • intra_mode_idx is 0, which means that both prediction modes are inter prediction modes, that is, mode0IsInter is 1, mode0IsInter is 1; intra_mode_idx is 1 Indicates that the first prediction mode is intra prediction mode, and the second prediction mode is inter prediction mode, that is, mode0IsInter is 0, mode0IsInter is 1; intra_mode_idx is 2, indicating that the first prediction mode is inter prediction mode, and the second prediction mode is inter prediction mode.
  • the prediction mode is the intra prediction mode, that is, mode0IsInter is 1, mode0IsInter is 0; intra_mode_idx is 3, which means that both prediction modes are intra prediction modes, that is, mode0IsInter is 0, mode0IsInter is 0.
  • the GPM decoding process can be expressed as: parse the code stream, determine whether the current block uses GPM technology; if the current block uses GPM technology, determine the weight derivation mode (or division mode or weight matrix derived mode), and a first prediction mode and a second prediction mode. Determine the first prediction block according to the first prediction mode, determine the second prediction block according to the second prediction mode, determine the weight matrix according to the weight matrix derivation mode, and determine the prediction of the current block according to the first prediction block, the second prediction block and the weight matrix. piece.
  • the template matching method was first used in inter-frame prediction. It uses the correlation between adjacent pixels to use some areas around the current block as templates.
  • the current block is encoded and decoded, its left and upper sides have been encoded and decoded according to the encoding sequence.
  • inter-frame blocks such as inter-frame coded blocks in HEVC.
  • intra-coded blocks must require the reconstructed pixels on the left and upper sides as reference pixels. Theoretically, the left and upper sides are available, which means that it can be achieved by making corresponding adjustments to the hardware design. Relatively speaking, the right and lower sides are not available under the encoding order of current standards such as VVC.
  • the rectangular area on the left and upper sides of the current block as a template.
  • the height of the left template part is generally the same as the height of the current block
  • the width of the upper template part is generally the same as the width of the current block.
  • the same, of course, can also be different.
  • the so-called matching degree can be measured by some distortion costs, such as SAD (sum of absolute transformed difference), SATD (sum of absolute transformed difference) ), generally the transformations used by SATD are Hadamard transform, MSE (mean-square error), etc.
  • SAD sum of absolute transformed difference
  • SATD sum of absolute transformed difference
  • MSE mean-square error
  • the cost is calculated using the prediction block of the template corresponding to the position and the reconstruction block of the template surrounding the current block. In addition to searching for whole pixel positions, you can also search for sub-pixel positions, and determine the motion information of the current block based on the searched position with the highest degree of matching. Using the correlation between adjacent pixels, motion information suitable for the template may also be suitable for the current block.
  • the template matching method may not necessarily be applicable to all blocks, so some methods can be used to determine whether the current block uses the above template matching method, such as using a control switch in the current block to indicate whether to use the template matching method.
  • One name for this template matching method is DMVD (decoder side motion vector derivation).
  • DMVD decoder side motion vector derivation
  • Both the encoder and decoder can use templates to search to derive motion information or find better motion information based on the original motion information. It does not need to transmit specific motion vectors or motion vector differences. Instead, both the encoder and the decoder perform searches according to the same rules to ensure consistency in encoding and decoding.
  • the template matching method can improve compression performance, but it requires "searching" in the decoder, which brings a certain decoder complexity.
  • the above is a method of applying template matching between frames.
  • the template matching method can also be used within a frame.
  • a template is used to determine the intra-frame prediction mode.
  • the current block you can also use the area within a certain range on the upper and left sides of the current block as a template, such as the rectangular area on the left and the rectangular area on the upper side as shown above.
  • the reconstructed pixels in the template are available. This process can be roughly described as determining a set of candidate intra prediction modes for the current block, and the candidate intra prediction modes constitute a subset of all available intra prediction modes.
  • the candidate intra prediction mode may be the complete set of all available intra prediction modes. This can be determined based on performance and complexity trade-offs.
  • the set of candidate intra prediction modes can be determined according to MPM or some rules, such as equal-spaced filtering. Calculate the cost of each candidate intra prediction mode on the template, such as SAD, SATD, MSE, etc. Use this mode to predict on the template to make a prediction block, and use the prediction block and the reconstructed block of the template to calculate the cost. Modes with low cost may be better matched to the template. Taking advantage of the similarity between adjacent pixels, the intra prediction mode that performs well on the template may also perform well on the current block. Select one or several low-cost modes. Of course, the above two steps can be repeated. For example, after selecting one or several low-cost modes, determine the set of candidate intra prediction modes again, and then calculate the cost for the newly determined set of candidate intra prediction modes.
  • One intra prediction mode finally selected is determined as the intra prediction mode of the current block, or several intra prediction modes finally selected as candidates for the intra prediction mode of the current block.
  • sorting the MPM list that is, making prediction blocks on the template for the modes in the MPM list and determining the cost, from small to large. Sort.
  • the higher the mode in the MPM list the smaller the overhead in the code stream, which can also achieve the purpose of improving compression efficiency.
  • the template matching method can be used to determine the two prediction modes of GPM. If the template matching method is used for GPM, one control switch can be used to control whether the two prediction modes of the current block use template matching for the current block, or two control switches can be used to control whether each of the two prediction modes uses template matching. .
  • Another aspect is how to use template matching. For example, if GPM is used in merge mode, such as GPM in VVC, it uses merge_gpm_idxX to determine a motion information from mergeCandList, where the uppercase X is 0 or 1. For the Xth motion information, one method is to use template matching method to optimize based on the above motion information. That is, determine a piece of motion information from mergeCandList according to merge_gpm_idxX. If template matching is used for the motion information, then the template matching method is used to optimize based on the above motion information. Another method is not to use merge_gpm_idxX to determine a motion information from mergeCandList, but to directly search and determine a motion information based on a default motion information.
  • the template matching method can be used to determine an intra prediction mode, and there is no need to indicate the intra prediction mode in the code stream. index of. Or the template matching method is used to determine a candidate set or MPM list, and the index of the intra prediction mode needs to be indicated in the code stream.
  • GPM has three elements, a weight matrix and two prediction modes.
  • the advantage of GPM is that it can achieve more autonomous combinations through the weight matrix.
  • GPM needs to determine more information, so it needs to pay more overhead in the code stream.
  • GPM in VVC is used in merge mode.
  • merge_gpm_partition_idx, merge_gpm_idx0, merge_gpm_idx1 to determine the weight matrix, the first prediction mode and the second prediction mode respectively in the code stream.
  • the weight matrix and the two prediction modes each have multiple possible choices. For example, the weight matrix in VVC has 64 possible choices.
  • Merge_gpm_idx0 and merge_gpm_idx1 each allow a maximum of 6 possible choices in VVC.
  • VVC stipulates that merge_gpm_idx0 and merge_gpm_idx1 do not overlap. Then such a GPM has 65X6X5 possible choices.
  • MMVD is used to optimize two motion information (prediction modes), a variety of possible choices can be provided for each prediction mode. This number is quite large.
  • each of the prediction modes can use 67 common intra prediction modes in VVC.
  • the two intra prediction modes are different, and there are 64X67X66 possible choices.
  • each prediction mode can be restricted to only use a subset of all common intra prediction modes, but there are still many possible choices.
  • 1 weight-derived mode has one or more syntax elements of its own
  • the first prediction mode has one or more syntax elements of its own
  • the second prediction mode has one or more syntax elements of its own.
  • standards can restrict that the second prediction mode cannot be the same as the first prediction mode in some cases, or some optimization methods can be used in two prediction modes at the same time (this can also be understood as being used in the current block), but three
  • the writing and parsing of syntax elements are relatively independent, that is, more codewords are needed to indicate the weight derivation mode and prediction mode, and the coding overhead is high.
  • the first component in the same space will be encoded and decoded first, and then the second and third components will be encoded and decoded, so that the second and third components can utilize some information of the first component.
  • a typical example is cross-component linear model prediction (CCLM).
  • CCLM cross-component linear model prediction
  • pixels of the chroma component can be predicted by reconstructed pixels of the luma component. Specifically, as shown in the following equation:
  • pred C (i, j) represents the predicted value of the chroma pixel at the (i, j) position
  • rec L ′ (i, j) represents the reconstructed value of the downsampled chroma pixel at the (i, j) position.
  • the parameters of CCLM ( ⁇ and ⁇ ) are derived from the adjacent downsampled luma and chroma pixels of the current CU.
  • the basic principle is to use the adjacent brightness and chrominance pixels of the current CU to derive a linear model, and then use this linear model on the current CU. According to the reconstruction value of the brightness and this linear The model determines the predicted value of the chroma.
  • CCLM cannot achieve accurate prediction of chroma blocks with complex textures.
  • the embodiment of the present application takes the first weight derivation mode and the K first prediction modes corresponding to the current component block as a combination, and indicates the first weight derivation mode and the K first prediction modes in a combined form, In this way, there is no need to separately transmit the syntax corresponding to the K first prediction modes and the first weight derivation modes in the code stream, thereby saving code words and improving coding efficiency.
  • the first weight derivation mode included in the first combination can also be accurately determined. and K first prediction modes, and then use the first weight derivation mode and the K first prediction modes to achieve accurate prediction of the current component block.
  • Figure 16 is a schematic flow chart of a video decoding method provided by an embodiment of the present application.
  • the embodiment of the present application is applied to the video decoder shown in Figures 1 and 3.
  • the method in the embodiment of this application includes:
  • the first combination includes a first weight derivation mode and K first prediction modes, where K is a positive integer greater than 1.
  • Image formats include YUV, YCrCb, RGB, etc.
  • YUV format Y represents the brightness component
  • UV represents the chrominance component respectively, where Y is also called the first component
  • U is called the second component
  • V is called the third component.
  • YCrCb format Y represents the brightness component
  • CrCb represents the chrominance component respectively, where Y is also called the first component
  • Cr is called the second component
  • Cb is called the third component.
  • G is called the first component
  • B is called the second component
  • R is called the third component.
  • the first component of the CTU may be divided into at least one first component block, the second component into at least one second component block, and the third component into at least one third component block. Portion blocks.
  • K different prediction modes are used to predict the current component block, where the current component block includes the second component block or the third component block.
  • a weight derivation mode and K prediction modes jointly generate a prediction block.
  • This prediction block acts on the current component block, that is, the weight is determined according to the first weight derivation mode, and the current component block is processed according to the K first prediction modes. For prediction, K predicted values are obtained, and the K predicted values are weighted according to the weights to obtain the predicted value of the current component block. It can be seen from this that the first weight derivation mode and the K first prediction modes included in the first combination work together on the current component block, and they are related.
  • the first weight derivation mode is used to determine the weight used by the current component block.
  • the first weight derivation mode may be a mode of deriving weights.
  • each weight derivation mode can export a weight matrix; for blocks of the same size, different weight derivation modes export different weight matrices.
  • AWP has 56 weight derivation modes
  • GPM has 64 weight derivation modes.
  • the K different first prediction modes included in the above first combination include the following examples:
  • Example 1 the K different first prediction modes mentioned above are all intra prediction modes.
  • the current component block is an intra-coded block, and screen content coding is not applicable.
  • Example 2 The K different first prediction modes mentioned above are all inter-frame prediction modes, for example, the current component block is an inter-frame coded block.
  • Example 3 Among the K different first prediction modes, at least one is an intra prediction mode and at least one is an inter prediction mode.
  • Example 4 Among the above K different first prediction modes, at least one is an intra prediction mode, and at least one is a non-inter and non-intra prediction mode, such as intra-block copy IBC prediction mode or palette palette prediction. mode etc.
  • Example 5 Among the K different first prediction modes, at least one is an inter-frame prediction mode, and at least one is a non-inter-frame and non-intra-frame prediction mode, such as an IBC prediction mode or a palette prediction mode.
  • an inter-frame prediction mode at least one is an inter-frame prediction mode
  • a non-inter-frame and non-intra-frame prediction mode such as an IBC prediction mode or a palette prediction mode.
  • Example 6 None of the above K different first prediction modes are intra prediction modes or inter prediction modes, for example, one is IBC prediction mode, one is palette prediction mode, etc.
  • the above-mentioned S101 is performed to decode the code stream and determine the first combination. If the decoder determines that the current component block does not use K different prediction modes for weighted prediction processing, the above-mentioned step S101 is skipped.
  • the decoder can determine whether the current component block uses K different prediction modes for weighted prediction processing by determining the prediction mode parameters of the current component block.
  • the prediction mode parameter may indicate whether the current component block can use GPM mode or AWP mode, that is, indicate whether the current component block can use K different prediction modes for prediction processing.
  • the prediction mode parameter can be understood as a flag indicating whether the GPM mode or the AWP mode is used.
  • the encoder can use a variable as the prediction mode parameter, so that the prediction mode parameter can be set by setting the value of the variable. For example, in this application, if the current component block uses GPM mode or AWP mode, then the encoder can set the value of the prediction mode parameter to indicate that the current component block uses GPM mode or AWP mode. Specifically, the encoder can Set the value of the variable to 1.
  • the encoder can set the value of the prediction mode parameter to indicate that the current component block does not use GPM mode or AWP mode.
  • the controller can set the variable value to 0.
  • the encoder after the encoder completes setting the prediction mode parameters, it can write the prediction mode parameters into the code stream and transmit it to the decoder, so that the decoder can parse the code stream after Get prediction mode parameters.
  • the decoder decodes the code stream to obtain the prediction mode parameters, and then determines whether the current component block uses GPM mode or AWP mode based on the prediction mode parameters. If the current component block uses GPM mode or AWP mode, K different predictions are used When the mode performs prediction processing, the weight derivation mode of the current component block is determined.
  • the embodiment of the present application can also conditionally limit the use of GPM mode or AWP mode for the current component block, that is, when judging that the current component block meets the preset conditions, determine the use of the current component block.
  • K prediction modes are used for weighted prediction, and then the decoder decodes the code stream to determine the first combination.
  • the size of the current component block may be limited.
  • the decoder can first determine the size parameter of the current component block, and then determine whether the current component block uses the GPM mode or the AWP mode according to the size parameter.
  • the size parameters of the current component block may include the height and width of the current component block. Therefore, the decoder may determine whether the current component block uses GPM mode or AWP mode according to the height and width of the current component block.
  • the current component block can use the GPM mode or the AWP mode. It can be seen that one possible limitation is to use the GPM mode or the AWP mode only when the width of the block is greater than (or greater than or equal to) the first threshold, and the height of the block is greater than (or greater than or equal to) the second threshold.
  • the values of the first threshold and the second threshold may be 4, 8, 16, 32, 128, 256, etc., and the first threshold may be equal to the second threshold.
  • the current component block can use the GPM mode or the AWP mode. It can be seen that one possible limitation is to use the GPM mode or the AWP mode only when the width of the block is less than (or less than or equal to) the third threshold, and the height of the block is greater than (or greater than or equal to) the fourth threshold.
  • the values of the third threshold and the fourth threshold may be 4, 8, 16, 32, 128, 256, etc., and the third threshold may be equal to the fourth threshold.
  • the size of blocks that can use the GPM mode or the AWP mode can also be limited by limiting the pixel parameters.
  • the decoder can first determine the pixel parameters of the current component block, and then further determine whether the current component block can use the GPM mode or the AWP mode based on the pixel parameters and the fifth threshold. It can be seen that one possible limitation is to use the GPM mode or the AWP mode only when the number of pixels of the block is greater than (or greater than or equal to) the fifth threshold.
  • the value of the fifth threshold may be 4, 8, 16, 32, 128, 256, 1024, etc.
  • the current component block can use the GPM mode or the AWP mode only if the size parameters of the current component block meet the size requirements.
  • this application there may be a frame-level flag to determine whether the current frame to be decoded uses this application. For example, you can configure intra-frame frames (such as I frames) to use this application, but inter-frame frames (such as B frames and P frames) not to use this application. Or you can configure intra-frame frames not to use this application and inter-frame frames to use this application. Or you can configure some interframes to use this application and some interframes not to use this application. Inter frames can also use intra prediction, so it is also possible for inter frames to use this application.
  • intra-frame frames such as I frames
  • inter-frame frames such as B frames and P frames
  • a flag below the frame level and above the CU level such as tile, slice, patch, LCU, etc.
  • the embodiment of the present application does not limit the specific method of decoding the code stream and determining the first combination in S101.
  • the first combination is a preset combination, that is to say, the decoder decodes the code stream, and when it is determined that the current component block can be predicted using the first combination, the preset combination is determined as the first combination, and The current component block is predicted using the first weight derivation mode and the K first prediction modes included in the first combination.
  • the first combination is determined from a plurality of preset combinations.
  • multiple preset combinations include any number of combinations such as 2, 3, 4, 5, 6, 7, 8, 9, etc. It is assumed that 8 combinations are included, each combination includes a weight derivation mode and K prediction modes, and these 8 combinations have different identifiers (or indexes).
  • the decoding end can obtain the first index by decoding the code stream, and the first index is used to indicate the first combination. Then, the combination corresponding to the first index is queried among the plurality of preset combinations, and the combination corresponding to the first index is determined as the first combination.
  • both the decoding end and the encoding end determine a list, which includes multiple candidate combinations. Therefore, the list is also called a candidate combination list, and the first index corresponding to the first index is determined from this candidate combination list. combination.
  • the above S101 includes the following steps:
  • the candidate combination list includes at least one candidate combination, and any candidate combination in the at least one candidate combination includes a weight derivation mode and K prediction modes;
  • the above candidate combination list includes at least one candidate combination, and any candidate combination in the at least one candidate combination includes a weight derivation mode and K prediction modes.
  • Candidate combination 0 Candidate combination 1 (including one weight derivation mode and K prediction modes) 1
  • Candidate combination 2 (including a weight derivation mode and K prediction modes) ...
  • ... i-1 Candidate combination i (including a weight derivation mode and K prediction modes) ... ...
  • the candidate combination list includes at least one candidate combination, and any two candidate combinations in this at least one candidate combination are not exactly the same, that is, any two candidate combinations include at least one of the weight derivation modes and K prediction modes.
  • a pattern is different.
  • the weight derivation modes in candidate combination 1 and candidate combination 2 are different, or the weight derivation modes in candidate combination 1 and candidate combination 2 are the same, and at least one prediction mode among the K prediction modes is different, or candidate combination 1 and candidate combination
  • the weight derivation modes in 2 are different, and at least one of the K prediction modes is different.
  • the above-mentioned Table 5 uses the ordering of the candidate combinations in the candidate combination list as the index.
  • the index of the candidate combinations in the candidate combination list can also be reflected in other ways, and this embodiment of the present application does not limit this.
  • the decoder determines the first combination according to the candidate combination list, including but not limited to the following:
  • Method 1 The candidate combination list includes one candidate combination. At this time, the candidate combination included in the candidate combination list is determined as the first combination.
  • the candidate combination list includes multiple candidate combinations.
  • the code stream is decoded to obtain the first index.
  • the first index is used to indicate the first combination; the candidate combination corresponding to the first index in the candidate combination list is determined. For the first combination.
  • the decoder decodes the code stream to obtain the first index, and determines the candidate combination list as shown in Table 5 above. It performs a query in the candidate combination list according to the first index to obtain the candidate combination indicated by the first index. The first combination.
  • the first index is index 1.
  • the candidate combination corresponding to index 1 is candidate combination 2. That is to say, the first combination indicated by the first index is candidate combination 2.
  • the decoder determines the weight derivation mode and K prediction modes included in candidate combination 1 as the first weight derivation mode and K first prediction modes included in the first combination, and uses the first weight derivation mode and K A first prediction mode predicts the current component block to obtain the predicted value of the current component block.
  • the encoding end and the decoding end can respectively determine the same candidate combination list.
  • the encoding end and the decoding end both determine a list including N candidate combinations, and each candidate combination includes 1 weight derivation mode and K Prediction mode. If N is greater than 1, then in the code stream, the encoding end only needs to write one candidate combination finally selected, such as the first combination, and the decoding end parses the first combination finally selected by the encoding end, specifically the decoding end decodes the code stream.
  • the first index is obtained, and the first combination is determined from the candidate combination list determined by the decoding end through the first index.
  • the embodiment of this application does not limit the specific syntax element form of the first index.
  • gpm_cand_idx is used to represent the first index.
  • the first index may also be called a first combination index or an index of the first combination.
  • the syntax after adding the first index to the code stream is as shown in Table 6:
  • gpm_cand_idx is the first index.
  • the embodiment of the present application uses the first weight derivation mode corresponding to the current component block and the K first prediction modes as a combination, that is, the first combination, and uses the first index to perform the first combination Instruction: Compared with instructing the first weight derivation mode and the K first prediction modes separately, the embodiment of the present application uses fewer codewords, thereby reducing the coding cost.
  • the above candidate combination list is preset.
  • the candidate combination list is sent by the encoding end to the decoding end.
  • the encoding end sends it to the decoding end before encoding the current component block.
  • the above candidate combination list is uploaded to the cloud by the encoding end, and the decoding end can read the candidate combination list from the cloud.
  • the above candidate combination list is constructed by the decoding end.
  • the embodiment of the present application does not limit the way in which the decoding end constructs the candidate combination list. For example, information related to the current component block is used to analyze the probability of occurrence of each combination composed of different weight derivation modes and different prediction modes, and a candidate combination list is constructed based on the probability of occurrence of each combination.
  • the information related to the current component block includes mode information of surrounding blocks of the current component block, reconstructed pixels of the first component block corresponding to the current component block, etc.
  • the decoding end constructs a candidate combination list through the following steps of S101-A1:
  • VVC video coding and decoding
  • images are divided into CTUs.
  • the CTU size allowed by VVC is 128x128.
  • the CTU can be further divided into more flexible CU (coding unit).
  • VVC supports binary tree, ternary tree, and quadtree division methods.
  • Figures 17A to 17D are schematic diagrams of vertical binary tree, horizontal binary tree, vertical ternary tree, and horizontal ternary tree division respectively.
  • Figure 17E is a schematic diagram of CTU division, in which the blocks with thick borders are divided by quadtree, and the blocks with thin borders are divided by binary tree and ternary tree. It can be seen that some blocks after division can be further divided. Of course, some restrictions will be imposed for the sake of performance and complexity trade-offs. This is not limited in the embodiment of the present application.
  • YUV4:2:0 the most commonly supported video codec
  • Y represents the brightness component
  • UV the chrominance component respectively.
  • the YUV4:2:0 format takes advantage of the fact that the human eye is sensitive to brightness but not sensitive to chroma. It reduces the sampling rate of chroma compared to brightness, that is, the horizontal and vertical directions are pixels for every two brightness components. A pixel corresponding to one chroma component U or V, which can help improve compression efficiency. Since the human eye is sensitive to brightness but insensitive to chroma, the brightness component is more important. Therefore, the general video coding and decoding standards will encode the brightness component first and then the chroma component.
  • the luminance component and the chrominance component adopt the same block partitioning method.
  • the block division of chroma components may also be different from that of luminance components. For example, as shown in FIG. 17F , the block division of the luminance component on the left is finer, while the division of the chrominance component on the right is coarser.
  • the video codec not only supports YUV4:2:0 format, but also supports other formats, such as YUV4:4:4, YUV4:2:1, RGB, etc.
  • the current component block is the gray component block on the right
  • the first component block in the same space as the gray component block is the gray area on the left in Figure 17F
  • the gray area on the left includes 10 The first component CU.
  • the first component block in the same space as the current component block refers to the first component block that is located in the same spatial position and has the same spatial size as the current component block.
  • the current component block as a chrominance block and the first component block as a luminance block as an example
  • the sizes of the chroma block and the luminance block may be different.
  • the chroma block is the same as the size of the luma block.
  • the size of the luma block is 4 times the size of the chroma block.
  • chroma blocks and luma blocks with the same spatial position and the same spatial size may not have the same coordinates.
  • the chroma block is a block determined by the upper left corner coordinates (x0, y0), the width is width, and the height is height.
  • the brightness block in the same space can be the upper left corner coordinates (x0 *2, y0*2), a block whose width is width*2 and height is determined by height*2.
  • the chroma block is a block determined by the coordinates of the upper left corner as (x0, y0), the width as width, and the height as height. Then the brightness block in the same space can have the coordinates of the upper left corner as ( x0, y0), a block whose width is width and height is determined by height.
  • the luma block corresponding to the chroma decoding block may not coincide with the decoding block into which the luma component has been divided, but in The spatial position, spatial size and luminance area corresponding to the chroma decoding block. That is to say, in this embodiment of the present application, the first component block corresponding to the current component block can be understood as the first component block whose spatial coverage range is the same as that of the current component block.
  • the luminance component is usually decoded first, and then the chrominance component is decoded. Therefore, in the embodiment of the present application, when decoding the current component block, the code stream is first decoded, and the first component block corresponding to the current component block is decoded to obtain the reconstructed value of the first component block. Then, the first component block is used as a template of the current component block, and the current component block is decoded.
  • the embodiment of the present application constructs a candidate combination list of the current component block based on the first component block.
  • the combination to predict the first component block For example, for each combination, use the combination to predict the first component block, obtain the predicted value of the first component block under each combination, and construct a candidate combination list based on the predicted value of the first component block under each combination.
  • use the weight derivation mode included in the combination to derive the weight of the first component block use the K prediction modes included in the combination to predict the first component block respectively, and obtain K predicted values of the first component block, according to The derived weight of the first component block is weighted on the K predicted values of the first component block to obtain the predicted value of the first component block under the combination.
  • a candidate combination list is constructed based on the predicted value of the first component block under each combination.
  • the above-mentioned weights derived according to the weight derivation mode can be understood as deriving the weight corresponding to each pixel point in the first component block, or can also be understood as deriving the weight matrix corresponding to the first component block.
  • K predicted values corresponding to each pixel point in the first component block may be determined, and based on the K predicted values and weight corresponding to each pixel point, the The predicted value corresponding to each pixel point and the predicted value corresponding to each pixel point in the first component block constitute the predicted value of the first component block.
  • it can also be performed on a block basis. For example, the predicted value of the first component block is determined, and the K of the first component block is determined according to the weight matrix of the first component block. The predicted values are weighted to obtain the predicted value of the first component block.
  • S101-A2 includes the following steps of S101-A21 to S101-A23:
  • Any second combination among the R second combinations includes a weight derivation mode and K prediction modes, and R is a positive integer greater than 1;
  • the decoder when constructing the candidate combination list, the decoder first determines R second combinations.
  • This application does not limit the specific values of the R second combinations, such as 8, 16, 32, etc.
  • the R second combinations are Each second combination among the combinations includes a weight derivation mode and K prediction modes.
  • a candidate combination list is constructed based on the cost corresponding to each of the R second combinations.
  • the decoder can obtain the reconstructed value of the first component block, so that for each of the R second combinations, the The predicted value of the first component block and the reconstructed value of the first component block are calculated to determine the prediction distortion cost corresponding to the second combination.
  • the methods for determining the cost corresponding to the second combination include but are not limited to SAD, SATD, SEE, etc. Then, a candidate combination list is constructed based on the cost corresponding to each of the R second combinations.
  • the cost corresponding to the second combination includes at least two methods:
  • the first way is to determine the weight of the first component block according to the weight derivation mode included in the second combination; predict the first component block according to the K prediction modes in the second combination to obtain the K number of the first component block. Predicted value; weight the K predicted values of the first component block according to the weight of the first component block to obtain the predicted value of the first component block corresponding to the second combination; according to the predicted value of the first component block corresponding to the second combination and the reconstruction value of the first component block to determine the cost corresponding to the second combination.
  • the second way is to determine the predicted values of the first component blocks corresponding to the K prediction modes in the second combination according to the weight derivation modes in the second combination; according to the first components corresponding to the K prediction modes in the second combination.
  • the predicted value of the block and the reconstructed value of the first component block determine the costs corresponding to the K prediction modes in the second combination; determine the costs corresponding to the second combination based on the costs corresponding to the K prediction modes in the second combination.
  • the weight on the first component block can be simplified to only two possibilities: 0 and 1. Then for each pixel position, its pixel value only comes from A prediction block in the first prediction mode or a prediction block in the second prediction mode. Therefore, for a prediction mode, the cost on the first component block when it is the first prediction mode of a certain weight derivation mode can be calculated, that is, only the cost of this prediction mode when it is the first prediction mode of this weight derivation mode is calculated. The cost incurred by some pixels with a weight of 1 on the first component block in prediction mode.
  • An example is to record the cost as cost[pred_mode_idx][gpm_idx][0], where pred_mode_idx represents the index of the prediction mode, gpm_idx represents the index of the weight derivation mode, and 0 represents the first prediction mode.
  • the cost on the first component block when the prediction mode is used as the second prediction mode of a certain weight derivation mode that is, only the cost of the prediction mode with a weight of 1 when used as the second prediction mode in the weight derivation mode is calculated
  • the cost incurred by some pixels on the first component block is to record the cost as cost[pred_mode_idx][gpm_idx][1], where pred_mode_idx represents the index of the prediction mode, gpm_idx represents the index of the weight derivation mode, and 1 represents the second prediction mode.
  • the cost of the prediction modes pred_mode_idx0 and pred_mode_idx1 in the weight derivation mode gpm_idx is required, where pred_mode_idx0 is the first prediction mode and pred_mode_idx1 is the second prediction mode.
  • pred_mode_idx0 and pred_mode_idx1 are used as the first prediction mode and pred_mode_idx0 is used as the second prediction mode.
  • cost[pred_mode_idx][gpm_idx][0] and cost[pred_mode_idx][gpm_idx][1] are reused, thereby reducing the amount of calculation.
  • the cost corresponding to each of the R second combinations can be determined, and then S101-A23 is executed.
  • the method of constructing the candidate combination list based on the cost corresponding to each of the R second combinations includes but is not limited to the following examples:
  • Example 1 Sort the R second combinations according to the cost corresponding to each of the R second combinations; determine the sorted R second combinations as a candidate combination list.
  • the candidate combination list generated in this example 1 includes R candidate combinations.
  • the R candidate combinations in the candidate combination list are sorted according to the cost from small to large, that is, the costs corresponding to the R candidate combinations in the candidate combination list increase in order.
  • sorting the R second combinations according to the cost corresponding to each of the R second combinations may be to sort the R second combinations in order from small to large costs.
  • Example 2 According to the cost corresponding to the second combination, N second combinations are selected from R second combinations, and the list composed of these N second combinations is determined as a candidate combination list.
  • the above-mentioned N second combinations are the top N second combinations with the smallest cost among the R second combinations. For example, according to the cost corresponding to each of the R second combinations, from the R second combinations The N second combinations with the smallest cost are selected to form a candidate combination list. At this time, the candidate combination list includes N candidate combinations.
  • the above R second combinations are preset. In this way, each of the preset R second combinations is used to predict the first component block, and the predicted value of the first component block corresponding to each second combination is obtained, and then the predicted value of the first component block corresponding to each second combination is obtained. The predicted value of the first component block and the reconstructed value of the first component block are used to determine the cost corresponding to each second combination. According to the cost corresponding to each second combination, the R second combinations are sorted, and the sorted R second combinations as a candidate combination list, or N second combinations with the smallest cost are selected from the sorted R second combinations to form a candidate combination list.
  • R second combinations based on P weight derivation modes and Q prediction modes. Any second combination among the R second combinations includes a weight derivation mode among the P weight derivation modes and For the K prediction modes among the Q prediction modes, P is a positive integer, and Q is a positive integer greater than or equal to K.
  • the decoder first determines P weight derivation modes and Q prediction modes, and then constructs R second combinations based on the determined P weight derivation modes and Q prediction modes.
  • the second combination includes a weight derivation mode and two prediction modes.
  • the P weight derivation modes are weight derivation mode 1 and weight derivation mode 2
  • the Q prediction modes are prediction mode 1, prediction mode 2, and prediction mode.
  • Mode 3 these 2 weight derivation modes and 3 prediction modes can be combined into a total of 12 second combinations of 2X3X2.
  • the current component block is an intra-frame coding block. It is assumed that there are 64 possible weight derivation modes of GPM and 67 possible intra-frame prediction modes of GPM. These can be obtained from the VVC standard. turn up. But it does not limit the possible weights of GPM to only 64, or which 64. It should be noted that the reason why VVC’s GPM chooses 64 is also a trade-off between improving the prediction effect and increasing the overhead in the code stream. . This application no longer uses a fixed logic to encode the weight derivation mode, so in theory this application can use more diverse weights and use them more flexibly. Similarly, it does not limit GPM to only 67 intra prediction modes, or which 67 types it is.
  • Theoretically all possible intra prediction modes can be used in GPM. For example, if the intra-frame angle prediction mode is made more detailed and generates more intra-frame angle prediction modes, then GPM can also use more intra-frame angle prediction modes.
  • the MIP (matrix-based intra prediction) mode of VVC can also be used in this application. However, considering that MIP has multiple sub-modes to choose from, MIP is not added to this embodiment for ease of understanding. There are also some wide-angle modes that can also be used in this application and will not be described in this embodiment.
  • the P weight derivation modes are all possible weight derivation modes, such as the 64 weight derivation modes in GPM
  • the Q prediction modes are all possible prediction modes, such as the 67 intra prediction modes of GPM
  • each prediction mode in order to reduce the amount of data and improve the construction speed of the candidate combination list, each prediction mode is not tried, and some of the prediction modes may be selected to try.
  • the implementation methods for determining the Q prediction modes in the above S101-A21-1 include but are not limited to the following methods:
  • the Q prediction modes are preset prediction modes.
  • Method 2 Determine at least one of the candidate prediction mode list of the current component block, the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode, according to the candidate prediction mode list, Q prediction modes are determined from at least one of the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode.
  • the candidate prediction mode list includes multiple candidate prediction modes, and the candidate prediction mode list corresponding to any one of the K prediction modes includes at least one candidate prediction mode.
  • Q prediction modes are determined according to the candidate prediction mode list of the current component block.
  • Q prediction modes are determined according to the candidate prediction mode lists respectively corresponding to the K first prediction modes.
  • Q prediction modes are determined according to the prediction modes corresponding to the weight derivation modes.
  • Q prediction modes are determined according to the preset mode.
  • Q prediction modes are determined according to the candidate prediction mode list of the current component block and the candidate prediction mode lists respectively corresponding to the K first prediction modes.
  • Q prediction modes are determined according to the candidate prediction mode list of the current component block and the prediction mode corresponding to the weight derivation mode.
  • Q prediction modes are determined based on the candidate prediction mode lists corresponding to the K first prediction modes and the prediction modes corresponding to the weight derivation modes.
  • Q prediction modes are determined according to the candidate prediction mode list, the candidate prediction mode list corresponding to the K first prediction modes, and the prediction modes corresponding to the weight derivation mode.
  • Q prediction modes are determined according to the candidate prediction mode list, the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode.
  • determining the candidate prediction mode list corresponding to the K first prediction modes can be understood as determining an alternative prediction mode list for each of the K first prediction modes, and then constructing the second combination later.
  • a certain prediction mode in the second combination is selected from the list of candidate prediction modes corresponding to the prediction mode.
  • the decoder constructs an alternative prediction mode list 1 for the first prediction mode, and constructs an alternative prediction mode list 1 for the second prediction mode.
  • Select prediction mode list 2 select prediction mode list 2.
  • an alternative prediction mode is selected from the alternative prediction mode list 1 as the first prediction mode
  • an alternative prediction mode is selected from the alternative prediction mode list 2 as the third prediction mode.
  • Two prediction modes, such a weight derivation mode, and the currently selected first prediction mode and the second prediction mode form a second combination.
  • the embodiment of the present application does not limit the method of determining the candidate prediction mode list corresponding to each prediction mode among the K first prediction modes.
  • a candidate prediction mode list corresponding to the prediction mode and at least one of the prediction modes corresponding to the weight derivation mode are determined; according to the candidate At least one of the prediction modes corresponding to the prediction mode list and the weight derivation mode determines the candidate prediction mode list corresponding to the prediction mode.
  • the process of determining the candidate prediction mode list corresponding to one of the K first prediction modes is basically similar to the process of determining the candidate prediction mode list corresponding to the current component block.
  • the process of determining the candidate prediction mode list corresponding to the current component block is basically similar to the process of determining the candidate prediction mode list corresponding to the current component block.
  • the candidate prediction mode list includes one or more inter prediction modes, for example, at least one of skip, merge, common inter prediction mode, unidirectional prediction, bidirectional prediction, multi-hypothesis prediction, etc.
  • the candidate prediction mode list includes one or more intra prediction modes, for example, at least one of a direct current (DC) mode, a planar (PLANAR) mode, an angle mode, and the like.
  • the above candidate prediction mode list includes at least one intra prediction mode in the MPM list.
  • the above list of candidate prediction modes may also include modes such as IBC and palette.
  • This application does not limit the types of prediction modes and the number of prediction modes included in the candidate prediction mode list.
  • the candidate prediction mode list is determined in at least one of the following ways:
  • Method 1 the candidate prediction mode list includes a preset mode.
  • Method 2 The candidate prediction mode list includes modes in the MPM list.
  • the first candidate intra prediction mode list may be an MPM list of the current component block.
  • the current component block may obtain an MPM list of length 6.
  • there is a secondary MPM solution which may derive an MPM list with a length of 22. It can also be said that the combined length of the first MPM list and the second MPM list is 22. That is to say, in this embodiment of the present application, MPM can be used to filter intra prediction modes.
  • the preset mode is added to the candidate prediction mode list.
  • the above-mentioned preset modes are several preset prediction modes.
  • the above-mentioned preset mode includes at least one of DC, horizontal mode, and vertical mode.
  • the preset mode is determined by determining the image type corresponding to the current component block and based on the image type corresponding to the current component block.
  • I slice can only have intra-coded blocks
  • B slice and P slice can have both intra-coded blocks and inter-coded blocks. That is to say, the current component block in I slice is surrounded by intra-frame coded blocks, while in B slice and P slice, the current component block in B slice and P slice is surrounded by intra-frame coded blocks or inter-frame coded blocks. Therefore, for some intra-frame GPM methods in this application, they can obtain more relevant information in I slice, such as the intra-frame prediction mode of adjacent blocks. The relevant information obtained in B slice and P slice is relatively less. Thus different rules can be set for different image types.
  • the candidate prediction mode list when constructing the candidate prediction mode list, if the image type corresponding to the current component block is B type or P type, add more preset modes, such as adding some more on the basis of DC, horizontal mode and vertical mode. Other angle modes, such as upper-right direction (Mode 2 in VVC), lower-left direction (Mode 66 in VVC), upper-left direction (Mode 34 in VVC), etc. Or use different limits on the number of candidate prediction mode lists for blocks of different image types, etc.
  • the above method of determining the image type corresponding to the current component block may be to determine the image type corresponding to the current component block based on the image type of the current image to which the current component block belongs or the image type of the current slice to which the current component block belongs. For example, the image type of the current image to which the current component block belongs or the image type of the current slice to which the current component block belongs is determined as the image type corresponding to the current component block.
  • a preset mode can be added under certain conditions.
  • An example is to add it when the number of prediction modes in the candidate prediction mode is less than, or less than or equal to a threshold.
  • This threshold can be 3, 4, 5, 6, etc. .
  • Method 3 The above list of candidate prediction modes includes a set of candidate prediction modes determined according to some rules, such as equal-spaced filtering, etc.
  • Method 4 Determine a candidate prediction mode list based on the prediction mode used by at least one block adjacent to the current component block.
  • the prediction modes used by one or more blocks adjacent to the current component block are added to the candidate prediction mode list to obtain the candidate prediction mode list of the current component block, or the kth prediction mode correspondence among the K prediction modes is obtained.
  • the prediction mode corresponding to the k-th prediction mode among the prediction modes used by one or more blocks adjacent to the current component block is added to the candidate prediction mode list corresponding to the k-th prediction mode.
  • the k-th prediction mode is the first prediction mode
  • the two blocks adjacent to the current component block are also assumed to use two prediction modes for weighted prediction, in which the first adjacent block uses
  • the two prediction modes are prediction mode 1 and prediction mode 3 respectively
  • the two prediction modes used by the second adjacent block are prediction mode 4 and prediction mode 5 respectively.
  • prediction mode 1 and prediction mode 4 can be added to the list of candidate prediction modes corresponding to the first prediction mode.
  • Method 5 Determine the image type corresponding to the current component block, and determine the candidate prediction mode list according to the image type corresponding to the current component block. For example, if the image type corresponding to the current component block is B type or P type, DC, at least one of horizontal mode, vertical mode and some angle modes can be added to the first candidate prediction mode list. For another example, if the image type corresponding to the current component block is type I, at least one of DC, horizontal mode, and vertical mode can be added to the candidate prediction mode list.
  • Method 6 Determine the second prediction mode used by at least one component block (such as chroma block and/or luma block) among the first component block, the second component block and the third component block at the preset position, and the surroundings of the current component block.
  • the third prediction mode used by at least one of the decoded first component block, the second component block and the third component block (for example, the luma block and/or the chrominance block), and the internal preset area correspondence of the current component block At least one of the fourth prediction mode used by the first component block (such as the luminance block) and the fifth prediction mode related to the first component block corresponding to the current component block; according to the second prediction mode, the third prediction mode, At least one of the fourth prediction mode and the fifth prediction mode determines a candidate prediction mode list of the current component block.
  • At least one of the decoded first component block, second component block and third component block surrounding the current component block includes the decoded area above and/or to the left of the current component block.
  • the prediction mode used by blocks 0 to 5 is selected as the second prediction mode
  • the prediction mode used by at least one block represented by the ellipsis between block 2 and block 3 is selected as the second prediction mode.
  • the first component block in this embodiment may be a luma CU
  • the second component block and/or the third component block may be a chroma CU.
  • the decoded luma CUs surrounding the current component block and /Or the prediction mode used by the chroma CU is determined as the second prediction mode.
  • the internal preset area of the current component block may be any area inside the current component block.
  • the first component block corresponding to the internal area of the current component block can be understood as the first component block that is in the same space as the internal area of the current component block.
  • the first component block may be a brightness CU. For example, according to the coordinates of the upper left corner vertex of the internal area of the current component block, the brightness CU corresponding to the coordinates is mapped, and then the prediction mode used by the brightness CU is determined as the fourth prediction mode.
  • the method of determining the fifth prediction mode related to the first component block corresponding to the current component block includes at least the following examples:
  • Example 1 Since the first component block corresponding to the current component block has been decoded, the prediction mode used by the first component block is determined as the fifth prediction mode.
  • the first component block may include multiple first component CUs, and the prediction modes used by the multiple first component CUs may be the same or different.
  • the first component block may be The prediction mode used by at least one first component CU among the plurality of first component CUs included in the component block is determined as the fifth prediction mode.
  • Example 2 Determine the fifth prediction mode according to the texture of the first component block corresponding to the current component block. For example, the texture direction of the first component block is determined; and the fifth prediction mode is determined according to the texture direction.
  • the embodiment of the present application does not limit the specific method of determining the texture direction of the first component block corresponding to the current component block.
  • the texture direction of certain points in the first component block corresponding to the current component block is determined, and the texture direction of the first component block is determined based on the texture directions of these points.
  • the points in the first component block that need to determine the texture direction are recorded as texture points. These texture points may be default.
  • the encoding end and the decoding end use some points in the first component block as texture points by default and calculate their texture directions.
  • the texture points are selected according to a preset method. For example, the decoder selects multiple texture points in the first component block according to a preset texture point selection method.
  • each texture point in the plurality of texture points determine the gradient of each texture point, for example, determine the horizontal gradient and vertical gradient of each texture point, and then based on the horizontal gradient and vertical gradient of each texture point, Determine the texture direction of each texture point.
  • the texture direction of the first component block is determined.
  • one or more of the texture directions respectively corresponding to the plurality of texture points are determined as the texture directions of the first component block.
  • any one or more of the texture directions respectively corresponding to the plurality of texture points are determined as the texture directions of the first component block.
  • one or more of the texture directions corresponding to the plurality of texture points that appear the most frequently are determined as the texture directions of the first component block.
  • the fifth prediction mode is determined based on the texture direction.
  • the prediction mode in which the prediction direction is parallel to the texture direction is determined as the fifth prediction mode.
  • the prediction mode in which the prediction direction is perpendicular to the texture direction is determined as the fifth prediction mode.
  • the prediction mode in which the prediction direction is parallel to the texture direction and the prediction mode in which the prediction direction is perpendicular to the texture direction are determined as the fifth prediction mode.
  • prediction mode in which the prediction direction is parallel to the texture direction includes prediction modes in which the prediction direction is parallel and/or approximately parallel to the texture direction.
  • Prediction modes in which the prediction direction is perpendicular to the texture direction include prediction modes in which the prediction direction is perpendicular and/or approximately perpendicular to the texture direction.
  • the candidate prediction mode list includes at least one of a candidate intra prediction mode list and a candidate inter prediction mode list.
  • the candidate intra prediction mode list includes at least one candidate intra prediction mode
  • the candidate inter prediction mode list includes at least one candidate inter prediction mode.
  • Q prediction modes are determined according to the candidate prediction mode list, for example, all or part of the candidate prediction modes included in the candidate prediction mode list are determined as Q prediction modes. all or part of.
  • the prediction mode corresponding to the weight derivation mode is a general term. For example, it may be the prediction mode corresponding to one preset weight derivation mode, or the prediction mode corresponding to several preset weight derivation modes. In some embodiments, the prediction mode corresponding to the weight derivation mode can also be understood as a prediction mode list corresponding to the weight derivation mode, and the prediction mode list includes at least one prediction mode.
  • the prediction mode corresponding to the above-mentioned weight derivation mode includes a prediction mode corresponding to at least one weight derivation mode among the P weight derivation modes.
  • determining the prediction mode corresponding to the weight derivation mode includes: for the p-th weight derivation mode among the P weight derivation modes, determining the prediction mode corresponding to the p-th weight derivation mode, and based on at least one weight among the P weight derivation modes Determine the prediction mode corresponding to the derivation mode, and determine the prediction mode corresponding to the above-mentioned weight derivation mode, where p is a positive integer.
  • the process of determining the prediction mode corresponding to each of the P weight derivation modes is basically the same.
  • the following takes the p-th weight derivation mode among the P weight derivation modes as an example. illustrate.
  • determining the prediction mode corresponding to the p-th weight derivation mode includes the following two methods:
  • Method 1 if at least one of the prediction modes corresponding to the p-th weight derivation mode is an intra-frame prediction mode, determine the angle index according to the p-th weight derivation mode; determine the intra-frame prediction mode corresponding to the angle index as the p-th At least one of the prediction modes corresponding to the weight derivation modes.
  • the angle index is used to indicate the angle index of the weighted dividing line.
  • the angle index is represented by the field angleIdx.
  • Table 2 shows the corresponding relationship between merge_gpm_partition_idx and angleIdx.
  • the angle index can be derived according to the p-th weight derivation mode.
  • the angle index has a corresponding relationship with the intra prediction mode, that is, different angle indexes correspond to different intra prediction modes.
  • the angle index and the intra prediction mode have a corresponding relationship as shown in Table 7:
  • the angle index is determined according to the p-th weight derivation mode, for example, according to the above Table 2, The angle index corresponding to the p-th weight derivation mode.
  • the intra prediction mode corresponding to the angle index is determined. For example, the angle index is 2, and the corresponding intra prediction mode is 42, and then the intra prediction mode 42 is determined as the first prediction mode or a second prediction mode.
  • Method 2 If at least one of the prediction modes corresponding to the p-th weight derivation mode is an intra-frame prediction mode, determine the intra-frame prediction mode corresponding to the p-th weight derivation mode; At least one of the prediction modes is determined to be at least one of the prediction modes corresponding to the p-th weight derivation mode.
  • the intra prediction mode corresponding to the p-th weight derivation mode includes at least one of an intra prediction mode in which the prediction direction is parallel to the dividing line of the weight, an intra prediction mode in which the prediction direction is perpendicular to the dividing line, and a planar mode.
  • the intra prediction mode in which the prediction direction is parallel to the dividing line of the weight includes one or several intra prediction modes in which the prediction direction is parallel or approximately parallel to the dividing line of the weight.
  • the intra prediction mode in which the prediction direction is perpendicular to the dividing line of the weight includes one or several intra prediction modes in which the prediction direction is perpendicular or approximately perpendicular to the dividing line of the weight.
  • the first prediction mode and/or the second prediction mode are intra prediction modes
  • the first prediction mode and/or the second prediction mode are derived from weights. Determined from the intra prediction mode corresponding to the mode.
  • the first prediction mode and/or the second prediction mode may be an intra prediction mode that is on the same straight line as the weight dividing line (also called the dividing line) or is approximately on the same straight line.
  • the first prediction mode and/or the second prediction mode may be an intra prediction mode in which the prediction direction is perpendicular or approximately perpendicular to the weight dividing line.
  • the dividing line of weights is horizontal, such as the modes with GPM indexes 18, 19, 50, and 51 in Figure 4.
  • the first prediction mode and/or the second prediction mode are horizontal mode 18 or vertical. Orientation mode 50.
  • the decoder determines the prediction mode corresponding to at least one of the P weight derivation modes according to the above steps, and then determines the prediction mode corresponding to the weight derivation mode based on the prediction mode corresponding to at least one of the P weight derivation modes. . For example, all or part of the prediction mode corresponding to at least one of the P weight derivation modes is used as the prediction mode corresponding to the weight derivation mode.
  • the duplicate prediction modes will be eliminated, and the remaining different prediction modes will be determined as the prediction modes corresponding to the weight derivation modes.
  • the prediction modes are screened. Specifically, Q prediction modes are determined according to the above method.
  • the number of the Q prediction modes is limited.
  • Q is less than or equal to the first preset threshold.
  • This application does not specify the specific value of the first preset threshold.
  • the restriction can be determined according to actual needs.
  • the first preset threshold is 6, that is, 6 prediction modes are selected to construct R second combinations to control the number of second combinations.
  • the size of Q is related to the size and/or shape of the current component block, where the shape of the current component block can be understood to be determined by the aspect ratio of the current component block.
  • the embodiment of the present application sets different Q values for blocks of different sizes, that is, a larger Q value is set for larger blocks, and a smaller Q value is set for smaller blocks.
  • the Q value corresponding to the current component block it is set according to the size of the current component block. For example, if the size of the current component block is greater than the first value, then Q is greater than or equal to the second preset threshold. For another example, if the size of the current component block is less than or equal to the first value, Q is less than the third preset threshold.
  • the embodiments of the present application do not limit the specific sizes of the first value, the second prediction threshold, and the third preset threshold, where the third preset threshold is smaller than the second preset threshold.
  • the methods for determining P weight derivation modes include at least the following methods:
  • Method 1 Select P weight derivation modes from the preset M weight derivation modes, where M is a positive integer greater than or equal to P.
  • GPM includes 64 weight derivation modes and AWP includes 56 weight derivation modes.
  • the above-mentioned M preset weight derivation modes include at least one weight derivation mode among the 64 weight derivation modes included in GPM, or at least one weight derivation mode among the 56 weight derivation modes included in AWP.
  • the M weight derivation mode of the embodiment of the present application can support more angleIdx, or angleIdx that is different from VVC.
  • the M weight derivation mode in the embodiment of the present application can support more distanceIdx, or a different distanceIdx from VVC.
  • the above-mentioned M preset weight derivation modes may be derived through preset weight derivation modes.
  • the embodiment of this application uses the weight derivation mode corresponding to AWP to determine M weight derivation modes.
  • other methods can be used to derive M weight derivation modes.
  • M weight derivation modes are determined as P weight derivation modes.
  • the preset M weight derivation modes are filtered, and P can be selected from the preset M weight derivation modes.
  • a weight derivation mode is used to construct R second combinations.
  • the weight derivation modes corresponding to the preset division angle and/or the preset offset are eliminated from the M weight derivation modes to obtain P weight derivation modes. Since the same division angle in the weight derivation mode can correspond to multiple offsets, as shown in Figure 19A, the weight derivation modes 10, 11, 12 and 13 have the same division angles but different offsets, so some presets can be removed. The weight export mode corresponding to the offset, and/or the weight export mode corresponding to some preset division angles can also be removed. Doing so reduces the total number of possible second combinations. Moreover, the differences between the possible second combinations are made more obvious.
  • the filtering conditions corresponding to different blocks may be different. In this way, when determining the P weight derivation modes corresponding to the current component block, the filtering conditions corresponding to the current component block are first determined, and the filtering conditions corresponding to the current component block are determined based on the filtering conditions corresponding to the current component block. , select P weight derivation modes from M weight derivation modes.
  • the filtering conditions corresponding to the current component block include filtering conditions corresponding to the size of the current component block and/or the filtering conditions corresponding to the shape of the current component block.
  • the above filtering conditions include an array, which includes M elements.
  • the M elements correspond to M weight derivation modes one-to-one, and the element corresponding to each weight derivation mode is used to indicate whether the weight derivation mode is available. Whether the weight derivation mode is available can be understood as whether the weight derivation mode is used to form one of the P weight derivation modes for a subsequent second combination attempt.
  • the above array can be a one-digit value or a two-digit value.
  • the value of g_sgpm_splitDir[x] is 1, which means that the weight export mode with index x is available, and 0 means that the weight export mode with index x is not available.
  • the filtering conditions corresponding to the current component block include filtering conditions corresponding to the size of the current component block and filtering conditions corresponding to the shape of the current component block, and for the same weight derivation mode, if the size of the current component block When the corresponding filtering conditions and the filtering conditions corresponding to the shape of the current component block indicate that the weight export mode is available, the weight export mode is determined to be one of the P weight export modes. If the filtering condition corresponding to the size of the current component block If at least one of the filter conditions corresponding to the shape of the current component block indicates that the weight derivation mode is unavailable, it is determined that the weight derivation mode does not constitute P weight derivation modes.
  • multiple arrays can be used to implement filtering conditions corresponding to different block sizes and filtering conditions corresponding to different block shapes.
  • the filtering conditions corresponding to different block sizes and the filtering conditions corresponding to different block shapes can be implemented using a two-digit array. That is to say, a two-digit array includes the filtering conditions corresponding to the block size. Filter conditions corresponding to block shapes are also included.
  • the filtering conditions corresponding to a block of size A and shape B are as follows.
  • the filtering conditions are represented by a two-digit array:
  • the values of g_sgpm_splitDir[x] are all 1, indicating that the weight export mode with index x is available, and one of the values of g_sgpm_splitDir[x] is 0, indicating that the weight export mode with index x is not available.
  • the above example takes the GPM including 64 weight derivation modes as an example, but the weight derivation modes in the embodiment of the present application include but are not limited to the 64 weight derivation modes included in the GPM and the 56 weight derivation modes included in the AMP. .
  • R different second combinations are formed based on the Q prediction modes and P weight derivation modes.
  • a candidate combination list is determined based on the R second combinations, and then the first weight derivation mode and K first prediction modes are determined from the candidate combination list.
  • the decoding end screens the Q prediction modes and P weight derivation modes determined above again.
  • the P weight derivation modes and Q prediction modes, forming R second combinations include the following steps from S101-A21-21 to S101-A21-23:
  • weight derivation modes with lower probability of occurrence are eliminated from the P weight derivation modes determined above, and S filtered weight derivation modes are obtained.
  • the methods for selecting S weight derivation modes from P weight derivation modes in the above S101-A11-21 include but are not limited to the following:
  • Method 1 For the i-th weight derivation mode among the P weight derivation modes, determine the weights of the K second prediction modes on the first component block according to the i-th weight derivation mode, and the K second prediction modes are Q
  • i is a positive integer from 1 to P; if the weight of any one of the K prediction modes on the first component block is less than the first preset value, then from The i-th weight derivation mode is eliminated from the P weight derivation modes, and S weight derivation modes are obtained.
  • the weight derivation mode 52 in Figure 4 makes the second prediction mode have a smaller weight on the first component block.
  • the weight derivation mode 54 which makes the second prediction mode have a smaller weight on the first component block.
  • the weight of the mode on the first component block is 0, that is, it can be considered that in the weight derivation mode 54, the second prediction mode has no impact on the first component block, and the predicted values of the first component block are all determined by the first prediction mode.
  • the second prediction mode has no effect. For such a weight derivation mode, it needs to be eliminated from the P weight derivation modes.
  • the same weight derivation mode for blocks of different shapes may have different impacts on the two prediction modes. Since the current component block may be a square or a rectangle, the length may be greater than the width or the width may be greater than the length, and the ratio may also be 1:2, 1:4, etc.
  • Figures 19A and 19B show the weight derivation modes of GPM in 32x64 blocks and 64x32 blocks. It can be seen that the intersection points of the dividing lines and block boundaries of the same weight derivation mode in different shapes are different. Because the block shape changes but the angle of the dividing line does not change according to the block shape change.
  • the weight derivation mode with index 52 in a 32x64 block, extends the interface of the weight derivation mode with index 52 to the first component block area corresponding to the current component block, and the first component block
  • the regions intersect so that the weight of the second prediction mode in the first component block is not less than the preset value, which means that the second prediction mode has an influence in the first component block.
  • the same weight derivation mode with index 52 in a 64x32 block, extends the interface of the weight derivation mode with index 52 to the first component block area corresponding to the current component block.
  • the regions of one component block do not intersect, so that the weight of the second prediction mode in the first component block is 0, which means that the second prediction mode has no influence on the first component block.
  • the weight derivation modes such that the weight of any one of the K prediction modes on the first component block is less than the first preset value are eliminated, and S weight derivation modes are obtained. model.
  • the embodiment of the present application does not limit the specific value of the above-mentioned first preset value, for example, it may be a smaller value greater than or equal to 0.
  • Method 2 For the i-th weight derivation mode among the P weight derivation modes, determine the cost when using the i-th weight derivation mode to predict the first component block, i is a positive integer from 1 to P; according to the i-th weight derivation mode For the costs corresponding to the weight derivation modes, S weight derivation modes are selected from the P weight derivation modes.
  • the weight derivation mode and K prediction modes are used as a combination to calculate the cost.
  • the costs of the P weight derivation modes are calculated.
  • Calculation means combining the P weight derivation modes with the set K prediction modes to obtain P combinations, calculating the cost corresponding to each of the P combinations, and then obtaining the costs of the P weight derivation modes.
  • the i-th weight derivation mode is composed of prediction mode 1 and prediction mode 2.
  • a combination is denoted as combination i.
  • Use combination i to predict the first component block corresponding to the current component block, and obtain the predicted value of the first component block under combination i.
  • the prediction distortion cost corresponding to the combination i is determined as the cost corresponding to the i-th weight derivation mode. In this way, the cost corresponding to any one of the P weight derivation modes can be determined.
  • S weight derivation modes are selected from the P weight derivation modes according to the cost corresponding to the i-th weight derivation mode.
  • the decoder selects S weight derivation modes from P weight derivation modes based on the cost corresponding to the i-th weight derivation mode, including the following methods:
  • the similar weight derivation mode of the i-th weight derivation mode can be understood as a weight derivation mode whose prediction result is similar to the prediction result of the i-th weight derivation mode.
  • the similar weight derivation mode of the i-th weight derivation mode includes the division angle and
  • the i-th weight derivation mode has a weight derivation mode with a similar division angle, and/or a weight derivation mode with an offset similar to the i-th weight derivation mode, where the offset of the weight derivation mode can also be It is understood as the intercept of the dividing line of the weight derivation mode on the edge of the current component block.
  • the above-mentioned similar division angles may include the same division angles but different offsets, such as the weight derivation mode 11 and the weight derivation mode 13 in Figure 4 , or may also include the same division angles and similar offsets, such as the weights in Figure 4
  • the derivation mode 11 and the weight derivation mode 12 may also include similar division angles and different offsets, such as the weight derivation mode 9 and the weight derivation mode 11 in Figure 4. They may also include similar division angles and similar offsets, such as in Figure 4 4 in weight derivation mode 9 and weight derivation mode 12.
  • the above-mentioned similar offsets may include similar offsets and the same division angle, such as the weight derivation mode 29 and the weight derivation mode 30 in Figure 4 , and may also include the same or similar offsets and similar division angles, such as in Figure 4 4 in weight derivation mode 2 and weight derivation mode 38.
  • a similar weight derivation mode of the i-th weight derivation mode may be understood as a weight derivation mode whose index is close to the index of the i-th weight derivation mode.
  • the cost corresponding to the i-th weight derivation mode is less than the second preset value, it means that when using the i-th weight derivation mode to predict the current component block, a better prediction may be achieved.
  • the i-th weight derivation mode is selected from the P weight derivation modes and used to construct subsequent R second combinations.
  • the similar weight derivation of the i-th weight derivation mode is selected from the P weight derivation modes. Pattern, used to construct subsequent R second combinations. Then, from the remaining weight derivation modes of the P weight derivation modes, select one weight derivation mode as the new i-th weight derivation mode, repeat the above steps, and then obtain S weight derivation modes.
  • the embodiment of the present application does not limit the size of the above-mentioned second preset value, and it is specifically determined according to actual needs.
  • the decoder can also select S weight derivation modes from P weight derivation modes according to the second method below.
  • the cost corresponding to the i-th weight derivation mode is greater than the third preset value, the i-th weight derivation mode and the similar weight derivation of the i-th weight derivation mode are eliminated from the P weight derivation modes. mode, obtain at least one weight derivation mode after elimination; determine S weight derivation modes based on at least one weight derivation mode after elimination.
  • the cost corresponding to the i-th weight derivation mode is less than the third preset value, it means that when using the i-th weight derivation mode to predict the current component block, better prediction may not be achieved. Effect: At this time, the i-th weight derivation mode is eliminated from the P weight derivation modes. In addition, since the weight derivation pattern similar to the i-th weight derivation pattern has similar characteristics to the i-th weight derivation pattern, the similar weight derivation pattern of the i-th weight derivation pattern is also derived from the P weight derivation patterns. Eliminate them from the equation to obtain the set of weight derived patterns after elimination.
  • the embodiment of the present application does not limit the size of the above-mentioned third preset value, which is determined according to actual needs.
  • the third preset value is larger than the above-mentioned second preset value.
  • the decoder selects S weight derivation modes from the P weight derivation modes, it performs the following steps S101-A21-22.
  • the embodiment of the present application does not limit the method of selecting T prediction modes from Q prediction modes.
  • preset T prediction modes are selected from Q prediction modes.
  • the decoder determines the cost when using the i-th prediction mode to predict the first component block, where i is a positive integer from 1 to Q; according to The cost corresponding to the i-th prediction mode is to select T prediction modes from Q prediction modes.
  • the weight derivation mode and K prediction modes are used as a combination to calculate the cost.
  • Q Calculate the cost of each weight derivation mode, that is, combine the Q prediction modes with the set weight derivation mode and K-1 prediction modes respectively to obtain Q combinations, and calculate the cost corresponding to each combination in these Q combinations. Then the costs of Q prediction modes are obtained.
  • the given K-1 prediction modes are prediction mode 1
  • the given weight derivation mode is weight derivation mode 1.
  • the weight derivation mode 1 is the same as the i-th prediction mode.
  • Prediction modes and prediction mode 1 form a combination, denoted as combination i.
  • Use combination i to predict the first component block, and obtain the predicted value of the first component block under combination i.
  • Based on the predicted value of the first component block under combination i and the reconstructed value of the first component block determine the corresponding value of combination i.
  • the prediction distortion cost of combination i is determined as the cost corresponding to the i-th prediction mode. In this way, the cost corresponding to any one of the Q prediction modes can be determined.
  • T prediction modes are selected from the Q prediction modes according to the cost corresponding to the i-th prediction mode.
  • the decoder selects T prediction modes from Q prediction modes according to the cost corresponding to the i-th prediction mode, including the following methods:
  • a prediction mode similar to the i-th prediction mode is selected from the Q prediction modes; according to the i-th prediction mode, and the Similar prediction modes of i prediction modes determine T prediction modes.
  • a prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar (or close) to the prediction reception of the i-th prediction mode, for example, the prediction direction (or angle) is the same as the prediction of the i-th prediction mode.
  • Prediction modes with similar directions (or angles), or prediction modes whose indexes are similar to the index of the i-th prediction mode for example, prediction modes whose indexes are 1, 2, etc. larger than the index of the i-th prediction mode, or whose indexes are larger than those of the i-th prediction mode.
  • the i prediction modes have prediction modes whose indexes are smaller by 1, 2, etc.
  • the cost corresponding to the i-th prediction mode is less than the fourth preset value, it means that when using the i-th prediction mode to predict the current component block, a better prediction effect may be achieved.
  • the i-th prediction mode is selected from Q prediction modes and used to construct subsequent R second combinations.
  • the similar prediction mode of the i-th prediction mode is selected from the Q prediction modes for constructing The subsequent R second combinations. Then, one prediction mode is selected as the new i-th prediction mode from the remaining prediction modes of the Q prediction modes, and the above steps are repeated to obtain T prediction modes.
  • the embodiment of the present application does not limit the size of the fourth preset value, and it is determined based on actual needs.
  • the cost corresponding to the i-th prediction mode is greater than the fifth preset value, the i-th prediction mode and the similar prediction modes of the i-th prediction mode are eliminated from the Q prediction modes, and the result after elimination is at least one prediction mode; determine T prediction modes based on at least one prediction mode after elimination.
  • the cost corresponding to the i-th prediction mode is greater than the fifth preset value, it means that when using the i-th prediction mode to predict the current component block, a better prediction effect may not be achieved.
  • the i-th prediction mode is eliminated from the Q prediction modes.
  • the similar prediction modes of the i-th prediction mode are also eliminated from the Q prediction modes to obtain the elimination The final set of prediction models. Then, from the eliminated prediction mode set, select one prediction mode as the new i-th prediction mode, repeat the above steps, and finally determine the prediction modes included in the prediction mode set as T prediction modes.
  • the embodiment of the present application does not limit the size of the fifth preset value, which is determined based on actual needs.
  • the fifth preset value is larger than the fourth preset value.
  • S weight derivation modes are selected from P weight derivation modes
  • T prediction modes are selected from Q prediction modes, and then, the following S101-A21-23 is performed.
  • one weight derivation mode is selected from S weight derivation modes, and K prediction modes are selected from T prediction modes. This weight derivation mode and the K prediction modes form a second combination, and this step is repeated. , R second combinations can be obtained.
  • a second combination includes a weight derivation mode and K prediction modes.
  • K weight derivation mode
  • K prediction modes
  • the following takes the screening process of another prediction mode when the weight derivation mode and one prediction mode are fixed as an example to introduce an implementation process of the above S101-A21-2.
  • the above-mentioned S101-A21-2 includes: for the i-th weight derivation mode among the P weight derivation modes, determining to use the i-th weight derivation mode and the j-th prediction mode pair among the Q prediction modes.
  • the cost when the first component block performs prediction if the cost corresponding to the combination of the i-th weight derivation mode and the j-th prediction mode is greater than the sixth preset value, then the j-th prediction mode is eliminated from the Q prediction modes, and Similar prediction modes of the jth prediction mode are used to obtain at least one prediction mode after elimination; based on the i-th weight derived mode and at least one prediction mode after elimination, R second combinations are constructed.
  • the other prediction mode performs screening. For example, in a certain weight derivation mode, if a certain intra prediction mode cannot obtain a relatively small cost as the first prediction mode, then the intra prediction mode similar to the intra prediction mode in the weight derivation mode will no longer be tried. As the case of the first prediction mode.
  • the second prediction mode is set to prediction mode 1.
  • the prediction mode 1 may be one prediction mode among the Q prediction modes, or may be other prediction modes other than the Q prediction modes. Determine the possible selection of the first prediction mode from the Q prediction modes, specifically, use the jth prediction mode among the Q prediction modes as the first prediction mode.
  • the i-th weight derivation mode When the combination j composed of the jth prediction mode and prediction mode 1 predicts the first component block, the predicted value of the first component block is used, and based on the predicted value, the cost corresponding to combination j is determined, and the cost corresponding to combination j is Determine the cost corresponding to the jth prediction mode. Next, it is determined whether the cost corresponding to the j-th prediction mode is greater than the sixth preset value. If the cost corresponding to the j-th prediction mode is greater than the sixth preset value, it means that the j-th prediction mode is used with the i-th prediction mode. The combination of weight derivation mode and prediction mode 1 cannot achieve accurate prediction of the first component block.
  • the jth prediction mode is eliminated from the Q prediction modes. Since prediction modes similar to the j-th prediction mode have similar characteristics to the j-th prediction mode, the similar prediction modes of the j-th prediction mode are eliminated from the Q prediction modes to obtain the prediction after elimination. Pattern collection. From the eliminated prediction mode set, select a new prediction mode as the new j-th prediction mode, and repeat the above steps to obtain the final eliminated prediction mode set corresponding to the i-th weight derivation mode.
  • the final set of prediction modes after elimination corresponding to each of the P weight derivation modes can be determined, so that R can be constructed based on the P weight derivation modes and their corresponding final set of prediction modes after elimination.
  • the decoding end determines the R second combinations according to the above methods, for any second combination among the R second combinations, the weight derivation mode and the K prediction modes in the second combination are used to calculate the first component block Prediction is performed to obtain the predicted value of the first component block corresponding to the second combination.
  • the following is an introduction to the process of using any second combination to predict the first component block and obtain the predicted value of the first component block.
  • the weight of the first component block is determined using the weight derivation mode included in the second combination.
  • the weight of the first component block can be understood as the weight of the predicted value corresponding to the first component block. That is, according to the weight derivation mode included in the second combination, the weight of the first component block is determined, according to the K prediction modes included in the second combination, the K prediction values of the first component block are determined, and the first component block is used Weight the K predicted values of the first component block to obtain the predicted value of the first component block.
  • determining the weight of the first component block according to the weight derivation mode includes the following steps:
  • Step 1 Determine the angle index and distance index according to the weight export mode
  • Step 2 Determine the weight of the first component block based on the angle index, the distance index and the size of the first component block.
  • This application may derive the weight of the first component block in the same manner as deriving the weight of the predicted value. For example, first determine the angle index and distance index according to the weight derivation mode, where the angle index can be understood as the dividing line angle index of each weight derived by the weight derivation mode. For example, the angle index and distance index corresponding to the weight derivation mode can be determined according to the above Table 2. For example, if the weight derivation mode is 27, the corresponding angle index is 12 and the distance index is 3. Next, the first component block weight is determined according to the angle index, the distance index and the size of the first component block.
  • the methods for determining the weight of the first component block include but are not limited to the following methods:
  • Method 1 directly determine the weight of the first component block based on the angle index, the distance index and the size of the first component block.
  • step 2 includes the following steps from step 21 to step 23:
  • Step 21 Determine the first parameter of the pixel point in the first component block according to the angle index, distance index and the size of the first component block;
  • Step 22 Determine the weight of the pixel in the first component block according to the first parameter of the pixel in the first component block;
  • Step 23 Determine the weight of the first component block based on the weight of the pixels in the first component block.
  • the weight of the pixel points in the first component block is determined based on the angle index, distance index and the size of the first component block, and then the weight matrix composed of the weight of each point in the first component block is determined as the One component block weight.
  • the first parameter of this application is used to determine the weight.
  • the first parameter is also called the weight index.
  • the offset and the first parameter can be determined as follows:
  • the inputs to the first component block weight derivation process are: the width of the first component block nCbW, the height of the current component block nCbH; GPM's "division" angle index variable angleId; GPM's distance index variable distanceIdx; component index variable cIdx, here Determine the weight of the first component block, so cIdx is 0, indicating the luminance component.
  • nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are exported as follows:
  • offsets offsetX and offsetY are derived as follows:
  • offsetY ((-nH)>>1)+(angleIdx ⁇ 16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
  • offsetX ((-nW)>>1)+(angleIdx ⁇ 16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
  • the upper left corner coordinate of the first component block is (0, 0) and is derived as follows:
  • disLut is determined according to the above table 3.
  • the first parameter weightIdx is derived as follows:
  • weightIdx (((xL+offsetX) ⁇ 1)+1)*disLut[displacementX]+(((yL+offsetY) ⁇ 1)+1)*disLut[displacementY]
  • the weight at the midpoint (x, y) of the first component block is determined based on weightIdx.
  • the methods for determining the weight of the pixels in the first component block based on the first parameters of the pixels in the first component block in step 22 include but are not limited to the following:
  • Method 1 Determine the second parameter of the pixel in the first component block based on the first parameter of the pixel in the first component block; determine the second parameter of the pixel in the first component block based on the second parameter of the pixel in the first component block the weight of.
  • the second parameter is also used to determine the weight.
  • the above-mentioned second parameter is also called a weight index under the first component, and the first component may be a brightness component or the like.
  • weightIdxL partFlip? 32+weightIdx:32-weightIdx
  • wTemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is the second parameter of the midpoint (x, y) of the first component block, also known as the weight of the midpoint (x, y) of the first component block.
  • the weight index under the brightness component wTemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is 32–weightIdx.
  • weightIdxL is 32+weightIdx. It should be noted that 32 here is just one This application is not limited to this example.
  • Method 2 determine the weight of the pixel in the first component block based on the first parameter, the first threshold, and the second threshold of the pixel in the first component block.
  • the weight of the pixel point in the first component block is limited to the first threshold or the second threshold, that is, the weight of the pixel point in the first component block Either the first threshold or the second threshold, thereby reducing the computational complexity of the weight of the first component block.
  • This application does not limit the specific values of the first threshold and the second threshold.
  • the first threshold is 1.
  • the second threshold is 0.
  • the weight of the pixels in the first component block can be determined by the following formula:
  • wTemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block, 1 in the above “1:0" is the first threshold, and 0 is the second threshold.
  • the weight of each point in the first component block is determined through the weight derivation mode, and the weight matrix composed of the weight of each point in the first component block is used as the weight of the first component block.
  • the K prediction modes in the second combination are used to predict the first component block to obtain K prediction values. , weight the K predicted values according to the weight of the first component block to obtain the predicted value of the first component block.
  • the predicted value of the first component block can be understood as a matrix composed of the predicted values of the pixels in the first component block.
  • the above predicted values are also called predicted samples.
  • the cost of the second combination is determined based on the predicted value and reconstructed value of the first component block.
  • Method 1 Use a matrix method to determine the cost of the second combination. Specifically, a loss is determined based on the predicted value and reconstructed value of the first component block, and the loss is recorded as the first loss. Since the predicted value and reconstructed value of the first component block are matrices, the first loss is also obtained as The matrix, for example, determines the absolute value of the difference between the predicted value and the reconstructed value of the first component block as the first loss, and determines the first loss as the cost of the second combination.
  • the second method is to use point-by-point calculation to determine the cost of the second combination.
  • the i-th pixel in the first component block when determining the prediction at the i-th pixel of each of the K prediction modes in the second combination, determine the i-th pixel at The corresponding first component block weight in the first component block weight is based on the first component block weight of the i-th pixel point and the K predicted values of the i-th pixel point, and the predicted value of the i-th pixel point is obtained. According to the predicted value and reconstructed value of the i-th pixel, the cost of the second combination at the i-th pixel is obtained. According to this method, the prediction distortion cost of the second combination at each pixel point in the first component block can be determined, and finally, the prediction distortion cost of the second combination at each pixel point in the first component block The cumulative sum of is determined as the cost of the second combination.
  • the cost of each second combination among the R second combinations can be determined.
  • a candidate combination list is constructed based on the cost of each second combination among the R second combinations.
  • the R second combinations are sorted in order from small to large, and the sorted R second combinations are determined as a candidate combination list.
  • N second combinations with the smallest cost are selected from the R second combinations to form a candidate combination list.
  • N is 8 or 16 or 32, etc.
  • a candidate combination list is determined, and the candidate combinations in the candidate combination list are sorted from small to large in order of cost.
  • the candidate combination list is as shown in the above Table 6.
  • the decoding end queries the candidate combination corresponding to the first index in the candidate combination list shown in Table 6 according to the first index, and determines the candidate combination corresponding to the first index as the first combination, that is, the candidate combination included in the candidate combination
  • the weight derivation mode is determined as the first weight derivation mode
  • the K prediction modes included in the candidate combination are determined as K first prediction modes.
  • the method of constructing a candidate combination is introduced by taking the first combination including the first weight derivation mode and K first prediction modes as an example.
  • the first combination in case 1, includes a first weight derivation mode and K first prediction modes, and the first weight derivation mode does not include a blending parameter.
  • the first combination includes the first weight derivation mode, K first prediction modes and the second transition parameter.
  • Case 3 the first combination includes a first weight derivation mode and K first prediction modes, and the first weight derivation mode includes transition parameters. Wherein, the transition parameter is used together with the K first prediction modes to determine the prediction value of the current component block.
  • the candidate combination list corresponding to the current component block is constructed as described in the above embodiment.
  • the first combination includes the first weight derivation mode, K first prediction modes and the second transition parameter.
  • the prediction value of the current component block is determined based on the second transition parameter, the first weight derivation mode and K first prediction modes.
  • the first combination of the embodiment of the present application includes a first weight derivation mode, K first prediction modes and a second transition parameter.
  • determining the first combination in S101 includes the following steps:
  • the candidate combination list includes at least one candidate combination, and any candidate combination in the at least one candidate combination includes a weight derivation mode, K prediction modes and a transition parameter;
  • the candidate combination list is shown in Table 8:
  • the candidate combination list includes at least one candidate combination. Any two candidate combinations in the at least one candidate combination are not exactly the same, that is, any two candidate combinations include weight derivation modes, K prediction modes and transition parameters. At least one of them is different.
  • the above-mentioned Table 8 uses the ordering of the candidate combinations in the candidate combination list as the index.
  • the index of the candidate combinations in the candidate combination list can also be reflected in other ways. This embodiment of the present application does not limit this.
  • the decoder determines the first combination according to the candidate combination list, including but not limited to the following:
  • Method 1 The candidate combination list includes one candidate combination. At this time, the candidate combination included in the candidate combination list is determined as the first combination.
  • the candidate combination list includes multiple candidate combinations.
  • the code stream is decoded to obtain the first index.
  • the first index is used to indicate the first combination; the candidate combination corresponding to the first index in the candidate combination list is determined. For the first combination.
  • the decoder decodes the code stream to obtain the first index, and determines the candidate combination list as shown in Table 8 above. It performs a query in the candidate combination list according to the first index to obtain the candidate combination indicated by the first index. The first combination.
  • the first index is index 1.
  • the candidate combination corresponding to index 1 is candidate combination 2. That is to say, the first combination indicated by the first index is candidate combination 2.
  • the decoder determines the weight derivation mode, K prediction modes and transition parameters included in candidate combination 2 as the first weight derivation mode, K first prediction modes and second transition parameters included in the first combination, and uses The first weight derivation mode, the second transition parameter and the K first prediction modes predict the current component block to obtain the prediction value of the current component block.
  • the encoding end and the decoding end can respectively determine the same candidate combination list.
  • the encoding end and the decoding end both determine a list including L candidate combinations.
  • Each candidate combination includes 1 weight derivation mode, K Prediction mode and 1 transition parameter.
  • the encoding end only needs to write one candidate combination finally selected, such as the first combination.
  • the decoding end parses the first combination finally selected by the encoding end. Specifically, the decoding end decodes the code stream to obtain the first index, and The first combination is determined in the candidate combination list determined at the decoding end through the first index.
  • the above candidate combination list already exists.
  • the decoder can obtain or read the candidate combination list according to the first index, and then according to the first index, Query the candidate combination corresponding to the first index in the candidate combination list.
  • the candidate combination list is sent by the encoding end to the decoding end.
  • the encoding end sends it to the decoding end before encoding the current component block.
  • the above candidate combination list is uploaded to the cloud by the encoding end, and the decoding end reads the candidate combination list from the cloud.
  • the above candidate combination list is constructed by the decoding end.
  • the embodiment of the present application does not limit the way in which the decoding end constructs the candidate combination list.
  • information related to the current component block is used to analyze the probability of occurrence of each combination composed of different weight derivation modes, different prediction modes and different transition parameters, and a candidate combination list is constructed based on the probability of occurrence of each combination.
  • the information related to the current component block includes mode information of surrounding blocks of the current component block, reconstructed pixels of the first component block corresponding to the current component block, etc.
  • the decoding end constructs a candidate combination list through the following steps S101-C1 and S101-C2:
  • S101-C1 The specific implementation process of S101-C1 refers to the above description of S101-A1, and will not be described again here.
  • the embodiment of the present application constructs a candidate combination list of the current component block based on the first component block.
  • Combination list For example, use the combination to predict the first component block, obtain the predicted value of the first component block under each combination, and construct a candidate based on the predicted value of the first component block under each combination.
  • Combination list For example, use the weight derivation mode included in the combination to derive the weight of the first component block, use the K prediction modes included in the combination to predict the first component block respectively, and obtain K predicted values of the first component block, according to The derived weight of the first component block is weighted on the K predicted values of the first component block to obtain the predicted value of the first component block under the combination. Finally, a candidate combination list is constructed based on the predicted value of the first component block under each combination.
  • the above-mentioned weights derived according to the weight derivation mode can be understood as deriving the weight corresponding to each pixel point in the first component block, or can also be understood as deriving the weight matrix corresponding to the first component block.
  • Using the transition parameter to adjust the weight of the first component block can be understood as adjusting the weight corresponding to each pixel in the first component block, or adjusting the weight matrix of the first component block.
  • the predicted value and the adjusted weight determine the predicted value corresponding to each pixel point, and the predicted value corresponding to each pixel point in the first component block constitutes the predicted value of the first component block.
  • it can also be performed on a block basis. For example, the predicted value of the first component block is determined, and the predicted value of the first component block is determined based on the adjusted weight matrix of the first component block.
  • the K predicted values of one component block are weighted to obtain the predicted value of the first component block.
  • S101-C2 includes the following steps of S101-C21 to S101-C23:
  • Any second combination among the R second combinations includes a weight derivation mode, K prediction modes and a transition parameter, and any two of the R second combinations are The included weight derivation modes, K prediction modes and transition parameters are not exactly the same, and R is a positive integer greater than 1.
  • the decoder when constructing the candidate combination list, the decoder first determines R second combinations.
  • This application does not limit the specific values of the R second combinations, such as 8, 16, 32, etc.
  • the R second combinations are Each second combination in the combination includes a weight derivation mode, K prediction modes and a transition parameter, and any two of the R second combinations include incomplete weight derivation modes, K prediction modes and transition parameters. same.
  • a candidate combination list is constructed based on the cost corresponding to each of the R second combinations.
  • the cost corresponding to the second combination at least includes the following Way:
  • S101-C22 includes the following S101-C22-11 to S101-C22-14:
  • S101-C22-14 Determine the cost corresponding to the second combination based on the prediction value of the first component block corresponding to the second combination and the reconstruction value of the first component block.
  • the process of determining the cost corresponding to each of the R second combinations is the same.
  • one second combination among the R second combinations is used as an example for explanation.
  • the second combination includes a weight derivation mode, a transition parameter and K prediction modes.
  • the weight derivation mode included in the second combination is used. and transition parameters, determine the weight of the first component block, predict the first component block according to the K prediction modes included in the second combination, and obtain K prediction values of the first component block, and then use the K prediction values of the first component block.
  • the weight performs a weighting process on the K predicted values of the first component block to obtain the predicted value of the first component block corresponding to the second combination.
  • the cost corresponding to the second combination is determined based on the prediction value of the first component block corresponding to the second combination and the reconstruction value of the first component block.
  • the transition parameter is used to adjust the weight derived from the weight derivation mode. Therefore, in the embodiment of the present application, in the above-mentioned S101-C22-11, according to the weight derivation mode and transition parameters included in the second combination, There are at least the following ways to determine the weight of the first component block:
  • Example 1 When using the first weight derivation mode to derive the weight of the first component block, multiple intermediate variables need to be determined. Transition parameters can be used to adjust one or several of the multiple intermediate variables. , and then use the adjusted variables to derive the weight of the first component block. For example, use transition parameters to adjust one or more of displacementX, displacementY, partFlip, shiftHoroffsetX, offsetY, xL, yL and other variables to obtain the weight of the first component block.
  • Example 2 Determine the third weight corresponding to the first component block based on the weight derivation mode and the first component block in the second combination, use the transition parameters in the second combination to adjust the third weight, and obtain the adjusted third weight. Three weights; determine the weight of the first component block based on the adjusted third weight.
  • the weight derivation mode and the first component block in the second combination determine the third weight corresponding to the first component block to be weightIdx. Then, use the transition parameter to adjust weightIdx to obtain the adjusted weightIdx. Then, according to the adjustment The final weightIdx determines the weight wVemplateValue of the first component block.
  • the transition parameter can be used to adjust weightIdx according to the following formula to obtain the adjusted weightIdx:
  • weightIdx weightIdx*blendingCoeff
  • blendingCoeff is the transition parameter included in the second combination.
  • the weight derivation mode and the first component block in the second combination determine the third weight corresponding to the first component block to be wVemplateValue. Then, use the transition parameter to adjust wVemplateValue to obtain the adjusted wVemplateValue. The wVemplateValue determines the weight of the first component block.
  • the transition parameter can be used to adjust wVemplateValue according to the following formula to obtain the adjusted wVemplateValue:
  • the weight of the first component block corresponding to each of the R second combinations can be determined.
  • use K prediction modes included in the second combination to predict the first component block obtain K prediction values of the first component block, and use the first component corresponding to the second combination
  • the weight of the block is used to weight the K predicted values of the first component block corresponding to the second combination to obtain the predicted value of the first component block corresponding to the second combination.
  • the predicted value and the reconstructed value of the first component block determine the cost corresponding to the second combination.
  • the methods for determining the cost corresponding to the second combination include but are not limited to SAD, SATD, SEE, etc. Referring to this method, the cost corresponding to each of the R second combinations can be determined.
  • a candidate combination list is constructed based on the cost corresponding to each of the R second combinations.
  • S101-C22 includes the following S101-C22-11 to S101-C22-14:
  • the two prediction modes included in the second combination are recorded as prediction mode 1 and prediction mode 2 respectively.
  • the prediction mode 1 is determined based on the weight derivation mode and transition parameters included in the second combination.
  • the weight and predicted value of the corresponding first component block are used to process the predicted value corresponding to prediction mode 1 using the weight of the first component block corresponding to prediction mode 1, for example, for each of the first component blocks corresponding to prediction mode 1
  • For a pixel multiply the predicted value of the pixel in the first component block corresponding to prediction mode 1 by the weight of the first component block corresponding to the pixel to obtain the predicted value of the pixel.
  • the predicted value of the first component block corresponding to the prediction mode 1 can be determined, and then, based on the predicted value of the first component block corresponding to the prediction mode 1 and the reconstruction value of the first component block, the predicted value of the first component block corresponding to the prediction mode 1 can be determined.
  • the cost wherein the method of determining the cost corresponding to the prediction mode 1 includes but is not limited to SAD, SATD, SEE, etc.
  • the cost corresponding to prediction mode 2 can be determined.
  • the cost corresponding to the second combination is determined. For example, the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 are added to determine the cost corresponding to the second combination. price.
  • the above R second combinations are preset.
  • S101-C21 includes the following steps:
  • R second combinations based on F weight derivation modes, J prediction modes and W transition parameters. Any second combination among the R second combinations includes F weight derivation modes.
  • the decoder first determines F weight derivation modes, J prediction modes and W transition parameters, and then constructs R weight derivation modes, J prediction modes and W transition parameters based on the determined F weight derivation modes, J prediction modes and W transition parameters. The second combination.
  • the embodiments of this application do not limit the specific number of the above-mentioned F weight derivation modes, J prediction modes and W transition parameters.
  • the above K prediction modes include the first prediction mode and the second prediction mode. Assume that there are J kinds of all available prediction modes, and the first prediction mode has J kinds of possibilities. Since the second prediction mode is different from The first prediction mode is different, so there are J-1 kinds of the second prediction mode. Assuming that there are F kinds of weight derivation modes, and assuming that there are W kinds of excessive gradient coefficients, this application may use any two different prediction modes and any A weight derivation mode and any excessive gradient coefficient form a second combination, and there are a total of F*J*(J-1)*W possible second combinations.
  • the F weight derivation modes are all possible weight derivation modes
  • the J prediction modes are all possible prediction modes
  • the W transition parameters are all possible transition parameters.
  • each prediction mode in order to reduce the amount of data and improve the construction speed of the candidate combination list, each prediction mode is not tried, and some of the prediction modes may be selected to try.
  • the implementation methods for determining J prediction modes in the above S101-C21-1 include but are not limited to the following methods:
  • the J prediction modes are preset prediction modes.
  • Method 2 Determine at least one of the candidate prediction mode list of the current component block, the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode, according to the candidate prediction mode list, J prediction modes are determined from at least one of the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode.
  • the method of determining the candidate prediction mode list of the current component block includes at least the following examples:
  • Example 1 Determine a candidate prediction mode list according to the prediction mode used by at least one block adjacent to the current component block.
  • Example 2 If the candidate prediction mode list does not include the preset mode, determine the preset mode corresponding to the current component block; and add the preset mode to the candidate prediction mode list.
  • the above-mentioned preset modes are several preset prediction modes.
  • the preset mode is determined by determining the image type corresponding to the current component block and based on the image type corresponding to the current component block.
  • the preset mode includes at least one of DC, horizontal mode, vertical mode and angle mode.
  • Example 3 Determine the image type corresponding to the current component block, and determine a candidate prediction mode list based on the image type corresponding to the current component block. For example, if the image type corresponding to the current component block is B type or P type, DC, at least one of horizontal mode, vertical mode and some angle modes can be added to the second candidate prediction mode list. For another example, if the image type corresponding to the current component block is type I, at least one of DC, horizontal mode, and vertical mode can be added to the candidate prediction mode list.
  • Example 4 Determine the second prediction mode used by at least one component block (such as chroma block and/or luma block) among the first component block, the second component block and the third component block at the preset position, and the surroundings of the current component block
  • the third prediction mode used by at least one of the decoded first component block, the second component block and the third component block (for example, the luma block and/or the chrominance block), and the internal preset area correspondence of the current component block At least one of the fourth prediction mode used by the first component block (such as the luminance block) and the fifth prediction mode related to the first component block corresponding to the current component block; according to the second prediction mode, the third prediction mode, At least one of the fourth prediction mode and the fifth prediction mode determines a candidate prediction mode list of the current component block.
  • J equals Q above.
  • the methods for determining the F weight derivation modes include at least the following methods:
  • the above-mentioned F weight derivation modes are preset weight derivation modes.
  • F weight derivation modes are selected from the preset Z weight derivation modes, where Z is a positive integer greater than or equal to F.
  • the embodiment of the present application does not limit the above-mentioned Z preset weight derivation modes.
  • Z weight derivation modes are determined as F weight derivation modes.
  • the Z preset weight derivation modes are screened, and then F can be selected from the preset Z weight derivation modes.
  • a weight derivation mode is used to construct R second combinations.
  • the process of determining the F weight derivation modes in the above S101-C21-1 is basically the same as the process of determining the P weight derivation modes in the above S101-A21-1. Refer to the above specific description of determining the P weight derivation modes, which will not be discussed here. Again.
  • the above-mentioned W transition parameters are preset transition parameters, such as 1/4, 1/2, 1, 2, 4, etc.
  • W transition parameters are determined based on the size of the current component block. For example, if the size of the current component block is less than a certain preset value, then W transition parameters are located in the value range 1 of the transition parameters. For another example, if the size of the current component block is less than a certain preset value, then W transition parameters are located in the value range 2 of the transition parameters. Among them, the value range 1 of the transition parameter and the value range 2 of the transition parameter may intersect or may not intersect.
  • W transition parameters are determined from a plurality of preset transition parameters.
  • W transition parameters are determined from a plurality of preset transition parameters based on the image information of the current component block.
  • the embodiment of the present application does not limit the specific content of the image information of the current component block, such as blur, clarity, sharpness, etc.
  • W transition parameters are determined from a plurality of preset transition parameters according to the image information of the current component block, including two types Example:
  • Example 1 If the sharpness of the image edge of the current component block is less than the preset value, at least one first-type transition parameter among the plurality of preset transition parameters is determined as W transition parameters.
  • the first type of transition parameters can be understood as transition parameters that can form a wider transition area, such as 1/4, 1/2, etc.
  • Example 2 If the sharpness of the image edge of the current component block is greater than or equal to the preset value, then at least one second type transition parameter among the plurality of preset transition parameters is determined as W transition parameters, and the The second type transition parameters are larger than the first type transition parameters.
  • the second type of transition parameters can be understood as transition parameters that can form a narrow transition area, such as 2, 4, etc.
  • the method of determining the image information of the current component block may include at least two methods:
  • Method 1 Obtain the image information of the current component block by decoding the code stream.
  • the encoding end encodes the image information of the current component block into the code stream.
  • the decoding end obtains the image information of the current component block by decoding the code stream.
  • Method 2 determine the image information of the first component block; determine the image information of the current component block based on the image information of the first component block. Since the first component block has been decoded, the image information of the first component block is available. For example, the reconstructed value of the first component block is analyzed to obtain the image information of the first component block. Then, based on the image information of the first component block, the image information of the current component block is obtained. For example, the image information of the first component block is determined as the image information of the current component block, or the image information of the first component block is processed to obtain the image information of the current component block.
  • the decoder After the decoder determines J prediction modes, F weight derivation modes and W transition parameters according to the above steps, it forms R different second prediction modes, F weight derivation modes and W transition parameters based on these J prediction modes, F weight derivation modes and W transition parameters. combination. Next, a candidate combination list is determined based on the R second combinations, and then the first weight derivation mode, K first prediction modes and second transition parameters are determined from the candidate combination list.
  • the decoding end screens the J prediction modes, F weight derivation modes and W transition parameters determined above.
  • the above S101-C21- According to the determined F weight derivation modes, J prediction modes and W transition parameters in 2, forming R second combinations includes the following steps from S101-C21-21 to S101-C21-24:
  • the weight derivation modes with lower occurrence probability are eliminated from the F weight derivation modes determined above, and the filtered E weight derivation modes are obtained.
  • the methods for selecting E weight derivation modes from F weight derivation modes in the above S101-C21-21 include but are not limited to the following:
  • Method 1 For the i-th weight derivation mode among the F weight derivation modes, determine the weights of the K second prediction modes on the first component block according to the i-th weight derivation mode and the fourth transition parameter.
  • the fourth transition The parameter is any transition parameter among the W transition gradients
  • the K second prediction modes are any K prediction modes among the J prediction modes
  • i is a positive integer from 1 to F; if any of the K prediction modes When the weight of a prediction mode on the first component block is less than the first preset value, the i-th weight derivation mode is eliminated from the F weight derivation modes to obtain E weight derivation modes.
  • the method of determining the weights of the K second prediction modes on the first component block based on the i-th weight derivation mode and the fourth transition parameter includes at least the methods shown in the following examples:
  • Example 1 When using the i-th weight derivation mode to derive the weight of the first component block, multiple intermediate variables need to be determined.
  • the fourth transition parameter can be used to determine one or several of the multiple intermediate variables. Make adjustments and then use the adjusted variables to derive the weight of the first component block.
  • Example 2 Determine the fourth weight corresponding to the first component block based on the i-th weight derivation mode and the first component block; use the fourth transition parameter to adjust the fourth weight to obtain the adjusted fourth weight; according to the adjusted The fourth weight determines the weight of the K second prediction modes on the first component block.
  • the fourth weight corresponding to the first component block is determined to be weightIdx. Then, the fourth transition parameter is used to adjust weightIdx to obtain the adjusted weightIdx. Then, according to the adjusted The weightIdx determines the weight wVemplateValue of the first component block.
  • the fourth transition parameter can be used to adjust weightIdx according to the following formula to obtain the adjusted weightIdx:
  • weightIdx weightIdx*blendingCoeff3
  • blendingCoeff3 is the fourth transition parameter.
  • the fourth weight corresponding to the first component block is determined to be wVemplateValue. Then, the fourth transition parameter is used to adjust wVemplateValue to obtain the adjusted wVemplateValue, and the adjusted wVemplateValue is obtained. wVemplateValue, determined as the weight of the first component block.
  • the fourth transition parameter can be used to adjust wVemplateValue according to the following formula to obtain the adjusted wVemplateValue:
  • the weights of the K second prediction modes on the first component block are derived according to the i-th weight in the mode.
  • Method 2 For the i-th weight derivation mode among the F weight derivation modes, determine the cost when using the i-th weight derivation mode to predict the first component block, i is a positive integer from 1 to F; according to the i-th weight derivation mode For the costs corresponding to the weight derivation modes, E weight derivation modes are selected from the F weight derivation modes.
  • the impact of the transition parameter on the weight is not considered.
  • the impact of the transition parameter on the weight is included, that is, the weight of the first component block is determined based on the i-th weight derivation mode and the transition parameter, Then, the first component block prediction value is determined based on the weight of the first component block and the K predicted values of the first component block, and the cost corresponding to the i-th weight derivation mode is determined based on the first component block prediction value and the reconstruction value.
  • the specific process of determining the weight of the first component block based on the i-th weight derivation mode and the transition parameter may refer to the description of the above embodiment, and will not be described again here.
  • the decoder selects E weight derivation modes from the F weight derivation modes, it performs the following steps S101-C21-22.
  • the embodiment of the present application does not limit the method of selecting V prediction modes from J prediction modes.
  • preset V prediction modes are selected from J prediction modes.
  • the decoder determines the cost when using the i-th prediction mode to predict the first component block, where i is a positive integer from 1 to J; according to The cost corresponding to the i-th prediction mode is to select V prediction modes from J prediction modes.
  • the weight derivation mode, K prediction modes and transition parameters are used as a combination to calculate the cost.
  • the weight derivation mode, other K-1 prediction modes and transition parameters are given On the basis of The cost corresponding to each combination in the combination is obtained, and then the costs of J prediction modes are obtained.
  • V prediction modes are selected from the J prediction modes according to the cost corresponding to the i-th prediction mode.
  • the decoder selects V prediction modes from J prediction modes according to the cost corresponding to the i-th prediction mode, including the following methods:
  • a prediction mode similar to the i-th prediction mode is selected from J prediction modes; according to the i-th prediction mode, and the Similar prediction modes of i prediction modes determine V prediction modes.
  • a prediction mode similar to the i-th prediction mode can be understood as a prediction mode whose prediction result is similar (or close) to the prediction reception of the i-th prediction mode, for example, the prediction direction (or angle) is the same as the prediction of the i-th prediction mode.
  • Prediction modes with similar directions (or angles), or prediction modes whose indexes are similar to the index of the i-th prediction mode for example, prediction modes whose indexes are 1, 2, etc. larger than the index of the i-th prediction mode, or whose indexes are larger than those of the i-th prediction mode.
  • the i prediction modes have prediction modes whose indexes are smaller by 1, 2, etc.
  • the cost corresponding to the i-th prediction mode is greater than the fifth preset value, the i-th prediction mode and the similar prediction modes of the i-th prediction mode are eliminated from the J prediction modes, and the result after elimination is at least one prediction mode; determine V prediction modes based on at least one prediction mode after elimination.
  • E weight derivation modes are selected from F weight derivation modes
  • V prediction modes are selected from J prediction modes
  • S101-C21-23 is executed.
  • W transition parameters are determined as O transition parameters.
  • W transition parameters are screened to obtain O transition parameters.
  • the methods of screening W transition parameters and obtaining O transition parameters include at least the following:
  • Example 1 Determine the cost of each transition parameter among the W transition parameters, and filter out the top O transition parameters with the smallest cost among the W transition parameters.
  • the i-th transition parameter is combined with weight derivation mode 1, prediction mode 1, and prediction mode 2 to form a combination, and the combination is used to predict the first component block, and we get The predicted value of the first component block.
  • a weight is determined according to weight derivation mode 1, and the i-th transition parameter is used to adjust the weight to obtain an adjusted weight.
  • Prediction mode 1 and prediction mode 2 are used to predict the first component block respectively, and two prediction values of the first component block are obtained. The two prediction values are weighted using the adjusted weight, and the corresponding value of the i-th transition parameter is obtained. First component block prediction value.
  • the cost corresponding to the i-th transition parameter is determined based on the reconstructed value of the first component block and the predicted value of the first component block corresponding to the i-th transition parameter.
  • the cost corresponding to the combination of weight derivation mode 1, prediction mode 1 and prediction mode 2 for each of the W transition parameters can be determined, and then O parameters can be screened out from the W transition parameters based on the cost. transition parameters. For example, O transition parameters with the smallest cost among W transition parameters are screened out.
  • Example 2 If the above W transition parameters are not determined through the image information of the current component block, the embodiment of the present application can also determine the image information of the current component block; according to the image information of the current component block, from the W transition parameters , O transition parameters are determined.
  • the embodiment of the present application does not limit the specific content of the image information of the current component block, such as blur, clarity, sharpness, etc.
  • O transition parameters are determined from W transition parameters based on the image information of the current component block, including two examples:
  • At least one first-type transition parameter among the W transition parameters is determined as O transition parameters.
  • At least one second-type transition parameter among the W transition parameters is determined as O transition parameters.
  • the O transition parameters are selected from W transition parameters according to the size of the current component block.
  • transition parameters greater than or equal to the third value among the W transition parameters are used as O transition parameters.
  • the transition parameter whose value is the third value among the W transition parameters is used as one of the O transition parameters.
  • the transition parameters that are less than or equal to the fourth value among the W transition parameters are used as O transition parameters, where the fourth value is less than the third value.
  • the embodiments of this application do not limit the specific values of the second set threshold, the third value, and the fourth value.
  • the third value is 1 and the fourth value is 1/2.
  • the second set threshold is 256 and so on.
  • the O transition parameters are determined to be at least one transition parameter within a certain value range among the W transition parameters.
  • the O transition parameter is determined to be one or more transition parameters located within the value range of the fourth transition parameter among the W transition parameters.
  • the O transition parameter is one or more transition parameters located in the third transition parameter value range among the W transition parameters, where the third transition parameter The minimum value of the transition parameter value range is smaller than the minimum value of the fourth transition parameter value range.
  • the embodiments of this application do not limit the specific values of the above-mentioned fourth transition parameter value range and the third transition parameter value range.
  • the fourth transition parameter value range intersects with the third transition parameter value range.
  • the value range of the fourth transition parameter and the value range of the third transition parameter do not intersect.
  • one weight derivation mode is selected from E weight derivation modes
  • K prediction modes are selected from V prediction modes
  • one transition parameter is finally selected from O transition parameters.
  • This weight derivation mode, K The prediction mode and a transition parameter form a second combination, and by repeating this step, R second combinations can be obtained.
  • a second combination includes a weight derivation mode, K prediction modes and a transition parameter, that is, a second combination includes K+2 elements, so that when screening an element, other elements in a combination can be restricted.
  • the element is fixed and another element is a possible choice.
  • the following takes the weight derivation mode, transition parameters and the screening process of another prediction mode as an example when one prediction mode is fixed to introduce an implementation process of the above S101-C21-2.
  • the above-mentioned S101-C21-2 includes: determining to use the f-th weight derivation mode for the f-th weight derivation mode among the F weight derivation modes, and the o-th transition parameter among the O transition parameters.
  • the cost when the o-th transition parameter and the j-th prediction mode among the J prediction modes predict the first component block where f is a positive integer less than or equal to F, o is a positive integer less than or equal to O, j is a positive integer less than or equal to J; if the cost corresponding to the combination of the f-th weight derivation mode, the o-th transition parameter and the j-th prediction mode is greater than the sixth preset value, then the J-th prediction mode will be eliminated.
  • j prediction modes, and similar prediction modes of the j-th prediction mode obtain at least one prediction mode after elimination; construct R prediction modes based on the f-th weight derived mode, the o-th transition parameter and at least one prediction mode after elimination The second combination.
  • the other prediction mode is filtered. For example, under a certain weight derivation mode and transition parameters, if a certain intra prediction mode cannot obtain a relatively small cost as the first prediction mode, then the weight derivation mode and transition parameters will no longer be tried to match the intra prediction mode. A similar intra prediction mode is used as the first prediction mode.
  • the f-th weight derivation mode among the F weight derivation modes and the o-th transition gradient parameter among the O transition parameters are used.
  • the second prediction mode is set to prediction mode 1.
  • the prediction mode 1 may be one prediction mode among the J prediction modes, or may be other prediction modes other than the J prediction modes. Determine the possible selection of the first prediction mode from the J prediction modes, specifically, use the jth prediction mode among the J prediction modes as the first prediction mode.
  • the j-th prediction mode and prediction mode 1 predicts the first component block
  • the predicted value of the first component block is used, and based on the predicted value, the cost corresponding to the combination j is determined , determine the cost corresponding to combination j as the cost corresponding to the j-th prediction mode.
  • the combination of the weight derivation mode, the o-th transition gradient parameter and prediction mode 1 cannot achieve accurate prediction of the first component block.
  • the j-th prediction mode is eliminated from the J prediction modes. Since prediction modes similar to the j-th prediction mode have similar characteristics to the j-th prediction mode, the similar prediction modes of the j-th prediction mode are eliminated from the J prediction modes to obtain the prediction after elimination. Pattern collection. From the eliminated prediction mode set, select a new prediction mode as the new j-th prediction mode, repeat the above steps, and obtain the final eliminated prediction mode set corresponding to the f-th weight derivation mode and the o-th transition parameter. .
  • the final set of prediction modes after elimination corresponding to each weight derivation mode and transition parameter among the F weight derivation modes can be determined, so that the set of final elimination prediction modes corresponding to the F weight derivation modes and their respective corresponding , construct R second combinations.
  • the decoding end determines the R second combinations according to the above methods, for any second combination among the R second combinations, the weight derivation mode, transition parameters and K prediction modes in the second combination are used to calculate the One component block is predicted to obtain the predicted value of the first component block corresponding to the second combination.
  • the first component block is predicted according to the weight derivation mode, transition parameters and K prediction modes included in the second combination, and the first component block corresponding to the second combination is obtained. Predictive value.
  • the embodiment of the present application does not provide a specific implementation method for predicting the first component block based on the weight derivation mode, transition parameters and K prediction modes included in the second combination, and obtaining the predicted value of the first component block corresponding to the second combination. limit. For example, first, a predicted value of the first component block is determined based on the weight derivation mode and K prediction modes included in the second combination, and then the predicted value of the first component block is determined based on the transition parameter and the determined predicted value of the first component block. The predicted values of the first component block corresponding to the two combinations.
  • the weight derivation mode and the transition parameter included in the second combination may be used to determine the weight of the first component block, and then, the K first components are determined based on the K prediction modes included in the second combination.
  • the block prediction value determines the first component block prediction value corresponding to the second combination based on the weight of the first component block and the K first component block prediction values.
  • determining the first component block weight according to the weight derivation mode includes the following steps:
  • Step 1 Determine the angle index and distance index according to the weight export mode
  • Step 2 Determine the first component block weight according to the angle index, distance index, transition parameter and size of the first component block.
  • This application can derive the first component block weight in the same manner as deriving the weight of the predicted value. For example, first determine the angle index and distance index according to the weight derivation mode, where the angle index can be understood as the dividing line angle index of each weight derived by the weight derivation mode. For example, the angle index and distance index corresponding to the weight derivation mode can be determined according to the above Table 2. For example, if the weight derivation mode is 27, then the corresponding angle index is 12 and the distance index is 3. Next, the first component block weight is determined according to the angle index, the distance index and the size of the first component block.
  • the methods for determining the weight of the first component block include but are not limited to the following methods:
  • Method 1 determine the first component block weight according to the angle index, distance index, transition parameter and the size of the first component block.
  • step 2 includes the following steps from step 21 to step 23:
  • Step 21 Determine the first parameter of the pixel point in the first component block according to the angle index, distance index and the size of the first component block;
  • Step 22 Determine the weight of the pixel in the first component block based on the first parameter and transition parameter of the pixel in the first component block;
  • Step 23 Determine the first component block weight according to the weight of the pixels in the first component block.
  • the weight of the pixel points in the first component block is determined based on the angle index, distance index, the size of the first component block and the size of the current component block, and then the weight of each point in the first component block is determined.
  • the weight matrix is determined as the first component block weight.
  • the first parameter of this application is used to determine the weight.
  • the first parameter is also called the weight index.
  • the first parameter can be understood as the third weight corresponding to the first component block and the fourth weight corresponding to the first component block in the above embodiments.
  • the offset and the first parameter can be determined as follows:
  • the inputs to the first component block weight derivation process are: the width of the first component block nCbW, the height of the first component block nCbH; GFM's "division" angle index variable angleId; GFM's distance index variable distanceIdx; component index variable cIdx, this Taking the first component block as an example, cIdx is 0, indicating the brightness component.
  • nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are exported as follows:
  • offsets offsetX and offsetY are derived as follows:
  • offsetY ((-nH)>>1)+(angleIdx ⁇ 16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
  • offsetX ((-nW)>>1)+(angleIdx ⁇ 16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
  • disLut is determined according to the above table 3.
  • the first parameter weightIdx is derived as follows:
  • weightIdx (((xL+offsetX) ⁇ 1)+1)*disLut[displacementX]+(((yL+offsetY) ⁇ 1)+1)*disLut[displacementY]
  • the first parameter is then adjusted using the transition parameter to obtain the adjusted first parameter.
  • the first parameter is adjusted through the following formula:
  • weightIdx weightIdx*blendingCoeff
  • blendingCoeff is the transition parameter.
  • the methods for determining the weight of the pixels in the first component block include, but are not limited to, the following:
  • Method 1 Determine the second parameters of the pixels in the first component block based on the adjusted first parameters of the pixels in the first component block; determine the first component block based on the second parameters of the pixels in the first component block The weight of the middle pixel.
  • the second parameter is also used to determine the weight.
  • the above-mentioned second parameter is also called a weight index under the first component, and the first component may be a luminance component, a chrominance component, etc.
  • weightIdxL partFlip? 32+weightIdx:32-weightIdx
  • wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is the second parameter of the midpoint (x, y) of the first component block, also known as the weight of the midpoint (x, y) of the first component block.
  • the weight index under the brightness component wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is 32–weightIdx.
  • weightIdxL is 32+weightIdx. It should be noted that 32 here is just one This application is not limited to this example.
  • Method 2 Determine the weight of the pixel in the first component block based on the adjusted first parameter, first threshold, and second threshold of the pixel in the first component block.
  • the weight of the pixel point in the first component block is limited to the first threshold or the second threshold, that is, the weight of the pixel point in the first component block is either is the first threshold or the second threshold, thereby reducing the computational complexity of the weight of the first component block.
  • This application does not limit the specific values of the first threshold and the second threshold.
  • the first threshold is 1.
  • the second threshold is 0.
  • the weight of the pixels in the first component block can be determined by the following formula:
  • wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block, 1 in the above “1:0" is the first threshold, and 0 is the second threshold.
  • the weight of each point in the first component block is determined through the weight derivation mode, and the weight matrix composed of the weight of each point in the first component block is used as the first component block weight.
  • the K prediction modes in the second combination are used to predict the first component block, and K prediction values are obtained.
  • the first component block weight weights the K predicted values to obtain the predicted value of the first component block.
  • the cost of the second combination is determined based on the predicted value and reconstructed value of the first component block.
  • the cost of each second combination among the R second combinations can be determined.
  • a candidate combination list as shown in Table 8 is constructed.
  • the decoding end queries the candidate combination corresponding to the first index in the candidate combination list shown in Table 8 according to the first index, and determines the candidate combination corresponding to the first index as the first combination, that is, the candidate combination included in the candidate combination
  • the weight derivation mode is determined as the first weight derivation mode
  • the K prediction modes included in the candidate combination are determined as K first prediction modes
  • the transition parameters included in the candidate combination are determined as second transition parameters.
  • Case 3 the first combination includes a first weight derivation mode and K first prediction modes, and the first weight derivation mode includes a third transition parameter, and the third transition parameter is used to determine the weight.
  • the first weight derivation mode can be understood as a data set that includes multiple parameters, such as a third transition parameter, and these multiple parameters are jointly used to determine the weight.
  • determining the first combination in S101 includes the following steps:
  • the candidate combination list includes at least one candidate combination. At least any candidate combination in the candidate combination includes a weight derivation mode and K prediction modes, where the weight derivation mode includes a Transition parameters;
  • the candidate combination list is shown in Table 9:
  • the candidate combination list includes at least one candidate combination. Any two candidate combinations in the at least one candidate combination are not exactly the same, that is, any two candidate combinations include at least one of the weight derivation modes and K prediction modes. A difference.
  • the above-mentioned Table 9 uses the ordering of the candidate combinations in the candidate combination list as the index.
  • the index of the candidate combinations in the candidate combination list can also be reflected in other ways. This embodiment of the present application does not limit this.
  • the decoder determines the first combination according to the candidate combination list, including but not limited to the following:
  • Method 1 The candidate combination list includes one candidate combination. At this time, the candidate combination included in the candidate combination list is determined as the first combination.
  • the candidate combination list includes multiple candidate combinations.
  • the code stream is decoded to obtain the first index.
  • the first index is used to indicate the first combination; the candidate combination corresponding to the first index in the candidate combination list is determined as The first combination.
  • the decoder decodes the code stream to obtain the first index, and determines the candidate combination list as shown in Table 9 above. It performs a query in the candidate combination list based on the first index to obtain the candidate combination indicated by the first index. The first combination.
  • the first index is index 1.
  • the candidate combination corresponding to index 1 is candidate combination 2. That is to say, the first combination indicated by the first index is candidate combination 2.
  • the decoder determines the weight derivation mode and the K prediction modes included in the candidate combination 2 as the first weight derivation mode and the K first prediction modes included in the first combination, and uses the first weight derivation mode included in the first weight derivation mode.
  • the third transition parameter and the K first prediction modes predict the current component block to obtain the prediction value of the current component block.
  • the above candidate combination list already exists.
  • the decoder can obtain or read the candidate combination list according to the first index, and then according to the first index, Query the candidate combination corresponding to the first index in the candidate combination list.
  • the candidate combination list is sent by the encoding end to the decoding end.
  • the encoding end sends it to the decoding end before encoding the current component block.
  • the above candidate combination list is uploaded to the cloud by the encoding end, and the decoding end reads the candidate combination list from the cloud.
  • the above candidate combination list is constructed by the decoding end.
  • the embodiment of the present application does not limit the way in which the decoding end constructs the candidate combination list. For example, information related to the current component block is used to analyze the probability of occurrence of each combination composed of different prediction modes and different transition parameters, and a candidate combination list is constructed based on the probability of occurrence of each combination.
  • the information related to the current component block includes mode information of surrounding blocks of the current component block, reconstructed pixels of the first component block corresponding to the current component block, etc.
  • the decoding end constructs a candidate combination list through the following steps S101-E1 and S101-E2:
  • the embodiment of the present application constructs a candidate combination list of the current component block based on the first component block.
  • the combination to predict the first component block For example, for each combination, use the combination to predict the first component block, obtain the predicted value of the first component block under each combination, and construct a candidate combination list based on the predicted value of the first component block under each combination.
  • use the weight derivation mode included in the combination to derive the weight of the first component block use the K prediction modes included in the combination to predict the first component block respectively, and obtain K predicted values of the first component block, according to The derived weight of the first component block is weighted on the K predicted values of the first component block to obtain the predicted value of the first component block under the combination.
  • a candidate combination list is constructed based on the predicted value of the first component block under each combination.
  • the above-mentioned weights derived according to the weight derivation mode can be understood as deriving the weight corresponding to each pixel point in the first component block, or can also be understood as deriving the weight matrix corresponding to the first component block.
  • Using the transition parameter to adjust the weight of the first component block can be understood as adjusting the weight corresponding to each pixel in the first component block, or adjusting the weight matrix of the first component block.
  • the predicted value and the adjusted weight determine the predicted value corresponding to each pixel point, and the predicted value corresponding to each pixel point in the first component block constitutes the predicted value of the first component block.
  • it can also be performed on a block basis. For example, the predicted value of the first component block is determined, and the predicted value of the first component block is determined based on the adjusted weight matrix of the first component block.
  • the K predicted values of one component block are weighted to obtain the predicted value of the first component block.
  • S101-E2 includes the following steps of S101-E21 to S101-E23:
  • Any second combination among the R second combinations includes a weight derivation mode and K prediction modes.
  • the weight derivation mode includes a transition parameter, and any of the R second combinations
  • the weight derivation modes and K prediction modes included in the two combinations are not exactly the same, and R is a positive integer greater than 1.
  • the decoder when constructing the candidate combination list, the decoder first determines R second combinations.
  • This application does not limit the specific values of the R second combinations, such as 8, 16, 32, etc.
  • the R second combinations are Each second combination in the combination includes a weight derivation mode and K prediction modes, the weight derivation mode includes a transition parameter, and the weight derivation mode and the K prediction modes included in any two of the R second combinations are different. Exactly the same.
  • a candidate combination list is constructed based on the cost corresponding to each of the R second combinations.
  • the cost corresponding to the second combination at least includes the following methods:
  • S101-E22 includes the following S101-E22-11 to S101-E22-14:
  • the process of determining the cost corresponding to each of the R second combinations is the same.
  • one second combination among the R second combinations is used as an example for explanation.
  • the second combination includes a weight derivation mode and K prediction modes.
  • the decoding end can use the second combination to predict the first component block according to the second combination.
  • the weight derivation mode determines the weight of the first component block, predicts the first component block according to the K prediction modes included in the second combination, and obtains K prediction values of the first component block, and then uses the K prediction values of the first component block.
  • the weight performs a weighting process on the K predicted values of the first component block to obtain the predicted value of the first component block corresponding to the second combination. Then, the cost corresponding to the second combination is determined based on the prediction value of the first component block corresponding to the second combination and the reconstruction value of the first component block.
  • the embodiment of the present application does not limit the specific method of determining the weight of the first component block according to the weight derivation mode included in the second combination in the above S101-E22-11.
  • the weight derivation mode in the second combination includes a transition parameter, so the weight of the first component block can be determined according to the transition parameter.
  • S101-E22 includes the following S101-E22-11 to S101-E22-14:
  • the two prediction modes included in the second combination are recorded as prediction mode 1 and prediction mode 2 respectively.
  • One component block weight and predicted value use the weight of the first component block corresponding to prediction mode 1 to process the predicted value corresponding to prediction mode 1, for example, for each pixel in the first component block corresponding to prediction mode 1,
  • the predicted value of the pixel in the first component block corresponding to prediction mode 1 is multiplied by the weight of the first component block corresponding to the pixel to obtain the predicted value of the pixel.
  • the prediction value of the first component block corresponding to the prediction mode 1 can be determined, and then, based on the prediction value of the first component block and the reconstruction value of the first component block corresponding to the prediction mode 1, the cost corresponding to the prediction mode 1 is determined.
  • the methods for determining the cost corresponding to prediction mode 1 include but are not limited to SAD, SATD, SEE, etc.
  • the cost corresponding to prediction mode 2 can be determined. Then, based on the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2, the cost corresponding to the second combination is determined. For example, the cost corresponding to prediction mode 1 and the cost corresponding to prediction mode 2 are added to determine the cost corresponding to the second combination. price.
  • the above R second combinations are preset.
  • S101-E21 includes the following steps:
  • R second combinations based on C weight derivation modes and D prediction modes.
  • Any second combination among the R second combinations includes a weight derivation mode among the C weight derivation modes, K prediction modes among D prediction modes.
  • the decoder first determines C weight derivation modes and D prediction modes, and then constructs R second combinations based on the determined C weight derivation modes and D prediction modes.
  • the above K prediction modes include the first prediction mode and the second prediction mode. Assume that there are D kinds of all available prediction modes.
  • the first prediction mode has D kinds of possibilities. Since the second prediction mode is different from The first prediction mode is different, so there are D-1 kinds of the second prediction mode.
  • this application may use any two different prediction modes and any one weight derivation mode and any one The excessive gradient coefficients form a second combination, and there are a total of C*D*(D-1) possible second combinations.
  • the C weight derivation modes are all possible weight derivation modes, and the weight derivation modes include transition parameters. That is to say, the C weight derivation modes include all possible transition parameters, and the D prediction modes are all possible transition parameters.
  • the prediction model uses an exhaustive approach to obtain all possible second combinations. Use each second combination among all possible second combinations to predict the first component block, calculate the distortion cost of each second combination, and then obtain the candidate corresponding to the current component block based on the distortion cost of each second combination. Combination list.
  • each prediction mode in order to reduce the amount of data and improve the construction speed of the candidate combination list, each prediction mode is not tried, and some of the prediction modes may be selected to try.
  • the implementation methods for determining the D prediction modes in the above S101-E21-1 include but are not limited to the following methods:
  • the D prediction modes are preset prediction modes.
  • Method 2 Determine at least one of the candidate prediction mode list of the current component block, the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode, according to the candidate prediction mode list, At least one of the candidate prediction mode list corresponding to the K first prediction modes, the prediction mode corresponding to the weight derivation mode, and the preset mode determines D prediction modes.
  • the method of determining the third candidate prediction mode list of the current component block includes at least the following examples:
  • Example 1 Determine a third candidate prediction mode list according to the prediction mode used by at least one block adjacent to the current component block.
  • Example 2 If the third candidate prediction mode list does not include the preset mode, determine the preset mode corresponding to the current component block; and add the preset mode to the third candidate prediction mode list.
  • the above-mentioned preset modes are several preset prediction modes.
  • the preset mode is determined by determining the image type corresponding to the current component block and based on the image type corresponding to the current component block.
  • the preset mode includes at least one of DC, horizontal mode, vertical mode and angle mode.
  • Example 3 Determine the image type corresponding to the current component block, and determine a third candidate prediction mode list based on the image type corresponding to the current component block. For example, if the image type corresponding to the current component block is B type or P type, DC, at least one of horizontal mode, vertical mode and some angle modes can be added to the third candidate prediction mode list. For another example, if the image type corresponding to the current component block is type I, at least one of DC, horizontal mode, and vertical mode may be added to the third candidate prediction mode list.
  • Example 4 Determine the second prediction mode used by at least one component block (such as chroma block and/or luma block) among the first component block, the second component block and the third component block at the preset position, and the surroundings of the current component block
  • the third prediction mode used by at least one of the decoded first component block, the second component block and the third component block (for example, the luma block and/or the chrominance block), and the internal preset area correspondence of the current component block At least one of the fourth prediction mode used by the first component block (such as the luminance block) and the fifth prediction mode related to the first component block corresponding to the current component block; according to the second prediction mode, the third prediction mode, At least one of the fourth prediction mode and the fifth prediction mode determines a candidate prediction mode list of the current component block.
  • D above is equal to Q.
  • the above C weight derivation modes are preset.
  • the above-mentioned C weight derivation modes are filtered from multiple preset weight derivation modes, for example, based on information such as the size of the current component block and/or the image type corresponding to the current component block, C weight export patterns are obtained.
  • C weight derivation modes with smaller costs can be selected from multiple preset weight derivation modes according to the cost.
  • X transition parameters are determined, and C weight derivation modes are determined based on the X transition parameters.
  • the embodiment of the present application does not limit the size relationship between X and C.
  • C weight derivation modes can be determined based on the X transition parameters. For example, if the weight derivation mode includes other parameters in addition to transition parameters, at this time, the transition parameters included in at least one of the C weight derivation modes can be the same or different, and then the transition parameters included in the weight derivation mode can be the same or different according to X transition parameters, determine C weight derivation modes, for example, use multiple different weight derivation modes composed of X transition parameters, determine the cost corresponding to each of the multiple different weight derivation modes, and then select C weight export modes with the smallest cost.
  • the above-mentioned X transition parameters are preset transition parameters, such as 1/4, 1/2, 1, 2, 4, etc.
  • X transition parameters are determined according to the size of the current component block.
  • transition parameters greater than or equal to the fifth value among the at least one preset transition parameter are used as X transition parameters.
  • the transition parameters that are less than or equal to the sixth value among the at least one transition parameters are used as X transition parameters, and the sixth value is less than the third value. Five values.
  • the transition parameters that are less than or equal to the sixth value among the at least one transition parameters are used as X transition parameters, and the sixth value is less than the fifth value.
  • the X transition parameter is determined to be one or more transition parameters in which at least one preset transition parameter is located within the fifth transition parameter value range.
  • the X transition parameter is determined to be one or more transition parameters with at least one transition parameter located within the value range of the sixth transition parameter, and the sixth transition parameter The minimum value of the value range is smaller than the minimum value of the fifth transition parameter value range.
  • the embodiments of the present application do not limit the specific values of the above-mentioned third set threshold, fifth value, sixth value, fifth transition parameter value range, and sixth transition parameter value range.
  • the above third set threshold is 256.
  • fifth value is 1.
  • the sixth value is 1/2.
  • the image information of the current component block is determined; and X transition parameters are determined based on the image information of the current component block.
  • Example 1 if the sharpness of the image edge of the current component block is less than the preset value, then at least one third-type transition parameter among the preset Y transition parameters is determined as X transition parameters, and Y is a positive value greater than X. integer.
  • the third type of transition parameters can be understood as transition parameters that can form a wider transition area, such as 1/4, 1/2, etc.
  • Example 2 if the sharpness of the image edge of the current component block is greater than or equal to the preset value, then at least one fourth-type transition parameter among the Y transition parameters is determined as X transition parameters, and the fourth-type transition parameter is greater than the Three types of transition parameters.
  • the fourth type of transition parameters can be understood as transition parameters that can form a narrow transition area, such as 2, 4, etc.
  • the decoding end After determining D prediction modes, C weight derivation modes and W transition parameters according to the above steps, the decoding end forms R different second combinations based on the D prediction modes and C weight derivation modes. Next, a candidate combination list is determined based on the R second combinations, and then the first weight derivation mode and K first prediction modes are determined from the candidate combination list.
  • the decoding end filters the D prediction modes and C weight derivation modes determined above.
  • C weight derivation modes and D prediction modes, forming R second combinations include the following steps from S101-E21-21 to S101-E21-24:
  • the decoder selects C1 weight derivation modes from the C weight derivation modes, it performs the following steps S101-E21-22.
  • C1 weight derivation modes are selected from C weight derivation modes
  • D1 prediction modes are selected from D prediction modes. Then, the following S101-E21-23 is performed.
  • the weight of the first component block is determined using the weight derivation mode included in the second combination.
  • determining the first component block weight according to the weight derivation mode includes the following steps:
  • Step 3 Determine the angle index, distance index and transition parameters according to the weight derivation mode
  • Step 4 Determine the weight of the first component block based on the angle index, distance index, transition parameter and size of the first component block.
  • This application can derive the first component block weight in the same manner as deriving the weight of the predicted value.
  • the mode is first derived based on the weights, and parameters such as angle index, distance index, and transition parameters are determined.
  • the methods for determining the weight of the first component block include but are not limited to the following methods:
  • Method 1 determine the first component block weight according to the angle index, distance index, transition parameter and the size of the first component block.
  • step 4 includes the following steps from step 41 to step 43:
  • Step 41 Determine the first parameter of the pixel point in the first component block according to the angle index, distance index and the size of the first component block;
  • Step 42 Determine the weight of the pixel in the first component block based on the first parameter and transition parameter of the pixel in the first component block;
  • Step 43 Determine the first component block weight according to the weight of the pixels in the first component block.
  • the weight of the pixel points in the first component block is determined based on the angle index, distance index, size of the first component block and transition parameters, and then the weight matrix composed of the weight of each point in the first component block is, Determine the weight of the first component block.
  • the first parameter of this application is used to determine the weight.
  • the first parameter is also called the weight index.
  • the offset and the first parameter can be determined as follows:
  • the inputs to the first component block weight derivation process are: the width of the first component block nCbW, the height of the first component block nCbH; GFM's "division" angle index variable angleId; GFM's distance index variable distanceIdx; component index variable cIdx, this Taking the first component block as an example, cIdx is 0, indicating the brightness component.
  • nW, nH, shift1, offset1, displacementX, displacementY, partFlip and shiftHor are exported as follows:
  • offsets offsetX and offsetY are derived as follows:
  • offsetY ((-nH)>>1)+(angleIdx ⁇ 16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
  • offsetX ((-nW)>>1)+(angleIdx ⁇ 16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
  • the upper left corner coordinate of the first component block is (0, 0) and is derived as follows:
  • disLut is determined according to the above table 3.
  • the first parameter weightIdx is derived as follows:
  • weightIdx (((xL+offsetX) ⁇ 1)+1)*disLut[displacementX]+(((yL+offsetY) ⁇ 1)+1)*disLut[displacementY]
  • the first parameter is then adjusted using the transition parameter to obtain the adjusted first parameter.
  • the first parameter is adjusted through the following formula:
  • weightIdx weightIdx*blendingCoeff
  • blendingCoeff is the transition parameter.
  • the methods for determining the weight of the pixels in the first component block include, but are not limited to, the following:
  • Method 1 Determine the second parameters of the pixels in the first component block based on the adjusted first parameters of the pixels in the first component block; determine the first component block based on the second parameters of the pixels in the first component block The weight of the middle pixel.
  • the second parameter is also used to determine the weight.
  • the above-mentioned second parameter is also called a weight index under the first component, and the first component may be a luminance component, a chrominance component, etc.
  • weightIdxL partFlip? 32+weightIdx:32-weightIdx
  • wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is the second parameter of the midpoint (x, y) of the first component block, also known as the weight of the midpoint (x, y) of the first component block.
  • the weight index under the brightness component wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block
  • weightIdxL is 32–weightIdx.
  • weightIdxL is 32+weightIdx. It should be noted that 32 here is just one Examples, this application is not limited to this.
  • Method 2 Determine the weight of the pixel in the first component block based on the adjusted first parameter, first threshold, and second threshold of the pixel in the first component block.
  • the weight of the pixel point in the first component block is limited to the first threshold or the second threshold, that is, the weight of the pixel point in the first component block is either is the first threshold or the second threshold, thereby reducing the computational complexity of the weight of the first component block.
  • This application does not limit the specific values of the first threshold and the second threshold.
  • the first threshold is 1.
  • the second threshold is 0.
  • the weight of the pixels in the first component block can be determined by the following formula:
  • wVemplateValue[x][y] is the weight of the midpoint (x, y) of the first component block, 1 in the above “1:0" is the first threshold, and 0 is the second threshold.
  • the weight of each point in the first component block is determined through the weight derivation mode, and the weight matrix composed of the weight of each point in the first component block is used as the first component block weight.
  • the cost corresponding to each of the K prediction modes included in the second combination is determined, and then the cost corresponding to the K prediction mode included in the second combination is determined.
  • the corresponding cost of the two combinations is determined.
  • the cost of each second combination among the R second combinations can be determined.
  • a candidate combination list as shown in Table 9 above is constructed.
  • the decoding end queries the candidate combination corresponding to the first index in the candidate combination list shown in Table 9 according to the first index, and determines the candidate combination corresponding to the first index as the first combination, that is, the candidate combination included in the candidate combination
  • the weight derivation mode is determined as the first weight derivation mode
  • the K prediction modes included in the candidate combination are determined as K first prediction modes.
  • case 1 and case 3 after the decoder determines the first combination, it performs the following steps of S102.
  • the content included in the first combination is different.
  • the first combination includes the first weight derivation mode and K first prediction modes, but does not include transition parameters.
  • the first combination includes the first weight derivation mode, K first prediction modes and the second transition parameter.
  • the first combination includes a first weight derivation mode and K first prediction modes, and the first weight derivation mode includes a third transition parameter.
  • the method of determining the predicted value of the current component block is also different depending on the content included in the first combination.
  • Case 11 Determine the predicted value weight of the current component block according to the first weight derivation mode, predict the current component block according to K first prediction modes, obtain K predicted values of the current component block, and use the predicted value of the current component block The weight weights the K predicted values of the current component block to obtain the predicted value of the current component block.
  • the process of deriving the predicted value weight of the current component block can be referred to the process of deriving the predicted value weight of the current block in the above embodiment, which will not be described again here.
  • the following situation 22 is also included.
  • the transition parameters are taken into consideration when determining the prediction value of the current component block.
  • the above S102 includes the following steps of S102-A1 and S102-A2:

Landscapes

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

Abstract

本申请提供一种视频编解码方法、装置、设备、系统、及存储介质,本申请将第一权重导出模式和K个第一预测模式作为一个组合,以组合的形式指示第一权重导出模式和K个第一预测模式,这样在码流中不需要单独传输K个第一预测模式和第一权重导出模式分别对应的语法,进而节省码字,提升编码效率。另外,本申请在当前分量块对应多个第一分量CU,且多个第一分量CU的预测模式不完全相同时,也可以准确确定出第一组合所包括的第一权重导出模式和K个第一预测模式,进而使用该第一权重导出模式和K个第一预测模式,实现当前分量块的准确预测。

Description

视频编解码方法、装置、设备、系统、及存储介质 技术领域
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法、装置、设备、系统、及存储介质。
背景技术
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。
由于视频中存在时间或空间冗余,通过预测可以消除或降低视频中的冗余,提高压缩效率。目前为了提高预测效果,可以使用多个预测模式对当前块进行预测。但是,使用多个预测模式对当前块进行预测时,需要在码流中传输的信息较多,进而增加了编码代价。
发明内容
本申请实施例提供了一种视频编解码方法、装置、设备、系统、及存储介质,可以降低编码代价。
第一方面,本申请提供了一种视频解码方法,应用于解码器,包括:
解码码流,确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
第二方面,本申请实施例提供一种视频编码方法,包括:
确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
根据所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
第三方面,本申请提供了一种视频解码装置,用于执行上述第一方面或其各实现方式中的方法。具体地,该装置包括用于执行上述第一方面或其各实现方式中的方法的功能单元。
第四方面,本申请提供了一种视频编码装置,用于执行上述第二方面或其各实现方式中的方法。具体地,该装置包括用于执行上述第二方面或其各实现方式中的方法的功能单元。
第五方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。
第六方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频解码器用于执行上述第一方面或其各实现方式中的方法,视频编码器用于执行上述第二方面或其各实现方式中的方法。
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十二方面,提供了一种码流,码流是基于上述第二方面的方法生成的,可选的,上述码流包括第一索引,第一索引用于指示由一个权重导出模式和K个预测模式组成的第一组合,K为大于1的正整数。
基于以上技术方案,本申请将第一权重导出模式和K个第一预测模式作为一个组合,以组合的形式指示第一权重导出模式和K个第一预测模式,这样在码流中不需要单独传输K个第一预测模式和第一权重导出模式分别对应的语法,进而节省码字,提升编码效率。另外,本申请实施例,在当前分量块对应多个第一分量CU,且多个第一分量CU的预测模式不完全相同时,也可以准确确定出第一组合所包括的第一权重导出模式和K个第一预测模式,进而使用该第一权重导出模式和K个第一预测模式,实现当前分量块的准确预测。
附图说明
图1为本申请实施例涉及的一种视频编解码系统的示意性框图;
图2是本申请实施例涉及的视频编码器的示意性框图;
图3是本申请实施例涉及的视频解码器的示意性框图;
图4为权重分配示意图;
图5为权重分配示意图;
图6A为帧间预测的示意图;
图6B为加权帧间预测的示意图;
图7A为帧内预测的示意图;
图7B为帧内预测的示意图;
图8A-8I为帧内预测的示意图;
图9为帧内预测模式的示意图;
图10为帧内预测模式的示意图;
图11为帧内预测模式的示意图;
图12为MIP的示意图;
图13为加权预测的示意图;
图14为第一分量块匹配示意图;
图15为本申请实施例涉及的CCLM原理示意图;
图16为本申请一实施例提供的视频解码方法流程示意图;
图17A至图17D为块划分方式示意图;
图17E为一个CTU划分的示意图;
图17F为本申请实施例涉及的亮度分量和色度分量的块划分方式示意图;
图18为本申请实施例涉及的当前分量块与特定位置块的示意图;
图19A为一种权重分配示意图;
图19B为另一种权重分配示意图;
图20为本申请实一施例提供的视频编码方法流程示意图;
图21是本申请一实施例提供的视频解码装置的示意性框图;
图22是本申请一实施例提供的视频编码装置的示意性框图;
图23是本申请实施例提供的电子设备的示意性框图;
图24是本申请实施例提供的视频编解码系统的示意性框图。
具体实施方式
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。例如,本申请的方案可结合至音视频编码标准(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基于图像或基于块对重建图像进行环路滤波,得到解码图像。编码端同样需要和解码端类似的操作获得解码图像。该解码图像也可以称为重建图像,重建图像可以为后续的帧作为帧间预测的参考帧。
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
在一些实施例中,当前块(current block)可以是当前编码单元(CU)或当前预测单元(PU)等。由于并行处理 的需要,图像可以被划分成片slice等,同一个图像中的片slice可以并行处理,也就是说它们之间没有数据依赖。而“帧”是一种常用的说法,一般可以理解为一帧是一个图像。在申请中所述帧也可以替换为图像或slice等。
目前正在制定中的多功能视频编码(Versatile Video Coding,VVC)视频编解码标准中,有一个叫做几何划分预测模式(GeometricpartitioningMode,GPM)的帧间预测模式。目前正在制定中的视频编解码标准(Audio Video coding Standard,AVS)视频编解码标准中,有一个叫做角度加权预测模式(Angular Weightedprediction,AWP)的帧间预测模式。这两种模式虽然名称不同、具体的实现形式不同、但原理上有共通之处。
需要说明的是,传统的单向预测只找一个与当前块大小相同的参考块,传统的双向预测使用两个与当前块大小相同的参考块,且预测块每个点的像素值为两个参考块对应位置的平均值,即每一个参考块的所有点都占50%的比例。双向加权预测使得两个参考块的比例可以不同,如第一个参考块中所有点都占75%的比例,第二个参考块中所有点都占25%的比例。但同一个参考块中的所有点的比例都相同。但同一个参考块中的所有点的比例都相同。其他一些优化方式比如采用解码端运动矢量修正(Decoder sideMotion Vector Refinement,DMVR)技术、双向光流(Bi-directional Optical Flow,BIO)等会使参考像素或预测像素产生一些变化,但与上面所说的原理无关。BIO也可以简写为BDOF。而GPM或AWP也使用两个与当前块大小相同的参考块,但某些像素位置100%使用第一个参考块对应位置的像素值,某些像素位置100%使用第二个参考块对应位置的像素值,而在交界区域或者称过渡区域,按一定比例使用这两个参考块对应位置的像素值。交界区域的权重也是逐渐过渡的。具体这些权重如何分配,由GPM或AWP的模式决定。根据GPM或AWP的模式确定每个像素位置的权重。当然在某些情况下,比如说块尺寸很小的情况,可能某些GPM或AWP的模式下不能保证一定有某些像素位置100%使用第一个参考块对应位置的像素值,某些像素位置100%使用第二个参考块对应位置的像素值。也可以认为GPM或AWP使用两个与当前块大小不相同的参考块,即各取所需的一部分作为参考块。即将权重不为0的部分作为参考块,而将权重为0的部分剔除出来。这是实现的问题,不是本发明讨论的重点。
示例性地,图4为权重分配示意图,如图4所示,其示出了本申请实施例提供的一种GPM在64×64的当前块上的多种划分模式的权重分配示意图,其中,GPM存在有64种划分模式。图5为权重分配示意图,如图5所示,其示出了本申请实施例提供的一种AWP在64×64的当前块上的多种划分模式的权重分配示意图,其中,AWP存在有56种划分模式。无论是图4还是图5,每一种划分模式下,黑色区域表示第一个参考块对应位置的权重值为0%,白色区域表示第一个参考块对应位置的权重值为100%,灰色区域则按颜色深浅的不同表示第一个参考块对应位置的权重值为大于0%且小于100%的某一个权重值,第二个参考块对应位置的权重值则为100%减去第一个参考块对应位置的权重值。
GPM和AWP的权重导出方法不同。GPM根据每种模式确定角度及偏移量,而后计算出每个模式的权重矩阵。AWP首先做出一维的权重的线,然后使用类似于帧内角度预测的方法将一维的权重的线铺满整个矩阵。
应理解,早期的编解码技术中只存在矩形的划分方式,无论是CU、PU还是变换单元(Transform Unit,TU)的划分。而GPM或AWP均在没有划分的情况下实现了预测的非矩形的划分效果。GPM和AWP使用了两个参考块的权重的蒙版(mask),即上述的权重图。这个蒙版确定了两个参考块在产生预测块时的权重,或者可以简单地理解为预测块的一部分位置来自于第一个参考块一部分位置来自于第二个参考块,而过渡区域(blending area)用两个参考块的对应位置加权得到,从而使过渡更平滑。GPM和AWP没有按划分线把当前块划分成两个CU或PU,于是在预测之后的残差的变换、量化、反变换、反量化等也都是将当前块作为一个整体来处理。
GPM使用权重矩阵模拟了几何形状的划分,更确切地说是模拟了预测的划分。而要实施GPM,除了权重矩阵还需要2个预测值,每个预测值由1个单向运动信息确定。这2个单向运动信息来自于一个运动信息候选列表,例如来自merge运动信息候选列表(mergeCandList)。GPM在码流中使用两个索引从mergeCandList中确定2个单向运动信息。
帧间预测使用运动信息(motion information)来表示“运动”。基本的运动信息包含参考帧(reference frame)(或者叫参考图像(reference picture))的信息和运动矢量(MV,motion vector)的信息。常用的双向预测,使用2个参考块对当前块进行预测。2个参考块可以使用一个前向的参考块和一个后向的参考块。可选的,也允许2个都是前向或2个都是后向。所谓前向指参考帧对应的时刻在当前帧之前,后向指参考帧对应的时刻在当前帧之后。或者说前向指参考帧在视频中的位置位于当前帧之前,后向指参考帧在视频中的位置位于当前帧之后。或者说前向指参考帧的POC(picture order count)小于当前帧的POC,后向指参考帧的POC大于当前帧的POC。为了能使用双向预测,自然需要能找到2个参考块,那么就需要2组参考帧的信息和运动矢量的信息。可以把它们每一组理解为一个单向运动信息,而把这2组组合到一起就形成了一个双向运动信息。在具体实现时,单向运动信息和双向运动信息可以使用相同的数据结构,只是双向运动信息的2组参考帧的信息和运动矢量的信息都有效,而单向运动信息的其中一组参考帧的信息和运动矢量的信息是无效的。
在一些实施例中,支持2个参考帧列表,记为RPL0,RPL1,其中RPL是Reference Picture List的简写。在一些实施例中,P slice只可以使用RPL0,B slice可以使用RPL0和RPL1。对一个slice,每个参考帧列表中有若干参考帧,编解码器通过参考帧索引来找到某一个参考帧。在一些实施例中,用参考帧索引和运动矢量来表示运动信息。如对上述的双向运动信息,使用参考帧列表0对应的参考帧索引refIdxL0,以及参考帧列表0对应的运动矢量mvL0,参考帧列表1对应的参考帧索引refIdxL1,以及参考帧列表1对应的运动矢量mvL0。这里的参考帧列表0对应的参考帧索引,参考帧列表1对应的参考帧索引就可以理解为上述的参考帧的信息。在一些实施例中,用两个标志位来分别表示是否使用参考帧列表0对应的运动信息以及是否使用参考帧列表0对应的运动信息,分别记为predFlagL0和predFlagL1。也可以理解为predFlagL0和predFlagL1表示上述单向运动信息“是否有效”。虽然没有明确地提到运动信息这种数据结构,但是它用每个参考帧列表对应的参考帧索引,运动矢量以及“是否有效”的标志位一起来表示运动信息。在一些标准文本中不出现运动信息,而是使用的运动矢量,也可以认为参考帧索引和是否使用对应运动信息的标志是运动矢量的附属。本申请中为了描述方便仍然用“运动信息”,但是应当理解,也可以用“运动矢量”来描述。
当前块所使用的运动信息可以保存下来。当前帧的后续编解码的块可以根据相邻的位置关系使用前面已编解码的块,如相邻块,的运动信息。这利用了空域上的相关性,所以这种已编解码的运动信息叫做空域上的运动信息。当前帧的每个块所使用的运动信息可以保存下来。后续编解码的帧可以根据参考关系使用前面已编解码的帧的运动信息。这利用了时域上的相关性,所以这种已编解码的帧的运动信息叫做时域上的运动信息。当前帧的每个块所使用的运动信息的存储方法通常将一个固定大小的矩阵,如4x4的矩阵,作为一个最小单元,每个最小单元单独存储一组运动信息。这样每编解码一个块,它的位置对应的那些最小单元就可以把这个块的运动信息存储下来。这样使用空域上的运动信息或时域上的运动信息时可以直接根据位置找到该位置对应的运动信息。如一个16x16的块使用了传统的单向预测,那么这个块对应的所有的4x4个最小单元都存储这个单向预测的运动信息。如果一个块使用了GPM或AWP,那么这个块对应的所有的最小单元会根据GPM或AWP的模式,第一个运动信息,和第二个运动信息以及每个最小单元的位置确定每个最小单元存储的运动信息。一种方法是如果一个最小单元对应的4x4的像素全部来自于第一个运动信息,那么这个最小单元存储第一个运动信息,如果一个最小单元对应的4x4的像素全部来自于第二个运动信息,那么这个最小单元存储第二个运动信息。如果一个最小单元对应的4x4的像素既来自于第一个运动信息又来自于第二个运动信息,那么AWP会选择其中一个运动信息进行存储;GPM的做法是如果两个运动信息指向不同的参考帧列表,那么把它们组合成双向运动信息存储,否则只存储第二个运动信息。
可选的,上述mergeCandList是根据空域运动信息,时域运动信息,基于历史的运动信息,还有一些其他的运动信息来构建的。示例性的,mergeCandList使用如图6A中1至5的位置来推导空域运动信息,使用如图6A中的6或7的位置来推导时域运动信息。基于历史的运动信息是在每编解码一个块时,把这个块的运动信息添加到一个先进先出的列表里,添加过程可能需要一些检查,如是否跟列表里现有的运动信息重复。这样在编解码当前块时就可以参考这个基于历史的列表里的运动信息。
在一些实施例中,关于GPM的语法描述如表1所示:
表1
Figure PCTCN2022103734-appb-000001
如表1所示,在merge模式下,如果regular_merge_flag不为1,当前块可能用CIIP或GPM。如果当前块不用CIIP,那么它就用GPM,也就是在表1中的语法“if(!ciip_flag[x0][y0])”所示的内容。
如上述表1可知,GPM需要在码流中传输3个信息,即merge_gpm_partition_idx,merge_gpm_idx0,merge_gpm_idx1。x0,y0用来确定当前块左上角亮度像素相对于图像左上角亮度像素的坐标(x0,y0)。merge_gpm_partition_idx确定GPM的划分形状,上面已经讲过了,它是“模拟划分”,merge_gpm_partition_idx也就是本文所说的权重矩阵导出模式或者说权重矩阵导出模式的索引,或者说权重导出模式或权重导出模式的索引。merge_gpm_idx0是第一个合并候选索引,第一合并(merge)候选索引用于根据mergeCandList确定第一运动信息或者称第一合并候选。merge_gpm_idx1是第二个合并候选索引,第二合并(merge)候选索引用于根据mergeCandList确定第二运动信息或者称第二合并候选。如果MaxNumGpmMergeCand>2即候选列表长度大于2才需要解码merge_gpm_idx1,否则可以直接确定。
在一些实施例中,GPM的解码过程包括如下步骤:
解码过程输入的信息包括:当前块左上角的亮度位置相对于图像左上角的坐标(xCb,yCb),当前块亮度分量的宽 度cbWidth,当前块亮度分量的高度cbHeight,1/16像素精度的亮度运动矢量mvA和mvB,色度运动矢量mvCA和mvCB,参考帧索引refIdxA和refIdxB,预测列表标志predListFlagA和predListFlagB。
示例性的,可以用运动矢量,参考帧索引和预测列表标志组合起来来表示运动信息。VVC支持2个参考帧列表,每个参考帧列表可能有多个参考帧。单向预测只使用其中一个参考帧列表中的一个参考帧的一个参考块作为参考,双向预测使用两个参考帧列表中的各一个参考帧的各一个参考块作为参考。而VVC中的GPM使用2各单向预测。上述mvA和mvB,mvCA和mvCB,refIdxA和refIdxB,predListFlagA和predListFlagB中的A可以理解为第一个预测模式,B可以理解为第二个预测模式。我们用X表示A或B,predListFlagX表示X使用第一个参考帧列表还是第二个参考帧列表,refIdxX表示X使用的参考帧列表中的参考帧索引,mvX表示X使用的亮度运动矢量,mvCX表示X使用的色度运动矢量。重申一遍,可以认为VVC中,运动矢量,参考帧索引和预测列表标志组合起来来表示本文所述的运动信息。
解码过程输出的信息包括:(cbWidth)X(cbHeight)的亮度预测样本矩阵predSamplesL;(cbWidth/SubWidthC)X(cbHeight/SubHeightC)的Cb色度分量的预测样本矩阵,如果需要;(cbWidth/SubWidthC)X(cbHeight/SubHeightC)的Cr色度分量的预测样本矩阵,如果需要。
示例性的,下面以亮度分量举例,色度分量的处理和亮度分量类似。
假设predSamplesLAL和predSamplesLBL的大小为(cbWidth)X(cbHeight),为根据2个预测模式做出的预测样本矩阵。predSamplesL按如下方法导出:分别根据亮度运动矢量mvA和mvB,色度运动矢量mvCA和mvCB,参考帧索引refIdxA和refIdxB,预测列表标志predListFlagA和predListFlagB确定predSamplesLAL和predSamplesLBL。即分别根据2个预测模式的运动信息进行预测,详细过程不再赘述。通常GPM是merge模式,可以认为GPM的2个预测模式都是merge模式。
根据merge_gpm_partition_idx[xCb][yCb],利用表2确定GPM的划分角度索引变量angleIdx和距离索引变量distanceIdx。
表2–angleIdx和distanceIdx与merge_gpm_partition_idx的对应关系
merge_gpm_partition_idx 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
angleIdx 0 0 2 2 2 2 3 3 3 3 4 4 4 4 5 5
distanceIdx 1 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1
merge_gpm_partition_idx 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
angleIdx 5 5 8 8 11 11 11 11 12 12 12 12 13 13 13 13
distanceIdx 2 3 1 3 0 1 2 3 0 1 2 3 0 1 2 3
merge_gpm_partition_idx 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
angleIdx 14 14 14 14 16 16 18 18 18 19 19 19 20 20 20 21
distanceIdx 0 1 2 3 1 3 1 2 3 1 2 3 1 2 3 1
merge_gpm_partition_idx 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
angleIdx 21 21 24 24 27 27 27 28 28 28 29 29 29 30 30 30
distanceIdx 2 3 1 3 1 2 3 1 2 3 1 2 3 1 2 3
需要说明的是,因为三个分量(component,如Y、Cb、Cr)都可以使用GPM,所以在一些标准文本将一个分量产生GPM的预测样本矩阵的过程分装到了一个子流程里面,即GPM的加权预测过程(Weighted sample prediction process for geometric partitioning mode),三个分量都会调用这个流程,只是调用的参数不同,这里只用亮度分量举例。当前亮度块的预测矩阵predSamplesL[xL][yL](其中xL=0..cbWidth–1,yL=0..cbHeight-1)由GPM的加权预测过程导出。其中nCbW设为cbWidth,nCbH设为cbHeight,两个预测模式做的预测样本矩阵predSamplesLAL和predSamplesLBL,还有angleIdx,distanceIdx作为输入。
在一些实施例中,GPM的加权预测导出过程包括如下步骤:
该过程的输入有:当前块的宽度nCbW,当前块的高度nCbH;2个(nCbW)X(nCbH)的预测样本矩阵predSamplesLA和predSamplesLB;GPM的划分角度索引变量angleIdx;GPM的距离索引变量distanceIdx;分量索引变量cIdx。本示例以亮度举例,因此上述cIdx为0,表示亮度分量。
该过程的输出有:(nCbW)X(nCbH)的GPM预测样本矩阵pbSamples。
示例性的,变量nW,nH,shift1,offset1,displacementX,displacementY,partFlip还有shiftHor按如下方法导出:
nW=(cIdx==0)?nCbW:nCbW*SubWidthC;
nH=(cIdx==0)?nCbH:nCbH*SubHeightC;
shift1=Max(5,17-BitDepth),其中BitDepth是编解码的比特深度;
offset1=1<<(shift1-1),其中“<<”表示左移;
displacementX=angleIdx;
displacementY=(angleIdx+8)%32;
partFlip=(angleIdx>=13&&angleIdx<=27)?0:1;
shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))?0:1。
变量offsetX和offsetY按如下方法导出:
当shiftHor的值为0时:
offsetX=(-nW)>>1,
offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))。
当shiftHor的值为1时:
offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3),
offsetY=(-nH)>>1。
变量xL和yL按如下方法导出:
xL=(cIdx==0)?x:x*SubWidthC,
yL=(cIdx==0)?y:y*SubHeightC,
表示当前位置预测样本权重的变量wValue按如下方法导出,wValue即为(x,y)点的第一预测模式的预测矩阵的预测值predSamplesLA[x][y]的权重,而(8-wValue)即为(x,y)点的第一预测模式的预测矩阵的预测值predSamplesLB[x][y]的权重。
其中距离矩阵disLut按表3确定:
表3
idx 0 2 3 4 5 6 8 10 11 12 13 14
disLut[idx] 8 8 8 4 4 2 0 -2 -4 -4 -8 -8
idx 16 18 19 20 21 22 24 26 27 28 29 30
disLut[idx] -8 -8 -8 -4 -4 -2 0 2 4 4 8 8
weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY],
weightIdxL=partFlip?32+weightIdx:32–weightIdx,
wValue=Clip3(0,8,(weightIdxL+4)>>3),
预测样本的值pbSamples[x][y]按如下方法导出:
pbSamples[x][y]=Clip3(0,(1<<BitDepth)-1,(predSamplesLA[x][y]*wValue+predSamplesLB[x][y]*(8-wValue)+offset1)>>shift1)。
需要说明的是,对当前块的每一个位置推导一个权重值,然后计算一个GPM的预测值pbSamples[x][y]。因为这种方式权重wValue不必写成一个矩阵的形式,但是可以理解如果把每个位置的wValue都保存到一个矩阵里,那它就是一个权重矩阵。每个点分别计算权重并加权得到GPM的预测值,或者计算出所有的权重再统一加权得到GPM的预测样本矩阵其原理是一样的。而本申请中的诸多描述中使用权重矩阵的说法,是为了表述更容易理解,用权重矩阵画图更直观,其实也可以按每个位置的权重来描述。比如权重矩阵导出模式也可以说成权重导出模式。
在一些实施例中,如图6B所示,GPM的解码流程可以表述为:解析码流,确定当前块是否使用GPM技术;如果当前块使用GPM技术,确定权重导出模式(或划分模式或权重矩阵导出模式),及第一运动信息和第二运动信息。分别根据第一运动信息确定第一预测块,根据第二运动信息确定第二预测块,根据权重矩阵导出模式确定权重矩阵,根据第一预测块和第二预测块和权重矩阵确定当前块的预测块。
帧内预测方法是使用当前块周边已编解码的重建像素作为参考像素来对当前块进行预测。图7A为帧内预测的示意图,如图7A所示,当前块的大小为4x4,当前块左侧一行和上方一列的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如当前块是整帧的最左侧,那么当前块的左边的参考像素不可得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。
图7B为帧内预测的示意图,如图7B所示,多参考行帧内预测方法(Multiple reference line,MRL)可以使用更多的参考像素从而提高编解码效率,例如,使用4个参考行/列为当前块的参考像素。
进一步地,帧内预测有多种预测模式,图8A-5I为帧内预测的示意图,如图8A-5I所示,H.264中对4x4的块进行帧内预测主要可以包括9种模式。其中,如图8A所示的模式0将当前块上面的像素按垂直方向复制到当前块作为预测值,如图8B所示的模式1将左边的参考像素按水平方向复制到当前块作为预测值,如图8C所示的模式2直流DC将A~D和I~L这8个点的平均值作为所有点的预测值,如图8D-5I所示的模式3~8分别按某一个角度将参考像素复制到当前块的对应位置,因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。
除此之外,还有Plane,Planar等模式等,而随着技术的发展以及块的扩大,角度预测模式也越来越多。图9为帧内预测模式的示意图,如图9所示,如HEVC使用的帧内预测模式有Planar、DC和33种角度模式共35种预测模式。图10为帧内预测模式的示意图,如图10所示,VVC使用的帧内模式有Planar、DC和65种角度模式共67种预测模式。图11为帧内预测模式的示意图,如图11所示,VS3使用DC、Plane、Bilinear、PCM和62种角度模式共66种预测模式。
另外还有一些技术对预测进行改进,如改进参考像素的分像素插值,对预测像素进行滤波等。如AVS3中的多组合帧内预测滤波(multipleintraprediction filter,MIPF)对不同的块大小,使用不同的滤波器产生预测值。对同一个块内的不同位置的像素,与参考像素较近的像素使用一种滤波器产生预测值,与参考像素较远的像素使用另一种滤波器产生预测值。对预测像素进行滤波的技术如AVS3中的帧内预测滤波(intraprediction filter,IPF),对预测值可以使用参考像素进行滤波。
在帧内预测中可以使用最可能模式列表(MostprobableModes List,MPM)的帧内模式编码技术来提高编解码效率。利用周边已编解码的块的帧内预测模式,以及根据周边已编解码块的帧内预测模式导出的帧内预测模式,如相邻的模式,以及一些常用或使用概率比较高的帧内预测模式,如DC,Planar,Bilinear模式等,构成一个模式列表。参考周边已编解码的块的帧内预测模式利用了空间上的相关性。因为纹理在空间上会有一定的连续性。MPM可以作为 帧内预测模式的预测。也就是认为当前块使用MPM的概率会比不使用MPM的概率高。因而在二值化时,会给MPM使用更少的码字,从而节省开销,以提高编解码效率。
在一些实施例中,可以使用基于矩阵的帧内预测(Matrix-based Intra Prediction,MIP),有的地方也写做Matrix weighted Intra Prediction进行帧内预测。如图12所示,为了对一个宽度为W高度为H的块进行预测,MIP需要当前块左侧一列的R个重建像素和当前块上侧一行的W个重建像素作为输入。MIP按如下3个步骤生成预测块:参考像素平均(Averaging),矩阵乘法(Matrix Vector Multiplication)和插值(Interpolation)。其中矩阵乘法是MIP的核心。MIP可以认为是用一种矩阵乘法的方式用输入像素(参考像素)生成预测块的过程。MIP提供了多种矩阵,预测方式的不同就体现在矩阵的不同上,相同的输入像素使用不同的矩阵会得到不同的结果。而参考像素平均和插值的过程是一种性能和复杂度折中的设计。对于尺寸较大的块,可以通过参考像素平均来实现一种近似于降采样的效果,使输入能适配到比较小的矩阵,而插值则实现一种上采样的效果。这样就不需要对每一种尺寸的块都提供MIP的矩阵,而是只提供一种或几种特定的尺寸的矩阵即可。随着对压缩性能的需求的提高,以及硬件能力的提高,下一代的标准中也许会出现复杂度更高的MIP。
MIP有些类似于planar,但显然MIP比planar更复杂,灵活性也更强。
GPM用权重矩阵组合两个帧间预测块。实际上它可以扩展到组合两个任意的预测块。如两个帧间预测块,两个帧内预测块,一个帧间预测块和一个帧内预测块。甚至在屏幕内容编码中,还可以使用IBC(intra block copy)或palette的预测块作为其中的1个或2个预测块。
本申请将帧内、帧间、IBC、palette称为不同的预测方式。为了表述方便,这里使用一个叫预测模式的称呼。预测模式可以理解为根据它编解码器可以产生当前块的一个预测块的信息。比如,在帧内预测中,预测模式可以是某个帧内预测模式,如DC,Planar,各种帧内角度预测模式等。当然也可以叠加某个或某些辅助的信息,比如帧内参考像素的优化方法,产生初步的预测块以后的优化方法(比如滤波)等。比如,在帧间预测中,预测模式可以是skip(跳过)模式,merge(合并)模式或MMVD(merge with motion vector difference,带运动矢量差的合并)模式,或AMVP(advanced motion vector predition,高级运动矢量预测),可以是单向预测也可以是双向预测或多假设预测。如果帧间的预测模式使用单向预测,一个预测模式还要能确定一个运动信息,根据一个运动信息能确定预测块。如果帧间的预测模式使用双向预测,一个预测模式还要能确定两个运动信息,根据两个运动信息能确定预测块。
这样GPM需要确定的信息可以表述为1个权重导出模式和2个预测模式。权重导出模式用来确定权重矩阵或权重,2个预测模式分别确定一个预测块或预测值。权重导出模式在某些地方也被称为划分模式。但因为它是模拟划分,本申请称为权重导出模式。
其中,2个预测模式可以来自相同的或不同的预测方式,其中预测方式包括但不限于帧内预测、帧间预测、IBC、palette。
可选的,2个预测模式可以来自相同的或不同的预测方式,其中预测方式包括但不限于帧内预测、帧间预测、IBC、palette。
一个具体的具体的例子如下:如果当前块使用GPM。这个例子用在帧间编码的块中,允许使用帧内预测和帧间预测中的merge模式。如表4所示,增加一个语法元素intra_mode_idx表示哪一个预测模式是帧内预测模式,比如intra_mode_idx为0表示2个预测模式都是帧间预测模式,即mode0IsInter为1,mode0IsInter为1;intra_mode_idx为1表示第一个预测模式是帧内预测模式,第二个预测模式是帧间预测模式,即mode0IsInter为0,mode0IsInter为1;intra_mode_idx为2表示第一个预测模式是帧间预测模式,第二个预测模式是帧内预测模式,即mode0IsInter为1,mode0IsInter为0;intra_mode_idx为3表示两个预测模式都是帧内预测模式,即mode0IsInter为0,mode0IsInter为0。
表4
Figure PCTCN2022103734-appb-000002
在一些实施例中,如图13所示,GPM的解码流程可以表述为:解析码流,确定当前块是否使用GPM技术;如果当前块使用GPM技术,确定权重导出模式(或划分模式或权重矩阵导出模式),及第一预测模式和第二预测模式。分别根据第一预测模式确定第一预测块,根据第二预测模式确定第二预测块,根据权重矩阵导出模式确定权重矩阵,根据第一预测块和第二预测块和权重矩阵确定当前块的预测块。
模板匹配(template matching)的方法最早用在帧间预测中,它利用相邻像素之间的相关性,把当前块周边的一些区域作为模板。在当前块进行编解码时,按照编码顺序其左侧及上侧已经编解码完成。当然在现有的硬件解码器实现时,不一定能保证当前块开始解码时,其左侧和上侧已经解码完成,当然这里说的是帧间块,比如在HEVC中帧间编码的块产生预测块时是不需要周边的重建像素的,因而帧间块的预测过程可以并行进行。但是帧内编码的块是一定需要左侧和上侧的重建像素作为参考像素的。理论上左侧和上侧是可得的,也就是说硬件设计做相应的调整是可以实现的。相对来说右侧和下侧在现在标准如VVC的编码顺序下是不可得的。
如图14所示把当前块的左侧和上侧的矩形区域设为模板,左侧的模板部分的高度一般和当前块的高度相同,上侧的模板的部分的宽度一般和当前块的宽度相同,当然也可以不同。在参考帧中寻找模板的最佳匹配位置从而确定当前块的运动信息或者说运动矢量。这个过程大致可以描述为,在某一个参考帧中,从一个起始位置开始,在周边一定 范围内进行搜索。可以预先设定好搜索的规则,如搜索范围搜索步长等。每移动一个到位置,计算该位置对应的模板和当前块周边的模板的匹配程度,所谓匹配程度可以用一些失真代价来衡量,比如说SAD(sum of absolute difference),SATD(sum of absolute transformed difference),一般SATD使用的变换是Hadamard变换,MSE(mean-square error)等,SAD,SATD,MSE等的值越小代表匹配程度越高。用该位置对应的模板的预测块和当前块周边的模板的重建块计算代价。除了整像素位置的搜索还可以进行分像素位置的搜索,根据搜索到的匹配程度最高的位置来确定当前块的运动信息。利用相邻像素之间的相关性,对模板合适的运动信息可能也是当前块合适的运动信息。当然模板匹配的方法可能并不一定对所有的块都适用,因而可以使用一些方法确定当前块是否使用上述模板匹配的方法,比如在当前块用一个控制开关表示是否使用模板匹配的方法。这种模板匹配的方法的一个名字叫DMVD(decoder side motion vector derivation)。编码器和解码器都可以利用模板进行搜索从而导出运动信息或者在原有的运动信息的基础上找到更好的运动信息。而它不需要传输具体的运动矢量或运动矢量差,而是由编码器和解码器都进行同样规则的搜索从而保证编码和解码的一致。模板匹配的方法可以提高压缩性能,但是它需要在解码器中也进行“搜索”,从而带来了一定的解码器复杂度。
上述是在帧间上应用模板匹配的方法,模板匹配的方法也可以用在帧内上,比如说利用模板来确定帧内预测模式。对当前块,同样可以使用当前块上侧和左侧一定范围内的区域作为模板,比如说仍然如上图所示的左侧的矩形区域和上侧的矩形区域。在编解码当前块时,在模板中的重建像素是可得的。这个过程大致可以描述为,对当前块确定候选的帧内预测模式的集合,候选的帧内预测模式构成全部可用的帧内预测模式的一个子集。当然候选的帧内预测模式可以是全部可用的帧内预测模式的全集。这可以根据性能和复杂度的权衡来确定。可以根据MPM或一些规则,如等间距筛选等,来确定候选的帧内预测模式的集合。计算各候选的帧内预测模式在模板上的代价,比如SAD,SATD,MSE等。用该模式在模板上进行预测做出预测块,用预测块和模板的重建块计算代价。代价小的模式可能与模板更匹配,利用相邻像素之间的相似性,在模板上表现好的帧内预测模式可能也是当前块上表现好的帧内预测模式。选定1个或几个代价小的模式。当然上述2步可以重复进行,比如说在选定1个或几个代价小的模式后,再一次确定候选的帧内预测模式的集合,对新确定的候选的帧内预测模式集合再计算代价,选定1个或几个代价小的模式。这也可以理解为粗选和细选。最终选定的1个帧内预测模式确定为当前块的帧内预测模式,或者最终选定的几个帧内预测模式作为当前块的帧内预测模式的候选。当然也可以仅仅用模板匹配的方法对候选的帧内预测模式集合进行排序,比如对MPM列表进行排序,即将MPM列表中的模式分别在模板上做出预测块并确定代价,按代价从小到大进行排序。一般MPM列表中越靠前的模式在码流中的开销越小,这样也可以达到提高压缩效率的目的。
模板匹配的方法可以用于确定GPM的2个预测模式上。如果将模板匹配的方法用于GPM,对当前块可以用1个控制开关控制当前块的2个预测模式是否使用模板匹配,也可以用2个控制开关分别控制2个预测模式各自是否使用模板匹配。
另一方面是如何使用模板匹配。比如如果GPM在merge模式下使用,如VVC中的GPM,它使用merge_gpm_idxX从mergeCandList中确定一个运动信息,其中大写的X为0或1。对第X个运动信息,一种方法是在上述运动信息的基础上用模板匹配的方法进行优化。即根据merge_gpm_idxX从mergeCandList中确定一个运动信息,如果对该运动信息使用模板匹配,那么用模板匹配的方法在上述运动信息的基础上进行优化。另一种方法是不使用merge_gpm_idxX从mergeCandList中确定一个运动信息,而是直接从一个默认运动信息的基础上进行搜索,确定一个运动信息。
如果第X预测模式是帧内预测模式,而且当前块的第X预测模式使用模板匹配的方法,那么可以利用模板匹配方法确定一个帧内预测模式,不需要在码流中指示该帧内预测模式的索引。或者利用模板匹配方法确定一个候选集合或者MPM列表,需要在码流中指示该帧内预测模式的索引。
由上述可知,GPM有3个要素,一个权重矩阵和2个预测模式。GPM的优势是可以通过权重矩阵实现更自主的组合。而另一方面,GPM需要确定更多的信息,因而需要在码流中付出更大的开销。以VVC中的GPM为例,VVC中的GPM用在merge模式下。在码流中分别用merge_gpm_partition_idx,merge_gpm_idx0,merge_gpm_idx1确定权重矩阵,第一个预测模式和第二个预测模式。权重矩阵和2个预测模式各自都有多种可能的选择,比如VVC中的权重矩阵有64种可能的选择。而merge_gpm_idx0,merge_gpm_idx1各自在VVC中最大允许有6种可能的选择,当然VVC规定merge_gpm_idx0和merge_gpm_idx1不重复。那么这样的GPM就有65X6X5种可能的选择。而如果将MMVD用于2个运动信息(预测模式)的优化上,对每一个预测模式又可以提供多种可能的选择。这个数量就相当庞大了。
而如果GPM使用2个帧内预测模式,其中每一个预测模式如果可以使用VVC中的67种普通帧内预测模式,2个帧内预测模式不相同,也有64X67X66种可能的选择。当然为了节省开销,可以限制每个预测模式只可以使用所有普通帧内预测模式的一个子集,但这仍然有众多的可能的选择。
目前,GPM的1个权重导出模式和2个预测模式需要按照各自的规则分别在码流中传输必要的信息。例如,1个权重导出模式有自己的一个或多个语法元素,第一个预测模式有自己的一个或多个语法元素,第二个预测模式有自己的一个或多个语法元素。当然标准可以限制在某些情况下第二个预测模式不能和第一个预测模式相同,或者某些优化手段可以同时用在2个预测模式(这也可以理解为用在当前块),但是三者在语法元素的写入和解析上是相对独立的,即需要较多的码字对权重导出模式和预测模式进行指示,编码开销大。
另外,由于同一空间的不同分量间具有很强的相关性,视频编解码技术可以利用这种相关性来提高压缩效率。在一些情况下,同一空间的第一分量会先编解码,然后再编解码第二分量和第三分量,这样第二分量和第三分量可以利用第一分量的一些信息。一个典型的例子是跨分量预测(cross-component linear model prediction,简称CCLM)。在同一个CU中,色度分量的像素可以用亮度分量的重建像素来预测。具体地,如下面等式所示:
pred C(i,j)=α·rec L′(i,j)+β
其中,pred C(i,j)代表(i,j)位置的色度像素的预测值,rec L′(i,j)代表(i,j)位置经过降采样的色度像素的重 建值。CCLM的参数(α和β)是根据当前CU的相邻的经过降采样的亮度像素和色度像素导出的。
在一种示例中,如图15所示,基本的原理是利用当前CU相邻的亮度和色度像素导出线性模型,再将这个线性模型用在当前CU上,根据亮度的重建值和这个线性模型确定色度的预测值。
但是,在一些情况下,由于一个色度CU可能对应多个亮度CU,且不同的亮度CU的预测模式可能不同,这种情况下CCLM无法实现对复杂纹理的色度块的准确预测。
为了解决上述技术问题,本申请实施例将当前分量块对应的第一权重导出模式和K个第一预测模式作为一个组合,以组合的形式指示第一权重导出模式和K个第一预测模式,这样在码流中不需要单独传输K个第一预测模式和第一权重导出模式分别对应的语法,进而节省码字,提升编码效率。另外,本申请实施例,在当前分量块对应多个第一分量CU,且多个第一分量CU的预测模式不完全相同时,也可以准确确定出第一组合所包括的第一权重导出模式和K个第一预测模式,进而使用该第一权重导出模式和K个第一预测模式,实现当前分量块的准确预测。
下面结合图16,以解码端为例,对本申请实施例提供的视频解码方法进行介绍。
图16为本申请一实施例提供的视频解码方法流程示意图,本申请实施例应用于图1和图3所示视频解码器。如图16所示,本申请实施例的方法包括:
S101、解码码流,确定第一组合。
其中,第一组合包括第一权重导出模式和K个第一预测模式,K为大于1的正整数。
图像格式包括YUV、YCrCb、RGB等。在YUV格式中,Y表示亮度分量,UV分别表示色度分量,其中Y也称为第一分量,U称第二分量,V称为第三分量。在YCrCb格式中,Y表示亮度分量,CrCb分别表示色度分量,其中Y也称为第一分量,Cr称第二分量,Cb称为第三分量。在一些实施例中,在RGB格式中,G称为第一分量,B称为第二分量,R称为第三分量。
在一些实施例中,在编解码时,可以将CTU的第一分量划分为至少一个第一分量块,将第二分量划分为至少一个第二分量块,将第三分量划分为至少一个第三分量块。
本申请实施例,采用K个不同的预测模式对当前分量块进行预测,其中当前分量块包括第二分量块或第三分量块。
由上述可知,一个权重导出模式和K个预测模式共同产生一个预测块,这个预测块作用于当前分量块,即根据第一权重导出模式确定权重,根据K个第一预测模式对当前分量块进行预测,得到K个预测值,根据权重对K个预测值进行加权处理,得到当前分量块的预测值。由此可知,该第一组合所包括的第一权重导出模式和K个第一预测模式,共同作用在当前分量块,它们之间是有关联的。
在本申请中,第一权重导出模式用于对当前分量块使用的权重进行确定。具体地,第一权重导出模式可以是导出权重的模式。对于一个给定长度和宽度的块,每一种权重导出模式可以导出一个权重矩阵;对于同样大小的块,不同权重导出模式导出的权重矩阵不同。
示例性的,在本申请中,AWP有56种权重导出模式,GPM有64种权重导出模式。
上述第一组合所包括的K个不同的第一预测模式包括如下几种示例:
示例1,上述K个不同的第一预测模式均为帧内预测模式,例如当前分量块是帧内编码的块,且不适用屏幕内容编码。
示例2,上述K个不同的第一预测模式均为帧间预测模式,例如当前分量块为帧间编码的块。
示例3,上述K个不同的第一预测模式中,至少一个为帧内预测模式,至少一个为帧间预测模式。
示例4,上述K个不同的第一预测模式中,至少一个为帧内预测模式,至少一个为非帧间和非帧内的预测模式,例如为块内复制IBC预测模式或调色板palette预测模式等。
示例5,上述K个不同的第一预测模式中,至少一个为帧间预测模式,至少一个为非帧间和非帧内的预测模式,例如为IBC预测模式或palette预测模式等。
示例6,上述K个不同的第一预测模式均不是帧内预测模式,也不是帧间预测模式,例如一个为IBC预测模式,一个为palette预测模式等。
需要说明的是,本申请实施例对第一组合所包括的K个不同的第一预测模式的具体类型不做限制。
在一些实施例中,确定第一组合之前,首先需要判断当前分量块是否使用K个不同的预测模式进行加权预测处理。若解码端确定当前分量块使用K个不同的预测模式进行加权预测处理时,则执行上述S101解码码流,确定第一组合。若解码端确定当前分量块不使用K个不同的预测模式进行加权预测处理时,则跳过上述S101的步骤。
在一种可能的实现方式中,解码端可以通过确定当前分量块的预测模式参数,来确定当前分量块是否使用K个不同的预测模式进行加权预测处理。
可选的,在本申请的实施中,预测模式参数可以指示当前分量块是否可以使用GPM模式或AWP模式,即指示当前分量块是否可以使用K个不同的预测模式进行预测处理。
可以理解的是,在本申请的实施例中,可以将预测模式参数理解为一个表明是否使用了GPM模式或AWP模式标志位。具体地,编码器可以使用一个变量作为预测模式参数,从而可以通过对该变量的取值的设置来实现预测模式参数的设置。示例性的,在本申请中,如果当前分量块使用GPM模式或AWP模式,那么编码器可以将预测模式参数的取值设置为指示当前分量块使用GPM模式或AWP模式,具体地,编码器可以将变量的取值设置为1。示例性的,在本申请中,如果当前分量块不使用GPM模式或AWP模式,那么编码器可以将预测模式参数的取值设置为指示当前分量块不使用GPM模式或AWP模式,具体地,编码器可以将变量取值设置为0。进一步地,在本申请的实施例中,编码器在完成对预测模式参数的设置之后,便可以将预测模式参数写入码流中,传输至解码器,从而可以使解码器在解析码流之后获得预测模式参数。
基于此,解码端解码码流,得到预测模式参数,进而根据该预测模式参数确定当前分量块是否使用GPM模式或 AWP模式,若当前分量块使用GPM模式或AWP模式,即使用K个不同的预测模式进行预测处理时,确定当前分量块的权重导出模式。
在一些实施例中,如表5所示,本申请实施例还可以对当前分量块使用GPM模式或AWP模式进行条件限定,即在判断当前分量块在满足预设条件时,确定当前分量块使用K个预测模式进行加权预测,进而解码端解码码流,确定第一组合。
示例性的,在应用GPM模式或AWP模式时,可以对当前分量块的尺寸进行限制。
可以理解的是,由于本申请实施例提出的预测方法需要分别使用K个不同的预测模式生成K个预测值,再根据权重进行加权得到当前分量块的预测值,为了降低的复杂度,同时考虑压缩性能和复杂度的权衡,在本申请的实施例中,可以限制对一些大小的块不使用该GPM模式或AWP模式。因此,在本申请中,解码器可以先确定当前分量块的尺寸参数,然后根据尺寸参数确定当前分量块是否使用GPM模式或AWP模式。
在本申请的实施例中,当前分量块的尺寸参数可以包括当前分量块的高度和宽度,因此,解码器可以根据当前分量块的高度和宽度确定当前分量块是否使用GPM模式或AWP模式。
示例性的,在本申请中,若宽度大于第一阈值且高度大于第二阈值,则确定当前分量块可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的宽度大于(或大于等于)第一阈值,且块的高度大于(或大于等于)第二阈值的情况下使用GPM模式或AWP模式。其中,第一阈值和第二阈值的值可以是4、8,16,32、128、256等,第一阈值可以等于第二阈值。
示例性的,在本申请中,若宽度小于第三阈值且高度大于第四阈值,则确定当前分量块可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的宽度小于(或小于等于)第三阈值,且块的高度大于(或大于等于)第四阈值的情况下使用GPM模式或AWP模式。其中,第三阈值和第四阈值的值可以是4、8,16,32、128、256等,第三阈值可以等于第四阈值。
进一步地,在本申请的实施例中,还可以通过像素参数的限制来实现限制能够使用GPM模式或AWP模式的块的尺寸。
示例性的,在本申请中,解码器可以先确定当前分量块的像素参数,然后再根据像素参数和第五阈值进一步判断当前分量块是否可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的像素数大于(或大于等于)第五阈值的情况下使用GPM模式或AWP模式。其中,第五阈值的值可以是4、8,16,32、128、256、1024等。
也就是说,在本申请中,在当前分量块的尺寸参数满足大小要求的条件下,当前分量块才可以使用GPM模式或AWP模式。
示例性的,在本申请中,可以有一个帧级的标志来确定当前待解码帧是否使用本申请。如可以配置帧内帧(如I帧)使用本申请,帧间帧(如B帧、P帧)不使用本申请。或者可以配置帧内帧不使用本申请,帧间帧使用本申请。或者可以配置某些帧间帧使用本申请,某些帧间帧不使用本申请。帧间帧也可以使用帧内预测,因而帧间帧也有可能使用本申请。
在一些实施例中,还可以有一个帧级以下、CU级以上(如tile、slice、patch、LCU等)的标志来确定这一区域是否使用本申请。
本申请实施例对上述S101中解码码流,确定第一组合的具体方式不做限制。
在一些实施例中,第一组合为预设组合,也就是说,解码端解码码流,在确定当前分量块可以使用第一组合进行预测时,则将预设组合确定为第一组合,并使用该第一组合所包括的第一权重导出模式和K个第一预测模式对当前分量块进行预测。
在一些实施例中,从多个预设组合中,确定出第一组合。例如,多个预设组合包括2个、3个、4个、5个、6个、7个、8个、9个等任意数量个组合。假设包括8个组合,每个组合包括一个权重导出模式和K个预测模式,且这8个组合具有不同的标识(或索引)。这样,解码端可以通过解码码流,得到第一索引,该第一索引用于指示第一组合。接着,在这多个预设组合中查询第一索引对应的组合,并将第一索引对应的组合确定为第一组合。
在一些实施例中,解码端和编码端均确定一个列表,该列表中包括多个候选组合,因此将该列表也称为候选组合列表,从这个候选组合列表中确定第一索引对应的第一组合。此时,上述S101包括如下步骤:
S101-A、解码码流,确定候选组合列表,该候选组合列表包括至少一个候选组合,该至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式;
S101-B、根据候选组合列表,确定第一组合。
其中,上述候选组合列表中包括至少一个候选组合,至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式。
示例性的,候选组合列表如表5所示:
表5
索引 候选组合
0 候选组合1(包括一个权重导出模式和K个预测模式)
1 候选组合2(包括一个权重导出模式和K个预测模式)
…… ……
i-1 候选组合i(包括一个权重导出模式和K个预测模式)
…… ……
如表5所示,候选组合列表包括至少一个候选组合,这至少一个候选组合中任意两个候选组合不完全相同,即任意两个候选组合所包括的权重导出模式和K个预测模式中的至少一个模式不同。例如,候选组合1和候选组合2中的权重导出模式不同,或者候选组合1和候选组合2中的权重导出模式相同,K个预测模式中至少一个预测模式不同, 或者,候选组合1和候选组合2中的权重导出模式不同,且K个预测模式中至少一个预测模式不同。
示例性的,上述表5中以候选组合在候选组合列表中的排序为索引,可选的,还可以以其他方式体现候选组合在候选组合列表中的索引,本申请实施例对此不作限制。
在该实施例中,解码端根据候选组合列表,确定第一组合的方式包括不限于如下几种:
方式1,候选组合列表包括一个候选组合,此时将该候选组合列表所包括的候选组合,确定为第一组合。
方式2,候选组合列表包括多个候选组合,此时,解码码流,得到第一索引,该第一索引用于指示第一组合;将该候选组合列表中第一索引对应的候选组合,确定为第一组合。
在该方式2中,解码端解码码流,得到第一索引,并确定如上述表5所示的候选组合列表,根据第一索引在该候选组合列表中进行查询,得到该第一索引指示的第一组合。
例如,第一索引为索引1,在表5所示的候选组合列表中,索引1对应的候选组合为候选组合2,也就是说,第一索引指示的第一组合为候选组合2。这样,解码端将候选组合1所包括的权重导出模式和K个预测模式确定为第一组合所包括的第一权重导出模式和K个第一预测模式,并使用该第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例中,编码端和解码端可以分别确定相同的候选组合列表,例如编码端和解码端均确定一个包括N个候选组合的列表,每个候选组合包括1个权重导出模式和K个预测模式。若N大于1时,则在码流中,编码端只需要写入最终选择的一个候选组合,例如第一组合,解码端解析编码端最终选择的第一组合,具体是解码端解码码流,得到第一索引,并通过第一索引在解码端所确定的候选组合列表中,确定出第一组合。
本申请实施例对第一索引的具体语法元素形式不做限制。
在一种可能的实现方式中,若当前分量块采用GPM技术进行预测时,则使用gpm_cand_idx表示第一索引。
由于上述第一索引用于指示第一组合,因此,在一些实施例中,该第一索引也可以称为第一组合索引或者第一组合的索引。
在一种示例中,在码流中添加第一索引后的语法如表6所示:
表6
Figure PCTCN2022103734-appb-000003
其中,gpm_cand_idx为第一索引。
本申请实施例为了节省码字,降低编码代价,将当前分量块对应的第一权重导出模式和K个第一预测模式作为一个组合,即第一组合,使用第一索引对该第一组合进行指示,相比于对第一权重导出模式和K个第一预测模式分别进行指示,本申请实施例使用更少的码字,进而降低了编码代价。
下面对上述S101-A中,确定候选组合列表的具体过程进行介绍。
在一些实施例中,上述候选组合列表为预设的。
在一些实施例中,上述候选组合列表为编码端发送给解码端的,例如编码端在对当前分量块进行编码之前,发送给解码端。
在一些实施例中,上述候选组合列表为编码端上传至云端,解码端可以从云端读取该候选组合列表。
在一些实施例中,上述候选组合列表是解码端构建的。
本申请实施例对解码端构建候选组合列表的方式不做限制。例如,利用与当前分量块相关的信息去分析不同的权重导出模式和不同的预测模式所组成的各组合发生的概率大小,根据各组合的发生概率大小来构建候选组合列表。
可选的,与当前分量块相关的信息包括当前分量块的周围块的模式信息,当前分量块对应的第一分量块的重建像素等。
在一些实施例中,解码端通过如下S101-A1的步骤,构建候选组合列表:
S101-A1、解码码流,确定当前分量块对应的第一分量块;
S101-A2、基于第一分量块,构建候选组合列表。
目前在视频编解码中,将一个图像划分成块来处理。例如在VVC中,图像会划分成CTU。VVC允许的CTU的尺寸是128x128。对CTU可以进一步划分成更灵活的CU(coding unit)。VVC支持二叉树、三叉树、四叉树的划分方式。例如,图17A至图17D分别为竖直二叉树、水平二叉树、竖直三叉树、水平三叉树划分的示意图。
图17E为一个CTU划分的示意图,其中粗边框的块使用的是四叉树的划分,细边框的块使用的是二叉树、三叉树的划分。可以看到在划分了之后的某些块可以进一步划分,当然会出于性能和复杂度折中的考虑进行一些限制,本申请实施例对此不做限制。
目前视频编解码中最常支持的是YUV4:2:0格式。Y表示亮度分量,UV分别表示色度分量。YUV4:2:0格式利用了人眼对亮度敏感对色度不敏感的特性,相对于亮度而言降低了色度的采样率,也就是水平和竖直方向都是每2个亮度分量的像素对应1个色度分量U或V的像素,这样能帮助提升压缩效率。由于人眼对亮度敏感对色度不敏感的特性,亮度分量显得更重要一些,所以一般的视频编解码标准会先编码亮度分量,再编码色度分量。
对于块划分来说,在一些实施例中,亮度分量和色度分量采用相同的块划分方式。
但是因为色度的采样率低,而且对色度的质量要求通常没有亮度那么高,因此,在一些实施例中,色度分量的块划分也可以和亮度分量的不同。例如图17F所示,左侧的亮度分量的块划分更精细,而右侧的色度分量的划分更粗糙。
需要说明的是,视频编解码不只支持YUV4:2:0格式,还支持其他格式,如YUV4:4:4、YUV4:2:1、RGB等。
如图17F所示,假设当前分量块为右侧的灰色分量块,与该灰色分量块同一空间的第一分量块为图17F中左侧的灰色区域,而该左侧的灰色区域包括10个第一分量CU。
由上述图17F可知,与当前分量块处于同一空间的第一分量块指,与当前分量块位于相同的空间位置,具有相同的空间大小的第一分量块。以当前分量块为色度块,第一分量块为亮度块为例,由于视频格式的不同,色度块和亮度块的大小可能不同,例如,对于YUV4:4:4格式的视频,色度块的大小和亮度块的大小相同,对于YUV4:2:0格式的视频,亮度块的大小是色度块大小的4倍。
由于色度块的大小与亮度块的大小可能不同,因此,相同空间位置和相同空间大小的色度块和亮度块有可能不是相同坐标。例如,视频格式YUV4:2:0,色度块是由左上角坐标为(x0,y0),宽度为width,高度为height确定的块,则同一空间的亮度块可以是左上角坐标为(x0*2,y0*2),宽度为width*2,高度为height*2确定的块。再例如,视频格式YUV4:4:4,色度块是由左上角坐标为(x0,y0),宽度为width,高度为height确定的块,则同一空间的亮度块可以是左上角坐标为(x0,y0),宽度为width,高度为height确定的块。
另外,在一些实施例中,由于色度块和亮度块采用独立的块划分,因此,色度解码块对应的亮度块,有可能与亮度分量已经划分得到的解码块不相重合,而是在空间位置、空间大小与色度解码块对应的亮度区域。也就是说,本申请实施例中,当前分量块对应的第一分量块可以理解为空间覆盖范围与当前分量块相同的第一分量块。
在解码时,通常先对亮度分量进行解码,再对色度分量进行解码。因此,本申请实施例,在对当前分量块进行解码时,首先解码码流,对当前分量块对应的第一分量块进行解码,得到第一分量块的重建值。进而将第一分量块作为当前分量块的模板,对当前分量块进行解码。
由于当前分量块对应的第一分量块与当前分量块具有相关性,基于此本申请实施例基于第一分量块来构建当前分量块的候选组合列表。
例如,针对每个组合,使用该组合对第一分量块进行预测,得到每个组合下该第一分量块的预测值,根据每个组合下该第一分量块的预测值,构建候选组合列表。例如,使用该组合所包括的权重导出模式导出第一分量块的权重,使用该组合所包括的K个预测模式分别对第一分量块进行预测,得到第一分量块的K个预测值,根据导出的第一分量块的权重,对第一分量块的K个预测值进行加权处理,得到该组合下第一分量块的预测值。最后,根据每个组合下该第一分量块的预测值,构建候选组合列表。
需要说明的是,上述根据权重导出模式导出的权重可以理解为导出第一分量块中每一个像素点对应的权重,也可以理解为导出第一分量块对应的权重矩阵。其中,基于权重确定第一分量块的预测值时,可以是确定第一分量块中每一个像素点对应的K个预测值,并根据每一个像素点对应的K个预测值和权重,确定出每个像素点对应的预测值,第一分量块中每一个像素点对应的预测值构成第一分量块的预测值。可选的,基于权重确定第一分量块的预测值时,还可以是按照块来执行,例如,确定第一分量块的预测值,根据第一分量块的权重矩阵对第一分量块的K个预测值进行加权,得到第一分量块的预测值。
在一些实施例中,S101-A2包括如下S101-A21至S101-A23的步骤:
S101-A21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,R为大于1的正整数;
S101-A22、对于R个第二组合中的任一第二组合,确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价;
S101-A23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,解码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式和K个预测模式。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
由于当前分量块对应的第一分量块为已重建区域,因此,解码端可以得到第一分量块的重建值,这样对于R个第二组合中的每个第二组合,可以根据该第二组合下第一分量块的预测值和第一分量块的重建值,确定出该第二组合对应的预测失真代价。其中,确定第二组合对应的代价的方式包括但不限于SAD、SATD、SEE等。接着,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
本申请实施例中,S101-A22中确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价至少包括两种方式:
第一种方式,根据第二组合所包括的权重导出模式,确定第一分量块的权重;根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块的预测值;根据第二组合对应的第一分量块的预测值和第一分量块的重建值,确定第二组合对应的代价。
第二种方式,根据第二组合中的权重导出模式,确定第二组合中K个预测模式分别对应的第一分量块的预测值;根据第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定第二组合中K个预测模式分别对应的代价;根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。
在该第二种方式中,以K=2为例,可以把第一分量块上的权重简化为只有0和1两种可能,那么对每一个像素位置而言,它的像素值只来自于第一预测模式的预测块或第二预测模式的预测块。所以,可以对一个预测模式,计算出其作为某一权重导出模式的第一预测模式时在第一分量块上的代价,也就是只计算该预测模式在该权重导出模式的情况下作为第一预测模式时权重为1的部分像素在第一分量块上所产生的代价。一个例子是把该代价记为cost[pred_mode_idx][gpm_idx][0],其中pred_mode_idx代表该预测模式的索引,gpm_idx代表该权重导出模式的索引,0代表作为第一预测模式。
以及该预测模式作为某一权重导出模式的第二预测模式时在第一分量块上的代价,也就是只计算该预测模式在该 权重导出模式的情况下作为第二预测模式时权重为1的部分像素在第一分量块上所产生的代价。一个例子是把该代价记为cost[pred_mode_idx][gpm_idx][1],其中pred_mode_idx代表该预测模式的索引,gpm_idx代表该权重导出模式的索引,1代表作为第二预测模式。
那么在计算一个组合的代价时,可以直接把对应的上述2个代价相加。举例如下,要求预测模式pred_mode_idx0和pred_mode_idx1在权重导出模式gpm_idx时的代价,其中pred_mode_idx0作为第一预测模式,pred_mode_idx1作为第二预测模式。将该代价记为costTemp,则costTemp=cost[pred_mode_idx0][gpm_idx][0]+cost[pred_mode_idx1][gpm_idx][1]。如果是要求预测模式pred_mode_idx0和pred_mode_idx1在权重导出模式gpm_idx时的代价,其中pred_mode_idx1作为第一预测模式,pred_mode_idx0作为第二预测模式。将该代价记为costTemp,则costTemp=cost[pred_mode_idx1][gpm_idx][0]+cost[pred_mode_idx0][gpm_idx][1]。
这样做的一个好处是将先加权组合成一个预测块再计算代价,简化为直接计算2个部分的代价,再将代价相加得到组合的代价。由于一个预测模式可能与多个其他预测模式组合,而对于同一权重导出模式来说,该预测模式作为第一预测模式和第二预测模式的部分的代价是固定的,所以可以保留这些代价,即上述例子中的cost[pred_mode_idx][gpm_idx][0]和cost[pred_mode_idx][gpm_idx][1],重复利用,从而减少计算量。
根据上述方法,可以确定出R个第二组合中各第二组合对应的代价,接着执行S101-A23。
其中,S101-A23中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式包括但不限于如下几种示例:
示例1,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序;将排序后的R个第二组合,确定为候选组合列表。
在该示例1中生成的候选组合列表包括R个候选组合。
可选的,该候选组合列表中R个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中R个候选组合对应的代价按照排序依次增大。
其中,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序可以是,按照代价从小到大顺序,对R个第二组合进行排序。
示例2,根据第二组合对应的代价,从R个第二组合中选出N个第二组合,将这N个第二组合组成的列表,确定为候选组合列表。
可选的,上述N个第二组合为R个第二组合中代价最小的前N个第二组合,例如根据R个第二组合中每个第二组合对应的代价,从R个第二组合中选出代价最小的N个第二组合,构成候选组合列表,此时,候选组合列表包括N个候选组合。
可选的,该候选组合列表中N个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中N个候选组合对应的代价按照排序依次增大。
下面对上述S101-A21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。这样使用预设的R个第二组合中的每个第二组合对第一分量块进行预测,得到每个第二组合对应的第一分量块的预测值,再根据每个第二组合对应的第一分量块的预测值和第一分量块的重建值,确定每个第二组合对应的代价,根据每个第二组合对应的代价,对R个第二组合进行排序,将排序后的R个第二组合作为候选组合列表,或者从排序后的R个第二组合中选出代价最小的N个第二组合构成候选组合列表。
在一些实施例中,S101-A21包括如下步骤:
S101-A21-1、确定P个权重导出模式和Q个预测模式,P为正整数,Q为大于或等于K的正整数;
S101-A21-2、根据P个权重导出模式和Q个预测模式,构建R个第二组合,R个第二组合中的任一第二组合包括P个权重导出模式中的一权重导出模式和Q个预测模式中的K个预测模式,P均为正整数,Q为大于或等于K的正整数。
在该实施例中,解码端首先确定P个权重导出模式和Q个预测模式,接着,根据确定的P个权重导出模式和Q个预测模式,构建R个第二组合。
举例说明,第二组合包括一个权重导出模式和2个预测模式为例,假设P个权重导出模式为权重导出模式1和权重导出模式2,Q个预测模式为预测模式1、预测模式2和预测模式3,这2个权重导出模式和3个预测模式可以组合成2X3X2共12个第二组合。
本申请实施例对上述P个权重导出模式和Q个预测模式的具体个数不做限制。
在一种可能的实现方式中,假设当前分量块为帧内编码块,这里假设GPM的可能的权重导出模式有64种,GPM可能的帧内预测模式有67种,这些可以从VVC的标准中找到。但是并不是限制GPM的可能的权重只有64种,或者是哪64种,需要说明的是,之所以VVC的GPM选择64种也是一个预测效果提升和在码流中的开销提升的一种权衡方案。而本申请不再使用一种固定的逻辑去编码权重导出模式,所以理论上本申请可以使用更多样的权重,以及更灵活地使用它们。同样,并不是限制GPM的帧内预测模式只有67种,或者是哪67种。理论上所有可能的帧内预测模式都可以用在GPM中。比如说帧内角度预测模式做得更加细致,产生更多的帧内角度预测模式,那么GPM也可以使用更多的帧内角度预测模式。比如说VVC的MIP(matrix-based intra prediction)模式,本申请也可以使用,但是考虑到MIP还有多种子模式可以选择,这里为了便于理解就不把MIP加入到本实施例中。另外还有一些宽角度模式,本申请也可以使用,本实施例不再加以描述。
假设K=2,上述K个预测模式包括第一个预测模式和第二个预测模式,假设所有可用的预测模式有67种(即Q=67),第一个预测模式有67种可能,由于第二个预测模式与第一个预测模式不相同,因此第二个预测模式有66种,假设权重导出模式有64种(即P=64),那么本申请可能使用任意两种不同的预测模式以及任意一种权重导出模式组成一个第二组合,总共有64*67*66种可能的第二组合。
在该实现方式中,P个权重导出模式为所有可能的权重导出模式,例如GPM中的64个权重导出模式和Q个预测模式为所有可能的预测模式,例如GPM的67个帧内预测模式,使用一种穷举的办法,得到所有可能的第二组合,例如得到64*67*66种可能的第二组合,使用这64*67*66种可能的第二组合中的每个第二组合对第一分量块进行预测,计算每一个第二组合的失真代价,进而根据每个第二组合的失真代价,得到当前分量块对应的候选组合列表。
在一些实施例中,为了降低数据量,提升候选组合列表的构建速度,则不对每一种预测模式都进行尝试,可以选择其中部分预测模式进行尝试。
此时,上述S101-A21-1中确定Q个预测模式的实现方式包括但不限于如下几种方式:
方式一,Q个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定Q个预测模式。
其中,候选预测模式列表包括多个候选预测模式,K个预测模式中任一预测模式对应的备选预测模式列表包括至少一个备选预测模式。
例如,根据当前分量块的候选预测模式列表,确定Q个预测模式。
再例如,根据K个第一预测模式分别对应的备选预测模式列表,确定Q个预测模式。
再例如,根据权重导出模式对应的预测模式,确定Q个预测模式。
再例如,根据预设模式,确定Q个预测模式。
再例如,根据当前分量块的候选预测模式列表和K个第一预测模式分别对应的备选预测模式列表,确定Q个预测模式。
再例如,根据当前分量块的候选预测模式列表和权重导出模式对应的预测模式,确定Q个预测模式。
再例如,根据K个第一预测模式分别对应的备选预测模式列表、以及权重导出模式对应的预测模式,确定Q个预测模式。
再例如,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、以及权重导出模式对应的预测模式,确定Q个预测模式。
再例如,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式,确定Q个预测模式。
其中,确定K个第一预测模式分别对应的备选预测模式列表可以理解为,为K个第一预测模式中每个第一预测模式确定一个备选预测模式列表,在后续构建第二组合时,第二组合中的某一个预测模式从该预测模式对应的备选预测模式列表中选出。例如K=2,K个第一预测模式包括第一个预测模式和第二个预测模式,解码端为第一个预测模式构建一个备选预测模式列表1,为第二个预测模式构建一个备选预测模式列表2。这样在后期构建不同的第二组合时,从备选预测模式列表1中选出一个备选预测模式作为第一个预测模式,从备选预测模式列表2中选出一个备选预测模式作为第二个预测模式,这样一个权重导出模式,以及当前选出的第一个预测模式和第二个预测模式组成一个第二组合。
本申请实施例对确定K个第一预测模式中每个预测模式对应的备选预测模式列表的方式不做限制。
在一种可能的实现方式中,针对K个第一预测模式中的任一预测模式,确定该预测模式对应的候选预测模式列表,以及权重导出模式对应的预测模式中的至少一个;根据该候选预测模式列表和权重导出模式对应的预测模式中的至少一个,确定该预测模式对应的备选预测模式列表。
本申请实施例中,确定K个第一预测模式中某一个预测模式对应的候选预测模式列表,与确定当前分量块对应的候选预测模式列表的过程基本相似,具体可以参照下面描述。
在一些实施例中,上述候选预测模式列表中包括一个或多个帧间预测模式,例如包括skip、merge、普通帧间预测模式、单向预测、双向预测、多假设预测等中的至少一个。
在一些实施例中,上述候选预测模式列表中包括一个或多个帧内预测模式,例如包括直流(Direct Current,DC)模式、平面(PLANAR)模式、角度模式等中的至少一个。可选的,上述候选预测模式列表包括MPM列表中的至少一个帧内预测模式。
在一些实施例中,上述候选预测模式列表还可以包括IBC、palette等模式。
本申请对上述候选预测模式列表所包括的预测模式的类型以及预测模式的个数不做限制。
在一些实施例中,候选预测模式列表通过如下至少一种方式确定:
方式1,上述上述候选预测模式列表包括预设模式。
方式2,上述上述候选预测模式列表包括MPM列表中的模式。
在一些实施例中,第一候选帧内预测模式列表可以是当前分量块的MPM列表,比如在VVC中,当前分量块可以得到一个长度为6的MPM列表。另外在一些后续的技术演进中,有一种secondary MPM的方案,可能导出长度为22的MPM列表,也可以说第一MPM列表和第二MPM列表的长度加起来是22。也就是说,本申请实施例可以使用MPM来对帧内预测模式进行一个筛选。
在一些实施例中,若上述确定的第一候选预测模式列表中不包括预设模式时,则将预设模式添加至候选预测模式列表中。
在一种示例中,上述预设模式为预设的几个预测模式。可选的,上述预设模式包括DC、水平模式、竖直模式中的至少一个。
在另一种示例中,通过确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定预设模式。
现在常用的图像类型有I图像,B图像,P图像,常用的片类型有I slice,B slice,P slice。以片类型为例,对图 像类型同样适用。I slice只能有帧内编码的块,而B slice和P slice既可以有帧内编码的块,也可以有帧间编码的块。也就是说I slice中的当前分量块周边都是帧内编码的块,而B slice,P slice中,当前分量块周边可能是帧内编码的块也可能是帧间编码的块。所以对本申请中的一些帧内的GPM方法来说,其在I slice中能获得更多的相关信息,比如相邻块的帧内预测模式。而B slice,P slice中获得的相关信息相对少一些。因而可以对不同的图像类型设置不同的规则。
例如,在构建候选预测模式列表时,若当前分量块对应的图像类型为B类型或P类型时,加入更多的预设模式,比如在DC,水平模式和竖直模式的基础上再加入一些其它的角度模式,如右上方向(VVC中的模式2),左下方向(VVC中的模式66),左上方向(VVC中的模式34)等。或者对不同的图像类型的块使用不同的候选预测模式列表个数限制等。
上述确定当前分量块对应的图像类型的方式可以是根据当前分量块所属的当前图像的图像类型或当前分量块所属的当前片的图像类型,确定当前分量块对应的图像类型。例如,将当前分量块所属的当前图像的图像类型或当前分量块所属的当前片的图像类型,确定为当前分量块对应的图像类型。
可选的,可以在某些条件下添加预设模式,一个例子是在候选预测模式中的预测模式个数小于、或小于等于一个阈值时添加,这个阈值可以是3,4,5,6等。
方式3,上述候选预测模式列表包括根据一些规则,如等间距筛选等,确定出的候选预测模式的集合。
方式4,根据与当前分量块相邻的至少一个块所使用的预测模式,确定候选预测模式列表。
例如,将与当前分量块相邻的一个或多个块所使用的预测模式加入候选预测模式列表中,得到当前分量块的候选预测模式列表,或者得到K个预测模式中第k个预测模式对应的候选预测模式列表,其中第k个预测模式为K个预测模式中的任一预测模式。
再例如,将与当前分量块相邻的一个或多个块所使用的预测模式中第k个预测模式对应的预测模式,添加到该第k个预测模式对应的候选预测模式列表中。举例说明,假设K=2,第k个预测模式为第一个预测模式,与当前分量块相邻的2个块假设也使用2个预测模式进行加权预测,其中第一个相邻块所使用的2个预测模式分别为预测模式1和预测模式3,第二个相邻块所使用的2个预测模式分别为预测模式4和预测模式5,这样,可以将预测模式1和预测模式4添加至第一个预测模式对应的候选预测模式列表中。
方式5,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至少一个,添加至第一候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至候选预测模式列表中。
方式6,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已解码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
在一些实施例中,方式6中,当前分量块周边已解码的第一分量块、第二分量块和第三分量块中至少一个分量块包括当前分量块的上方和/或左侧已解码区域对应的第一分量块、第二分量块和第三分量块中至少一个分量块。例如,图18所示,选择0到5的块使用的预测模式,作为第二预测模式,和/或选择块2到块3之间省略号代表的至少一个块所使用的预测模式,作为第二预测模式,和/或选择块1到块5之间省略号代表的至少一个块所使用的预测模式,作为第二预测模式。在一种示例中,该实施例中的第一分量块可以为亮度CU,第二分量块和/或第三分量块可以为色度CU,此时将当前分量块周边已解码的亮度CU和/或色度CU所使用的预测模式,确定为第二预测模式。
在一些实施例中,上述方式6中,当前分量块的内部预设区域可以为当前分量块内部的任意区域。当前分量块的内部区域对应的第一分量块可以理解为,与当前分量块的内部区域为同一个空间的第一分量块。可选的,该第一分量块可以为亮度CU。例如,根据当前分量块的内部区域的左上角顶点的坐标,映射得到该坐标对应的亮度CU,进而将该亮度CU所使用预测模式,确定为第四预测模式。
在一些实施例中,上述方式6中,确定当前分量块对应的第一分量块相关的第五预测模式的方式至少包括如下几种示例:
示例1,由于当前分量块对应的第一分量块已解码,因此,将该第一分量块所使用的预测模式,确定为第五预测模式。在一种示例中,该第一分量块可能包括多个第一分量CU,这多个第一分量CU所使用的预测模式可能相同,也可能不同,本申请实施例中,可以将该第一分量块所包括的多个第一分量CU中至少一个第一分量CU所使用的预测模式,确定为第五预测模式。
示例2,根据当前分量块对应的第一分量块的纹理,确定第五预测模式。示例性的,确定该第一分量块的纹理方向;根据纹理方向,确定第五预测模式。
本申请实施例对确定当前分量块对应的第一分量块的纹理方向的具体方式不做限制。
在一种可能的实现方式中,确定当前分量块对应的第一分量块中某些点的纹理方向,根据这些点的纹理方向,确定该第一分量块的纹理方向。在一些实施例中,为了便于描述,将该第一分量块中需要确定纹理方向的点,记为纹理点。这些纹理点可以为默认的,例如编码端和解码端默认将该第一分量块中的一些点作为纹理点,计算其纹理方向。在一些实施例中,上述纹理点是根据预设方式选择的,例如解码端根据预设的纹理点选择方式,选出该第一分量块中的多个纹理点。
针对这多个纹理点中的每一个纹理点,确定该每个纹理点的梯度,例如确定每个纹理点的水平梯度和竖直梯度,进而根据每个纹理点的水平梯度和竖直梯度,确定出每个纹理点的纹理方向。
接着,根据每个纹理点的纹理方向,确定该第一分量块的纹理方向。
示例性的,将多个纹理点分别对应的纹理方向中的一个或多个,确定为该第一分量块的纹理方向。
例如,将多个纹理点分别对应的纹理方向中的任意一个或多个,确定为该第一分量块的纹理方向。
再例如,将多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为该第一分量块的纹理方向。
根据上述确定出当前分量块对应的第一分量块的纹理方向后,根据纹理方向,确定第五预测模式。
在一种示例中,将预测方向与纹理方向平行的预测模式,确定为第五预测模式。
在一种示例中,将预测方向与纹理方向垂直的预测模式,确定为第五预测模式。
在一种示例中,将预测方向与纹理方向平行的预测模式,以及预测方向与纹理方向垂直的预测模式,确定为第五预测模式。
需要说明的是,上述预测方向与纹理方向平行的预测模式,包括预测方向与纹理方向平行和/或近似平行的预测模式。预测方向与纹理方向垂直的预测模式,包括预测方向与纹理方向垂直和/或近似垂直的预测模式。
需要说明的是,上述方式1至方式6可以作为确定候选预测模式列表的方式单独使用,也可以进行任意组合使用。
在一些实施例中,上述候选预测模式列表包括候选帧内预测模式列表、候选帧间预测模式列表中的至少一个。其中,候选帧内预测模式列表包括至少一个候选帧内预测模式,候选帧间预测模式列表包括至少一个候选帧间预测模式。
根据上述方式,得到当前分量块的候选预测模式列表后,根据该候选预测模式列表,确定Q个预测模式,例如将候选预测模式列表所包括的全部或部分候选预测模式,确定为Q个预测模式的全部或部分。
下面对确定权重导出模式对应的预测模式的过程进行介绍。
本申请实施例中,权重导出模式对应的预测模式为一个泛指,例如可以是预设的一个权重导出模式对应的预测模式,或者是预设的几个权重导出模式对应的预测模式。在一些实施例中,权重导出模式对应的预测模式也可以理解为权重导出模式对应的预测模式列表,该预测模式列表中包括至少一个预测模式。
在一些实施例中,上述权重导出模式对应的预测模式包括P个权重导出模式中至少一个权重导出模式对应的预测模式。此时,确定权重导出模式对应的预测模式包括:针对P个权重导出模式中的第p个权重导出模式,确定第p个权重导出模式对应的预测模式,根据P个权重导出模式中至少一个权重导出模式对应的预测模式,确定上述的权重导出模式对应的预测模式,其中p为正整数。
本申请实施例中,确定P个权重导出模式中每个一个权重导出模式对应的预测模式的过程基本相同,为了便于描述,下面以P个权重导出模式中的第p个权重导出模式为例进行说明。
其中,确定第p个权重导出模式对应的预测模式包括如下两种方式:
方式1,若第p个权重导出模式对应的预测模式中的至少一个为帧内预测模式时,根据第p个权重导出模式确定角度索引;将角度索引对应的帧内预测模式,确定为第p个权重导出模式对应的预测模式中的至少一个。
其中角度索引用于指示权重的分界线角度索引。
在一些实施例中,用字段angleIdx表示角度索引。
上述表2示出了merge_gpm_partition_idx与angleIdx的对应关系,参照上述表2,可以根据该第p个权重导出模式导出角度索引。
本申请中,角度索引与帧内预测模式具有对应关系,即不同的角度索引与不同帧内预测模式对应。
示例性的,角度索引与帧内预测模式具有对应关系如表7所示:
表7
angleIdx 帧内预测模式
0 50
2 42
3 38
4 34
5 30
该方式一中,以K=2为例,若第一个预测模式或第二个预测模式为帧内预测模式时,则根据第p个权重导出模式确定角度索引,例如根据上述表2,导出第p个权重导出模式对应的角度索引。接着,在上述表7中,确定出该角度索引对应的帧内预测模式,例如,角度索引为2,其对应的帧内预测模式为42,进而将帧内预测模式42确定为第一个预测模式或第二个预测模式。
方式2,若第p个权重导出模式对应的预测模式中的至少一个为帧内预测模式时,确定第p个权重导出模式对应的帧内预测模式;将第p个权重导出模式对应的帧内预测模式中的至少一个,确定为第p个权重导出模式对应的预测模式中的至少一个。
其中,第p个权重导出模式对应的帧内预测模式包括预测方向与权重的分界线平行的帧内预测模式、预测方向与分界线垂直的帧内预测模式和planar模式中的至少一个。
需要说明的是,预测方向与权重的分界线平行的帧内预测模式包括预测方向与权重的分界线平行或近似平行的一个或几个帧内预测模式。预测方向与权重的分界线垂直的帧内预测模式包括预测方向与权重的分界线垂直或近似垂直的一个或几个帧内预测模式。
该方式二中,以K=2为例,若第一个预测模式和/或第二个预测模式为帧内预测模式时,第一个预测模式和/或第二个预测模式是从权重导出模式对应的帧内预测模式中确定出。例如,第一个预测模式和/或第二个预测模式可以是跟权重划分线(也称为分界线)同一条直线的或近似同一条直线的帧内预测模式。或者,第一个预测模式和/或第二个预测模式可以是预测方向与权重分界线垂直的或近似垂直的帧内预测模式。例如,权重的分界线是水平方向的,如图4中GPM的索引为18,19,50,51的模式,第一个预测模式和/或第二个预测模式为水平方向的模式18或者垂直方向的模式50。
解码端根据上述步骤,确定出P个权重导出模式中至少一个权重导出模式对应的预测模式,进而根据P个权重导出模式中至少一个权重导出模式对应的预测模式,确定权重导出模式对应的预测模式。例如,将P个权重导出模式中至少一个权重导出模式对应的预测模式的全部或部分,作为权重导出模式对应的预测模式。
进一步的,P个权重导出模式对应的预测模式中可能存在重复的预测模式,则将重复的预测模式进行剔除,将剩余的不同的预测模式确定为权重导出模式对应的预测模式。
本申请实施例,为了降低R个第二组合的数量,对预测模式进行筛选,具体是根据上述方法,确定出Q个预测模式。
在一些实施例中,为了降低解码端的复杂度,对上述Q个预测模式的个数进行限定,例如,Q小于或等于第一预设阈值,本申请对第一预设阈值的具体取值不做限制,可以根据实际需要进行确定,例如第一预设阈值为6,即选定6个预测模式来构建R个第二组合,以控制第二组合的个数。
在一些实施例中,Q的大小与当前分量块的大小和/或形状相关,其中当前分量块的形状可以理解为由当前分量块的长宽比决定。
在预测时,对于较小的块,相似的预测模式对预测结果的影响差别不大,对于较大的块,相似的预测模式对预测结果的影响差别会更加明显。基于此,本申请实施例对不同大小的块设定不同的Q值,即对较大块设置较大的Q值,对较小的块设置较小的Q值。
此时,在确定当前分量块对应的Q值时,根据当前分量块的大小设定,例如,若当前分量块的大小大于第一数值时,则Q大于或等于第二预设阈值。再例如,若当前分量块的大小小于或等于第一数值时,则Q小于第三预设阈值。本申请实施例对第一数值、第二预测阈值和第三预设阈值的具体大小不做限制,其中第三预设阈值小于第二预设阈值。
下面对S101-A21-1中确定P个权重导出模式的过程进行介绍。
本申请实施例中,确定P个权重导出模式的方式至少包括如下几种方式:
方式一,从预设的M个权重导出模式中,选出P个权重导出模式,其中M为大于或等于P的正整数。
本申请实施例对上述预设的M个权重导出模式不做限制。
在一些实施例中,GPM包括64种权重导出模式,AWP包括56种权重导出模式。在该实施例中,上述预设的M个权重导出模式包括GPM所包括64种权重导出模式中的至少一个权重导出模式,或者包括AWP所包括56种权重导出模式中的至少一个权重导出模式。
在一些实施例中,本申请实施例的M权重导出模式可以支持更多的angleIdx,或者与VVC不一样的angleIdx。再例如,本申请实施例的M权重导出模式可以支持更多的distanceIdx,或者与VVC不一样的distanceIdx。
在一些实施例中,上述预设的M个权重导出模式可以是通过预设的权重导出模式进行推导而得。
例如,本申请实施例使用AWP对应的权重导出模式,确定M个权重导出模式。可选的,本申请实施例,还可以使用其他的方式,推导出M个权重导出模式。
在一些实施例中,若M等于P,则将M个权重导出模式,确定为P个权重导出模式。
在一些实施例中,若M大于P,则为了进一步降低R个第二组合的数量,则对预设的M个权重导出模式进行筛选,则可以从预设的M个权重导出模式中选择P个权重导出模式,用于构建R个第二组合。
在一些实施例中,从M个权重导出模式中剔除预设划分角度和/或预设偏移量对应的权重导出模式,得到P个权重导出模式。由于权重导出模式中同一划分角度可以对应多个偏移量,如图19A所示权重导出模式10、11、12和13,它们的划分角度相同,但是偏移量不同,这样可以去掉一些预设偏移量对应的权重导出模式,和/或也可以去掉一些预设划分角度对应的权重导出模式。这样做可以减少总的可能的第二组合数量。而且使各个可能的第二组合之间差别更明显。
在一些实施例中,不同的块对应的筛选条件可以不同,这样在确定当前分量块对应的P个权重导出模式时,首先确定当前分量块对应的筛选条件,并根据当前分量块对应的筛选条件,从M个权重导出模式中,选出P个权重导出模式。
在一些实施例中,当前分量块对应的筛选条件包括当前分量块的大小对应的筛选条件和/或当前分量块的形状对应的筛选条件。在预测时,对于更小的块,相似的权重导出模式对预测结果的影响差别不大,而对于较大的块,相似的权重导出模式对预测结果的影响差别会更加明显。基于此,本申请实施例对不同大小的块设定不同的P值,即对较大块设置较大的P值,对较小的块设置较小的P值。
在一些实施例中,上述筛选条件包括数组,该数组包括M个元素,M个元素与M个权重导出模式一一对应,每个权重导出模式对应的元素用于指示该权重导出模式是否可用,其中权重导出模式是否可用可以理解为该权重导出模式是否用于组成P个权重导出模式中的一个权重导出模式进行后续的第二组合的尝试。
上述数组可以是一位数值,也可以是二位数值。
示例性的,以GPM为例,M个权重导出模式是64个,设置一个含有64个元素的数组,每一个元素的值表示其对应的权重导出模式是否可用。以一位数值为例,一个具体的例子如下,设置一个g_sgpm_splitDir的数组:
g_sgpm_splitDir[64]={
1,1,1,0,1,0,1,0,
1,0,1,0,1,0,1,0,
1,0,1,1,1,0,1,0,
1,0,1,0,1,0,1,0,
0,0,0,0,1,1,0,1,
0,0,1,0,0,1,0,0,
1,0,1,1,0,1,0,0,
1,0,0,1,0,0,1,0
};
其中,g_sgpm_splitDir[x]的值为1表示索引为x的权重导出模式可用,为0表示索引为x的权重导出模式不可用。
在一些实施例中,若当前分量块对应的筛选条件包括当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件时,且对于同一个权重导出模式,若当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件表示该权重导出模式均可用时,则将该权重导出模式确定为P个权重导出模式中的一个,若当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件中的至少一个表示该权重导出模式不可用,则确定该权重导出模式不构成P个权重导出模式。
在一些实施例中,对于不同块大小对应的筛选条件和不同块形状对应的筛选条件,可以使用多个数组分别进行实现。
在一些实施例中,对于不同块大小对应的筛选条件,和不同块形状对应的筛选条件可以使用二位数组来实现,也就是说,在一个二位数组中即包括块大小对应的筛选条件,也包括块形状对应的筛选条件。
示例性的,对于大小为A,形状为B的块对应的筛选条件如下所示,该筛选条件通过一个二位数组表示:
g_sgpm_splitDir[64]={
(1,1),(1,1),(1,1),(1,0),(1,0),(0,0),(1,0),(1,1),
(1,1),(0,0),(1,1),(1,0),(1,0),(0,0),(1,0),(1,1),
(0,1),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0),(0,0),
(1,1),(0,0),(0,1),(1,0),(1,0),(1,0),(1,0),(0,0),
(0,0),(0,0),(1,1),(0,0),(1,1),(1,1),(1,0),(0,1),
(0,0),(0,0),(1,1),(0,0),(1,0),(0,0),(1,0),(0,0),
(1,0),(0,0),(1,1),(1,0),(1,0),(1,0),(0,0),(0,0),
(1,1),(0,0),(1,1),(0,0),(0,0),(1,0),(1,1),(0,0)
};
其中,g_sgpm_splitDir[x]的值均为1表示索引为x的权重导出模式可用,g_sgpm_splitDir[x]的值中有一个为0表示索引为x的权重导出模式不可用。例如g_sgpm_splitDir[4]=(1,0),表示权重导出模式4对于块大小为A可用户,但对于形状为B的块不可用,因此,若块的大小为A且形状为B时,则权重导出模式不可用。
需要说明的是,上述以GPM包括64个权重导出模式为例,但是本申请实施例的权重导出模式包括但不限于GPM所包括的64个权重导出模式,以及AMP所包括的56个权重导出模式。
解码端根据上述步骤,确定出Q个预测模式和P个权重导出模式后,根据这Q个预测模式和P个权重导出模式,组成R个不同的第二组合。接着,根据R个第二组合,确定出候选组合列表,进而从这候选组合列表中,确定出第一权重导出模式和K个第一预测模式。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则解码端对上述确定的Q个预测模式和P个权重导出模式再次进行筛选,此时,上述S101-A21-2中根据确定出的P个权重导出模式和Q个预测模式,组成R个第二组合包括如下S101-A21-21至S101-A21-23的步骤:
S101-A11-21、从P个权重导出模式中选出S个权重导出模式,其中S为小于或等于P的正整数。
具体的,从上述确定的P个权重导出模式剔除掉发生概率较低的权重导出模式,得到筛选后的S个权重导出模式。
其中,上述S101-A11-21中从P个权重导出模式中选出S个权重导出模式的方式包括但不限于如下几种:
方式1,针对P个权重导出模式中的第i个权重导出模式,根据第i个权重导出模式,确定K个第二预测模式在第一分量块上的权重,K个第二预测模式为Q个预测模式中的任意K个预测模式,i为从1到P的正整数;若K个预测模式中的任一预测模式在第一分量块上的权重小于第一预设值时,则从P个权重导出模式中剔除第i个权重导出模式,得到S个权重导出模式。
在该方式1中,如果一种权重导出模式导出的第一分量块的权重,使得某一个预测模式在第一分量块上的影响很小,或者在第一分量块上没有影响,那么就不使用这个权重导出模式。例如,图4(正方形的块)中的权重导出模式52,该权重导出模式,使得第二个预测模式在第一分量块上的权重较小,再例如权重导出模式54,使得第二个预测模式在第一分量块上的权重为0,即可以认为在权重导出模式54下,第二个预测模式在第一分量块上没有影响,第一分量块的预测值全部由第一个预测模式确定。这种情况下第二个预测模式是什么都没有影响,对于这样的权重导出模式则需要从P个权重导出模式中剔除。
需要说明的是,不同形状的块的同一个权重导出模式可能使得两个预测模式的影响也不相同。由于当前分量块可能是正方形,也可能是长方形,可能长度比宽度大也可能宽度比长度大,而且比例也有1:2,1:4等可能。图19A和图19B示出了GPM在32x64块和64x32块的权重导出模式,可以看到不同形状下同一个权重导出模式的分界线与块边界的交点并不一样。因为块形状变了但是分界线的角度并不根据块形状变化而变化。如图19A所示,索引为52的权重导出模式,在32x64的块中,将索引为52的权重导出模式的分界面向当前分量块对应的第一分量块区域延伸时,与第一分量块区域相交,使得第二个预测模式在第一分量块中的权重不小于预设值,即说明第二个预测模式在第一分量块中有影响。但是,如图19B所示,同样索引为52的权重导出模式,在64x32的块中,将索引为52的权重导出模式的分界面向当前分量块对应的第一分量块区域延伸时,与第一分量块区域不相交,使得第二个预测模式在第一分量块中的权重为0,即说明第二个预测模式在第一分量块中没有有影响。
在上述方式1中,将P个权重导出模式中,使得K个预测模式中的任意一个预测模式在第一分量块上的权重小于第一预设值的权重导出模式剔除,得到S个权重导出模式。
本申请实施例对上述第一预设值的具体取值不做限制,例如为大于或等于0的较小值。
方式2,针对P个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式对第一分量块进行预测时的代价,i为从1到P的正整数;根据第i个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模 式。
在该方式2中,通过计算P个权重导出模式中每个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模式。
本申请实施例中,将权重导出模式和K个预测模式作为一个组合,进行代价的计算,这样,为了计算方便,在给定K个预测模式的基础上,对P个权重导出模式的代价进行计算,即将P个权重导出模式分别与设定的K个预测模式进行组合,得到P个组合,计算这P个组合中每个组合对应的代价,进而得到P个权重导出模式的代价。
举例说明,假设给定的K个预测模式为预测模式1和预测模式2,对于P个权重导出模式中的第i个权重导出模式,第i个权重导出模式与预测模式1和预测模式2组成一个组合,记为组合i。使用组合i对当前分量块对应的第一分量块进行预测,得到该组合i下第一分量块的预测值,根据组合i下第一分量块的预测值与第一分量块的重建值,确定该组合i对应的预测失真代价,将该组合i对应的预测失真代价,确定为第i个权重导出模式对应的代价。这样可以确定出P个权重导出模式中任意一个权重导出模式对应的代价。
根据上述方法,确定出P个权重导出模式中第i个权重导出模式对应的代价后,根据第i个权重导出模式对应的代价从P个权重导出模式中选出S个权重导出模式。
在该方式2中,解码端根据第i个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模式包括如下方式:
第1种方式,若第i个权重导出模式对应的代价小于第二预设值,则从P个权重导出模式中选出与第i个权重导出模式相似的权重导出模式;根据第i个权重导出模式,以及第i个权重导出模式的相似权重导出模式,确定S个权重导出模式。其中,第i个权重导出模式的相似权重导出模式可以理解为预测结果与第i个权重导出模式的预测结果相似的权重导出模式,例如第i个权重导出模式的相似权重导出模式包括划分角度与该第i个权重导出模式的划分角度相近的权重导出模式,和/或偏移量与该第i个权重导出模式的偏移量相近的权重导出模式,其中权重导出模式的偏移量也可以理解为该权重导出模式的分界线在当前分量块的边上的截距。
示例性的,上述划分角度相近可以包括划分角度相同且偏移量不同,例如图4中权重导出模式11和权重导出模式13,还可以包括划分角度相同且偏移量相似,例如图4中权重导出模式11和权重导出模式12,还可以包括划分角度相似且偏移量不同,例如图4中权重导出模式9和权重导出模式11,还可以包括划分角度相似且偏移量相似等,例如图4中权重导出模式9和权重导出模式12。
示例性的,上述偏移量相近可以包括偏移量相近且划分角度相同,例如图4中权重导出模式29和权重导出模式30,还包括偏移量相同或相近且划分角度相似等,例如图4中权重导出模式2和权重导出模式38。
在一些实施例中,第i个权重导出模式的相似权重导出模式可以理解为索引与该第i个权重导出模式的索引相近的权重导出模式。
在该第1种方式中,若第i个权重导出模式对应的代价小于第二预设值,则说明使用该第i个权重导出模式对当前分量块进行预测时,可能会达到较优的预测效果,此时,将该第i个权重导出模式从P个权重导出模式中选出,用于构造后续的R个第二组合。另外,由于与第i个权重导出模式相似的权重导出模式,具有与该第i个权重导出模式相似的特性,因此,从P个权重导出模式中选出第i个权重导出模式的相似权重导出模式,用于构造后续的R个第二组合。接着,从P个权重导出模式所剩余的权重导出模式中,选择一个权重导出模式作为新的第i个权重导出模式,重复上述步骤,进而得到S个权重导出模式。
本申请实施例对上述第二预设值的大小不做限制,具体根据实际需要进行确定。
在一些实施例中,解码端还可以根据下面的第2种方式,从P个权重导出模式中选出S个权重导出模式。
第2种方式,若第i个权重导出模式对应的代价大于第三预设值,则从P个权重导出模式中剔除掉第i个权重导出模式,以及第i个权重导出模式的相似权重导出模式,得到剔除后的至少一个权重导出模式;根据剔除后的至少一个权重导出模式,确定S个权重导出模式。
在该第2种方式中,若第i个权重导出模式对应的代价小于第三预设值,则说明使用该第i个权重导出模式对当前分量块进行预测时,可能无法达到较优的预测效果,此时,将该第i个权重导出模式从P个权重导出模式中剔除掉。另外,由于与第i个权重导出模式相似的权重导出模式,具有与该第i个权重导出模式相似的特性,因此,将第i个权重导出模式的相似权重导出模式也从P个权重导出模式中剔除掉,得到剔除后的权重导出模式集合。接着,在剔除后的权重导出模式集合中,选择一个权重导出模式作为新的第i个权重导出模式,重复上述步骤,将最终得到权重导出模式集合所包括的权重导出模式,确定为S个权重导出模式。
本申请实施例对上述第三预设值的大小不做限制,具体根据实际需要进行确定,第三预设值大于上述第二预设值。
根据上述步骤,解码端从P个权重导出模式中筛选出S个权重导出模式后,执行如下S101-A21-22的步骤。
S101-A21-22、从Q个预测模式中选出T个预测模式,T为小于或等于Q的正整数。
本申请实施例对从Q个预测模式中选出T个预测模式的方式不做限制。
在一些实施例中,从Q个预测模式中选出预设的T个预测模式。
在一些实施例中,针对Q个预测模式中的第i个预测模式,解码端确定使用第i个预测模式对第一分量块进行预测时的代价,i为从1到Q的正整数;根据第i个预测模式对应的代价,从Q个预测模式中选出T个预测模式。
本申请实施例中,将权重导出模式和K个预测模式作为一个组合,进行代价的计算,这样,为了计算方便,在给定权重导出模式和其他K-1个预测模式的基础上,对Q个权重导出模式的代价进行计算,即将Q个预测模式分别与设定的权重导出模式和K-1个预测模式进行组合,得到Q个组合,计算这Q个组合中每个组合对应的代价,进而得到Q个预测模式的代价。
举例说明,假设给定的K-1个预测模式为预测模式1,给定的权重导出模式为权重导出模式1,对于Q个预测模式中的第i个预测模式,权重导出模式1与第i个预测模式和预测模式1组成一个组合,记为组合i。使用组合i对当第一分量块进行预测,得到该组合i下第一分量块的预测值,根据组合i下第一分量块的预测值与第一分量块的重建 值,确定该组合i对应的预测失真代价,将该组合i对应的预测失真代价,确定为第i个预测模式对应的代价。这样可以确定出Q个预测模式中任意一个预测模式对应的代价。
根据上述方法,确定出Q个预测模式中第i个预测模式对应的代价后,根据第i个预测模式对应的代价从Q个预测模式中选出T个预测模式。
其中,解码端根据第i个预测模式对应的代价从Q个预测模式中选出T个预测模式包括如下方式:
第一种方式,若第i个预测模式对应的代价小于第四预设值,则从Q个预测模式中选出与第i个预测模式相似的预测模式;根据第i个预测模式,以及第i个预测模式的相似预测模式,确定T个预测模式。其中,与第i个预测模式相似的预测模式可以理解为预测结果与第i个预测模式的预测接收相似(或相近)的预测模式,例如预测方向(或角度)与第i个预测模式的预测方向(或角度)相近的预测模式,或者预测模式索引与第i个预测模式的索引相近的预测模式,例如索引比第i个预测模式的索引大1、2等的预测模式,或者索引比第i个预测模式的索引小1、2等的预测模式。
在该第一种方式中,若第i个预测模式对应的代价小于第四预设值,则说明使用该第i个预测模式对当前分量块进行预测时,可能会达到较优的预测效果,此时,将该第i个预测模式从Q个预测模式中选出,用于构造后续的R个第二组合。另外,由于与第i个预测模式相似的预测模式,具有与该第i个预测模式相似的特性,因此,从Q个预测模式模式中选出第i个预测模式的相似预测模式,用于构造后续的R个第二组合。接着,从Q个预测模式所剩余的预测模式中,选择一个预测模式作为新的第i个预测模式,重复上述步骤,进而得到T个预测模式。
本申请实施例对上述第四预设值的大小不做限制,具体根据实际需要进行确定。
第二种方式,若第i个预测模式对应的代价大于第五预设值,则从Q个预测模式中剔除掉第i个预测模式,以及第i个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据剔除后的至少一个预测模式,确定T个预测模式。
在该第二种方式中,若第i个预测模式对应的代价大于第五预设值,则说明使用该第i个预测模式对当前分量块进行预测时,可能无法达到较优的预测效果,此时,将该第i个预测模式从Q个预测模式中剔除掉。另外,由于与第i个预测模式相似的预测模式,具有与该第i个预测模式相似的特性,因此,将第i个预测模式的相似预测模式也从Q个预测模式中剔除掉,得到剔除后的预测模式集合。接着,在剔除后的预测模式集合中,选择一个预测模式作为新的第i个预测模式,重复上述步骤,将最终得到预测模式集合所包括的预测模式,确定为T个预测模式。
本申请实施例对上述第五预设值的大小不做限制,具体根据实际需要进行确定,第五预设值大于上述第四预设值。
根据上述步骤,从P个权重导出模式中选出S个权重导出模式,从Q个预测模式中选出T个预测模式,接着,执行如下S101-A21-23。
S101-A21-23、根据S个权重导出模式和T个预测模式,组成R个第二组合。
具体的,从S个权重导出模式中选出一个权重导出模式,从T个预测模式中选出K个预测模式,这一个权重导出模式和K个预测模式组成一个第二组合,重复执行该步骤,可以得到R个第二组合。
由上述可知,一个第二组合包括一个权重导出模式和K个预测模式,这样在筛选预测模式时,可以限制一个组合中的K个要素固定时,另外一个要素的可能选择,例如K=2时,可以限制在与其中2个要素组合使用的情况下,另外一个要素的可能选择。
下面以权重导出模式和一个预测模式固定时,另外一个预测模式的筛选过程为例,对上述S101-A21-2的一种实现过程进行介绍。
在一些实施例中,上述S101-A21-2包括:针对P个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式与Q个预测模式中的第j个预测模式对第一分量块进行预测时的代价;若第i个权重导出模式与第j个预测模式组合对应的代价大于第六预设值,则从Q个预测模式中剔除掉第j个预测模式,以及第j个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据第i个权重导出模式和剔除后的至少一个预测模式,构建R个第二组合。
在该实施例中,在权重导出模式和一个预测模式固定时,另外一个预测模式进行筛选。例如,某一权重导出模式下,某一个帧内预测模式作为第一预测模式不能得到比较小的代价,那么就不再尝试该权重导出模式下,与该帧内预测模式相似的帧内预测模式作为第一预测模式的情况。
具体的,针对P个权重导出模式中的第i个权重导出模式,假设K=2,即该组合中包括第i个权重导出模式、第一个预测模式和第二个预测模式。假设第二个预测模式设定为预测模式1,该预测模式1可以是Q个预测模式中的一个预测模式,也可以是Q个预测模式外的其他预测模式。从Q个预测模式中确定第一个预测模式的可能的选择,具体是,将Q个预测模式中的第j个预测模式作为第一个预测模式,此时,确定第i个权重导出模式、第j个预测模式和预测模式1组成的组合j对第一分量块进行预测时,第一分量块的预测值,并根据该预测值,确定出组合j对应的代价,将组合j对应的代价确定为第j个预测模式对应的代价。接着,判断该第j个预测模式对应的代价是否大于第六预设值,若该第j个预测模式对应的代价大于第六预设值,则说明使用该第j个预测模式与第i个权重导出模式和预测模式1组成的组合,无法实现第一分量块的准确预测,此时,从Q个预测模式中剔除掉第j个预测模式。由于与第j个预测模式相似的预测模式,具有与该第j个预测模式相似的特性,因此,从Q个预测模式模式中剔除掉第j个预测模式的相似预测模式,得到剔除后的预测模式集合。在剔除后的预测模式集合中,从新选择一个预测模式作为新的第j个预测模式,重复执行上述步骤,得到第i个权重导出模式对应的最终剔除后的预测模式集合。
根据上述步骤,可以确定出P个权重导出模式中,每个权重导出模式对应的最终剔除后的预测模式集合,这样根据P个权重导出模式与其各自对应的最终剔除后的预测模式集合,构建R个第二组合。
需要说明的是,上述实施例,示出了以组合的形式对预测模式进行筛选的方式,可选的,还可以通过组合的形式,对权重导出模式和预测模式中的任意一个进行筛选,最终构建出R个第二组合。
解码端根据上述各方法,确定出R个第二组合后,对于R个第二组合中的任一第二组合,使用第二组合中的权重 导出模式和K个预测模式,对第一分量块进行预测,得到第二组合对应的第一分量块预测值。
下面对使用任意一个第二组合对第一分量块进行预测,得到第一分量块的预测值的过程进行介绍。
首先,使用该第二组合所包括的权重导出模式,确定第一分量块的权重。其中,第一分量块的权重可以理解为第一分量块对应的预测值的权重。即根据该第二组合所包括的权重导出模式,确定第一分量块的权重,根据该第二组合所包括的K个预测模式,确定第一分量块的K个预测值,使用第一分量块的权重对第一分量块的K个预测值进行加权,得到第一分量块的预测值。
在一些实施例中,根据权重导出模式确定第一分量块的权重包括如下步骤:
步骤1、根据权重导出模式,确定角度索引和距离索引;
步骤2、根据角度索引、距离索引和第一分量块的大小,确定第一分量块的权重。
本申请可以采用与导出预测值的权重相同的方式,导出第一分量块的权重。例如,首先根据权重导出模式,确定角度索引和距离索引,其中角度索引可以理解为权重导出模式导出的各权重的分界线角度索引。示例性的,可以根据上述表2,确定出权重导出模式对应的角度索引和距离索引,例如权重导出模式为27,则对应的角度索引为12,距离索引为3。接着,根据角度索引、距离索引和第一分量块的大小,确定出第一分量块权重。
上述步骤2中根据角度索引、距离索引和第一分量块的大小,确定第一分量块权重的方式包括但不限于如下几种方式:
方式一,根据角度索引、距离索引和第一分量块的大小,直接确定第一分量块的权重。此时,上述步骤2包括如下步骤21至步骤23的步骤:
步骤21、根据角度索引、距离索引和第一分量块的大小,确定第一分量块中像素点的第一参数;
步骤22、根据第一分量块中像素点的第一参数,确定第一分量块中像素点的权重;
步骤23、根据第一分量块中像素点的权重,确定第一分量块的权重。
本实现方式中,根据角度索引、距离索引和第一分量块的大小,确定第一分量块中像素点的权重,进而将第一分量块中每个点的权重组成的权重矩阵,确定为第一分量块权重。
本申请的第一参数用于确定权重。在一些实施例中,第一参数也称为权重索引。
在一种可能的实现方式中,可以根据如下方式确定出偏移量和第一参数:
第一分量块权重导出过程的输入有:第一分量块的宽度nCbW,当前分量块的高度nCbH;GPM的“划分”角度索引变量angleId;GPM的距离索引变量distanceIdx;分量索引变量cIdx,此处确定第一分量块的权重,因此cIdx为0,表示亮度分量。
其中,变量nW,nH,shift1,offset1,displacementX,displacementY,partFlip还有shiftHor按如下方法导出:
nW=(cIdx==0)?nCbW:nCbW*SubWidthC
nH=(cIdx==0)?nCbH:nCbH*SubHeightC
shift1=Max(5,17-BitDepth)其中BitDepth是编解码的比特深度
offset1=1<<(shift1-1)
displacementX=angleIdx
displacementY=(angleIdx+8)%32
partFlip=(angleIdx>=13&&angleIdx<=27)?0:1
shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))?0:1
其中,偏移量offsetX and offsetY按如下方法导出:
– 如果shiftHor的值为0:
offsetX=(-nW)>>1
offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
– 否则(即shiftHor的值为1):
offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
offsetY=(-nH)>>1
第一分量块的权重矩阵wTemplateValue[x][y](其中x=-nTmW..nCbW–1,y=-nTmH..nCbH-1,去除x,y同时大于等于0的情况)注意这个例子里面以第一分量块的左上角坐标为(0,0)按如下方法导出:
– 变量xL和yL按如下方法导出:
xL=(cIdx==0)?x:x*SubWidthC
yL=(cIdx==0)?y:y*SubHeightC
其中disLut按上述表3确定
其中,第一参数weightIdx按如下方法导出:
weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY]
根据上述方法,确定出第一参数weightIdx后,根据weightIdx确定出第一分量块中点(x,y)处的权重。
本申请中,上述步骤22中根据第一分量块中像素点的第一参数,确定第一分量块中像素点的权重的方式包括的不限于如下几种:
方式1,根据第一分量块中像素点的第一参数,确定第一分量块中像素点的第二参数;根据第一分量块中像素点的第二参数,确定第一分量块中像素点的权重。
其中第二参数也用于确定权重。在一些实施例中,上述第二参数也称为第一分量下的权重索引,该第一分量可以为亮度分量等。
例如,根据公式,确定出第一分量块中像素点的权重:
weightIdxL=partFlip?32+weightIdx:32-weightIdx
wTemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3)
其中,wTemplateValue[x][y]为第一分量块中点(x,y)的权重,weightIdxL为第一分量块中点(x,y)的第二参数,也称为在第一分量(例如亮度分量)下的权重索引,wTemplateValue[x][y]为第一分量块中点(x,y)的权重,partFlip为中间变量,根据角度索引angleIdx确定,例如上述所述:partFlip=(angleIdx>=13&&angleIdx<=27)?0:1,也就是说,partFlip的值为1或0,当partFlip为0时,weightIdxL为32–weightIdx,当partFlip为1时,weightIdxL为32+weightIdx,需要说明的是,这里的32只是一种示例,本申请不局限于此。
方式2,根据第一分量块中像素点的第一参数、第一阈值和第二阈值,确定第一分量块中像素点的权重。
为了降低第一分量块的权重的计算复杂度,在方式2中将第一分量块中像素点的权重限定为第一阈值或第二阈值,也就是说,第一分量块中像素点的权重要么为第一阈值,要么是第二阈值,进而降低第一分量块权重的计算复杂度。
本申请对第一阈值和第二阈值的具体取值不做限制。
可选的,第一阈值为1。
可选的,第二阈值为0。
在一种示例,可以通过如下公式确定出第一分量块中像素点的权重:
wTemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0
其中,wTemplateValue[x][y]为第一分量块中点(x,y)的权重,上述“1:0”中的1为第一阈值,0为第二阈值。
在上述方式一中,通过权重导出模式确定出第一分量块中每个点的权重,第一分量块中每个点的权重组成的权重矩阵作为第一分量块的权重。
根据上述方法,确定出该第二组合所包括的权重导出模式对应的第一分量块的权重后,使用该第二组合中的K个预测模式对第一分量块进行预测,得到K个预测值,根据第一分量块的权重对K个预测值进行加权,得到第一分量块的预测值。
其中,第一分量块的预测值可以理解为由第一分量块中像素点的预测值组成的矩阵。
在一些实施例中,上述预测值也称为预测样本。
接着,根据第一分量块的预测值和重建值,确定该第二组合的代价。
上述确定该第二组合的代价的方式包括但不限于如下几种:
方式一,采用矩阵的方式确定该第二组合的代价。具体是,根据第一分量块的预测值和重建值,确定一损失,将该损失记为第一损失,由于上述第一分量块的预测值和重建值为矩阵,因此得到第一损失也为矩阵,例如将第一分量块的预测值和重建值的差值的绝对值确定为第一损失,将该第一损失确定为该第二组合的代价。
方式二,采用逐点计算的方式,确定出第二组合的代价。
具体的,针对第一分量块中的第i个像素点,确定该第二组合中的K个预测模式中每个预测模式在第i个像素点处的预测时,确定第i个像素点在第一分量块权重中对应的第一分量块的权重,根据第i像素点的第一分量块权重,以及第i个像素点的K个预测值,得到该第i个像素点的预测值。根据该第i个像素点的预测值与重建值,得到该第二组合在第i个像素点处的代价。根据该方法,可以确定出该第二组合在第一分量块中的每一个像素点处的预测失真代价,最后,该第二组合在第一分量块中的每一个像素点处的预测失真代价的累加和,确定为该第二组合的代价。
根据上述方法,可以确定出R个第二组合中每个第二组合的代价。
接着,根据R个第二组合中每个第二组合的代价,构建候选组合列表。
例如,根据第二组合的代价大小,按照从小到大的顺序,对R个第二组合进行排序,将排序后的R个第二组合确定为候选组合列表。
再例如,根据第二组合的代价大小,从R个第二组合中选出代价最小的N个第二组合,构成候选组合列表。
可选的,N为8或16或32等。
根据上述方法,确定出候选组合列表,该候选组合列表中各候选组合按照代价的大小从小到大进行排序,示例性的,该候选组合列表如上述表6所示。
这样解码端根据第一索引,在表6所示的候选组合列表中查询第一索引对应的候选组合,且将该第一索引对应的候选组合确定为第一组合,即将该候选组合所包括的权重导出模式确定为第一权重导出模式,将该候选组合所包括的K个预测模式,确定为K个第一预测模式。
上述实施例,以第一组合包括第一权重导出模式和K个第一预测模式为例,对构建候选组合的方式进行介绍。
本申请实施例中,情况1,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式不包括过渡参数(blending parameter)。情况2,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。情况3,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括过渡参数。其中,过渡参数与K个第一预测模式一起用于确定当前分量块的预测值。
对于情况1,第一组合包括第一权重导出模式和K个第一预测模式,且第一权重导出模式不包括过渡参数时,当前分量块对应的候选组合列表的构建方式如上述实施例的描述。
情况2,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。
由上述图4和图5所示,在权重分割线附近存在过渡区域,即图4和图5中的灰色区域,该过渡区域对应一个过渡参数,也就是说,使用过渡参数来表示权重图中的过渡区域。在某些情况下,可以通过该过渡参数对权重有影响。因此,本申请实施例,根据第二过渡参数、第一权重导出模式和K个第一预测模式确定当前分量块的预测值。此时,本申请实施例的第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。
在该情况2下,S101中确定第一组合包括如下步骤:
S101-C、解码码流,确定候选组合列表,该候选组合列表中包括至少一个候选组合,至少一个候选组合中的任一候选组合包括一个权重导出模式、K个预测模式和一个过渡参数;
S101-D、根据候选组合列表,确定第一组合。
示例性的,该候选组合列表如表8所示:
表8
Figure PCTCN2022103734-appb-000004
如表8所示,候选组合列表包括至少一个候选组合,这至少一个候选组合中任意两个候选组合不完全相同,即任意两个候选组合所包括的权重导出模式、K个预测模式和过渡参数中的至少一个不同。
示例性的,上述表8中以候选组合在候选组合列表中的排序为索引,可选的,还可以以其他方式体现候选组合在候选组合列表中的索引,本申请实施例对此不作限制。
在该实施例中,解码端根据候选组合列表,确定第一组合的方式包括不限于如下几种:
方式1,候选组合列表包括一个候选组合,此时将该候选组合列表所包括的候选组合,确定为第一组合。
方式2,候选组合列表包括多个候选组合,此时,解码码流,得到第一索引,该第一索引用于指示第一组合;将该候选组合列表中第一索引对应的候选组合,确定为第一组合。
在该方式2中,解码端解码码流,得到第一索引,并确定如上述表8所示的候选组合列表,根据第一索引在该候选组合列表中进行查询,得到该第一索引指示的第一组合。
例如,第一索引为索引1,在表8所示的候选组合列表中,索引1对应的候选组合为候选组合2,也就是说,第一索引指示的第一组合为候选组合2。这样,解码端将候选组合2所包括的权重导出模式、K个预测模式和过渡参数确定为第一组合所包括的第一权重导出模式、K个第一预测模式和第二过渡参数,并使用该第一权重导出模式、第二过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
在该方式2中,编码端和解码端可以分别确定相同的候选组合列表,例如编码端和解码端均确定一个包括L个候选组合的列表,每个候选组合包括1个权重导出模式、K个预测模式和1个过渡参数。而在码流中,编码端只需要写入最终选择的一个候选组合,例如第一组合,解码端解析编码端最终选择的第一组合,具体是解码端解码码流,得到第一索引,并通过第一索引在解码端所确定的候选组合列表中,确定出第一组合。
下面对上述S101-C中,确定候选组合列表的具体过程进行介绍。
在一些实施例中,上述候选组合列表为已有的,解码端在解码码流得到第一索引后,可以根据该第一索引获得或读取该候选组合列表,进而根据该第一索引,在该候选组合列表中查询第一索引对应的候选组合。
在一些实施例中,上述候选组合列表为编码端发送给解码端的,例如编码端在对当前分量块进行编码之前,发送给解码端。
在一些实施例中,上述候选组合列表为编码端上传至云端,解码端从云端读取该候选组合列表。
在一些实施例中,上述候选组合列表是解码端构建的。
本申请实施例对解码端构建候选组合列表的方式不做限制。例如,利用与当前分量块相关的信息去分析不同的权重导出模式、不同的预测模式和不同的过渡参数所组成的各组合发生的概率大小,根据各组合的发生概率大小来构建候选组合列表。
可选的,与当前分量块相关的信息包括当前分量块的周围块的模式信息,当前分量块对应的第一分量块的重建像素等。
在一些实施例中,解码端通过如下S101-C1和S101-C2的步骤,构建候选组合列表:
S101-C1、解码码流,确定当前分量块对应的第一分量块;
S101-C2、基于第一分量块,构建候选组合列表。
其中,S101-C1的具体实现过程参照上述S101-A1的描述,在此不再赘述。
由于当前分量块对应的第一分量块与当前分量块具有相关性,基于此本申请实施例基于第一分量块来构建当前分量块的候选组合列表。
例如,例如,针对每个组合,使用该组合对第一分量块进行预测,得到每个组合下该第一分量块的预测值,根据每个组合下该第一分量块的预测值,构建候选组合列表。例如,使用该组合所包括的权重导出模式导出第一分量块的权重,使用该组合所包括的K个预测模式分别对第一分量块进行预测,得到第一分量块的K个预测值,根据导出的第一分量块的权重,对第一分量块的K个预测值进行加权处理,得到该组合下第一分量块的预测值。最后,根据每个组合下该第一分量块的预测值,构建候选组合列表。
需要说明的是,上述根据权重导出模式导出的权重可以理解为导出第一分量块中每一个像素点对应的权重,也可以理解为导出第一分量块对应的权重矩阵。使用过渡参数对第一分量块的权重进行调整可以理解为对第一分量块中每一个像素点对应的权重进行调整,或者,对第一分量块的权重矩阵进行调整。其中,基于调整后的第一分量块权重确 定第一分量块的预测值时,可以是确定第一分量块中每一个像素点对应的K个预测值,并根据每一个像素点对应的K个预测值和调整后的权重,确定出每个像素点对应的预测值,第一分量块中每一个像素点对应的预测值构成第一分量块的预测值。可选的,基于调整后的权重确定第一分量块的预测值时,还可以是按照块来执行,例如,确定第一分量块的预测值,根据第一分量块的调整后权重矩阵对第一分量块的K个预测值进行加权,得到第一分量块的预测值。
在一些实施例中,S101-C2包括如下S101-C21至S101-C23的步骤:
S101-C21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式、K个预测模式和一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式、K个预测模式和过渡参数不完全相同,R为大于1的正整数。
S101-C22、对于R个第二组合中的任一第二组合,确定使用第二组合中的权重导出模式、K个预测模式和过渡参数,对第一分量块进行预测时,第二组合对应的代价。
S101-C23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,解码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式、K个预测模式和一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式、K个预测模式和过渡参数不完全相同。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合所包括的权重导出模式、K个预测模式和过渡参数对第一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
在一些实施例中,上述S101-C22中确定使用第二组合中的权重导出模式、K个预测模式和过渡参数,对第一分量块进行预测时,该第二组合对应的代价,至少包括如下方式:
方式1,S101-C22包括如下S101-C22-11至S101-C22-14:
S101-C22-11、根据第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重;
S101-C22-12、根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S101-C22-13、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块预测值;
S101-C22-14、根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定第二组合对应的代价。
本申请实施例中,确定R个第二组合中每个第二组合对应的代价的过程一致,为了便于描述,在此以R个第二组合中的一个第二组合为例进行说明。
本申请实施例中,第二组合包括一个权重导出模式、一个过渡参数和K个预测模式,在使用该第二组合对第一分量块进行预测时,根据该第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重,根据第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,接着,使用第一分量块的权重对第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块预测值。然后,根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定该第二组合对应的代价。
本申请实施例中,过渡参数用于对权重导出模式导出的权重进行调整,因此,本申请实施例中,上述S101-C22-11中,根据第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重的实现方式,至少存在如下几种:
示例1,在使用第一权重导出模式,导出第一分量块的权重时,需要确定多个中间变量,可以使用过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出第一分量块的权重。例如,使用过渡参数对displacementX、displacementY、partFlip、shiftHoroffsetX、offsetY、xL、yL等变量中的一个或几个进行调整,得到第一分量块的权重。
示例2,根据第二组合中的权重导出模式和第一分量块,确定第一分量块对应的第三权重,使用第二组合中的过渡参数,对第三权重进行调整,得到调整后的第三权重;根据调整后的第三权重,确定第一分量块的权重。
例如,根据第二组合中的权重导出模式和第一分量块,确定第一分量块对应的第三权重为weightIdx,接着,使用过渡参数对weightIdx进行调整,得到调整后的weightIdx,接着,根据调整后的weightIdx,确定第一分量块的权重wVemplateValue。
在一种示例中,可以根据如下公式,使用过渡参数对weightIdx进行调整,得到调整后的weightIdx:
weightIdx=weightIdx*blendingCoeff
其中,blendingCoeff为第二组合包括的过渡参数。
再例如,根据第二组合中的权重导出模式和第一分量块,确定第一分量块对应的第三权重为wVemplateValue,接着,使用过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue,将调整后的wVemplateValue,确定第一分量块的权重。
在一种示例中,可以根据如下公式,使用过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue:
wVemplateValue=wVemplateValue*blendingCoeff
根据上述方法,可以确定出R个第二组合中每一个第二组合对应的第一分量块的权重。接着,针对每个第二组合,使用该第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,使用该第二组合对应的第一分量块的权重,对该第二组合对应的第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块的预测值,根据该第二组合对应的第一分量块的预测值和第一分量块的重建值,确定该第二组合对应的代价。其中,确定第二组合对应的代价的方式包括但不限于SAD、SATD、SEE等。参照该方法,可以确定出R个第二组合中,每个第二组合对应的代价。接着,根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
方式2,S101-C22包括如下S101-C22-11至S101-C22-14:
S101-C22-21、根据第二组合中的权重导出模式和过渡参数,确定第二组合中K个预测模式分别对应的第一分量块的预测值;
S101-C22-22、根据第二组合中K个预测模式分别对应的第一分量块的预测值和第一分量块重建值,确定第二组合中K个预测模式分别对应的代价;
S101-C22-23、根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。例如,将第二组合中的K个预测模式分别对应的代价之和,确定为第二组合对应的代价。
举例说明,假设K=2,第二组合所包括的2个预测模式分别记为预测模式1和预测模式2,首先,根据该第二组合所包括的权重导出模式和过渡参数,确定预测模式1对应的第一分量块的权重和预测值,使用预测模式1对应的第一分量块的权重对预测模式1对应的预测值进行处理,例如针对预测模式1对应的第一分量块中的每一个像素点,将预测模式1对应的第一分量块中的像素点的预测值乘以该像素点对应的第一分量块的权重,得到该像素点的预测值。这样,可以确定出该预测模式1对应的第一分量块的预测值,接着,根据预测模式1对应的第一分量块的预测值和第一分量块的重建值,确定出该预测模式1对应的代价,其中,确定该预测模式1对应的代价的方式包括但不限于SAD、SATD、SEE等。同理,可以确定出预测模式2对应的代价。进而根据预测模式1对应的代价和预测模式2对应的代价,确定出第二组合对应的代价,例如,将预测模式1对应的代价和预测模式2对应的代价相加,确定为第二组合对应的代价。
上述S101-C23中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式,可以参照上述S101-A23的描述,在此不再赘述。
下面对上述S101-C21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。
在一些实施例中,S101-C21包括如下步骤:
S101-C21-1、确定F个权重导出模式、J个预测模式和W个过渡参数,F和W均为正整数,J为大于或等于K的正整数;
S101-C21-2、根据F个权重导出模式、J个预测模式和W个过渡参数,构建R个第二组合,R个第二组合中的任一第二组合包括F个权重导出模式中的一权重导出模式、J个预测模式中的K个预测模式和W个过渡参数中的一个过渡参数。
在该实施例中,解码端首先确定F个权重导出模式、J个预测模式和W个过渡参数,接着,根据确定的F个权重导出模式、J个预测模式和W个过渡参数,构建R个第二组合。
本申请实施例对上述F个权重导出模式、J个预测模式和W个过渡参数的具体个数不做限制。
假设K=2,上述K个预测模式包括第一个预测模式和第二个预测模式,假设所有可用的预测模式有J种,第一个预测模式有J种可能,由于第二个预测模式与第一个预测模式不相同,因此第二个预测模式有J-1种,假设权重导出模式有F种,假设过度梯度系数有W种,那么本申请可能使用任意两种不同的预测模式以及任意一种权重导出模式和任意一种过度梯度系数组成一个第二组合,总共有F*J*(J-1)*W种可能的第二组合。
在该实现方式中,F个权重导出模式为所有可能的权重导出模式,J个预测模式为所有可能的预测模式,W个过渡参数为所有可能的过渡参数,使用一种穷举的办法,得到所有可能的第二组合。使用所有可能的第二组合中的每个第二组合对当前分量块对应的第一分量块进行预测,计算每一个第二组合的失真代价,进而根据每个第二组合的失真代价,得到当前分量块对应的候选组合列表。
在一些实施例中,为了降低数据量,提升候选组合列表的构建速度,则不对每一种预测模式都进行尝试,可以选择其中部分预测模式进行尝试。
此时,上述S101-C21-1中确定J个预测模式的实现方式包括但不限于如下几种方式:
方式一,J个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定J个预测模式。
其中,确定当前分量块的候选预测模式列表的方式至少包括如下几种示例:
示例1,根据与当前分量块相邻的至少一个块所使用的预测模式,确定候选预测模式列表。
示例2,若候选预测模式列表中不包括预设模式时,则确定当前分量块对应的预设模式;将预设模式添加至候选预测模式列表中。
在一种示例中,上述预设模式为预设的几个预测模式。
在另一种示例中,通过确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定预设模式。
例如,若当前分量块对应的图像类型为B类型或P类型时,则预设模式包括DC,水平模式、竖直模式和角度模式中的至少一个。
示例3,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至少一个,添加至第二候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至候选预测模式列表中。
示例4,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已解码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
本申请实施例中,上述确定J个预测模式的具体实现方式,可以参照上述S101-A21-1中确定Q个预测模式的具体描述,在此不再赘述。在一些实施例中,上述J等于Q。
下面对S101-C21-1中确定F个权重导出模式的过程进行介绍。
本申请实施例中,确定F个权重导出模式的方式至少包括如下几种方式:
在一些实施例中,上述F个权重导出模式为预设的权重导出模式。
在一些实施例中,从预设的Z个权重导出模式中,选出F个权重导出模式,其中Z为大于或等于F的正整数。
本申请实施例对上述预设的Z个权重导出模式不做限制。
在一些实施例中,若Z等于F,则将Z个权重导出模式,确定为F个权重导出模式。
在一些实施例中,若Z大于F,则为了进一步降低R个第二组合的数量,则对预设的Z个权重导出模式进行筛选,则可以从预设的Z个权重导出模式中选择F个权重导出模式,用于构建R个第二组合。
上述S101-C21-1中确定F个权重导出模式的过程,与上述S101-A21-1中确定P个权重导出模式的过程基本一致,参照上述确定P个权重导出模式的具体描述,在此不再赘述。
下面对S101-C21-1中确定W个过渡梯度系数的过程进行介绍。
在一些实施例中,上述W个过渡参数为预设的过渡参数,例如为1/4、1/2、1、2、4等。
在一些实施例中,根据当前分量块的大小,确定W个过渡参数。例如,若当前分量块的大小小于某一个预设值时,则W个过渡参数位于过渡参数的取值范围1中。再例如,若当前分量块的大小小于某一个预设值时,则W个过渡参数位于过渡参数的取值范围2中。其中,过渡参数的取值范围1与过渡参数的取值范围2可以相交,也可以不相交。
在一些实施例中,从预设的多个过渡参数,确定W个过渡参数。
在一种示例中,根据当前分量块的图像信息,从预设的多个过渡参数中,确定出W个过渡参数。
本申请实施例对当前分量块的图像信息的具体内容不做限制,例如模糊度、清晰度、锐度等。
在一些实施例中,若当前分量块的图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从多个预设的过渡参数中,确定出W个过渡参数,包括两种示例:
示例1,若当前分量块的图像边缘的清晰度小于预设值,则将多个预设过渡参数中的至少一个第一类过渡参数,确定为W个过渡参数。
其中,第一类过渡参数可以理解为可以形成较宽过渡区域的过渡参数,例如为1/4、1/2等。
示例2,若所述当前分量块的图像边缘的清晰度大于或等于所述预设值,则将多个预设过渡参数中的至少一个第二类过渡参数,确定为W个过渡参数,第二类过渡参数大于第一类过渡参数。
其中,第二类过渡参数可以理解为可以形成较窄过渡区域的过渡参数,例如为2、4等。
本申请实施例中,确定当前分量块的图像信息的方式可以包括至少两种方式:
方式1,通过解码码流,得到当前分量块的图像信息,例如,编码端将当前分量块的图像信息编入码流,这样,解码端通过解码码流,得到当前分量块的图像信息。
方式2,确定第一分量块图像信息;根据第一分量块图像信息,确定当前分量块的图像信息。由于第一分量块已解码,因此,第一分量块图像信息是可得的,例如,对第一分量块的重建值进行分析,得到第一分量块的图像信息。接着,根据第一分量块的图像信息,得到当前分量块的图像信息。例如,将第一分量块的图像信息,确定为当前分量块的图像信息,或者对第一分量块的图像信息进行处理,得到当前分量块的图像信息。
解码端根据上述步骤,确定出J个预测模式、F个权重导出模式和W个过渡参数后,根据这J个预测模式、F个权重导出模式和W个过渡参数,组成R个不同的第二组合。接着,根据R个第二组合,确定出候选组合列表,进而从这候选组合列表中,确定出第一权重导出模式、K个第一预测模式和第二过渡参数。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则解码端对上述确定的J个预测模式、F个权重导出模式和W个过渡参数再次进行筛选,此时,上述S101-C21-2中根据确定出的F个权重导出模式、J个预测模式和W个过渡参数,组成R个第二组合包括如下S101-C21-21至S101-C21-24的步骤:
S101-C21-21、从F个权重导出模式中选出E个权重导出模式,其中E为小于或等于F的正整数。
具体的,从上述确定的F个权重导出模式剔除掉发生概率较低的权重导出模式,得到筛选后的E个权重导出模式。
其中,上述S101-C21-21中从F个权重导出模式中选出E个权重导出模式的方式包括但不限于如下几种:
方式1,针对F个权重导出模式中的第i个权重导出模式,根据第i个权重导出模式和第四过渡参数,确定K个第二预测模式在第一分量块上的权重,第四过渡参数为W个过渡梯度中的任一过渡参数,K个第二预测模式为J个预测模式中的任意K个预测模式,i为从1到F的正整数;若K个预测模式中的任一预测模式在第一分量块上的权重小于第一预设值时,则从F个权重导出模式中剔除第i个权重导出模式,得到E个权重导出模式。
在该方式1中,根据第i个权重导出模式和第四过渡参数,确定K个第二预测模式在第一分量块上的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第i权重导出模式,导出第一分量块的权重时,需要确定多个中间变量,可以使用第四过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出第一分量块的权重。
示例2,根据第i权重导出模式和第一分量块,确定第一分量块对应的第四权重;使用第四过渡参数,对第四权重进行调整,得到调整后的第四权重;根据调整后的第四权重,确定K个第二预测模式在第一分量块上的权重。
例如,根据第i权重导出模式和第一分量块,确定第一分量块对应的第四权重为weightIdx,接着,使用第四过渡参数对weightIdx进行调整,得到调整后的weightIdx,接着,根据调整后的weightIdx,确定第一分量块的权重wVemplateValue。
在一种示例中,可以根据如下公式,使用第四过渡参数对weightIdx进行调整,得到调整后的weightIdx:
weightIdx=weightIdx*blendingCoeff3
其中,blendingCoeff3为第四过渡参数。
再例如,根据第i权重导出模式和第一分量块,确定第一分量块对应的第四权重为wVemplateValue,接着,使用第四过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue,将调整后的wVemplateValue,确定为第一分量块的权重。
在一种示例中,可以根据如下公式,使用第四过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue:
wVemplateValue=wVemplateValue*blendingCoeff3
根据上述方法,根据第i个权重导出模式下,K个第二预测模式在第一分量块上的权重。
方式2,针对F个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式对第一分量块进行预测时的代价,i为从1到F的正整数;根据第i个权重导出模式对应的代价,从F个权重导出模式中选出E个权重导出模式。
在一些实施例中,在确定上述第i个权重导出模式对应的代价时,不考虑过渡参数对权重的影响。
在一些实施例中,在确定上述第i个权重导出模式对应的代价时,包括过渡参数对权重的影响,也就是说,根据第i个权重导出模式和过渡参数确定第一分量块的权重,进而根据第一分量块的权重和第一分量块的K个预测值,确定第一分量块预测值,根据第一分量块预测值和重建值,确定第i个权重导出模式对应的代价。其中根据第i个权重导出模式和过渡参数确定第一分量块的权重的具体过程可以参照上述实施例的描述,在此不再赘述。
在一些实施例中,还可以参照上述S101-A11-21中从P个权重导出模式中选出S个权重导出模式相同的方式,从F个权重导出模式中选出E个权重导出模式的方式,具体参照上述实施例的描述,在此不再赘述。
根据上述步骤,解码端从F个权重导出模式中筛选出E个权重导出模式后,执行如下S101-C21-22的步骤。
S101-C21-22、从J个预测模式中选出V个预测模式,V为小于或等于J的正整数。
本申请实施例对从J个预测模式中选出V个预测模式的方式不做限制。
在一些实施例中,从J个预测模式中选出预设的V个预测模式。
在一些实施例中,针对J个预测模式中的第i个预测模式,解码端确定使用第i个预测模式对第一分量块进行预测时的代价,i为从1到J的正整数;根据第i个预测模式对应的代价,从J个预测模式中选出V个预测模式。
本申请实施例中,将权重导出模式、K个预测模式和过渡参数作为一个组合,进行代价的计算,这样,为了计算方便,在给定权重导出模式、其他K-1个预测模式和过渡参数的基础上,对J个权重导出模式的代价进行计算,即将J个预测模式分别与设定的权重导出模式、K-1个预测模式和过渡参数进行组合,得到J个组合,计算这J个组合中每个组合对应的代价,进而得到J个预测模式的代价。
根据上述方法,确定出J个预测模式中第i个预测模式对应的代价后,根据第i个预测模式对应的代价从J个预测模式中选出V个预测模式。
其中,解码端根据第i个预测模式对应的代价从J个预测模式中选出V个预测模式包括如下方式:
第一种方式,若第i个预测模式对应的代价小于第四预设值,则从J个预测模式中选出与第i个预测模式相似的预测模式;根据第i个预测模式,以及第i个预测模式的相似预测模式,确定V个预测模式。其中,与第i个预测模式相似的预测模式可以理解为预测结果与第i个预测模式的预测接收相似(或相近)的预测模式,例如预测方向(或角度)与第i个预测模式的预测方向(或角度)相近的预测模式,或者预测模式索引与第i个预测模式的索引相近的预测模式,例如索引比第i个预测模式的索引大1、2等的预测模式,或者索引比第i个预测模式的索引小1、2等的预测模式。
第二种方式,若第i个预测模式对应的代价大于第五预设值,则从J个预测模式中剔除掉第i个预测模式,以及第i个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据剔除后的至少一个预测模式,确定V个预测模式。
根据上述步骤,从F个权重导出模式中选出E个权重导出模式,从J个预测模式中选出V个预测模式,接着,执行如下S101-C21-23。
S101-C21-23、从W个过渡参数中选出O个过渡参数,O为小于或等于W的正整数。
在一些实施例中,若O等于W,则将W个过渡参数,确定为O个过渡参数。
在一些实施例中,若W大于O时,则对W个过渡参数进行筛选,得到O个过渡参数。
其中,对W个过渡参数进行筛选,得到O个过渡参数的方式至少包括如下几种:
示例1,确定W个过渡参数中每个过渡参数的代价,筛选出W个过渡参数中,代价最小的前O个过渡参数。
例如,针对W个过渡参数中的第i个过渡参数,将第i个过渡参数与权重导出模式1、预测模式1和预测模式2组成一个组合,使用该组合对第一分量块进行预测,得到第一分量块的预测值。示例性的,根据权重导出模式1确定一个权重,使用第i个过渡参数对该权重进行调整,得到调整后的权重。使用预测模式1和预测模式2分别对第一分量块进行预测,得到第一分量块的2个预测值,使用调整后的权重对这2个预测值进行加权,得到第i个过渡参数对应的第一分量块预测值。接着,根据第一分量块的重建值和第i个过渡参数对应的第一分量块预测值,确定第i个过渡参数对应的代价。参照上述方法,可以确定出W个过渡参数中每一个过渡参数,与权重导出模式1、预测模式1和预测模式2组成的组合对应的代价,进而根据代价,从W个过渡参数中筛选出O个过渡参数。例如,筛选出W个过渡参数中代价最小的O个过渡参数。
示例2,若上述W个过渡参数不是经过当前分量块的图像信息确定的时,则本申请实施例还可以通过确定当前分量块的图像信息;根据当前分量块的图像信息,从W个过渡参数中,确定出O个过渡参数。
本申请实施例对当前分量块的图像信息的具体内容不做限制,例如模糊度、清晰度、锐度等。
在一些实施例中,若当前分量块的图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从W个过渡参数中,确定出O个过渡参数,包括两种示例:
在一种示例中,若当前分量块的图像边缘的清晰度小于预设值,则将W个过渡参数中的至少一个第一类过渡参数,确定为O个过渡参数。
在另一种示例中,若所述当前分量块的图像边缘的清晰度大于或等于所述预设值,则将W个过渡参数中的至少一个第二类过渡参数,确定为O个过渡参数。
在一些实施例中,根据当前分量块的大小,从W个过渡参数中选出所述O个过渡参数。
在一种可能的实现方式中,根据当前分量块的大小,将W个过渡参数中大于或等于第三值的过渡参数作为O个过渡参数。
例如,若当前分量块的大小小于第二设定阈值时,则将W个过渡参数中值为第三值的过渡参数作为O个过渡参数中的一个过渡参数。
再例如,若当前分量块的大小大于或等于第二设定阈值时,则将W个过渡参数中小于或等于第四值的过渡参数作为O个过渡参数,其中第四值小于第三值。
本申请实施例对第二设定阈值、第三值和第四值的具体取值不做限制。
可选的,第三值为1,第四值为1/2。
可选的,若当前分量块的大小用当前分量块的像素点个数表示,则第二设定阈值为256等。
在另一种可能的实现方式中,根据当前分量块的大小,确定O个过渡参数为W个过渡参数中位于某一个取值范围内的至少一个过渡参数。
例如,若当前分量块的大小小于第二设定阈值时,则确定O过渡参数为W个过渡参数中位于第四过渡参数取值范围内的一个或多个过渡参数。
再例如,若当前分量块的大小大于或等于第二设定阈值时,则确定O过渡参数为W个过渡参数中位于第三过渡参数取值范围内的一个或多个过渡参数,其中第三过渡参数取值范围的最小值小于第四过渡参数取值范围的最小值。
本申请实施例对上述第四过渡参数取值范围和第三过渡参数取值范围的具体取值不做限制,可选的,第四过渡参数取值范围和第三过渡参数取值范围相交,可选的,第四过渡参数取值范围和第三过渡参数取值范围不相交。
从F个权重导出模式中选出E个权重导出模式,从J个预测模式中选出V个预测模式,从W个过渡参数中选出O个过渡参数后,执行如下S101-C21-24。
S101-C21-24、根据E个权重导出模式、V个预测模式和O个过渡参数,组成R个第二组合。
具体的,从E个权重导出模式中选出一个权重导出模式,从V个预测模式中选出K个预测模式,从O个过渡参数最终选出一个过渡参数,这一个权重导出模式、K个预测模式和一个过渡参数组成一个第二组合,重复执行该步骤,可以得到R个第二组合。
由上述可知,一个第二组合包括一个权重导出模式、K个预测模式和一个过渡参数,即一个第二组合中包括K+2个元素,这样在筛选一个元素时,可以限制一个组合中的其他要素固定,另外一个要素的可能选择。
下面以权重导出模式、过渡参数和一个预测模式固定时,另外一个预测模式的筛选过程为例,对上述S101-C21-2的一种实现过程进行介绍。
在一些实施例中,上述S101-C21-2包括:针对F个权重导出模式中的第f个权重导出模式,以及O个过渡参数中的第o个过渡参数,确定使用第f个权重导出模式、第o个过渡参数与J个预测模式中的第j个预测模式对第一分量块进行预测时的代价,其中f为小于或等于F的正整数,o为小于或等于O的正整数,j为小于或等于J的正整数;若第f个权重导出模式、第o个过渡参数与第j个预测模式组合对应的代价大于第六预设值,则从J个预测模式中剔除掉第j个预测模式,以及第j个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据第f个权重导出模式、第o个过渡参数和剔除后的至少一个预测模式,构建R个第二组合。
在该实施例中,在权重导出模式、过渡参数和一个预测模式固定时,另外一个预测模式进行筛选。例如,某一权重导出模式和过渡参数下,某一个帧内预测模式作为第一预测模式不能得到比较小的代价,那么就不再尝试该权重导出模式和过渡参数下,与该帧内预测模式相似的帧内预测模式作为第一预测模式的情况。
具体的,假设K=2,针对F个权重导出模式中的第f个权重导出模式和O个过渡参数中的第o个过渡梯度参。假设第二个预测模式设定为预测模式1,该预测模式1可以是J个预测模式中的一个预测模式,也可以是J个预测模式外的其他预测模式。从J个预测模式中确定第一个预测模式的可能的选择,具体是,将J个预测模式中的第j个预测模式作为第一个预测模式,此时,确定第f个权重导出模式、第o个过渡梯度参、第j个预测模式和预测模式1组成的组合j对第一分量块进行预测时,第一分量块的预测值,并根据该预测值,确定出组合j对应的代价,将组合j对应的代价确定为第j个预测模式对应的代价。接着,判断该第j个预测模式对应的代价是否大于第六预设值,若该第j个预测模式对应的代价大于第六预设值,则说明使用该第j个预测模式与第f个权重导出模式、第o个过渡梯度参和预测模式1组成的组合,无法实现第一分量块的准确预测,此时,从J个预测模式中剔除掉第j个预测模式。由于与第j个预测模式相似的预测模式,具有与该第j个预测模式相似的特性,因此,从J个预测模式模式中剔除掉第j个预测模式的相似预测模式,得到剔除后的预测模式集合。在剔除后的预测模式集合中,从新选择一个预测模式作为新的第j个预测模式,重复执行上述步骤,得到第f个权重导出模式和第o个过渡参数对应的最终剔除后的预测模式集合。
根据上述步骤,可以确定出F个权重导出模式中,每个权重导出模式和过渡参数对应的最终剔除后的预测模式集合,这样根据F个权重导出模式与其各自对应的最终剔除后的预测模式集合,构建R个第二组合。
需要说明的是,上述实施例,示出了以组合的形式对预测模式进行筛选的方式,可选的,还可以通过组合的形式,对权重导出模式和过渡参数中的任意一个进行筛选,最终构建出R个第二组合。
解码端根据上述各方法,确定出R个第二组合后,对于R个第二组合中的任一第二组合,使用第二组合中的权重导出模式、过渡参数和K个预测模式,对第一分量块进行预测,得到第二组合对应的第一分量块预测值。
下面对本申请一实施例中,使用任意一个第二组合对当前分量块对应的第一分量块进行预测,得到第一分量块的 预测值的一种实现过程进行介绍。
本申请实施例中,针对任意一个第二组合,根据该第二组合所包括的权重导出模式、过渡参数和K个预测模式对第一分量块进行预测,得到第二组合对应的第一分量块预测值。
本申请实施例对根据该第二组合所包括的权重导出模式、过渡参数和K个预测模式对第一分量块进行预测,得到第二组合对应的第一分量块预测值的具体实现方式不做限制。例如,首先根据该第二组合所包括的权重导出模式和K个预测模式,确定出第一分量块的一个预测值,接着根据过渡参数和确定出的第一分量块的预测值,得到该第二组合对应的第一分量块预测值。
在一些实施例中,可以使用该第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重,接着,根据该第二组合包括的K个预测模式确定出K个第一分量块预测值,根据第一分量块的权重和K个第一分量块预测值,确定出第二组合对应的第一分量块预测值。
在一些实施例中,根据权重导出模式确定第一分量块权重包括如下步骤:
步骤1、根据权重导出模式,确定角度索引和距离索引;
步骤2、根据角度索引、距离索引、过渡参数和第一分量块的大小,确定第一分量块权重。
本申请可以采用与导出预测值的权重相同的方式,导出第一分量块权重。例如,首先根据权重导出模式,确定角度索引和距离索引,其中角度索引可以理解为权重导出模式导出的各权重的分界线角度索引。示例性的,可以根据上述表2,确定出权重导出模式对应的角度索引和距离索引,例如权重导出模式为27,则对应的角度索引为12,距离索引为3。接着,根据角度索引、距离索引和第一分量块的大小,确定出第一分量块权重。
上述步骤2中根据角度索引、距离索引和第一分量块的大小,确定第一分量块权重的方式包括但不限于如下几种方式:
方式一,根据角度索引、距离索引、过渡参数和第一分量块的大小,确定第一分量块权重。此时,上述步骤2包括如下步骤21至步骤23的步骤:
步骤21、根据角度索引、距离索引和第一分量块的大小,确定第一分量块中像素点的第一参数;
步骤22、根据第一分量块中像素点的第一参数和过渡参数,确定第一分量块中像素点的权重;
步骤23、根据第一分量块中像素点的权重,确定第一分量块权重。
本实现方式中,根据角度索引、距离索引、第一分量块的大小和当前分量块的大小,确定第一分量块中像素点的权重,进而将第一分量块中每个点的权重组成的权重矩阵,确定为第一分量块权重。
本申请的第一参数用于确定权重。
在一些实施例中,第一参数也称为权重索引。
在一些实施例中,第一参数可以理解为上述实施例中的第一分量块对应的第三权重和第一分量块对应的第四权重。
在一种可能的实现方式中,可以根据如下方式确定出偏移量和第一参数:
第一分量块权重导出过程的输入有:第一分量块的宽度nCbW,第一分量块的高度nCbH;GFM的“划分”角度索引变量angleId;GFM的距离索引变量distanceIdx;分量索引变量cIdx,此时以第一分量块为例,因此cIdx为0,表示亮度分量。
其中,变量nW,nH,shift1,offset1,displacementX,displacementY,partFlip还有shiftHor按如下方法导出:
nW=(cIdx==0)?nCbW:nCbW*EubWidthC
nH=(cIdx==0)?nCbH:nCbH*EubHeightC
shift1=Max(5,17-BitDepth)其中BitDepth是编解码的比特深度
offset1=1<<(shift1-1)
displacementX=angleIdx
displacementY=(angleIdx+8)%32
partFlip=(angleIdx>=13&&angleIdx<=27)?0:1
shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))?0:1
其中,偏移量offsetX and offsetY按如下方法导出:
– 如果shiftHor的值为0:
offsetX=(-nW)>>1
offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
– 否则(即shiftHor的值为1):
offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
offsetY=(-nH)>>1
第一分量块权重矩阵wVemplateValue[x][y](其中x=-nVmW..nCbW–1,y=-nVmH..nCbH-1,去除x,y同时大于等于0的情况)注意这个例子里面以第一分量块的左上角坐标为(0,0)按如下方法导出:
– 变量xL和yL按如下方法导出:
xL=(cIdx==0)?x:x*EubWidthC
yL=(cIdx==0)?y:y*EubHeightC
其中disLut按上述表3确定
其中,第一参数weightIdx按如下方法导出:
weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY]
在一些实施例中,根据上述方法,确定出第一参数weightIdx后,接着,使用过渡参数对第一参数进行调整,得到调整后的第一参数。
在一种示例中,通过如下公式对第一参数进行调整:
weightIdx=weightIdx*blendingCoeff
其中,blendingCoeff为过渡参数。
接着,根据调整后的第一参数,确定第一分量块中像素点的权重的方式包括的不限于如下几种:
方式1,根据第一分量块中像素点的调整后的第一参数,确定第一分量块中像素点的第二参数;根据第一分量块中像素点的第二参数,确定第一分量块中像素点的权重。
其中第二参数也用于确定权重。在一些实施例中,上述第二参数也称为第一分量下的权重索引,该第一分量可以为亮度分量、色度分量等。
例如,根据公式,确定出第一分量块中像素点的权重:
weightIdxL=partFlip?32+weightIdx:32-weightIdx
wVemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3)
其中,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,weightIdxL为第一分量块中点(x,y)的第二参数,也称为在第一分量(例如亮度分量)下的权重索引,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,partFlip为中间变量,根据角度索引angleIdx确定,例如上述所述:partFlip=(angleIdx>=13&&angleIdx<=27)?0:1,也就是说,partFlip的值为1或0,当partFlip为0时,weightIdxL为32–weightIdx,当partFlip为1时,weightIdxL为32+weightIdx,需要说明的是,这里的32只是一种示例,本申请不局限于此。
方式2,根据第一分量块中像素点的调整后的第一参数、第一阈值和第二阈值,确定第一分量块中像素点的权重。
为了降低第一分量块权重的计算复杂度,在方式2中将第一分量块中像素点的权重限定为第一阈值或第二阈值,也就是说,第一分量块中像素点的权重要么为第一阈值,要么是第二阈值,进而降低第一分量块权重的计算复杂度。
本申请对第一阈值和第二阈值的具体取值不做限制。
可选的,第一阈值为1。
可选的,第二阈值为0。
在一种示例,可以通过如下公式确定出第一分量块中像素点的权重:
wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0
其中,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,上述“1:0”中的1为第一阈值,0为第二阈值。
在上述方式一中,通过权重导出模式确定出第一分量块中每个点的权重,第一分量块中每个点的权重组成的权重矩阵作为第一分量块权重。
根据上述方法,确定出该第二组合所包括权重导出模式对应的第一分量块权重后,使用该第二组合中的K个预测模式对第一分量块进行预测,得到K个预测值,根据第一分量块权重对K个预测值进行加权,得到第一分量块的预测值。
接着,根据第一分量块的预测值和重建值,确定该第二组合的代价。
根据上述方法,可以确定出R个第二组合中每个第二组合的代价。接着,根据R个第二组合中每个第二组合的代价,构建如表8所示候选组合列表。
这样解码端根据第一索引,在表8所示的候选组合列表中查询第一索引对应的候选组合,且将该第一索引对应的候选组合确定为第一组合,即将该候选组合所包括的权重导出模式确定为第一权重导出模式,将该候选组合所包括的K个预测模式,确定为K个第一预测模式,将该候选组合所包括的过渡参数,确定为第二过渡参数。
上述情况2,以第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数为例,对上述S101的实现过程进行介绍。
情况3,第一组合包括第一权重导出模式和K个第一预测模式,且第一权重导出模式包括第三过渡参数,该第三过渡参数用于确定权重。
在该情况3中,第一权重导出模式可以理解为一个数据集,该数据集中包括多个参数,例如包括第三过渡参数,这多个参数共同用于确定权重。
在该情况3下,S101中确定第一组合包括如下步骤:
S101-E、解码码流,确定候选组合列表,该候选组合列表中包括至少一个候选组合,至少候选组合中的任一候选组合包括一个权重导出模式和K个预测模式,其中权重导出模式包括一个过渡参数;
S101-F、根据候选组合列表,确定第一组合。
示例性的,候选组合列表如表9所示:
表9
Figure PCTCN2022103734-appb-000005
如表9所示,候选组合列表包括至少一个候选组合,这至少一个候选组合中任意两个候选组合不完全相同,即任意两个候选组合所包括的权重导出模式、K个预测模式中的至少一个不同。
示例性的,上述表9中以候选组合在候选组合列表中的排序为索引,可选的,还可以以其他方式体现候选组合在候选组合列表中的索引,本申请实施例对此不作限制。
在该实施例中,解码端根据候选组合列表,确定第一组合的方式包括不限于如下几种:
方式1,候选组合列表包括一个候选组合,此时将该候选组合列表所包括的候选组合,确定为第一组合。
方式2,候选组合列表包括多个候选组合,此时解码码流,得到第一索引,该第一索引用于指示第一组合;将该候选组合列表中第一索引对应的候选组合,确定为第一组合。
在该方式2中,解码端解码码流,得到第一索引,并确定如上述表9所示的候选组合列表,根据第一索引在该候选组合列表中进行查询,得到该第一索引指示的第一组合。
例如,第一索引为索引1,在表9所示的候选组合列表中,索引1对应的候选组合为候选组合2,也就是说,第一索引指示的第一组合为候选组合2。这样,解码端将候选组合2所包括的权重导出模式和K个预测模式确定为第一组合所包括的第一权重导出模式和K个第一预测模式,并使用该第一权重导出模式所包括第三过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
下面对上述S101-E中,确定候选组合列表的具体过程进行介绍。
在一些实施例中,上述候选组合列表为已有的,解码端在解码码流得到第一索引后,可以根据该第一索引获得或读取该候选组合列表,进而根据该第一索引,在该候选组合列表中查询第一索引对应的候选组合。
在一些实施例中,上述候选组合列表为编码端发送给解码端的,例如编码端在对当前分量块进行编码之前,发送给解码端。
在一些实施例中,上述候选组合列表为编码端上传至云端,解码端从云端读取该候选组合列表。
在一些实施例中,上述候选组合列表是解码端构建的。
本申请实施例对解码端构建候选组合列表的方式不做限制。例如,利用与当前分量块相关的信息去分析不同的预测模式和不同的过渡参数所组成的各组合发生的概率大小,根据各组合的发生概率大小来构建候选组合列表。
可选的,与当前分量块相关的信息包括当前分量块的周围块的模式信息,当前分量块对应的第一分量块的重建像素等。
在一些实施例中,解码端通过如下S101-E1和S101-E2的步骤,构建候选组合列表:
S101-E1、解码码流,确定当前分量块对应的第一分量块;
S101-E2、基于第一分量块,构建候选组合列表。
其中,S101-E1的具体实现过程参照上述S101-A1的描述,在此不再赘述。
由于当前分量块对应的第一分量块与当前分量块具有相关性,基于此本申请实施例基于第一分量块来构建当前分量块的候选组合列表。
例如,针对每个组合,使用该组合对第一分量块进行预测,得到每个组合下该第一分量块的预测值,根据每个组合下该第一分量块的预测值,构建候选组合列表。例如,使用该组合所包括的权重导出模式导出第一分量块的权重,使用该组合所包括的K个预测模式分别对第一分量块进行预测,得到第一分量块的K个预测值,根据导出的第一分量块的权重,对第一分量块的K个预测值进行加权处理,得到该组合下第一分量块的预测值。最后,根据每个组合下该第一分量块的预测值,构建候选组合列表。
需要说明的是,上述根据权重导出模式导出的权重可以理解为导出第一分量块中每一个像素点对应的权重,也可以理解为导出第一分量块对应的权重矩阵。使用过渡参数对第一分量块的权重进行调整可以理解为对第一分量块中每一个像素点对应的权重进行调整,或者,对第一分量块的权重矩阵进行调整。其中,基于调整后的第一分量块权重确定第一分量块的预测值时,可以是确定第一分量块中每一个像素点对应的K个预测值,并根据每一个像素点对应的K个预测值和调整后的权重,确定出每个像素点对应的预测值,第一分量块中每一个像素点对应的预测值构成第一分量块的预测值。可选的,基于调整后的权重确定第一分量块的预测值时,还可以是按照块来执行,例如,确定第一分量块的预测值,根据第一分量块的调整后权重矩阵对第一分量块的K个预测值进行加权,得到第一分量块的预测值。
在一些实施例中,S101-E2包括如下S101-E21至S101-E23的步骤:
S101-E21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,权重导出模式包括一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式和K个预测模式不完全相同,R为大于1的正整数。
S101-E22、对于R个第二组合中的任一第二组合,确定使用第二组合中的权重导出模式和K个预测模式,对第一分量块进行预测,第二组合对应的代价。
S101-E23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,解码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式和K个预测模式,权重导出模式包括一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式和K个预测模式不完全相同。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合所包括的权重导出模式和K个预测模式对第一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
在一些实施例中,上述S101-E22中确定使用第二组合中的权重导出模式和K个预测模式,对第一分量块进行预测时,该第二组合对应的代价,至少包括如下方式:
方式1,S101-E22包括如下S101-E22-11至S101-E22-14:
S101-E22-11、根据第二组合所包括的权重导出模式,确定第一分量块的权重;
S101-E22-12、根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S101-E22-13、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块预测值;
S101-E22-14、根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定第二组合对应的代价。
本申请实施例中,确定R个第二组合中每个第二组合对应的代价的过程一致,为了便于描述,在此以R个第二组合中的一个第二组合为例进行说明。
本申请实施例中,第二组合包括一个权重导出模式和K个预测模式,在使用该第二组合对第一分量块进行预测时,示例性的,解码端可以根据该第二组合所包括的权重导出模式,确定第一分量块的权重,根据第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,接着,使用第一分量块的权重对第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块预测值。然后,根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定该第二组合对应的代价。
本申请实施例对上述S101-E22-11中根据第二组合所包括的权重导出模式,确定第一分量块的权重的具体方式不做限制。例如,第二组合中的权重导出模式包括过渡参数,因此,可以根据该过渡参数,确定第一分量块的权重。
方式2,S101-E22包括如下S101-E22-11至S101-E22-14:
S101-E22-21、根据第二组合中的权重导出模式,确定第二组合中K个预测模式分别对应的第一分量块的预测值;
S101-E22-22、根据第二组合中K个预测模式分别对应的第一分量块的预测值和第一分量块的重建值,确定第二组合中K个预测模式分别对应的代价;
S101-E22-23、根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。例如,将第二组合中的K个预测模式分别对应的代价之和,确定为第二组合对应的代价。
举例说明,假设K=2,第二组合所包括的2个预测模式分别记为预测模式1和预测模式2,首先,根据该第二组合所包括的权重导出模式,确定预测模式1对应的第一分量块权重和预测值,使用预测模式1对应的第一分量块的权重对预测模式1对应的预测值进行处理,例如针对预测模式1对应的第一分量块中的每一个像素点,将预测模式1对应的第一分量块中的像素点的预测值乘以该像素点对应的第一分量块权重,得到该像素点的预测值。这样,可以确定出该预测模式1对应的第一分量块预测值,接着,根据预测模式1对应的第一分量块预测值和第一分量块重建值,确定出该预测模式1对应的代价,其中,确定该预测模式1对应的代价的方式包括但不限于SAD、SATD、SEE等。同理,可以确定出预测模式2对应的代价。进而根据预测模式1对应的代价和预测模式2对应的代价,确定出第二组合对应的代价,例如,将预测模式1对应的代价和预测模式2对应的代价相加,确定为第二组合对应的代价。
上述S101-E23中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式,可以参照上述S101-A23的描述,在此不再赘述。
下面对上述S101-E21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。
在一些实施例中,S101-E21包括如下步骤:
S101-E21-1、确定C个权重导出模式和D个预测模式,C为正整数,D为大于或等于K的正整数;
S101-E21-2、根据C个权重导出模式和D个预测模式,构建R个第二组合,R个第二组合中的任一第二组合包括C个权重导出模式中的一权重导出模式、D个预测模式中的K个预测模式。
在该实施例中,解码端首先确定C个权重导出模式和D个预测模式,接着,根据确定的C个权重导出模式和D个预测模式,构建R个第二组合。
本申请实施例对上述C个权重导出模式和D个预测模式的具体个数不做限制。
假设K=2,上述K个预测模式包括第一个预测模式和第二个预测模式,假设所有可用的预测模式有D种,第一个预测模式有D种可能,由于第二个预测模式与第一个预测模式不相同,因此第二个预测模式有D-1种,假设权重导出模式有C种,那么本申请可能使用任意两种不同的预测模式以及任意一种权重导出模式和任意一种过度梯度系数组成一个第二组合,总共有C*D*(D-1)种可能的第二组合。
在该实现方式中,C个权重导出模式为所有可能的权重导出模式,权重导出模式包括过渡参数,也就是说,C个权重导出模式包括所有可能的过渡参数,D个预测模式为所有可能的预测模式,使用一种穷举的办法,得到所有可能的第二组合。使用所有可能的第二组合中的每个第二组合对第一分量块进行预测,计算每一个第二组合的失真代价,进而根据每个第二组合的失真代价,得到当前分量块对应的候选组合列表。
在一些实施例中,为了降低数据量,提升候选组合列表的构建速度,则不对每一种预测模式都进行尝试,可以选择其中部分预测模式进行尝试。
此时,上述S101-E21-1中确定D个预测模式的实现方式包括但不限于如下几种方式:
方式一,D个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定D个预测模式。
其中,确定当前分量块的第三候选预测模式列表的方式至少包括如下几种示例:
示例1,根据与当前分量块相邻的至少一个块所使用的预测模式,确定第三候选预测模式列表。
示例2,若第三候选预测模式列表中不包括预设模式时,则确定当前分量块对应的预设模式;将预设模式添加至第三候选预测模式列表中。
在一种示例中,上述预设模式为预设的几个预测模式。
在另一种示例中,通过确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定预设模式。
例如,若当前分量块对应的图像类型为B类型或P类型时,则预设模式包括DC,水平模式、竖直模式和角度模式中的至少一个。
示例3,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定第三候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至 少一个,添加至第三候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至第三候选预测模式列表中。
示例4,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已解码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
本申请实施例中,上述确定D个预测模式的具体实现方式,可以参照上述S101-A21-1中确定Q个预测模式的具体描述,在此不再赘述。在一些实施例中,上述D等于Q。
下面对S101-E21-1中确定C个权重导出模式的过程进行介绍。
在一些实施例中,上述C个权重导出模式为预设的。
在一些实施例中,上述C个权重导出模式为从预设的多个权重导出模式中筛选出的,例如根据当前分量块的大小和/或当前分量块对应的图像类型等信息,进行筛选,得到C个权重导出模式。可选的,还可以根据代价,从预设的多个权重导出模式中选择代价较小的C个权重导出模式。
在一些实施例中,确定X个过渡参数,根据X个过渡参数,确定C个权重导出模式。本申请实施例对X和C之间的大小关系不进行限定。
本申请实施例中,由于C个权重导出模式中每一个权重导出模式均包括一个过渡参数,这样,可以根据X个过渡参数,确定C个权重导出模式。例如,若权重导出模式除了包括过渡参数时,还包括其他的参数,此时,C个权重导出模式中至少一个两个权重导出模式所包括的过渡参数可以相同,也可以不同,进而可以根据X个过渡参数,确定出C个权重导出模式,例如,使用X个过渡参数组成的多个不同的权重导出模式,确定这多个不同的权重导出模式中每个权重导出模式对应的代价,进而选出代价最小的C个权重导出模式。
本申请实施例对上述确定X个过渡参数的具体方式不做限制。
在一些实施例中,上述X个过渡参数为预设的过渡参数,例如为1/4、1/2、1、2、4等。
在一些实施例中,根据当前分量块大的大小,确定X个过渡参数。
例如,若当前分量块的大小小于第三设定阈值时,则将预设的至少一个过渡参数中大于或等于第五值的过渡参数作为X个过渡参数。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则将至少一个过渡参数中小于或等于第六值的过渡参数作为X个过渡参数,所述第六值小于所述第五值。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则将至少一个过渡参数中小于或等于第六值的过渡参数作为X个过渡参数,第六值小于所述第五值。
再例如,若当前分量块的大小小于第三设定阈值时,则确定X过渡参数为预设的至少一个过渡参数位于第五过渡参数取值范围内的一个或多个过渡参数。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则确定X过渡参数为至少一个过渡参数位于第六过渡参数取值范围内的一个或多个过渡参数,第六过渡参数取值范围的最小值小于第五过渡参数取值范围的最小值。
本申请实施例对上述第三设定阈值、第五值、第六值、第五过渡参数取值范围和第六过渡参数取值范围的具体取值不做限制。
可选的,若当前分量块的大小通过当前分量块所包括的像素点数表示时,则上述第三设定阈值为256。
可选的,第五值为1。
可选的,第六值为1/2。
在一些实施例中,确定所述当前分量块的图像信息;根据当前分量块的图像信息,确定出X个过渡参数。
示例1,若当前分量块的图像边缘的清晰度小于预设值,则将预设的Y个过渡参数中的至少一个第三类过渡参数,确定为X个过渡参数,Y为大于X的正整数。
其中,第三类过渡参数可以理解为可以形成较宽过渡区域的过渡参数,例如为1/4、1/2等。
示例2,若当前分量块的图像边缘的清晰度大于或等于预设值,则将Y个过渡参数中的至少一个第四类过渡参数,确定为X个过渡参数,第四类过渡参数大于第三类过渡参数。
其中,第四类过渡参数可以理解为可以形成较窄过渡区域的过渡参数,例如为2、4等。
解码端根据上述步骤,确定出D个预测模式和C个权重导出模式和W个过渡参数后,根据这D个预测模式和C个权重导出模式,组成R个不同的第二组合。接着,根据R个第二组合,确定出候选组合列表,进而从这候选组合列表中,确定出第一权重导出模式和K个第一预测模式。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则解码端对上述确定的D个预测模式、C个权重导出模式次进行筛选,此时,上述S101-E21-2中根据确定出的C个权重导出模式、D个预测模式,组成R个第二组合包括如下S101-E21-21至S101-E21-24的步骤:
S101-E21-21、从C权重导出模式中选出C1个权重导出模式,其中C1为小于或等于C的正整数。
上述S101-E21-21的具体实现过程可以参照上述S101-A11-21的描述,在此不再赘述。
根据上述步骤,解码端从C个权重导出模式中筛选出C1个权重导出模式后,执行如下S101-E21-22的步骤。
S101-E21-22、从D个预测模式中选出D1个预测模式,D1为小于或等于D的正整数。
上述S101-E21-22的具体实现过程可以参照上述S101-A11-22的描述,在此不再赘述。
根据上述步骤,从C个权重导出模式中选出C1个权重导出模式,从D个预测模式中选出D1个预测模式,接着,执行如下S101-E21-23。
S101-C21-23、根据C1个权重导出模式和D1个预测模式,组成R个第二组合。
上述S101-E21-23的具体实现过程可以参照上述S101-A11-23的描述,在此不再赘述。
下面对本申请一实施例中,使用任意一个第二组合对当前分量块对应的第一分量块进行预测,得到第一分量块的预测值的一种实现过程进行介绍。
首先,使用该第二组合所包括的权重导出模式,确定第一分量块的权重。
在一些实施例中,根据权重导出模式确定第一分量块权重包括如下步骤:
步骤3、根据权重导出模式,确定角度索引、距离索引和过渡参数;
步骤4、根据角度索引、距离索引、过渡参数和第一分量块的大小,确定第一分量块的权重。
本申请可以采用与导出预测值的权重相同的方式,导出第一分量块权重。例如,首先根据权重导出模式,确定角度索引、距离索引和过渡参数等参数。
上述步骤2中根据角度索引、距离索引、过渡参数和第一分量块的大小,确定第一分量块权重的方式包括但不限于如下几种方式:
方式一,根据角度索引、距离索引、过渡参数和第一分量块的大小,确定第一分量块权重。此时,上述步骤4包括如下步骤41至步骤43的步骤:
步骤41、根据角度索引、距离索引和第一分量块的大小,确定第一分量块中像素点的第一参数;
步骤42、根据第一分量块中像素点的第一参数和过渡参数,确定第一分量块中像素点的权重;
步骤43、根据第一分量块中像素点的权重,确定第一分量块权重。
本实现方式中,根据角度索引、距离索引、第一分量块的大小和过渡参数,确定第一分量块中像素点的权重,进而将第一分量块中每个点的权重组成的权重矩阵,确定为第一分量块的权重。
本申请的第一参数用于确定权重。
在一些实施例中,第一参数也称为权重索引。
在一种可能的实现方式中,可以根据如下方式确定出偏移量和第一参数:
第一分量块权重导出过程的输入有:第一分量块的宽度nCbW,第一分量块的高度nCbH;GFM的“划分”角度索引变量angleId;GFM的距离索引变量distanceIdx;分量索引变量cIdx,此时以第一分量块为例,因此cIdx为0,表示亮度分量。
其中,变量nW,nH,shift1,offset1,displacementX,displacementY,partFlip还有shiftHor按如下方法导出:
nW=(cIdx==0)?nCbW:nCbW*EubWidthC
nH=(cIdx==0)?nCbH:nCbH*EubHeightC
shift1=Max(5,17-BitDepth)其中BitDepth是编解码的比特深度
offset1=1<<(shift1-1)
displacementX=angleIdx
displacementY=(angleIdx+8)%32
partFlip=(angleIdx>=13&&angleIdx<=27)?0:1
shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&nH>=nW))?0:1
其中,偏移量offsetX and offsetY按如下方法导出:
– 如果shiftHor的值为0:
offsetX=(-nW)>>1
offsetY=((-nH)>>1)+(angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3))
– 否则(即shiftHor的值为1):
offsetX=((-nW)>>1)+(angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
offsetY=(-nH)>>1
第一分量块的权重矩阵wVemplateValue[x][y](其中x=-nVmW..nCbW–1,y=-nVmH..nCbH-1,去除x,y同时大于等于0的情况)注意这个例子里面以第一分量块的左上角坐标为(0,0)按如下方法导出:
– 变量xL和yL按如下方法导出:
xL=(cIdx==0)?x:x*EubWidthC
yL=(cIdx==0)?y:y*EubHeightC
其中disLut按上述表3确定
其中,第一参数weightIdx按如下方法导出:
weightIdx=(((xL+offsetX)<<1)+1)*disLut[displacementX]+(((yL+offsetY)<<1)+1)*disLut[displacementY]
在一些实施例中,根据上述方法,确定出第一参数weightIdx后,接着,使用过渡参数对第一参数进行调整,得到调整后的第一参数。
在一种示例中,通过如下公式对第一参数进行调整:
weightIdx=weightIdx*blendingCoeff
其中,blendingCoeff为过渡参数。
接着,根据调整后的第一参数,确定第一分量块中像素点的权重的方式包括的不限于如下几种:
方式1,根据第一分量块中像素点的调整后的第一参数,确定第一分量块中像素点的第二参数;根据第一分量块中像素点的第二参数,确定第一分量块中像素点的权重。
其中第二参数也用于确定权重。在一些实施例中,上述第二参数也称为第一分量下的权重索引,该第一分量可以为亮度分量、色度分量等。
例如,根据公式,确定出第一分量块中像素点的权重:
weightIdxL=partFlip?32+weightIdx:32-weightIdx
wVemplateValue[x][y]=Clip3(0,8,(weightIdxL+4)>>3)
其中,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,weightIdxL为第一分量块中点(x,y)的第二参数,也称为在第一分量(例如亮度分量)下的权重索引,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,partFlip为中间变量,根据角度索引angleIdx确定,例如上述所述:partFlip=(angleIdx>=13&&angleIdx<=27)?0:1,也就是说,partFlip的值为1或0,当partFlip为0时,weightIdxL为32–weightIdx,当partFlip为1时,weightIdxL为32+weightIdx,需要说明的是,这里的32只是一种示例,本申请不局限于此。
方式2,根据第一分量块中像素点的调整后的第一参数、第一阈值和第二阈值,确定第一分量块中像素点的权重。
为了降低第一分量块权重的计算复杂度,在方式2中将第一分量块中像素点的权重限定为第一阈值或第二阈值,也就是说,第一分量块中像素点的权重要么为第一阈值,要么是第二阈值,进而降低第一分量块权重的计算复杂度。
本申请对第一阈值和第二阈值的具体取值不做限制。
可选的,第一阈值为1。
可选的,第二阈值为0。
在一种示例,可以通过如下公式确定出第一分量块中像素点的权重:
wVemplateValue[x][y]=(partFlip?weightIdx:-weightIdx)>0?1:0
其中,wVemplateValue[x][y]为第一分量块中点(x,y)的权重,上述“1:0”中的1为第一阈值,0为第二阈值。
在上述方式一中,通过权重导出模式确定出第一分量块中每个点的权重,第一分量块中每个点的权重组成的权重矩阵作为第一分量块权重。
根据上述方法,确定出该第二组合所包括权重导出模式对应的第一分量块权重后,确定该第二组合所包括的K个预测模式中每个预测模式对应的代价,进而确定出该第二组合对应的代价。
根据上述方法,可以确定出R个第二组合中每个第二组合的代价。接着,根据R个第二组合中每个第二组合的代价,构建如上述表9所示候选组合列表。
这样解码端根据第一索引,在表9所示的候选组合列表中查询第一索引对应的候选组合,且将该第一索引对应的候选组合确定为第一组合,即将该候选组合所包括的权重导出模式确定为第一权重导出模式,将该候选组合所包括的K个预测模式,确定为K个第一预测模式。
根据情况1、情况2和情况3,解码端确定出第一组合后,执行如下S102的步骤。
S102、根据第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
由上述S102可知,本申请实施例中,第一组合所包括的内容不同,例如,情况1中,第一组合包括第一权重导出模式和K个第一预测模式,但是不包括过渡参数。情况2中,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。情况3中,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括第三过渡参数。本申请实施例,针对第一组合所包括的内容的不同,确定当前分量块的预测值的方法也不相同。
情况1,若第一组合包括第一权重导出模式和K个第一预测模式,且不包括过渡参数时,则上述S102包括的计算过程包括两种如下两种子情况:
情况11,根据第一权重导出模式,确定当前分量块的预测值权重,根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值,使用当前分量块的预测值权重对当前分量块的K个预测值进行加权,得到当前分量块的预测值。其中,根据第一权重导出模式,导出当前分量块的预测值权重的过程,可以参照上述实施例中导出当前块的预测值权重的过程,在此不再赘述。
在该情况11中,在确定当前分量块的预测值权重时,不考虑过渡参数对权重的影响。
在一些实施例中,若第一组合包括第一权重导出模式和K个第一预测模式,且不包括过渡参数时,还包括如下情况22。
情况22,虽然第一组合中包括过渡参数,但是在确定当前分量块的预测值时,考虑过渡参数的考虑,此时,上述S102包括如下S102-A1和S102-A2的步骤:
S102-A1、确定第一过渡参数;
S102-A2、根据第一过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对上述S102-A2的具体实现过程不做限制,例如,第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第一过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,上述S102-A2包括如下步骤:
S102-A21、根据第一过渡参数和第一权重导出模式,确定预测值的权重;
S102-A22、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S102-A23、根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S102-A22和S102-A21在执行顺序上没有先后顺序,即S102-A22可以在S102-A21之前执行,或者在S102-A21之后执行,或者与S102-A21并行执行。
在该情况1中,若第一组组合包括第一权重导出模式和K个第一预测模式,但不包括过渡参数时,则解码端确定第一过渡参数,并根据该第一过渡参数和第一权重导出模式,确定预测值的权重。接着,根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
本申请实施例中,确定第一过渡参数的方式至少包括如下几种:
方式1,解码码流,得到第二索引,该第二索引用于指示第一过渡参数,根据该第二索引,确定第一过渡参数。 具体的,编码端确定出第一过渡参数后,将该第一过渡参数对应的第二索引,写入码流中。接着,解码端通过解码码流,得到第二索引,进而根据该第二索引,确定出第一过渡参数。
在一种示例中,方式1对应的语法如表10所示:
表10
Figure PCTCN2022103734-appb-000006
表10中,gpm_cand_idx表示第一索引,gpm_blending_idx表示第二索引。
在一些实施例中,不同过渡梯度索引对第一分量块的预测结果影响较小,而如果使用简化的方法,即第一分量块上的权重只有0和1,此时,过渡梯度索引无法对第一分量块的预测产生影响,即无法对候选组合列表产生影响,此时可以将过渡梯度索引放到组合外。
本申请实施例中,对根据第二索引,确定第一过渡参数的具体方式不做限制。
在一些实施例中,解码端确定候选过渡参数列表,该候选过渡参数列表中包括多个候选过渡参数,将候选过渡参数列表中,第二索引对应的候选过渡参数,确定为第一过渡参数。
本申请实施例对确定候选过渡参数列表的方式不做限制。
在一种示例中,上述候选过渡参数列表中的候选过渡参数为预设的。
在另一种示例,解码端根据当前分量块的特征信息,从预设的多个过渡参数中,选择至少一个过渡参数组成候选过渡参数列表。例如,根据当前分量块的图像信息,从预设的多个过渡参数中,选择符合当前分量块的图像信息的过渡参数,组成候选过渡参数列表。
举例说明,假设图像信息包括图像边缘的清晰度,则若当前分量块的图像边缘的清晰度小于预设值,则选择预设的多个过渡参数中的至少一个第一类过渡参数,例如1/4、1/2等,组成候选过渡参数列表;若当前分量块的图像边缘的清晰度大于或等于预设值,则选择预设的多个过渡参数中的至少一个第二类过渡参数,例如2、4等,组成候选过渡参数列表。
示例性的,本申请实施例的候选过渡参数列表如表11所示:
表11
索引 候选过渡参数
0 候选过渡参数0
1 候选过渡参数1
…… ……
i 候选过渡参数i
…… ……
如表11所示,候选过渡参数列表包括多个候选过渡参数,每一个候选过渡参数对应一个索引。
示例性的,上述表11中以候选过渡参数在候选过渡参数列表中的排序为索引,可选的,还可以以其他方式体现候选过渡参数在候选过渡参数列表中的索引,本申请实施例对此不作限制。
基于上述表11,解码端根据第二索引,将表11中第二索引对应的候选过渡参数,确定为第一过渡参数。
解码端通过上述方式1,解码码流,得到第二索引,进而根据第二索引,确定第一过渡参数外,还可以根据如下方式2,确定第一过渡参数。
在一些实施例中,解码端还可以通过如下方式2,确定第一过渡参数。
方式2,通过如下S102-A11和S102-A12的步骤,确定第一过渡参数。
S102-A11、确定G个备选过渡参数,G为正整数;
S102-A12、从G个备选过渡参数中,确定第一过渡参数。
在该方式2中,解码端自行确定第一过渡参数,进而避免编码端在码流中编入第二索引,进而节约码字。具体的,解码端首先确定G个备选过渡参数,进而从这G个备选过渡参数中,确定出一个备选过渡参数作为第一过渡参数。
本申请实施例对解码端确定G个备选过渡参数的具体方式不做限制。
在一种可能的实现方式中,上述G个备选过渡参数为预设的,也就是说,解码端和编码端约定将预设的几个过渡参数,确定为G个备选过渡参数。
在另一种可能的实现方式中,上述G个备选过渡参数可以是编码端指示的,例如编码端指示将预设的多个过渡参数中的G个过渡参数,作为G个备选过渡参数。
在另一种可能的实现方式中,块的大小和过渡参数之间有一定的关联性,因而可以利用块的大小和过渡参数之间的关联性提高压缩效率。一种合理的关联性是较小的块更适合比较窄的过渡区域,而较大的块更适合比较宽的过渡区域。基于此,本申请实施例还可以根据当前分量块的大小,确定G个备选过渡参数,例如当前分量块的大小大于某一个预设值时,则可以将较小的过渡参数确定为G个备选过渡参数。再例如,若当前分量块的大小小于或等于某一预设值时,则可以将较大的过渡参数,确定为G个备选过渡参数。
示例性的,块大小可以由块的长度、宽度或像素数来表示。
在另一种可能的实现方式中,确定当前分量块的图像信息;根据当前分量块的图像信息,从预设的多个备选过渡参数中,确定G个备选过渡参数。
示例性的,若图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从预设的多个备选过渡参数中,确定G个备选过渡参数包括如下两种方式:
第一种方式:若当前分量块的图像边缘的清晰度小于预设值,则将预设的多个备选过渡参数中的至少一个第一备 选过渡参数,例如,1/4、1/2等,确定为G个备选过渡参数。
第二种方式:若当前分量块的图像边缘的清晰度大于或等于预设值,则将预设的多个备选过渡参数中的至少一个第二备选过渡参数,例如,2、4等,确定为G个备选过渡参数,其中第二备选过渡参数大于第一备选过渡参数。
解码端确定G个备选过渡参数后,从这G个备选过渡参数中,确定第一过渡参数。
本申请实施例对从这G个备选过渡参数中,确定第一过渡参数的具体方式不做限制。
在一些实施例中,将G个备选过渡参数中的任一备选过渡参数,确定为第一过渡参数。
在一些实施例中,通过如下S102-A121和S102-A122的步骤,从G个备选过渡参数中,确定第一过渡参数:
S102-A121、针对G个备选过渡参数中的第g个备选过渡参数,确定第g个备选过渡参数对应的代价,g为从1到G的正整数;
S102-A122、根据G个备选过渡参数对应的代价,从G个备选过渡参数中,确定第一过渡参数。
在该实施例中,通过确定G个备选过渡参数中每一个备选过渡参数对应的代价,进而根据代价,从这G个备选过渡参数中,确定第一过渡参数。
本申请实施例中,确定G个备选过渡参数中每一个备选过渡参数对应的代价相同,为了便于描述,以第g个备选过渡参数为例进行说明。
本申请实施例对确定第g个备选过渡参数对应的代价的具体方式不做限制。
在一种可能的实现方式中,将第g个备选过渡参数与预设的一个权重导出模式和预设的K个预测模式作为一个组合,确定该组合对第一分量块进行预测时的代价。例如,根据预设的权重导出模式和第g个备选过渡参数,确定第一分量块的权重,根据预设的K个预测模式,确定第一分量块的K个预测值,根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第一分量块的预测值,进而根据第一分量块的预测值和重建值,确定该组合对应的代价,将该组合对应的代价,确定为第g个备选过渡参数对应的代价。
在另一种可能的实现方式中,将第一权重导出模式、第g个备选过渡参数和K个第一预测模式作为一个组合,确定该组合对第一分量块进行预测时的代价。示例性的,S102-A121包括如下步骤:
S102-A1211、根据第一权重模式和第g个备选过渡参数,确定当前分量块对应的第一分量块的权重;
S102-A1212、根据K个第一预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S102-A1213、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第一分量块的预测值;
S102-A1214、根据第一分量块的预测值,确定第g个备选过渡参数对应的代价。
其中,上述S102-A1211中根据第一权重模式和第g个备选过渡参数,确定当前分量块对应的第一分量块的权重的具体过程可以参照上述实施例的描述。
例如,根据第一权重导出模式和第一分量块,确定第一分量块对应的第一权重;使用第g个备选过渡参数,对第一权重进行调整,得到调整后的第一权重;根据调整后的第一权重,确定第一分量块的权重。
参照上述方法,可以确定出G个备选过渡参数中每一个备选过渡参数对应的代价,进而根据代价,从G个备选过渡参数中确定出第一过渡参数。
例如,将G个备选过渡参数中代价最小的备选过渡参数,确定为第一过渡参数。
在一些实施例中,还可以根据如下方式3,确定第一过渡参数。
方式3,根据当前分量块的大小,确定第一过渡参数。
由上述可知,过渡参数与块的大小之间有一定的关联性,因此,本申请实施例还可以根据当前分量块的大小,确定第一过渡参数。
在一种可能的实现方式中,根据当前分量块的大小,将某一固定的过渡参数,确定为第一过渡参数。
例如,若当前分量块的大小小于第一设定阈值时,则确定第一过渡参数为第一值。
再例如,若当前分量块的大小大于或等于第一设定阈值时,则确定第一过渡参数为第二值,其中第二值小于所述第一值。
本申请实施例对上述第一值、第二值和第一设定阈值的具体取值不做限制。
示例性的,第一值为1,第二值为1/2。
示例性的,若当前分量块的大小用当前分量块的像素点数(或采样点数)来表示时,则第一设定阈值可以为256等。
在另一种可能的实现方式中,根据当前分量块的大小,确定第一过渡参数所在的取值范围,进而将第一过渡参数确定为该取值范围内的值。
例如,若当前分量块的大小小于第一设定阈值时,则确定第一过渡参数位于第一过渡参数取值范围内。比如,第一过渡参数为第一过渡参数取值范围内的最小过渡参数、或最大过渡参数、或中间过渡参数等任意一个过渡参数。再比如,第一过渡参数为第一过渡参数取值范围内代价最小的过渡参数。其中,确定过渡参数代价的方法,可以参照本申请其他实施例的描述,在此不再赘述。
再例如,若当前分量块的大小大于或等于第一设定阈值时,则确定第一过渡参数位于该第二过渡参数取值范围内。比如,第一过渡参数为第二过渡参数取值范围内的最小过渡参数、或最大过渡参数、或中间过渡参数等任意一个过渡参数。再比如,第一过渡参数为第二过渡参数取值范围内代价最小的过渡参数。其中,第二过渡参数取值范围的最小值小于第一过渡参数取值范围的最小值,且第一过渡参数取值范围与第二过渡参数取值范围可以相交,也可以不相交,本申请实施例对此不做限制。
在该情况1中,根据上述步骤,确定出第一过渡参数后,执行上述S102-A2的步骤,根据第一过渡参数和第一权重导出模式,确定预测值的权重。
本申请实施例中,根据第一过渡参数和第一权重导出模式,确定预测值的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第一权重导出模式,导出预测值的权重时,需要确定多个中间变量,可以使用第一过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出预测值的权重。
示例2,根据第一权重导出模式和当前分量块,确定当前分量块对应的第二权重;使用第一过渡参数,对第二权重进行调整,得到调整后的第二权重;根据调整后的第二权重,确定预测值的权重。
例如,根据第一权重导出模式和当前分量块,确定当前分量块对应的第二权重为weightIdx,接着,使用第一过渡参数对weightIdx进行调整,得到调整后的weightIdx,接着,根据调整后的weightIdx,确定预测值的权重wVemplateValue。
在一种示例中,可以根据如下公式,使用第一过渡参数对weightIdx进行调整,得到调整后的weightIdx:
weightIdx=weightIdx*blendingCoeff1
其中,blendingCoeff1为第一过渡参数。
再例如,根据第一权重导出模式和当前分量块,确定当前分量块对应的第二权重为wVemplateValue,接着,使用第一过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue,将调整后的wVemplateValue,确定预测值的权重。
在一种示例中,可以根据如下公式,使用第一过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue:
wVemplateValue=wVemplateValue*blendingCoeff1
参照上述方法,解码端可以根据第一过渡参数和第一权重导出模式,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述对情况1中第一组合包括第一权重导出模式和K个第一预测模式,而不包括过渡参数时,确定当前分量块的预测值的过程进行介绍。
下面对情况2对应的当前分量块的预测中的确定过程进行介绍。
情况2,若第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数时,则上述S102包括:根据第二过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对根据第二过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值的具体实现方式不做限制,例如,第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第二过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,可以通过如下S102-B1至S102-B4的步骤,确定出当前分量块的预测值:
S102-B1、根据第一权重导出模式和第二过渡参数,确定预测值的权重;
S102-B2、根据K个第一预测模式,确定K个预测值;
S102-B3、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S102-B4、根据K个预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S102-B1和S102-B2在执行顺序上没有先后顺序,即S102-B1可以在S102-B2之前执行,或者在S102-B1之后执行,或者与S102-B2并行执行。
在该情况2中,若第一组组合包括第一权重导出模式、K个第一预测模式和第二过渡参数时,则解码端根据该第一过渡参数和第一权重导出模式,确定预测值的权重。根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
本申请实施例中,根据第二过渡参数和第一权重导出模式,确定预测值的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第一权重导出模式,导出预测值的权重时,需要确定多个中间变量,可以使用第二过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出预测值的权重。
示例2,根据第一权重导出模式和当前分量块,确定当前分量块对应的第四权重;使用第二过渡参数,对第四权重进行调整,得到调整后的第四权重;根据调整后的第四权重,确定预测值的权重。
例如,根据第一权重导出模式和当前分量块,确定当前分量块对应的第四权重为weightIdx,接着,使用第二过渡参数对weightIdx进行调整,得到调整后的weightIdx,接着,根据调整后的weightIdx,确定预测值的权重wVemplateValue。
在一种示例中,可以根据如下公式,使用第二过渡参数对weightIdx进行调整,得到调整后的weightIdx:
weightIdx=weightIdx*blendingCoeff2
其中,blendingCoeff2为第二过渡参数。
再例如,根据第一权重导出模式和当前分量块,确定当前分量块对应的第四权重为wVemplateValue,接着,使用第二过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue,将调整后的wVemplateValue,确定预测值的权重。
在一种示例中,可以根据如下公式,使用第二过渡参数对wVemplateValue进行调整,得到调整后的wVemplateValue:
wVemplateValue=wVemplateValue*blendingCoeff2
参照上述方法,解码端可以根据第二过渡参数和第一权重导出模式,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
在一些实施例中,上述预测过程是以像素点为单位进行的,对应的上述预测值的权重也为像素点对应的权重。此时,对当前分量块进行预测时,使用K个第一预测模式中的每个预测模式对当前分量块中的某一个像素点A进行预 测,得到K个第一预测模式关于像素点A的K个预测值,根据第一权重导出模式和过渡参数确定像素点A的预测值的权重。接着,使用像素点A的预测值的权重对这K个预测值进行加权,得到像素点A的预测值。对当前分量块中的每一个像素点执行上述步骤,可以得到当前分量块中每个像素点的预测值,当前分量块中每个像素点的预测值构成当前分量块的预测值。以K=2为例,使用第一个预测模式对当前分量块中的某一个像素点A进行预测,得到该像素点A的第一预测值,使用第二个预测模式对该像素点A进行预测,得到该像素点A的第二预测值,根据像素点A对应的预测值权重,对第一预测值和第二预测值进行加权,得到像素点A的预测值。
在一种示例中,以K=2为例,若第一个预测模式和第二个预测模式均为帧内预测模式时,采用第一帧内预测模式进行预测,得到第一预测值,采用第二帧内预测模式进行预测,得到第二预测值,根据预测值的权重对第一预测值和第二预测值进行加权,得到当前分量块的预测值。例如,采用第一帧内预测模式对像素点A进行预测,得到像素点A的第一预测值,采用第二帧内预测模式对像素点A进行预测,得到像素点A的第二预测值,根据像素点A对应的预测值的权重,对第一预测值和第二预测值进行加权,得到像素点A的预测值。
上述对情况2中第一组合包括第一权重导出模式、K个第一预测模式和一个过渡参数时,确定当前分量块的预测值的过程进行介绍。
下面对情况3对应的当前分量块的预测中的确定过程进行介绍。
情况3,若第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括第三过渡参数时,则上述S102包括:根据第三过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对第三过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值的具体实现方式不做限制,例如,若第一权重导出模式还包括其他参数时,则根据第一权重导出模式中的其他参数和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第三过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,可以通过如下S102-C1至S102-C4的步骤,确定出当前分量块的预测值:
S102-C1、根据第一权重导出模式,确定预测值的权重;
S102-C2、根据K个第一预测模式,确定K个预测值;
S102-C3、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S102-C4、根据K个预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S102-C1和S102-C2在执行顺序上没有先后顺序,即S102-C1可以在S102-C2之前执行,或者在S102-B1之后执行,或者与S102-C2并行执行。
在该情况3中,若第一组组合包括第一权重导出模式和K个第一预测模式时,则解码端根据第一权重导出模式,确定预测值的权重。根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
本申请实施例中,根据第一权重导出模式,确定预测值的权重的方式不做限制。例如,根据第一权重导出模式,确定角度索引、距离索引和第三过渡参数,根据角度索引、距离索引、第三过渡参数和当前分量块的大小,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
本申请实施例中,可以根据上述情况1、情况2和情况3中的任意一种方式,确定出当前分量块的预测值。
在一些实施例中,若K个第一预测模式中的第j个预测模式为帧间预测模式,则上述S102根据所述K个第一预测模式以及第一权重导出模式,确定当前分量块的预测值包括如下步骤:
S102-D1、根据第j个预测模式,确定运动信息;
S102-D2、根据运动信息,确定第j个预测值;
S102-D3、根据K个第一预测模式中除第j个预测模式外的其他预测模式,确定K-1个预测值;
S102-D4、根据第一权重导出模式,确定K个预测值的权重;
S102-D5、根据第j个预测值、K-1个预测值和预测值的权重,确定当前分量块的预测值。
以K=2为例,若第一个预测模式为帧内预测模式,第二个预测模式为帧间预测模式时,采用帧内预测模式进行预测,得到第一预测值,采用帧间预测模式进行预测,得到第二预测值,根据预测值的权重对第一预测值和第二预测值进行加权,得到当前分量块的预测值。在该示例中,采用帧内预测模式对当前分量块中每一个点进行预测,得到当前分量块中每一个点的预测值,当前分量块中每一个点的预测值,构成当前分量块的第一预测值。采用帧间预测模式,确定一运动信息,根据该运动信息确定当前分量块的最佳匹配块,将该最佳匹配块确定为当前分量块的第二预测值。针对当前分量块中每个像素点的预测值的权重,对当前分量块的第一预测值和第二预测值进行逐点加权运算,得到当前分量块的预测值。例如,对于当前分量块中的像素点A,根据像素点A的预测值的权重,将当前分量块的第一预测值中像素点A对应的第一预测值,与当前分量块的第二预测值中像素点A对应的第二预测值进行加权,得到像素点A的预测值。
在一些实施例中,若K大于2时,则可以根据第一权重导出模式确定K个第一预测模式中两个预测模式对应的预测值的权重,K个第一预测模式中的其他预测模式对应的预测值的权重可以为预设值。例如,K=3,第一个预测模式和第二个预测模式对应的预测值的第一权重根据权重导出模式导出,第三个预测模式对应的预测值的权重为预设值。在一些实施例中,若K个第一预测模式对应的总预测值的权重一定,例如为8,则可以根据预设权重比例,来确定K个第一预测模式各自对应的预测值的权重,假设第三个预测模式对应的预测值的权重占整个中预测值的权重的1/4,则可以确定第三个预测模式的预测值的权重为2,总预测值权重中的剩下3/4分配给第一个预测模式和第二个预测模式。示例性的,如果根据第一权重导出模式导出第一个预测模式对应的预测值的权重3,则确定第一个预测模式对应的预测值的权重为(3/4)*3,第二个预测模式对应的预测值的权重为第一个预测模式的预测值的权重为(3/4)*5。
根据上述方法,确定出当前分量块的预测值,同时,解码码流,得到当前分量块的量化系数,对当前分量块的量化系数进行反量化和反变换,得到当前分量块的残差值,将当前分量块的预测值和残差值进行相加,得到当前分量块的重建值。
由上述可知,本申请实施例的候选组合列表中各候选组合,按照代价从小到的顺序进行排序,其中代价小的候选组合被选中的概率大。基于此,为了进一步降低编码代价,则对于候选组合列表中排在前面一些位次的候选组合使用更短的码字进行编码,对于候选组合列表中排在后面一些位次的候选组合使用更长的码字进行编码,使得整体编码效率提升。
在一些实施例中,第一索引通过变长编码方式编入码流,例如,采用哥伦布编码方式进行编码。
在一些实施例中,若上述候选组合列表所包括的候选组合数量小于第四预设阈值时,则第一索引采用定长编码方式编入码流。即本申请实施例中,若候选组合列表所包括的候选组合数量较少时,各候选组合统一使用预设比特长度进行编码,本申请实施例对第四预设阈值的具体取值不做限制,例如第四预设阈值=16。
在一些实施例中,第二索引通过变长编码方式编入码流,例如,采用哥伦布编码方式进行编码。
在一些实施例中,若上述候选过渡参数列表所包括的候选过渡参数数量小于某一预设阈值时,则第二索引采用定长编码方式编入码流。即本申请实施例中,若候选过渡参数列表所包括的候选过渡参数数量较少时,各候选过渡参数统一使用预设比特长度进行编码。
在一些实施例中,可以使用一个高层语法(high level syntax)控制本申请实施例提供的组合编码技术方案的开关,例如可以通过至少一个标志来指示当前分量块是否允许采用本申请实施例提供的组合编码技术方案,即是否允许使用第一组合进行解码。
在一种可能的实现方式中,设置的至少一个标志可以是不同级别的标志,用于指示对应级别是否允许采用本申请实施例提供的组合编码技术方案。
可选的,上述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
例如,上述至少一个标志包括序列级标志,该序列级标志用于指示当前序列是否允许采用本申请实施提供的组合编码技术方案。
示例性的,在参数集(sequence parameter set)中增加语法元素sps_cgpm_enabled_flag。其中cgpm可以认为是combined geometric partitioning mode的缩写。如果sps_cgpm_enabled_flag的值为1,表示当前序列允许使用本申请的技术方案,如果sps_cgpm_enabled_flag的值为0,表示当前序列不允许使用本申请的技术方案。
本申请实施例提供的技术方案如果使用在帧间模式中,因为帧间模式已经存在sps_gpm_enbled_flag,那么也可以由sps_gpm_enbled_flag来控制本方案。因为本方案也可以用在帧内模式中,帧内也可以和帧间一起使用sps_cgpm_enabled_flag或sps_gpm_enabled_flag,当然也可以为了更好的灵活性,对帧内模式和帧间模式使用不同的flag,比如设置一个sps_sgpm_enabled_flag。其中sgpm可以认为是spatial geometric partitioning mode的缩写。sps_sgpm_enabled_flag控制帧内模式是否允许使用本方案,而sps_cgpm_enabled_flag或sps_gpm_enabled_flag控制帧间模式是否允许使用本方案。
再例如,上述至少一个标志包括图像级标志,该图像级标志用于指示当前图像是否允许使用本申请的技术方案。
可选的,若至少一个标志包括图像级标志时,该图像级标志可以位于图像头(picture header)中。
再例如,上述至少一个标志包括片级标志,该片级标志用于指示当前片(slice)是否允许使用本申请的技术方案。
可选的,若至少一个标志包括片级标志时,该片级标志可以位于片头(slice header)中。
再例如,上述至少一个标志包括单元级标志,该单元级标志用于指示当前CTU是否允许使用本申请的技术方案。
再例如,上述至少一个标志包括块(CU)级标志,该块级标志用于指示当前分量块是否允许使用本申请的技术方案。
以帧内为例,假设块级标志为cu_cgpm_flag。如果cu_cgpm_flag的值为1,表示当前分量块允许使用本申请的技术方案,如果cu_cgpm_flag的值为0,表示当前分量块不允许使用本申请的技术方案。目前VVC中的GPM用在帧间的合并(merge)模式,它是通过推导得出来的,当然以后也可能直接用CU级的flag表示,这里不做限制。
这样,解码端首先解码码流,得到上述至少一个标志,根据这至少一个标志,判断当前分量块是否允许使用本申请的技术方案。若根据上述至少一个标志,确定当前分量块不允许使用本申请的技术方案时,则跳过本申请实施例的方法。若根据上述至少一个标志,确定当前分量块允许使用本申请的技术方案术,则执行本申请实施例的方法,即解码码流,得到第一索引。
在一些实施例中,若上述至少一个标志包括块级标志时,则上述解码端在确定当前分量块的大小满足预设条件时,解码码流,确定块级标志。本申请实施例对上述预设条件不做限制。
在一些实施例中,若确定当前分量块不采用第一技术进行解码时,则解码码流,得到第一索引。也就是说,本申请实施例中,出于性能和复杂度之间的考虑,可以设置本申请实施例提出的组合编码技术不与第一技术在同一个块里共用,第一技术可以是MRL(Multiple reference line),ISP(Intra sub-partitions)等。即在解析码流确定当前分量块使用本申请提出的组合编码技术时,不需要再解析MRL的标志(如VVC中的intra_luma_ref_idx)和/或ISP的标志(如VVC中的intra_subpartitions_mode_flag),默认它们为0。或者当MRL的标志(如VVC中的intra_luma_ref_idx)和/或ISP的标志(如VVC中的intra_subpartitions_mode_flag)为1时不需要再解析本申请实施涉及的上述至少一个标志,例如不解析块级标志cu_cgpm_enabled_flag,默认它为0。
本申请实施例提供的视频解码方法,通过解码码流,确定第一组合,第一组合包括第一权重导出模式和K个第一预测模式,K为大于1的正整数;根据第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。即本申请将第一权重导出模式和K个第一预测模式作为一个组合,以组合的形式指示第一权重导出模式 和K个第一预测模式,这样在码流中不需要单独传输K个第一预测模式和第一权重导出模式分别对应的语法,进而节省码字,提升编码效率。另外,本申请实施例,在当前分量块对应多个第一分量CU,且多个第一分量CU的预测模式不完全相同时,也可以准确确定出第一组合所包括的第一权重导出模式和K个第一预测模式,进而使用该第一权重导出模式和K个第一预测模式,实现当前分量块的准确预测。在一些实施例中,本申请实施例通过第一过渡参数或第二过渡参数对预测值的权重进行调整,使用调整后的预测值权重进行预测,进而提高了预测准确性。
上文以解码端为例对本申请的预测方法进行介绍,下面以编码端为例进行说明。
图20为本申请实一施例提供的预测方法流程示意图,本申请实施例应用于图1和图2所示视频编码器。如图20所示,本申请实施例的方法包括:
S201、确定第一组合。
其中,第一组合包括第一权重导出模式和K个第一预测模式。
基于上述描述,一个权重导出模式和K个预测模式可以作为一个组合共同作用在当前分量块上,为了节省码字,降低编码代价,本申请实施例将当前分量块对应的权重导出模式和K个预测模式作为一个组合,即第一组合,使用第一索引对该第一组合进行指示,相比于对权重导出模式和K个预测模式分别进行指示,本申请实施例使用更少的码字,进而降低了编码代价。
具体的,编码端确定当前分量块对应的第一组合,该第一组合包括一个权重导出模式和K个预测模式,为了便于描述,将第一组合所包括的权重导出模式记为第一权重导出模式,将第一组合所包括的K个预测模式确定为K个第一预测模式。编码端使用该第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值,例如,使用第一权重导出模式导出权重,使用K个预测模式分别对当前分量块进行预测得到K个预测值,根据导出的权重对这K个预测值进行加权运算,得到当前分量块的预测值。
在一些实施例中,编码端在确定第一组合之前,首先需要判断当前分量块是否使用K个不同的预测模式进行加权预测处理。若编码端确定当前分量块使用K个不同的预测模式进行加权预测处理时,则执行上述S201确定第一组合。若编码端确定当前分量块不使用K个不同的预测模式进行加权预测处理时,则跳过上述S201的步骤。
在一种可能的实现方式中,编码端可以通过确定当前分量块的预测模式参数,来确定当前分量块是否使用K个不同的预测模式进行加权预测处理。
可选的,在本申请的实施中,预测模式参数可以指示当前分量块是否可以使用GPM模式或AWP模式,即指示当前分量块是否可以使用K个不同的预测模式进行预测处理。
可以理解的是,在本申请的实施例中,可以将预测模式参数理解为一个表明是否使用了GPM模式或AWP模式标志位。具体地,编码器可以使用一个变量作为预测模式参数,从而可以通过对该变量的取值的设置来实现预测模式参数的设置。示例性的,在本申请中,如果当前分量块使用GPM模式或AWP模式,那么编码器可以将预测模式参数的取值设置为指示当前分量块使用GPM模式或AWP模式,具体地,编码器可以将变量的取值设置为1。示例性的,在本申请中,如果当前分量块不使用GPM模式或AWP模式,那么编码器可以将预测模式参数的取值设置为指示当前分量块不使用GPM模式或AWP模式,具体地,编码器可以将变量取值设置为0。进一步地,在本申请的实施例中,编码器在完成对预测模式参数的设置之后,便可以将预测模式参数写入码流中,传输至解码器,从而可以使解码器在解析码流之后获得预测模式参数。
在一些实施例中,如表5所示,本申请实施例还可以对当前分量块使用GPM模式或AWP模式进行条件限定,即在判断当前分量块在满足预设条件时,确定当前分量块使用K个预测模式进行加权预测,进而确定第一组合。
示例性的,在应用GPM模式或AWP模式时,可以对当前分量块的尺寸进行限制。
可以理解的是,由于本申请实施例提出的预测方法需要分别使用K个不同的预测模式生成K个预测值,再根据权重进行加权得到当前分量块的预测值,为了降低的复杂度,同时考虑压缩性能和复杂度的权衡,在本申请的实施例中,可以限制对一些大小的块不使用该GPM模式或AWP模式。因此,在本申请中,编码端可以先确定当前分量块的尺寸参数,然后根据尺寸参数确定当前分量块是否使用GPM模式或AWP模式。
在本申请的实施例中,当前分量块的尺寸参数可以包括当前分量块的高度和宽度,因此,编码器可以根据当前分量块的高度和宽度确定当前分量块是否使用GPM模式或AWP模式。
示例性的,在本申请中,若宽度大于第一阈值且高度大于第二阈值,则确定当前分量块可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的宽度大于(或大于等于)第一阈值,且块的高度大于(或大于等于)第二阈值的情况下使用GPM模式或AWP模式。其中,第一阈值和第二阈值的值可以是4、8,16,32、128、256等,第一阈值可以等于第二阈值。
示例性的,在本申请中,若宽度小于第三阈值且高度大于第四阈值,则确定当前分量块可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的宽度小于(或小于等于)第三阈值,且块的高度大于(或大于等于)第四阈值的情况下使用GPM模式或AWP模式。其中,第三阈值和第四阈值的值可以是4、8,16,32、128、256等,第三阈值可以等于第四阈值。
进一步地,在本申请的实施例中,还可以通过像素参数的限制来实现限制能够使用GPM模式或AWP模式的块的尺寸。
示例性的,在本申请中,编码器可以先确定当前分量块的像素参数,然后再根据像素参数和第五阈值进一步判断当前分量块是否可以使用GPM模式或AWP模式。可见,一种可能的限制是仅仅在块的像素数大于(或大于等于)第五阈值的情况下使用GPM模式或AWP模式。其中,第五阈值的值可以是4、8,16,32、128、256、1024等。
也就是说,在本申请中,在当前分量块的尺寸参数满足大小要求的条件下,当前分量块才可以使用GPM模式或AWP模式。
示例性的,在本申请中,可以有一个帧级的标志来确定当前待编码帧是否使用本申请。如可以配置帧内帧(如I 帧)使用本申请,帧间帧(如B帧、P帧)不使用本申请。或者可以配置帧内帧不使用本申请,帧间帧使用本申请。或者可以配置某些帧间帧使用本申请,某些帧间帧不使用本申请。帧间帧也可以使用帧内预测,因而帧间帧也有可能使用本申请。
在一些实施例中,还可以有一个帧级以下、CU级以上(如tile、slice、patch、LCU等)的标志来确定这一区域是否使用本申请的技术方案。
本申请实施例中,第一组合包括第一权重导出模式和K个第一预测模式。
其中,第一权重导出模式用于对当前分量块使用的权重进行确定。具体地,第一权重导出模式可以是导出权重的模式。对于一个给定长度和宽度的块,每一种权重导出模式可以导出一个权重矩阵;对于同样大小的块,不同权重导出模式导出的权重矩阵不同。
示例性的,在本申请中,AWP有56种权重导出模式,GPM有64种权重导出模式。
上述第一组合所包括的K个不同的第一预测模式包括如下几种示例:
示例1,上述K个不同的第一预测模式均为帧内预测模式,例如当前分量块是帧内编码的块,且不适用屏幕内容编码。
示例2,上述K个不同的第一预测模式均为帧间预测模式,例如当前分量块为帧间编码的块。
示例3,上述K个不同的第一预测模式中,至少一个为帧内预测模式,至少一个为帧间预测模式。
示例4,上述K个不同的第一预测模式中,至少一个为帧内预测模式,至少一个为非帧间和非帧内的预测模式,例如为块内复制IBC预测模式或调色板palette预测模式等。
示例5,上述K个不同的第一预测模式中,至少一个为帧间预测模式,至少一个为非帧间和非帧内的预测模式,例如为IBC预测模式或palette预测模式等。
示例6,上述K个不同的第一预测模式均不是帧内预测模式,也不是帧间预测模式,例如一个为IBC预测模式,一个为palette预测模式等。
需要说明的是,本申请实施例对第一组合所包括的K个不同的第一预测模式的具体类型不做限制。
本申请实施例中,在一种情况下,第一组合包括第一权重导出模式和K个第一预测模式。在另一种情况下,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数,其中第二过渡参数用于对第一权重导出模式确定的权重进行调整,得到调整后的权重,这样,可以通过K个第一预测模式,确定出K个预测值,使用调整后的权重对K个预测值进行加权处理,得到当前分量块的预测值。
下面对第一组合包括不同内容时,确定第一组合的过程进行介绍。
情况1,第一组合包括第一权重导出模式和K个第一预测模式时,则编码端确定第一组合的方式包括但不限于如下几种:
方式1,第一组合为预设组合。
方式2,编码端确定一个列表,该列表中包括多个候选组合,因此将该列表也称为候选组合列表,从这个候选组合列表中确定第一组合。此时,上述S201包括如下步骤:
S201-A、确定候选组合列表;
S201-B、从候选组合列表中,确定出第一组合。
其中,上述候选组合列表中包括至少一个候选组合,至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式。
示例性的,候选组合列表如上述表5所示。
如表5所示,候选组合列表包括至少一个候选组合,这至少一个候选组合中任意两个候选组合不完全相同,即任意两个候选组合所包括的权重导出模式和K个预测模式中的至少一个模式不同。例如,候选组合1和候选组合2中的权重导出模式不同,或者候选组合1和候选组合2中的权重导出模式相同,K个预测模式中至少一个预测模式不同,或者,候选组合1和候选组合2中的权重导出模式不同,且K个预测模式中至少一个预测模式不同。
示例性的,上述表5中以候选组合在候选组合列表中的排序为索引,可选的,还可以以其他方式体现候选组合在候选组合列表中的索引,本申请实施例对此不作限制。
在该方式2中,编码端将候选组合列表中的一个候选组合确定为第一组合。
例如,编码端将候选组合列表中的第一个候选组合确定为第一组合。
在该方式2中,编码端和解码端可以分别确定相同的候选组合列表,例如编码端和解码端均确定一个包括N个候选组合的列表,每个候选组合包括1个权重导出模式和K个预测模式。而在码流中,编码端只需要写入最终选择的一个候选组合,例如第一组合,解码端解析编码端最终选择的第一组合,例如解码端解码码流,得到第一索引,并通过第一索引在解码端所确定的候选组合列表中,确定出第一组合。
本申请实施例对编码端确定上述候选组合列表的具体方式不做限制。
在一些实施例中,上述候选组合列表为已有的,编码端在确定当前分量块可以使用K个预测模式进行加权预测时,获取该候选组合列表。
在一些实施例中,上述候选组合列表为编码端构建的。此时,在一些实施例中,编码端可以将构建的候选组合列表发送给解码端的。在一些实施例中,编码端将上述构建的候选组合列表上传至云端,解码端从云端读取该候选组合列表。
下面对对编码端构建候选组合列表的过程进行介绍。
本申请实施例对编码端构建候选组合列表的方式不做限制。
在一些实施例中,编码端通过如下S201-A1的步骤,构建候选组合列表:
S201-A1、确定当前分量块对应的第一分量块;
S201-A2、基于第一分量块,构建候选组合列表。
如图17F所示,假设当前分量块为右侧的灰色分量块,与该灰色分量块同一空间的第一分量块为图17F中左侧的灰色区域,而该左侧的灰色区域包括10个第一分量CU。
由上述图17F可知,与当前分量块处于同一空间的第一分量块指,与当前分量块位于相同的空间位置,具有相同的空间大小的第一分量块。以当前分量块为色度块,第一分量块为亮度块为例,由于视频格式的不同,色度块和亮度块的大小可能不同,例如,对于YUV4:4:4格式的视频,色度块的大小和亮度块的大小相同,对于YUV4:2:0格式的视频,亮度块的大小是色度块大小的4倍。
由于色度块的大小与亮度块的大小可能不同,因此,相同空间位置和相同空间大小的色度块和亮度块有可能不是相同坐标。例如,视频格式YUV4:2:0,色度块是由左上角坐标为(x0,y0),宽度为width,高度为height确定的块,则同一空间的亮度块可以是左上角坐标为(x0*2,y0*2),宽度为width*2,高度为height*2确定的块。再例如,视频格式YUV4:4:4,色度块是由左上角坐标为(x0,y0),宽度为width,高度为height确定的块,则同一空间的亮度块可以是左上角坐标为(x0,y0),宽度为width,高度为height确定的块。
另外,在一些实施例中,由于色度块和亮度块采用独立的块划分,因此,色度解码块对应的亮度块,有可能与亮度分量已经划分得到的解码块不相重合,而是在空间位置、空间大小与色度解码块对应的亮度区域。也就是说,本申请实施例中,当前分量块对应的第一分量块可以理解为空间覆盖范围与当前分量块相同的第一分量块。
在编码时,通常先对亮度分量进行编码,再对色度分量进行编码。因此,本申请实施例,在对当前分量块进行编码时,首先编码码流,对当前分量块对应的第一分量块进行编码,得到第一分量块的重建值。进而将第一分量块作为当前分量块的模板,对当前分量块进行编码。
由于当前分量块对应的第一分量块与当前分量块具有相关性,基于此本申请实施例基于第一分量块来构建当前分量块的候选组合列表。
例如,针对每个组合,使用该组合对第一分量块进行预测,得到每个组合下该第一分量块的预测值,根据每个组合下该第一分量块的预测值,构建候选组合列表。例如,使用该组合所包括的权重导出模式导出第一分量块的权重,使用该组合所包括的K个预测模式分别对第一分量块进行预测,得到第一分量块的K个预测值,根据导出的第一分量块的权重,对第一分量块的K个预测值进行加权处理,得到该组合下第一分量块的预测值。最后,根据每个组合下该第一分量块的预测值,构建候选组合列表。
需要说明的是,上述根据权重导出模式导出的权重可以理解为导出第一分量块中每一个像素点对应的权重,也可以理解为导出第一分量块对应的权重矩阵。其中,基于权重确定第一分量块的预测值时,可以是确定第一分量块中每一个像素点对应的K个预测值,并根据每一个像素点对应的K个预测值和权重,确定出每个像素点对应的预测值,第一分量块中每一个像素点对应的预测值构成第一分量块的预测值。可选的,基于权重确定第一分量块的预测值时,还可以是按照块来执行,例如,确定第一分量块的预测值,根据第一分量块的权重矩阵对第一分量块的K个预测值进行加权,得到第一分量块的预测值。
在一些实施例中,S201-A2包括如下S201-A21至S201-A23的步骤:
S201-A21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,R为大于1的正整数;
S201-A22、对于R个第二组合中的任一第二组合,确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价;
S201-A23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,编码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式和K个预测模式,且R个第二组合中任意两个组合所包括的权重导出模式和K个预测模式不完全相同。接着,对于R个第二组合中的每一个第二组合,使用该第二组合所包括的权重导出模式和K个预测模式对当前分量块对应的第一分量块进行预测,得到该第二组合下该第一分量块的预测值。最后,根据R个第二组合中每个第二组合对应的第一分量块预测值,构建候选组合列表。
上述S201-A23中根据R个第二组合中各第二组合对应的第一分量块预测值,构建候选组合列表的方式包括但不限于如下几种:
方式1,根据R个第二组合中每个第二组合对应的第一分量块预测值的大小,构建候选组合列表。
例如,根据R个第二组合中每个第二组合对应的第一分量块预测值的大小,对R个第二组合进行排序,将排序后的R个第二组合确定为候选组合列表,此时,候选组合列表中包括R个候选组合。
再例如,根据R个第二组合中每个第二组合对应的第一分量块预测值的大小,对R个第二组合进行排序,从排序后的R个第二组合中,选出N个第二组合构成候选组合列表,此时候选组合列表中包括N个候选组合。
方式2,上述S201-A23包括如下步骤:
S201-A23-1、根据第二组合对应的第一分量块的预测值和第一分量块的重建值,确定第二组合对应的代价;
S201-A23-2、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,编码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式和K个预测模式。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
由于当前分量块对应的第一分量块为已重建区域,因此,编码端可以得到第一分量块的重建值,这样对于R个第二组合中的每个第二组合,可以根据该第二组合下第一分量块的预测值和第一分量块的重建值,确定出该第二组合对应的预测失真代价。其中,确定第二组合对应的代价的方式包括但不限于SAD、SATD、SEE等。接着,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
本申请实施例中,S201-A22中确定使用该第二组合对第一分量块进行预测时,该第二组合对应的代价至少包括两种方式:
第一种方式,根据第二组合所包括的权重导出模式,确定第一分量块的权重;根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块的预测值;根据第二组合对应的第一分量块的预测值和第一分量块的重建值,确定第二组合对应的代价。
第二种方式,根据第二组合中的权重导出模式,确定第二组合中K个预测模式分别对应的第一分量块的预测值;根据第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定第二组合中K个预测模式分别对应的代价;根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。
根据上述方法,可以确定出R个第二组合中各第二组合对应的代价,接着执行S201-A13-2。
其中,S201-A23-2中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式包括但不限于如下几种示例:
示例1,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序;将排序后的R个第二组合,确定为候选组合列表。
在该示例1中生成的候选组合列表包括R个候选组合。
可选的,该候选组合列表中R个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中R个候选组合对应的代价按照排序依次增大。
其中,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序可以是,按照代价从小到大顺序,对R个第二组合进行排序。
示例2,根据第二组合对应的代价,从R个第二组合中选出N个第二组合,将这N个第二组合组成的列表,确定为候选组合列表。
可选的,上述N个第二组合为R个第二组合中代价最小的前N个第二组合,例如根据R个第二组合中每个第二组合对应的代价,从R个第二组合中选出代价最小的N个第二组合,构成候选组合列表,此时,候选组合列表包括N个候选组合。
可选的,该候选组合列表中N个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中N个候选组合对应的代价按照排序依次增大。
下面对上述S201-A21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。这样使用预设的R个第二组合中的每个第二组合对第一分量块进行预测,得到每个第二组合对应的第一分量块预测值,再根据每个第二组合对应的第一分量块预测值和第一分量块的重建值,确定每个第二组合对应的代价,根据每个第二组合对应的代价,对R个第二组合进行排序,将排序后的R个第二组合作为候选组合列表,或者从排序后的R个第二组合中选出代价最小的N个第二组合构成候选组合列表。
在一些实施例中,S201-A21包括如下步骤:
S201-A21-1、确定P个权重导出模式和Q个预测模式,P为正整数,Q为大于或等于K的正整数;
S201-A21-2、根据P个权重导出模式和Q个预测模式,构建R个第二组合,R个第二组合中的任一第二组合包括P个权重导出模式中的一权重导出模式和Q个预测模式中的K个预测模式,P均为正整数,Q为大于或等于K的正整数。
在该实施例中,编码端首先确定P个权重导出模式和Q个预测模式,接着,根据确定的P个权重导出模式和Q个预测模式,构建R个第二组合。
本申请实施例对上述P个权重导出模式和Q个预测模式的具体个数不做限制。
在一种可能的实现方式中,假设当前分量块为帧内编码块,这里假设GPM的可能的权重导出模式有64种,GPM可能的帧内预测模式有67种,这些可以从VVC的标准中找到。但是并不是限制GPM的可能的权重只有64种,或者是哪64种,需要说明的是,之所以VVC的GPM选择64种也是一个预测效果提升和在码流中的开销提升的一种权衡方案。而本申请不再使用一种固定的逻辑去编码权重导出模式,所以理论上本申请可以使用更多样的权重,以及更灵活地使用它们。同样,并不是限制GPM的帧内预测模式只有67种,或者是哪67种。理论上所有可能的帧内预测模式都可以用在GPM中。比如说帧内角度预测模式做得更加细致,产生更多的帧内角度预测模式,那么GPM也可以使用更多的帧内角度预测模式。比如说VVC的MIP(matrix-based intra prediction)模式,本申请也可以使用,但是考虑到MIP还有多种子模式可以选择,这里为了便于理解就不把MIP加入到本实施例中。另外还有一些宽角度模式,本申请也可以使用,本实施例不再加以描述。
在一些实施例中,为了降低数据量,提升候选组合列表的构建速度,则不对每一种预测模式都进行尝试,可以选择其中部分预测模式进行尝试。
此时,上述S201-A21-1中确定Q个预测模式的实现方式包括但不限于如下几种方式:
方式一,Q个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定Q个预测模式。
其中,候选预测模式列表包括多个候选预测模式,K个预测模式中任一预测模式对应的备选预测模式列表包括至少一个备选预测模式。
其中,确定K个第一预测模式分别对应的备选预测模式列表可以理解为,为K个第一预测模式中每个第一预测模式确定一个备选预测模式列表,在后续构建第二组合时,第二组合中的某一个预测模式从该预测模式对应的备选预 测模式列表中选出。例如K=2,K个第一预测模式包括第一个预测模式和第二个预测模式,编码端为第一个预测模式构建一个备选预测模式列表1,为第二个预测模式构建一个备选预测模式列表2。这样在后期构建不同的第二组合时,从备选预测模式列表1中选出一个备选预测模式作为第一个预测模式,从备选预测模式列表2中选出一个备选预测模式作为第二个预测模式,这样一个权重导出模式,以及当前选出的第一个预测模式和第二个预测模式组成一个第二组合。
本申请实施例对确定K个第一预测模式中每个预测模式对应的备选预测模式列表的方式不做限制。
在一种可能的实现方式中,针对K个第一预测模式中的任一预测模式,确定该预测模式对应的候选预测模式列表,以及权重导出模式对应的预测模式中的至少一个;根据该候选预测模式列表和权重导出模式对应的预测模式中的至少一个,确定该预测模式对应的备选预测模式列表。
本申请实施例中,确定K个第一预测模式中某一个预测模式对应的候选预测模式列表,与确定当前分量块对应的候选预测模式列表的过程基本相似,具体可以参照下面描述。
在一些实施例中,上述候选预测模式列表中包括一个或多个帧间预测模式,例如包括skip、merge、普通帧间预测模式、单向预测、双向预测、多假设预测等中的至少一个。
在一些实施例中,上述候选预测模式列表中包括一个或多个帧内预测模式,例如包括直流(Direct Current,DC)模式、平面(PLANAR)模式、角度模式等中的至少一个。可选的,上述候选预测模式列表包括MPM列表中的至少一个帧内预测模式。
在一些实施例中,上述候选预测模式列表还可以包括IBC、palette等模式。
本申请对上述候选预测模式列表所包括的预测模式的类型以及预测模式的个数不做限制。
在一些实施例中,候选预测模式列表通过如下至少一种方式确定:
方式1,上述上述候选预测模式列表包括预设模式。
方式2,上述上述候选预测模式列表包括MPM列表中的模式。
方式3,上述候选预测模式列表包括根据一些规则,如等间距筛选等,确定出的候选预测模式的集合。
方式4,根据与当前分量块相邻的至少一个块所使用的预测模式,确定候选预测模式列表。
方式5,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至少一个,添加至第一候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至候选预测模式列表中。
方式6,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已编码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
在一些实施例中,方式6中,当前分量块周边已编码的第一分量块、第二分量块和第三分量块中至少一个分量块包括当前分量块的上方和/或左侧已编码区域对应的第一分量块、第二分量块和第三分量块中至少一个分量块。例如,图18所示,选择0到5的块使用的预测模式,作为第二预测模式,和/或选择块2到块3之间省略号代表的至少一个块所使用的预测模式,作为第二预测模式,和/或选择块1到块5之间省略号代表的至少一个块所使用的预测模式,作为第二预测模式。在一种示例中,该实施例中的第一分量块可以为亮度CU,第二分量块和/或第三分量块可以为色度CU,此时将当前分量块周边已编码的亮度CU和/或色度CU所使用的预测模式,确定为第二预测模式。
在一些实施例中,上述方式6中,当前分量块的内部预设区域可以为当前分量块内部的任意区域。当前分量块的内部区域对应的第一分量块可以理解为,与当前分量块的内部区域为同一个空间的第一分量块。可选的,该第一分量块可以为亮度CU。例如,根据当前分量块的内部区域的左上角顶点的坐标,映射得到该坐标对应的亮度CU,进而将该亮度CU所使用预测模式,确定为第四预测模式。
在一些实施例中,上述方式6中,确定当前分量块对应的第一分量块相关的第五预测模式的方式至少包括如下几种示例:
示例1,由于当前分量块对应的第一分量块已编码,因此,将该第一分量块所使用的预测模式,确定为第五预测模式。在一种示例中,该第一分量块可能包括多个第一分量CU,这多个第一分量CU所使用的预测模式可能相同,也可能不同,本申请实施例中,可以将该第一分量块所包括的多个第一分量CU中至少一个第一分量CU所使用的预测模式,确定为第五预测模式。
示例2,根据当前分量块对应的第一分量块的纹理,确定第五预测模式。示例性的,确定该第一分量块的纹理方向;根据纹理方向,确定第五预测模式。
本申请实施例对确定当前分量块对应的第一分量块的纹理方向的具体方式不做限制。
在一种可能的实现方式中,确定当前分量块对应的第一分量块中某些点的纹理方向,根据这些点的纹理方向,确定该第一分量块的纹理方向。在一些实施例中,为了便于描述,将该第一分量块中需要确定纹理方向的点,记为纹理点。这些纹理点可以为默认的,例如编码端和解码端默认将该第一分量块中的一些点作为纹理点,计算其纹理方向。在一些实施例中,上述纹理点是根据预设方式选择的,例如编码端根据预设的纹理点选择方式,选出该第一分量块中的多个纹理点。
针对这多个纹理点中的每一个纹理点,确定该每个纹理点的梯度,例如确定每个纹理点的水平梯度和竖直梯度,进而根据每个纹理点的水平梯度和竖直梯度,确定出每个纹理点的纹理方向。
接着,根据每个纹理点的纹理方向,确定该第一分量块的纹理方向。
示例性的,将多个纹理点分别对应的纹理方向中的一个或多个,确定为该第一分量块的纹理方向。
例如,将多个纹理点分别对应的纹理方向中的任意一个或多个,确定为该第一分量块的纹理方向。
再例如,将多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为该第一分量块的纹理方向。
根据上述确定出当前分量块对应的第一分量块的纹理方向后,根据纹理方向,确定第五预测模式。
在一种示例中,将预测方向与纹理方向平行的预测模式,确定为第五预测模式。
在一种示例中,将预测方向与纹理方向垂直的预测模式,确定为第五预测模式。
在一种示例中,将预测方向与纹理方向平行的预测模式,以及预测方向与纹理方向垂直的预测模式,确定为第五预测模式。
需要说明的是,上述预测方向与纹理方向平行的预测模式,包括预测方向与纹理方向平行和/或近似平行的预测模式。预测方向与纹理方向垂直的预测模式,包括预测方向与纹理方向垂直和/或近似垂直的预测模式。
需要说明的是,上述方式1至方式6可以作为确定候选预测模式列表的方式单独使用,也可以进行任意组合使用。
在一些实施例中,上述候选预测模式列表包括候选帧内预测模式列表、候选帧间预测模式列表中的至少一个。其中,候选帧内预测模式列表包括至少一个候选帧内预测模式,候选帧间预测模式列表包括至少一个候选帧间预测模式。
根据上述方式,得到当前分量块的候选预测模式列表后,根据该候选预测模式列表,确定Q个预测模式,例如将候选预测模式列表所包括的全部或部分候选预测模式,确定为Q个预测模式的全部或部分。
下面对确定权重导出模式对应的预测模式的过程进行介绍。
本申请实施例中,权重导出模式对应的预测模式为一个泛指,例如可以是预设的一个权重导出模式对应的预测模式,或者是预设的几个权重导出模式对应的预测模式。在一些实施例中,权重导出模式对应的预测模式也可以理解为权重导出模式对应的预测模式列表,该预测模式列表中包括至少一个预测模式。
在一些实施例中,上述导出模式对应的预测模式包括P个权重导出模式中至少一个权重导出模式对应的预测模式。此时,确定权重导出模式对应的预测模式包括:针对P个权重导出模式中的第p个权重导出模式,确定第p个权重导出模式对应的预测模式,根据P个权重导出模式中至少一个权重导出模式对应的预测模式,确定权重导出模式对应的预测模式,其中p为正整数。
本申请实施例中,确定P个权重导出模式中每个一个权重导出模式对应的预测模式的过程基本相同,为了便于描述,下面以P个权重导出模式中的第p个权重导出模式为例进行说明。
其中,确定第p个权重导出模式对应的预测模式包括如下两种方式:
方式1,若第p个权重导出模式对应的预测模式中的至少一个为帧内预测模式时,根据第p个权重导出模式确定角度索引;将角度索引对应的帧内预测模式,确定为第p个权重导出模式对应的预测模式中的至少一个。
其中角度索引用于指示权重的分界线角度索引。
在一些实施例中,用字段angleIdx表示角度索引。
上述表2示出了merge_gpm_partition_idx与angleIdx的对应关系,参照上述表2,可以根据该第p个权重导出模式导出角度索引。
本申请中,角度索引与帧内预测模式具有对应关系,即不同的角度索引与不同帧内预测模式对应。
示例性的,角度索引与帧内预测模式具有对应关系如表7所示。
该方式一中,以K=2为例,若第一个预测模式或第二个预测模式为帧内预测模式时,则根据第p个权重导出模式确定角度索引,例如根据上述表2,导出第p个权重导出模式对应的角度索引。接着,在上述表7中,确定出该角度索引对应的帧内预测模式,例如,角度索引为2,其对应的帧内预测模式为42,进而将帧内预测模式42确定为第一个预测模式或第二个预测模式。
方式2,若第p个权重导出模式对应的预测模式中的至少一个为帧内预测模式时,确定第p个权重导出模式对应的帧内预测模式;将第p个权重导出模式对应的帧内预测模式中的至少一个,确定为第p个权重导出模式对应的预测模式中的至少一个。
其中,第p个权重导出模式对应的帧内预测模式包括预测方向与权重的分界线平行的帧内预测模式、预测方向与分界线垂直的帧内预测模式和planar模式中的至少一个。
需要说明的是,预测方向与权重的分界线平行的帧内预测模式包括预测方向与权重的分界线平行或近似平行的一个或几个帧内预测模式。预测方向与权重的分界线垂直的帧内预测模式包括预测方向与权重的分界线垂直或近似垂直的一个或几个帧内预测模式。
该方式二中,以K=2为例,若第一个预测模式和/或第二个预测模式为帧内预测模式时,第一个预测模式和/或第二个预测模式是从权重导出模式对应的帧内预测模式中确定出。例如,第一个预测模式和/或第二个预测模式可以是跟权重划分线(也称为分界线)同一条直线的或近似同一条直线的帧内预测模式。或者,第一个预测模式和/或第二个预测模式可以是预测方向与权重分界线垂直的或近似垂直的帧内预测模式。例如,权重的分界线是水平方向的,如图4中GPM的索引为18,19,50,51的模式,第一个预测模式和/或第二个预测模式为水平方向的模式18或者垂直方向的模式50。
编码端根据上述步骤,确定出P个权重导出模式中至少一个权重导出模式对应的预测模式,进而根据P个权重导出模式中至少一个权重导出模式对应的预测模式,确定权重导出模式对应的预测模式。例如,将P个权重导出模式中至少一个权重导出模式对应的预测模式的全部或部分,作为权重导出模式对应的预测模式。
进一步的,P个权重导出模式对应的预测模式中可能存在重复的预测模式,则将重复的预测模式进行剔除,将剩余的不同的预测模式确定为权重导出模式对应的预测模式。
本申请实施例,为了降低R个第二组合的数量,对预测模式进行筛选,具体是根据上述方法,确定出Q个预测模式。
在一些实施例中,为了降低编码端的复杂度,对上述Q个预测模式的个数进行限定,例如,Q小于或等于第一预设阈值,本申请对第一预设阈值的具体取值不做限制,可以根据实际需要进行确定,例如第一预设阈值为6,即选定6个预测模式来构建R个第二组合,以控制第二组合的个数。
在一些实施例中,Q的大小与当前分量块的大小和/或形状相关,其中当前分量块的形状可以理解为由当前分量块的长宽比决定。
在预测时,对于较小的块,相似的预测模式对预测结果的影响差别不大,对于较大的块,相似的预测模式对预测结果的影响差别会更加明显。基于此,本申请实施例对不同大小的块设定不同的Q值,即对较大块设置较大的Q值,对较小的块设置较小的Q值。
此时,在确定当前分量块对应的Q值时,根据当前分量块的大小设定,例如,若当前分量块的大小大于第一数值时,则Q大于或等于第二预设阈值。再例如,若当前分量块的大小小于或等于第一数值时,则Q小于第三预设阈值。本申请实施例对第一数值、第二预测阈值和第三预设阈值的具体大小不做限制,其中第三预设阈值小于第二预设阈值。
下面对S201-A21-1中确定P个权重导出模式的过程进行介绍。
在一些实施例中,P个权重导出模式为GPM所包括64种权重导出模式,或者为AWP包括56种权重导出模式。
在一些实施例中,从预设的M个权重导出模式中,选出P个权重导出模式,其中M为大于或等于P的正整数。
上述预设的M个权重导出模式可以为GPM所包括64种权重导出模式,或者为AWP包括56种权重导出模式,还可以是GPM所包括64种权重导出模式的部分权重导出模式,或者为AWP包括56种权重导出模式的部分权重导出模式。
在该实施例中,为了进一步降低R个第二组合的数量,则对预设的M个权重导出模式进行筛选,则可以从预设的M个权重导出模式中选择P个权重导出模式,用于构建R个第二组合。
在一些实施例中,从M个权重导出模式中剔除预设划分角度和/或预设偏移量对应的权重导出模式,得到P个权重导出模式。由于权重导出模式中同一划分角度可以对应多个偏移量,如图19A所示权重导出模式10、11、12和13,它们的划分角度相同,但是偏移量不同,这样可以去掉一些预设偏移量对应的权重导出模式,和/或也可以去掉一些预设划分角度对应的权重导出模式。这样做可以减少总的可能的第二组合数量。而且使各个可能的第二组合之间差别更明显。
在一些实施例中,不同的块对应的筛选条件可以不同,这样在确定当前分量块对应的P个权重导出模式时,首先确定当前分量块对应的筛选条件,并根据当前分量块对应的筛选条件,从M个权重导出模式中,选出P个权重导出模式。
在一些实施例中,当前分量块对应的筛选条件包括当前分量块的大小对应的筛选条件和/或当前分量块的形状对应的筛选条件。在预测时,对于更小的块,相似的权重导出模式对预测结果的影响差别不大,而对于较大的块,相似的权重导出模式对预测结果的影响差别会更加明显。基于此,本申请实施例对不同大小的块设定不同的P值,即对较大块设置较大的P值,对较小的块设置较小的P值。
在一些实施例中,上述筛选条件包括数组,该数组包括M个元素,M个元素与M个权重导出模式一一对应,每个权重导出模式对应的元素用于指示该权重导出模式是否可用,其中权重导出模式是否可用可以理解为该权重导出模式是否用于组成P个权重导出模式中的一个权重导出模式进行后续的第二组合的尝试。
上述数组可以是一位数值,也可以是二位数值。
在一些实施例中,若当前分量块对应的筛选条件包括当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件时,且对于同一个权重导出模式,若当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件表示该权重导出模式均可用时,则将该权重导出模式确定为P个权重导出模式中的一个,若当前分量块的大小对应的筛选条件和当前分量块的形状对应的筛选条件中的至少一个表示该权重导出模式不可用,则确定该权重导出模式不构成P个权重导出模式。
在一些实施例中,对于不同块大小对应的筛选条件和不同块形状对应的筛选条件,可以使用多个数组分别进行实现。
在一些实施例中,对于不同块大小对应的筛选条件,和不同块形状对应的筛选条件可以使用二位数组来实现,也就是说,在一个二位数组中即包括块大小对应的筛选条件,也包括块形状对应的筛选条件。
编码端根据上述步骤,确定出Q个预测模式和P个权重导出模式后,根据这Q个预测模式和P个权重导出模式,组成R个不同的第二组合。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则编码端对上述确定的Q个预测模式和P个权重导出模式再次进行筛选,此时,上述S201-A21-2中根据确定出的P个权重导出模式和Q个预测模式,组成R个第二组合包括如下S201-A21-21至S201-A21-23的步骤:
S201-A21-21、从P个权重导出模式中选出S个权重导出模式,其中S为小于或等于P的正整数。
具体的,从上述确定的P个权重导出模式剔除掉发生概率较低的权重导出模式,得到筛选后的S个权重导出模式。
其中,上述S201-A21-21中从P个权重导出模式中选出S个权重导出模式的方式包括但不限于如下几种:
方式1,针对P个权重导出模式中的第i个权重导出模式,根据第i个权重导出模式,确定K个第二预测模式在第一分量块上的权重,K个第二预测模式为Q个预测模式中的任意K个预测模式,i为从1到P的正整数;若K个预测模式中的任一预测模式在第一分量块上的权重小于第一预设值时,则从P个权重导出模式中剔除第i个权重导出模式,得到S个权重导出模式。
在该方式1中,如果一种权重导出模式导出的第一分量块的权重,使得某一个预测模式在第一分量块上的影响很小,或者在第一分量块上没有影响,那么就不使用这个权重导出模式。例如,图4(正方形的块)中的权重导出模式 52,该权重导出模式,使得第二个预测模式在第一分量块上的权重较小,再例如权重导出模式54,使得第二个预测模式在第一分量块上的权重为0,即可以认为在权重导出模式54下,第二个预测模式在第一分量块上没有影响,第一分量块的预测值全部由第一个预测模式确定。这种情况下第二个预测模式是什么都没有影响,对于这样的权重导出模式则需要从P个权重导出模式中剔除。
在上述方式1中,将P个权重导出模式中,使得K个预测模式中的任意一个预测模式在第一分量块上的权重小于第一预设值的权重导出模式剔除,得到S个权重导出模式。
本申请实施例对上述第一预设值的具体取值不做限制,例如为大于或等于0的较小值。
方式2,针对P个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式对第一分量块进行预测时的代价,i为从1到P的正整数;根据第i个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模式。
在该方式2中,通过计算P个权重导出模式中每个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模式。
本申请实施例中,将权重导出模式和K个预测模式作为一个组合,进行代价的计算,这样,为了计算方便,在给定K个预测模式的基础上,对P个权重导出模式的代价进行计算,即将P个权重导出模式分别与设定的K个预测模式进行组合,得到P个组合,计算这P个组合中每个组合对应的代价,进而得到P个权重导出模式的代价。
根据上述方法,确定出P个权重导出模式中第i个权重导出模式对应的代价后,根据第i个权重导出模式对应的代价从P个权重导出模式中选出S个权重导出模式。
在该方式2中,编码端根据第i个权重导出模式对应的代价,从P个权重导出模式中选出S个权重导出模式包括如下方式:
第1种方式,若第i个权重导出模式对应的代价小于第二预设值,则从P个权重导出模式中选出与第i个权重导出模式相似的权重导出模式;根据第i个权重导出模式,以及第i个权重导出模式的相似权重导出模式,确定S个权重导出模式。其中,第i个权重导出模式的相似权重导出模式可以理解为预测结果与第i个权重导出模式的预测结果相似的权重导出模式
本申请实施例对上述第二预设值的大小不做限制,具体根据实际需要进行确定。
在一些实施例中,编码端还可以根据下面的第2种方式,从P个权重导出模式中选出S个权重导出模式。
第2种方式,若第i个权重导出模式对应的代价大于第三预设值,则从P个权重导出模式中剔除掉第i个权重导出模式,以及第i个权重导出模式的相似权重导出模式,得到剔除后的至少一个权重导出模式;根据剔除后的至少一个权重导出模式,确定S个权重导出模式。
本申请实施例对上述第三预设值的大小不做限制,具体根据实际需要进行确定,第三预设值大于上述第二预设值。
根据上述步骤,编码端从P个权重导出模式中筛选出S个权重导出模式后,执行如下S201-A21-22的步骤。
S201-A21-22、从Q个预测模式中选出T个预测模式,T为小于或等于Q的正整数。
本申请实施例对从Q个预测模式中选出T个预测模式的方式不做限制。
在一些实施例中,从Q个预测模式中选出预设的T个预测模式。
在一些实施例中,针对Q个预测模式中的第i个预测模式,编码端确定使用第i个预测模式对第一分量块进行预测时的代价,i为从1到Q的正整数;根据第i个预测模式对应的代价,从Q个预测模式中选出T个预测模式。
本申请实施例中,将权重导出模式和K个预测模式作为一个组合,进行代价的计算,这样,为了计算方便,在给定权重导出模式和其他K-1个预测模式的基础上,对Q个权重导出模式的代价进行计算,即将Q个预测模式分别与设定的权重导出模式和K-1个预测模式进行组合,得到Q个组合,计算这Q个组合中每个组合对应的代价,进而得到Q个预测模式的代价。
举例说明,假设给定的K-1个预测模式为预测模式1,给定的权重导出模式为权重导出模式1,对于Q个预测模式中的第i个预测模式,权重导出模式1与第i个预测模式和预测模式1组成一个组合,记为组合i。使用组合i对第一分量块进行预测,得到该组合i下第一分量块的预测值,根据组合i下第一分量块的预测值与第一分量块的重建值,确定该组合i对应的预测失真代价,将该组合i对应的预测失真代价,确定为第i个预测模式对应的代价。这样可以确定出Q个预测模式中任意一个预测模式对应的代价。
根据上述方法,确定出Q个预测模式中第i个预测模式对应的代价后,根据第i个预测模式对应的代价从Q个预测模式中选出T个预测模式。
其中,编码端根据第i个预测模式对应的代价从Q个预测模式中选出T个预测模式包括如下方式:
第一种方式,若第i个预测模式对应的代价小于第四预设值,则从Q个预测模式中选出与第i个预测模式相似的预测模式;根据第i个预测模式,以及第i个预测模式的相似预测模式,确定T个预测模式。其中,与第i个预测模式相似的预测模式可以理解为预测结果与第i个预测模式的预测接收相似(或相近)的预测模式,例如预测方向(或角度)与第i个预测模式的预测方向(或角度)相近的预测模式,或者预测模式索引与第i个预测模式的索引相近的预测模式,例如索引比第i个预测模式的索引大1、2等的预测模式,或者索引比第i个预测模式的索引小1、2等的预测模式。
本申请实施例对上述第四预设值的大小不做限制,具体根据实际需要进行确定。
第二种方式,若第i个预测模式对应的代价大于第五预设值,则从Q个预测模式中剔除掉第i个预测模式,以及第i个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据剔除后的至少一个预测模式,确定T个预测模式。
本申请实施例对上述第五预设值的大小不做限制,具体根据实际需要进行确定,第五预设值大于上述第四预设值。
根据上述步骤,从P个权重导出模式中选出S个权重导出模式,从Q个预测模式中选出T个预测模式,接着,执行如下S201-A21-23。
S201-A21-23、根据S个权重导出模式和T个预测模式,组成R个第二组合。
具体的,从S个权重导出模式中选出一个权重导出模式,从T个预测模式中选出K个预测模式,这一个权重导出模式和K个预测模式组成一个第二组合,重复执行该步骤,可以得到R个第二组合。
在一些实施例中,上述S201-A21-2包括:针对P个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式与Q个预测模式中的第j个预测模式对第一分量块进行预测时的代价;若第i个权重导出模式与第j个预测模式组合对应的代价大于第六预设值,则从Q个预测模式中剔除掉第j个预测模式,以及第j个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据第i个权重导出模式和剔除后的至少一个预测模式,构建R个第二组合。
在该实施例中,在权重导出模式和一个预测模式固定时,另外一个预测模式进行筛选。例如,某一权重导出模式下,某一个帧内预测模式作为第一预测模式不能得到比较小的代价,那么就不再尝试该权重导出模式下,与该帧内预测模式相似的帧内预测模式作为第一预测模式的情况。
根据上述步骤,可以确定出P个权重导出模式中,每个权重导出模式对应的最终剔除后的预测模式集合,这样根据P个权重导出模式与其各自对应的最终剔除后的预测模式集合,构建R个第二组合。
需要说明的是,上述实施例,示出了以组合的形式对预测模式进行筛选的方式,可选的,还可以通过组合的形式,对权重导出模式和预测模式中的任意一个进行筛选,最终构建出R个第二组合。
编码端根据上述各方法,确定出R个第二组合后,对于R个第二组合中的任一第二组合,使用第二组合中的权重导出模式和K个预测模式,对第一分量块进行预测,得到第二组合对应的第一分量块预测值。
接着,根据第一分量块的预测值和重建值,确定该第二组合的代价。
根据上述方法,可以确定出R个第二组合中每个第二组合的代价。接着,根据R个第二组合中每个第二组合的代价,构建表6所示的候选组合列表。
这样编码端在表6所示的候选组合列表中查询第一组合。
上述实施例,以第一组合包括第一权重导出模式和K个第一预测模式为例,对构建候选组合的方式进行介绍。
本申请实施例中,情况1,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式不包括过渡参数(blending parameter)。情况2,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。情况3,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括过渡参数。其中,过渡参数与K个第一预测模式一起用于确定当前分量块的预测值。
对于情况1,第一组合包括第一权重导出模式和K个第一预测模式,且第一权重导出模式不包括过渡参数时,当前分量块对应的候选组合列表的构建方式如上述实施例的描述。
情况2,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。
在该情况2下,S201中确定第一组合包括如下步骤:
S201-C、确定候选组合列表,该候选组合列表中包括至少一个候选组合,至少一个候选组合中的任一候选组合包括一个权重导出模式、K个预测模式和一个过渡参数;
S201-D、从候选组合列表中,确定出第一组合。
示例性的,候选组合列表如表8所示。
本申请实施例对确定上述候选组合列表的具体方式不做限制。
在一些实施例中,上述候选组合列表为已有的,编码端获得或读取该候选组合列表。
在一些实施例中,上述候选组合列表是编码端构建的。
本申请实施例对编码端构建候选组合列表的方式不做限制。
在一些实施例中,编码端通过如下S201-C1和S201-C2的步骤,构建候选组合列表:
S201-C1、确定当前分量块对应的第一分量块;
S201-C2、基于第一分量块,构建候选组合列表。
其中,S201-C1的具体实现过程参照上述S101-A1的描述,在此不再赘述。
在一些实施例中,S201-C2包括如下S201-C21至S201-C23的步骤:
S201-C21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式、K个预测模式和一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式、K个预测模式和过渡参数不完全相同,R为大于1的正整数。
S201-C22、对于R个第二组合中的任一第二组合,确定使用第二组合中的权重导出模式、K个预测模式和过渡参数,对第一分量块进行预测时,第二组合对应的代价。
S201-C23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,编码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式、K个预测模式和一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式、K个预测模式和过渡参数不完全相同。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合所包括的权重导出模式、K个预测模式和过渡参数对当前分量块对应的第一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
在一些实施例中,上述S201-C22中确定使用第二组合中的权重导出模式、K个预测模式和过渡参数,对第一分量块进行预测时,该第二组合对应的代价,至少包括如下方式:
方式1,S201-C22包括如下S201-C22-11至S201-C22-14:
S201-C22-11、根据第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重;
S201-C22-12、根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S201-C22-13、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块预测值;
S201-C22-14、根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定第二组合对应的代价。
本申请实施例中,确定R个第二组合中每个第二组合对应的代价的过程一致,为了便于描述,在此以R个第二组合中的一个第二组合为例进行说明。
本申请实施例中,第二组合包括一个权重导出模式、一个过渡参数和K个预测模式,在使用该第二组合对第一分量块进行预测时,根据该第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重,根据第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,接着,使用第一分量块的权重对第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块预测值。然后,根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定该第二组合对应的代价。
本申请实施例中,过渡参数用于对权重导出模式导出的权重进行调整,因此,本申请实施例中,上述S201-C221中,根据第二组合所包括的权重导出模式和过渡参数,确定第一分量块的权重的实现方式,至少存在如下几种:
示例1,在使用第一权重导出模式,导出第一分量块权重时,需要确定多个中间变量,可以使用过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出第一分量块的权重。
示例2,根据第二组合中的权重导出模式和第一分量块,确定第一分量块对应的第三权重,使用第二组合中的过渡参数,对第三权重进行调整,得到调整后的第三权重;根据调整后的第三权重,确定第一分量块的权重。
根据上述方法,可以确定出R个第二组合中每一个第二组合对应的第一分量块权重。接着,针对每个第二组合,使用该第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,使用该第二组合对应的第一分量块权重,对该第二组合对应的第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块预测值,根据该第二组合对应的第一分量块预测值和第一分量块的重建值,确定该第二组合对应的代价。其中,确定第二组合对应的代价的方式包括但不限于SAD、SATD、SEE等。参照该方法,可以确定出R个第二组合中,每个第二组合对应的第一分量块预测值。接着,根据R个第二组合中各第二组合对应的第一分量块预测值,构建候选组合列表。
方式2,S201-C22包括如下S201-C22-11至S201-C22-14:
S201-C22-21、根据第二组合中的权重导出模式和过渡参数,确定第二组合中K个预测模式分别对应的第一分量块预测值;
S201-C22-22、根据第二组合中K个预测模式分别对应的第一分量块预测值和第一分量块重建值,确定第二组合中K个预测模式分别对应的代价;
S201-C22-23、根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。例如,将第二组合中的K个预测模式分别对应的代价之和,确定为第二组合对应的代价。
上述S201-C23中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式包括但不限于如下几种:
示例1,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序;将排序后的R个第二组合,确定为候选组合列表。
示例2,根据第二组合对应的代价,从R个第二组合中选出L个第二组合,将这L个第二组合组成的列表,确定为候选组合列表。
下面对上述S201-C21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。
在一些实施例中,S201-C21包括如下步骤:
S201-C21-1、确定F个权重导出模式、J个预测模式和W个过渡参数,F和W均为正整数,J为大于或等于K的正整数;
S201-C21-2、根据F个权重导出模式、J个预测模式和W个过渡参数,构建R个第二组合,R个第二组合中的任一第二组合包括F个权重导出模式中的一权重导出模式、J个预测模式中的K个预测模式和W个过渡参数中的一个过渡参数。
在该实施例中,编码端首先确定F个权重导出模式、J个预测模式和W个过渡参数,接着,根据确定的F个权重导出模式、J个预测模式和W个过渡参数,构建R个第二组合。
在一些实施例中,为了降低数据量,提升候选组合列表的构建速度,则不对每一种预测模式都进行尝试,可以选择其中部分预测模式进行尝试。
此时,上述S201-C21-1中确定J个预测模式的实现方式包括但不限于如下几种方式:
方式一,J个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定J个预测模式。
其中,确定当前分量块的第二候选预测模式列表的方式至少包括如下几种示例:
示例1,根据与当前分量块相邻的至少一个块所使用的预测模式,确定第二候选预测模式列表。
示例2,若第二候选预测模式列表中不包括预设模式时,则确定当前分量块对应的预设模式;将预设模式添加至第二候选预测模式列表中。
在一种示例中,上述预设模式为预设的几个预测模式。
在另一种示例中,通过确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定预设模式。
例如,若当前分量块对应的图像类型为B类型或P类型时,则预设模式包括DC,水平模式、竖直模式和角度模式中的至少一个。
示例3,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定第二候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至少一个,添加至第二候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至第二候选预测模式列表中。
示例4,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已编码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
本申请实施例中,上述确定J个预测模式的具体实现方式,可以参照上述S101-A21-1中确定Q个预测模式的具体描述,在此不再赘述。在一些实施例中,上述J等于Q。。
下面对S201-C21-1中确定F个权重导出模式的过程进行介绍。
本申请实施例中,确定F个权重导出模式的方式至少包括如下几种方式:
在一些实施例中,上述F个权重导出模式为预设的权重导出模式。
在一些实施例中,从预设的Z个权重导出模式中,选出F个权重导出模式,其中Z为大于或等于F的正整数。
本申请实施例对上述预设的Z个权重导出模式不做限制。
在一些实施例中,若Z等于F,则将Z个权重导出模式,确定为F个权重导出模式。
在一些实施例中,若Z大于F,则为了进一步降低R个第二组合的数量,则对预设的Z个权重导出模式进行筛选,则可以从预设的Z个权重导出模式中选择F个权重导出模式,用于构建R个第二组合。
上述S201-C21-1中确定F个权重导出模式的过程,与上述S201-A21-1中确定P个权重导出模式的过程基本一致,参照上述确定P个权重导出模式的具体描述,在此不再赘述。
下面对S201-C21-1中确定W个过渡梯度系数的过程进行介绍。
在一些实施例中,上述W个过渡参数为预设的过渡参数,例如为1/4、1/2、1、2、4等。
在一些实施例中,根据当前分量块大的大小,确定W个过渡参数。
在一些实施例中,从预设的多个过渡参数,确定W个过渡参数。
在一种示例中,根据当前分量块的图像信息,从预设的多个过渡参数中,确定出W个过渡参数。
本申请实施例对当前分量块的图像信息的具体内容不做限制,例如模糊度、清晰度、锐度等。
在一些实施例中,若当前分量块的图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从多个预设的过渡参数中,确定出W个过渡参数,包括两种示例:
示例1,若当前分量块的图像边缘的清晰度小于预设值,则将多个预设过渡参数中的至少一个第一类过渡参数,确定为W个过渡参数。
其中,第一类过渡参数可以理解为可以形成较宽过渡区域的过渡参数,例如为1/4、1/2等。
示例2,若所述当前分量块的图像边缘的清晰度大于或等于所述预设值,则将多个预设过渡参数中的至少一个第二类过渡参数,确定为W个过渡参数,第二类过渡参数大于第一类过渡参数。
其中,第二类过渡参数可以理解为可以形成较窄过渡区域的过渡参数,例如为2、4等。
本申请实施例中,确定当前分量块的图像信息的方式可以包括至少两种方式:
方式1,将当前分量块的图像信息进行分析,得到当前分量块的图像信息。
方式2,确定第一分量块图像信息;根据第一分量块图像信息,确定当前分量块的图像信息
根据上述步骤,确定出J个预测模式、F个权重导出模式和W个过渡参数后,根据这J个预测模式、F个权重导出模式和W个过渡参数,组成R个不同的第二组合。接着,根据R个第二组合,确定出候选组合列表,进而从这候选组合列表中,确定出第一权重导出模式、K个第一预测模式和第二过渡参数。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则对上述确定的J个预测模式、F个权重导出模式和W个过渡参数再次进行筛选,此时,上述S201-C21-2中根据确定出的F个权重导出模式、J个预测模式和W个过渡参数,组成R个第二组合包括如下S201-C21-21至S201-C21-24的步骤:
S201-C21-21、从F个权重导出模式中选出E个权重导出模式,其中E为小于或等于F的正整数。
具体的,从上述确定的F个权重导出模式剔除掉发生概率较低(即代价较大)的权重导出模式,得到筛选后的E个权重导出模式。
其中,上述S201-C21-21中从F个权重导出模式中选出E个权重导出模式的方式包括但不限于如下几种:
方式1,针对F个权重导出模式中的第i个权重导出模式,根据第i个权重导出模式和第四过渡参数,确定K个第二预测模式在第一分量块上的权重,第四过渡参数为W个过渡梯度中的任一过渡参数,K个第二预测模式为J个预测模式中的任意K个预测模式,i为从1到F的正整数;若K个预测模式中的任一预测模式在第一分量块上的权重小于第一预设值时,则从F个权重导出模式中剔除第i个权重导出模式,得到E个权重导出模式。
在该方式1中,根据第i个权重导出模式和第四过渡参数,确定K个第二预测模式在第一分量块上的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第i权重导出模式,导出第一分量块的权重时,需要确定多个中间变量,可以使用第四过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出第一分量块的权重。
示例2,根据第i权重导出模式和第一分量块,确定第一分量块对应的第四权重;使用第四过渡参数,对第四权重进行调整,得到调整后的第四权重;根据调整后的第四权重,确定K个第二预测模式在第一分量块上的权重。
根据上述方法,根据第i个权重导出模式下,K个第二预测模式在第一分量块上的权重。
方式2,针对F个权重导出模式中的第i个权重导出模式,确定使用第i个权重导出模式对第一分量块进行预测时的代价,i为从1到F的正整数;根据第i个权重导出模式对应的代价,从F个权重导出模式中选出E个权重导出模式。
在一些实施例中,在确定上述第i个权重导出模式对应的代价时,不考虑过渡参数对权重的影响。
在一些实施例中,在确定上述第i个权重导出模式对应的代价时,包括过渡参数对权重的影响,也就是说,根据第i个权重导出模式和过渡参数确定第一分量块的权重,进而根据第一分量块的权重和第一分量块的K个预测值,确定第一分量块的预测值,根据第一分量块的预测值和重建值,确定第i个权重导出模式对应的代价。其中根据第i个权重导出模式和过渡参数确定第一分量块的权重的具体过程可以参照上述实施例的描述,在此不再赘述。
根据上述步骤,从F个权重导出模式中筛选出E个权重导出模式后,执行如下S201-C21-22的步骤。
S201-C21-22、从J个预测模式中选出V个预测模式,V为小于或等于J的正整数。
本申请实施例对从J个预测模式中选出V个预测模式的方式不做限制。
在一些实施例中,从J个预测模式中选出预设的V个预测模式。
在一些实施例中,针对J个预测模式中的第i个预测模式,编码端确定使用第i个预测模式对第一分量块进行预测时的代价,i为从1到J的正整数;根据第i个预测模式对应的代价,从J个预测模式中选出V个预测模式。
本申请实施例中,将权重导出模式、K个预测模式和过渡参数作为一个组合,进行代价的计算,这样,为了计算方便,在给定权重导出模式、其他K-1个预测模式和过渡参数的基础上,对J个权重导出模式的代价进行计算,即将J个预测模式分别与设定的权重导出模式、K-1个预测模式和过渡参数进行组合,得到J个组合,计算这J个组合中每个组合对应的代价,进而得到J个预测模式的代价。
根据上述方法,确定出J个预测模式中第i个预测模式对应的代价后,根据第i个预测模式对应的代价从J个预测模式中选出V个预测模式。
其中,根据第i个预测模式对应的代价从J个预测模式中选出V个预测模式包括如下方式:
第一种方式,若第i个预测模式对应的代价小于第四预设值,则从J个预测模式中选出与第i个预测模式相似的预测模式;根据第i个预测模式,以及第i个预测模式的相似预测模式,确定V个预测模式。
第二种方式,若第i个预测模式对应的代价大于第五预设值,则从J个预测模式中剔除掉第i个预测模式,以及第i个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据剔除后的至少一个预测模式,确定V个预测模式。
根据上述步骤,从F个权重导出模式中选出E个权重导出模式,从J个预测模式中选出V个预测模式,接着,执行如下S201-C21-23。
S201-C21-23、从W个过渡参数中选出O个过渡参数,O为小于或等于W的正整数。
在一些实施例中,若O等于W,则将W个过渡参数,确定为O个过渡参数。
在一些实施例中,若W大于O时,则对W个过渡参数进行筛选,得到O个过渡参数。
其中,对W个过渡参数进行筛选,得到O个过渡参数的方式至少包括如下几种:
示例1,确定W个过渡参数中每个过渡参数的代价,筛选出W个过渡参数中,代价最小的前O个过渡参数。
示例2,若上述W个过渡参数不是经过当前分量块的图像信息确定的时,则本申请实施例还可以通过确定当前分量块的图像信息;根据当前分量块的图像信息,从W个过渡参数中,确定出O个过渡参数。
在一些实施例中,若当前分量块的图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从W个过渡参数中,确定出O个过渡参数,包括两种示例:
在一种示例中,若当前分量块的图像边缘的清晰度小于预设值,则将W个过渡参数中的至少一个第一类过渡参数,确定为O个过渡参数。
在另一种示例中,若所述当前分量块的图像边缘的清晰度大于或等于所述预设值,则将W个过渡参数中的至少一个第二类过渡参数,确定为O个过渡参数。
在一些实施例中,根据当前分量块的大小,从W个过渡参数中选出所述O个过渡参数。
在一种可能的实现方式中,根据当前分量块的大小,将W个过渡参数中大于或等于第三值的过渡参数作为O个过渡参数。
例如,若当前分量块的大小小于第二设定阈值时,则将W个过渡参数中值为第三值的过渡参数作为O个过渡参数中的一个过渡参数。
再例如,若当前分量块的大小大于或等于第二设定阈值时,则将W个过渡参数中小于或等于第四值的过渡参数作为O个过渡参数,其中第四值小于第三值。
在另一种可能的实现方式中,根据当前分量块的大小,确定O个过渡参数为W个过渡参数位于某一个取值范围的至少一个过渡参数。
例如,若当前分量块的大小小于第二设定阈值时,则确定O过渡参数为W个过渡参数位于第四过渡参数取值范围内的一个或多个过渡参数。
再例如,若当前分量块的大小大于或等于第二设定阈值时,则确定O过渡参数为W个过渡参数中位于第三过渡参数取值范围内的一个或多个过渡参数,其中第三过渡参数取值范围的最小值小于第四过渡参数取值范围的最小值。
从F个权重导出模式中选出E个权重导出模式,从J个预测模式中选出V个预测模式,从W个过渡参数中选出O个过渡参数后,执行如下S201-C21-24。
S201-C21-24、根据E个权重导出模式、V个预测模式和O个过渡参数,组成R个第二组合。
具体的,从E个权重导出模式中选出一个权重导出模式,从V个预测模式中选出K个预测模式,从O个过渡参数最终选出一个过渡参数,这一个权重导出模式、K个预测模式和一个过渡参数组成一个第二组合,重复执行该步骤,可以得到R个第二组合。
由上述可知,一个第二组合包括一个权重导出模式、K个预测模式和一个过渡参数,即一个第二组合中包括K+2个元素,这样在筛选一个元素时,可以限制一个组合中的其他要素固定,另外一个要素的可能选择。
下面以权重导出模式、过渡参数和一个预测模式固定时,另外一个预测模式的筛选过程为例,对上述S201-C21-2的一种实现过程进行介绍。
在一些实施例中,上述S201-C21-2包括:针对F个权重导出模式中的第f个权重导出模式,以及O个过渡参数中的第o个过渡参数,确定使用第f个权重导出模式、第o个过渡参数与J个预测模式中的第j个预测模式对第一分量块进行预测时的代价,其中f为小于或等于F的正整数,o为小于或等于O的正整数,j为小于或等于J的正整数;若第f个权重导出模式、第o个过渡参数与第j个预测模式组合对应的代价大于第六预设值,则从J个预测模式中剔除掉第j个预测模式,以及第j个预测模式的相似预测模式,得到剔除后的至少一个预测模式;根据第f个权重导出模式、第o个过渡参数和剔除后的至少一个预测模式,构建R个第二组合。
在该实施例中,在权重导出模式、过渡参数和一个预测模式固定时,另外一个预测模式进行筛选。例如,某一权重导出模式和过渡参数下,某一个帧内预测模式作为第一预测模式不能得到比较小的代价,那么就不再尝试该权重导出模式和过渡参数下,与该帧内预测模式相似的帧内预测模式作为第一预测模式的情况。
根据上述步骤,可以确定出F个权重导出模式中,每个权重导出模式和过渡参数对应的最终剔除后的预测模式集合,这样根据F个权重导出模式与其各自对应的最终剔除后的预测模式集合,构建R个第二组合。
需要说明的是,上述实施例,示出了以组合的形式对预测模式进行筛选的方式,可选的,还可以通过组合的形式,对权重导出模式和过渡参数中的任意一个进行筛选,最终构建出R个第二组合。
根据上述各方法,确定出R个第二组合后,对于R个第二组合中的任一第二组合,使用第二组合中的权重导出模式、过渡参数和K个预测模式,对第一分量块进行预测,得到第二组合对应的第一分量块预测值。
接着,根据第一分量块的预测值和重建值,确定该第二组合的代价,并根据R个第二组合中每个第二组合的代价,构建候选组合列表。
这样,编码端从构建的候选组合列表中,确定出第一组合。
例如,将候选组合列表中的一个候选组合,确定为第一组合。
再例如,将候选组合列表中代价最小的候选组合,确定为第一组合。
根据上述方法,确定出第一组合后,执行如下S202。
上述情况2,以第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数为例,对上述S101的实现过程进行介绍。
情况3,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括第三过渡参数,该第三过渡参数用于确定权重。
在该情况3中,第一权重导出模式可以理解为一个数据集,该数据集中包括多个参数,例如包括第三过渡参数,这多个参数共同用于确定权重。
在该情况3下,S201中确定第一组合包括如下步骤:
S201-E、确定候选组合列表,该候选组合列表中包括至少一个候选组合,至少候选组合中的任一候选组合包括一个权重导出模式和K个预测模式,其中权重导出模式包括一个过渡参数;
S201-F、根据候选组合列表,确定第一组合。
示例性的,候选组合列表如表9所示。
本申请实施例对编码端确定上述候选组合列表的具体方式不做限制。
在一些实施例中,上述候选组合列表为已有的。
在一些实施例中,上述候选组合列表是编码端构建的。
本申请实施例对编码端构建候选组合列表的方式不做限制。
在一些实施例中,编码端通过如下S201-E1和S201-E2的步骤,构建候选组合列表:
S201-E1、确定当前分量块对应的第一分量块;
S201-E2、基于第一分量块,构建候选组合列表。
其中,S201-E1的具体实现过程参照上述S101-A1的描述,在此不再赘述。
在一些实施例中,S201-E2包括如下S201-E21至S201-E23的步骤:
S201-E21、确定R个第二组合,R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,且R个第二组合中任意两个组合所包括的权重导出模式和K个预测模式不完全相同,R为大于1的正整数。
S201-E22、对于R个第二组合中的任一第二组合,确定使用第二组合中的权重导出模式和K个预测模式,对第一分量块进行预测,第二组合对应的代价。
S201-E23、根据R个第二组合中各第二组合对应的代价,构建候选组合列表。
在该实施例中,编码端在构建候选组合列表时,首先确定R个第二组合,本申请对R个第二组合的具体数值不做限制,例如8、16、32等,R个第二组合中的每一个第二组合包括一权重导出模式和K个预测模式,权重导出模式包括一个过渡参数,且R个第二组合中任意两个组合所包括的权重导出模式和K个预测模式不完全相同。接着,对于R个第二组合中的每一个第二组合,确定使用该第二组合所包括的权重导出模式和K个预测模式对当前分量块对应的第 一分量块进行预测时,该第二组合对应的代价。最后,根据R个第二组合中每个第二组合对应的代价,构建候选组合列表。
在一些实施例中,上述S201-E22中确定使用第二组合中的权重导出模式和K个预测模式,对第一分量块进行预测时,该第二组合对应的代价,至少包括如下方式:
方式1,S201-E22包括如下S201-E22-11至S201-E22-14:
S201-E22-11、根据第二组合所包括的权重导出模式,确定第一分量块的权重;
S201-E22-12、根据第二组合中的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S201-E22-13、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第二组合对应的第一分量块预测值;
S201-E22-14、根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定第二组合对应的代价。
本申请实施例中,确定R个第二组合中每个第二组合对应的代价的过程一致,为了便于描述,在此以R个第二组合中的一个第二组合为例进行说明。
本申请实施例中,第二组合包括一个权重导出模式和K个预测模式,在使用该第二组合对第一分量块进行预测时,示例性的,编码端可以根据该第二组合所包括的权重导出模式,确定第一分量块的权重,根据第二组合所包括的K个预测模式对第一分量块进行预测,得到第一分量块的K个预测值,接着,使用第一分量块的权重对第一分量块的K个预测值进行加权处理,得到该第二组合对应的第一分量块预测值。然后,根据第二组合对应的第一分量块预测值和第一分量块的重建值,确定该第二组合对应的代价。
本申请实施例对上述S201-E22-11中根据第二组合所包括的权重导出模式,确定第一分量块的权重的具体方式不做限制。例如,第二组合中的权重导出模式包括过渡参数,因此,可以根据该过渡参数,确定第一分量块的权重。
方式2,S201-E22包括如下S201-E22-11至S201-E22-14:
S201-E22-21、根据第二组合中的权重导出模式,确定第二组合中K个预测模式分别对应的第一分量块预测值;
S201-E22-22、根据第二组合中K个预测模式分别对应的第一分量块预测值和第一分量块重建值,确定第二组合中K个预测模式分别对应的代价;
S201-E22-23、根据第二组合中K个预测模式分别对应的代价,确定第二组合对应的代价。例如,将第二组合中的K个预测模式分别对应的代价之和,确定为第二组合对应的代价。
上述S201-E23中根据R个第二组合中各第二组合对应的代价,构建候选组合列表的方式包括但不限于如下几种:
示例1,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序;将排序后的R个第二组合,确定为候选组合列表。
在该示例1中生成的候选组合列表包括R个候选组合。
可选的,该候选组合列表中R个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中R个候选组合对应的代价按照排序依次增大。
其中,根据R个第二组合中各第二组合对应的代价,对R个第二组合进行排序可以是,按照代价从小到大顺序,对R个第二组合进行排序。
示例2,根据第二组合对应的代价,从R个第二组合中选出B个第二组合,将这B个第二组合组成的列表,确定为候选组合列表。
可选的,上述B个第二组合为R个第二组合中代价最小的前B个第二组合。
可选的,该候选组合列表中B个候选组合按照代价的大小,从小到大进行排序,即候选组合列表中B个候选组合对应的代价按照排序依次增大。
下面对上述S201-E21中确定R个第二组合的过程进行介绍。
在一些实施例中,上述R个第二组合为预设的。这样使用预设的R个第二组合中的每个第二组合对当前分量块对应的第一分量块进行预测,得到每个第二组合对应的第一分量块预测值,再根据每个第二组合对应的第一分量块预测值和第一分量块的重建值,确定每个第二组合对应的代价,根据每个第二组合对应的代价,对R个第二组合进行排序,将排序后的R个第二组合作为候选组合列表,或者从排序后的R个第二组合中选出代价最小的B个第二组合构成候选组合列表。
在一些实施例中,S201-E21包括如下步骤:
S101-E21-1、确定C个权重导出模式和D个预测模式,C为正整数,D为大于或等于K的正整数;
S101-E21-2、根据C个权重导出模式和D个预测模式,构建R个第二组合,R个第二组合中的任一第二组合包括C个权重导出模式中的一权重导出模式、D个预测模式中的K个预测模式。
在该实施例中,编码端首先确定C个权重导出模式和D个预测模式,接着,根据确定的C个权重导出模式和D个预测模式,构建R个第二组合。
本申请实施例对上述C个权重导出模式和D个预测模式的具体个数不做限制。
此时,上述S201-E21-1中确定D个预测模式的实现方式包括但不限于如下几种方式:
方式一,D个预测模式为预设的预测模式。
方式二,确定当前分量块的候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,根据候选预测模式列表、K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式以及预设模式中的至少一个,确定D个预测模式。
其中,确定当前分量块的第三候选预测模式列表的方式至少包括如下几种示例:
示例1,根据与当前分量块相邻的至少一个块所使用的预测模式,确定第三候选预测模式列表。
示例2,若第三候选预测模式列表中不包括预设模式时,则确定当前分量块对应的预设模式;将预设模式添加至 第三候选预测模式列表中。
在一种示例中,上述预设模式为预设的几个预测模式。
在另一种示例中,通过确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定预设模式。
例如,若当前分量块对应的图像类型为B类型或P类型时,则预设模式包括DC,水平模式、竖直模式和角度模式中的至少一个。
示例3,确定当前分量块对应的图像类型,并根据当前分量块对应的图像类型,确定第三候选预测模式列表。例如,若当前分量块对应的图像类型为B类型或P类型时,则可以将DC,水平模式、竖直模式和一些角度模式中的至少一个,添加至第三候选预测模式列表中。再例如,若当前分量块对应的图像类型为I类型时,则可以将DC,水平模式、竖直模式中的至少一个,添加至第三候选预测模式列表中。
示例4,确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块(例如色度块和/或亮度块)所使用的第二预测模式、当前分量块周围已编码的第一分量块、第二分量块和第三分量块中至少一个分量块(例如亮度块和/或色度块)所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块(例如亮度块)所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
本申请实施例中,上述确定D个预测模式的具体实现方式,可以参照上述S101-A21-1中确定Q个预测模式的具体描述,在此不再赘述。在一些实施例中,上述D等于Q。
下面对S201-E21-1中确定C个权重导出模式的过程进行介绍。
在一些实施例中,上述C个权重导出模式为预设的。
在一些实施例中,上述C个权重导出模式为从预设的多个权重导出模式中筛选出的,例如根据当前分量块的大小和/或当前分量块对应的图像类型等信息,进行筛选,得到C个权重导出模式。可选的,还可以根据代价,从预设的多个权重导出模式中选择代价较小的C个权重导出模式。
在一些实施例中,确定X个过渡参数,根据X个过渡参数,确定C个权重导出模式。本申请实施例对X和C之间的大小关系不进行限定。
本申请实施例中,由于C个权重导出模式中每一个权重导出模式均包括一个过渡参数,这样,可以根据X个过渡参数,确定C个权重导出模式。例如,若权重导出模式除了包括过渡参数时,还包括其他的参数,此时,C个权重导出模式中至少一个两个权重导出模式所包括的过渡参数可以相同,也可以不同,进而可以根据X个过渡参数,确定出C个权重导出模式,例如,使用X个过渡参数组成的多个不同的权重导出模式,确定这多个不同的权重导出模式中每个权重导出模式对应的代价,进而选出代价最小的C个权重导出模式。
本申请实施例对上述确定X个过渡参数的具体方式不做限制。
在一些实施例中,上述X个过渡参数为预设的过渡参数,例如为1/4、1/2、1、2、4等。
在一些实施例中,根据当前分量块大的大小,确定X个过渡参数。
例如,若当前分量块的大小小于第三设定阈值时,则将预设的至少一个过渡参数中大于或等于第五值的过渡参数作为X个过渡参数。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则将至少一个过渡参数中小于或等于第六值的过渡参数作为X个过渡参数,所述第六值小于所述第五值。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则将至少一个过渡参数中小于或等于第六值的过渡参数作为X个过渡参数,第六值小于所述第五值。
再例如,若当前分量块的大小小于第三设定阈值时,则确定X过渡参数为预设的至少一个过渡参数位于第五过渡参数取值范围内的一个或多个过渡参数。
再例如,若当前分量块的大小大于或等于第三设定阈值时,则确定所述X过渡参数为至少一个过渡参数位于第六过渡参数取值范围内的一个或多个过渡参数,第六过渡参数取值范围的最小值小于第五过渡参数取值范围的最小值。
在一些实施例中,确定所述当前分量块的图像信息;根据当前分量块的图像信息,确定出X个过渡参数。
示例1,若当前分量块的图像边缘的清晰度小于预设值,则将预设的Y个过渡参数中的至少一个第三类过渡参数,确定为X个过渡参数,Y为大于X的正整数。
其中,第三类过渡参数可以理解为可以形成较宽过渡区域的过渡参数,例如为1/4、1/2等。
示例2,若当前分量块的图像边缘的清晰度大于或等于预设值,则将Y个过渡参数中的至少一个第四类过渡参数,确定为X个过渡参数,第四类过渡参数大于第三类过渡参数。
其中,第四类过渡参数可以理解为可以形成较窄过渡区域的过渡参数,例如为2、4等。
编码端根据上述步骤,确定出D个预测模式和C个权重导出模式和W个过渡参数后,根据这D个预测模式和C个权重导出模式,组成R个不同的第二组合。接着,根据R个第二组合,确定出候选组合列表,进而从这候选组合列表中,确定出第一权重导出模式和K个第一预测模式。
在一些实施例中,为了进一步提高候选组合列表的构建速度,则编码端对上述确定的D个预测模式、C个权重导出模式次进行筛选,此时,上述S101-E21-2中根据确定出的C个权重导出模式、D个预测模式,组成R个第二组合包括如下S201-E21-21至S201-E21-24的步骤:
S201-E21-21、从C权重导出模式中选出C1个权重导出模式,其中C1为小于或等于C的正整数。
上述S201-E21-21的具体实现过程可以参照上述S101-A11-21的描述,在此不再赘述。
根据上述步骤,编码端从C个权重导出模式中筛选出C1个权重导出模式后,执行如下S201-E21-22的步骤。
S201-E21-22、从D个预测模式中选出D1个预测模式,D1为小于或等于D的正整数。
上述S201-E21-22的具体实现过程可以参照上述S101-A11-22的描述,在此不再赘述。
根据上述步骤,从C个权重导出模式中选出C1个权重导出模式,从D个预测模式中选出D1个预测模式,接着,执行如下S101-E21-23。
S101-C21-23、根据C1个权重导出模式和D1个预测模式,组成R个第二组合。
上述S201-E21-23的具体实现过程可以参照上述S101-A11-23的描述,在此不再赘述。
根据上述方法,可以确定出R个第二组合后,可以确定出R个第二组合中每个第二组合的代价。
接着,根据R个第二组合中每个第二组合的代价,构建候选组合列表。
例如,根据第二组合的代价大小,按照从小到大的顺序,对R个第二组合进行排序,将排序后的R个第二组合确定为候选组合列表。
再例如,根据第二组合的代价大小,从R个第二组合中选出代价最小的B个第二组合,构成候选组合列表。
根据上述方法,确定出候选组合列表,该候选组合列表中各候选组合按照代价的大小从小到大进行排序,示例性的,该候选组合列表如上述表9所示。
这样,编码端从构建的候选组合列表中,确定出第一组合。
例如,将候选组合列表中的任一候选组合,确定为第一组合。
再例如,将候选组合列表中代价最小的候选组合,确定为第一组合。
根据上述方法,确定出第一组合后,执行如下S202。
本申请实施例,根据情况1、情况2和情况3,编码端确定出第一组合后,执行如下S202的步骤。
S202、根据第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
由上述S201可知,本申请实施例中,第一组合所包括的内容不同,例如,情况1中,第一组合包括第一权重导出模式和K个第一预测模式,但是不包括过渡参数。情况2中,第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数。本申请实施例,针对第一组合所包括的内容的不同,确定当前分量块的预测值的方法也不相同。情况3中,第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括第三过渡参数。本申请实施例,针对第一组合所包括的内容的不同,确定当前分量块的预测值的方法也不相同。
情况1,若第一组合包括第一权重导出模式和K个第一预测模式,且不包括过渡参数时,则上述S202包括的计算过程包括两种如下两种子情况:
情况11,根据第一权重导出模式,确定当前分量块的预测值权重,根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值,使用当前分量块的预测值权重对当前分量块的K个预测值进行加权,得到当前分量块的预测值。其中,根据第一权重导出模式,导出当前分量块的预测值权重的过程,可以参照上述实施例中导出当前块的预测值权重的过程,在此不再赘述。
在该情况11中,在确定当前分量块的预测值权重时,不考虑过渡参数对权重的影响。
在一些实施例中,若第一组合包括第一权重导出模式和K个第一预测模式,且不包括过渡参数时,还包括如下情况22。
情况22,虽然第一组合中包括过渡参数,但是在确定当前分量块的预测值时,考虑过渡参数的考虑,此时,上述S202包括如下S202-A1和S202-A2的步骤:
S202-A1、确定第一过渡参数;
S202-A2、根据第一过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对上述S202-A2的具体实现过程不做限制,例如,第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第一过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,上述S202-A2包括如下步骤:
S202-A21、根据第一过渡参数和第一权重导出模式,确定预测值的权重;
S202-A22、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S202-A23、根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S202-A22和S202-A21在执行顺序上没有先后顺序,即S202-A22可以在S202-A21之前执行,或者在S202-A21之后执行,或者与S202-A21并行执行。
在该情况1中,若第一组组合包括第一权重导出模式和K个第一预测模式,但不包括过渡参数时,则确定第一过渡参数,并根据该第一过渡参数和第一权重导出模式,确定预测值的权重。接着,根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
在一些实施例中,将预设的多个过渡参数中的一个过渡参数,确定为第一过渡参数。
在一些实施例中,确定候选过渡参数列表,该候选过渡参数列表中包括多个候选过渡参数,将候选过渡参数列表中的一个候选过渡参数,确定为第一过渡参数。
在一些实施例中,针对候选过渡参数列表的一个候选过渡参数,确定候选过渡参数对应的代价;根据候选过渡参数列表中各候选过渡参数对应的代价,从候选过渡参数列表中选择一个候选过渡参数,作为第一过渡参数。
在一些实施例中,确定候选过渡参数对应的代价,包括:根据候选过渡参数和第一权重导出模式,确定第一分量块的权重;根据K个第一预测模式对第一分量块进行预测,得到第一分量块的K个预测值;根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第一分量块的预测值;根据第一分量块的预测值和重建值,确定候选过渡参数对应的代价。
在一些实施例中,根据候选过渡参数和第一权重导出模式,确定第一分量块的权重,包括:根据第一权重导出模 式,确定第一分量块的一个权重;使用候选过渡参数,对第一分量块的一个权重进行调整,得到第一分量块的权重。
在一些实施例中,根据候选过渡参数列表中各候选过渡参数对应的代价,从候选过渡参数列表中选择一个候选过渡参数,作为第一过渡参数,包括:将候选过渡参数列表中代价最小的候选过渡参数,确定为第一过渡参数。
在一些实施例中,根据上述方法,确定出第一过渡参数后,在码流中写入第二索引,第二索引用于指示第一过渡参数,以便解码端快速确定出第一过渡参数。
在一些实施例中,编码端还可以通过如下方式2,确定第一过渡参数。
方式2,通过如下S202-A11和S202-A12的步骤,确定第一过渡参数。
S202-A11、确定G个备选过渡参数,G为正整数;
S202-A12、从G个备选过渡参数中,确定第一过渡参数。
本申请实施例对编码端确定G个备选过渡参数的具体方式不做限制。
在一种可能的实现方式中,上述G个备选过渡参数为预设的,也就是说,解码端和编码端约定将预设的几个过渡参数,确定为G个备选过渡参数。
在另一种可能的实现方式中,根据当前分量块的大小,确定G个备选过渡参数。
示例性的,块大小可以由块的长度、宽度或像素数来表示。
在另一种可能的实现方式中,确定当前分量块的图像信息;根据当前分量块的图像信息,从预设的多个备选过渡参数中,确定G个备选过渡参数。
示例性的,若图像信息包括图像边缘的清晰度时,则根据当前分量块的图像信息,从预设的多个备选过渡参数中,确定G个备选过渡参数包括如下两种方式:
第一种方式:若当前分量块的图像边缘的清晰度小于预设值,则将预设的多个备选过渡参数中的至少一个第一备选过渡参数,例如,1/4、1/2等,确定为G个备选过渡参数。
第二种方式:若当前分量块的图像边缘的清晰度大于或等于预设值,则将预设的多个备选过渡参数中的至少一个第二备选过渡参数,例如,2、4等,确定为G个备选过渡参数,其中第二备选过渡参数大于第一备选过渡参数。
编码确定G个备选过渡参数后,从这G个备选过渡参数中,确定第一过渡参数。
本申请实施例对从这G个备选过渡参数中,确定第一过渡参数的具体方式不做限制。
在一些实施例中,将G个备选过渡参数中的任一备选过渡参数,确定为第一过渡参数。
在一些实施例中,通过如下S202-A121和S202-A122的步骤,从G个备选过渡参数中,确定第一过渡参数:
S202-A121、针对G个备选过渡参数中的第g个备选过渡参数,确定第g个备选过渡参数对应的代价,g为从1到G的正整数;
S202-A122、根据G个备选过渡参数对应的代价,从G个备选过渡参数中,确定第一过渡参数。
在该实施例中,通过确定G个备选过渡参数中每一个备选过渡参数对应的代价,进而根据代价,从这G个备选过渡参数中,确定第一过渡参数。
本申请实施例中,确定G个备选过渡参数中每一个备选过渡参数对应的代价相同,为了便于描述,以第g个备选过渡参数为例进行说明。
本申请实施例对确定第g个备选过渡参数对应的代价的具体方式不做限制。
在一种可能的实现方式中,将第一权重导出模式、第g个备选过渡参数和K个第一预测模式作为一个组合,确定该组合对第一分量块进行预测时的代价。示例性的,S202-A121包括如下步骤:
S202-A1211、根据第一权重模式和第g个备选过渡参数,确定当前分量块对应的第一分量块的权重;
S202-A1212、根据K个第一预测模式对第一分量块进行预测,得到第一分量块的K个预测值;
S202-A1213、根据第一分量块的权重对第一分量块的K个预测值进行加权,得到第一分量块的预测值;
S202-A1214、根据第一分量块的预测值,确定第g个备选过渡参数对应的代价。
其中,上述S202-A1211中根据第一权重模式和第g个备选过渡参数,确定当前分量块对应的第一分量块的权重的具体过程可以参照上述实施例的描述。
例如,根据第一权重导出模式和第一分量块,确定第一分量块对应的第一权重;使用第g个备选过渡参数,对第一权重进行调整,得到调整后的第一权重;根据调整后的第一权重,确定第一分量块的权重。
参照上述方法,可以确定出G个备选过渡参数中每一个备选过渡参数对应的代价,进而根据代价,从G个备选过渡参数中确定出第一过渡参数。
例如,将G个备选过渡参数中代价最小的备选过渡参数,确定为第一过渡参数。
在一些实施例中,根据当前分量块的大小,确定第一过渡参数。
由上述可知,过渡参数与块的大小之间有一定的关联性,因此,本申请实施例还可以根据当前分量块的大小,确定第一过渡参数。
在一种可能的实现方式中,根据当前分量块的大小,将某一固定的过渡参数,确定为第一过渡参数。
例如,若当前分量块的大小小于第一设定阈值时,则确定第一过渡参数为第一值。
再例如,若当前分量块的大小大于或等于第一设定阈值时,则确定第一过渡参数为第二值,其中第二值小于所述第一值。
在另一种可能的实现方式中,根据当前分量块的大小,确定第一过渡参数所在的取值范围,进而将第一过渡参数确定为该取值范围内的值。
例如,若当前分量块的大小小于第一设定阈值时,则确定第一过渡参数位于第一过渡参数取值范围内。比如,确定第一过渡参数为第一过渡参数取值范围内的最小过渡参数、或最大过渡参数、或中间过渡参数等任意一个过渡参数。再比如,确定第一过渡参数为第一过渡参数取值范围内代价最小的过渡参数。其中,确定过渡参数代价的方法,可以 参照本申请其他实施例的描述,在此不再赘述。
再例如,若当前分量块的大小大于或等于第一设定阈值时,则确定第一过渡参数位于第二过渡参数取值范围内。比如,确定第一过渡参数为第二过渡参数取值范围内的最小过渡参数、或最大过渡参数、或中间过渡参数等任意一个过渡参数。再比如,确定第一过渡参数为第二过渡参数取值范围内代价最小的过渡参数。其中,第二过渡参数取值范围的最小值小于第一过渡参数取值范围的最小值,且第一过渡参数取值范围与第二过渡参数取值范围可以相交,也可以不相交,本申请实施例对此不做限制。
在该情况1中,根据上述步骤,确定出第一过渡参数后,执行上述S202-A2的步骤,根据第一过渡参数和第一权重导出模式,确定预测值的权重。
本申请实施例中,根据第一过渡参数和第一权重导出模式,确定预测值的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第一权重导出模式,导出预测值的权重时,需要确定多个中间变量,可以使用第一过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出预测值的权重。
示例2,根据第一权重导出模式和当前分量块,确定当前分量块对应的第二权重;使用第一过渡参数,对第二权重进行调整,得到调整后的第二权重;根据调整后的第二权重,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述对情况1中第一组合包括第一权重导出模式和K个第一预测模式,而不包括过渡参数时,确定当前分量块的预测值的过程进行介绍。
下面对情况2对应的当前分量块的预测中的确定过程进行介绍。
情况2,若第一组合包括第一权重导出模式、K个第一预测模式和第二过渡参数时,则上述S202包括:根据第二过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对根据第二过渡参数、第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值的具体实现方式不做限制,例如,第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第二过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,可以通过如下S202-B1至S202-B4的步骤,确定出当前分量块的预测值:
S202-B1、根据第一权重导出模式和第二过渡参数,确定预测值的权重;
S202-B2、根据K个第一预测模式,确定K个预测值;
S202-B3、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S202-B4、根据K个预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S202-B1和S202-B2在执行顺序上没有先后顺序,即S202-B1可以在S202-B2之前执行,或者在S202-B1之后执行,或者与S202-B2并行执行。
在该情况2中,若第一组组合包括第一权重导出模式、K个第一预测模式和第二过渡参数时,则编码端根据该第一过渡参数和第一权重导出模式,确定预测值的权重。根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
本申请实施例中,根据第二过渡参数和第一权重导出模式,确定预测值的权重的方式,至少包括如下几种示例所示的方式:
示例1,在使用第一权重导出模式,导出预测值的权重时,需要确定多个中间变量,可以使用第二过渡参数,对这多个中间变量中的某一个或某几个中间变量进行调整,进而使用调整后的变量,导出预测值的权重。
示例2,根据第一权重导出模式和当前分量块,确定当前分量块对应的第四权重;使用第二过渡参数,对第四权重进行调整,得到调整后的第四权重;根据调整后的第四权重,确定预测值的权重。
参照上述方法,根据第二过渡参数和第一权重导出模式,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述对情况2中第一组合包括第一权重导出模式、K个第一预测模式和一个过渡参数时,确定当前分量块的预测值的过程进行介绍。
下面对情况3对应的当前分量块的预测中的确定过程进行介绍。
情况3,若第一组合包括第一权重导出模式和K个第一预测模式,第一权重导出模式包括第三过渡参数时,则上述S202包括:根据第三过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
本申请实施例对第三过渡参数和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值的具体实现方式不做限制,例如,若第一权重导出模式还包括其他参数时,则根据第一权重导出模式中的其他参数和K个第一预测模式对当前分量块进行预测,得到一个预测值,接着根据第三过渡参数和该预测值,确定当前分量块的预测值。
在一些实施例中,可以通过如下S202-C1至S202-C4的步骤,确定出当前分量块的预测值:
S202-C1、根据第一权重导出模式,确定预测值的权重;
S202-C2、根据K个第一预测模式,确定K个预测值;
S202-C3、根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;
S202-C4、根据K个预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
上述S202-C1和S202-C2在执行顺序上没有先后顺序,即S202-C1可以在S202-C2之前执行,或者在S202-C2之后执行,或者与S202-C2并行执行。
在该情况3中,若第一组组合包括第一权重导出模式和K个第一预测模式时,则编码端根据第一权重导出模式, 确定预测值的权重。根据K个第一预测模式对当前分量块进行预测,得到当前分量块的K个预测值。然后,使用预测值的权重,对当前分量块的K个预测值进行加权处理,得到当前分量块的预测值。
本申请实施例中,根据第一权重导出模式,确定预测值的权重的方式不做限制。例如,根据第一权重导出模式,确定角度索引、距离索引和第三过渡参数,根据角度索引、距离索引、第三过渡参数和当前分量块的大小,确定预测值的权重。
接着,根据K个第一预测模式,对当前分量块进行预测,得到K个预测值;根据预测值的权重对K个预测值进行加权,得到当前分量块的预测值。
本申请实施例中,可以根据上述情况1、情况2和情况3中的任意一种方式,确定出当前分量块的预测值。
接着,编码端根据当前分量块的预测值,得到码流。
具体的,根据上述步骤确定出当前分量块的预测值后,根据当前分量块和当前分量块的预测值,得到当前分量块的残差值,对当前分量块的残差值进行变换,得到变换系数,对变换系数进行量化,得到量化系数,对量化系数进行编码,得到码流。
在一些实施例中,候选组合列表中包括一个候选组合,则编码端可以将该候选组合列表所包括的这一个候选组合确定为第一组合,此时编码端跳过在码流中写入第一索引,第一索引用于指示第一组合。
在一些实施例中,候选组合列表中包括多个候选组合,为了保持编解码两端的一致性,编码端通过第一索引向解码端指示第一组合,即编码端在码流中写入第一索引。这样解码端通过解码码流,得到该第一索引,进而根据该第一索引,在候选组合列表中确定出第一组合,进而使用第一组合所包括的第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值。
在一些实施例中,编码端确定至少一个标志,根据该至少一个标志,确定是否确定第一组合。
可选的,上述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
例如,上述至少一个标志包括序列级标志,该序列级标志用于指示当前序列是否允许采用本申请实施提供的组合编码技术方案。
在一些实施例中,若上述至少一个标志包括块级标志时,则上述编码端在确定当前分量块的大小满足预设条件时,确定块级标志。本申请实施例对上述预设条件不做限制。
在一些实施例中,若确定当前分量块不采用第一技术进行编码时,则确定第一组合。
本申请实施例提供的视频编码方法,编码端通过确定第一组合,该第一组合包括第一权重导出模式和K个第一预测模式,根据第一权重导出模式和K个第一预测模式对当前分量块进行预测,得到当前分量块的预测值,根据当前分量块的预测值,得到码流。本申请将第一权重导出模式和K个第一预测模式作为一个组合,以组合的形式指示第一权重导出模式和K个第一预测模式,这样在码流中不需要单独传输K个第一预测模式和第一权重导出模式分别对应的语法,进而节省码字,提升编码效率。另外,本申请实施例,在当前分量块对应多个第一分量CU,且多个第一分量CU的预测模式不完全相同时,也可以准确确定出第一组合所包括的第一权重导出模式和K个第一预测模式,进而使用该第一权重导出模式和K个第一预测模式,实现当前分量块的准确预测。在一些实施例中,本申请实施例通过第一过渡参数或第二过渡参数对预测值的权重进行调整,使用调整后的预测值权重进行预测,进而提高了预测准确性。
应理解,图16至图20仅为本申请的示例,不应理解为对本申请的限制。
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中字符“/”,一般表示前后关联对象是一种“或”的关系。
上文结合图16至图20,详细描述了本申请的方法实施例,下文结合图21至图23,详细描述本申请的装置实施例。
图21是本申请一实施例提供的视频解码装置的示意性框图,该视频解码装置10应用于上述视频解码器。
如图21所示,视频解码装置10包括:
解码单元11,用于解码码流,确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
预测单元12,用于根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
在一些实施例中,解码单元11,具体用于解码所述码流,确定候选组合列表,所述候选组合列表包括至少一个候选组合,所述至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式;根据所述候选组合列表,确定所述第一组合。
在一些实施例中,所述候选组合列表包括一个候选组合,解码单元11,具体用于将所述候选组合列表所包括的候选组合,确定为所述第一组合。
在一些实施例中,所述候选组合列表包括多个候选组合,解码单元11,具体用于解码所述码流,得到第一索引,所述第一索引用于指示所述第一组合;将所述候选组合列表中所述第一索引对应的候选组合,确定为所述第一组合。
在一些实施例中,解码单元11,具体用于解码所述码流,确定所述当前分量块对应的第一分量块;基于所述第 一分量块,构建所述候选组合列表。
在一些实施例中,所述第一分量块为当前图像中与所述当前分量块为同一个空间的亮度块。
在一些实施例中,解码单元11,具体用于确定R个第二组合,所述R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,所述R为大于1的正整数;对于所述R个第二组合中的任一第二组合,确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价;根据所述R个第二组合中各第二组合对应的代价,构建所述候选组合列表。
在一些实施例中,解码单元11,具体用于根据所述第二组合所包括的权重导出模式,确定所述第一分量块的权重;根据所述第二组合中的K个预测模式对所述第一分量块进行预测,得到所述第一分量块的K个预测值;根据所述第一分量块的权重对所述第一分量块的K个预测值进行加权,得到所述第二组合对应的第一分量块的预测值;根据所述第二组合对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合对应的代价。
在一些实施例中,解码单元11,具体用于根据所述第二组合中的权重导出模式,确定所述第二组合中K个预测模式分别对应的第一分量块的预测值;根据所述第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合中K个预测模式分别对应的代价;根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价。
在一些实施例中,解码单元11,具体用于将所述第二组合中的K个预测模式分别对应的代价之和,确定为所述第二组合对应的代价。
在一些实施例中,解码单元11,具体用于确定P个权重导出模式和Q个预测模式,所述P为正整数,所述Q为大于或等于K的正整数;根据所述P个权重导出模式和所述Q个预测模式,构建所述R个第二组合,所述R个第二组合中的任一第二组合包括所述P个权重导出模式中的一权重导出模式和所述Q个预测模式中的K个预测模式。
在一些实施例中,解码单元11,具体用于确定所述当前分量块的候选预测模式列表、所述K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式、以及预设模式中的至少一个,所述候选预测模式列表包括多个候选预测模式,所述K个预测模式中任一预测模式对应的备选预测模式列表包至少一个备选预测模式;根据所述候选预测模式列表、所述K个预测模式分别对应的备选预测模式列表、以及所述权重导出模式对应的预测模式中的至少一个,确定所述Q个预测模式。
在一些实施例中,解码单元11,具体用于确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第二预测模式、当前分量块周围已解码的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
在一些实施例中,解码单元11,具体用于确定所述第一分量块的纹理方向;根据所述纹理方向,确定所述第五预测模式。
在一些实施例中,解码单元11,具体用于将预测方向与所述纹理方向平行的预测模式,确定为所述第五预测模式;和/或,将预测方向与所述纹理方向垂直的预测模式,确定为所述第五预测模式。
在一些实施例中,解码单元11,具体用于根据预设的纹理点选择方式,选出所述第一分量块中的多个纹理点;确定所述多个纹理点分别对应的纹理方向;将所述多个纹理点分别对应的纹理方向中的一个或多个,确定为所述第一分量块的纹理方向。
在一些实施例中,解码单元11,具体用于将所述多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为所述第一分量块的纹理方向。
在一些实施例中,解码单元11,具体用于从预设的M个权重导出模式中,选出所述P个权重导出模式,所述M为大于或等于P的正整数。
在一些实施例中,预测单元12,具体用于确定第一过渡参数;根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,预测单元12,具体用于根据所述第一过渡参数和所述第一权重导出模式,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,所述第一组合包括第二过渡参数,预测单元12,具体用于根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,预测单元12,具体用于根据所述第二过渡参数和所述第一权重导出模式,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,所述第一权重导出模式包括第三过渡参数,预测单元12,具体用于根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,预测单元12,具体用于根据所述第三过渡参数,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,解码单元11,还用于解码所述码流,得到至少一个标志,所述至少一个标志用于指示是否使用第一组合对所述当前分量块进行解码;若所述至少一个标志指示使用所述第一组合对所述当前分量块进行解码时,解码所述码流,确定所述第一组合。
在一些实施例中,所述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图21所示的装置10可以执行本申请实施例的解码端的解码方法,并且装置10中的各个单元的前述和其它操作和/或功能分别为了实现上述解码端的解码方法等各个方法中的相应流程,为了简洁,在此不再赘述。
图22是本申请一实施例提供的视频编码装置的示意性框图,该视频编码装置应用于上述编码器。
如图22所示,该视频编码装置20可以包括:
确定单元21,用于确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
预测单元22,用于根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
在一些实施例中,确定单元21,具体用于确定候选组合列表,所述候选组合列表包括至少一个候选组合,所述至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式;根据所述候选组合列表,确定所述第一组合。
在一些实施例中,预测单元22,还用于所述候选组合列表包括一个候选组合,则跳过在码流中写入第一索引,所述第一索引用于指示所述第一组合。
在一些实施例中,预测单元22,还用于所述候选组合列表包括多个候选组合,则在码流中写入第一索引,所述第一索引用于指示所述第一组合。
在一些实施例中,确定单元21,具体用于确定所述当前分量块对应的第一分量块;基于所述第一分量块,构建所述候选组合列表。
在一些实施例中,所述第一分量块为当前图像中与所述当前分量块为同一个空间的亮度块。
在一些实施例中,确定单元21,具体用于确定R个第二组合,所述R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,所述R为大于1的正整数;对于所述R个第二组合中的任一第二组合,确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价;根据所述R个第二组合中各第二组合对应的代价,构建所述候选组合列表。
在一些实施例中,确定单元21,具体用于根据所述第二组合所包括的权重导出模式,确定所述第一分量块的权重;根据所述第二组合中的K个预测模式对所述第一分量块进行预测,得到所述第一分量块的K个预测值;根据所述第一分量块的权重对所述第一分量块的K个预测值进行加权,得到所述第二组合对应的第一分量块的预测值;根据所述第二组合对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合对应的代价。
在一些实施例中,确定单元21,具体用于根据所述第二组合中的权重导出模式,确定所述第二组合中K个预测模式分别对应的第一分量块的预测值;根据所述第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合中K个预测模式分别对应的代价;根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价。
在一些实施例中,确定单元21,具体用于将所述第二组合中的K个预测模式分别对应的代价之和,确定为所述第二组合对应的代价。
在一些实施例中,确定单元21,具体用于确定P个权重导出模式和Q个预测模式,所述P为正整数,所述Q为大于或等于K的正整数;根据所述P个权重导出模式和所述Q个预测模式,构建所述R个第二组合,所述R个第二组合中的任一第二组合包括所述P个权重导出模式中的一权重导出模式和所述Q个预测模式中的K个预测模式。
在一些实施例中,确定单元21,具体用于确定所述当前分量块的候选预测模式列表、所述K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式、以及预设模式中的至少一个,所述候选预测模式列表包括多个候选预测模式,所述K个预测模式中任一预测模式对应的备选预测模式列表包至少一个备选预测模式;根据所述候选预测模式列表、所述K个预测模式分别对应的备选预测模式列表、以及所述权重导出模式对应的预测模式中的至少一个,确定所述Q个预测模式。
在一些实施例中,确定单元21,具体用于确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第二预测模式、当前分量块周围已编码的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第三预测模式、当前分量块的内部预设区域对应的第一分量块所使用的第四预测模式、当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;根据第二预测模式、第三预测模式、第四预测模式和第五预测模式中的至少一个,确定当前分量块的候选预测模式列表。
在一些实施例中,确定单元21,具体用于确定所述第一分量块的纹理方向;根据所述纹理方向,确定所述第五预测模式。
在一些实施例中,确定单元21,具体用于将与所述纹理方向的角度平行的预测模式,确定为所述第五预测模式;和/或,将与所述纹理方向的角度垂直的预测模式,确定为所述第五预测模式。
在一些实施例中,确定单元21,具体用于根据预设的纹理点选择方式,选出所述第一分量块中的多个纹理点;确定所述多个纹理点分别对应的纹理方向;将所述多个纹理点分别对应的纹理方向中的一个或多个,确定为所述第一分量块的纹理方向。
在一些实施例中,确定单元21,具体用于将所述多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为所述第一分量块的纹理方向。
在一些实施例中,确定单元21,具体用于从预设的M个权重导出模式中,选出所述P个权重导出模式,所述M为大于或等于P的正整数。
在一些实施例中,确定单元21,具体用于确定第一过渡参数;根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,确定单元21,具体用于根据所述第一过渡参数和所述第一权重导出模式,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,所述第一组合包括第二过渡参数,则确定单元21,具体用于根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,确定单元21,具体用于根据所述第二过渡参数和所述第一权重导出模式,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,所述第一权重导出模式包括第三过渡参数,则在一些实施例中,确定单元21,具体用于根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
在一些实施例中,确定单元21,具体用于根据所述第三过渡参数,确定预测值的权重;根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
在一些实施例中,确定单元21,还用于确定至少一个标志,所述至少一个标志用于指示是否使用第一组合对所述当前分量块进行解码;若所述至少一个标志指示使用所述第一组合对所述当前分量块进行解码时,确定所述第一组合。
在一些实施例中,所述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图22所示的装置20可以对应于执行本申请实施例的编码端的编码方法中的相应主体,并且装置20中的各个单元的前述和其它操作和/或功能分别为了实现编码端的编码方法等各个方法中的相应流程,为了简洁,在此不再赘述。
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。
图23是本申请实施例提供的电子设备的示意性框图。
如图23所示,该电子设备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中的执行过程。
如图23所示,该电子设备30还可包括:
收发器33,该收发器33可连接至该处理器32或存储器33。
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
图24是本申请实施例提供的视频编解码系统的示意性框图。
如图24所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够 执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。
本申请还提供了一种码流,该码流是根据上述编码方法生成的。
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本申请中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。

Claims (58)

  1. 一种视频解码方法,其特征在于,包括:
    解码码流,确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
    根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
  2. 根据权利要求1所述的方法,其特征在于,所述解码码流,确定第一组合,包括:
    解码所述码流,确定候选组合列表,所述候选组合列表包括至少一个候选组合,所述至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式;
    根据所述候选组合列表,确定所述第一组合。
  3. 根据权利要求2所述的方法,其特征在于,所述候选组合列表包括一个候选组合,所述根据所述候选组合列表,确定所述第一组合,包括:
    将所述候选组合列表所包括的候选组合,确定为所述第一组合。
  4. 根据权利要求2所述的方法,其特征在于,所述候选组合列表包括多个候选组合,所述根据所述候选组合,确定所述第一组合,包括:
    解码所述码流,得到第一索引,所述第一索引用于指示所述第一组合;
    将所述候选组合列表中所述第一索引对应的候选组合,确定为所述第一组合。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述解码所述码流,确定候选组合列表,包括:
    解码所述码流,确定所述当前分量块对应的第一分量块;
    基于所述第一分量块,构建所述候选组合列表。
  6. 根据权利要求5所述的方法,其特征在于,所述第一分量块为当前图像中与所述当前分量块为同一个空间的第一分量块。
  7. 根据权利要求5所述的方法,其特征在于,所述基于所述第一分量块,构建所述候选组合列表,包括:
    确定R个第二组合,所述R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,所述R为大于1的正整数;
    对于所述R个第二组合中的任一第二组合,确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价;
    根据所述R个第二组合中各第二组合对应的代价,构建所述候选组合列表。
  8. 根据权利要求7所述的方法,其特征在于,所述确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价,包括:
    根据所述第二组合所包括的权重导出模式,确定所述第一分量块的权重;
    根据所述第二组合中的K个预测模式对所述第一分量块进行预测,得到所述第一分量块的K个预测值;
    根据所述第一分量块的权重对所述第一分量块的K个预测值进行加权,得到所述第二组合对应的第一分量块的预测值;
    根据所述第二组合对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合对应的代价。
  9. 根据权利要求7所述的方法,其特征在于,所述确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价,包括:
    根据所述第二组合中的权重导出模式,确定所述第二组合中K个预测模式分别对应的第一分量块的预测值;
    根据所述第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合中K个预测模式分别对应的代价;
    根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价。
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价,包括:
    将所述第二组合中的K个预测模式分别对应的代价之和,确定为所述第二组合对应的代价。
  11. 根据权利要求7-10任一项所述的方法,其特征在于,所述确定R个第二组合,包括:
    确定P个权重导出模式和Q个预测模式,所述P为正整数,所述Q为大于或等于K的正整数;
    根据所述P个权重导出模式和所述Q个预测模式,构建所述R个第二组合,所述R个第二组合中的任一第二组合包括所述P个权重导出模式中的一权重导出模式和所述Q个预测模式中的K个预测模式。
  12. 根据权利要求11所述的方法,其特征在于,确定Q个预测模式,包括:
    确定所述当前分量块的候选预测模式列表、所述K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式、以及预设模式中的至少一个,所述候选预测模式列表包括多个候选预测模式,所述K个预测模式中任一预测模式对应的备选预测模式列表包至少一个备选预测模式;
    根据所述候选预测模式列表、所述K个预测模式分别对应的备选预测模式列表、以及所述权重导出模式对应的预测模式中的至少一个,确定所述Q个预测模式。
  13. 根据权利要求11所述的方法,其特征在于,所述确定所述当前分量块的候选预测模式列表,包括:
    确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第二预测模式、所述当前分量块周围已解码的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第三预测模式、所述当前分量块的内部预设区域对应的第一分量块所使用的第四预测模式、所述当前分量块对应的第一分量块所相关的第五预测模式中的至少一个;
    根据所述第二预测模式、所述第三预测模式、所述第四预测模式和所述第五预测模式中的至少一个,确定所述当 前分量块的候选预测模式列表。
  14. 根据权利要求13所述的方法,其特征在于,确定所述当前分量块对应的第一分量块所相关的第五预测模式,包括:
    确定所述当前分量块对应的第一分量块的纹理方向;
    根据所述纹理方向,确定所述第五预测模式。
  15. 根据权利要求14所述的方法,其特征在于,所述根据所述纹理方向,确定所述第五预测模式,包括:
    将预测方向与所述纹理方向平行的预测模式,确定为所述第五预测模式;和/或,
    将预测方向与所述纹理方向垂直的预测模式,确定为所述第五预测模式。
  16. 根据权利要求14所述的方法,其特征在于,所述确定所述当前分量块对应的第一分量块的纹理方向,包括:
    根据预设的纹理点选择方式,选出所述第一分量块中的多个纹理点;
    确定所述多个纹理点分别对应的纹理方向;
    将所述多个纹理点分别对应的纹理方向中的一个或多个,确定为所述第一分量块的纹理方向。
  17. 根据权利要求16所述的方法,其特征在于,所述将所述多个纹理点分别对应的纹理方向中的一个或多个,确定为所述第一分量块的纹理方向,包括:
    将所述多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为所述第一分量块的纹理方向。
  18. 根据权利要求10所述的方法,其特征在于,所述确定P个权重导出模式,包括:
    从预设的M个权重导出模式中,选出所述P个权重导出模式,所述M为大于或等于P的正整数。
  19. 根据权利要求1-4、6-10、12-18任一项所述的方法,其特征在于,所述根据所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    确定第一过渡参数;
    根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  20. 根据权利要求19所述的方法,其特征在于,所述根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第一过渡参数和所述第一权重导出模式,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  21. 根据权利要求1-4、6-10、12-18任一项所述的方法,其特征在于,所述第一组合包括第二过渡参数,则所述根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  22. 根据权利要求21所述的方法,其特征在于,所述根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第二过渡参数和所述第一权重导出模式,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  23. 根据权利要求1-4、6-10、12-18任一项所述的方法,其特征在于,所述第一权重导出模式包括第三过渡参数,则所述根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  24. 根据权利要求23所述的方法,其特征在于,所述根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第三过渡参数,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  25. 根据权利要求1-4、6-10、12-18任一项所述的方法,其特征在于,所述方法还包括:
    解码所述码流,得到至少一个标志,所述至少一个标志用于指示是否使用第一组合对所述当前分量块进行解码;
    所述解码码流,确定第一组合,包括:
    若所述至少一个标志指示使用所述第一组合对所述当前分量块进行解码时,解码所述码流,确定所述第一组合。
  26. 根据权利要求25所述的方法,其特征在于,所述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
  27. 一种视频编码方法,其特征在于,包括:
    确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
    根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,所述当前分量块包括第二分量块或第三分量块。
  28. 根据权利要求27所述的方法,其特征在于,所述确定第一组合,包括:
    确定候选组合列表,所述候选组合列表包括至少一个候选组合,所述至少一个候选组合中的任一候选组合包括一个权重导出模式和K个预测模式;
    根据所述候选组合列表,确定所述第一组合。
  29. 根据权利要求28所述的方法,其特征在于,所述方法还包括:
    所述候选组合列表包括一个候选组合,则跳过在码流中写入第一索引,所述第一索引用于指示所述第一组合。
  30. 根据权利要求28所述的方法,其特征在于,所述方法还包括:
    若所述候选组合列表包括多个候选组合时,则在码流中写入第一索引,所述第一索引用于指示所述第一组合。
  31. 根据权利要求28-30任一项所述的方法,其特征在于,所述确定候选组合列表,包括:
    确定所述当前分量块对应的第一分量块;
    基于所述第一分量块,构建所述候选组合列表。
  32. 根据权利要求31所述的方法,其特征在于,所述第一分量块为当前图像中与所述当前分量块为同一个空间的第一分量块。
  33. 根据权利要求31所述的方法,其特征在于,所述基于所述第一分量块,构建所述候选组合列表,包括:
    确定R个第二组合,所述R个第二组合中的任一第二组合包括一权重导出模式和K个预测模式,所述R为大于1的正整数;
    对于所述R个第二组合中的任一第二组合,确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价;
    根据所述R个第二组合中各第二组合对应的代价,构建所述候选组合列表。
  34. 根据权利要求33所述的方法,其特征在于,所述确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价,包括:
    根据所述第二组合所包括的权重导出模式,确定所述第一分量块的权重;
    根据所述第二组合中的K个预测模式对所述第一分量块进行预测,得到所述第一分量块的K个预测值;
    根据所述第一分量块的权重对所述第一分量块的K个预测值进行加权,得到所述第二组合对应的第一分量块的预测值;
    根据所述第二组合对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合对应的代价。
  35. 根据权利要求33所述的方法,其特征在于,所述确定使用所述第二组合对所述第一分量块进行预测时,所述第二组合对应的代价,包括:
    根据所述第二组合中的权重导出模式,确定所述第二组合中K个预测模式分别对应的第一分量块的预测值;
    根据所述第二组合中K个预测模式分别对应的第一分量块的预测值和所述第一分量块的重建值,确定所述第二组合中K个预测模式分别对应的代价;
    根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价。
  36. 根据权利要求35所述的方法,其特征在于,所述根据所述第二组合中K个预测模式分别对应的代价,确定所述第二组合对应的代价,包括:
    将所述第二组合中的K个预测模式分别对应的代价之和,确定为所述第二组合对应的代价。
  37. 根据权利要求33-36任一项所述的方法,其特征在于,所述确定R个第二组合,包括:
    确定P个权重导出模式和Q个预测模式,所述P为正整数,所述Q为大于或等于K的正整数;
    根据所述P个权重导出模式和所述Q个预测模式,构建所述R个第二组合,所述R个第二组合中的任一第二组合包括所述P个权重导出模式中的一权重导出模式和所述Q个预测模式中的K个预测模式。
  38. 根据权利要求37所述的方法,其特征在于,确定Q个预测模式,包括:
    确定所述当前分量块的候选预测模式列表、所述K个第一预测模式分别对应的备选预测模式列表、权重导出模式对应的预测模式、以及预设模式中的至少一个,所述候选预测模式列表包括多个候选预测模式,所述K个预测模式中任一预测模式对应的备选预测模式列表包至少一个备选预测模式;
    根据所述候选预测模式列表、所述K个预测模式分别对应的备选预测模式列表、以及所述权重导出模式对应的预测模式中的至少一个,确定所述Q个预测模式。
  39. 根据权利要求11所述的方法,其特征在于,所述确定所述当前分量块的候选预测模式列表,包括:
    确定预设位置的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第二预测模式、所述当前分量块周围已编码的第一分量块、第二分量块和第三分量块中至少一个分量块所使用的第三预测模式、所述当前分量块的内部预设区域对应的第一分量块所使用的第四预测模式、所述当前分量块对应的第一分量块所相关的对应的第五预测模式中的至少一个;
    根据所述第二预测模式、所述第三预测模式、所述第四预测模式和所述第五预测模式中的至少一个,确定所述当前分量块的候选预测模式列表。
  40. 根据权利要求39所述的方法,其特征在于,确定所述当前分量块对应的第一分量块所相关的对应的第五预测模式,包括:
    确定所述当前分量块对应的第一分量块的纹理方向;
    根据所述纹理方向,确定所述第五预测模式。
  41. 根据权利要求40所述的方法,其特征在于,所述根据所述纹理方向,确定所述第五预测模式,包括:
    将与所述纹理方向的角度平行的预测模式,确定为所述第五预测模式;和/或,
    将与所述纹理方向的角度垂直的预测模式,确定为所述第五预测模式。
  42. 根据权利要求40所述的方法,其特征在于,所述确定所述当前分量块对应的第一分量块的纹理方向,包括:
    根据预设的纹理点选择方式,选出所述第一分量块中的多个纹理点;
    确定所述多个纹理点分别对应的纹理方向;
    将所述多个纹理点分别对应的纹理方向中的一个或多个,确定为所述第一分量块的纹理方向。
  43. 根据权利要求42所述的方法,其特征在于,所述将所述多个纹理点分别对应的纹理方向中的一个或多个, 确定为所述第一分量块的纹理方向,包括:
    将所述多个纹理点分别对应的纹理方向中出现次数最多的一个或多个,确定为所述第一分量块的纹理方向。
  44. 根据权利要求37所述的方法,其特征在于,所述确定P个权重导出模式,包括:
    从预设的M个权重导出模式中,选出所述P个权重导出模式,所述M为大于或等于P的正整数。
  45. 根据权利要求27-30、32-36、38-44任一项所述的方法,其特征在于,所述根据所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    确定第一过渡参数;
    根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  46. 根据权利要求45所述的方法,其特征在于,所述根据所述第一过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第一过渡参数和所述第一权重导出模式,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  47. 根据权利要求27-30、32-36、38-44任一项所述的方法,其特征在于,所述第一组合包括第二过渡参数,则所述根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  48. 根据权利要求47所述的方法,其特征在于,所述根据所述第二过渡参数、所述第一权重导出模式和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第二过渡参数和所述第一权重导出模式,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  49. 根据权利要求27-30、32-36、38-44任一项所述的方法,其特征在于,所述第一权重导出模式包括第三过渡参数,则所述根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值。
  50. 根据权利要求49所述的方法,其特征在于,所述根据所述第三过渡参数和所述K个第一预测模式对所述当前分量块进行预测,得到所述当前分量块的预测值,包括:
    根据所述第三过渡参数,确定预测值的权重;
    根据所述K个第一预测模式对所述当前分量块进行预测,得到K个预测值;
    根据所述预测值的权重对所述K个预测值进行加权,得到所述当前分量块的预测值。
  51. 根据权利要求27-30、32-36、38-44任一项所述的方法,其特征在于,所述方法还包括:
    确定至少一个标志,所述至少一个标志用于指示是否使用第一组合对所述当前分量块进行解码;
    所述确定第一组合,包括:
    若所述至少一个标志指示使用所述第一组合对所述当前分量块进行解码时,确定所述第一组合。
  52. 根据权利要求51所述的方法,其特征在于,所述至少一个标志包括序列级标志、图像级标志、片级标志、单元级标志和块级标志中的至少一个。
  53. 一种视频解码装置,其特征在于,包括:
    解码单元,用于解码码流,确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
    预测单元,用于根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值。
  54. 一种视频编码装置,其特征在于,包括:
    确定单元,用于确定第一组合,所述第一组合包括第一权重导出模式和K个第一预测模式,所述K为大于1的正整数;
    预测单元,用于根据所述第一权重导出模式和所述K个第一预测模式对当前分量块进行预测,得到所述当前分量块的预测值。
  55. 一种电子设备,其特征在于,包括处理器和存储器;
    所示存储器用于存储计算机程序;
    所述处理器用于调用并运行所述存储器中存储的计算机程序,以实现上述权利要求1至26或27至52任一项所述的方法。
  56. 一种视频编解码系统,其特征在于,包括:视频编码器和视频解码器;
    所述的视频解码器用于实现上述权利要求1至26任一项所述的方法;
    所述的视频编码器用于实现上述权利要求27至52任一项所述的方法。
  57. 一种计算机可读存储介质,其特征在于,用于存储计算机程序;
    所述计算机程序使得计算机执行如上述权利要求1至26或27至52任一项所述的方法。
  58. 一种码流,其特征在于,所述码流基于上述权利要求27至52任一项所述的方法生成。
PCT/CN2022/103734 2022-07-04 2022-07-04 视频编解码方法、装置、设备、系统、及存储介质 WO2024007128A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/103734 WO2024007128A1 (zh) 2022-07-04 2022-07-04 视频编解码方法、装置、设备、系统、及存储介质
TW112124176A TW202404356A (zh) 2022-07-04 2023-06-28 視訊編解碼方法、裝置、設備、系統、儲存媒介、及碼流

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
WO2024007128A1 true WO2024007128A1 (zh) 2024-01-11

Family

ID=89454715

Family Applications (1)

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

Country Status (2)

Country Link
TW (1) TW202404356A (zh)
WO (1) WO2024007128A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200177878A1 (en) * 2017-06-21 2020-06-04 Lg Electronics Inc Intra-prediction mode-based image processing method and apparatus therefor
CN113170109A (zh) * 2018-11-30 2021-07-23 交互数字Vc控股公司 视频编码/解码中通用预测的统一化的处理和语法
WO2022104498A1 (zh) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 帧内预测方法、编码器、解码器以及计算机存储介质
WO2022117089A1 (zh) * 2020-12-03 2022-06-09 Oppo广东移动通信有限公司 预测方法、编码器、解码器以及存储介质
WO2022116113A1 (zh) * 2020-12-03 2022-06-09 Oppo广东移动通信有限公司 一种帧内预测方法、装置及解码器和编码器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200177878A1 (en) * 2017-06-21 2020-06-04 Lg Electronics Inc Intra-prediction mode-based image processing method and apparatus therefor
CN113170109A (zh) * 2018-11-30 2021-07-23 交互数字Vc控股公司 视频编码/解码中通用预测的统一化的处理和语法
WO2022104498A1 (zh) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 帧内预测方法、编码器、解码器以及计算机存储介质
WO2022117089A1 (zh) * 2020-12-03 2022-06-09 Oppo广东移动通信有限公司 预测方法、编码器、解码器以及存储介质
WO2022116113A1 (zh) * 2020-12-03 2022-06-09 Oppo广东移动通信有限公司 一种帧内预测方法、装置及解码器和编码器

Also Published As

Publication number Publication date
TW202404356A (zh) 2024-01-16

Similar Documents

Publication Publication Date Title
KR102616713B1 (ko) 이미지 예측 방법, 장치 및 시스템, 디바이스 및 저장 매체
US11962783B2 (en) Encoder, a decoder and corresponding methods of deblocking filter adaptation
CN114885159B (zh) 位置相关预测组合的模式相关和大小相关块级限制的方法和装置
CN113196748B (zh) 帧内预测方法及相关装置
WO2020119814A1 (zh) 图像重建方法和装置
CN116567207B (zh) 用于帧内预测的方法和装置
AU2023229600A1 (en) Picture partitioning method and apparatus
WO2024007128A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2023197433A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2023123736A1 (zh) 预测方法、装置、设备、系统、及存储介质
WO2024077553A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2023123478A1 (zh) 预测方法、装置、设备、系统、及存储介质
WO2024108391A1 (zh) 视频编解码方法、装置、设备、系统、及存储介质
WO2023122968A1 (zh) 帧内预测方法、设备、系统、及存储介质
WO2023220970A1 (zh) 视频编码方法、装置、设备、系统、及存储介质
WO2023122969A1 (zh) 帧内预测方法、设备、系统、及存储介质
US20230319267A1 (en) Video coding method and video decoder
WO2020143684A1 (zh) 图像预测方法、装置、设备、系统及存储介质

Legal Events

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

Ref document number: 22949718

Country of ref document: EP

Kind code of ref document: A1