WO2022174467A1 - 帧内预测方法、编码器、解码器以及存储介质 - Google Patents

帧内预测方法、编码器、解码器以及存储介质 Download PDF

Info

Publication number
WO2022174467A1
WO2022174467A1 PCT/CN2021/077324 CN2021077324W WO2022174467A1 WO 2022174467 A1 WO2022174467 A1 WO 2022174467A1 CN 2021077324 W CN2021077324 W CN 2021077324W WO 2022174467 A1 WO2022174467 A1 WO 2022174467A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
intra
prediction mode
prediction
mpm list
Prior art date
Application number
PCT/CN2021/077324
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/CN2021/077324 priority Critical patent/WO2022174467A1/zh
Priority to EP21926184.9A priority patent/EP4297406A1/en
Priority to CN202311667837.7A priority patent/CN117676133A/zh
Priority to JP2023549679A priority patent/JP2024511272A/ja
Priority to KR1020237031641A priority patent/KR20230147149A/ko
Priority to MX2023009740A priority patent/MX2023009740A/es
Priority to CN202180092098.6A priority patent/CN116830584A/zh
Publication of WO2022174467A1 publication Critical patent/WO2022174467A1/zh
Priority to US18/450,377 priority patent/US20230403392A1/en

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/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • 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
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the embodiments of the present application relate to the technical field of image processing, and in particular, to an intra-frame prediction method, an encoder, a decoder, and a storage medium.
  • VVC Versatile Video Coding
  • HEVC High Efficiency Video Coding
  • DC Direct Current
  • the embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium, which can reduce hardware implementation costs, reduce complexity, and implement simple and efficient encoding and decoding on the basis of improving the accuracy of intra-frame prediction method to improve compression performance.
  • an embodiment of the present application provides an intra-frame prediction method, which is applied to a decoder, and the method includes:
  • the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra prediction value of the current block, determining a first mode index and a second mode index of the current block;
  • a first intra prediction mode and a second intra prediction mode of the current block are determined according to the first mode index, the second mode index and the MPM list; wherein the first intra prediction mode and The second intra-frame prediction modes are two different intra-frame angle prediction modes;
  • a weight matrix of the current block is determined, and a prediction value of the current block is determined based on the first intra prediction mode, the second intra prediction mode and the weight matrix.
  • an embodiment of the present application provides an intra-frame prediction method, which is applied to an encoder, and the method includes:
  • the first intra prediction mode and the second intra prediction mode of the current block are determined; wherein the first intra prediction mode and the second intra prediction mode are determined.
  • the second intra-frame prediction mode is two different intra-frame angle prediction modes;
  • an embodiment of the present application provides an encoder, the encoder includes: a first determining part, a first constructing part, an encoding part,
  • the first determination part is configured to determine the first intra prediction mode and the second intra prediction mode of the current block when the current block uses the IWCP mode to determine the intra prediction value of the current block; wherein, the The first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes;
  • the first construction part configured to construct the MPM list of the current block
  • the first determining part is further configured to determine the first mode index and the second mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list;
  • the encoding part is configured to write the first mode index and the second mode index into a code stream.
  • an embodiment of the present application provides a decoder, the decoder includes: a decoding part, a second determining part, a second constructing part,
  • the decoding part is configured to decode the code stream
  • the second determination part is configured to determine the intra prediction mode parameter of the current block; when the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra prediction value of the current block, determine the the first mode index and the second mode index of the current block;
  • a second building part configured to build the most probable mode MPM list of the current block
  • the second determining part is further configured to determine a first intra prediction mode and a second intra prediction mode of the current block according to the first mode index, the second mode index and the MPM list; wherein , the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes; the weight matrix of the current block is determined, and based on the first intra-frame prediction mode, the Two intra-frame prediction modes and the weight matrix determine the prediction value of the current block.
  • an embodiment of the present application provides an encoder, where the encoder includes a first processor and a first memory storing an executable instruction of the first processor, when the instruction is executed, the When executed by the first processor, the intra-frame prediction method described above is implemented.
  • an embodiment of the present application provides a decoder, where the decoder includes a second processor and a second memory storing an executable instruction of the second processor, when the instruction is executed, the When executed by the second processor, the intra-frame prediction method described above is implemented.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by the first processor, the intra-frame prediction method according to the first aspect is implemented, Alternatively, the intra prediction method as described in the second aspect is implemented when executed by the second processor.
  • the embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium.
  • the decoder decodes a code stream and determines an intra-frame prediction mode parameter of a current block; when the intra-frame prediction mode parameter indicates that the current block uses the IWCP mode
  • determine the intra-frame prediction value of the current block determine the first mode index and the second mode index of the current block; construct the most probable mode MPM list of the current block; determine the current block according to the first mode index, the second mode index and the MPM list
  • the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes; the weight matrix of the current block is determined and based The first intra prediction mode, the second intra prediction mode and the weight matrix determine the prediction value of the current block.
  • the encoder determines the first intra prediction mode and the second intra prediction mode of the current block; wherein, the first intra prediction mode and the second intra prediction The mode is two different intra-frame angle prediction modes; the MPM list of the current block is constructed; the first mode index and the second mode index of the current block are determined according to the first intra-frame prediction mode, the second intra-frame prediction mode and the MPM list; Write the first mode index and the second mode index into the code stream. That is to say, in the embodiment of the present application, the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • Figure 1 is a schematic diagram 1 of weight allocation
  • Figure 2 is a schematic diagram 2 of weight distribution
  • 3 is a schematic diagram of intra prediction
  • Fig. 4 is a kind of composition block diagram of video coding system
  • Figure 5 is a block diagram of a video decoding system
  • FIG. 6 is a schematic diagram 1 of the implementation flow of the intra-frame prediction method
  • FIG. 7 is a schematic diagram of an IWCP mode
  • Fig. 9 is the realization flow schematic diagram 2 of the intra-frame prediction method
  • FIG. 10 is a schematic diagram 1 of the composition structure of the encoder proposed by the embodiment of the application.
  • FIG. 11 is a second schematic diagram of the composition and structure of an encoder proposed by an embodiment of the present application.
  • FIG. 12 is a schematic diagram 1 of the composition and structure of a decoder proposed by an embodiment of the present application.
  • FIG. 13 is a second schematic diagram of the composition and structure of a decoder proposed by an embodiment of the present application.
  • LCUs Large Coding Units
  • CU Coding Unit
  • Prediction Unit PU
  • the hybrid coding framework may include modules such as prediction, transform (Transform), quantization (Quantization), entropy coding (EntropyCoding), and loop filtering (In Loop Filter); wherein, the prediction module may include intraPrediction (intraPrediction) And inter prediction (interPrediction), inter prediction can include motion estimation (motion estimation) and motion compensation (motion compensation). Since there is a strong correlation between adjacent pixels in a frame of a video image, the use of intra-frame prediction in video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; There is also a strong similarity between frames. In the video coding and decoding technology, the inter-frame prediction method is used to eliminate the temporal redundancy between adjacent frames, thereby improving the coding and decoding efficiency.
  • the basic process of a video codec is as follows: at the encoding end, a frame of image is divided into blocks, intra-frame prediction or inter-frame prediction is used for the current block to generate the prediction block of the current block, and the original block of the current block is subtracted from the prediction block to obtain the residual. Difference block, transform and quantize the residual block to obtain a quantized coefficient matrix, perform entropy encoding on the quantized coefficient matrix and output it to the code stream.
  • intra-frame prediction or inter-frame prediction for the current block to generate the prediction block of the current block.
  • decode the code stream to obtain a quantized coefficient matrix, and perform inverse quantization and inverse transformation on the quantized coefficient matrix to obtain a residual block.
  • the block and residual block are added to obtain the reconstructed block.
  • the reconstructed blocks form a reconstructed image, and the decoded image is obtained by performing loop filtering on the reconstructed image based on the image or based on the block.
  • the encoding side also needs a similar operation to the decoding side to obtain the decoded image.
  • the decoded image can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the block division information determined by the coding end, mode information such as prediction, transformation, quantization, entropy coding, and loop filtering, or parameter information should be output to the code stream if necessary.
  • the decoding end determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoding end through analysis and analysis according to the existing information, so as to ensure the decoded image and decoded image obtained by the encoding end.
  • the decoded image obtained by the terminal is the same.
  • the decoded image obtained by the encoding end is usually also called the reconstructed image.
  • the current block may be divided into prediction units during prediction, and the current block may be divided into transformation units during transformation, and the division of prediction units and transformation units may be different.
  • the current block may be a current coding unit (CU) or a current prediction unit (PU), or the like.
  • Inter prediction uses information from a decoded or reconstructed image, or reference frame, to predict the current block.
  • Inter prediction uses motion information to find a reference block from a reference frame, and generates a prediction block from the reference block.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be of whole pixel or sub-pixel. If the motion vector is sub-pixel, then it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block.
  • the reference frame found according to the motion vector is used.
  • the whole pixel or sub-pixel block is called the reference block.
  • the reference block is directly used as the prediction block, and some technologies are processed on the basis of the reference block to generate the prediction block. Reprocessing to generate a prediction block on the basis of the reference block can also be understood as taking the reference block as a prediction block and then processing it on the basis of the prediction block to generate a new prediction block.
  • VVC Versatile Video Coding
  • GPM Geometric Partitioning Mode
  • AVS Angular Weighted prediction mode
  • the traditional unidirectional prediction just finds a reference block with the same size as the current block
  • the traditional bidirectional prediction uses two reference blocks with the same size as the current block
  • the pixel value of each point in the predicted block is The average value of the corresponding positions of the two reference blocks, that is, all points of each reference block account for 50% of the ratio.
  • Bidirectional weighted prediction enables two reference blocks to have different proportions, such as 75% of all points in the first reference block and 25% of all points in the second reference block. But all points in the same reference block have the same scale.
  • Some other optimization methods such as Decoder side Motion Vector Refinement (DMVR) technology, Bi-directional Optical Flow (BIO), etc., will cause some changes in reference pixels or predicted pixels, and GPM or AWP also Use two reference blocks of the same size as the current block, but some pixel positions use 100% of the pixel values of the corresponding positions of the first reference block, some pixel positions 100% use the pixel values of the corresponding positions of the second reference block, and In the boundary area, the pixel values of the corresponding positions of the two reference blocks are used in a certain proportion.
  • the weight assignment can be determined by the prediction mode of GPM or AWP.
  • FIG. 1 is a schematic diagram 1 of weight allocation. As shown in FIG. 1 , it shows a schematic diagram of weight allocation for multiple division modes of a GPM on a 64 ⁇ 64 current block provided by an embodiment of the present application, wherein , GPM has 64 division modes.
  • FIG. 2 is a schematic diagram 2 of weight allocation. As shown in FIG. 2 , it shows a schematic diagram of weight allocation of multiple division modes of an AWP on a 64 ⁇ 64 current block provided by an embodiment of the present application. 56 division modes.
  • 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 indicates that the weight value of the corresponding position of the first reference block is 100%.
  • the area indicates that the weight value of the corresponding position of the first reference block is greater than 0% and less than 100% according to the different shades of color, and the weight value of the corresponding position of the second reference block is 100% minus the first weight value.
  • the weight value of the corresponding position of each reference block is Whether it is in Figure 1 or Figure 2, in each division 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 indicates that the weight value of the corresponding position of the first reference block is 100%.
  • the area indicates that the weight value of the corresponding position of the first reference block is greater than 0% and less than 100% according to the different shades
  • the weights are derived in different ways for GPM and AWP.
  • GPM determines the angle and offset according to each mode, and then calculates the weight matrix for each mode.
  • AWP first makes a one-dimensional weighted line, and then uses a method similar to intra-frame angle prediction to fill the entire matrix with the one-dimensional weighted line.
  • GPM and AWP both achieve the predicted non-rectangular division effect without division.
  • GPM and AWP use a mask of the weights of the two reference blocks, the aforementioned weight map. This mask determines the weight of the two reference blocks when generating the prediction block, and the blending area is weighted with the corresponding positions of the two reference blocks, thus 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 transform, quantization, inverse transform, and inverse quantization of the residual after prediction are also processed by the current block as a whole.
  • the motion information used by the current block can be saved.
  • Subsequent coded blocks of the current frame may use motion information of previously coded blocks (eg, adjacent blocks) according to the adjacent positional relationship. 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 by each block of the current frame can be saved.
  • the subsequent coded frame can use the motion information of the previous coded frame according to the reference relationship. This utilizes the correlation in the time domain, so the motion information of the encoded and decoded frame is called the motion information in the time domain.
  • the storage method of the motion information used by each block of the current frame usually takes a fixed-size matrix, such as a 4 ⁇ 4 matrix, as a minimum unit, and each minimum unit stores a set of motion information separately.
  • a fixed-size matrix such as a 4 ⁇ 4 matrix
  • each minimum unit stores a set of motion information separately.
  • the minimum units corresponding to its position can store the motion information of the block.
  • the motion information in the space domain or the motion information in the time domain is used, the motion information corresponding to the position can be directly found according to the position. 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 according to the mode of GPM or AWP, the first motion information, and the second motion information and the position of each minimum unit Stored athletic information.
  • One method is that if all the 4 ⁇ 4 pixels corresponding to a minimum unit come from the first motion information, then this minimum unit stores the first motion information, if all the 4 ⁇ 4 pixels corresponding to a minimum unit come from the first motion information. two 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 The reference frame list, then combine them into bidirectional motion information storage, otherwise only store the second motion information.
  • GPM or AWP belongs to an inter-frame prediction technology, and GPM or AWP needs to transmit a flag (flag) whether GPM or AWP is used in the code stream, and the flag can indicate whether the current block uses GPM or AWP. If GPM or AWP is used, the encoder needs to transmit the specific mode used in the code stream, that is, one of the 64 division modes of GPM, or one of the 56 division modes of AWP; and two index values of unidirectional motion information. That is to say, for the current block, the decoder can obtain information on whether GPM or AWP is used by decoding the code stream.
  • the decoder can parse out the prediction mode parameters of GPM or AWP and two motion information.
  • the index value for example, the current block can be divided into two partitions, then the first index value corresponding to the first partition and the second index value corresponding to the second partition can be parsed.
  • the prediction mode parameters under GPM will be transmitted in the code stream, such as the specific division mode of GPM; under normal circumstances, GPM includes 64 division modes.
  • the prediction mode parameters under the AWP will be transmitted in the code stream, such as the specific division mode of the AWP; under normal circumstances, the AWP includes 56 division modes.
  • the current implementation is to construct a unidirectional motion information candidate list by using the relevant information of the coded/decoded part before the current block on the encoder side, select unidirectional motion information from the unidirectional motion information candidate list, and combine the two unidirectional motion information. Write the code stream to the index value (index) of the motion information in the unidirectional motion information candidate list.
  • a unidirectional motion information candidate list is constructed by using the relevant information of the decoded part before the current block.
  • This unidirectional motion information candidate list must be the same as the candidate list constructed by the encoder side. In this way, the index values of the two unidirectional motion information are parsed from the code stream, and then the two unidirectional motion information are found from the unidirectional motion information candidate list, which are the two unidirectional motion information that the current block needs to use.
  • the unidirectional motion information described in this application may include: motion vector information, that is, the value of (x, y), and corresponding reference frame information, that is, the reference frame list and the reference frame index in the reference frame list value.
  • motion vector information that is, the value of (x, y)
  • reference frame information that is, the reference frame list and the reference frame index in the reference frame list value.
  • One representation is to record the reference frame index values of two reference frame lists, where the reference frame index value corresponding to one reference frame list is valid, such as 0, 1, 2, etc.; the reference frame index value corresponding to the other reference frame list is Invalid, i.e. -1.
  • the reference frame list with a valid reference frame index value is the reference frame list used by the motion information of the current block, and a corresponding reference frame can be found from the reference frame list according to the reference frame index value.
  • Each reference frame list has a corresponding motion vector, the motion vector corresponding to the valid reference frame list is valid, and the motion vector corresponding to the invalid reference frame list is invalid.
  • the decoder can find the required reference frame through the reference frame information in the unidirectional motion information, and can find the reference block in the reference frame according to the position of the current block and the value of the motion vector (x, y), and then determine the current block.
  • the inter-frame prediction value can be found the required reference frame through the reference frame information in the unidirectional motion information, and can find the reference block in the reference frame according to the position of the current block and the value of the motion vector (x, y), and then determine the current block.
  • the inter-frame prediction value can be found from the required reference frame through the reference frame information in the unidirectional motion information, and can find the reference block in the reference frame according to the position of the current block and the value of the motion vector (x, y), and then determine the current block.
  • the intra-frame prediction method uses the encoded and decoded reconstructed pixels around the current block as reference pixels to predict the current block.
  • Figure 3 is a schematic diagram of intra prediction. As shown in Figure 3, the size of the current block is 4 ⁇ 4, and the pixels in the left row and the upper column of the current block are the reference pixels of the current block. Make predictions. These reference pixels may already be all available, ie all already coded and decoded. Some parts may not be available. For example, if the current block is the leftmost part of the whole frame, the reference pixels to the left of the current block are not available. Or when the current block is encoded and decoded, the lower left part of the current block has not been encoded or decoded, so the reference pixels at the lower left are also unavailable. For cases where reference pixels are not available, the available reference pixels or some value or some method can be used for padding, or no padding is performed.
  • the multiple reference line intra-prediction method can use more reference pixels to improve encoding and decoding efficiency, for example, using 4 reference lines/columns for the current block reference pixel.
  • intra-frame prediction for a 4 ⁇ 4 block mainly includes 9 modes. Among them, mode 0 can copy the pixels above the current block to the current block in the vertical direction as the predicted value, mode 1 can copy the reference pixel on the left to the current block in the horizontal direction as the predicted value, and mode 2 The average value of the points is used as the predicted value of all points. Modes 3 to 8 can copy the reference pixel to the corresponding position of the current block at a certain angle, because some positions in the current block cannot exactly correspond to the reference pixel, it may be necessary to use the reference pixel. The weighted average of the pixels, or subpixels of the interpolated reference pixels.
  • the intra prediction modes used by HEVC include Planar mode, DC mode and 33 angle modes. There are 35 prediction modes in total.
  • the intra-frame modes used by VVC include Planar mode, DC mode and 65 angle modes, a total of 67 prediction modes.
  • AVS3 uses a total of 66 prediction modes in DC mode, Planar mode, Bilinear mode and 63 angle modes.
  • the multiple intraprediction filter (MIPF) in AVS3 uses different filters to generate predicted values for different block sizes. For pixels at different positions within the same block, one filter is used to generate predicted values for pixels closer to the reference pixel, and another filter is used to generate predicted values for pixels farther from the reference pixel.
  • MIPF intraprediction filter
  • a technique for filtering predicted pixels, such as intra prediction filter (IPF) in AVS3, can use reference pixels to filter predicted values.
  • an intra-frame mode coding technique of the Most Probable Modes List can be used to improve coding and decoding efficiency.
  • MPM Most Probable Modes List
  • the intra-frame prediction modes of the surrounding coded and decoded blocks and the intra-frame prediction modes derived from the intra-frame prediction modes of the surrounding coded and decoded blocks, such as adjacent modes, as well as some commonly used or high-probability intra-frame predictions Modes, such as DC, Planar, Bilinear modes, etc., form a list of MPMs.
  • Intra prediction modes with reference 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 for intra prediction mode. That is, it is considered that the probability of using MPM for the current block is higher than that of not using MPM. Therefore, during binarization, fewer code words will be used for the MPM, thereby saving overhead and improving encoding and decoding efficiency.
  • the current intra-frame prediction modes include DC mode, Planar mode, Bilinear mode, etc., they can only handle simple texture prediction; even if there are more and more angle modes, their prediction can only follow a straight line at an angle to proceed. It can be seen that the current intra prediction mode can only handle simple texture prediction. For complex textures, it needs to be divided into smaller blocks during prediction, or encode more residuals, or cause larger distortion.
  • an intra prediction method is currently proposed.
  • the codec can determine two different prediction blocks of the current block through two different intra prediction modes, and then can combine them through various weight matrices to finally obtain a more accurate prediction. Sophisticated prediction blocks improve prediction accuracy.
  • the non-angle prediction modes such as DC mode, Planar mode, PLANE mode, and Bilinear mode is different from that of the angle prediction mode, the non-angle prediction modes each have their own logic. The circuit of the angle prediction mode cannot be easily reused.
  • the 2 intra prediction modes When using 2 intra prediction modes for prediction, if the 2 intra prediction modes are serially predicted on the hardware, and then combined according to the weight matrix, the 2 intra prediction modes
  • the existing intra-frame prediction circuits can be used for prediction, but the prediction value that is predicted first needs to be stored, and the time of intra-frame weighted combination prediction is significantly higher than the original intra-frame prediction mode that only uses one. The time to make the forecast. If the 2 intra prediction modes are predicted serially on the hardware, the speed of producing the predicted value of the intra-weighted combined prediction is significantly better than the serial implementation. The cost of this is the need for two sets of intra-frame prediction circuits.
  • a set of intra-frame prediction circuits needs to be added, and the intra-frame prediction circuits mentioned here perform prediction of the above-mentioned intra-frame non-angle prediction mode and intra-frame angle prediction mode. That is to say, a set of intra-frame prediction circuits must be added.
  • the current intra-frame prediction method using two different intra-frame prediction modes can improve the prediction effect to a certain extent.
  • the hardware implementation cost will increase. Therefore, simplifying the newly added intra-frame prediction circuit as much as possible can reduce the complexity of intra-frame weighted combined prediction.
  • the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine various weight matrices to finally obtain
  • more complex prediction blocks can reduce hardware implementation costs, reduce complexity, and implement simple and efficient encoding and decoding methods, thereby improving compression performance.
  • the video coding system 10 includes a transformation and quantization unit 101, an intra-frame estimation unit 102, an intra-frame The prediction unit 103, the motion compensation unit 104, the motion estimation unit 105, the inverse transform and inverse quantization unit 106, the filter control analysis unit 107, the filtering unit 108, the encoding unit 109, the decoded image buffer unit 110, etc., wherein the filtering unit 108 can To implement deblocking filtering and sample adaptive offset (Sample Adaptive Offset, SAO) filtering, the encoding unit 109 can implement header information encoding and context-based Adaptive Binary Arithmatic Coding (CABAC).
  • CABAC Adaptive Binary Arithmatic Coding
  • a video coding block can be obtained by dividing the coding tree block (Coding Tree Unit, CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is transformed and quantized.
  • Unit 101 pairs The video coding block is transformed, including transforming residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used for Intra prediction is performed on the video coding block; specifically, the intra prediction unit 102 and the intra prediction unit 103 are used to determine the intra prediction mode to be used to encode the video coding block;
  • the motion compensation unit 104 and the motion estimation unit 105 is used to perform inter-predictive encoding of the received video encoding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is to generate a motion vector.
  • the motion vector can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 also For providing the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for the video Reconstruction of the coding block, reconstructing the residual block in the pixel domain, the reconstructed residual block removing the blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and then adding the reconstructed residual block to the decoding A predictive block in the frame of the image buffer unit 110 is used to generate a reconstructed video coding block; the coding unit 109 is used for coding various coding parameters and quantized transform coefficients.
  • the context content can be based on adjacent coding blocks, and can be used to encode information indicating the determined intra-frame prediction mode, and output a code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding blocks, for Forecast reference. As the video image coding proceeds, new reconstructed video coding blocks are continuously generated, and these reconstructed video coding blocks are all stored in the decoded image buffer unit 110 .
  • the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame The prediction unit 203, the motion compensation unit 204, the filtering unit 205, and the decoded image buffering unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the decoding unit 201 can implement header information decoding and CABAC decoding
  • the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the code stream of the video signal is output; the code stream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain the decoded transform coefficient; Inverse transform and inverse quantization unit 202 processes to generate residual blocks in the pixel domain; intra prediction unit 203 may be used to generate based on the determined intra prediction mode and data from previously decoded blocks of the current frame or picture Prediction data for the current video decoding block; motion compensation unit 204 determines prediction information for the video decoding block by parsing the motion vector and other associated syntax elements, and uses the prediction information to generate predictive information for the video decoding block being decoded block; a decoded video block is formed by summing the residual block from inverse transform and inverse quantization unit 202 and the corresponding predictive block produced by intra prediction unit 203 or motion compensation unit 204; the decoded video signal Video quality may be improved by filtering unit 205 in order to remove blocking artifacts; decoded video blocks are then stored in decoded image buffer unit 206, which stores reference images for subsequent
  • the intra-frame prediction method in this embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in FIG. 4 and the intra-frame prediction unit 203 shown in FIG. 5 . That is to say, the intra-frame prediction method in the embodiment of the present application can be applied to both a video encoding system and a video decoding system, and can even be applied to a video encoding system and a video decoding system at the same time. There is no specific limitation.
  • the “current block” specifically refers to the current coding block in the intra-frame prediction; when the intra-frame prediction method is applied to the intra-frame prediction unit 203, the “current block” specifically refers to the current decoded block in intra prediction.
  • FIG. 6 is a schematic diagram 1 of the implementation flow of the intra-frame prediction method.
  • the method for performing intra-frame prediction by the decoder may include the following step:
  • Step 101 Decode the code stream, and determine the intra prediction mode parameter of the current block.
  • the decoder may determine the intra prediction mode parameter of the current block by decoding the code stream.
  • the intra prediction mode parameter may indicate whether the current block can use the intra weighted combined prediction (intra weighted combined prediction, IWCP) mode, that is, whether the current block can use two different
  • IWCP intra weighted combined prediction
  • the intra prediction mode parameter can be understood as a flag indicating whether the IWCP mode is used.
  • the decoder decodes the code stream, and can determine a variable as the parameter of the intra-frame prediction mode, so that the determination of the parameter of the intra-frame prediction mode can be realized by the value of the variable.
  • the IWCP mode is an intra-frame prediction method, and specifically, the IWCP mode is to determine two different intra-frame angle prediction modes for the current block, and then according to the two different The intra-frame angle prediction mode of , determines two prediction blocks, then a weight matrix can be determined, and the two prediction blocks are combined according to the weight matrix, and finally a new prediction block can be obtained, that is, the prediction block of the current block can be obtained.
  • FIG. 7 is a schematic diagram of the IWCP mode.
  • the intra angle prediction mode 1 (the first intra prediction mode) can be used to determine the first prediction block of the current block, and at the same time Use the intra-frame angle prediction mode 2 (second intra-frame prediction mode) to determine the second prediction block of the current block, and then use the weight matrix to combine the first prediction block and the second prediction block, and finally obtain a new prediction block .
  • the intra angle prediction mode 1 the first intra prediction mode
  • second intra-frame prediction mode second intra-frame prediction mode
  • a video image may be divided into multiple image blocks, and the current block is each image block currently to be encoded, which may be called a coding block (Coding Block, CB).
  • each coding block may include a first image component, a second image component, and a third image component.
  • the first intra-frame prediction is performed, and the first image component is a luminance component, that is, the image component to be predicted is a luminance component, then the coding block to be predicted can be called a luminance block; or, it is assumed that The second intra-frame prediction is performed, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the coding block to be predicted may be called a chrominance block.
  • the size of the current block may be limited.
  • the intra-frame prediction method proposed in the embodiment of the present application needs to use two different intra-frame angle prediction modes to generate two prediction blocks, and then perform weighting according to the weight matrix to obtain a new prediction block, in order to reduce the complexity of
  • the IWCP mode may be restricted from not using this IWCP mode for prediction blocks of some sizes. Therefore, in this application, the decoder can first determine the size parameter of the current block, and then determine whether the current block uses the IWCP mode according to the size parameter.
  • the size parameter of the current block may include the height and width of the current block. Therefore, the decoder may use the height and width of the current block to limit the use of the IWCP mode, that is, limit the use of the IWCP mode. The size of the prediction block in IWCP mode.
  • both the width and the height are greater than or equal to the first lower limit value, and at the same time, both the width and the height are less than or equal to the first upper limit value, then it can be determined that the current block uses the IWCP mode. It can be seen that a possible restriction is to use only when the width and height of the predicted block are less than (or less than or equal to) the first upper limit value, and the width and height of the predicted block are greater than (or greater than or equal to) the first lower limit value. IWCP mode. Wherein, the first lower limit value may be 8, and the value of the first upper limit value may be 16 or 32 or the like.
  • intra-frame frames such as I frames
  • inter-frame frames such as B frames and P frames
  • the intra-frame does not use the IWCP mode
  • the inter-frame uses the IWCP mode.
  • some inter-frames can be configured to use the IWCP mode, and some inter-frames do not use the IWCP mode.
  • Inter-frames can also use intra-frame prediction, so it is also possible for inter-frames to use IWCP mode.
  • a flag below the frame level and above the CU level (such as tile, slice, patch, LCU, etc.) to determine whether this area uses the IWCP mode.
  • Step 102 When the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra prediction value of the current block, determine the first mode index and the second mode index of the current block.
  • the decoder may further determine the current block The first mode index and second mode index of the block.
  • the first mode index is used to indicate the first intra prediction mode used by the current block
  • the second mode index may be used to indicate the second intra prediction mode of the current block. to instruct.
  • the value of the first mode index and the value of the second mode index are related to the number of intra-frame angle prediction modes that may exist in the first intra-frame prediction mode and the second intra-frame prediction mode, for example, the first intra-frame prediction mode
  • the prediction mode and the second intra-frame prediction mode may be one of the 28 intra-frame angle prediction modes with mode numbers 4-31, respectively, then the value of the first mode index and the value of the second mode index both belong to the range 0 ⁇ 27.
  • the parameter iwcp_pred_mode0_index may be used to represent the first mode index
  • the parameter iwcp_pred_mode1_index may be used to represent the second mode index
  • Step 103 Build the MPM list of the current block.
  • the decoder may also construct the MPM list of the current block.
  • the prediction modes in the MPM list are all intra-angle prediction modes.
  • the decoder when constructing the MPM list of the current block, the decoder needs to first determine the weight matrix derivation mode of the current block, and then use the weight matrix derivation mode to further determine the MPM list of the current block.
  • the weight matrix derivation mode is used to determine the weight matrix used by the current block.
  • the weight matrix derivation mode may be a mode of deriving the weight matrix.
  • each weight matrix derivation mode can derive a weight matrix; for a prediction block of the same size, different weight matrix derivation modes derive different weight matrices.
  • the AWP of AVS3 has 56 weight matrix derivation modes
  • the GPM of VVC has 64 weight matrix derivation modes.
  • the decoder when constructing the MPM list of the current block, may construct the MPM list directly based on the prediction mode and the weight matrix derivation mode of the adjacent blocks of the current block.
  • the decoder when constructing the MPM list of the current block, may also construct the MPM list based on the prediction mode, the preset angle prediction mode set and the weight matrix derivation mode of neighboring blocks of the current block.
  • the preset angle prediction mode set may be a subset of all intra-frame angle prediction modes. Taking AVS3 as an example, the preset angle prediction mode set may only include 28 intra angle prediction modes with mode numbers 4-31.
  • the preset angle prediction mode set may be a combination of all intra angle prediction modes; if necessary The range of the first intra-frame prediction mode and the second intra-frame prediction mode is limited, then the preset angle prediction mode set can be only a combination of some intra-frame angle prediction modes, and the preset angle prediction mode set can be used for The range of the first intra-frame prediction mode and the second intra-frame prediction mode is limited, thereby effectively reducing overhead and improving compression performance.
  • the decoder can use the prediction mode of the adjacent block when constructing the MPM list based on the intra prediction mode, the preset angle prediction mode set and the weight matrix derivation mode of the adjacent blocks of the current block. determining the first candidate mode; determining the second candidate mode by using the weight matrix derivation mode; further constructing the MPM list of the current block according to the first candidate mode, the second candidate mode and the set of preset angle prediction modes.
  • the decoder determines the first candidate mode by using the prediction mode of the adjacent block, if the adjacent block is an ordinary intra prediction block, and the prediction mode of the adjacent block is the intra prediction mode, then The prediction mode of the adjacent block is determined as the first candidate mode.
  • a common intra prediction block refers to a prediction block using prediction modes such as DC mode, Planar mode, Bilinear mode, and angle prediction mode, rather than using intra block copy (IBC).
  • Prediction blocks for prediction modes such as string copy intra prediction intra string copy prediction.
  • Fig. 8 is a schematic diagram of adjacent blocks. As shown in Fig. 8, the current block is E, where (x0, y0) is the coordinates of the upper left corner sample of block E in the image, and (x1, y0) is the upper right corner sample of block E at The coordinates in the image, (x0, y1) are the coordinates of the bottom left sample of block E in the image.
  • the neighboring block A of the current block E is the block where the sample (x0-1, y0) is located
  • the neighboring block B of the current block E is the block where the sample (x0, y0-1) is located
  • the neighboring block C of the current block E is is the block where the sample (x1+1, y0-1) is located
  • the adjacent block D of the current block E is the block where the sample (x0-1, y0-1) is located
  • the adjacent block F of the block E is the sample (x0- 1, y1)
  • the adjacent block G of block E is the block where the sample (x1, y0-1) is located.
  • the spatial positional relationship between the current block E and its adjacent blocks A, B, C, and D is shown in FIG. 8 .
  • the decoder can also use the adjacent blocks to the right and the lower of the current block.
  • the decoder when the decoder uses the weight matrix derivation mode to determine the second candidate mode, it can first determine the dividing line angle index value according to the weight matrix derivation mode; and then can use the dividing line angle index value to determine the second candidate mode .
  • the second candidate mode is L different intra-frame angle prediction modes, so that the construction of an MPM list of length L can be ensured.
  • the position of the weight change constitutes a straight line, or, in the case that the weight matrix has multiple weights, the transition region has the same weight.
  • the positions form a straight line, which can be called the dividing line. You can set the horizontal right angle to 0, and the angle increases counterclockwise. Then the dividing line may be horizontal 0 degrees, vertical 90 degrees, inclined such as 45 degrees, 135 degrees, and various other angles.
  • the corresponding texture is likely to show different characteristics on both sides of the dividing line, such as two textures with different angles on both sides of the dividing line, or one side of the dividing line is an angle texture, while the other side is a relatively flat texture. Since the dividing line itself is also angled, it can be assumed that a point is obtained by intra-frame angle prediction, and it may be close to some textures of the current block, so this line and the two intra-frame prediction modes of the current block are There is a correlation.
  • the boundary line is obtained from a point through intra-frame angle prediction, then at least one intra-frame angle prediction mode can be found, and this intra-frame angle prediction mode can approximate the boundary line.
  • the horizontal dividing line matches the horizontal intra prediction mode, such as mode 24 in AVS3;
  • the vertical dividing line matches the vertical intra prediction mode, such as mode 12 in AVS3;
  • the boundary line can match the intra prediction mode of 45 degrees from the lower left to the upper right, such as mode 30 in AVS3; it can also match the intra prediction mode of 225 degrees from the upper right to the lower left, such as mode 6 in AVS3.
  • weight matrix derivation mode can be matched to some intra prediction modes, so the weight matrix derivation mode can be used to assist the decoding of the intra prediction mode.
  • the weight matrix derivation mode may also be an index of the weight matrix, for example, the 56 modes of AWP can be regarded as 56 weight matrix derivation modes.
  • a mapping relationship table may be constructed to further represent the mapping relationship between the weight matrix derivation mode and the intra angle prediction mode.
  • the boundary lines of multiple modes of AWP and GPM are all the same angle, for example, the angle of the boundary line of AWP of AVS3 is the same every 8 modes.
  • the index of the dividing line angle can be obtained from the mode number modulo 8 (%8) of the weight matrix derived mode.
  • Table 1 is a mapping relationship table.
  • the indexes 0 and 1 of the dividing line angle can respectively correspond to two intra-frame angle prediction modes, one from the upper right corner to the lower left corner, and the other from the upper left corner to the upper left corner. bottom right.
  • another approximately corresponding intra-frame angle prediction mode may be found for indices of other boundary angles, or all indices of boundary angles correspond to only one intra-frame angle prediction mode.
  • some intra-angle prediction modes related to it are also more likely to be used. For example, an angle close to the dividing line, or an angle perpendicular to the dividing line, etc. corresponds to an intra-frame angle prediction mode.
  • the decoder may utilize the correlation of the weight matrix with the intra angle prediction modes to construct an MPM list of intra weighted combined prediction modes. For example, when constructing an MPM list of intra-frame weighted combined prediction modes, if the list length of the MPM list is 4, the candidate modes corresponding to the boundary angle indices in Table 2 below may be added to the MPM list.
  • the number of candidate modes corresponding to the index of each boundary angle is equal to the length of the MPM list, which can ensure that even if all the intra prediction modes of the referenced adjacent blocks are unavailable. Fill up the MPM list. If the length of the MPM list is 4, the number of candidate modes corresponding to the index of each boundary angle can be set to 4.
  • the decoder when constructing the MPM list according to the first candidate mode, the second candidate mode and the preset angle prediction mode set, the decoder may also screen the first candidate mode based on the preset angle prediction mode set. processing, to obtain the candidate pattern after screening; construct the MPM list according to the candidate pattern after screening and the second candidate pattern.
  • the decoder when the decoder performs screening processing on the first candidate mode based on the preset angle prediction mode set and obtains the candidate mode after screening, if the first candidate mode belongs to the preset angle prediction mode set, the first candidate mode is selected.
  • a candidate mode is determined as a candidate mode after screening; if the first candidate mode is an intra-angle prediction mode and does not belong to a preset angle prediction mode set, then a replacement mode of the first candidate mode is determined in the preset angle prediction mode set, and Identify replacement patterns as post-screening candidate patterns.
  • the decoder can directly delete the first candidate mode.
  • the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes, excluding intra frame prediction modes.
  • Non-angle prediction mode therefore, for the intra-frame weighted combination prediction mode, the selection of the most probable mode MPM of the current block, that is, the construction method of the MPM list, also needs to be adjusted accordingly.
  • the decoder needs to refer to the intra prediction modes of neighboring blocks around the current block when constructing the MPM list. Peripheral adjacent blocks are such as left adjacent block, upper adjacent block, upper left adjacent block, upper right adjacent block, lower left adjacent block and so on. Due to the spatial correlation, a certain prediction mode is used in the surrounding adjacent blocks, and the current block has a higher probability of using the same or similar prediction mode.
  • both the first intra-frame prediction mode and the second intra-frame prediction mode of the intra-frame weighted combined prediction mode can only be the intra-frame angle prediction mode
  • the decoder does not use the intra-frame non-angle prediction mode used by this reference block when constructing the MPM list of the current block, That is, the intra non-angle prediction mode is not added to the MPM list of the current block.
  • the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes
  • the intra prediction mode is an intra angle prediction mode other than the preset angle prediction mode set, that is, the first candidate mode is the intra angle prediction mode and does not belong to the preset angle prediction mode set
  • the decoder is constructing the current block.
  • the intra angle prediction mode outside the preset angle prediction mode set can be converted into an intra angle prediction mode within the preset angle prediction mode set with a similar angle, and then added to the MPM list.
  • Intra-frame angle prediction mode No. 12 the decoder can add the intra-frame angle prediction No. 12 similar to the intra-frame angle prediction No. 43 to the MPM list of the current block in the intra-frame weighted combined prediction mode.
  • the decoder constructs the MPM list according to the candidate mode after screening and the second candidate mode, if the candidate mode after screening satisfies the preset addition condition, the candidate mode after screening is added to the MPM. list; if the MPM list does not meet the preset list length L, and the second candidate mode satisfies the preset addition condition, add the second candidate mode to the MPM list; where L is an integer greater than or equal to 1.
  • the value of L may be 4, that is, the preset list length of the MPM list is 4, or in other words, the MPM list includes 4 most probable patterns.
  • the decoder may sort the L modes in the MPM list in ascending order of mode numbers.
  • the decoder can determine that the candidate mode after screening satisfies the preset addition condition; If the candidate mode is different from the prediction mode in the MPM list, the decoder can determine that the second candidate mode satisfies the preset addition condition.
  • the decoder can determine the sequence parameter corresponding to the adjacent block when adding the filtered candidate mode corresponding to the adjacent block to the MPM list;
  • the post-filtered candidate mode corresponding to the block is added to the MPM list.
  • the decoder can determine the corresponding order parameter according to the spatial distance between the adjacent block and the current block. For example, the closer the spatial distance between the adjacent block and the current block, the stronger the correlation between the two, the earlier the The addition processing is performed, that is, the smaller the order parameter is; the further the spatial distance between the adjacent block and the current block, the weaker the correlation between the two, and the later the addition processing is performed, that is, the larger the order parameter is.
  • the decoder may also perform a sequence of mode numbers from small to large in the MPM list.
  • the L prediction modes are sorted.
  • the MPM list of the current block in the intra-frame weighted combined prediction mode is IwcpMpm[4], that is, the list length of the MPM list is 4, the index of the weight matrix derivation mode is IwcpIndex, and the weight matrix is derived.
  • the mode multiplexes the 56 derivation modes of the AWP, and the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong are the intra angle prediction modes No. 4-31. Then the decoder can perform the following steps in sequence when constructing the MPM list of the current block:
  • Step S1 set the array cand_mode[10], and all values of cand_mode are initialized to invalid values. Do the following for cand_mode:
  • cand_mode[3] is equal to the intra-frame prediction mode of A
  • cand_mode[4] is equal to the intra prediction mode of B
  • the adjacent block X (X is A, B, C, D, F or G) "exists" means that the block should be within the image and the block should belong to the same slice as block E; otherwise the adjacent block "does not exist” . If the block "does not exist” or has not been decoded, the block is "unavailable”; otherwise the block is "available”. If the block in which the image sample is located is "not present” or the sample has not been decoded, the sample is "unavailable”; otherwise the sample is "available”.
  • the execution steps of (a) to (f) above are the process of determining the first candidate mode; the execution steps of (g) to (j) are the determination of the second candidate mode.
  • the flow, wherein, the decoder may refer to the above Table 2 to determine the second candidate mode.
  • Step S2 for i from 0 to 5, perform the following operations:
  • the decoder can directly delete the first candidate mode, that is, not use the first candidate mode.
  • the decoder can select a similar intra-angle prediction mode from the preset angle prediction mode set pattern as a replacement pattern for the first candidate pattern, and then this replacement pattern as a filtered candidate pattern.
  • the decoder can directly use the first candidate mode, that is, the first candidate mode is the filtered candidate mode.
  • step S2 is the screening process of the first candidate mode, and a post-screening candidate mode corresponding to the first candidate mode is finally determined.
  • Step S3 record mpm_num as 0, and perform the following operations for i from 0 to 9:
  • the decoder can add the candidate mode after screening to the MPM list. If all the post-screening candidate modes that meet the preset addition conditions are added to the MPM list, and the prediction modes in the MPM list are less than 4, the decoder can continue to add the second candidate modes that meet the preset addition conditions to the MPM list. , until the list length of the MPM list reaches 4.
  • Step S4 sort the four numbers of IwcpMpm[4] in ascending order.
  • the decoder may sort the 4 intra-angle prediction modes in the MPM list in ascending order of mode numbers.
  • the present application does not limit the execution order of the above steps 102 and 103, that is, does not limit the sequence between the process of determining the first mode index and the second mode index and the process of constructing the MPM list.
  • Step 104 Determine the first intra prediction mode and the second intra prediction mode of the current block according to the first mode index, the second mode index and the MPM list; wherein, the first intra prediction mode and the second intra prediction mode are: Two different intra-angle prediction modes.
  • the decoder after the decoder determines the first mode index and the second mode index of the current block and completes the construction of the MPM list of the current block, the decoder can further use the first mode index, the second mode index and the The MPM list determines the first intra prediction mode and the second intra prediction mode of the current block.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may be two different intra-frame angle prediction modes.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may be respectively two different intra-frame angle prediction modes in the preset angle prediction mode set.
  • both the first intra-frame prediction mode and the second intra-frame prediction mode can only be intra-frame angle prediction modes, that is, neither the first intra-frame prediction mode nor the second intra-frame prediction mode is a division
  • Other basic intra-frame prediction modes other than the intra-frame angle prediction mode such as intra-frame non-angle prediction modes, including DC mode, Planar mode, PLANE mode, Bilinear mode, PCM mode, etc.
  • the basic intra-frame prediction modes include, but are not limited to, an angular prediction mode and a non-angular prediction mode. Such as 67 intra prediction modes used by VVC and 66 intra prediction modes used by AVS3.
  • the restriction of the intra-frame angle prediction mode on the first intra-frame prediction mode and the second intra-frame prediction mode can reduce the hardware implementation complexity of the intra-frame weighted combination prediction mode on the one hand, because When the hardware implements the intra-frame weighted combination prediction mode in a parallel manner, only a set of circuits that support the intra-frame angle weighted prediction need to be added;
  • the non-angle prediction mode usually deals with scenes with relatively uniform texture changes, and there are fewer modes that can be used to reduce overhead. Therefore, the intra-frame weighted combined prediction mode or not using the intra-frame non-angle prediction mode has little effect on compression performance.
  • the decoder may limit the available intra-angle prediction modes for the first intra-frame prediction mode and the second intra-frame prediction mode using a preset angle prediction mode set, wherein the preset angle prediction mode set is all intra-frame angles A subset of prediction modes.
  • AVS3 has 62 angle modes, that is, intra-frame angle prediction modes with mode numbers 3-32 and 34-65.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may only use the intra-frame angle prediction modes whose mode numbers are 3-32, or the first intra-frame prediction mode and the second frame.
  • the intra prediction mode may use only 28 intra angle prediction modes with mode numbers 4-31.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may only use the intra-frame angle prediction mode whose mode number is an even number, or the first intra-frame prediction mode and The second intra prediction mode may use only intra angle prediction modes whose mode numbers are odd.
  • the angle prediction mode set used by the first intra prediction mode and the angle prediction mode set used by the second intra prediction mode are different.
  • the decoder can use the same preset angle prediction mode set to limit the first intra prediction mode and the second intra prediction mode, that is, if the first intra prediction mode can only use the mode number 4- 28 intra-frame angle prediction modes of 31, the second intra-frame prediction mode can also only use the 28 intra-frame angle prediction modes with mode numbers 4-31, and then the first intra-frame prediction mode and the second intra-frame prediction mode. You can use the same MPM list and use the same or similar codecs.
  • the decoder restricts the first intra prediction mode and the second intra prediction mode using different preset angle prediction mode sets, then the first intra prediction mode and the second intra prediction mode need to be restricted. Use a different MPM list or use a significantly different codec.
  • the decoder may determine a first mapping relationship table between the index value and the binary symbol string; wherein, the first mapping relationship table includes the first length, the second length and the third length respectively The binary string of symbols.
  • the first length is 3 bits
  • the second length is 5 bits
  • the third length is 6 bits.
  • the first mapping relationship table between the index value and the binary symbol string may be used to determine the values of the first mode index and the second mode index.
  • the preset angle prediction mode set includes a total of 28 modes
  • 4+8+ can be used.
  • 16 form encoding that is, a pattern of 4 shortest codewords, a pattern of 8 shorter codewords, and a pattern of 16 longer codewords.
  • the mode of 4 shortest codewords uses 3-bit codewords, that is, the first length is used
  • the mode of 8 shorter codewords uses 5-bit codewords, that is, the second length is used, that is, the mode of 16 longer codewords
  • a 6-bit codeword is used, that is, the third length is used.
  • the prediction angles using the 28 intra-frame angle prediction modes with mode numbers 4-31 basically cover the entire commonly used angle range, and at the same time, the mode numbers are 4-31 intra-frame angle prediction
  • the mode is simpler than the intra-angle prediction mode with mode numbers 34-65, and using these 28 modes to encode in the form of 4+8+16 will not cause waste of code words, so the decoder can preferably follow the mode number 4.
  • the 28 intra-angle prediction modes of -31 define a set of preset angle prediction modes.
  • the 4 most probable patterns in the MPM list can correspond to the binary symbol string using the first length, that is, the 4 shortest codes.
  • the word mode can be used for 4 MPMs in the MPM list; correspondingly, other prediction modes in the preset angle prediction mode set other than the MPM list can use the binary symbol string of the second length and the binary symbol of the third length respectively. string of symbols.
  • the decoder may The patterns of the words are evenly distributed. Specifically, the decoder may evenly distribute the modes of the 8 shorter codewords (binary symbol strings of the second length) among the remaining 24 intra-angle prediction modes. For example, a pattern of 1 shorter codeword (binary symbol string of second length) is used for every pattern of 2 longer codewords (binary symbol string of third length). Furthermore, in the specific execution process, it can be realized by the sequence number modulo 3 (%3) from 0-23 in the remaining 24 intra-frame angle prediction modes. The binary symbol string of the second length is used, and the serial number modulo 3 is 0 or 1 to use a 6-bit codeword, that is, the binary symbol string of the third length is used.
  • a mapping relationship table may be as shown in Table 3, wherein the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
  • the first bit can be used to indicate whether it is MPM, for example, "1" indicates that it is MPM, and "0" indicates that it is not MPM. If the first intra prediction mode is MPM, assuming that there are 4 MPMs in the MPM list, then 2 bits can be used to indicate which MPM in the MPM list is used, that is, "00, 01, 10, 11" respectively indicate the MPM The first MPM in the list, the second MPM, the third MPM, the fourth MPM.
  • the context model is used for decoding the binary symbol string whose bit flag is 0, and the context model is not used for decoding the binary symbol string whose bit flag is not 0.
  • the value of the bit flag may indicate how many bits have been decoded, and the bit flag may be represented by binIdx.
  • the context model can be used to decode the binary symbol string whose binIdx is 0, while the binary symbol whose binIdx is not 0 can be decoded using the context model. Strings are decoded using an equal probability model or bypass mode.
  • the value i of the first mode index may be determined according to the first mapping relationship table between the index value and the binary symbol string; wherein, i is an integer greater than or equal to 0. If i is greater than or equal to 0 and less than L, determine the (i+1)th angle prediction mode in the MPM list as the first intra prediction mode; if i is greater than or equal to L, use the preset The set of angular prediction modes and the MPM list determine the first intra prediction mode.
  • the decoder determines the first intra-frame prediction mode by using the preset angle prediction mode set and the MPM list, if i is greater than or equal to the first mode in the MPM list If (i+1) is greater than or equal to the mode number of the second mode in the MPM list, then (i+1) and 1 are summed; If (i+2) is greater than or equal to the mode number of the third mode in the MPM list, perform a sum operation on (i+2) and 1; if (i+3) is greater than or equal to the mode number in the MPM list For the mode number of the fourth mode, perform a sum operation on (i+3) and 1; determine (i+4) as the mode number of the first intra-frame prediction mode, and predict at the preset angle The first intra prediction mode is determined from a mode set.
  • the decoder determines the first intra-frame prediction mode by using the preset angle prediction mode set and the MPM list, if i is less than the value of the first mode in the MPM list mode number, then i is determined as the mode number of the first intra-frame prediction mode, and the first intra-frame prediction mode is determined in the preset angle prediction mode set; or, if (i+1) is less than the mode number of the second mode in the MPM list, then (i+1) is determined as the mode number of the first intra-frame prediction mode, and the first intra-frame prediction mode is determined in the preset angle prediction mode set.
  • an intra-frame prediction mode or, if (i+2) is less than the mode number of the third mode in the MPM list, then (i+2) is determined as the mode number of the first intra-frame prediction mode, and determine the first intra-frame prediction mode in the preset angle prediction mode set; or, if (i+3) is less than the mode number of the fourth mode in the MPM list, then (i+3) ) is determined as the mode number of the first intra-frame prediction mode, and the first intra-frame prediction mode is determined in the preset angle prediction mode set.
  • the mode numbers of the 4 MPMs in the MPM list are 4, 8, 12, and 16, respectively, based on the first mapping relationship between the index value and the binary symbol string as shown in Table 3 above
  • the value i of the first mode index determined by the table is 5, then in the preset angle prediction mode set including 28 intra-frame angle prediction modes with mode numbers 4-31, i is sequentially associated with 4 in the MPM list.
  • the value 6 of (i+1) can be determined as the mode number of the first intra prediction mode, and the mode is set in the preset angle prediction mode set.
  • the intra-frame angle prediction mode numbered 6 determines the first intra-frame prediction mode.
  • the mode numbers of the 4 MPMs in the MPM list are 4, 8, 12, and 16, respectively, based on the first mapping relationship between the index value and the binary symbol string as shown in Table 3 above
  • the value i of the first mode index determined by the table is 10, then in the preset angle prediction mode set including 28 intra-frame angle prediction modes whose mode numbers are 4-31, i is sequenced with the 4 in the MPM list.
  • the intra-frame angle prediction mode numbered 13 determines the first intra-frame prediction mode.
  • the value j of the second mode index may be determined according to the first mapping relationship table; wherein, j is an integer greater than or equal to 0. If j is greater than or equal to 0 and less than L, the (i+1)th angle prediction mode in the MPM list is determined as the first intra-frame prediction mode; if j is greater than or equal to L, the preset is used The set of angular prediction modes and the MPM list determine the first intra prediction mode.
  • the decoder determines the second intra-frame prediction mode by using the preset angle prediction mode set and the MPM list, if j is greater than or equal to the first mode in the MPM list If (j+1) is greater than or equal to the mode number of the second mode in the MPM list, then (j+1) and 1 are summed; If (j+2) is greater than or equal to the mode number of the third mode in the MPM list, perform a sum operation on (j+2) and 1; if (j+3) is greater than or equal to the mode number in the MPM list For the mode number of the fourth mode, perform a sum operation on (j+3) and 1; determine (j+4) as the mode number of the second intra-frame prediction mode, and predict at the preset angle The second intra prediction mode is determined from a mode set.
  • the decoder determines the second intra prediction mode by using the preset angle prediction mode set and the MPM list, if j is less than the value of the first mode in the MPM list mode number, then determine j as the mode number of the second intra-frame prediction mode, and determine the second intra-frame prediction mode in the preset angle prediction mode set; or, if (j+1) is less than the mode number of the second mode in the MPM list, then (j+1) is determined as the mode number of the second intra prediction mode, and the first prediction mode set is determined in the preset angle prediction mode set.
  • the decoder decodes the code stream can determine the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, and then can derive the first intra prediction mode according to the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index as IwcpPredMode0, and the second intra prediction mode is IwcpPredMode0.
  • the prediction mode is IwcpPredMode1.
  • the decoder may specifically perform the following operations:
  • the binary symbol string can be determined by inverse binarization according to Table 3, that is, a matching binary symbol string can be found from the right column of Table 3 according to iwcp_pred_mode0_index , and then determine the value i of iwcp_pred_mode0_index from the left column of the same row.
  • IwcpPredMode0 is equal to IwcpMpm[i].
  • the decoder can compare the value i of the first mode index iwcp_pred_mode0_index with the mode number of each angle prediction mode in the MPM list in turn, and select whether to perform an increment operation according to the comparison result, and finally calculate the mode of the first intra prediction mode. number, and determine the first intra prediction mode in the preset angle prediction mode set according to the mode number.
  • the decoder may specifically perform the following operations:
  • the binary symbol string can be determined by inverse binarization according to Table 3, that is, a matching binary symbol string can be found from the right column of Table 3 according to iwcp_pred_mode1_index , and then determine the value j of iwcp_pred_mode1_index from the left column of the same row.
  • IwcpPredMode1 is equal to IwcpMpm[i].
  • IwcpPredMode1 is equal to
  • the first intra-frame prediction mode and the second intra prediction mode can share a preset angle prediction mode set, and can also share the same MPM list, but the first intra prediction mode and the second intra prediction mode in the intra weighted combined prediction mode are not the same. Therefore, when encoding and decoding the second intra-frame prediction mode, the first intra-frame prediction mode may be referred to. Specifically, when determining the second intra-frame prediction mode, the first intra-frame prediction mode may be excluded.
  • the probability of occurrence of 4 MPMs in the MPM list is very high (the first intra-frame angle prediction mode).
  • the probability that the prediction mode is one of the 4 MPMs in the MPM list is about 50%, and the probability that the second intra prediction mode is one of the 4 MPMs in the MPM list is about 50%), if the first intra The prediction mode and the second intra-frame prediction mode are both MPMs in the MPM list, so when determining the second intra-frame prediction mode, you can only select from the other 3 MPMs in the MPM list other than the first intra-frame prediction mode One will do.
  • the second intra-frame prediction mode can also be removed from the 24 intra-frame angle prediction modes of 8+16. , but this effect is relatively small.
  • the MPM After the (i+1)th angle prediction mode in the list is determined to be the first intra prediction mode, when the decoder determines the second intra prediction mode, it can be based on the second mapping between the index value and the binary symbol string
  • the relationship table determines the value j of the second mode index; if j is greater than or equal to i, add 1 to j; after performing the self-adding 1 operation, if j is greater than or equal to 0 and less than L, then the MPM list
  • the (j+1)th angle prediction mode in is determined as the second intra-frame prediction mode; if j is greater than or equal to L, the second frame is determined by using the preset angle prediction mode set and the MPM list Intra prediction mode.
  • the decoder may determine a second mapping relationship table between the index value and the binary symbol string; wherein, the second mapping relationship table includes the first length, the second length, and the third length respectively. and a binary symbol string of the fourth length.
  • the first length is 3 bits
  • the second length is 5 bits
  • the third length is 6 bits
  • the fourth length is 2 bits.
  • the second mapping relationship table between the index value and the binary symbol string is only used to determine the value of the second mode index.
  • the second mapping relationship table between the index value and the binary symbol string may be as shown in Table 4, where the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits. bits, and the fourth length is 2 bits.
  • the length of the MPM list is 4, the preset angle prediction mode set includes 28 intra-frame angle prediction modes with mode numbers 4-31, the decoder decoding the code stream can determine the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, and then can According to the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, the first intra prediction mode is IwcpPredMode0, and the second intra prediction mode is IwcpPredMode1.
  • the context model can be used to decode the binary symbol string whose binIdx is 0, while the binary symbol whose binIdx is not 0 can be decoded using the context model. Strings are decoded using an equal probability model or bypass mode.
  • the decoder may specifically perform the following operations:
  • IwcpPredMode0 is equal to IwcpMpm[i].
  • the decoder may specifically perform the following operations:
  • i is greater than or equal to 4, de-binarize the binary symbol string according to Table 3, determine the value of iwcp_pred_mode1_index as j, and then perform step 3;
  • IwcpPredMode1 is equal to IwcpMpm[i].
  • IwcpPredMode1 is equal to
  • the value j of iwcp_pred_mode1_index depends on the value i of iwcp_pred_mode0_index.
  • the first frame Both the intra prediction mode and the second intra prediction mode are MPMs in the MPM list, so there are only 3 MPMs available for the second intra prediction mode, and then 1 to 2 bits can be used to indicate which MPM is, such as "00 , 01, 10" represent the remaining first MPM, second MPM, and third MPM, respectively. It can be seen that since a possibility is excluded, the encoding and decoding method or the binarization or de-binarization method can be changed to save overhead.
  • the preset angle prediction mode set includes 28 intra-frame angle prediction modes with mode numbers 4-31, and the length of the MPM list is 4, then when using the first length, When the binary symbol string of the second length and the third length determines the first mapping relationship table between the index value and the binary symbol string, the binary symbol string of the first length can be used for the 4 MPMs in the MPM list first, that is, using The shortest codeword. Next, 8 intra-angle prediction modes are selected from the remaining 24 intra-angle prediction modes to use the binary symbol string of the second length, and 16 intra-angle prediction modes are selected to use the binary symbol string of the third length.
  • a shorter codeword can be used for the prediction modes corresponding to the first 8 mode numbers in the order of the mode numbers from small to large, that is, the first A binary symbol string of two lengths, and then a longer codeword is used for the prediction modes corresponding to the next 16 mode numbers, that is, a binary symbol string of a third length is used.
  • the first mapping relationship table between the index value and the binary symbol string shown in Table 3 above can be replaced with the following Table 5, wherein the relationship between the index value and the binary symbol string is used to represent the index value and the binary symbol string.
  • Table 5 of the first mapping relationship can also be used to determine the values of the first mode index and the second mode index.
  • the second mapping relationship table between the index value and the binary symbol string shown in the above Table 4 can also be replaced with the following Table 6, wherein the second mapping relationship between the index value and the binary symbol string is used to represent the index value and the binary symbol string.
  • Table 6 may also be used to determine the value of the second mode index.
  • the preset angle prediction mode set includes a total of 20 modes, 4 3-bit codewords and 16 5-bit codewords can be used to represent them.
  • the preset angle prediction mode set includes a total of 36 modes
  • 4 3-bit codewords and 32 6-bit codewords can be used to represent them.
  • 36 intra-frame angle prediction modes with mode numbers of 4-31, 42-45, and 56-59 are used.
  • code word is understood as a string of binary symbols.
  • the length of the codeword can be understood as the length of the binary symbol string.
  • Another representation is to use a flag bit (flag) plus a binary symbol string.
  • a binary MPM_flag is used to indicate whether the current mode is MPM mode, that is, if MPM_flag is 1, it means that the current mode is MPM mode, if MPM_flag is 0, it means that the current mode is not MPM mode, and if the current mode is MPM mode, there are a total of 4 possibilities for MPM.
  • a 2-bit binary symbol string to indicate which MPM the current mode is. Then the code word can be understood as the flag bit plus the binary symbol string, and the length of the code word can be understood as the length of the flag bit plus the binary symbol string.
  • Step 105 Determine the weight matrix of the current block, and determine the predicted value of the current block based on the first intra prediction mode, the second intra prediction mode and the weight matrix.
  • the decoder needs to determine the weight matrix of the current block, so that after determining the first intra prediction mode and the second intra prediction mode used by the current block, the decoder also determines the weight matrix based on the first intra prediction mode, The second intra prediction mode and the weight matrix further determine the prediction value of the current block.
  • the decoder may determine the weight matrix of the current block according to the weight matrix derivation mode of the current block.
  • the decoder when determining the predicted value of the current block based on the first intra prediction mode, the second intra prediction mode and the weight matrix, the decoder may first determine the predicted value of the current block according to the The first intra-frame prediction mode determines the first prediction value of the current block; the second prediction value of the current block is determined according to the second intra-frame prediction mode; and then the weight matrix is used for the first prediction value A weighted operation is performed with the second predicted value to obtain the predicted value of the current block.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may both be intra-frame angle prediction modes, that is, two different intra-frame angle prediction modes are used in this embodiment of the present application. Then use the combination of the first intra prediction mode and the second intra prediction mode to generate the first prediction block and the second prediction block respectively, and then determine the prediction of the current block based on the first prediction block and the second prediction block, combined with the weight matrix piece.
  • not all points in all possible weight matrices have the same weight.
  • at least one possible weight matrix contains at least two different weight values.
  • the decoder may adopt a method similar to GPM or AWP to realize the determination of the weight matrix. Specifically, if GPM or AWP is used in the same codec standard or codec, this method can be used to determine the weight matrix, so that the same logic in the multiplexing part can be achieved. If AWP is used in AVS3 inter-frame prediction, the AWP method can be used to determine the weight matrix in AVS3. Of course, different methods from GPM or AWP in the same codec standard or codec can also be used, such as using different mode numbers, or different transition region algorithms, or using different parameters.
  • inter-frame prediction exploits the correlation in the temporal domain, it uses the reconstructed image in the reference frame as the reference block.
  • Intra-frame prediction utilizes the correlation in the spatial domain, and it uses the reconstructed pixels around the current block as reference pixels. In the airspace, the closer the distance, the stronger the correlation, and the farther the distance, the worse the correlation. Therefore, if a certain weight matrix makes the obtained pixel position used by a prediction block far away from the reference pixel, then this part may not be able to make a more suitable prediction value than the existing technology, so such a weight matrix may not be used, but Can be used in inter prediction.
  • the embodiment of the present application provides an intra-frame prediction method.
  • the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • the following prediction sample matrix is the prediction block described above, that is, a "block” can be understood as a "sample matrix", and the array mentioned in the text is meaning of matrix.
  • the prediction of the IWCP acting on the luma component can be taken as an example, but the present invention is not limited to the luma component, and can also be used for the chroma component and any component in any other format.
  • the specific process that the decoder uses the intra weighted combined prediction mode to determine the prediction value of the current block can be described as follows:
  • the weight matrix of the intra-frame weighted combined prediction (IWCP) mode multiplexes the weight matrix of the AWP, that is, the weight matrix derivation method of IWCP and the AWP
  • the weight matrix is derived in the same way.
  • a sequence-level flag may be used to determine whether the current sequence to be decoded uses the IWCP mode. For example:
  • Sequence header definition Descriptor sequence_header() ⁇ ... iwcp_enable_flag u(1) ...
  • the allowable flag iwcp_enable_flag of the intra-frame weighted combined prediction mode is a binary variable. Specifically, the iwcp_enable_flag value of '1' indicates that the intra-frame weighted combined prediction mode can be used; the value of '0' indicates that intra-frame weighted combined prediction should not be used. model.
  • the value of IwcpEnableFlag is equal to iwcp_enable_flag. If iwcp_enable_flag is not present in the bitstream, the value of IwcpEnableFlag is 0.
  • a frame-level flag may be used to determine whether the current frame to be decoded uses the IWCP mode. For example, it is possible to configure intra-frame frames (such as I frames) to use IWCP mode, and inter-frame frames (such as B frames and P frames) to not use IWCP mode. Or it can be configured that the intra-frame does not use the IWCP mode, and the inter-frame uses the IWCP mode. Alternatively, some inter-frames can be configured to use the IWCP mode, and some inter-frames do not apply the IWCP mode.
  • 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 may be used to determine whether this area uses the IWCP mode.
  • the decoder decodes the current CU, and if the current CU meets the IWCP usage condition, decodes the IWCP usage flag of the current CU. Otherwise there is no need to decode the IWCP usage flag of the current CU.
  • IwcpMinSize is equal to 8 and IwcpMaxSize is equal to 32.
  • IwcpMinSize equal to 8 and IwcpMaxSize equal to 16.
  • width is the width of the current CU
  • height is the height of the current CU.
  • an 8x8 block of luma corresponds to a 4x4 block of chrominance at the same position.
  • One possible method is to allow the 8x8 block of luma to use IWCP. mode but disables chroma for 4x4 blocks using IWCP mode. Because the prediction effect of the 4 ⁇ 4 block in the IWCP mode is not significantly improved, on the other hand, the implementation cost of the hardware is increased.
  • the current CU will not use, for example, Derived Tree (DT), Intra Prediction Filter (IPF), and Improved Intra Prediction (IIP) and some other modes. , that is, if the current CU uses IWCP, it does not need to process the related information of these modes. This is because the prediction effect of IWCP combined with these modes cannot be significantly improved.
  • DT Derived Tree
  • IPF Intra Prediction Filter
  • IIP Improved Intra Prediction
  • the current CU uses IWCP, the derived mode DT, intra-frame prediction filter IPF, and improved intra-frame prediction IIP are not used by default, so there is no need to transmit the flags of whether they are used in the code stream, such as dt_split_flag, intra_pf_flag, iip_flag, you can Saving code words is beneficial to compression efficiency.
  • the intra-frame weighted combination prediction flag iwcp_flag is a binary variable, and the iwcp_flag value of '1' indicates that the intra-frame weighted combination prediction mode should be used; the value of '0' indicates that the intra-frame weighted combination prediction mode should not be used.
  • the value of IwcpFlag is equal to the value of iwcp_flag. If iwcp_flag does not exist in the bitstream, the value of IwcpFlag is 0.
  • the derivative mode division flag dt_split_flag is a binary variable.
  • a value of dt_split_flag of '1' indicates that the derivative mode division should be performed; the value of '0' indicates that the derivative mode division should not be performed.
  • the value of DtSplitFlag is equal to the value of dt_split_flag, and the value range is 0 to 4. If dt_split_flag does not exist in the bitstream, the value of DtSplitFlag is 0.
  • Derived mode partition means that rectangular prediction units may be partitioned on the basis of the current CU.
  • the intra prediction filtering flag intra_pf_flag is a binary variable.
  • the intra_pf_flag value of '1' indicates that the current coding unit should use intra-frame prediction filtering; the value of '0' indicates that the current coding unit should not use intra-frame prediction filtering.
  • the value of IntraPfFlag is equal to the value of intra_pf_flag. If intra_pf_flag does not exist in the bitstream, the value of IntraPfFlag is 0.
  • Intra-frame prediction filtering can use reference pixels to filter the initial prediction value after generating the initial prediction value to generate a new prediction value.
  • the improved intra prediction flag iip_flag is a binary variable.
  • the iip_flag value of '1' indicates that the current coding unit should use improved intra prediction; the value of '0' indicates that the current coding unit should not use improved intra prediction.
  • the value of IipFlag is equal to the value of iip_flag. If iip_flag does not exist in the bitstream, the value of IipFlag is 0.
  • the improved intra prediction can generate predicted values using different filters than when the improved prediction is not used. An example is for certain angle predictions, where the improved intra prediction uses an 8-tap filter to produce the predicted value. The predicted value is generated using a 4-tap filter when not using improved intra prediction.
  • the weight matrix derivation mode reuses the weight matrix derivation mode of the AWP.
  • the intra-frame weighted combined prediction mode index iwcp_idx is used to determine the weight matrix of the intra-frame weighted combined prediction mode, and the value of IwcpIndex is equal to the value of iwcp_idx. If iwcp_idx does not exist in the bitstream, the value of IwcpIndex is equal to 0.
  • the first mode index iwcp_pred_mode0_index in the intra weighted combined prediction mode is used to determine the first intra prediction mode IwcpPredMode0 of the luma block of the intra weighted combined prediction mode.
  • the second mode index iwcp_pred_mode1_index in the intra weighted combined prediction mode is used to determine the second intra prediction mode IwcpPredMode1 of the luma block of the intra weighted combined prediction mode
  • the first intra-frame luminance prediction sample matrix predMatrixY0 can be determined according to IwcpPredMode0, and the first intra-frame luminance prediction sample matrix predMatrixY0 can be determined according to IwcpPredMode1.
  • Two intra-frame luminance prediction sample matrix predMatrixY1 and after determining the luminance weight matrix IwcpWeightMatrixY according to IwcpIndex, use the luminance weight matrix IwcpWeightMatrixY to perform a weighting operation on the first intra-frame luminance prediction sample matrix predMatrixY0 and the second intra-frame luminance prediction sample matrix predMatrixY1, and finally determine Luma prediction sample matrix predMatrixIwcpY.
  • the luminance prediction sample matrix predMatrixIwcpY of the IWCP is determined according to the two intra-frame luminance prediction sample matrices predMatrixY0, predMatrixY1 and the weight matrix IwcpWeightMatrixY.
  • the specific method is as follows:
  • the value of the element predMatrixIwcpY[x][y] in the prediction sample matrix predMatrixIwcpY of the intra weighted combined prediction mode is ((predMatrixY0[x][y]*IwcpWeightMatrixY[x][y]+predMatrixY1[x][y]* (8-IwcpWeightMatrixY[x][y])+4)>>3).
  • (x, y) is the coordinate position within the current block.
  • the subsequent processing may also include decoding of the quantized coefficients, inverse transformation, inverse quantization to determine the residual block, and the residual block. And the prediction block is combined into a reconstructed block, and the subsequent loop filtering, etc.
  • the embodiment of the present application provides an intra-frame prediction method.
  • the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • FIG. 9 is a schematic diagram 2 of the implementation flow of the intra-frame prediction method.
  • the method for performing intra-frame prediction by the encoder may include the following step:
  • Step 201 when the current block uses the IWCP mode to determine the intra-frame prediction value of the current block, determine the first intra-frame prediction mode and the second intra-frame prediction mode of the current block; wherein, the first intra-frame prediction mode and the second intra-frame prediction mode are The prediction modes are two different intra-angle prediction modes.
  • the encoder may first determine the first intra prediction mode and the second intra prediction mode of the current block;
  • the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes.
  • the IWCP mode is an intra-frame prediction method, and specifically, the IWCP mode is to determine two different intra-frame angle prediction modes for the current block, and then according to the two different The intra-frame angle prediction mode of , determines two prediction blocks, then a weight matrix can be determined, and the two prediction blocks are combined according to the weight matrix, and finally a new prediction block can be obtained, that is, the prediction block of the current block can be obtained.
  • the size of the current block may be limited.
  • the intra-frame prediction method proposed in the embodiment of the present application needs to use two different intra-frame angle prediction modes to generate two prediction blocks, and then perform weighting according to the weight matrix to obtain a new prediction block, in order to reduce the complexity of
  • the IWCP mode may be restricted from not using this IWCP mode for prediction blocks of some sizes. Therefore, in this application, the encoder may first determine the size parameter of the current block, and then determine whether the current block uses the IWCP mode according to the size parameter.
  • the size parameter of the current block may include the height and width of the current block. Therefore, the encoder may use the height and width of the current block to limit the use of the IWCP mode, that is, limit the use of the IWCP mode. The size of the prediction block in IWCP mode.
  • both the width and the height are greater than or equal to the first lower limit value, and at the same time, both the width and the height are less than or equal to the first upper limit value, then it can be determined that the current block uses the IWCP mode. It can be seen that a possible restriction is to use only when the width and height of the predicted block are less than (or less than or equal to) the first upper limit value, and the width and height of the predicted block are greater than (or greater than or equal to) the first lower limit value. IWCP mode. Wherein, the first lower limit value may be 8, and the value of the first upper limit value may be 16 or 32 or the like.
  • an 8x8 block of luma corresponds to a 4x4 block of chrominance at the same position.
  • One possible method is to allow the 8x8 block of luma to use IWCP. mode but disables chroma for 4x4 blocks using IWCP mode. Because the prediction effect of the 4 ⁇ 4 block in the IWCP mode is not significantly improved, on the other hand, the implementation cost of the hardware is increased.
  • intra-frame frames such as I frames
  • inter-frame frames such as B frames and P frames
  • the intra-frame does not use the IWCP mode
  • the inter-frame uses the IWCP mode.
  • some inter-frames can be configured to use the IWCP mode, and some inter-frames do not use the IWCP mode.
  • Inter-frames can also use intra-frame prediction, so it is also possible for inter-frames to use IWCP mode.
  • a flag below the frame level and above the CU level (such as tile, slice, patch, LCU, etc.) to determine whether this area uses the IWCP mode.
  • the encoder can determine a combination of the minimum rate-distortion intra-frame prediction mode and the weight matrix derivation mode, wherein the combination includes the first intra-frame prediction mode, the second Intra prediction mode, weight matrix derivation mode.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may be two different intra-frame angle prediction modes.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may be respectively two different intra-frame angle prediction modes in the preset angle prediction mode set.
  • both the first intra-frame prediction mode and the second intra-frame prediction mode can only be intra-frame angle prediction modes, that is, neither the first intra-frame prediction mode nor the second intra-frame prediction mode is a division
  • Other basic intra-frame prediction modes other than the intra-frame angle prediction mode such as intra-frame non-angle prediction modes, including DC mode, Planar mode, PLANE mode, Bilinear mode, PCM mode, etc.
  • the basic intra-frame prediction modes include, but are not limited to, an angular prediction mode and a non-angular prediction mode. Such as 67 intra prediction modes used by VVC and 66 intra prediction modes used by AVS3.
  • the restriction of the intra-frame angle prediction mode on the first intra-frame prediction mode and the second intra-frame prediction mode can reduce the hardware implementation complexity of the intra-frame weighted combination prediction mode on the one hand, because When the hardware implements the intra-frame weighted combination prediction mode in a parallel manner, only a set of circuits that support the intra-frame angle weighted prediction need to be added;
  • the non-angle prediction mode usually deals with scenes with relatively uniform texture changes, and there are fewer modes that can be used to reduce overhead. Therefore, the intra-frame weighted combined prediction mode or not using the intra-frame non-angle prediction mode has little effect on compression performance.
  • the encoder may limit the available intra-angle prediction modes for the first intra-frame prediction mode and the second intra-frame prediction mode using a preset angle prediction mode set, wherein the preset angle prediction mode set is all intra-frame angles A subset of prediction modes.
  • AVS3 has 62 angle modes, that is, intra-frame angle prediction modes with mode numbers 3-32 and 34-65.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may only use the intra-frame angle prediction modes whose mode numbers are 3-32, or the first intra-frame prediction mode and the second frame.
  • the intra prediction mode may use only 28 intra angle prediction modes with mode numbers 4-31.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may only use the intra-frame angle prediction mode whose mode number is an even number, or the first intra-frame prediction mode and The second intra prediction mode may use only intra angle prediction modes whose mode numbers are odd.
  • the angle prediction mode set used by the first intra prediction mode and the angle prediction mode set used by the second intra prediction mode are different.
  • the decoder can use the same preset angle prediction mode set to limit the first intra prediction mode and the second intra prediction mode, that is, if the first intra prediction mode can only use the mode number 4- 28 intra-frame angle prediction modes of 31, the second intra-frame prediction mode can also only use the 28 intra-frame angle prediction modes with mode numbers 4-31, and then the first intra-frame prediction mode and the second intra-frame prediction mode. You can use the same MPM list and use the same or similar codecs.
  • the decoder restricts the first intra prediction mode and the second intra prediction mode using different preset angle prediction mode sets, then the first intra prediction mode and the second intra prediction mode need to be restricted. Use a different MPM list or use a significantly different codec.
  • Step 202 Build the MPM list of the current block.
  • the encoder may further construct the MPM list of the current block.
  • the prediction modes in the MPM list are all intra-angle prediction modes.
  • the encoder when the encoder constructs the MPM list of the current block, it needs to first determine the weight matrix derivation mode of the current block, and then use the weight matrix derivation mode to further determine the MPM list of the current block.
  • the weight matrix derivation mode is used to determine the weight matrix used by the current block.
  • the weight matrix derivation mode may be a mode of deriving the weight matrix.
  • each weight matrix derivation mode can derive a weight matrix; for a prediction block of the same size, different weight matrix derivation modes derive different weight matrices.
  • the AWP of AVS3 has 56 weight matrix derivation modes
  • the GPM of VVC has 64 weight matrix derivation modes.
  • the decoder when constructing the MPM list of the current block, may construct the MPM list directly based on the prediction mode and the weight matrix derivation mode of the adjacent blocks of the current block.
  • the encoder when constructing the MPM list of the current block, may also construct the MPM list based on the prediction mode of the adjacent blocks of the current block, the set of preset angle prediction modes, and the weight matrix derivation mode. List of MPMs.
  • the preset angle prediction mode set may be a subset of all intra-frame angle prediction modes. Taking AVS3 as an example, the preset angle prediction mode set may only include 28 intra angle prediction modes with mode numbers 4-31.
  • the preset angle prediction mode set may be a combination of all intra angle prediction modes; if necessary The range of the first intra-frame prediction mode and the second intra-frame prediction mode is limited, then the preset angle prediction mode set can be only a combination of some intra-frame angle prediction modes, and the preset angle prediction mode set can be used for The range of the first intra-frame prediction mode and the second intra-frame prediction mode is limited, thereby effectively reducing overhead and improving compression performance.
  • the MPM list may be constructed first.
  • a first candidate mode is determined by using the prediction mode of the adjacent block; meanwhile, a second candidate mode is determined by using the weight matrix derivation mode; and then the first candidate mode, the second candidate mode and the prediction Set the angle prediction mode set, and construct the MPM list of the current block.
  • the encoder determines the first candidate mode by using the prediction mode of the adjacent block, if the adjacent block is an ordinary intra-frame prediction block, and the prediction mode of the adjacent block is Intra prediction mode, the prediction mode of the adjacent block is determined as the first candidate mode.
  • the common intra prediction block refers to the prediction block using prediction modes such as DC mode, Planar mode, Bilinear mode, and angle prediction mode, rather than using the IBC mode, string copy intra prediction intra string copy.
  • a prediction block for prediction modes such as prediction.
  • the encoder when using the weight matrix derivation mode to determine the second candidate mode, the encoder may first determine the boundary angle index value according to the weight matrix derivation mode; and then use the boundary angle index value determines the second candidate mode.
  • the second candidate mode is L different intra-frame angle prediction modes, so that the construction of an MPM list of length L can be ensured.
  • the position of the weight change constitutes a straight line, or, in the case that the weight matrix has multiple weights, the transition region has the same weight.
  • the positions form a straight line, which can be called the dividing line. You can set the horizontal right angle to 0, and the angle increases counterclockwise. Then the dividing line may be horizontal 0 degrees, vertical 90 degrees, inclined such as 45 degrees, 135 degrees, and various other angles.
  • the corresponding texture is likely to show different characteristics on both sides of the dividing line, such as two textures with different angles on both sides of the dividing line, or one side of the dividing line is an angle texture, while the other side is a relatively flat texture. Since the dividing line itself has an angle, it can be assumed that a point is predicted by intra-frame angle, and it may be close to some textures of the current block, so this line and the two intra-frame prediction modes of the current block are There is a correlation.
  • the boundary line is obtained from a point through intra-frame angle prediction, then at least one intra-frame angle prediction mode can be found, and this intra-frame angle prediction mode can approximate the boundary line.
  • the horizontal dividing line matches the horizontal intra prediction mode, such as mode 24 in AVS3;
  • the vertical dividing line matches the vertical intra prediction mode, such as mode 12 in AVS3;
  • the boundary line can match the intra prediction mode of 45 degrees from the lower left to the upper right, such as mode 30 in AVS3; it can also match the intra prediction mode of 225 degrees from the upper right to the lower left, such as mode 6 in AVS3.
  • weight matrix derivation mode can be matched to some intra prediction modes, so the weight matrix derivation mode can be used to assist the decoding of the intra prediction mode.
  • the weight matrix derivation mode may also be an index of the weight matrix, for example, the 56 modes of AWP can be regarded as 56 weight matrix derivation modes.
  • a mapping relationship table may be constructed to further represent the mapping relationship between the weight matrix derivation mode and the intra-angle prediction mode.
  • the boundary lines of multiple modes of AWP and GPM are all the same angle, for example, the angle of the boundary line of AWP of AVS3 is the same every 8 modes.
  • 56 AWP modes have a total of 8 dividing line angles.
  • the index of the dividing line angle can be obtained from the mode number modulo 8 (%8) of the weight matrix derived mode.
  • Table 1 above is a mapping relationship table.
  • the indices 0 and 1 of the boundary angle can correspond to two intra-frame angle prediction modes, one from the upper right corner to the lower left corner, and the other from the upper left corner. to the bottom right.
  • another approximately corresponding intra-angle prediction mode may be found for indices of other boundary angles, or all indices of boundary angles correspond to only one intra-angle prediction mode.
  • the encoder may utilize the correlation of the weight matrix with the intra-angle prediction modes to construct the MPM list of intra-weighted combined prediction modes. For example, when constructing the MPM list of intra-frame weighted combined prediction modes, if the list length of the MPM list is 4, the candidate modes corresponding to the boundary angle indices in Table 2 may be added to the MPM list.
  • the number of candidate modes corresponding to the index of each boundary angle is equal to the length of the MPM list, which can ensure that even if all the intra prediction modes of the referenced adjacent blocks are unavailable. Fill up the MPM list. If the length of the MPM list is 4, the number of candidate modes corresponding to the index of each boundary angle can be set to 4.
  • the encoder when the encoder constructs the MPM list according to the first candidate mode, the second candidate mode and the preset angle prediction mode set, the encoder can also be based on the preset angle prediction mode.
  • the set performs a screening process on the first candidate mode to obtain a candidate mode after screening; and constructs the MPM list according to the candidate mode after screening and the second candidate mode.
  • the encoder when the encoder performs screening processing on the first candidate mode based on the preset angle prediction mode set and obtains a candidate mode after screening, if the first candidate mode belongs to the preset angle prediction mode set, the first candidate mode is determined as the post-screened candidate mode; if the first candidate mode is an intra-frame angle prediction mode and does not belong to the preset angle prediction mode set, then A replacement mode of the first candidate mode is determined from the preset angle prediction mode set, and the replacement mode is determined as the screened candidate mode.
  • the encoder can directly delete the first candidate mode.
  • the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes, excluding intra frame prediction modes.
  • Non-angle prediction mode therefore, for the intra-frame weighted combination prediction mode, the selection of the most probable mode MPM of the current block, that is, the construction method of the MPM list, also needs to be adjusted accordingly.
  • the encoder needs to refer to the intra prediction modes of adjacent blocks around the current block when constructing the MPM list. Peripheral adjacent blocks are such as left adjacent block, upper adjacent block, upper left adjacent block, upper right adjacent block, lower left adjacent block and so on. Due to the spatial correlation, a certain prediction mode is used in the surrounding adjacent blocks, and the current block has a higher probability of using the same or similar prediction mode.
  • both the first intra-frame prediction mode and the second intra-frame prediction mode of the intra-frame weighted combined prediction mode can only be the intra-frame angle prediction mode
  • the encoder does not use the intra-frame non-angle prediction mode used by this reference block when constructing the MPM list of the current block, That is, the intra non-angle prediction mode is not added to the MPM list of the current block.
  • the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong is a subset of all intra angle prediction modes
  • the intra-frame prediction mode is an intra-frame angle prediction mode other than the preset angle prediction mode set, that is, the first candidate mode is the intra-frame angle prediction mode and does not belong to the preset angle prediction mode set
  • the encoder is constructing the current block.
  • the intra angle prediction mode outside the preset angle prediction mode set can be converted into an intra angle prediction mode within the preset angle prediction mode set with a similar angle, and then added to the MPM list.
  • Intra-frame angle prediction mode No. 12 the encoder can add intra-frame angle prediction No. 12 similar to the intra-frame angle prediction No. 43 to the MPM list of the current block in the intra-frame weighted combined prediction mode.
  • the encoder when the encoder constructs the MPM list according to the candidate mode after screening and the second candidate mode, if the candidate mode after screening satisfies the preset addition condition, then Add the filtered candidate mode to the MPM list; if the MPM list does not meet the preset list length L, and the second candidate mode satisfies the preset addition condition, then add the second candidate mode Add to the MPM list; wherein, L is an integer greater than or equal to 1.
  • the value of L may be 4, that is, the preset list length of the MPM list is 4, or in other words, the MPM list includes 4 most probable patterns.
  • the encoder may sort the L modes in the MPM list in ascending order of mode numbers.
  • the encoder can determine that the candidate mode after screening satisfies the preset addition condition;
  • the encoder may determine that the second candidate mode satisfies the preset addition condition.
  • the encoder determines the sequence parameter corresponding to the adjacent block when adding the filtered candidate mode corresponding to the adjacent block to the MPM list;
  • the corresponding post-screening candidate mode is added to the MPM list.
  • the encoder can determine the corresponding sequence parameter according to the spatial distance between the adjacent block and the current block. For example, the closer the spatial distance between the adjacent block and the current block, the stronger the correlation between the two, the earlier the The addition processing is performed, that is, the smaller the order parameter is; the further the spatial distance between the adjacent block and the current block, the weaker the correlation between the two, and the later the addition processing is performed, that is, the larger the order parameter is.
  • the encoder after the encoder adds the filtered candidate mode and/or the second candidate mode to the MPM list, the encoder can also perform mode numbers in an ascending order of mode numbers in the MPM list.
  • the L prediction modes are sorted.
  • the MPM list of the current block in the intra-frame weighted combined prediction mode is IwcpMpm[4], that is, the list length of the MPM list is 4, the index of the weight matrix derivation mode is IwcpIndex, and the weight matrix is derived.
  • the mode multiplexes the 56 derivation modes of the AWP, and the preset angle prediction mode set to which the first intra prediction mode and the second intra prediction mode belong are the intra angle prediction modes No. 4-31. Then the encoder can perform the following steps in sequence when building the MPM list of the current block:
  • Step S1 set the array cand_mode[10], and all values of cand_mode are initialized to invalid values. Do the following for cand_mode:
  • cand_mode[3] is equal to the intra-frame prediction mode of A
  • cand_mode[4] is equal to the intra prediction mode of B
  • the adjacent block X (X is A, B, C, D, F or G) "exists" means that the block should be within the image and the block should belong to the same slice as block E; otherwise the adjacent block "does not exist” . If the block "does not exist” or has not been decoded, the block is "unavailable”; otherwise the block is "available”. If the block in which the image sample is located is "not present” or the sample has not been decoded, the sample is "unavailable”; otherwise the sample is "available”.
  • Step S2 for i from 0 to 5, perform the following operations:
  • the encoder can directly delete the first candidate mode, that is, not use the first candidate mode.
  • the encoder can select a similar intra-angle prediction mode from the preset angle prediction mode set pattern as a replacement pattern for the first candidate pattern, and then this replacement pattern as a filtered candidate pattern.
  • the encoder can directly use the first candidate mode, that is, the first candidate mode is the filtered candidate mode.
  • step S2 is the screening process of the first candidate mode, and a post-screening candidate mode corresponding to the first candidate mode is finally determined.
  • Step S3 record mpm_num as 0, and perform the following operations for i from 0 to 9:
  • the encoder can add the candidate mode after screening to the MPM list. ; If all the post-screening candidate modes that meet the preset addition conditions are added to the MPM list, and the prediction modes in the MPM list are less than 4, then the encoder can continue to add the second candidate modes that meet the preset addition conditions to the MPM list. , until the list length of the MPM list reaches 4.
  • Step S4 sort the four numbers of IwcpMpm[4] in ascending order.
  • the encoder can sort the 4 intra-angle prediction modes in the MPM list in ascending order of mode numbers.
  • this application does not limit the execution order of the above-mentioned steps 202 and 203, that is, does not limit the sequence between the determination process of the first intra prediction mode and the second intra prediction mode and the construction process of the MPM list. .
  • Step 203 Determine the first mode index and the second mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list.
  • the encoder can further , the second intra prediction mode, and the MPM list to determine the first mode index and the second mode index of the current block.
  • the first mode index may be used to indicate the first intra prediction mode used by the current block
  • the second mode index may be used for the second intra prediction mode of the current block. mode to indicate.
  • the value of the first mode index and the value of the second mode index are related to the number of intra-frame angle prediction modes that may exist in the first intra-frame prediction mode and the second intra-frame prediction mode, for example, the first intra-frame prediction mode
  • the prediction mode and the second intra-frame prediction mode may be one of the 28 intra-frame angle prediction modes with mode numbers 4-31, respectively, then the value of the first mode index and the value of the second mode index both belong to the range 0 ⁇ 27.
  • the parameter iwcp_pred_mode0_index may be used to represent the first mode index
  • the parameter iwcp_pred_mode1_index may be used to represent the second mode index
  • the encoder may determine a first mapping relationship table between the index value and the binary symbol string; wherein the first mapping relationship table includes a first length, a second length and a third length respectively The binary string of symbols.
  • the first length is 3 bits
  • the second length is 5 bits
  • the third length is 6 bits.
  • the first mapping relationship table between the index value and the binary symbol string may be used to determine the values of the first mode index and the second mode index.
  • the preset angle prediction mode set includes a total of 28 modes
  • 4+8+ can be used.
  • 16 form encoding that is, a pattern of 4 shortest codewords, a pattern of 8 shorter codewords, and a pattern of 16 longer codewords.
  • the mode of 4 shortest codewords uses 3-bit codewords, that is, the first length is used
  • the mode of 8 shorter codewords uses 5-bit codewords, that is, the second length is used, that is, the mode of 16 longer codewords
  • a 6-bit codeword is used, that is, the third length is used.
  • the prediction angles using the 28 intra-frame angle prediction modes with mode numbers 4-31 basically cover the entire commonly used angle range, and at the same time, the mode numbers are 4-31 intra-frame angle prediction
  • the mode is simpler than the intra-angle prediction mode with mode numbers 34-65, and using these 28 modes to encode in the form of 4+8+16 will not cause waste of code words, so the encoder can preferably follow the mode number 4.
  • the 28 intra-angle prediction modes of -31 define a set of preset angle prediction modes.
  • the 4 most probable patterns in the MPM list can correspond to the binary symbol string using the first length, that is, the 4 shortest codes.
  • the word mode can be used for 4 MPMs in the MPM list; correspondingly, other prediction modes in the preset angle prediction mode set other than the MPM list can use the binary symbol string of the second length and the binary symbol of the third length respectively. string of symbols.
  • the encoder can The patterns of the words are evenly distributed. Specifically, the encoder may evenly distribute the modes of the 8 shorter codewords (binary symbol strings of the second length) among the remaining 24 intra-angle prediction modes. For example, a pattern of 1 shorter codeword (binary symbol string of second length) is used for every pattern of 2 longer codewords (binary symbol string of third length). Furthermore, in the specific execution process, it can be realized by the sequence number modulo 3 (%3) from 0-23 in the remaining 24 intra-frame angle prediction modes. The binary symbol string of the second length is used, and the serial number modulo 3 is 0 or 1 to use a 6-bit codeword, that is, the binary symbol string of the third length is used.
  • a mapping relationship table may be as shown in Table 3 above, wherein the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits.
  • the first bit can be used to indicate whether it is MPM, for example, "1" indicates that it is MPM, and "0" indicates that it is not MPM. If the first intra prediction mode is MPM, assuming that there are 4 MPMs in the MPM list, then 2 bits can be used to indicate which MPM in the MPM list is used, that is, "00, 01, 10, 11" respectively indicate the MPM The first MPM in the list, the second MPM, the third MPM, the fourth MPM.
  • the context model is used for encoding the binary symbol string whose bit flag is 0, and the context model is not used for encoding the binary symbol string whose bit flag is not 0.
  • the value of the bit flag may indicate how many bits have been encoded, and the bit flag may be represented by binIdx.
  • the context model can be used to encode the binary symbol string whose binIdx is 0, while the binary symbol string whose binIdx is not 0 can be encoded using the context model.
  • the encoder determines the first mode index and the second mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list , if the mode number of the first intra-frame prediction mode is the same as the mode number of the m-th mode in the MPM list, then the value i of the first mode index is assigned according to m; The mode number of the intra prediction mode is different from the mode number of any mode in the MPM list, then the value i of the first mode index is determined by using the MPM list; according to the first mapping relationship table and i The first mode index is determined.
  • m is an integer greater than or equal to 0 and less than L.
  • the encoder uses the MPM list to determine the value i of the first mode index
  • the mode number of the first intra prediction mode is greater than or equal to the fourth value in the MPM list mode number of the first intra-frame prediction mode
  • the mode number of the first intra-frame prediction mode is smaller than the The mode number of the fourth mode is greater than or equal to the mode number of the third mode in the MPM list, then assigns i according to the difference between the mode number of the first intra-frame prediction mode and 3
  • the mode number of the first intra-frame prediction mode is smaller than the mode number of the third mode in the MPM list, and is greater than or equal to the mode number of the second mode in the MPM list, then according to the The difference between the mode number of the first intra-frame prediction mode and 2 is assigned to i; if the mode number of the first intra-frame prediction mode is less than the mode number of the second mode in the MPM
  • the encoder can determine the first mode index according to the first mapping relationship table and i. , specifically, the encoder may perform binarization processing on i according to the first mapping relationship table shown in Table 3 above to determine the first mode index.
  • the encoder determines the first mode index and the second mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list , if the mode number of the second intra-frame prediction mode is the same as the mode number of the mth mode in the MPM list, then the value j of the first mode index is assigned according to m; The mode number of the intra prediction mode is different from the mode number of any mode in the MPM list, then the value j of the first mode index is determined by using the MPM list; according to the first mapping relationship table and j The second mode index is determined.
  • m is an integer greater than or equal to 0 and less than L.
  • the encoder uses the MPM list to determine the value j of the first mode index
  • if the mode number of the second intra prediction mode is greater than or equal to the fourth value in the MPM list mode number of the second intra-frame prediction mode then assign j according to the difference between the mode number of the second intra-frame prediction mode and 4; if the mode number of the second intra-frame prediction mode is smaller than the MPM list
  • the mode number of the fourth mode is greater than or equal to the mode number of the third mode in the MPM list, then assign j according to the difference between the mode number of the second intra-frame prediction mode and 3; If the mode number of the second intra prediction mode is less than the mode number of the third mode in the MPM list, and is greater than or equal to the mode number of the second mode in the MPM list, then according to the The difference between the mode number of the second intra prediction mode and 2 is assigned to j; if the mode number of the second intra prediction mode is less than the mode number of the second mode in the MPM list, and greater
  • the encoder can determine the second mode index according to the first mapping relationship table and j. , specifically, the encoder may perform binarization processing on j according to the first mapping relationship table shown in Table 3 above to determine the second mode index.
  • the preset angle prediction mode set includes 28 intra-frame angle prediction modes with mode numbers 4-31.
  • the encoder may first determine that the first intra-frame prediction mode is IwcpPredMode0, and the second intra-frame prediction mode is IwcpPredMode1, and then can According to the first intra prediction mode IwcpPredMode0, the second intra prediction mode IwcpPredMode1 further determines the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index, wherein the values of iwcp_pred_mode0_index and iwcp_pred_mode1_index range from 0-27.
  • the encoder may specifically perform the following operations when determining the first mode index iwcp_pred_mode0_index:
  • IwcpPredMode0 is equal to IwcpMpm[m], where m is greater than or equal to 0 and less than 4, then the value i of iwcp_pred_mode0_index is equal to m.
  • IwcpPredMode0 is not equal to IwcpMpm[m]
  • IwcpPredMode0 is the value i of iwcp_pred_mode0_index equal to IwcpPredMode0 ⁇ IwcpMpm[0]? IwcpPredMode0:IwcpPredMode0 ⁇ IwcpMpm[1]? IwcpPredMode0-1:IwcpPredMode0 ⁇ IwcpMpm[2]? IwcpPredMode0-2:IwcpPredMode0 ⁇ IwcpMpm[3]? IwcpPredMode0-3: IwcpPredMode0–4.
  • the same index value as i can be determined from the left column of Table 3, and then the binary symbol string iwcp_pred_mode0_index can be determined from the right column of the same row.
  • the encoder when the encoder determines the second mode index iwcp_pred_mode1_index after determining the second intra prediction mode IwcpPredMode1 used by the intra-frame weighted combined prediction mode of the current block, it may specifically perform the following operations:
  • IwcpPredMode1 is equal to IwcpMpm[m], where m is greater than or equal to 0 and less than 4, then the value j of iwcp_pred_mode1_index is equal to m.
  • IwcpPredMode1 is not equal to IwcpMpm[m]
  • IwcpPredMode1 is the value j of iwcp_pred_mode1_index equal to IwcpPredMode1 ⁇ IwcpMpm[0]? IwcpPredMode1:IwcpPredMode1 ⁇ IwcpMpm[1]? IwcpPredMode1-1:IwcpPredMode1 ⁇ IwcpMpm[2]? IwcpPredMode1-2:IwcpPredMode1 ⁇ IwcpMpm[3]? IwcpPredMode1-3: IwcpPredMode1–4.
  • the same index value as j can be determined from the left column of Table 3, and then the binary symbol string iwcp_pred_mode1_index can be determined from the right column of the same row.
  • the first intra-frame prediction mode and the second intra prediction mode can share a preset angle prediction mode set, and can also share the same MPM list, but the first intra prediction mode and the second intra prediction mode in the intra weighted combined prediction mode are not the same. Therefore, when encoding and decoding the second intra-frame prediction mode, the first intra-frame prediction mode may be referred to. Specifically, when determining the second intra-frame prediction mode, the first intra-frame prediction mode may be excluded.
  • the probability of occurrence of 4 MPMs in the MPM list is very high (the first intra-frame angle prediction mode).
  • the probability that the prediction mode is one of the 4 MPMs in the MPM list is about 50%, and the probability that the second intra prediction mode is one of the 4 MPMs in the MPM list is about 50%), if the first intra The prediction mode and the second intra-frame prediction mode are both MPMs in the MPM list, so when determining the second intra-frame prediction mode, you can only select from the other 3 MPMs in the MPM list other than the first intra-frame prediction mode One will do.
  • the second intra-frame prediction mode can also be removed from the 24 intra-frame angle prediction modes of 8+16. , but this effect is relatively small.
  • the encoder determines the first mode index and the first mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list.
  • the value j of the first mode index is assigned according to m; if The mode number of the second intra prediction mode is different from the mode number of any mode in the MPM list, then the MPM list is used to determine the value j of the first mode index; according to the first mapping A relationship table, a second mapping relationship table of index values and binary symbol strings, and j determine the second mode index.
  • the second mapping relationship table between index values and binary symbol strings, and j, if i is less than L and less than j, after subtracting 1 from j, binarize j according to the second mapping relationship table to determine the second mode index; if j is greater than or equal to L, then according to the first mapping relationship
  • the table performs binarization processing on j to determine the second mode index.
  • the encoder may determine a second mapping relationship table between the index value and the binary symbol string; wherein, the second mapping relationship table includes the first length, the second length, and the third length respectively. and a binary symbol string of the fourth length.
  • the first length is 3 bits
  • the second length is 5 bits
  • the third length is 6 bits
  • the fourth length is 2 bits.
  • the second mapping relationship table between the index value and the binary symbol string is only used to determine the value of the second mode index.
  • the second mapping relationship table between the index value and the binary symbol string may be as shown in Table 4 above, wherein the first length is 3 bits, the second length is 5 bits, and the third length is 6 bits, the fourth length is 2 bits.
  • the context model can be used to encode the binary symbol string whose binIdx is 0, while the binary symbol string whose binIdx is not 0 can be encoded using the context model.
  • the preset angle prediction mode set includes 28 intra-frame angle prediction modes with mode numbers 4-31.
  • the encoder may first determine that the first intra-frame prediction mode is IwcpPredMode0, and the second intra-frame prediction mode is IwcpPredMode1, and then can According to the first intra prediction mode IwcpPredMode0, the second intra prediction mode IwcpPredMode1 further determines the first mode index iwcp_pred_mode0_index and the second mode index iwcp_pred_mode1_index.
  • the encoder may specifically perform the following operations when determining the first mode index iwcp_pred_mode0_index:
  • IwcpPredMode0 is equal to IwcpMpm[m], where m is greater than or equal to 0 and less than 4, then the value i of iwcp_pred_mode0_index is equal to m.
  • IwcpPredMode0 is not equal to IwcpMpm[m]
  • IwcpPredMode0 is the value i of iwcp_pred_mode0_index equal to IwcpPredMode0 ⁇ IwcpMpm[0]? IwcpPredMode0:IwcpPredMode0 ⁇ IwcpMpm[1]? IwcpPredMode0-1:IwcpPredMode0 ⁇ IwcpMpm[2]? IwcpPredMode0-2:IwcpPredMode0 ⁇ IwcpMpm[3]? IwcpPredMode0-3: IwcpPredMode0–4.
  • the same index value as i can be determined from the left column of Table 3, and then the binary symbol string iwcp_pred_mode0_index can be determined from the right column of the same row.
  • the encoder performs the second mode index after determining the second intra prediction mode IwcpPredMode1 used by the intra weighted combined prediction mode of the current block.
  • Iwcp_pred_mode1_index you can perform the following operations:
  • IwcpPredMode1 is equal to IwcpMpm[m], where m is greater than or equal to 0 and less than 4, then the value j of iwcp_pred_mode1_index is equal to m.
  • IwcpPredMode1 is not equal to IwcpMpm[m]
  • IwcpPredMode1 is the value j of iwcp_pred_mode1_index equal to IwcpPredMode1 ⁇ IwcpMpm[0]? IwcpPredMode1:IwcpPredMode1 ⁇ IwcpMpm[1]? IwcpPredMode1-1:IwcpPredMode1 ⁇ IwcpMpm[2]? IwcpPredMode1-2:IwcpPredMode1 ⁇ IwcpMpm[3]? IwcpPredMode1-3: IwcpPredMode1–4.
  • iwcp_pred_mode1_index is greater than or equal to iwcp_pred_mode0_index, iwcp_pred_mode1_index is equal to iwcp_pred_mode1_index–1
  • iwcp_pred_mode0_index If the value j of iwcp_pred_mode0_index is greater than or equal to 4, then perform binarization processing on the value j of iwcp_pred_mode1_index according to Table 3, and determine the iwcp_pred_mode1_index in the form of a binary symbol string.
  • iwcp_pred_mode1_index also depends on iwcp_pred_mode0_index.
  • the first intra prediction mode and the second The intra prediction modes are all MPMs in the MPM list, so there are only 3 MPMs available for the second intra prediction mode, and 1 to 2 bits can be used to indicate which MPM, such as "00, 01, 10" respectively. Indicates the remaining first MPM, second MPM, and third MPM. It can be seen that since a possibility is excluded, the codec method or the binarization or de-binarization method can be changed to save overhead.
  • the preset angle prediction mode set includes 28 intra-frame angle prediction modes with mode numbers 4-31, and the length of the MPM list is 4, then when using the first length, When the binary symbol string of the second length and the third length determines the first mapping relationship table between the index value and the binary symbol string, the binary symbol string of the first length can be used for the 4 MPMs in the MPM list first, that is, using The shortest codeword. Next, 8 intra-angle prediction modes are selected from the remaining 24 intra-angle prediction modes to use the binary symbol string of the second length, and 16 intra-angle prediction modes are selected to use the binary symbol string of the third length.
  • a shorter codeword can be used for the prediction modes corresponding to the first 8 mode numbers in the order of the mode numbers from small to large, that is, the first A binary symbol string of two lengths, and then a longer codeword is used for the prediction modes corresponding to the next 16 mode numbers, that is, a binary symbol string of a third length is used.
  • the first mapping relationship table between the index value and the binary symbol string shown in Table 3 can be replaced with the above Table 5, wherein the first mapping table used to represent the index value and the binary symbol string Table 5 of a mapping relationship can also be used to determine the values of the first mode index and the second mode index.
  • the second mapping relationship table between the index value and the binary symbol string shown in the above Table 4 can also be replaced with the above-mentioned Table 6, wherein the table used to represent the second mapping relationship between the index value and the binary symbol string 6 may also be used to determine the value of the second mode index.
  • the preset angle prediction mode set includes a total of 20 modes, 4 3-bit codewords and 16 5-bit codewords can be used to represent them.
  • the preset angle prediction mode set includes a total of 36 modes
  • 4 3-bit codewords and 32 6-bit codewords can be used to represent them.
  • 36 intra-frame angle prediction modes with mode numbers of 4-31, 42-45, and 56-59 are used.
  • code word is understood as a string of binary symbols.
  • the length of the codeword can be understood as the length of the binary symbol string.
  • Another representation is to use a flag bit (flag) plus a binary symbol string.
  • a binary MPM_flag is used to indicate whether the current mode is MPM mode, that is, if MPM_flag is 1, it means that the current mode is MPM mode, if MPM_flag is 0, it means that the current mode is not MPM mode, and if the current mode is MPM mode, there are a total of 4 possibilities for MPM.
  • a 2-bit binary symbol string to indicate which MPM the current mode is. Then the code word can be understood as the flag bit plus the binary symbol string, and the length of the code word can be understood as the length of the flag bit plus the binary symbol string.
  • Step 204 Write the first mode index and the second mode index into the code stream.
  • the first mode index can be and the second mode index are written into the code stream and transmitted to the decoding side, so that the decoder determines the prediction value of the current block according to the first mode index and the second mode index determined by the decoding code stream.
  • the encoder needs to determine the weight matrix of the current block, so that after determining the first intra prediction mode and the second intra prediction mode used by the current block, it is also based on the first intra prediction mode and the second intra prediction mode.
  • the prediction mode, the second intra-frame prediction mode and the weight matrix further determine the prediction value of the current block.
  • the encoder when the encoder determines the prediction value of the current block based on the first intra prediction mode, the second intra prediction mode and the weight matrix, it can first predict the prediction value according to the first intra prediction mode. mode to determine the first predicted value of the current block; at the same time, the second predicted value of the current block can be determined according to the second intra-frame prediction mode; then the first predicted value and the second predicted value can be weighted by using the weight matrix, and finally Get the predicted value of the current block.
  • the encoder after determining the predicted value of the current block, can also perform a difference operation on the actual value and the predicted value of the current block to obtain a difference result between the two, so that it can The prediction difference value of the current block, that is, the residual error, is determined.
  • the encoder can calculate the difference between the actual value of the current block and the predicted value in the frame, thereby obtaining the residual, and the residual is transformed, quantized, and entropy encoded into the code stream, transmitted to the decoding side.
  • the encoder may determine the weight matrix of the current block according to the weight matrix derivation mode of the current block.
  • the first intra-frame prediction mode and the second intra-frame prediction mode may both be intra-frame angle prediction modes, that is, two different intra-frame angle prediction modes are used in this embodiment of the present application. Then use the combination of the first intra prediction mode and the second intra prediction mode to generate the first prediction block and the second prediction block respectively, and then determine the prediction of the current block based on the first prediction block and the second prediction block, combined with the weight matrix piece.
  • not all points in all possible weight matrices have the same weight.
  • at least one possible weight matrix contains at least two different weight values.
  • the encoder may adopt a method similar to GPM or AWP to realize the determination of the weight matrix. Specifically, if GPM or AWP is used in the same codec standard or codec, this method can be used to determine the weight matrix, so that the same logic in the multiplexing part can be achieved. If AWP is used in AVS3 inter-frame prediction, the AWP method can be used to determine the weight matrix in AVS3. Of course, different methods from GPM or AWP in the same codec standard or codec can also be used, such as using different mode numbers, or different transition region algorithms, or using different parameters.
  • inter-frame prediction exploits the correlation in the temporal domain, it uses the reconstructed image in the reference frame as the reference block.
  • Intra-frame prediction utilizes the correlation in the spatial domain, and it uses the reconstructed pixels around the current block as reference pixels. In the airspace, the closer the distance, the stronger the correlation, and the farther the distance, the worse the correlation. Therefore, if a certain weight matrix makes the obtained pixel position used by a prediction block far away from the reference pixel, then this part may not be able to make a more suitable prediction value than the existing technology, so such a weight matrix may not be used, but Can be used in inter prediction.
  • the embodiment of the present application provides an intra-frame prediction method.
  • the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • the encoder may further determine the intra-frame prediction mode parameter of the current block; wherein the intra-frame prediction mode parameter is used for It is judged whether the current block uses the IWCP mode; then the intra-prediction mode parameter can be written into the code stream.
  • the intra prediction mode parameter may indicate whether the current block can use the IWCP mode, that is, whether the current block can use two different intra angle prediction modes to determine the prediction value of the current block.
  • the intra prediction mode parameter can be understood as a flag indicating whether the IWCP mode is used.
  • the encoder parses the code stream and can determine a variable that is an intra-frame prediction mode parameter, so that the intra-frame prediction mode parameter can be determined through the value of the variable.
  • the encoder may set the value of the intra prediction mode parameter to indicate that the current block uses the IWCP mode. Specifically, the encoder may set the value of the variable. is 1.
  • the encoder may set the value of the intra prediction mode parameter to indicate that the current block does not use the IWCP mode. Specifically, the encoder may set the variable value Set to 0.
  • the encoder after the encoder completes the setting of the intra-frame prediction mode parameters, it can write the intra-frame prediction mode parameters into the code stream and transmit it to the decoder, so that the decoder can be The intra prediction mode parameters are obtained after decoding the code stream.
  • the intra prediction mode parameters of the current block can be determined, and the corresponding intra prediction mode can be determined.
  • the parameters are written into the code stream and transmitted from the encoder to the decoder.
  • the encoder may first determine the prediction mode parameter, and then determine whether the encoding mode of the current block of the current block is through the prediction mode parameter.
  • the specific encoding mode may be determined by the encoder.
  • the encoder determines the prediction mode parameter of the current block of the current block, it can first use a variety of different prediction modes to predict and encode the current block respectively, and then calculate the prediction mode under the various prediction modes.
  • multiple prediction modes can be used for the current block to encode the image components to be predicted, respectively.
  • the encoder can obtain a rate-distortion cost result corresponding to each prediction mode;
  • the minimum rate-distortion cost result is selected from the cost result, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block of the current block; in this way, the determined prediction mode can finally be used to encode the current block, Moreover, in this prediction mode, the prediction residual can be made small, and the coding and decoding efficiency can be improved.
  • the encoder when the encoder attempts to perform intra-frame prediction on a certain prediction block, it also attempts to encode the cost according to the IWCP mode.
  • the cost in IWCP mode all or part of the possible costs are tried, and the one with the lowest cost is selected as the cost for IWCP mode encoding.
  • all the above possible situations include that the first intra prediction mode of the current block is all possible prediction modes, and the second intra prediction mode of the current block is all possible prediction modes. mode, the weight matrix derives the mode as a combination of these three variations for all possible modes.
  • the first intra-frame prediction mode and the second intra-frame prediction mode are two completely different intra-frame angle prediction modes
  • the encoder can limit the intra-frame angle prediction modes that can be used by the IWCP mode, And limit the number of weight matrix derivation modes that can be used by the IWCP mode, then the possible situations will be reduced accordingly, and the complexity of the encoding end will also be reduced accordingly.
  • the first intra-frame prediction mode has 66 possibilities, because the second intra-frame prediction mode and the first intra-frame prediction mode are The modes are different, so there are 65 possibilities.
  • this application may use any two different intra-frame angle prediction modes and any one of the weight matrix derivation modes, a total of 66 ⁇ 65 ⁇ 56 possibilities.
  • the available intra-angle prediction modes are limited, that is, the mode range in the preset angle prediction mode set is limited, for example, the preset angle prediction mode set is limited to only include 28 intra-angle predictions with mode numbers 4-31 mode, then, there are 28 possibilities for the first intra-frame prediction mode. Since the second intra-frame prediction mode is different from the first intra-frame prediction mode, there are 27 possibilities for the second intra-frame prediction mode. It is assumed that the weight matrix derivation mode has 56 types (taking AWP as an example), then this application may use any two different intra-frame angle prediction modes and any one of the weight matrix derivation modes, with a total of 28 ⁇ 27 ⁇ 56 possibilities.
  • the encoder may perform rate-distortion optimization (Rate-Distortion Optimization, RDO) for all possible IWCP modes, and determine a combination with the smallest cost, wherein each combination includes There are combinations of the first intra prediction mode, the second intra prediction mode, and the weight matrix derivation mode.
  • RDO rate-distortion optimization
  • the cost may include the cost of encoding the first intra-frame prediction mode, the second intra-frame prediction mode, and the weight matrix derivation mode overhead in the code stream.
  • the estimated cost of the overhead of the first intra-frame prediction mode, the second intra-frame prediction mode, and the weight matrix derivation mode in the code stream can also be used in the primary selection.
  • the number of bits of the first intra prediction mode or the second intra prediction mode is estimated according to whether the MPM is MPM, or the number of bits of the first or second intra prediction mode is estimated according to the order of the intra prediction modes.
  • the cost can be obtained by more accurate trial coding. In this process, the method of constructing the MPM list or sorting the intra prediction modes of the present application needs to be used.
  • the first prediction block is determined according to the first intra prediction mode in the above-mentioned primary selection and fine selection
  • the second prediction block is determined according to the second intra prediction mode, and is derived according to the weight matrix derivation mode.
  • a weight matrix, the prediction block of the present application is determined according to the first prediction block, the second prediction block and the weight matrix.
  • the current block and the predicted block are used to determine SAD and SATD in the primary selection of SAD and SATD.
  • the encoder may also analyze the texture of the current block first, for example, by using gradients. Utilize the analyzed data to aid in the primaries. For example, in the texture of the current block, which direction has the stronger texture, in the above-mentioned primary selection, more attempts are made to select intra-frame prediction modes in approximate directions. For example, in the texture of the current block, in which direction the texture is weak, in the above-mentioned primary selection, less or no intra-frame prediction mode of the approximate direction is selected to try.
  • the cost of coding according to the IWCP mode includes the cost of the codewords occupied by the first intra-frame prediction mode, the second intra-frame prediction mode, and the weight matrix derivation mode in the code stream, and the prediction residual error.
  • the cost of various flags to be transmitted in the code stream such as transform quantization entropy coding and the cost of quantization coefficients, as well as the cost of distortion of the reconstructed block, etc.
  • the encoder After determining the cost of encoding according to the IWCP mode, if the cost of encoding according to the IWCP mode is less than the cost of other prediction modes, wherein the other prediction modes may include other intra prediction modes or inter prediction modes, etc., the encoder will select the IWCP mode as the The prediction mode of the current block, otherwise some other prediction mode will be selected.
  • the encoder will try coding costs of different block divisions, and the like. If the IWCP mode is selected for a certain prediction block, the flag bits required by the IWCP mode and the information of the first intra-frame prediction mode, the second intra-frame prediction mode, and the weight matrix derivation mode can be written in the code according to the syntax (syntax) At the same time, the prediction block is predicted according to the method of IWCP mode and the subsequent coding work is performed.
  • the embodiment of the present application provides an intra-frame prediction method.
  • the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • FIG. 10 is a schematic diagram of the composition and structure of the encoder proposed by the embodiment of the present application.
  • the encoder 300 proposed by the embodiment of the present application may include the first A determination part 301, a first construction part 302, an encoding part 303,
  • the first determination part 301 is configured to determine the first intra prediction mode and the second intra prediction mode of the current block when the current block uses the IWCP mode to determine the intra prediction value of the current block; wherein, The first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes;
  • the first construction part 302 is configured to construct the MPM list of the current block
  • the first determining part 301 is further configured to determine a first mode index and a second mode index of the current block according to the first intra prediction mode, the second intra prediction mode and the MPM list;
  • the encoding part 303 is configured to write the first mode index and the second mode index into a code stream.
  • FIG. 11 is a second schematic diagram of the composition and structure of the encoder proposed by the embodiment of the present application.
  • the encoder 300 proposed by the embodiment of the present application may further include a first processor 304 and store the executable of the first processor 304 A first memory 305 for instructions, a first communication interface 306 , and a first bus 307 for connecting the first processor 304 , the first memory 305 , and the first communication interface 306 .
  • the above-mentioned first processor 304 is configured to determine the first intra prediction mode of the current block when the current block uses the IWCP mode to determine the intra prediction value of the current block and a second intra-frame prediction mode; wherein, the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes; construct the MPM list of the current block; according to the The first intra prediction mode, the second intra prediction mode and the MPM list determine the first mode index and the second mode index of the current block; the first mode index and the second mode index are combined Write the code stream.
  • FIG. 12 is a schematic diagram 1 of the composition and structure of the decoder proposed by the embodiment of the present application.
  • the decoder 400 proposed by the embodiment of the present application may include a decoding part 401, a second determining part 402, a second constructing part 403,
  • the decoding part 401 is configured to decode the code stream
  • the second determining part 402 is configured to determine the intra prediction mode parameter of the current block; when the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra prediction value of the current block, determine the intra prediction value of the current block. the first mode index and the second mode index of the current block;
  • the second construction part 403 is configured to construct the most probable mode MPM list of the current block
  • the second determining part 402 is further configured to determine the first intra prediction mode and the second intra prediction mode of the current block according to the first mode index, the second mode index and the MPM list;
  • the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes;
  • the weight matrix of the current block is determined, and based on the first intra-frame prediction mode, the The second intra prediction mode and the weight matrix determine the prediction value of the current block.
  • FIG. 13 is a second schematic diagram of the composition and structure of the decoder proposed by the embodiment of the present application.
  • the decoder 400 proposed by the embodiment of the present application may further include a second processor 404, and store the executable of the second processor 404.
  • the above-mentioned second processor 404 is configured to decode the code stream and determine the intra-frame prediction mode parameter of the current block; when the intra-frame prediction mode parameter indicates that the current block uses the IWCP mode
  • determine the first mode index and the second mode index of the current block construct a MPM list of the most probable mode of the current block; according to the first mode index, the The second mode index and the MPM list determine the first intra prediction mode and the second intra prediction mode of the current block; wherein the first intra prediction mode and the second intra prediction mode are two different intra-frame angle prediction modes; determining a weight matrix of the current block, and determining a prediction value of the current block based on the first intra-frame prediction mode, the second intra-frame prediction mode and the weight matrix.
  • each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of software function modules and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or correct. Part of the contribution made by the prior art or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • Embodiments of the present application provide an encoder and a decoder.
  • the decoder decodes a code stream and determines an intra-frame prediction mode parameter of a current block; when the intra-frame prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra-frame prediction value of the current block , determine the first mode index and the second mode index of the current block; construct the most probable mode MPM list of the current block; determine the first intra prediction mode and The second intra-frame prediction mode; wherein, the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes; determine the weight matrix of the current block, and based on the first intra-frame prediction mode, the first intra-frame prediction mode Two intra-frame prediction modes and a weight matrix to determine the predicted value of the current block.
  • the encoder determines the first intra prediction mode and the second intra prediction mode of the current block; wherein, the first intra prediction mode and the second intra prediction The mode is two different intra-frame angle prediction modes; the MPM list of the current block is constructed; the first mode index and the second mode index of the current block are determined according to the first intra-frame prediction mode, the second intra-frame prediction mode and the MPM list; Write the first mode index and the second mode index into the code stream. That is to say, in the embodiment of the present application, the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.
  • Embodiments of the present application provide a computer-readable storage medium and a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the method described in the foregoing embodiments is implemented.
  • a program instruction corresponding to an intra-frame prediction method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • the intra prediction mode parameter indicates that the current block uses the IWCP mode to determine the intra prediction value of the current block, determining a first mode index and a second mode index of the current block;
  • a first intra prediction mode and a second intra prediction mode of the current block are determined according to the first mode index, the second mode index and the MPM list; wherein the first intra prediction mode and The second intra-frame prediction modes are two different intra-frame angle prediction modes;
  • a weight matrix of the current block is determined, and a prediction value of the current block is determined based on the first intra prediction mode, the second intra prediction mode and the weight matrix.
  • the first intra prediction mode and the second intra prediction mode of the current block are determined; wherein the first intra prediction mode and the second intra prediction mode are determined.
  • the second intra-frame prediction mode is two different intra-frame angle prediction modes;
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • An apparatus implements the functions specified in a flow or flows of the implementation flow diagram and/or a block or blocks of the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the implementing flow diagram and/or the block or blocks of the block diagram.
  • the embodiments of the present application provide an intra-frame prediction method, an encoder, a decoder, and a storage medium.
  • the decoder decodes a code stream and determines an intra-frame prediction mode parameter of a current block; when the intra-frame prediction mode parameter indicates that the current block uses the IWCP mode
  • determine the intra-frame prediction value of the current block determine the first mode index and the second mode index of the current block; construct the most probable mode MPM list of the current block; determine the current block according to the first mode index, the second mode index and the MPM list
  • the first intra-frame prediction mode and the second intra-frame prediction mode are two different intra-frame angle prediction modes; the weight matrix of the current block is determined and based The first intra prediction mode, the second intra prediction mode and the weight matrix determine the prediction value of the current block.
  • the encoder determines the first intra prediction mode and the second intra prediction mode of the current block; wherein, the first intra prediction mode and the second intra prediction The mode is two different intra-frame angle prediction modes; the MPM list of the current block is constructed; the first mode index and the second mode index of the current block are determined according to the first intra-frame prediction mode, the second intra-frame prediction mode and the MPM list; Write the first mode index and the second mode index into the code stream. That is to say, in the embodiment of the present application, the codec can determine two different prediction blocks of the current block through two different intra-frame angle prediction modes, and then can combine them through various weight matrices to finally obtain a better prediction block.
  • the complex prediction block on the basis of improving the accuracy of intra-frame prediction, can reduce the hardware implementation cost, reduce the complexity, and realize a simple and efficient encoding and decoding method, thereby improving the compression performance.

Landscapes

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

Abstract

本申请实施例提供了一种帧内预测方法、编码器、解码器以及存储介质,解码器解码码流,确定当前块的帧内预测模式参数;当帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一模式索引和第二模式索引;构建当前块的最可能模式MPM列表;根据第一模式索引、第二模式索引以及MPM列表确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前块的预测值。

Description

帧内预测方法、编码器、解码器以及存储介质 技术领域
本申请实施例涉及图像处理技术领域,尤其涉及一种帧内预测方法、编码器、解码器以及存储介质。
背景技术
为了捕捉自然视频中呈现的更精细的边缘方向,多功能视频编码(Versatile Video Coding,VVC)中将视频压缩标准(High Efficiency Video Coding,HEVC)中定义的33种帧内亮度预测角度模式扩展到了65种,另外还有两种非角度模式,即编号为0的渐变平坦Planar模式和编号为1的直流(Direct Current,DC)模式。
为了提高帧内预测的准确性,目前提出一种使用两种不同的帧内预测模式进行帧内预测的方法,然而,在硬件实现时,一些不同的帧内预测模式的电路无法难以复用,因此需要两套帧内预测电路,而增加新的预测电路会造成硬件实现代价的增大,复杂度增大,降低了编解码性能。
发明内容
本申请实施例提供一种帧内预测方法、编码器、解码器以及存储介质,能够在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种帧内预测方法,应用于解码器,所述方法包括:
解码码流,确定当前块的帧内预测模式参数;
当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
构建所述当前块的最可能模式MPM列表;
根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
第二方面,本申请实施例提供了一种帧内预测方法,应用于编码器,所述方法包括:
当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
构建所述当前块的MPM列表;
根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
将所述第一模式索引和所述第二模式索引写入码流。
第三方面,本申请实施例提供了一种编码器,所述编码器包括:第一确定部分,第一构建部分,编码部分,
所述第一确定部分,配置为当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
所述第一构建部分,配置为构建所述当前块的MPM列表;
所述第一确定部分,还配置为根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
所述编码部分,配置为将所述第一模式索引和所述第二模式索引写入码流。
第四方面,本申请实施例提供了一种解码器,所述解码器包括:解码部分,第二确定部分,第二构建部分,
所述解码部分,配置为解码码流;
所述第二确定部分,配置为确定当前块的帧内预测模式参数;当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
第二构建部分,配置为构建所述当前块的最可能模式MPM列表;
所述第二确定部分,还配置为根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
第五方面,本申请实施例提供了一种编码器,所述编码器包括第一处理器、存储有所述第一处理器可执行指令的第一存储器,当所述指令被执行时,所述第一处理器执行时实现如上所述的帧内预测方法。
第六方面,本申请实施例提供了一种解码器,所述解码器包括第二处理器、存储有所述第二处理器可执行指令的第二存储器,当所述指令被执行时,所述第二处理器执行时实现如上所述的帧内预测方法。
第七方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如第一方面所述的帧内预测方法,或者,被第二处理器执行时实现如第二方面所述的帧内预测方法。
本申请实施例提供了一种帧内预测方法、编码器、解码器以及存储介质,解码器解码码流,确定当前块的帧内预测模式参数;当帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一模式索引和第二模式索引;构建当前块的最可能模式MPM列表;根据第一模式索引、第二模式索引以及MPM列表确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前 块的预测值。编码器当当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;构建当前块的MPM列表;根据第一帧内预测模式、第二帧内预测模式以及MPM列表确定当前块的第一模式索引和第二模式索引;将第一模式索引和第二模式索引写入码流。也就是说,在本申请的实施例中,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
附图说明
图1为权重分配示意图一;
图2为权重分配示意图二;;
图3为帧内预测的示意图;
图4一种视频编码系统的组成框图;
图5一种视频解码系统的组成框图;
图6为帧内预测方法的实现流程示意图一;
图7为IWCP模式的示意图;
图8为相邻块的示意图;
图9为帧内预测方法的实现流程示意图二;
图10为本申请实施例提出的编码器的组成结构示意图一;
图11为本申请实施例提出的编码器的组成结构示意图二;
图12为本申请实施例提出的解码器的组成结构示意图一;
图13为本申请实施例提出的解码器的组成结构示意图二。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。
目前,通用的视频编解码标准基于都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(比如128×128,64×64等)的正方形的最大编码单元(Largest Coding Unit,LCU),每个最大编码单元还可以根据规则划分成矩形的编码单元(Coding Unit,CU);而且编码单元可能还会划分成更小的预测单元(Prediction Unit,PU)。具体地,混合编码框架可以包括有预测、变换(Transform)、量化(Quantization)、熵编码(EntropyCoding)、环路滤波(In Loop Filter)等模块;其中,预测模块可以包括帧内预测(intraPrediction)和帧间预测(interPrediction),帧间预测可以包括运动估计(motion estimation)和运动补偿(motion compensation)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余;但是由于视频图像中的相邻帧之间也存在着很强的相似性,在视频编解码技术中使用帧间预测方式消除相邻帧之间的时间冗余,从而能够提高编解码效率。
视频编解码器的基本流程如下:在编码端,将一帧图像划分成块,对当前块使用帧内预测或帧间预测产生当前块的预测块,当前块的原始块减去预测块得到残差块,对残差块进行变换、量化得到量化系数矩阵,对量化系数矩阵进行熵编码输出到码流中。在解码端,对当前块使用帧内预测或帧间预测产生当前块的预测块,另一方面解码码流得到量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块,将预测块和残差块相加得到重建块。重建块组成重建图像,基于图像或基于块对重建图像进行环路滤波得到解码图像。编码端同样需要和解码端类似的操作获得解码图像。解码图像可以为后续的帧作为帧间预测的参考帧。编码端确定的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息如果有必要需要在输出到码流中。解码端通过解析及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。编码端获得的解码图像通常也叫做重建图像。在预测时可以将当前块划分成预测单元,在变换时可以将当前块划分成变换单元,预测单元和变换单元的划分可以不同。上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请实施例适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
当前块(current block)可以是当前编码单元(CU)或当前预测单元(PU)等。
帧间预测使用已解码或重建的图像或者叫参考帧的信息对当前块进行预测。帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要在参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。
目前正在制定中的多功能视频编码(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)等会使参考像素或预测像素产生一些变化,而且GPM或AWP也使用两个与当前块大小相同的参考块,但某些像素位置100%使用第一个参考块对应位置的像素值,某些像素位置100%使用第二个参考块对应位置的像素值,而在交界区域,按一定比例使用这两个参考块对应位置的像素值。权重分配可以由GPM或AWP的预测模式决定。
示例性地,图1为权重分配示意图一,如图1所示,其示出了本申请实施例提供的一种GPM在64×64的当前块上的多种划分模式的权重分配示意图,其中,GPM存在有64种划分模式。图2为权重分配示意图二,如图2所示,其示出了本申请实施例提供的一种AWP在64×64的当前块上的多种划分模式的权重分配示意图,其中,AWP存在有56种划分模式。无论是图1还是图2,每一种划分模式下,黑色区域表示第一个参考块对应位置的权重值为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,于是在预测之后的残差的变换、量化、反变换、反量化等也都是将当前块作为一个整体来处理。
当前块所使用的运动信息可以保存下来。当前帧的后续编解码的块可以根据相邻的位置关系使用前面已编解码的块(如相邻块)的运动信息。这利用了空域上的相关性,所以这种已编解码的运动信息叫做空域上的运动信息。当前帧的每个块所使用的运动信息可以保存下来。后续编解码的帧可以根据参考关系使用前面已编解码的帧的运动信息。这利用了时域上的相关性,所以这种已编解码的帧的运动信息叫做时域上的运动信息。当前帧的每个块所使用的运动信息的存储方法通常将一个固定大小的矩阵,如4×4的矩阵,作为一个最小单元,每个最小单元单独存储一组运动信息。这样每编解码一个块,它的位置对应的那些最小单元就可以把这个块的运动信息存储下来。这样使用空域上的运动信息或时域上的运动信息时可以直接根据位置找到该位置对应的运动信息。如一个16x16的块使用了传统的单向预测,那么这个块对应的所有的4×4个最小单元都存储这个单向预测的运动信息。如果一个块使用了GPM或AWP,那么这个块对应的所有的最小单元会根据GPM或AWP的模式,第一个运动信息,和第二个运动信息以及每个最小单元的位置确定每个最小单元存储的运动信息。一种方法是如果一个最小单元对应的4×4的像素全部来自于第一个运动信息,那么这个最小单元存储第一个运动信息,如果一个最小单元对应的4×4的像素全部来自于第二个运动信息,那么这个最小单元存储第二个运动信息。如果一个最小单元对应的4×4的像素既来自于第一个运动信息又来自于第二个运动信息,那么AWP会选择其中一个运动信息进行存储;GPM的做法是如果两个运动信息指向不同的参考帧列表,那么把它们组合成双向运动信息存储,否则只存储第二个运动信息。
需要说明的是,GPM或AWP属于一种帧间预测技术,GPM或AWP需要在码流中传输一个GPM或AWP是否使用的标志(flag),该flag可以指示当前块是否使用GPM或AWP。如果使用GPM或AWP,编码器在码流中需要传输具体使用的模式,即GPM的64种划分模式之一,或AWP的56种划分模式之一;以及两个单向运动信息的索引值。也就是说,对于当前块而言,解码器通过解码码流可以得到GPM或AWP是否使用的信息,如果确定使用GPM或AWP,解码器可以解析出GPM或AWP的预测模式参数以及两个运动信息索引值,比如当前块可以划分为两个分区,那么可以解析出第一分区对应的第一索引值和第二分区对应的第二索引值。
具体来讲,对于GPM模式来说,如果使用GPM,那么码流中将会传输GPM下的预测模式参数,比如GPM具体的划分模式;通常情况下,GPM包括有64种划分模式。对于AWP模式来说,如果使用AWP,那么码流中将会传输AWP下的预测模式参数,比如AWP具体的划分模式;通常情况下,AWP包括有56种划分模式。
在帧间预测模式下,比如GPM和AWP均需要使用两个单向运动信息查找两个参考块。目前的实现方式是在编码器侧利用当前块之前已编码/已解码部分的相关信息构建一个单向运动信息候选列表,从单向运动信息候选列表中选择单向运动信息,将这两个单向运动信息在单向运动信息候选列表中的索引值(index)写入码流。在解码器侧采用同样的方式,即利用当前块之前已解码部分的相关信息构建一个单向运动信息候选列表,这个单向运动信息候选列表与编码器侧构建的候选列表一定是相同的。如此,从码流中解析出两个单向运动信息的索引值,然后从单向运动信息候选列表中查找出这两个单向运动信息即为当前块需要使用的两个单向运动信息。
也就是说,本申请所描述的单向运动信息可以包括:运动矢量信息,即(x,y)的值,以及对应的参考帧信息,即参考帧列表及在参考帧列表中的参考帧索引值。一种表示方式是记录两个参考帧列表的参考帧索引值,其中一个参考帧列表对应的参考帧索引值有效,如0,1,2等;另一个参考帧列表对应的参考帧索引值为无效,即-1。参考帧索引值有效的参考帧列表即为当前块的运动信息所使用的参考帧列表,根据参考帧索引值可以从该参考帧列表中查找到对应的参考帧。每个参考帧列表都有一个对应的运动矢量,有效的参考帧列表对应的运动矢量是有效的,无效的参考帧列表对应的运动矢量是无效的。解码器可以通过单向运动信息中的参考帧信息找到所需的参考帧,根据当前块的位置以及运动矢量即(x,y)的值可以在参考帧中找到参考块,进而确定出当前块的帧间预测值。
帧内预测方法是使用当前块周边已编解码的重建像素作为参考像素来对当前块进行预测。图3为帧内预测的示意图,如图3所示,当前块的大小为4×4,当前块左边一行和上面一列的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如 当前块是整帧的最左侧,那么当前块的左边的参考像素不可得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。
进一步地,在进行帧内预测时,多参考行帧内预测方法(Multiple reference line,MRL)可以使用更多的参考像素从而提高编解码效率,例如,使用4个参考行/列为当前块的参考像素。
帧内预测有多种预测模式,H.264中对4×4的块进行帧内预测主要可以包括9种模式。其中,模式0可以将当前块上面的像素按垂直方向复制到当前块作为预测值,模式1可以将左边的参考像素按水平方向复制到当前块作为预测值,模式2直流DC将相邻的多个点的平均值作为所有点的预测值,模式3~8可以分别按某一个角度将参考像素复制到当前块的对应位置,因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。
除此之外,还有Planar模式等,而随着技术的发展以及块的扩大,角度预测模式也越来越多,如HEVC使用的帧内预测模式有Planar模式、DC模式和33种角度模式共35种预测模式。VVC使用的帧内模式有Planar模式、DC模式和65种角度模式共67种预测模式。AVS3使用DC模式、Planar模式、Bilinear模式和63种角度模式共66种预测模式。
另外还有一些技术对预测进行改进,如改进参考像素的分像素插值,对预测像素进行滤波等。如AVS3中的多组合帧内预测滤波(multipleintraprediction filter,MIPF)对不同的块大小,使用不同的滤波器产生预测值。对同一个块内的不同位置的像素,与参考像素较近的像素使用一种滤波器产生预测值,与参考像素较远的像素使用另一种滤波器产生预测值。对预测像素进行滤波的技术如AVS3中的帧内预测滤波(intra prediction filter,IPF),对预测值可以使用参考像素进行滤波。
在帧内预测中可以使用最可能模式列表(MostprobableModes List,MPM)的帧内模式编码技术来提高编解码效率。利用周边已编解码的块的帧内预测模式,以及根据周边已编解码块的帧内预测模式导出的帧内预测模式,如相邻的模式,以及一些常用或使用概率比较高的帧内预测模式,如DC,Planar,Bilinear模式等,构成一个MPM列表。参考周边已编解码的块的帧内预测模式利用了空间上的相关性。因为纹理在空间上会有一定的连续性。MPM可以作为帧内预测模式的预测。也就是认为当前块使用MPM的概率会比不使用MPM的概率高。因而在二值化时,会给MPM使用更少的码字,从而节省开销,以提高编解码效率。
虽然现在的帧内预测有DC模式、Planar模式、Bilinear模式等模式,但它们都只能处理简单的纹理的预测;即使角度模式越来越多,但它们的预测只能循着一个角度的直线来进行。可见,目前的帧内预测模式仅仅能处理简单的纹理的预测。对于复杂的纹理,在预测时则需要划分成更小的块,或者对更多的残差进行编码,或者造成较大的失真。
针对上述问题,目前提出一种帧内预测方法,编解码器可以通过两种不同的帧内预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,提高了预测的准确性。然而,由于非角度预测模式如DC模式、Planar模式、PLANE模式、Bilinear模式等模式与角度预测模式的计算逻辑不同,非角度预测模式各自有各自的逻辑,在硬件实现时,非角度预测模式与角度预测模式的电路无法难以复用,在使用2个帧内预测模式进行预测时,如果2个帧内预测模式在硬件上串行进行预测,再依据权重矩阵进行组合,2个帧内预测模式的预测都可以使用现有的帧内预测电路,但是需要对先进行预测的预测值进行存储,而且这样帧内加权组合预测的时间就要明显高于原有的只使用一种帧内预测模式进行预测的时间。如果2个帧内预测模式在硬件上串行进行预测,产生帧内加权组合预测的预测值的速度要明显优于串行的实现。而这样做的代价是需要两套帧内预测电路。也就是需要增加一套帧内预测电路,这里所说的帧内预测电路进行上述帧内非角度预测模式和帧内角度预测模式的预测。也就是说要新增一套帧内预测电路。
由此可见,目前使用两种不同的帧内预测模式进行帧内预测的方法,虽然可以在一定程度上提高预测效果,但是,由于需要新增预测电路,进而会造成硬件实现代价的增大,因此,尽可能简化新增的帧内预测电路可以减少帧内加权组合预测带来的复杂度。为了解决上述问题,在本申请的实施例中,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
参见图4,其示出了本申请实施例提供的一种视频编码系统的组成框图示例;如图4所示,该视频编码系统10包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可以实现去方块滤波及样本自适应缩进(Sample Adaptive 0ffset,SAO)滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmatic Coding,CABAC)。针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于 该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。
参见图5,其示出了本申请实施例提供的一种视频解码系统的组成框图示例;如图5所示,该视频解码系统20包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现去方块滤波以及SAO滤波。输入的视频信号经过图4的编码处理之后,输出该视频信号的码流;该码流输入视频解码系统20中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。
本申请实施例中的帧内预测方法,主要应用在如图4所示的帧内预测单元103部分和如图5所示的帧内预测单元203部分。也就是说,本申请实施例中的帧内预测方法,既可以应用于视频编码系统,也可以应用于视频解码系统,甚至还可以同时应用于视频编码系统和视频解码系统,但是本申请实施例不作具体限定。还需要说明的是,当该帧内预测方法应用于帧内预测单元103部分时,“当前块”具体是指帧内预测中的当前编码块;当该帧内预测方法应用于帧内预测单元203部分时,“当前块”具体是指帧内预测中的当前解码块。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请的一实施例提出了一种帧内预测方法,应用于解码器,图6为帧内预测方法的实现流程示意图一,如图17所示,解码器进行帧内预测的方法可以包括以下步骤:
步骤101、解码码流,确定当前块的帧内预测模式参数。
在本申请的实施例中,解码器可以通过解码码流,确定当前块的帧内预测模式参数。
需要说明的是,在本申请的实施中,帧内预测模式参数可以指示当前块是否可以使用帧内加权组合预测(intra weighted combined prediction,IWCP)模式,即指示当前块是否可以使用两种不同的帧内角度预测模式确定当前块的预测值。
可以理解的是,在本申请的实施例中,可以将帧内预测模式参数理解为一个表明是否使用了IWCP模式标志位。具体地,解码器解码码流,可以确定作为帧内预测模式参数的一个变量,从而可以通过该变量的取值来实现帧内预测模式参数的确定。
需要说明的是,在本申请的实施例中,IWCP模式为一种帧内预测方法,具体地,IWCP模式为对当前块确定两个不同的帧内角度预测模式,然后分别根据这两个不同的帧内角度预测模式确定出两个预测块,接着可以确定一个权重矩阵,将这两个预测块依据权重矩阵进行组合,最终便可以得到新的预测块,即获得当前块的预测块。
图7为IWCP模式的示意图,如图7所示,在对当前块进行帧内预测时,可以使用帧内角度预测模式1(第一帧内预测模式)确定当前块的第一预测块,同时使用帧内角度预测模式2(第二帧内预测模式)确定当前块的第二预测块,然后可以利用权重矩阵对第一预测块和第二预测块进行组合处理,最终获得一个新的预测块。
需要说明的是,在本申请的实施例中,视频图像可以划分为多个图像块,当前块即为每个当前待编码的图像块,可以称为编码块(Coding Block,CB)。这里,每个编码块可以包括第一图像分量、第二图像分量和第三图像分量。具体地,在本申请中,假定进行第一帧内预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么可以将待预测的编码块称为亮度块;或者,假定进行第二帧内预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么可以将待预测的编码块称为色度块。
进一步地,在本申请的实施例中,在应用IWCP模式时,可以对当前块的尺寸进行限制。
可以理解的是,由于本申请实施例提出的帧内预测方法需要分别使用两个不同的帧内角度预测模式生成两个预测块,再根据权重矩阵进行加权得到新的预测块,为了降低的复杂度,同时考虑压缩性能和复杂度的权衡,在本申请的实施例中,可以限制对一些大小的预测块不使用该IWCP模式。因此,在本申请中,解码器可以先确定当前块的尺寸参数,然后根据尺寸参数确定当前块是否使用IWCP模式。
需要说明的是,在本申请的实施例中,当前块的尺寸参数可以包括当前块的高度和宽度,因此,解码器可以利用当前块的高度和宽度对使用IWCP模式进行限制,即限制能够使用IWCP模式的预测块的尺寸。
示例性的,在本申请中,若宽度和高度均大于等于第一下限值,同时,宽度和高度均小于或等于第一上限值,那么便可以确定当前块使用IWCP模式。可见,一种可能的限制是仅仅在预测块的宽度和高度小于(或小于等于)第一上限值,且预测块的宽度和高度大于(或大于等于)第一下限值的情况下使用IWCP模式。其中,第一下限值可以是8,第一上限值的值可以是16或32等。
示例性的,在本申请中,可以有一个帧级的标志来确定当前待解码帧是否使用IWCP模式。如可以配置帧内帧(如I帧)使用IWCP模式,帧间帧(如B帧、P帧)不使用IWCP模式。或者可以配置帧内帧不使用IWCP模式,帧间帧使用IWCP模式。或者可以配置某些帧间帧使用IWCP模式,某些帧间帧不使用IWCP模式。帧间帧也可以 使用帧内预测,因而帧间帧也有可能使用IWCP模式。
示例性的,在本申请中,可以有一个帧级以下、CU级以上(如tile、slice、patch、LCU等)的标志来确定这一区域是否使用IWCP模式。
步骤102、当帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的的第一模式索引和第二模式索引。
在本申请的实施例中,解码器在确定当前块的帧内预测模式参数之后,如果帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值,那么解码器可以进一步确定当前块的第一模式索引和第二模式索引。
可以理解的是,在本申请的实施例中,第一模式索引用于对当前块使用的第一帧内预测模式进行指示,第二模式索引可以用于对当前块的第二帧内预测模式进行指示。
具体地,第一模式索引的值和第二模式索引的值是与第一帧内预测模式和第二帧内预测模式可能存在的帧内角度预测模式的数量相关的,例如,第一帧内预测模式和第二帧内预测模式可能分别为模式号为4-31的28种帧内角度预测模式中的一种,那么第一模式索引的值和第二模式索引的值均属于范围0~27。
示例性的,在本申请的实施例中,可以使用参数iwcp_pred_mode0_index表示第一模式索引,同时使用参数iwcp_pred_mode1_index表示第二模式索引。
步骤103、构建当前块的MPM列表。
在本申请的实施例中,解码器还可以构建当前块的MPM列表。其中,MPM列表中的预测模式均为帧内角度预测模式。
进一步地,在本申请的实施例中,解码器在构建当前块的MPM列表时,需要先确定当前块的权重矩阵导出模式,然后利用权重矩阵导出模式进一步确定当前块的MPM列表。
需要说明的是,在本申请中,权重矩阵导出模式用于对当前块使用的权重矩阵进行确定。具体地,权重矩阵导出模式可以是导出权重矩阵的模式。对于一个给定长度和宽度的预测块,每一种权重矩阵导出模式可以导出一个权重矩阵;对于同样大小的预测块,不同权重矩阵导出模式导出的权重矩阵不同。
示例性的,在本申请中,AVS3的AWP有56种权重矩阵导出模式,VVC的GPM有64种权重矩阵导出模式。
可选地,在本申请中,解码器在构建当前块的MPM列表时,可以直接基于当前块的相邻块的预测模式和权重矩阵导出模式,构建MPM列表。
可选地,在本申请中,解码器在构建当前块的MPM列表时,也可以基于当前块的相邻块的预测模式、预设角度预测模式集合以及权重矩阵导出模式,构建MPM列表。其中,预设角度预测模式集合可以为所有帧内角度预测模式的一个子集。以AVS3为例,预设角度预测模式集合可以仅包括模式号为4-31的28个帧内角度预测模式。
可以理解的是,在本申请中,如果不对第一帧内预测模式和第二帧内预测模式的范围进行限制,那么预设角度预测模式集合可以是所有帧内角度预测模式的组合;如果需要对第一帧内预测模式和第二帧内预测模式的范围进行限制,那么预设角度预测模式集合可以仅为部分帧内角度预测模式的组合,此时预设角度预测模式集合便可以用于对限制第一帧内预测模式和第二帧内预测模式的范围,从而有效地降低开销,提高压缩性能。
可选地,在本申请中,解码器在基于当前块的相邻块的帧内预测模式、预设角度预测模式集合以及权重矩阵导出模式,构建MPM列表时,可以利用相邻块的预测模式确定第一候选模式;利用权重矩阵导出模式确定第二候选模式;可以进一步根据第一候选模式、第二候选模式以及预设角度预测模式集合,构建当前块的MPM列表。
具体地,在本申请中,解码器在利用相邻块的预测模式确定第一候选模式时,若相邻块为普通帧内预测块,且相邻块的预测模式为帧内预测模式,则将相邻块的预测模式确定为第一候选模式。
可以理解的是,在本申请中,普通帧内预测块表示使用DC模式、Planar模式、Bilinear模式、角度预测模式等预测模式的预测块,而不是使用帧内块复制(intra block copy,IBC)、串复制帧内预测intra string copy prediction等预测模式的预测块。
图8为相邻块的示意图,如图8所示,当前块为E,其中(x0,y0)是块E左上角样本在图像中的坐标,(x1,y0)是块E右上角样本在图像中的坐标,(x0,y1)是块E左下角样本在图像中的坐标。当前块E的相邻块A是样本(x0-1,y0)所在的块,当前块E的相邻块B是样本(x0,y0-1)所在的块,当前块E的相邻块C是样本(x1+1,y0-1)所在的块,当前块E的相邻块D是样本(x0-1,y0-1)所在的块,块E的相邻块F是样本(x0-1,y1)所在的块,块E的相邻块G是样本(x1,y0-1)所在的块。当前块E和它的相邻块A、B、C以及D的空间位置关系如图8所示。
可以理解的是,在本申请中,解码器还可以使用当前块更右边以及更下边的相邻块。
具体地,在本申请中,解码器在利用权重矩阵导出模式确定第二候选模式时,可以先根据权重矩阵导出模式确定分界线角度索引值;然后可以利用分界线角度索引值确定第二候选模式。
需要说明的是,在本申请的实施例中,可以确定第二候选模式为L个不同的帧内角度预测模式,从而可以保证长度为L的MPM列表的构建。
进一步地,在本申请的实施例中,在权重矩阵包括有两种权重的情况下,权重变化的位置构成一条直线,或者,在权重矩阵有多种权重的情况下,过渡区域中权重相同的位置构成一条直线,可以将这条直线叫做分界线。可以设水平向右的角度为0,角度逆时针增加。那么分界线可能有水平0度,竖直90度,倾斜的如45度,135度,以及其他各种不同的角度等。如果一个预测块选择使用某一个权重矩阵,那么对应的纹理很可能在分界线两边显现出不同的特性,比如分界线两边是两种不同角度的纹理,或者,分界线的一边是一种角度的纹理,而另一边是一种比较平坦的纹理。由于分界线本身也是有角度的,因此可以假设一个点经过帧内角度预测得到的,它可能与当前块的某些纹理是接近的,因而这条直线与当前块的两个帧内预测模式是存在相关性的。
具体地,在本申请中,假设分界线是由一个点经过帧内角度预测得到的,那么可以找到至少一个帧内角度预测模式,这个帧内角度预测模式可以近似地做出分界线。例如,水平方向的分界线就匹配水平帧内预测模式,如在 AVS3中的模式24;竖直方向的分界线就匹配竖直帧内预测模式,如在AVS3中的模式12;45度的分界线可以匹配左下到右上45度的帧内预测模式,如AVS3中的模式30;也可以匹配右上到左下225度的帧内预测模式,如AVS3中的模式6。如果一个权重矩阵中只有一个权重值,它可以匹配DC模式、Planar模式、Bilinear模式等没有明显角度的模式。由此可见,权重矩阵导出模式就可以匹配到某些帧内预测模式,因此可以利用权重矩阵导出模式辅助帧内预测模式的解码。
需要说明的是,在本申请中,权重矩阵导出模式也可以为权重矩阵的索引,如AWP的56种模式就可以认为是56种权重矩阵导出模式。
示例性的,在本申请中,可以构建一个映射关系表来进一步表示权重矩阵导出模式与帧内角度预测模式之间的映射关系。具体地,AWP和GPM的多个模式的分界线都是同一个角度,比如AVS3的AWP每隔8个模式分界线角度是相同的。56种AWP模式共有8种分界线的角度。分界线角度的索引可以由权重矩阵导出模式的模式号模8(%8)得到。例如,表1为映射关系表,以AVS3的角度模式为例,分界线角度的索引0和1分别可以对应到两个帧内角度预测模式,一个从右上角到左下角,一个从左上角到右下角。具体实现时,可以为其他分界线角度的索引也找到另一个近似对应的帧内角度预测模式,或者所有的分界线角度的索引都只对应一种帧内角度预测模式。
表1
Figure PCTCN2021077324-appb-000001
对一种权重矩阵来说,除了与其分界线对应的帧内角度预测模式使用的可能性高之外,和它相关的某些帧内角度预测模式使用的可能性也较高。比如说与这个分界线相近的角度,或这个分界线垂直的角度等对应的帧内角度预测模式。解码器可以利用权重矩阵与帧内角度预测模式的相关性来构建帧内加权组合预测模式的MPM列表。例如,在构建帧内加权组合预测模式的MPM列表时,如果MPM列表的列表长度为4,那么可以将如下表2中的分界线角度索引对应的候选模式加入MPM列表。
表2
分界线角度的索引 0 1 2 3 4 5 6 7
候选模式0 30 27 24 21 18 15 12 9
候选模式1 6 24 12 24 17 14 24 12
候选模式2 24 6 23 18 19 16 11 8
候选模式3 12 9 25 12 24 12 13 10
可以理解的是,基于上述表2,每个分界线角度的索引对应的候选模式个数与MPM列表的长度相等可以保证即使参考的相邻块的帧内预测模式全都不可用的情况下也能填满MPM列表。如MPM列表长度是4,就可以设每个分界线角度的索引对应的候选模式个数为4。
进一步地,在本申请中,解码器在根据第一候选模式、第二候选模式以及预设角度预测模式集合,构建MPM列表时,还可以基于预设角度预测模式集合对第一候选模式进行筛选处理,获得筛选后候选模式;根据筛选后候选模式和第二候选模式,构建MPM列表。
具体地,在本申请中,解码器在基于预设角度预测模式集合对第一候选模式进行筛选处理,获得筛选后候选模式时,若第一候选模式属于预设角度预测模式集合,则将第一候选模式确定为筛选后候选模式;若第一候选模式为帧内角度预测模式且不属于预设角度预测模式集合,则在预设角度预测模式集合中确定第一候选模式的替换模式,并将替换模式确定为筛选后候选模式。
进一步地,在本申请中,如果第一候选模式不为帧内角度预测模式,那么解码器可以直接删除第一候选模式。
可以理解的是,在本申请中,由于第一帧内预测模式和第二帧内预测模式所属于的预设角度预测模式集合是所有帧内角度预测模式的一个子集,而不包括帧内非角度预测模式,因此,对于帧内加权组合预测模式,当前块的最可能模式MPM的选择,即MPM列表的构建方法也需要做相应的调整。具体地,解码器在构建MPM列表时需要参考当前块周边的相邻块的帧内预测模式。周边的相邻块如左相邻块,上相邻块,左上相邻块,右上相邻块,左下相邻块等。由于空间上的相关性,周边的相邻块使用了某种预测模式,当前块就有较高的概率使用相同或相近的预测模式。
可选地,由于帧内加权组合预测模式的第一帧内预测模式和第二帧内预测模式都只能为帧内角度预测模式,因此,当某一个参考的相邻块使用的帧内预测模式是帧内非角度预测模式,即第一候选模式为不为帧内角度预测模式,那么解码器在构建当前块的MPM列表时就不使用这个参考块所使用的帧内非角度预测模式,即不将该帧内非角度预测模式加入到当前块的MPM列表。
可选地,由于第一帧内预测模式和第二帧内预测模式所属于的预设角度预测模式集合是所有帧内角度预测模式的一个子集,因此,当某一个参考的相邻块使用的帧内预测模式是该预设角度预测模式集合之外的帧内角度预测模式,即第一候选模式为帧内角度预测模式且不属于预设角度预测模式集合,那么解码器在构建当前块的MPM列表时可以将该预设角度预测模式集合外的帧内角度预测模式转化为角度相近的、预设角度预测模式集合内的帧内角度预测模式,然后再加入MPM列表。以AVS3为例,如果预设角度预测模式集合限制第一帧内预测模式和第二帧内预测模式仅可使用4-31号的帧内角度预测模式,而当前块的相邻块使用了43号帧内角度预测模式,那么解码器可以将与43号帧内角度预测相近的12号帧内角度预测加入到当前块在帧内加权组合预测模式下的MPM列表中。
进一步地,在本申请的实施例中,解码器在根据筛选后候选模式和第二候选模式,构建MPM列表时,若筛选后候选模式满足预设添加条件,则将筛选后候选模式添加至MPM列表;若MPM列表不满足预设列表长度L,且第二候选模式满足预设添加条件,则将第二候选模式添加至MPM列表;其中,L为大于等于1的整数。
示例性的,在本申请中,L的取值可以为4,即MPM列表的预设列表长度为4,或者说,MPM列表中包括由4个最可能模式。
可以理解的是,在本申请的实施例中,解码器可以按照模式号由小到大的顺序对MPM列表中的L个模式进行排序。
需要说明的是,在本申请的实施例中,如果筛选后候选模式与MPM列表中的预测模式均不相同,那么解码器可以确定筛选后候选模式满足预设添加条件;相应地,如果第二候选模式与所述MPM列表中的预测模式均不相同,那么解码器可以确定所述第二候选模式满足所述预设添加条件。
可以理解的是,在本申请的实施例中,解码器在将相邻块对应的筛选后候选模式添加至MPM列表时,可以确定相邻块对应的顺序参数;按照顺序参数,依次将相邻块对应的帧内筛选后候选模式添加至MPM列表。其中,解码器可以按照相邻块与当前块之间的空间距离来确定对应的顺序参数,例如,相邻块与当前块之间的空间距离越近,两者的相关性越强,越先进行添加处理,即顺序参数就越小;相邻块与当前块之间的空间距离越远,两者的相关性越弱,越后进行添加处理,即顺序参数就越大。
进一步地,在本申请的实施例中,解码器在将筛选后候选模式和/或第二候选模式添加至MPM列表之后,还可以按照模式号由小到大的顺序对所述MPM列表中的L个预测模式进行排序处理。
示例性的,在本申请中,假设当前块在帧内加权组合预测模式下的MPM列表为IwcpMpm[4],即MPM列表的列表长度为4,权重矩阵导出模式的索引为IwcpIndex,权重矩阵导出模式复用AWP的56种导出模式,第一帧内预测模式和第二帧内预测模式所属的预设角度预测模式集合为4-31号的帧内角度预测模式。那么解码器在构建当前块的MPM列表时,可以依次执行以下步骤:
步骤S1、设数组cand_mode[10],cand_mode的所有值初始化为无效值。对cand_mode执行如下操作:
(a)如果相邻块F“存在”且为普通帧内预测块,cand_mode[0]等于F的帧内预测模式,
(b)如果相邻块G“存在”且为普通帧内预测块,cand_mode[1]等于G的帧内预测模式,
(c)如果相邻块C“存在”且为普通帧内预测块,cand_mode[2]等于C的帧内预测模式,
(d)如果相邻块A“存在”且为普通帧内预测块,cand_mode[3]等于A的帧内预测模式,
(e)如果相邻块B“存在”且为普通帧内预测块,cand_mode[4]等于B的帧内预测模式,
(f)如果相邻块D“存在”且为普通帧内预测块,cand_mode[5]等于D的帧内预测模式,
(g)cand_mode[6]等于IwcpIndex%8对应的候选模式0,
(h)cand_mode[7]等于IwcpIndex%8对应的候选模式1,
(i)cand_mode[8]等于IwcpIndex%8对应的候选模式2,
(j)cand_mode[9]等于IwcpIndex%8对应的候选模式3,
其中,相邻块X(X为A、B、C、D、F或G)“存在”指该块应在图像内并且该块应与块E属于同一片;否则相邻块“不存在”。如果块“不存在”或者尚未解码,则此块“不可用”;否则此块“可用”。如果图像样本所在的块“不存在”或者此样本尚未解码,则此样本“不可用”;否则此样本“可用”。
可以理解的是,在本申请中,上述(a)至(f)的执行步骤即为第一候选模式的确定流程;上述(g)至(j)的执行步骤即为第二候选模式的确定流程,其中,解码器可以参照上述表2进行第二候选模式的确定。
步骤S2、对i从0到5,执行如下操作:
(a)如果cand_mode[i]小于3或cand_mode[i]等于33,cand_mode[i]设为无效值,
也就是说,如果第一候选模式为帧内非角度预测模式,那么解码器可以直接删除第一候选模式,即不使用第一候选模式。
(b)否则如果cand_mode[i]等于3,令cand_mode[i]等于4,
(c)否则如果cand_mode[i]等于32,令cand_mode[i]等于31,
(d)否则如果cand_mode[i]大于33,执行如下操作:
如果cand_mode[i]小于44,令cand_mode[i]等于cand_mode[i]-30,
否则如果cand_mode[i]小于58,令cand_mode[i]等于cand_mode[i]-33,
否则,令cand_mode[i]等于cand_mode[i]-34,
也就是说,如果第一候选模式为帧内角度预测模式,但是第一候选模式不属于预设角度预测模式集合,那么解码器可以在预设角度预测模式集合中选择一个相近的帧内角度预测模式作为第一候选模式的替换模式,然后将该替换模式作为筛选后候选模式。
(e)否则不修改cand_mode[i]的值,
也就是说,如果第一候选模式属于预设角度预测模式集合,那么解码器便可以直接使用第一候选模式,即第一候选模式即为筛选后候选模式。
可以理解的是,在本申请中,上述步骤S2即为第一候选模式的筛选流程,最终确定出对第一候选模式对应的筛选后候选模式。
步骤S3、记mpm_num为0,对i从0到9,执行如下操作:
(a)如果cand_mode[i]不是无效值,则执行如下操作:
将cand_mode[i]与IwcpMpm[j]比较,其中j为从0到mpm_num-1,如果cand_mode[i]与IwcpMpm[j]都不相等,执行如下操作:
1、令IwcpMpm[mpm_num]等于cand_mode[i],
2、令mpm_num等于mpm_num+1,
3、如果mpm_num等于4,则结束步骤3。
也就是说,在MPM列表中的预测模式还不足4个的前提下,如果筛选后候选模式与MPM列表中的任意一个预测模式不相同,那么解码器便可以将筛选后候选模式添加至MPM列表;如果在全部符合预设添加条件的筛选后候选模式添加至MPM列表之后,MPM列表中的预测模式还不足4,那么解码器可以继续将满足预设添加条件的第二候选模式添加至MPM列表,直到MPM列表的列表长度达到4。
步骤S4、对IwcpMpm[4]的4个数按由小到大排序。
最后,解码器可以对MPM列表中的4个帧内角度预测模式按照模式号的由小到大的顺序进行排序。
可以理解的是,本申请不对上述步骤102和步骤103的执行顺序进行限制,即不限制第一模式索引和第二模式索引的确定流程和MPM列表的构建流程之间的先后顺序。
步骤104、根据第一模式索引、第二模式索引以及MPM列表确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式。
在本申请的实施例中,解码器在确定出当前块的第一模式索引和第二模式索引,同时完成当前块的MPM列表的构建之后,可以进一步根据第一模式索引、第二模式索引以及MPM列表确定出当前块的第一帧内预测模式和第二帧内预测模式。
可以理解的是,在本申请的实施例中,第一帧内预测模式和第二帧内预测模式可以为两个不同的帧内角度预测模式。具体地,在本申请的实施例中,第一帧内预测模式和第二帧内预测模式可以分别为预设角度预测模式集合中的两个不同的帧内角度预测模式。
也就是说,在本申请中,第一帧内预测模式和第二帧内预测模式都只能为帧内角度预测模式,即第一帧内预测模式和第二帧内预测模式均不为除帧内角度预测模式以外的其他基本帧内预测模式,如帧内非角度预测模式,包括DC模式、Planar模式、PLANE模式、Bilinear模式、PCM模式等。其中,基本帧内预测模式包括但不限于角度预测模式和非角度预测模式。如VVC所使用的67种帧内预测模式,AVS3所使用的66种帧内预测模式。
可以理解的是,在本申请中,对第一帧内预测模式和第二帧内预测模式进行帧内角度预测模式的限制,一方面可以降低帧内加权组合预测模式的硬件实现复杂度,因为硬件以并行的方式实现帧内加权组合预测模式时只需要新增一组支持帧内角度加权预测的电路;另一方面是因为帧内加权组合预测模式本身适用的块内容相对复杂,而帧内非角度预测模式通常应对纹理变化比较均匀的场景,而且可使用的模式少了还可以减少开销,因而帧内加权组合预测模式使用或不使用帧内非角度预测模式对压缩性能几乎没有影响。
进一步地,在本申请中,虽然可使用的帧内角度预测模式越多,可以准确性更高的预测值,但是相应地在码流中传输所选模式的标志的开销也越大,因此,为了获得更好的压缩性能,可以选择一个合理的可用的帧内预测模式集合来实现预测效果和开销之间的更好的权衡。具体地,解码器可以使用预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式可用的帧内角度预测模式进行限制,其中,预设角度预测模式集合是所有帧内角度预测模式的一个子集。以AVS3为例,AVS3有62种角度模式,即模式号为3-32、34-65的帧内角度预测模式。
示例性的,在本申请中,第一帧内预测模式和第二帧内预测模式可仅使用模式号为3-32的帧内角度预测模式,或者,第一帧内预测模式和第二帧内预测模式可仅使用模式号为4-31的28个帧内角度预测模式。
示例性的,在本申请中,以VVC为例,第一帧内预测模式和第二帧内预测模式可仅使用模式号为偶数的帧内角度预测模式,或者,第一帧内预测模式和第二帧内预测模式可仅使用模式号为奇数的帧内角度预测模式。
示例性的,在本申请中,第一帧内预测模式使用的角度预测模式集合和第二帧内预测模式使用的角度预测模式集合不相同。可选地,解码器可以使用相同的预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式进行限制,即如果第一个帧内预测模式仅可使用模式号为4-31的28个帧内角度预测模式,第二个帧内预测模式也可仅使用模式号为4-31的28个帧内角度预测模式,进而第一帧内预测模式和第二帧内预测模式可以使用相同的MPM列表,并使用相同或相近的编解码方法。也就是说,如果解码器使用不同的预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式进行限制,那么需要对第一帧内预测模式和第二帧内预测模式需要使用不同的MPM列表或使用差别明显的编解码方法。
进一步地,在本申请的实施例中,解码器可以确定索引值与二元符号串的第一映射关系表;其中,第一映射关系表中分别包括第一长度、第二长度以及第三长度的二元符号串。
示例性的,在本申请中,第一长度为3比特,第二长度为5比特,第三长度为6比特。
需要说明的是,在本申请中,索引值与二元符号串的第一映射关系表可以用于对第一模式索引和第二模式索引的值进行确定。
可选地,在本申请中,对于AVS3,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么可以使用4+8+16的形式编码,即4个最短的码字的模式,8个较短码字的模式,16个较长码字的模式。其中,4个最短的码字的模式使用3bit的码字,即使用第一长度,8个较短码字的模式使用5bit的码字,即使用第二长度,16个较长码字的模式使用6bit的码字,即使用第三长度。
需要说明的是,在本申请中,使用模式号为4-31的28个帧内角度预测模式的预测角度基本上覆盖了整个常用的角度范围,同时,模式号为4-31帧内角度预测模式比模式号为34-65的帧内角度预测模式更加简单,且使用这28个模式以4+8+16的形式编码不会造成码字浪费,因此解码器可以优选地按照模式号为4-31的28个帧内角度预测模式定义预设角度预测模式集合。
进一步地,在本申请的实施例中,如果当前块的MPM列表的列表长度为4,那么MPM列表中的4个最可能模式可以对应使用第一长度的二元符号串,即4个最短码字的模式可以给MPM列表中的4个MPM使用;相应地,预设角度预测模式集合中、MPM列表以外的其他预测模式可以分别使用第二长度的二元符号串和第三长度的二元符号串。
可选地,在本申请中,对于预设角度预测模式集合中的、MPM列表中4个MPM以外的其他24个帧内角度预 测模式,解码器可以对较短码字的模式和较长码字的模式进行均匀分布。具体地,解码器可以将8个较短码字(第二长度的二元符号串)的模式均匀分布在这剩余的24个帧内角度预测模式中。例如,每隔2个较长码字(第三长度的二元符号串)的模式使用1个较短码字(第二长度的二元符号串)的模式。进而在具体执行过程中,可以通过对剩余的24个帧内角度预测模式中的从0-23的序号模3(%3)来实现,例如序号模3余2的模式使用5bit码字,即使用第二长度的二元符号串,序号模3余0或1使用6bit码字,即使用第三长度的二元符号串。
示例性的,在本申请中,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么索引值与二元符号串的第一映射关系表可以如表3所示,其中,第一长度为3比特,第二长度为5比特,第三长度为6比特。
表3
Figure PCTCN2021077324-appb-000002
其中,可以以第一个比特位表示是否是MPM,比如“1”表示是MPM,“0”表示不是MPM。如果第一帧内预测模式是MPM,假设MPM列表中包括有4个MPM,那么可以使用2个比特位表示使用MPM列表中的哪一个MPM,即“00,01,10,11”分别表示MPM列表中的第一个MPM,第二个MPM,第三个MPM,第四个MPM。
进一步地,在本申请中,对比特标志为0的二元符号串使用上下文模型进行解码,对比特标志不为0的二元符号串不使用上下文模型进行解码。其中,比特标志的取值可以表示已经解码了多少个bit,比特标志可以用binIdx表示。
需要说明的是,在本申请中,对于解码侧,在根据表3进行反二值化时,可以对binIdx为0的二元符号串使用上下文模型进行解码,而binIdx不为0的二元符号串使用等概率模型或者旁路模式bypass进行解码。
进一步地,在本申请中,解码器在根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式时,可以先根据索引值与二元符号串的第一映射关系表确定第一模式索引的值i;其中,i为大于等于0的整数。若i大于等于0且小于L,则将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式;若i大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第 一帧内预测模式。
具体地,在本申请中,解码器在利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式时,若i大于等于所述MPM列表中的第一个模式的模式号,则对i和1进行求和运算;若(i+1)大于等于所述MPM列表中的第二个模式的模式号,则对(i+1)和1进行求和运算;若(i+2)大于等于所述MPM列表中的第三个模式的模式号,则对(i+2)和1进行求和运算;若(i+3)大于等于所述MPM列表中的第四个模式的模式号,则对(i+3)和1进行求和运算;将(i+4)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式。
相应地,在本申请中,解码器在利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式时,若i小于所述MPM列表中的第一个模式的模式号,则将i确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,若(i+1)小于所述MPM列表中的第二个模式的模式号,则将(i+1)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,若(i+2)小于所述MPM列表中的第三个模式的模式号,则将(i+2)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,若(i+3)小于所述MPM列表中的第四个模式的模式号,则将(i+3)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,基于如上述表3所示的索引值与二元符号串的第一映射关系表确定的第一模式索引的值i为5,那么在包括有模式号为4-31的28个帧内角度预测模式的预设角度预测模式集合中,将i依次与MPM列表中的4个MPM的模式号相比,具体地,5大于MPM列表中的第一个模式的模式号,那么解码器可以确定对i进行加1运算,即i+1=6,然后再将6与MPM列表中的第二个模式的模式号相比,6小于8,那么可以将(i+1)的值6确定为第一帧内预测模式的模式号,并在预设角度预测模式集合中将模式号为6的帧内角度预测模式确定所述第一帧内预测模式。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,基于如上述表3所示的索引值与二元符号串的第一映射关系表确定的第一模式索引的值i为10,那么在包括有模式号为4-31的28个帧内角度预测模式的预设角度预测模式集合中,将i依次与MPM列表中的4个MPM的模式号相比,具体地,10大于MPM列表中的第一个模式的模式号,那么解码器可以确定对i进行加1运算,即i+1=11,然后再将11与MPM列表中的第二个模式的模式号相比,11大于8,那么解码器可以确定对(i+1)进行加1运算,即(i+1)+1=12,然后再将12与MPM列表中的第三个模式的模式号相比,12等于12,那么解码器可以确定对(i+2)进行加1运算,即(i+2)+1=13,然后再将12与MPM列表中的第四个模式的模式号相比,13小于16,那么可以将(i+3)的值13确定为第一帧内预测模式的模式号,并在预设角度预测模式集合中将模式号为13的帧内角度预测模式确定所述第一帧内预测模式。
进一步地,在本申请中,解码器在根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式时,可以先根据所述第一映射关系表确定所述第二模式索引的值j;其中,j为大于等于0的整数。若j大于等于0且小于L,则将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式;若j大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式。
具体地,在本申请中,解码器在利用所述预设角度预测模式集合和所述MPM列表确定所述第二帧内预测模式时,若j大于等于所述MPM列表中的第一个模式的模式号,则对j和1进行求和运算;若(j+1)大于等于所述MPM列表中的第二个模式的模式号,则对(j+1)和1进行求和运算;若(j+2)大于等于所述MPM列表中的第三个模式的模式号,则对(j+2)和1进行求和运算;若(j+3)大于等于所述MPM列表中的第四个模式的模式号,则对(j+3)和1进行求和运算;将(j+4)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式。
相应地,在本申请中,解码器在利用所述预设角度预测模式集合和所述MPM列表确定所述第二帧内预测模式时,若j小于所述MPM列表中的第一个模式的模式号,则将j确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,若(j+1)小于所述MPM列表中的第二个模式的模式号,则将(j+1)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,若(j+2)小于所述MPM列表中的第三个模式的模式号,则将(j+2)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,若(j+3)小于所述MPM列表中的第四个模式的模式号,则将(j+3)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式。
示例性的,在本申请中,如果当前块使用IWCP模式,当前块的MPM列表的长度为4,即L=4,预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,解码器解码码流可以确定第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index,进而可以根据第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index导出第一帧内预测模式为IwcpPredMode0,第二帧内预测模式为IwcpPredMode1。
解码器在利用第一模式索引iwcp_pred_mode0_index确定第一帧内预测模式IwcpPredMode0时,具体可以执行如下操作:
1、按照表3对二元符号串进行反二值化,确定iwcp_pred_mode0_index的值为i。
具体地,在根据解码确定的二元符号串形式的iwcp_pred_mode0_index之后,可以按照表3对二元符号串进行反二值化确定,即根据iwcp_pred_mode0_index从表3的右栏中找到匹配的二元符号串,然后从同一行的左栏中确定iwcp_pred_mode0_index的值i。
2、如果i大于等于0且小于4,那么IwcpPredMode0等于IwcpMpm[i]。
3、如果i大于等于4,那么IwcpPredMode0等于(iwcp_pred_mode0_index+(iwcp_pred_mode0_index>=IwcpMpm[0])+((iwcp_pred_mode0_index+1)>=IwcpMpm[1])+((iwcp_pred_mode0_index+2)>=IwcpMpm[2])+((iwcp_pred_mode0_index+3)>=IwcpMpm[3]))。
也就是说,在本申请中,如果第一帧内预测模式IwcpPredMode0不属于MPM列表,而是预设角度预测模式集合中的、MPM列表中的MPM以外的其他24个帧内角度预测模式,那么解码器可以将第一模式索引iwcp_pred_mode0_index的值i依次与MPM列表中的每一个角度预测模式的模式号进行比较,根据比较结果选择是否进行加1运算,最终计算出第一帧内预测模式的模式号,并按照该模式号在预设角度预测模式集合中确定第一帧内预测模式。
解码器在利用第二模式索引iwcp_pred_mode1_index确定第二帧内预测模式IwcpPredMode1时,具体可以执行如下操作:
1、按照表3对二元符号串进行反二值化,确定iwcp_pred_mode1_index的值为j。
具体地,在根据解码确定的二元符号串形式的iwcp_pred_mode1_index之后,可以按照表3对二元符号串进行反二值化确定,即根据iwcp_pred_mode1_index从表3的右栏中找到匹配的二元符号串,然后从同一行的左栏中确定iwcp_pred_mode1_index的值j。
2、如果j大于等于0且小于4,那么IwcpPredMode1等于IwcpMpm[i]。
3、如果j大于等于4,那么IwcpPredMode1等于
(iwcp_pred_mode1_index+(iwcp_pred_mode1_index>=IwcpMpm[0])+((iwcp_pred_mode1_index+1)>=IwcpMpm[1])+((iwcp_pred_mode1_index+2)>=IwcpMpm[2])+((iwcp_pred_mode1_index+3)>=IwcpMpm[3]))。
进一步地,在本申请的实施例中,由于帧内加权组合预测模式需要使用第一帧内预测模式和第二帧内预测模式对当前块的预测值进行确定,其中,第一帧内预测模式和第二帧内预测模式可以共享一个预设角度预测模式集合,还可以共享同一个MPM列表,但是,帧内加权组合预测模式中第一帧内预测模式和第二帧内预测模式并不相同,因此,在进行第二帧内预测模式的编解码时,可以参考第一帧内预测模式,具体地,在确定第二帧内预测模式时,可以将第一帧内预测模式排除掉。
可以理解的是,在本申请中,对于28个帧内角度预测模式,由于在上述4+8+16的编解码方式中,MPM列表中的4个MPM出现的概率很高(第一帧内预测模式是MPM列表中的4个MPM其中之一的概率约有50%,第二帧内预测模式是MPM列表中的4个MPM其中之一的概率约有50%),如果第一帧内预测模式和第二帧内预测模式都是MPM列表中的MPM,那么在确定第二帧内预测模式时,只能从MPM列表中的、第一帧内预测模式外的其他3个MPM中选择一个即可。这样从原来4选1,需要4个3bit的码字就可以变成3选1,需要1个2bit的码字和2个3bit的码字。相应地,如果第一帧内预测模式和第二帧内预测模式都不是MPM列表中的MPM,那么第二帧内预测模式也可以从8+16的24个帧内角度预测模式中去掉1个,但这样的影响就比较小了。
由此可见,对于第一帧内预测模式和第二帧内预测模式都是MPM列表中的MPM的情况,可以选择在进行第二帧内预测模式的确定时,先针对第一帧内预测模式执行删除处理,从而可以减少开销。
进一步地,在本申请的实施例中,如果第一帧内预测模式为MPM列表中的一个MPM,即解码器确定第一模式索引的值i大于等于0且小于L,那么在将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式之后,解码器在确定第二帧内预测模式时,可以根据索引值与二元符号串的第二映射关系表确定所述第二模式索引的值j;若j大于等于i,则对j进行加1运算;在进行自加1运算之后,若j大于等于0且小于L,则将所述MPM列表中的第(j+1)个角度预测模式确定为所述第二帧内预测模式;若j大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第二帧内预测模式。
进一步地,在本申请的实施例中,解码器可以确定索引值与二元符号串的第二映射关系表;其中,第二映射关系表中分别包括第一长度、第二长度、第三长度以及第四长度的二元符号串。
示例性的,在本申请中,第一长度为3比特,第二长度为5比特,第三长度为6比特,第四长度为2比特。
需要说明的是,在本申请中,索引值与二元符号串的第二映射关系表仅用于对第二模式索引的值进行确定。
可选地,在本申请中,索引值与二元符号串的第二映射关系表可以如表4所示,其中,第一长度为3比特,第二长度为5比特,第三长度为6比特,第四长度为2比特。
表4
Figure PCTCN2021077324-appb-000003
Figure PCTCN2021077324-appb-000004
MPM列表的长度为4,预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,解码器解码码流可以确定第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index,进而可以根据第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index导出第一帧内预测模式为IwcpPredMode0,第二帧内预测模式为IwcpPredMode1。
需要说明的是,在本申请中,对于解码侧,在根据表4进行反二值化时,可以对binIdx为0的二元符号串使用上下文模型进行解码,而binIdx不为0的二元符号串使用等概率模型或者旁路模式bypass进行解码。
解码器在利用第一模式索引iwcp_pred_mode0_index确定第一帧内预测模式IwcpPredMode0时,具体可以执行如下操作:
1、按照表3对二元符号串进行反二值化,确定iwcp_pred_mode0_index的值为i。
2、如果i大于等于0且小于4,那么IwcpPredMode0等于IwcpMpm[i]。
3、如果i大于等于4,那么IwcpPredMode0等于(iwcp_pred_mode0_index+(iwcp_pred_mode0_index>=IwcpMpm[0])+((iwcp_pred_mode0_index+1)>=IwcpMpm[1])+((iwcp_pred_mode0_index+2)>=IwcpMpm[2])+((iwcp_pred_mode0_index+3)>=IwcpMpm[3]))。
解码器在利用第二模式索引iwcp_pred_mode1_index确定第二帧内预测模式IwcpPredMode1时,具体可以执行如下操作:
1、如果i大于等于0且小于4,则执行如下操作:
(a)按照表4对二元符号串进行反二值化,确定iwcp_pred_mode1_index的值为j;
(b)如果iwcp_pred_mode1_index大于或等于iwcp_pred_mode0_index,即j大于等于i,则iwcp_pred_mode1_index等于iwcp_pred_mode1_index+1,即对j进行加1运算,即j=j+1,然后执行步骤3;
2、如果i大于等于4,则按照表3对二元符号串进行反二值化,确定iwcp_pred_mode1_index的值为j,然后执行步骤3;
3、如果j大于等于0且小于4,那么IwcpPredMode1等于IwcpMpm[i]。
4、如果j大于等于4,那么IwcpPredMode1等于
(iwcp_pred_mode1_index+(iwcp_pred_mode1_index>=IwcpMpm[0])+((iwcp_pred_mode1_index+1)>=IwcpMpm[1])+((iwcp_pred_mode1_index+2)>=IwcpMpm[2])+((iwcp_pred_mode1_index+3)>=IwcpMpm[3]))。
由此可见,如果需要基于第一帧内预测模式进行第二帧内预测模式的确定,那么iwcp_pred_mode1_index的值j是依赖于iwcp_pred_mode0_index的值i的,具体地,以表4为例,如果第一帧内预测模式和第二帧内预测模式都是MPM列表中的MPM,那么第二帧内预测模式可用的MPM只有3种,进而可以用1到2个比特位表示是哪一个MPM,如“00,01,10”分别表示剩余的第一个MPM,第二个MPM,第三个MPM。可见,由于排除了一种可能,可以改变编解码方法或者二值化或反二值化的方法以节省开销。
需要说明的是,在本申请的实施例中,如果预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,MPM列表的长度为4,那么在使用第一长度、第二长度、第三长度的二元符号串确定索引值与二元符号串的第一映射关系表时,可以先对MPM列表中的4个MPM使用第一长度的二元符号串,即使用最短的码字。接着,再从剩余的24个帧内角度预测模式选择8个帧内角度预测模式使用第二长度的二元符号串,选择16个帧内角度预测模式使用第三长度的二元符号串。
具体地,在本申请中,对于剩余的24个帧内角度预测模式,可以按照模式号由小到大的顺序,对前8个模式号对应的预测模式使用较短的码字,即使用第二长度的二元符号串,然后对接下来的16个模式号对应的预测模式使用使用较长的码字,即使用第三长度的二元符号串。
示例性的,在本申请中,可以将上述表3所示的索引值与二元符号串的第一映射关系表替换为下述表5,其中,用于表征索引值与二元符号串的第一映射关系的表5也可以用于对第一模式索引和第二模式索引的值进行确定。
表5
Figure PCTCN2021077324-appb-000005
相应地,还可以将上述表4所示的索引值与二元符号串的第二映射关系表替换为下述表6,其中,用于表征索引值与二元符号串的第二映射关系的表6也可以用于对第二模式索引的值进行确定。
表6
Figure PCTCN2021077324-appb-000006
Figure PCTCN2021077324-appb-000007
可以理解的是,在本申请中,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么可以使用4+8+16的形式编码,即4个3bit的码字的模式,8个5bit的码字的模式,16个6bit的码字的模式。
可选地,在本申请中,如果预设角度预测模式集合中共包括有20个模式,那么可以使用4个3bit的码字和16个5bit的码字来表示。
可选地,在本申请中,如果预设角度预测模式集合中共包括有36个模式,那么可以使用4个3bit的码字和32个6bit的码字来表示。例如如AVS3中使用模式号为4-31、42-45以及56-59这36种帧内角度预测模式。
需要说明的是,在本申请中,如果对预设角度预测模式集合中所有的模式的表示都按照如表3、表4所示的一组二元符号串来进行表示,那么可以将“码字”理解为二元符号串。码字的长度可以理解为二元符号串的长度。另一种表示方法是用标志位(flag)加二元符号串。比如用一个二元的MPM_flag表示当前模式是否MPM模式,即如果MPM_flag为1表示当前模式是MPM模式,如果MPM_flag为0表示当前模式不是MPM模式,如果当前模式是MPM模式,MPM总共有4种可能,再用2bit的二元符号串来表示当前模式是哪一个MPM。那么码字可以理解为标志位加二元符号串,码字的长度可以理解为标志位加二元符号串的长度。
步骤105、确定当前块的权重矩阵,并基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前块的预测值。
在本申请的实施例中,解码器需要确定当前块的权重矩阵,从而在确定出当前块使用的第一帧内预测模式和第二帧内预测模式之后,还基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,进一步确定当前块的预测值。
具体地,在本申请中,解码器可以根据当前块的权重矩阵导出模式确定当前块的权重矩阵。
进一步地,在本申请中,解码器在基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值时,可以先根据所述第一帧内预测模式确定所述当前块的第一预测值;根据所述第二帧内预测模式确定所述当前块的第二预测值;然后利用所述权重矩阵对所述第一预测值和所述第二预测值进行加权运算,获得所述当前块的预测值。
可以理解的是,在本申请中,第一帧内预测模式和第二帧内预测模式可以都是帧内角度预测模式,即本申请实施例使用两个不同的帧内角度预测模式。然后利用第一帧内预测模式和第二帧内预测模式组合,分别生成第一预测块和第二预测块,进而基于第一预测块和第二预测块,结合权重矩阵,确定当前块的预测块。
进一步地,在本申请的实施例中,所有可能的权重矩阵中并非每一个权重矩阵的所有的点的权重都相同。换句话说,至少有一个可能的权重矩阵中包含至少两个不同的权重值。
需要说明的是,在本申请的实施例中,解码器可以采用类似于GPM或AWP的方法来实现权重矩阵的确定。具体地,如果同一个编解码标准或编解码器中使用了GPM或AWP,那么可以使用该方法来确定权重矩阵,这样可以做到复用部分相同的逻辑。如AVS3帧间预测使用了AWP,那么在AVS3中可以使用AWP的方法来确定权重矩阵。当然也可以使用和同一个编解码标准或编解码器中的GPM或AWP不同方法,比如使用不同的模式数,或者不同的过渡区域算法,或者使用不同的参数等。因为帧间预测利用了时域上的相关性,它使用的是参考帧中已重建的图像作为参考块。而帧内预测利用了空域上的相关性,它使用的是当前块周边已重建的像素作为参考像素。空域上距离 越近相关性越强,距离越远相关性越差。所以如果某种权重矩阵使得一个预测块使用的得到的像素位置都距离参考像素较远,那么这部分可能做不出比现有技术更合适的预测值,那么可以不使用这样的权重矩阵,而在帧间预测中可以使用。
本申请实施例提供一种帧内预测方法,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
基于上述实施例,在本申请的再一实施例中,下述预测样本矩阵即为上文所述的预测块,即“块”可以理解为“样本矩阵”,文本中提到的阵列即为矩阵的意思。可以以IWCP作用于亮度分量的预测为例,但是本发明并不只限于亮度分量,也可以用于色度分量以及其他任何格式的任何分量。以在AVS3中应用本申请提出的帧内预测方法为例,解码器使用帧内加权组合预测模式确定当前块的预测值的具体过程可以描述如下:
需要说明的是,在一个具体的解码实施例中,由于AVS3中使用了AWP技术,帧内加权组合预测(IWCP)模式的权重矩阵复用AWP的权重矩阵,即IWCP的权重矩阵导出方式和AWP的权重矩阵导出方式相同。
示例性的,可以使用一个序列级的标志(flag)来确定当前待解码序列是否使用IWCP模式。比如:
序列头定义见错误!未找到引用源。:
表7
序列头定义 描述符
sequence_header(){  
……  
iwcp_enable_flag u(1)
……  
其中,帧内加权组合预测模式的允许标志iwcp_enable_flag为二值变量,具体地,iwcp_enable_flag值为‘1’表示可使用帧内加权组合预测模式;值为‘0’表示不应使用帧内加权组合预测模式。IwcpEnableFlag的值等于iwcp_enable_flag。如果位流中不存在iwcp_enable_flag,则IwcpEnableFlag的值为0。
示例性的,可以使用一个帧级的标志来确定当前待解码帧是否使用IWCP模式。如可以配置帧内帧(如I帧)使用IWCP模式,帧间帧(如B帧、P帧)不使用IWCP模式。或者可以配置帧内帧不使用IWCP模式,帧间帧使用IWCP模式。或者可以配置某些帧间帧使用IWCP模式,某些帧间帧不适用IWCP模式。
示例性的,可以使用一个帧级以下、CU级以上(如tile、slice、patch、LCU等)的标志来确定这一区域是否使用IWCP模式。
示例性的,解码器解码当前CU,如果当前CU符合IWCP的使用条件,解码当前CU的IWCP使用标志。否则不需要解码当前CU的IWCP使用标志。IWCP的使用条件可以为当前CU为帧内编码的CU(下面的IntraCuFlag为1)且当前序列可使用IWCP(下面的IwcpEnableFlag为1)且当前块的尺寸符合限制,(下面的width>=IwcpMinSize&&height>=IwcpMinSize&&width<=IwcpMaxSize&&height<=IwcpMaxSize)其中一个可能的情况是IwcpMinSize等于8,IwcpMaxSize等于32。一个可能的情况是IwcpMinSize等于8,IwcpMaxSize等于16。其中width是当前CU的宽度,height是当前CU的高度。
示例性的,对于YUV4:2:0格式的编码,亮度的8×8的块对应相同位置的色度的4×4的块,一种可能的方法是允许亮度的8×8的块使用IWCP模式但禁止色度的4×4的块使用IWCP模式。因为4×4的块进行IWCP模式的预测效果提升并不明显,另一方面增加了硬件的实现代价。
示例性的,如果当前CU使用IWCP,那么当前CU不会使用如衍生模式(Derived Tree,DT)、帧内预测滤波(Intra Prediction Filter,IPF)、改进型帧内预测(Improved Intra Prediction,IIP)等一些其他模式。,即当前CU使用IWCP的话就不需要处理这些模式的相关的信息。这是因为IWCP与这些模式叠加之后的预测效果并不能得到明显地提升。反而,如果当前CU使用IWCP,默认不使用衍生模式DT、帧内预测滤波IPF、改进型帧内预测IIP,便不需要在码流中传输它们是否使用的标志,如dt_split_flag,intra_pf_flag,iip_flag,可以节省码字,有利于压缩效率。
例如下表8所示:
表8
Figure PCTCN2021077324-appb-000008
Figure PCTCN2021077324-appb-000009
其中,帧内加权组合预测标志iwcp_flag为二值变量,iwcp_flag值为‘1’表示应使用帧内加权组合预测模式模式;值为‘0’表示不应使用帧内加权组合预测模式。IwcpFlag的值等于iwcp_flag的值。如果位流中不存在iwcp_flag,IwcpFlag的值为0。
其中,衍生模式划分标志dt_split_flag为二值变量。dt_split_flag值为‘1’表示应进行衍生模式划分;值为‘0’表示不应进行衍生模式划分。DtSplitFlag的值等于dt_split_flag的值,取值范围是0~4。如果位流中不存在dt_split_flag,DtSplitFlag的值为0。衍生模式划分表示可以在当前CU的基础上划分矩形的预测单元。
其中,帧内预测滤波标志intra_pf_flag为二值变量。intra_pf_flag值为‘1’表示当前编码单元应使用帧内预测滤波;值为‘0’表示当前编码单元不应使用帧内预测滤波。IntraPfFlag的值等于intra_pf_flag的值。如果位流中不存在intra_pf_flag,IntraPfFlag的值为0。帧内预测滤波可以在产生初始预测值以后利用参考像素对初始预测值进行滤波产生新的预测值。
其中,改进型帧内预测标志iip_flag为二值变量。iip_flag值为‘1’表示当前编码单元应使用改进型帧内预测;值为‘0’表示当前编码单元不应使用改进型帧内预测。IipFlag的值等于iip_flag的值。如果位流中不存在iip_flag,IipFlag的值为0。改进型帧内预测可以使用与不使用改进型预测时不同的滤波器产生预测值。一个例子是对某种角度预测,改进型帧内预测使用8抽头滤波器产生预测值。不使用改进型帧内预测时使用4抽头滤波器产生预测值。
示例性的,如果当前CU使用IWCP,那么需要解码码流并确定权重矩阵导出模式iwcp_idx和2个帧内预测模式的第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index,如下表9所示。其中,权重矩阵导出模式复用AWP的权重矩阵导出模式。
表9
Figure PCTCN2021077324-appb-000010
其中,帧内加权组合预测模式索引iwcp_idx,用于确定帧内加权组合预测模式的权重矩阵,IwcpIndex的值等于iwcp_idx的值。如果位流中不存在iwcp_idx,IwcpIndex的值等于0。
帧内加权组合预测模式中的第一模式索引iwcp_pred_mode0_index,用于确定帧内加权组合预测模式的亮度块的第一帧内预测模式IwcpPredMode0。
帧内加权组合预测模式中的第二模式索引iwcp_pred_mode1_index,用于确定帧内加权组合预测模式的亮度块的第二帧内预测模式IwcpPredMode1
进一步地,在确定第一帧内预测模式和第二帧内预测模式以后,基于上述实施例中步骤105提出的方法,可以在根据IwcpPredMode0确定第一帧内亮度预测样本矩阵predMatrixY0,根据IwcpPredMode1确定第二帧内亮度预测样本矩阵predMatrixY1,并根据IwcpIndex确定亮度权重矩阵IwcpWeightMatrixY之后,利用亮度权重矩阵IwcpWeightMatrixY对第一帧内亮度预测样本矩阵predMatrixY0和第二帧内亮度预测样本矩阵predMatrixY1进行加权运算,最终确定亮度预测样本矩阵predMatrixIwcpY。
具体地,在根据两个帧内亮度预测样本矩阵predMatrixY0、predMatrixY1以及权重矩阵IwcpWeightMatrixY确定IWCP的亮度预测样本矩阵predMatrixIwcpY时。具体方法如下:
帧内加权组合预测模式的预测样本矩阵predMatrixIwcpY中的元素predMatrixIwcpY[x][y]的值是((predMatrixY0[x][y]*IwcpWeightMatrixY[x][y]+predMatrixY1[x][y]*(8-IwcpWeightMatrixY[x][y])+4)>>3)。其中(x,y)是当前块的内的坐标位置。
进一步地,在确定了IWCP的预测块,即帧内加权组合预测模式的预测样本矩阵predMatrixIwcpY后,后续的处理还可以包括量化系数的解码,反变换、反量化确定残差块,以及残差块和预测块组合成重建块,以及后续的环路滤波等。
本申请实施例提供一种帧内预测方法,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
本申请的一实施例提出了一种帧内预测方法,应用于编码器,图9为帧内预测方法的实现流程示意图二,如图11所示,编码器进行帧内预测的方法可以包括以下步骤:
步骤201、当当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式。
在本申请的实施例中,如果确定当前块使用IWCP模式确定当前块的帧内预测值,那么编码器可以先确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式。
需要说明的是,在本申请的实施例中,IWCP模式为一种帧内预测方法,具体地,IWCP模式为对当前块确定两个不同的帧内角度预测模式,然后分别根据这两个不同的帧内角度预测模式确定出两个预测块,接着可以确定一个权重矩阵,将这两个预测块依据权重矩阵进行组合,最终便可以得到新的预测块,即获得当前块的预测块。
进一步地,在本申请的实施例中,在应用IWCP模式时,可以对当前块的尺寸进行限制。
可以理解的是,由于本申请实施例提出的帧内预测方法需要分别使用两个不同的帧内角度预测模式生成两个预测块,再根据权重矩阵进行加权得到新的预测块,为了降低的复杂度,同时考虑压缩性能和复杂度的权衡,在本申请的实施例中,可以限制对一些大小的预测块不使用该IWCP模式。因此,在本申请中,编码器可以先确定当前块的尺寸参数,然后根据尺寸参数确定当前块是否使用IWCP模式。
需要说明的是,在本申请的实施例中,当前块的尺寸参数可以包括当前块的高度和宽度,因此,编码器可以利用当前块的高度和宽度对使用IWCP模式进行限制,即限制能够使用IWCP模式的预测块的尺寸。
示例性的,在本申请中,若宽度和高度均大于等于第一下限值,同时,宽度和高度均小于或等于第一上限值,那么便可以确定当前块使用IWCP模式。可见,一种可能的限制是仅仅在预测块的宽度和高度小于(或小于等于)第一上限值,且预测块的宽度和高度大于(或大于等于)第一下限值的情况下使用IWCP模式。其中,第一下限值可以是8,第一上限值的值可以是16或32等。
示例性的,对于YUV4:2:0格式的编码,亮度的8×8的块对应相同位置的色度的4×4的块,一种可能的方法是允许亮度的8×8的块使用IWCP模式但禁止色度的4×4的块使用IWCP模式。因为4×4的块进行IWCP模式的预测效果提升并不明显,另一方面增加了硬件的实现代价。
示例性的,在本申请中,可以有一个帧级的标志来确定当前待解码帧是否使用IWCP模式。如可以配置帧内帧(如I帧)使用IWCP模式,帧间帧(如B帧、P帧)不使用IWCP模式。或者可以配置帧内帧不使用IWCP模式,帧间帧使用IWCP模式。或者可以配置某些帧间帧使用IWCP模式,某些帧间帧不使用IWCP模式。帧间帧也可以使用帧内预测,因而帧间帧也有可能使用IWCP模式。
示例性的,在本申请中,可以有一个帧级以下、CU级以上(如tile、slice、patch、LCU等)的标志来确定这一区域是否使用IWCP模式。
可以理解的是,在本申请的实施例中,编码器可以确定出最小率失真化的帧内预测模式与权重矩阵导出模式的组合,其中,该组合包括有第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式。
进一步地,在本申请的实施例中,第一帧内预测模式和第二帧内预测模式可以为两个不同的帧内角度预测模式。具体地,在本申请的实施例中,第一帧内预测模式和第二帧内预测模式可以分别为预设角度预测模式集合中的两个不同的帧内角度预测模式。
也就是说,在本申请中,第一帧内预测模式和第二帧内预测模式都只能为帧内角度预测模式,即第一帧内预测模式和第二帧内预测模式均不为除帧内角度预测模式以外的其他基本帧内预测模式,如帧内非角度预测模式,包括DC模式、Planar模式、PLANE模式、Bilinear模式、PCM模式等。其中,基本帧内预测模式包括但不限于角度预测模式和非角度预测模式。如VVC所使用的67种帧内预测模式,AVS3所使用的66种帧内预测模式。
可以理解的是,在本申请中,对第一帧内预测模式和第二帧内预测模式进行帧内角度预测模式的限制,一方面可以降低帧内加权组合预测模式的硬件实现复杂度,因为硬件以并行的方式实现帧内加权组合预测模式时只需要新增一组支持帧内角度加权预测的电路;另一方面是因为帧内加权组合预测模式本身适用的块内容相对复杂,而帧内非角度预测模式通常应对纹理变化比较均匀的场景,而且可使用的模式少了还可以减少开销,因而帧内加权组合预测模式使用或不使用帧内非角度预测模式对压缩性能几乎没有影响。
进一步地,在本申请中,虽然可使用的帧内角度预测模式越多,可以准确性更高的预测值,但是相应地在码流中传输所选模式的标志的开销也越大,因此,为了获得更好的压缩性能,可以选择一个合理的可用的帧内预测模式集合来实现预测效果和开销之间的更好的权衡。具体地,编码器可以使用预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式可用的帧内角度预测模式进行限制,其中,预设角度预测模式集合是所有帧内角度预测模式的一个子集。以AVS3为例,AVS3有62种角度模式,即模式号为3-32、34-65的帧内角度预测模式。
示例性的,在本申请中,第一帧内预测模式和第二帧内预测模式可仅使用模式号为3-32的帧内角度预测模式,或者,第一帧内预测模式和第二帧内预测模式可仅使用模式号为4-31的28个帧内角度预测模式。
示例性的,在本申请中,以VVC为例,第一帧内预测模式和第二帧内预测模式可仅使用模式号为偶数的帧内角度预测模式,或者,第一帧内预测模式和第二帧内预测模式可仅使用模式号为奇数的帧内角度预测模式。
示例性的,在本申请中,第一帧内预测模式使用的角度预测模式集合和第二帧内预测模式使用的角度预测模式集合不相同。可选地,解码器可以使用相同的预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式进行限制,即如果第一个帧内预测模式仅可使用模式号为4-31的28个帧内角度预测模式,第二个帧内预测模式也可仅使 用模式号为4-31的28个帧内角度预测模式,进而第一帧内预测模式和第二帧内预测模式可以使用相同的MPM列表,并使用相同或相近的编解码方法。也就是说,如果解码器使用不同的预设角度预测模式集合对第一帧内预测模式和第二帧内预测模式进行限制,那么需要对第一帧内预测模式和第二帧内预测模式需要使用不同的MPM列表或使用差别明显的编解码方法。
步骤202、构建当前块的MPM列表。
在本申请的实施例中,编码器还可以构建当前块的MPM列表。其中,MPM列表中的预测模式均为帧内角度预测模式。
进一步地,在本申请的实施例中,编码器在构建当前块的MPM列表时,需要先确定当前块的权重矩阵导出模式,然后利用权重矩阵导出模式进一步确定当前块的MPM列表。
需要说明的是,在本申请中,权重矩阵导出模式用于对当前块使用的权重矩阵进行确定。具体地,权重矩阵导出模式可以是导出权重矩阵的模式。对于一个给定长度和宽度的预测块,每一种权重矩阵导出模式可以导出一个权重矩阵;对于同样大小的预测块,不同权重矩阵导出模式导出的权重矩阵不同。
示例性的,在本申请中,AVS3的AWP有56种权重矩阵导出模式,VVC的GPM有64种权重矩阵导出模式。
可选地,在本申请中,解码器在构建当前块的MPM列表时,可以直接基于当前块的相邻块的预测模式和权重矩阵导出模式,构建MPM列表。
可选地,在本申请中,编码器在构建当前块的MPM列表时,也可以基于当前块的相邻块的预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表。其中,预设角度预测模式集合可以为所有帧内角度预测模式的一个子集。以AVS3为例,预设角度预测模式集合可以仅包括模式号为4-31的28个帧内角度预测模式。
可以理解的是,在本申请中,如果不对第一帧内预测模式和第二帧内预测模式的范围进行限制,那么预设角度预测模式集合可以是所有帧内角度预测模式的组合;如果需要对第一帧内预测模式和第二帧内预测模式的范围进行限制,那么预设角度预测模式集合可以仅为部分帧内角度预测模式的组合,此时预设角度预测模式集合便可以用于对限制第一帧内预测模式和第二帧内预测模式的范围,从而有效地降低开销,提高压缩性能。
可选地,在本申请中,编码器在基于所述当前块的相邻块的帧内预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表时,可以先利用所述相邻块的预测模式确定第一候选模式;同时利用所述权重矩阵导出模式确定第二候选模式;然后可以进一步根据所述第一候选模式、所述第二候选模式以及所述预设角度预测模式集合,构建当前块的MPM列表。
具体地,在本申请中,编码器在利用所述相邻块的预测模式确定第一候选模式时,若所述相邻块为普通帧内预测块,且所述相邻块的预测模式为帧内预测模式,则将所述相邻块的预测模式确定为第一候选模式。
可以理解的是,在本申请中,普通帧内预测块表示使用DC模式、Planar模式、Bilinear模式、角度预测模式等预测模式的预测块,而不是使用IBC模式、串复制帧内预测intra string copy prediction等预测模式的预测块。
具体地,在本申请中,编码器在利用所述权重矩阵导出模式确定第二候选模式时,可以先根据所述权重矩阵导出模式确定分界线角度索引值;然后可以利用所述分界线角度索引值确定所述第二候选模式。
需要说明的是,在本申请的实施例中,可以确定第二候选模式为L个不同的帧内角度预测模式,从而可以保证长度为L的MPM列表的构建。
进一步地,在本申请的实施例中,在权重矩阵包括有两种权重的情况下,权重变化的位置构成一条直线,或者,在权重矩阵有多种权重的情况下,过渡区域中权重相同的位置构成一条直线,可以将这条直线叫做分界线。可以设水平向右的角度为0,角度逆时针增加。那么分界线可能有水平0度,竖直90度,倾斜的如45度,135度,以及其他各种不同的角度等。如果一个预测块选择使用某一个权重矩阵,那么对应的纹理很可能在分界线两边显现出不同的特性,比如分界线两边是两种不同角度的纹理,或者,分界线的一边是一种角度的纹理,而另一边是一种比较平坦的纹理。由于分界线本身也是有角度的,因此可以假设一个点经过帧内角度预测得到的,它可能与当前块的某些纹理是接近的,因而这条直线与当前块的两个帧内预测模式是存在相关性的。
具体地,在本申请中,假设分界线是由一个点经过帧内角度预测得到的,那么可以找到至少一个帧内角度预测模式,这个帧内角度预测模式可以近似地做出分界线。例如,水平方向的分界线就匹配水平帧内预测模式,如在AVS3中的模式24;竖直方向的分界线就匹配竖直帧内预测模式,如在AVS3中的模式12;45度的分界线可以匹配左下到右上45度的帧内预测模式,如AVS3中的模式30;也可以匹配右上到左下225度的帧内预测模式,如AVS3中的模式6。如果一个权重矩阵中只有一个权重值,它可以匹配DC模式、Planar模式、Bilinear模式等没有明显角度的模式。由此可见,权重矩阵导出模式就可以匹配到某些帧内预测模式,因此可以利用权重矩阵导出模式辅助帧内预测模式的解码。
需要说明的是,在本申请中,权重矩阵导出模式也可以为权重矩阵的索引,如AWP的56种模式就可以认为是56种权重矩阵导出模式。
示例性的,在本申请中,可以构建一个映射关系表来进一步表示权重矩阵导出模式与帧内角度预测模式之间的映射关系。具体地,AWP和GPM的多个模式的分界线都是同一个角度,比如AVS3的AWP每隔8个模式分界线角度是相同的。56种AWP模式共有8种分界线的角度。分界线角度的索引可以由权重矩阵导出模式的模式号模8(%8)得到。例如,上述表1为映射关系表,以AVS3的角度模式为例,分界线角度的索引0和1分别可以对应到两个帧内角度预测模式,一个从右上角到左下角,一个从左上角到右下角。具体实现时,可以为其他分界线角度的索引也找到另一个近似对应的帧内角度预测模式,或者所有的分界线角度的索引都只对应一种帧内角度预测模式。
对一种权重矩阵来说,除了与其分界线对应的帧内角度预测模式使用的可能性高之外,和它相关的某些帧内角度预测模式使用的可能性也较高。比如说与这个分界线相近的角度,或这个分界线垂直的角度等对应的帧内角度预测模式。编码器可以利用权重矩阵与帧内角度预测模式的相关性来构建帧内加权组合预测模式的MPM列表。例如, 在构建帧内加权组合预测模式的MPM列表时,如果MPM列表的列表长度为4,那么可以将如上述表2中的分界线角度索引对应的候选模式加入MPM列表。
可以理解的是,基于上述表2,每个分界线角度的索引对应的候选模式个数与MPM列表的长度相等可以保证即使参考的相邻块的帧内预测模式全都不可用的情况下也能填满MPM列表。如MPM列表长度是4,就可以设每个分界线角度的索引对应的候选模式个数为4。
进一步地,在本申请中,编码器在根据所述第一候选模式、第二候选模式以及所述预设角度预测模式集合,构建所述MPM列表时,还可以基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式;根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表。
具体地,在本申请中,编码器在基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式时,若所述第一候选模式属于所述预设角度预测模式集合,则将所述第一候选模式确定为所述筛选后候选模式;若所述第一候选模式为帧内角度预测模式且不属于所述预设角度预测模式集合,则在所述预设角度预测模式集合中确定所述第一候选模式的替换模式,并将所述替换模式确定为所述筛选后候选模式。
进一步地,在本申请中,如果第一候选模式不为帧内角度预测模式,那么编码器可以直接删除第一候选模式。
可以理解的是,在本申请中,由于第一帧内预测模式和第二帧内预测模式所属于的预设角度预测模式集合是所有帧内角度预测模式的一个子集,而不包括帧内非角度预测模式,因此,对于帧内加权组合预测模式,当前块的最可能模式MPM的选择,即MPM列表的构建方法也需要做相应的调整。具体地,编码器在构建MPM列表时需要参考当前块周边的相邻块的帧内预测模式。周边的相邻块如左相邻块,上相邻块,左上相邻块,右上相邻块,左下相邻块等。由于空间上的相关性,周边的相邻块使用了某种预测模式,当前块就有较高的概率使用相同或相近的预测模式。
可选地,由于帧内加权组合预测模式的第一帧内预测模式和第二帧内预测模式都只能为帧内角度预测模式,因此,当某一个参考的相邻块使用的帧内预测模式是帧内非角度预测模式,即第一候选模式为不为帧内角度预测模式,那么编码器在构建当前块的MPM列表时就不使用这个参考块所使用的帧内非角度预测模式,即不将该帧内非角度预测模式加入到当前块的MPM列表。
可选地,由于第一帧内预测模式和第二帧内预测模式所属于的预设角度预测模式集合是所有帧内角度预测模式的一个子集,因此,当某一个参考的相邻块使用的帧内预测模式是该预设角度预测模式集合之外的帧内角度预测模式,即第一候选模式为帧内角度预测模式且不属于预设角度预测模式集合,那么编码器在构建当前块的MPM列表时可以将该预设角度预测模式集合外的帧内角度预测模式转化为角度相近的、预设角度预测模式集合内的帧内角度预测模式,然后再加入MPM列表。以AVS3为例,如果预设角度预测模式集合限制第一帧内预测模式和第二帧内预测模式仅可使用4-31号的帧内角度预测模式,而当前块的相邻块使用了43号帧内角度预测模式,那么编码器可以将与43号帧内角度预测相近的12号帧内角度预测加入到当前块在帧内加权组合预测模式下的MPM列表中。
进一步地,在本申请的实施例中,编码器在根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表时,若所述筛选后候选模式满足预设添加条件,则将所述筛选后候选模式添加至所述MPM列表;若所述MPM列表不满足预设列表长度L,且所述第二候选模式满足所述预设添加条件,则将所述第二候选模式添加至所述MPM列表;其中,L为大于等于1的整数。
示例性的,在本申请中,L的取值可以为4,即MPM列表的预设列表长度为4,或者说,MPM列表中包括由4个最可能模式。
可以理解的是,在本申请的实施例中,编码器可以按照模式号由小到大的顺序对所述MPM列表中的L个模式进行排序。
需要说明的是,在本申请的实施例中,如果筛选后候选模式与所述MPM列表中的预测模式均不相同,那么编码器可以确定所述筛选后候选模式满足所述预设添加条件;相应地,如果第二候选模式与所述MPM列表中的预测模式均不相同,那么编码器可以确定所述第二候选模式满足所述预设添加条件。
可以理解的是,在本申请的实施例中,编码器在将相邻块对应的筛选后候选模式添加至MPM列表时,确定相邻块对应的顺序参数;按照顺序参数,依次将相邻块对应的帧内筛选后候选模式添加至MPM列表。其中,编码器可以按照相邻块与当前块之间的空间距离来确定对应的顺序参数,例如,相邻块与当前块之间的空间距离越近,两者的相关性越强,越先进行添加处理,即顺序参数就越小;相邻块与当前块之间的空间距离越远,两者的相关性越弱,越后进行添加处理,即顺序参数就越大。
进一步地,在本申请的实施例中,编码器在将筛选后候选模式和/或第二候选模式添加至MPM列表之后,还可以按照模式号由小到大的顺序对所述MPM列表中的L个预测模式进行排序处理。
示例性的,在本申请中,假设当前块在帧内加权组合预测模式下的MPM列表为IwcpMpm[4],即MPM列表的列表长度为4,权重矩阵导出模式的索引为IwcpIndex,权重矩阵导出模式复用AWP的56种导出模式,第一帧内预测模式和第二帧内预测模式所属的预设角度预测模式集合为4-31号的帧内角度预测模式。那么编码器在构建当前块的MPM列表时,可以依次执行以下步骤:
步骤S1、设数组cand_mode[10],cand_mode的所有值初始化为无效值。对cand_mode执行如下操作:
(a)如果相邻块F“存在”且为普通帧内预测块,cand_mode[0]等于F的帧内预测模式,
(b)如果相邻块G“存在”且为普通帧内预测块,cand_mode[1]等于G的帧内预测模式,
(c)如果相邻块C“存在”且为普通帧内预测块,cand_mode[2]等于C的帧内预测模式,
(d)如果相邻块A“存在”且为普通帧内预测块,cand_mode[3]等于A的帧内预测模式,
(e)如果相邻块B“存在”且为普通帧内预测块,cand_mode[4]等于B的帧内预测模式,
(f)如果相邻块D“存在”且为普通帧内预测块,cand_mode[5]等于D的帧内预测模式,
(g)cand_mode[6]等于IwcpIndex%8对应的候选模式0,
(h)cand_mode[7]等于IwcpIndex%8对应的候选模式1,
(i)cand_mode[8]等于IwcpIndex%8对应的候选模式2,
(j)cand_mode[9]等于IwcpIndex%8对应的候选模式3,
其中,相邻块X(X为A、B、C、D、F或G)“存在”指该块应在图像内并且该块应与块E属于同一片;否则相邻块“不存在”。如果块“不存在”或者尚未解码,则此块“不可用”;否则此块“可用”。如果图像样本所在的块“不存在”或者此样本尚未解码,则此样本“不可用”;否则此样本“可用”。
可以理解的是,在本申请中,上述(a)至(f)的执行步骤即为第一候选模式的确定流程;上述(g)至(j)的执行步骤即为第二候选模式的确定流程,其中,编码器可以参照上述表2进行第二候选模式的确定。
步骤S2、对i从0到5,执行如下操作:
(a)如果cand_mode[i]小于3或cand_mode[i]等于33,cand_mode[i]设为无效值,
也就是说,如果第一候选模式为帧内非角度预测模式,那么编码器可以直接删除第一候选模式,即不使用第一候选模式。
(b)否则如果cand_mode[i]等于3,令cand_mode[i]等于4,
(c)否则如果cand_mode[i]等于32,令cand_mode[i]等于31,
(d)否则如果cand_mode[i]大于33,执行如下操作:
如果cand_mode[i]小于44,令cand_mode[i]等于cand_mode[i]-30,
否则如果cand_mode[i]小于58,令cand_mode[i]等于cand_mode[i]-33,
否则,令cand_mode[i]等于cand_mode[i]-34,
也就是说,如果第一候选模式为帧内角度预测模式,但是第一候选模式不属于预设角度预测模式集合,那么编码器可以在预设角度预测模式集合中选择一个相近的帧内角度预测模式作为第一候选模式的替换模式,然后将该替换模式作为筛选后候选模式。
(e)否则不修改cand_mode[i]的值,
也就是说,如果第一候选模式属于预设角度预测模式集合,那么编码器便可以直接使用第一候选模式,即第一候选模式即为筛选后候选模式。
可以理解的是,在本申请中,上述步骤S2即为第一候选模式的筛选流程,最终确定出对第一候选模式对应的筛选后候选模式。
步骤S3、记mpm_num为0,对i从0到9,执行如下操作:
(a)如果cand_mode[i]不是无效值,则执行如下操作:
将cand_mode[i]与IwcpMpm[j]比较,其中j为从0到mpm_num-1,如果cand_mode[i]与IwcpMpm[j]都不相等,执行如下操作:
1、令IwcpMpm[mpm_num]等于cand_mode[i],
2、令mpm_num等于mpm_num+1,
3、如果mpm_num等于4,则结束步骤3。
也就是说,在MPM列表中的预测模式还不足4个的前提下,如果筛选后候选模式与MPM列表中的任意一个预测模式不相同,那么编码器便可以将筛选后候选模式添加至MPM列表;如果在全部符合预设添加条件的筛选后候选模式添加至MPM列表之后,MPM列表中的预测模式还不足4,那么编码器可以继续将满足预设添加条件的第二候选模式添加至MPM列表,直到MPM列表的列表长度达到4。
步骤S4、对IwcpMpm[4]的4个数按由小到大排序。
最后,编码器可以对MPM列表中的4个帧内角度预测模式按照模式号的由小到大的顺序进行排序。
可以理解的是,本申请不对上述步骤202和步骤203的执行顺序进行限制,即不限制第一帧内预测模式和第二帧内预测模式的确定流程和MPM列表的构建流程之间的先后顺序。
步骤203、根据第一帧内预测模式、第二帧内预测模式以及MPM列表确定当前块的第一模式索引和第二模式索引。
在本申请的实施例中,编码器在确定出当前块的第一帧内预测模式和第二帧内预测模式,同时完成当前块的MPM列表的构建之后,可以进一步根据第一帧内预测模式、第二帧内预测模式以及MPM列表确定出当前块的第一模式索引和第二模式索引。
可以理解的是,在本申请的实施例中,第一模式索引可以用于对当前块使用的第一帧内预测模式进行指示,第二模式索引可以用于对当前块的第二帧内预测模式进行指示。
具体地,第一模式索引的值和第二模式索引的值是与第一帧内预测模式和第二帧内预测模式可能存在的帧内角度预测模式的数量相关的,例如,第一帧内预测模式和第二帧内预测模式可能分别为模式号为4-31的28种帧内角度预测模式中的一种,那么第一模式索引的值和第二模式索引的值均属于范围0~27。
示例性的,在本申请的实施例中,可以使用参数iwcp_pred_mode0_index表示第一模式索引,同时使用参数iwcp_pred_mode1_index表示第二模式索引。
进一步地,在本申请的实施例中,编码器可以确定索引值与二元符号串的第一映射关系表;其中,第一映射关系表中分别包括第一长度、第二长度以及第三长度的二元符号串。
示例性的,在本申请中,第一长度为3比特,第二长度为5比特,第三长度为6比特。
需要说明的是,在本申请中,索引值与二元符号串的第一映射关系表可以用于对第一模式索引和第二模式索引的值进行确定。
可选地,在本申请中,对于AVS3,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么可以使用4+8+16的形式编码,即4个最短的码字的模式,8个较短码字的模式,16个较长码字的模式。其中,4个最短的码字的模式使用3bit的码字,即使用第一长度,8个较短码字的模式使用5bit的码字,即使用第二长度,16个较长码字的模式使用6bit的码字,即使用第三长度。
需要说明的是,在本申请中,使用模式号为4-31的28个帧内角度预测模式的预测角度基本上覆盖了整个常用的角度范围,同时,模式号为4-31帧内角度预测模式比模式号为34-65的帧内角度预测模式更加简单,且使用这28个模式以4+8+16的形式编码不会造成码字浪费,因此编码器可以优选地按照模式号为4-31的28个帧内角度预测模式定义预设角度预测模式集合。
进一步地,在本申请的实施例中,如果当前块的MPM列表的列表长度为4,那么MPM列表中的4个最可能模式可以对应使用第一长度的二元符号串,即4个最短码字的模式可以给MPM列表中的4个MPM使用;相应地,预设角度预测模式集合中、MPM列表以外的其他预测模式可以分别使用第二长度的二元符号串和第三长度的二元符号串。
可选地,在本申请中,对于预设角度预测模式集合中的、MPM列表中4个MPM以外的其他24个帧内角度预测模式,编码器可以对较短码字的模式和较长码字的模式进行均匀分布。具体地,编码器可以将8个较短码字(第二长度的二元符号串)的模式均匀分布在这剩余的24个帧内角度预测模式中。例如,每隔2个较长码字(第三长度的二元符号串)的模式使用1个较短码字(第二长度的二元符号串)的模式。进而在具体执行过程中,可以通过对剩余的24个帧内角度预测模式中的从0-23的序号模3(%3)来实现,例如序号模3余2的模式使用5bit码字,即使用第二长度的二元符号串,序号模3余0或1使用6bit码字,即使用第三长度的二元符号串。
示例性的,在本申请中,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么索引值与二元符号串的第一映射关系表可以如上述表3所示,其中,第一长度为3比特,第二长度为5比特,第三长度为6比特。
其中,可以以第一个比特位表示是否是MPM,比如“1”表示是MPM,“0”表示不是MPM。如果第一帧内预测模式是MPM,假设MPM列表中包括有4个MPM,那么可以使用2个比特位表示使用MPM列表中的哪一个MPM,即“00,01,10,11”分别表示MPM列表中的第一个MPM,第二个MPM,第三个MPM,第四个MPM。
进一步地,在本申请中,对比特标志为0的二元符号串使用上下文模型进行编码,对比特标志不为0的二元符号串不使用上下文模型进行编码。其中,比特标志的取值可以表示已经编码了多少个bit,比特标志可以用binIdx表示。
需要说明的是,在本申请中,对于编码侧,在根据表3进行二值化时,可以对binIdx为0的二元符号串使用上下文模型进行编码,而binIdx不为0的二元符号串使用等概率模型或者旁路模式bypass进行编码。
进一步地,在本申请中,编码器在根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引时,若所述第一帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第一模式索引的值i进行赋值;若所述第一帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第一模式索引的值i;根据所述第一映射关系表和i确定所述第一模式索引。其中,m为大于等于0且小于L的整数。
也就是说,在本申请中,如果第一帧内预测模式的模式号与MPM列表中的一个模式的模式号相同,那么就可以直接将第一模式索引的值i设定为该最可能模式的顺序m。例如,如果第一帧内预测模式与MPM列表中的第二个模式相同,那么就设置i=2。
具体地,在本申请中,编码器在利用所述MPM列表确定所述第一模式索引的值i时,若所述第一帧内预测模式的模式号大于等于所述MPM列表中的第四个模式的模式号,则按照所述所述第一帧内预测模式的模式号与4的差值对i进行赋值;若所述第一帧内预测模式的模式号小于所述MPM列表中的第四个模式的模式号,且大于等于所述MPM列表中的第三个模式的模式号,则按照所述所述第一帧内预测模式的模式号与3的差值对i进行赋值;若所述第一帧内预测模式的模式号小于所述MPM列表中的第三个模式的模式号,且大于等于所述MPM列表中的第二个模式的模式号,则按照所述所述第一帧内预测模式的模式号与2的差值对i进行赋值;若所述第一帧内预测模式的模式号小于所述MPM列表中的第二个模式的模式号,且大于等于所述MPM列表中的第一个模式的模式号,则按照所述所述第一帧内预测模式的模式号与1的差值对i进行赋值;若所述第一帧内预测模式的模式号小于所述MPM列表中的第一个模式的模式号,则按照所述所述第一帧内预测模式的模式号对i进行赋值。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,第一帧内预测模式的模式号为9,编码器可以将第一帧内预测模式的模式号分别与4个MPM的模式号进行相比,具体地,9大于第二个MPM的模式号且小于第三个MPM的模式号,那么可以令第一模式索引的值i=9-2=7。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,第一帧内预测模式的模式号为15,编码器可以将第一帧内预测模式的模式号分别与4个MPM的模式号进行相比,具体地,15大于第三个MPM的模式号且小于第四个MPM的模式号,那么可以令第一模式索引的值i=15-3=12。
可以理解的是,在本申请中,编码器在确定出第一帧内预测模式对应的第一模式索引的值i以后,便可以根据所述第一映射关系表和i确定出第一模式索引,具体地,编码器可以按照如上述表3所示的第一映射关系表对i进行二值化处理,确定所述第一模式索引。
进一步地,在本申请中,编码器在根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引时,若所述第二帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第一模式索引的值j进行赋值;若所述第二帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第一模式索引的值j;根据所述第一映射关系表 和j确定所述第二模式索引。其中,m为大于等于0且小于L的整数。
也就是说,在本申请中,如果第二帧内预测模式的模式号与MPM列表中的一个模式的模式号相同,那么就可以直接将第一模式索引的值j设定为该最可能模式的顺序m。例如,如果第二帧内预测模式与MPM列表中的第三个模式相同,那么就设置j=3。
具体地,在本申请中,编码器在利用所述MPM列表确定所述第一模式索引的值j时,若所述第二帧内预测模式的模式号大于等于所述MPM列表中的第四个模式的模式号,则按照所述所述第二帧内预测模式的模式号与4的差值对j进行赋值;若所述第二帧内预测模式的模式号小于所述MPM列表中的第四个模式的模式号,且大于等于所述MPM列表中的第三个模式的模式号,则按照所述所述第二帧内预测模式的模式号与3的差值对j进行赋值;若所述第二帧内预测模式的模式号小于所述MPM列表中的第三个模式的模式号,且大于等于所述MPM列表中的第二个模式的模式号,则按照所述所述第二帧内预测模式的模式号与2的差值对j进行赋值;若所述第二帧内预测模式的模式号小于所述MPM列表中的第二个模式的模式号,且大于等于所述MPM列表中的第一个模式的模式号,则按照所述所述第二帧内预测模式的模式号与1的差值对j进行赋值;若所述第二帧内预测模式的模式号小于所述MPM列表中的第一个模式的模式号,则按照所述所述第二帧内预测模式的模式号对j进行赋值。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,第二帧内预测模式的模式号为17,编码器可以将第二帧内预测模式的模式号分别与4个MPM的模式号进行相比,具体地,17大于第四个MPM的模式号,那么可以令第一模式索引的值j=17-4=13。
示例性的,在本申请中,如果MPM列表中的4个MPM的模式号分别为4、8、12、16,第二帧内预测模式的模式号为6,编码器可以将第二帧内预测模式的模式号分别与4个MPM的模式号进行相比,具体地,6大于第一个MPM的模式号且小于第二个MPM的模式号,那么可以令第一模式索引的值j=6-1=5。
可以理解的是,在本申请中,编码器在确定出第二帧内预测模式对应的第二模式索引的值j以后,便可以根据所述第一映射关系表和j确定出第二模式索引,具体地,编码器可以按照如上述表3所示的第一映射关系表对j进行二值化处理,确定所述第二模式索引。
示例性的,在本申请中,如果当前块使用IWCP模式,当前块的MPM列表的长度为4,即L=4,其中,MPM列表中的4个模式是按照模式号由小到大的顺序排列的,预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,编码器可以先确定第一帧内预测模式为IwcpPredMode0,第二帧内预测模式为IwcpPredMode1,进而可以根据第一帧内预测模式IwcpPredMode0,第二帧内预测模式IwcpPredMode1进一步确定第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index,其中,iwcp_pred_mode0_index和iwcp_pred_mode1_index的值的范围是0-27。
编码器在确定了当前块的帧内加权组合预测模式使用的第一帧内预测模式IwcpPredMode0之后,进行第一模式索引iwcp_pred_mode0_index的确定时,具体可以执行如下操作:
1、如果IwcpPredMode0等于IwcpMpm[m],其中,m大于等于0且小于4,那么iwcp_pred_mode0_index的值i等于m。
也就是说,如果第一帧内预测模式与MPM列表中的第m个MPM相同,那么可以直接使用m对i进行赋值,即i=m。
2、如果IwcpPredMode0不等于IwcpMpm[m],iwcp_pred_mode0_index的值i等于IwcpPredMode0<IwcpMpm[0]?IwcpPredMode0:IwcpPredMode0<IwcpMpm[1]?IwcpPredMode0-1:IwcpPredMode0<IwcpMpm[2]?IwcpPredMode0-2:IwcpPredMode0<IwcpMpm[3]?IwcpPredMode0-3:IwcpPredMode0–4。
3、按照表3对iwcp_pred_mode0_index的值i进行二值化处理,确定二元符号串形式的iwcp_pred_mode0_index。
具体地,在按照表3对iwcp_pred_mode0_index的值i二值化时,可以从表3左栏中确定与i相同的索引值,然后从同一行的右栏中确定二元符号串iwcp_pred_mode0_index。
相应地,编码器在确定了当前块的帧内加权组合预测模式使用的第二帧内预测模式IwcpPredMode1之后,进行第二模式索引iwcp_pred_mode1_index的确定时,具体可以执行如下操作:
1、如果IwcpPredMode1等于IwcpMpm[m],其中,m大于等于0且小于4,那么iwcp_pred_mode1_index的值j等于m。
也就是说,如果第二帧内预测模式与MPM列表中的第m个MPM相同,那么可以直接使用m对j进行赋值,即i=m。
2、如果IwcpPredMode1不等于IwcpMpm[m],iwcp_pred_mode1_index的值j等于IwcpPredMode1<IwcpMpm[0]?IwcpPredMode1:IwcpPredMode1<IwcpMpm[1]?IwcpPredMode1-1:IwcpPredMode1<IwcpMpm[2]?IwcpPredMode1-2:IwcpPredMode1<IwcpMpm[3]?IwcpPredMode1-3:IwcpPredMode1–4。
3、按照表3对iwcp_pred_mode1_index的值j进行二值化处理,确定二元符号串形式的iwcp_pred_mode1_index。
具体地,在按照表3对iwcp_pred_mode1_index的值j二值化时,可以从表3左栏中确定与j相同的索引值,然后从同一行的右栏中确定二元符号串iwcp_pred_mode1_index。
进一步地,在本申请的实施例中,由于帧内加权组合预测模式需要使用第一帧内预测模式和第二帧内预测模式对当前块的预测值进行确定,其中,第一帧内预测模式和第二帧内预测模式可以共享一个预设角度预测模式集合,还可以共享同一个MPM列表,但是,帧内加权组合预测模式中第一帧内预测模式和第二帧内预测模式并不相同,因此,在进行第二帧内预测模式的编解码时,可以参考第一帧内预测模式,具体地,在确定第二帧内预测模式时,可以将第一帧内预测模式排除掉。
可以理解的是,在本申请中,对于28个帧内角度预测模式,由于在上述4+8+16的编解码方式中,MPM列表中的4个MPM出现的概率很高(第一帧内预测模式是MPM列表中的4个MPM其中之一的概率约有50%,第二帧内预测模式是MPM列表中的4个MPM其中之一的概率约有50%),如果第一帧内预测模式和第二帧内预测模式都是 MPM列表中的MPM,那么在确定第二帧内预测模式时,只能从MPM列表中的、第一帧内预测模式外的其他3个MPM中选择一个即可。这样从原来4选1,需要4个3bit的码字就可以变成3选1,需要1个2bit的码字和2个3bit的码字。相应地,如果第一帧内预测模式和第二帧内预测模式都不是MPM列表中的MPM,那么第二帧内预测模式也可以从8+16的24个帧内角度预测模式中去掉1个,但这样的影响就比较小了。
由此可见,对于第一帧内预测模式和第二帧内预测模式都是MPM列表中的MPM的情况,可以选择在进行第二帧内预测模式的确定时,先针对第一帧内预测模式执行删除处理,从而可以减少开销。
可选地,在本申请的实施例中,编码器在根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引时,若所述第二帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第一模式索引的值j进行赋值;若所述第二帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第一模式索引的值j;根据所述第一映射关系表、索引值与二元符号串的第二映射关系表以及j确定所述第二模式索引。
具体地,在本申请中,编码器在根据所述第一映射关系表、索引值与二元符号串的第二映射关系表以及j确定所述第二模式索引时,若i小于L且小于j,则在对j进行减1运算后,根据所述第二映射关系表对j进行二值化处理,确定所述第二模式索引;若j大于等于L,则根据所述第一映射关系表对j进行二值化处理,确定所述第二模式索引。
进一步地,在本申请的实施例中,编码器可以确定索引值与二元符号串的第二映射关系表;其中,第二映射关系表中分别包括第一长度、第二长度、第三长度以及第四长度的二元符号串。
示例性的,在本申请中,第一长度为3比特,第二长度为5比特,第三长度为6比特,第四长度为2比特。
需要说明的是,在本申请中,索引值与二元符号串的第二映射关系表仅用于对第二模式索引的值进行确定。
可选地,在本申请中,索引值与二元符号串的第二映射关系表可以如上述表4所示,其中,第一长度为3比特,第二长度为5比特,第三长度为6比特,第四长度为2比特。
需要说明的是,在本申请中,对于编码侧,在根据表4进行二值化时,可以对binIdx为0的二元符号串使用上下文模型进行编码,而binIdx不为0的二元符号串使用等概率模型或者旁路模式bypass进行编码。
示例性的,在本申请中,如果当前块使用IWCP模式,当前块的MPM列表的长度为4,即L=4,其中,MPM列表中的4个模式是按照模式号由小到大的顺序排列的,预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,编码器可以先确定第一帧内预测模式为IwcpPredMode0,第二帧内预测模式为IwcpPredMode1,进而可以根据第一帧内预测模式IwcpPredMode0,第二帧内预测模式IwcpPredMode1进一步确定第一模式索引iwcp_pred_mode0_index和第二模式索引iwcp_pred_mode1_index。
编码器在确定了当前块的帧内加权组合预测模式使用的第一帧内预测模式IwcpPredMode0之后,进行第一模式索引iwcp_pred_mode0_index的确定时,具体可以执行如下操作:
1、如果IwcpPredMode0等于IwcpMpm[m],其中,m大于等于0且小于4,那么iwcp_pred_mode0_index的值i等于m。
也就是说,如果第一帧内预测模式与MPM列表中的第m个MPM相同,那么可以直接使用m对i进行赋值,即i=m。
2、如果IwcpPredMode0不等于IwcpMpm[m],iwcp_pred_mode0_index的值i等于IwcpPredMode0<IwcpMpm[0]?IwcpPredMode0:IwcpPredMode0<IwcpMpm[1]?IwcpPredMode0-1:IwcpPredMode0<IwcpMpm[2]?IwcpPredMode0-2:IwcpPredMode0<IwcpMpm[3]?IwcpPredMode0-3:IwcpPredMode0–4。
3、按照表3对iwcp_pred_mode0_index的值i进行二值化处理,确定二元符号串形式的iwcp_pred_mode0_index。
具体地,在按照表3对iwcp_pred_mode0_index的值i二值化时,可以从表3左栏中确定与i相同的索引值,然后从同一行的右栏中确定二元符号串iwcp_pred_mode0_index。
相应地,如果根据第一帧内预测模式确定第二帧内预测模式,那么编码器在确定了当前块的帧内加权组合预测模式使用的第二帧内预测模式IwcpPredMode1之后,进行第二模式索引iwcp_pred_mode1_index的确定时,具体可以执行如下操作:
1、如果IwcpPredMode1等于IwcpMpm[m],其中,m大于等于0且小于4,那么iwcp_pred_mode1_index的值j等于m。
也就是说,如果第二帧内预测模式与MPM列表中的第m个MPM相同,那么可以直接使用m对j进行赋值,即i=m。
2、如果IwcpPredMode1不等于IwcpMpm[m],iwcp_pred_mode1_index的值j等于IwcpPredMode1<IwcpMpm[0]?IwcpPredMode1:IwcpPredMode1<IwcpMpm[1]?IwcpPredMode1-1:IwcpPredMode1<IwcpMpm[2]?IwcpPredMode1-2:IwcpPredMode1<IwcpMpm[3]?IwcpPredMode1-3:IwcpPredMode1–4。
3、如果iwcp_pred_mode0_index的值j小于4,那么,
a、如果iwcp_pred_mode1_index大于或等于iwcp_pred_mode0_index,iwcp_pred_mode1_index等于iwcp_pred_mode1_index–1
b、按照表4对iwcp_pred_mode1_index的值j进行二值化处理,确定二元符号串形式的iwcp_pred_mode1_index。。
4、如果iwcp_pred_mode0_index的值j大于等于4,那么,按照表3对iwcp_pred_mode1_index的值j进行二值化处理,确定二元符号串形式的iwcp_pred_mode1_index。
由此可见,如果需要基于第一帧内预测模式进行第二帧内预测模式的确定,那么iwcp_pred_mode1_index也是依赖于iwcp_pred_mode0_index的,具体地,以表4为例,如果第一帧内预测模式和第二帧内预测模式都是MPM列表中的MPM,那么第二帧内预测模式可用的MPM只有3种,进而可以用1到2个比特位表示是哪一个MPM,如“00,01,10”分别表示剩余的第一个MPM,第二个MPM,第三个MPM。可见,由于排除了一种可能,可以改变编解码 方法或者二值化或反二值化的方法以节省开销。
需要说明的是,在本申请的实施例中,如果预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式,MPM列表的长度为4,那么在使用第一长度、第二长度、第三长度的二元符号串确定索引值与二元符号串的第一映射关系表时,可以先对MPM列表中的4个MPM使用第一长度的二元符号串,即使用最短的码字。接着,再从剩余的24个帧内角度预测模式选择8个帧内角度预测模式使用第二长度的二元符号串,选择16个帧内角度预测模式使用第三长度的二元符号串。
具体地,在本申请中,对于剩余的24个帧内角度预测模式,可以按照模式号由小到大的顺序,对前8个模式号对应的预测模式使用较短的码字,即使用第二长度的二元符号串,然后对接下来的16个模式号对应的预测模式使用使用较长的码字,即使用第三长度的二元符号串。
示例性的,在本申请中,可以将上述表3所示的索引值与二元符号串的第一映射关系表替换为上述表5,其中,用于表征索引值与二元符号串的第一映射关系的表5也可以用于对第一模式索引和第二模式索引的值进行确定。
相应地,还可以将上述表4所示的索引值与二元符号串的第二映射关系表替换为上述表6,其中,用于表征索引值与二元符号串的第二映射关系的表6也可以用于对第二模式索引的值进行确定。
可以理解的是,在本申请中,如果使用模式号为4-31的28个帧内角度预测模式,即预设角度预测模式集合中共包括有28个模式,那么可以使用4+8+16的形式编码,即4个3bit的码字的模式,8个5bit的码字的模式,16个6bit的码字的模式。
可选地,在本申请中,如果预设角度预测模式集合中共包括有20个模式,那么可以使用4个3bit的码字和16个5bit的码字来表示。
可选地,在本申请中,如果预设角度预测模式集合中共包括有36个模式,那么可以使用4个3bit的码字和32个6bit的码字来表示。例如如AVS3中使用模式号为4-31、42-45以及56-59这36种帧内角度预测模式。
需要说明的是,在本申请中,如果对预设角度预测模式集合中所有的模式的表示都按照如表3、表4所示的一组二元符号串来进行表示,那么可以将“码字”理解为二元符号串。码字的长度可以理解为二元符号串的长度。另一种表示方法是用标志位(flag)加二元符号串。比如用一个二元的MPM_flag表示当前模式是否MPM模式,即如果MPM_flag为1表示当前模式是MPM模式,如果MPM_flag为0表示当前模式不是MPM模式,如果当前模式是MPM模式,MPM总共有4种可能,再用2bit的二元符号串来表示当前模式是哪一个MPM。那么码字可以理解为标志位加二元符号串,码字的长度可以理解为标志位加二元符号串的长度。
步骤204、将第一模式索引和第二模式索引写入码流。
在本申请的实施例中,编码器在确定出用于指示第一帧内预测模式的第一模式索引和用于指示第二帧内预测模式的第二模式索引,便可以将第一模式索引和第二模式索引写入码流中,传输至解码侧,以使解码器根据解码码流确定的第一模式索引和第二模式索引进行当前块的预测值的确定。
进一步地,在本申请的实施例中,编码器需要确定当前块的权重矩阵,从而在确定出当前块使用的第一帧内预测模式和第二帧内预测模式之后,还基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,进一步确定当前块的预测值。
可以理解的是,在本申请的实施例中,编码器在基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前块的预测值时,可以先根据第一帧内预测模式确定当前块的第一预测值;同时可以根据第二帧内预测模式确定当前块的第二预测值;然后可以利用权重矩阵对第一预测值和第二预测值进行加权运算,最终便可以获得当前块的预测值。
进一步地,在本申请的实施例中,编码器在确定当前块的预测值之后,还可以对当前块的真实值和预测值进行差值运算,获得两者之间的差值结果,从而可以确定出当前块的预测差值,即残差。
也就是说,在本申请中,编码器可以计算当前块的真实值与帧内预测值之间的差值,从而获得残差,且该残差经过变换、量化、熵编码写入码流,传输至解码侧。
具体地,在本申请中,编码器可以根据当前块的权重矩阵导出模式确定所述当前块的权重矩阵。
可以理解的是,在本申请中,第一帧内预测模式和第二帧内预测模式可以都是帧内角度预测模式,即本申请实施例使用两个不同的帧内角度预测模式。然后利用第一帧内预测模式和第二帧内预测模式组合,分别生成第一预测块和第二预测块,进而基于第一预测块和第二预测块,结合权重矩阵,确定当前块的预测块。
进一步地,在本申请的实施例中,所有可能的权重矩阵中并非每一个权重矩阵的所有的点的权重都相同。换句话说,至少有一个可能的权重矩阵中包含至少两个不同的权重值。
需要说明的是,在本申请的实施例中,编码器可以采用类似于GPM或AWP的方法来实现权重矩阵的确定。具体地,如果同一个编解码标准或编编码器中使用了GPM或AWP,那么可以使用该方法来确定权重矩阵,这样可以做到复用部分相同的逻辑。如AVS3帧间预测使用了AWP,那么在AVS3中可以使用AWP的方法来确定权重矩阵。当然也可以使用和同一个编解码标准或编编码器中的GPM或AWP不同方法,比如使用不同的模式数,或者不同的过渡区域算法,或者使用不同的参数等。因为帧间预测利用了时域上的相关性,它使用的是参考帧中已重建的图像作为参考块。而帧内预测利用了空域上的相关性,它使用的是当前块周边已重建的像素作为参考像素。空域上距离越近相关性越强,距离越远相关性越差。所以如果某种权重矩阵使得一个预测块使用的得到的像素位置都距离参考像素较远,那么这部分可能做不出比现有技术更合适的预测值,那么可以不使用这样的权重矩阵,而在帧间预测中可以使用。
本申请实施例提供一种帧内预测方法,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
基于上述实施例,在本申请的再一实施例中,编码器在确定当前块使用IWCP模式之后,还可以进一步确定当前块的帧内预测模式参数;其中,所述帧内预测模式参数用于判断所述当前块是否使用所述IWCP模式;然后可以将所述镇内预测模式参数写入所述码流。
需要说明的是,在本申请的实施中,帧内预测模式参数可以指示当前块是否可以使用IWCP模式,即指示当前块是否可以使用两种不同的帧内角度预测模式确定当前块的预测值。
可以理解的是,在本申请的实施例中,可以将帧内预测模式参数理解为一个表明是否使用了IWCP模式标志位。具体地,编码器解析码流,可以确定作为帧内预测模式参数的一个变量,从而可以通过该变量的取值来实现帧内预测模式参数的确定。
示例性的,在本申请中,如果当前块使用IWCP模式,那么编码器可以将帧内预测模式参数的取值设置为指示当前块使用IWCP模式,具体地,编码器可以将变量的取值设置为1。
示例性的,在本申请中,如果当前块不使用IWCP模式,那么编码器可以将帧内预测模式参数的取值设置为指示当前块不使用IWCP模式,具体地,编码器可以将变量取值设置为0。
进一步地,在本申请的实施例中,编码器在完成对帧内预测模式参数的设置之后,便可以将帧内预测模式参数写入码流中,传输至解码器,从而可以使解码器在解码码流之后获得帧内预测模式参数。
也就是说,在本申请的实施例中,在编码器侧,会针对当前块进行预测编码,在这过程中就可以确定出当前块的帧内预测模式参数,并将相应的帧内预测模式参数写入码流,由编码器传输到解码器。
可以理解的是,在本申请的实施例中,编码器在对当前块进行帧内预测之前,也可以先确定预测模式参数,然后可以通过预测模式参数来确定当前块的当前块的编码模式是具体哪一种编码模式。
在本申请的实施例中,进一步地,编码器在确定当前块的当前块的预测模式参数时,可以先利用多种不同的预测模式分别对当前块进行预测编码,然后计算多种预测模式下每一种预测模式对应的率失真代价结果;最后便可以从计算得到的多个率失真代价结果中选取最小率失真代价结果,并将最小率失真代价结果对应的预测模式确定为当前块的预测模式参数。
也就是说,在编码器侧,针对当前块可以采用多种预测模式分别对待预测图像分量进行编码。
进一步地,在本申请的实施例中,编码器在利用多种预测模式分别对当前块进行编码之后,可以得到每一种预测模式对应的率失真代价结果;然后从所得到的多个率失真代价结果中选取最小率失真代价结果,并将该最小率失真代价结果对应的预测模式确定为当前块的当前块的预测模式参数;如此,最终可以使用所确定的预测模式对当前块进行编码,而且在这种预测模式下,可以使得预测残差小,能够提高编解码效率。
在本申请的实施例中,进一步地,在编码端,当编码器对某一个预测块进行帧内预测的尝试时,也会尝试按照IWCP模式编码的代价。在尝试按照IWCP模式编码的代价时,会尝试全部或部分可能的情况的代价,然后选择代价最小的一个作为IWCP模式编码的代价。
需要说明的是,在本申请的实施例中,上述全部可能的情况,包括当前块的第一帧内预测模式为所有可能的预测模式,当前块的第二帧内预测模式为所有可能的测模式,权重矩阵导出模式为所有可能的模式这三个变化的组合。
可以理解的是,在本申请中,第一帧内预测模式与第二帧内预测模式时完全不同的两种帧内角度预测模式,编码器可以限制IWCP模式能够使用的帧内角度预测模式,以及限制IWCP模式能够使用的权重矩阵导出模式的个数,那么可能的情况也会相应减少,编码端的复杂度也相应降低。
示例性的,在本申请中,假设IWCP模式所有可用的帧内角度预测模式有66种,那么,第一帧内预测模式有66种可能,由于第二帧内预测模式与第一帧内预测模式不同,因此有65种可能,假设权重矩阵导出模式有56种(以AWP为例),那么本申请可能使用任意两种不同的帧内角度预测模式以及任意一种权重矩阵导出模式,共有66×65×56种可能。如果对可以使用的帧内角度预测模式进行限制,即限制预设角度预测模式集合中的模式范围,例如,限制预设角度预测模式集合仅仅包括模式号为4-31的28个帧内角度预测模式,那么,第一帧内预测模式有28种可能,由于第二帧内预测模式与第一帧内预测模式不相同,因此第二帧内预测模式有27种可能,假设权重矩阵导出模式有56种(以AWP为例),那么本申请可能使用任意两种不同的帧内角度预测模式以及任意一种权重矩阵导出模式,共有28×27×56种可能。
进一步地,在本申请的实施例中,编码器可以对所有的IWCP模式可能的情况进行率失真优化(Rate-Distortion Optimization,RDO),确定代价最小的一个组合,其中,每一个组合均为包括有第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式的组合。
可选地,为了减小RDO的耗时,可以先对上述所有的IWCP模式可能的情况进行初选,如使用SAD,和SATD等作为近似的代价进行初选,确定设定数量的候选第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式的组合,再进行RDO细选,确定代价最小的一个第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式的组合。从而可以在初选时使用一些快速算法减少尝试的次数,比如说一个帧内角度预测模式造成代价很大时,与它相邻的几个帧内预测模式都不再尝试等。
可以理解的是,在本申请中,在上述的初选和细选中,代价中可以包括编码第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式在码流中的开销的代价。也可以在初选的时候使用第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式在码流中的开销的估计的代价。如根据第一帧内预测模式或第二帧内预测模式是不是MPM估计其比特数,或者根据帧内预测模式的排序估计第一或第二帧内预测模式的比特数。在RDO中可以通过较为准确的试编码来获得其代价。该过程中需要用到本申请的构建MPM列表或者对帧内预测模式进行排序的方法。
可以理解的是,在本申请中,上述初选和细选时都会根据第一帧内预测模式确定第一预测块,根据第二帧内预测模式确定第二预测块,根据权重矩阵导出模式导出权重矩阵,根据第一预测块、第二预测块和权重矩阵确定本申请的预测块。SAD和SATD初选时使用当前块和预测块来确定SAD和SATD。
进一步地,在本申请的实施例中,编码器也可以先对当前块的纹理进行分析,比如使用梯度进行分析。利用分析的数据帮助初选。比如当前块的纹理中哪一个方向的纹理较强,上述初选时就多选择近似方向的帧内预测模式进行尝试。比如当前块的纹理中哪一个方向的纹理较弱,上述初选时就少选择或不选择近似方向的帧内预测模式进行尝试。
需要说明的是,在本申请中,按照IWCP模式编码的代价中包括第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式在码流中占用的码字的代价,预测残差进行变换量化熵编码等在码流中要传输的各种标志以及量化系数的代价,以及重建块的失真的代价等。
在确定按照IWCP模式编码的代价之后,如果按照IWCP模式编码的代价小于其他预测模式的代价,其中,其他预测模式可以包括其他帧内预测模式或帧间预测模式等,编码器会选择IWCP模式作为当前块的预测模式,否则会选择其他某种预测模式。
进一步地,在本申请的实施例中,编码器会尝试不同块划分的编码代价等。如果最终某一个预测块选择了了IWCP模式,那么可以将IWCP模式需要的标志位以及第一帧内预测模式、第二帧内预测模式、权重矩阵导出模式的信息按照语法(syntax)写入码流,同时将这个预测块按IWCP模式的方法进行预测以及后续的编码工作。
本申请实施例提供一种帧内预测方法,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
基于上述实施例,在本申请的再一实施例中,图10为本申请实施例提出的编码器的组成结构示意图一,如图10所示,本申请实施例提出的编码器300可以包括第一确定部分301,第一构建部分302,编码部分303,
所述第一确定部分301,配置为当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
所述第一构建部分302,配置为构建所述当前块的MPM列表;
所述第一确定部分301,还配置为根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
所述编码部分303,配置为将所述第一模式索引和所述第二模式索引写入码流。
图11为本申请实施例提出的编码器的组成结构示意图二,如图11所示,本申请实施例提出的编码器300还可以包括第一处理器304、存储有第一处理器304可执行指令的第一存储器305、第一通信接口306,和用于连接第一处理器304、第一存储器305以及第一通信接口306的第一总线307。
进一步地,在本申请的实施例中,上述第一处理器304,用于当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;构建所述当前块的MPM列表;根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;将所述第一模式索引和所述第二模式索引写入码流。
图12为本申请实施例提出的解码器的组成结构示意图一,如图12所示,本申请实施例提出的解码器400可以包括解码部分401,第二确定部分402,第二构建部分403,
所述解码部分401,配置为解码码流;
所述第二确定部分402,配置为确定当前块的帧内预测模式参数;当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
第二构建部分403,配置为构建所述当前块的最可能模式MPM列表;
所述第二确定部分402,还配置为根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
图13为本申请实施例提出的解码器的组成结构示意图二,如图13所示,本申请实施例提出的解码器400还可以包括第二处理器404、存储有第二处理器404可执行指令的第二存储器405、第二通信接口406,和用于连接第二处理器404、第二存储器405以及第二通信接口406的第二总线407。
进一步地,在本申请的实施例中,上述第二处理器404,用于解码码流,确定当前块的帧内预测模式参数;当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;构建所述当前块的最可能模式MPM列表;根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部 或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例提供了一种编码器和解码器,解码器解码码流,确定当前块的帧内预测模式参数;当帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一模式索引和第二模式索引;构建当前块的最可能模式MPM列表;根据第一模式索引、第二模式索引以及MPM列表确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前块的预测值。编码器当当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;构建当前块的MPM列表;根据第一帧内预测模式、第二帧内预测模式以及MPM列表确定当前块的第一模式索引和第二模式索引;将第一模式索引和第二模式索引写入码流。也就是说,在本申请的实施例中,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。
本申请实施例提供计算机可读存储介质和计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上述实施例所述的方法。
具体来讲,本实施例中的一种帧内预测方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种帧内预测方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
解码码流,确定当前块的帧内预测模式参数;
当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
构建所述当前块的最可能模式MPM列表;
根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
还包括如下步骤:
当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
构建所述当前块的MPM列表;
根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
将所述第一模式索引和所述第二模式索引写入码流。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。
工业实用性
本申请实施例提供了一种帧内预测方法、编码器、解码器以及存储介质,解码器解码码流,确定当前块的帧内预测模式参数;当帧内预测模式参数指示当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一模式索引和第二模式索引;构建当前块的最可能模式MPM列表;根据第一模式索引、第二模式索引以及MPM列表确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于第一帧内预测模式、第二帧内预测模式以及权重矩阵,确定当前块的预测值。编码器当当前块使用IWCP模式确定当前块的帧内预测值时,确定当前块的第一帧内预测模式和第二帧内预测模式;其中,第一帧内预测模式和第二帧内预测模式为两个不同的帧内角度预测模式;构建当前块的MPM列表;根据第一帧内预测模式、第二帧内预测模式以及MPM列表确定当前块的第一模式索引和第二模式索引;将第 一模式索引和第二模式索引写入码流。也就是说,在本申请的实施例中,编解码器可以通过两种不同的帧内角度预测模式确定当前块的两个不同的预测块,然后可以通过多样的权重矩阵进行组合,最终得到更复杂的预测块,在提高帧内预测的准确性的基础上,能够降低硬件实现代价,降低复杂度,实现简单高效的编解码方法,从而提升压缩性能。

Claims (76)

  1. 一种帧内预测方法,应用于解码器,所述方法包括:
    解码码流,确定当前块的帧内预测模式参数;
    当所述帧内预测模式参数指示所述当前块使用帧内加权组合预测IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
    构建所述当前块的最可能模式MPM列表;
    根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
    确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    确定所述当前块的权重矩阵导出模式。
  3. 根据权利要求2所述的方法,其中,所述构建所述当前块的MPM列表,包括:
    基于所述当前块的相邻块的预测模式和所述权重矩阵导出模式,构建所述MPM列表。
  4. 根据权利要求2所述的方法,其中,所述构建所述当前块的MPM列表,包括:
    基于所述当前块的相邻块的预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表。
  5. 根据权利要求4所述的方法,其中,所述基于所述当前块的相邻块的帧内预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表,包括:
    利用所述相邻块的预测模式确定第一候选模式;
    利用所述权重矩阵导出模式确定第二候选模式;
    根据所述第一候选模式、所述第二候选模式以及所述预设角度预测模式集合,构建所述MPM列表。
  6. 根据权利要求5所述的方法,其中,所述利用所述相邻块的预测模式确定第一候选模式,包括:
    若所述相邻块为普通帧内预测块,且所述相邻块的预测模式为帧内预测模式,则将所述相邻块的预测模式确定为第一候选模式。
  7. 根据权利要求5所述的方法,其中,所述利用所述权重矩阵导出模式确定第二候选模式,包括:
    根据所述权重矩阵导出模式确定分界线角度索引值;
    利用所述分界线角度索引值确定所述第二候选模式。
  8. 根据权利要求5所述的方法,其中,所述根据所述第一候选模式、所述第二候选模式以及所述预设角度预测模式集合,构建所述MPM列表,包括:
    基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式;
    根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表。
  9. 根据权利要求8所述的方法,其中,所述基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式,包括:
    若所述第一候选模式属于所述预设角度预测模式集合,则将所述第一候选模式确定为所述筛选后候选模式;
    若所述第一候选模式为帧内角度预测模式且不属于所述预设角度预测模式集合,则在所述预设角度预测模式集合中确定所述第一候选模式的替换模式,并将所述替换模式确定为所述筛选后候选模式。
  10. 根据权利要求8所述的方法,其中,所述方法还包括:
    若所述第一候选模式不为帧内角度预测模式,则删除所述第一候选模式。
  11. 根据权利要求8所述的方法,其中,所述根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表,包括:
    若所述筛选后候选模式满足预设添加条件,则将所述筛选后候选模式添加至所述MPM列表;
    若所述MPM列表不满足预设列表长度L,且所述第二候选模式满足所述预设添加条件,则将所述第二候选模式添加至所述MPM列表;其中,L为大于等于1的整数。
  12. 根据权利要求11所述的方法,其中,所述方法还包括:
    若所述筛选后候选模式与所述MPM列表中的预测模式均不相同,则确定所述筛选后候选模式满足所述预设添加条件;
    若所述第二候选模式与所述MPM列表中的预测模式均不相同,则确定所述第二候选模式满足所述预设添加条件。
  13. 根据权利要求11所述的方法,其中,所述方法还包括:
    确定所述相邻块对应的顺序参数;
    按照所述顺序参数,依次将所述筛选后候选模式添加至所述MPM列表。
  14. 根据权利要求11所述的方法,其中,所述方法还包括:
    按照模式号由小到大的顺序对所述MPM列表中的预测模式进行排序处理。
  15. 根据权利要求14所述的方法,其中,所述方法还包括:
    确定索引值与二元符号串的第一映射关系表;其中,所述第一映射关系表中分别包括第一长度、第二长度以及第三长度的二元符号串。
  16. 根据权利要求15所述的方法,其中,所述方法还包括:
    所述MPM列表中的预测模式使用所述第一长度的二元符号串;
    所述预设角度预测模式集合中、所述MPM列表以外的其他预测模式使用所述第二长度的二元符号串和所述第三 长度的二元符号串。
  17. 根据权利要求16所述的方法,其中,所述根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式,包括:
    根据所述第一映射关系表确定所述第一模式索引的值i;
    若i大于等于0且小于L,则将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式;
    若i大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式。
  18. 根据权利要求17所述的方法,其中,所述利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式,包括:
    若i大于等于所述MPM列表中的第一个模式的模式号,则对i和1进行求和运算;
    若(i+1)大于等于所述MPM列表中的第二个模式的模式号,则对(i+1)和1进行求和运算;
    若(i+2)大于等于所述MPM列表中的第三个模式的模式号,则对(i+2)和1进行求和运算;
    若(i+3)大于等于所述MPM列表中的第四个模式的模式号,则对(i+3)和1进行求和运算;
    将(i+4)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式。
  19. 根据权利要求18所述的方法,其中,所述方法还包括:
    若i小于所述MPM列表中的第一个模式的模式号,则将i确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,
    若(i+1)小于所述MPM列表中的第二个模式的模式号,则将(i+1)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,
    若(i+2)小于所述MPM列表中的第三个模式的模式号,则将(i+2)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式;或者,
    若(i+3)小于所述MPM列表中的第四个模式的模式号,则将(i+3)确定为所述第一帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第一帧内预测模式。
  20. 根据权利要求16所述的方法,其中,所述根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的第一帧内预测模式和第二帧内预测模式,包括:
    根据所述第一映射关系表确定所述第二模式索引的值j;
    若j大于等于0且小于L,则将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式;
    若j大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第一帧内预测模式。
  21. 根据权利要求20所述的方法,其中,所述利用所述预设角度预测模式集合和所述MPM列表确定所述第二帧内预测模式,包括:
    若j大于等于所述MPM列表中的第一个模式的模式号,则对j和1进行求和运算;
    若(j+1)大于等于所述MPM列表中的第二个模式的模式号,则对(j+1)和1进行求和运算;
    若(j+2)大于等于所述MPM列表中的第三个模式的模式号,则对(j+2)和1进行求和运算;
    若(j+3)大于等于所述MPM列表中的第四个模式的模式号,则对(j+3)和1进行求和运算;
    将(j+4)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式。
  22. 根据权利要求21所述的方法,其中,所述方法还包括:
    若j小于所述MPM列表中的第一个模式的模式号,则将j确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,
    若(j+1)小于所述MPM列表中的第二个模式的模式号,则将(j+1)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,
    若(j+2)小于所述MPM列表中的第三个模式的模式号,则将(j+2)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式;或者,
    若(j+3)小于所述MPM列表中的第四个模式的模式号,则将(j+3)确定为所述第二帧内预测模式的模式号,并在所述预设角度预测模式集合中确定所述第二帧内预测模式。
  23. 根据权利要求17所述的方法,其中,所述若i大于等于0且小于L,则将所述MPM列表中的第(i+1)个角度预测模式确定为所述第一帧内预测模式之后,所述方法还包括:
    根据索引值与二元符号串的第二映射关系表确定所述第二模式索引的值j;
    若j大于等于i,则对j进行加1运算;
    若j大于等于0且小于L,则将所述MPM列表中的第(j+1)个角度预测模式确定为所述第二帧内预测模式;
    若j大于等于L,则利用所述预设角度预测模式集合和所述MPM列表确定所述第二帧内预测模式。
  24. 根据权利要2所述的方法,其中,所述确定当前块的权重矩阵,包括:
    根据所述权重矩阵导出模式确定所述当前块的权重矩阵。
  25. 根据权利要求24所述的方法,其中,所述基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值,包括:
    根据所述第一帧内预测模式确定所述当前块的第一预测值;根据所述第二帧内预测模式确定所述当前块的第二预测值;
    利用所述权重矩阵对所述第一预测值和所述第二预测值进行加权运算,获得所述当前块的预测值。
  26. 根据权利要求11所述的方法,其中,所述L等于4。
  27. 根据权利要求11所述的方法,其中,所述第二候选模式为L个不同的帧内角度预测模式。
  28. 根据权利要求4所述的方法,其中,所述预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式。
  29. 根据权利要求4所述的方法,其中,所述第一帧内预测模式和所述第二帧内预测模式分别为所述预设角度预测模式集合中的两个不同的帧内角度预测模式。
  30. 根据权利要求1所述的方法,其中,所述方法还包括:
    所述MPM列表中的预测模式均为帧内角度预测模式。
  31. 根据权利要求1所述的方法,其中,所述方法还包括:
    确定所述当前块的尺寸参数;
    根据所述尺寸参数确定所述当前块是否使用所述IWCP模式。
  32. 根据权利要求31所述的方法,其中,所述尺寸参数包括宽度和高度;所述方法还包括:
    若所述宽度和所述高度均大于等于第一下限值,且所述宽度和所述高度均小于等于第一上限值,则确定所述当前块使用所述IWCP模式。
  33. 根据权利要求1所述的方法,其中,所述方法还包括:
    对比特标志为0的二元符号串使用上下文模型进行解码,对比特标志不为0的二元符号串不使用上下文模型进行解码。
  34. 根据权利要求1所述的方法,其中,所述方法还包括:
    若所述帧内预测模式参数指示所述当前块使用IWCP模式,则不解码衍生模式DT、帧内预测滤波IPF、改进型帧内预测IIP的标志信息。
  35. 根据权利要求1所述的方法,其中,所述方法还包括:
    对于YUV4:2:0格式,若所述当前块为亮度的8×8的块,则确定所述当前块使用所述IWCP模式;若所述当前块为色度的4×4的块,则确定所述当前块不使用所述IWCP模式。
  36. 一种帧内预测方法,应用于编码器,所述方法包括:
    当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
    构建所述当前块的MPM列表;
    根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
    将所述第一模式索引和所述第二模式索引写入码流。
  37. 根据权利要求36所述的方法,其中,所述方法还包括:
    确定所述当前块的权重矩阵导出模式。
  38. 根据权利要求37所述的方法,其中,所述构建所述当前块的MPM列表,包括:
    基于所述当前块的相邻块的预测模式和所述权重矩阵导出模式,构建所述MPM列表。
  39. 根据权利要求37所述的方法,其中,所述构建所述当前块的MPM列表,包括:
    基于所述当前块的相邻块的预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表。
  40. 根据权利要求39所述的方法,其中,所述基于所述当前块的相邻块的帧内预测模式、预设角度预测模式集合以及所述权重矩阵导出模式,构建所述MPM列表,包括:
    利用所述相邻块的预测模式确定第一候选模式;
    利用所述权重矩阵导出模式确定第二候选模式;
    根据所述第一候选模式、所述第二候选模式以及所述预设角度预测模式集合,构建所述MPM列表。
  41. 根据权利要求40所述的方法,其中,所述利用所述相邻块的预测模式确定第一候选模式,包括:
    若所述相邻块为普通帧内预测块,且所述相邻块的预测模式为帧内预测模式,则将所述相邻块的预测模式确定为第一候选模式。
  42. 根据权利要求40所述的方法,其中,所述利用所述权重矩阵导出模式确定第二候选模式,包括:
    根据所述权重矩阵导出模式确定分界线角度索引值;
    利用所述分界线角度索引值确定所述第二候选模式。
  43. 根据权利要求40所述的方法,其中,所述根据所述第一候选模式、所述第二候选模式以及所述预设角度预测模式集合,构建所述MPM列表,包括:
    基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式;
    根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表。
  44. 根据权利要求43所述的方法,其中,所述基于所述预设角度预测模式集合对所述第一候选模式进行筛选处理,获得筛选后候选模式,包括:
    若所述第一候选模式属于所述预设角度预测模式集合,则将所述第一候选模式确定为所述筛选后候选模式;
    若所述第一候选模式为帧内角度预测模式且不属于所述预设角度预测模式集合,则在所述预设角度预测模式集合中确定所述第一候选模式的替换模式,并将所述替换模式确定为所述筛选后候选模式。
  45. 根据权利要求43所述的方法,其中,所述方法还包括:
    若所述第一候选模式不为帧内角度预测模式,则删除所述第一候选模式。
  46. 根据权利要求43所述的方法,其中,所述根据所述筛选后候选模式和所述第二候选模式,构建所述MPM列表,包括:
    若所述筛选后候选模式满足预设添加条件,则将所述筛选后候选模式添加至所述MPM列表;
    若所述MPM列表不满足预设列表长度L,且所述第二候选模式满足所述预设添加条件,则将所述第二候选模式添加至所述MPM列表;其中,L为大于等于1的整数。
  47. 根据权利要求46所述的方法,其中,所述方法还包括:
    若所述筛选后候选模式与所述MPM列表中的预测模式均不相同,则确定所述筛选后候选模式满足所述预设添加条件;
    若所述第二候选模式与所述MPM列表中的预测模式均不相同,则确定所述第二候选模式满足所述预设添加条件。
  48. 根据权利要求46所述的方法,其中,所述方法还包括:
    确定所述相邻块对应的顺序参数;
    按照所述顺序参数,依次将所述筛选后候选模式添加至所述MPM列表。
  49. 根据权利要求46所述的方法,其中,所述方法还包括:
    按照模式号由小到大的顺序对所述MPM列表中的预测模式进行排序处理。
  50. 根据权利要求49所述的方法,其中,所述方法还包括:
    确定索引值与二元符号串的第一映射关系表;其中,所述第一映射关系表中分别包括第一长度、第二长度以及第三长度的二元符号串。
  51. 根据权利要求50所述的方法,其中,所述方法还包括:
    所述MPM列表中的预测模式使用所述第一长度的二元符号串;
    所述预设角度预测模式集合中、所述MPM列表以外的其他预测模式使用所述第二长度的二元符号串和所述第三长度的二元符号串。
  52. 根据权利要求51所述的方法,其中,所述根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引,包括:
    若所述第一帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第一模式索引的值i进行赋值;其中,m为大于等于0且小于L的整数;
    若所述第一帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第一模式索引的值i;
    根据所述第一映射关系表和i确定所述第一模式索引。
  53. 根据权利要求52所述的方法,其中,所述利用所述MPM列表确定所述第一模式索引的值i,包括:
    若所述第一帧内预测模式的模式号大于等于所述MPM列表中的第四个模式的模式号,则按照所述所述第一帧内预测模式的模式号与4的差值对i进行赋值;
    若所述第一帧内预测模式的模式号小于所述MPM列表中的第四个模式的模式号,且大于等于所述MPM列表中的第三个模式的模式号,则按照所述所述第一帧内预测模式的模式号与3的差值对i进行赋值;
    若所述第一帧内预测模式的模式号小于所述MPM列表中的第三个模式的模式号,且大于等于所述MPM列表中的第二个模式的模式号,则按照所述所述第一帧内预测模式的模式号与2的差值对i进行赋值;
    若所述第一帧内预测模式的模式号小于所述MPM列表中的第二个模式的模式号,且大于等于所述MPM列表中的第一个模式的模式号,则按照所述所述第一帧内预测模式的模式号与1的差值对i进行赋值;
    若所述第一帧内预测模式的模式号小于所述MPM列表中的第一个模式的模式号,则按照所述所述第一帧内预测模式的模式号对i进行赋值。
  54. 根据权利要求52所述的方法,其中,所述根据所述第一映射关系表和i确定所述第一模式索引,包括:
    按照所述第一映射关系表对i进行二值化处理,确定所述第一模式索引。
  55. 根据权利要求51所述的方法,其中,所述根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引,包括:
    若所述第二帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第二模式索引的值j进行赋值;其中,m为大于等于0且小于L的整数;
    若所述第二帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第二模式索引的值j;
    根据所述第一映射关系表和j确定所述第二模式索引。
  56. 根据权利要求55所述的方法,其中,所述利用所述MPM列表确定所述第二模式索引的值j,包括:
    若所述第二帧内预测模式的模式号大于等于所述MPM列表中的第四个模式的模式号,则按照所述所述第二帧内预测模式的模式号与4的差值对j进行赋值;
    若所述第二帧内预测模式的模式号小于所述MPM列表中的第四个模式的模式号,且大于等于所述MPM列表中的第三个模式的模式号,则按照所述所述第二帧内预测模式的模式号与3的差值对j进行赋值;
    若所述第二帧内预测模式的模式号小于所述MPM列表中的第三个模式的模式号,且大于等于所述MPM列表中的第二个模式的模式号,则按照所述所述第二帧内预测模式的模式号与2的差值对j进行赋值;
    若所述第二帧内预测模式的模式号小于所述MPM列表中的第二个模式的模式号,且大于等于所述MPM列表中的第一个模式的模式号,则按照所述所述第二帧内预测模式的模式号与1的差值对j进行赋值;
    若所述第二帧内预测模式的模式号小于所述MPM列表中的第一个模式的模式号,则按照所述所述第二帧内预测模式的模式号对j进行赋值。
  57. 根据权利要求55所述的方法,其中,所述根据所述第一映射关系表和j确定所述第二模式索引,包括:
    按照所述第一映射关系表对j进行二值化处理,确定所述第二模式索引。
  58. 根据权利要求52所述的方法,其中,所述根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引,包括:
    若所述第二帧内预测模式的模式号与所述MPM列表中的第m个模式的模式号相同,则按照m对所述第二模式索引的值j进行赋值;其中,m为大于等于0且小于L的整数;
    若所述第二帧内预测模式的模式号与所述MPM列表中的任一个模式的模式号均不同,则利用所述MPM列表确定所述第二模式索引的值j;
    根据所述第一映射关系表、索引值与二元符号串的第二映射关系表以及j确定所述第二模式索引。
  59. 根据权利要求58所述的方法,其中,所述根据所述第一映射关系表、索引值与二元符号串的第二映射关系表以及j确定所述第二模式索引,包括:
    若i小于L且小于j,则在对j进行减1运算后,根据所述第二映射关系表对j进行二值化处理,确定所述第二模式索引;
    若j大于等于L,则根据所述第一映射关系表对j进行二值化处理,确定所述第二模式索引。
  60. 根据权利要37所述的方法,其中,所述确定当前块的权重矩阵,包括:
    根据所述权重矩阵导出模式确定所述当前块的权重矩阵。
  61. 根据权利要求60所述的方法,其中,所述方法还包括:
    根据所述第一帧内预测模式确定所述当前块的第一预测值;根据所述第二帧内预测模式确定所述当前块的第二预测值;
    利用所述权重矩阵对所述第一预测值和所述第二预测值进行加权运算,获得所述当前块的预测值。
  62. 根据权利要求46所述的方法,其中,所述L等于4。
  63. 根据权利要求46所述的方法,其中,所述第二候选模式为L个不同的帧内角度预测模式。
  64. 根据权利要求39所述的方法,其中,所述预设角度预测模式集合包括模式号为4-31的28个帧内角度预测模式。
  65. 根据权利要求39所述的方法,其中,所述第一帧内预测模式和所述第二帧内预测模式分别为所述预设角度预测模式集合中的两个不同的帧内角度预测模式。
  66. 根据权利要求36所述的方法,其中,所述方法还包括:
    所述MPM列表中的预测模式均为帧内角度预测模式。
  67. 根据权利要求36所述的方法,其中,所述方法还包括:
    确定所述当前块的尺寸参数;
    根据所述尺寸参数确定所述当前块是否使用所述IWCP模式。
  68. 根据权利要求67所述的方法,其中,所述尺寸参数包括宽度和高度;所述方法还包括:
    若所述宽度和所述高度均大于等于第一下限值,且所述宽度和所述高度均小于等于第一上限值,则确定所述当前块使用所述IWCP模式。
  69. 根据权利要求36所述的方法,其中,所述方法还包括:
    确定所述当前块的帧内预测模式参数;其中,所述帧内预测模式参数用于判断所述当前块是否使用所述IWCP模式;
    将所述镇内预测模式参数写入所述码流。
  70. 根据权利要求36所述的方法,其中,所述方法还包括:
    对比特标志为0的二元符号串使用上下文模型进行编码,对比特标志不为0的二元符号串不使用上下文模型进行编码。
  71. 根据权利要求36所述的方法,其中,所述方法还包括:
    对于YUV4:2:0格式,若所述当前块为亮度的8×8的块,则确定所述当前块使用所述IWCP模式;若所述当前块为色度的4×4的块,则确定所述当前块不使用所述IWCP模式。
  72. 一种编码器,所述编码器包括:第一确定部分,第一构建部分,编码部分,
    所述第一确定部分,配置为当当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;
    所述第一构建部分,配置为构建所述当前块的MPM列表;
    所述第一确定部分,还配置为根据所述第一帧内预测模式、所述第二帧内预测模式以及所述MPM列表确定所述当前块的第一模式索引和第二模式索引;
    所述编码部分,配置为将所述第一模式索引和所述第二模式索引写入码流。
  73. 一种编码器,所述解码器包括第一处理器、存储有所述第一处理器可执行指令的第一存储器,当所述指令被执行时,所述第一处理器执行时实现如权利要求1-35任一项所述的方法。
  74. 一种解码器,所述解码器包括:解码部分,第二确定部分,第二构建部分,
    所述解码部分,配置为解码码流;
    所述第二确定部分,配置为确定当前块的帧内预测模式参数;当所述帧内预测模式参数指示所述当前块使用IWCP模式确定所述当前块的帧内预测值时,确定所述当前块的第一模式索引和第二模式索引;
    第二构建部分,配置为构建所述当前块的最可能模式MPM列表;
    所述第二确定部分,还配置为根据所述第一模式索引、所述第二模式索引以及所述MPM列表确定所述当前块的 第一帧内预测模式和第二帧内预测模式;其中,所述第一帧内预测模式和所述第二帧内预测模式为两个不同的帧内角度预测模式;确定当前块的权重矩阵,并基于所述第一帧内预测模式、所述第二帧内预测模式以及所述权重矩阵,确定所述当前块的预测值。
  75. 一种解码器,所述编码器包括第二处理器、存储有所述第二处理器可执行指令的第二存储器,当所述指令被执行时,所述第二处理器执行时实现如权利要求36-71任一项所述的方法。
  76. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1-35任一项所述的方法,或者,被第二处理器执行时实现如权利要求36-71任一项所述的方法。
PCT/CN2021/077324 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质 WO2022174467A1 (zh)

Priority Applications (8)

Application Number Priority Date Filing Date Title
PCT/CN2021/077324 WO2022174467A1 (zh) 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质
EP21926184.9A EP4297406A1 (en) 2021-02-22 2021-02-22 Intra-frame prediction method, coder, decoder and storage medium
CN202311667837.7A CN117676133A (zh) 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质
JP2023549679A JP2024511272A (ja) 2021-02-22 2021-02-22 イントラ予測方法、符号器、復号器及び記憶媒体
KR1020237031641A KR20230147149A (ko) 2021-02-22 2021-02-22 인트라 예측 방법, 인코더, 디코더 및 저장 매체
MX2023009740A MX2023009740A (es) 2021-02-22 2021-02-22 Metodo de prediccion intra, codificador, decodificador y medio de almacenamiento.
CN202180092098.6A CN116830584A (zh) 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质
US18/450,377 US20230403392A1 (en) 2021-02-22 2023-08-15 Intra prediction method and decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/077324 WO2022174467A1 (zh) 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/450,377 Continuation US20230403392A1 (en) 2021-02-22 2023-08-15 Intra prediction method and decoder

Publications (1)

Publication Number Publication Date
WO2022174467A1 true WO2022174467A1 (zh) 2022-08-25

Family

ID=82931976

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077324 WO2022174467A1 (zh) 2021-02-22 2021-02-22 帧内预测方法、编码器、解码器以及存储介质

Country Status (7)

Country Link
US (1) US20230403392A1 (zh)
EP (1) EP4297406A1 (zh)
JP (1) JP2024511272A (zh)
KR (1) KR20230147149A (zh)
CN (2) CN117676133A (zh)
MX (1) MX2023009740A (zh)
WO (1) WO2022174467A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9609343B1 (en) * 2013-12-20 2017-03-28 Google Inc. Video coding using compound prediction
CN111373750A (zh) * 2017-10-24 2020-07-03 韦勒斯标准与技术协会公司 视频信号处理方法和装置
CN111937390A (zh) * 2018-09-14 2020-11-13 腾讯美国有限责任公司 用于实现针对多行帧内预测的mpm列表生成的方法和装置
CN112385234A (zh) * 2018-10-09 2021-02-19 华为技术有限公司 图像和视频译码的设备和方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9609343B1 (en) * 2013-12-20 2017-03-28 Google Inc. Video coding using compound prediction
CN111373750A (zh) * 2017-10-24 2020-07-03 韦勒斯标准与技术协会公司 视频信号处理方法和装置
CN111937390A (zh) * 2018-09-14 2020-11-13 腾讯美国有限责任公司 用于实现针对多行帧内预测的mpm列表生成的方法和装置
CN112385234A (zh) * 2018-10-09 2021-02-19 华为技术有限公司 图像和视频译码的设备和方法

Also Published As

Publication number Publication date
US20230403392A1 (en) 2023-12-14
EP4297406A1 (en) 2023-12-27
KR20230147149A (ko) 2023-10-20
CN117676133A (zh) 2024-03-08
CN116830584A (zh) 2023-09-29
JP2024511272A (ja) 2024-03-13
MX2023009740A (es) 2023-08-30

Similar Documents

Publication Publication Date Title
WO2020253831A1 (zh) 一种编解码方法、装置及存储介质
CA3029038C (en) Enhanced intra-prediction coding using planar representations
TW202029765A (zh) 用於編碼或解碼轉換塊的方法與裝置
US10284841B2 (en) Method for encoding/decoding an intra-picture prediction mode using two intra-prediction mode candidate, and apparatus using such a method
WO2022117089A1 (zh) 预测方法、编码器、解码器以及存储介质
KR20130045150A (ko) 영상 복호화 방법 및 장치
CN113766247B (zh) 环路滤波的方法与装置
US11706449B2 (en) Method and device for intra-prediction
WO2021203924A1 (zh) 编码方法、解码方法、编码器、解码器以及存储介质
CN116668695B (zh) 用于视频编码的方法、计算设备和存储介质
JP7286783B2 (ja) 符号化方法、復号化方法、デコーダ、エンコーダー及び記憶媒体
WO2022116113A1 (zh) 一种帧内预测方法、装置及解码器和编码器
KR20210133978A (ko) 비디오 코딩을 위한 잔차 코딩에서의 정규 빈들의 유연한 할당
WO2022174467A1 (zh) 帧内预测方法、编码器、解码器以及存储介质
WO2022140905A1 (zh) 预测方法、编码器、解码器以及存储介质
WO2022188114A1 (zh) 帧内预测方法、编码器、解码器以及存储介质
CN112262573B (zh) 帧内预测装置、编码装置、解码装置、以及方法
AU2018201830B2 (en) Enhanced intra-prediction coding using planar representations
KR101622122B1 (ko) 개선된 양자화 정보 표현 조건에 의한 동영상 압축율 향상방법

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: 21926184

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180092098.6

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 2023549679

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: MX/A/2023/009740

Country of ref document: MX

ENP Entry into the national phase

Ref document number: 20237031641

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 1020237031641

Country of ref document: KR

WWE Wipo information: entry into national phase

Ref document number: 2021926184

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021926184

Country of ref document: EP

Effective date: 20230922